Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
13c6b36
bump to polkadot-sdk-stable2412-5 + bump frontier rev
l0r1s May 30, 2025
cf8bc0f
fix ambiguous types
l0r1s May 30, 2025
631d098
fix dispatch_info.weight to .call_weight
l0r1s May 30, 2025
aedad2e
refactor imports and fix hash conversion in subnet registration
l0r1s May 30, 2025
b389891
bump polkadot sdk to stable2412-6 and frontier
l0r1s Jun 6, 2025
7d634e6
fix transaction pool from frontier types
l0r1s Jun 6, 2025
1a16adc
bump frontier commit hash
l0r1s Jun 6, 2025
6489d6a
bump frame-metadata version
l0r1s Jun 9, 2025
c91f4b0
fix weight field renaming
l0r1s Jun 9, 2025
828660c
fix benchmark tx extension conversion
l0r1s Jun 9, 2025
3b4c7cf
fix benchmark command new api params
l0r1s Jun 9, 2025
e9cf480
start converting from signed extension to transaction extension
l0r1s Jun 9, 2025
3db4813
cargo clippy
l0r1s Jun 9, 2025
1406f5e
cargo fmt
l0r1s Jun 9, 2025
6fd5cb4
Merge branch 'devnet-ready' into feat/upgrade-polkadot-sdk-to-2412
l0r1s Jun 10, 2025
0906bdb
bump frontier hash to master
l0r1s Jun 10, 2025
c277b5c
fix compilation
open-junius Jun 10, 2025
75f419c
fix unused imports
l0r1s Jun 10, 2025
468d102
convert subtensor signed ext to tx ext
l0r1s Jun 11, 2025
21c31bc
addd comment
l0r1s Jun 11, 2025
26fbbef
fix deprecated macro for runtime str
l0r1s Jun 11, 2025
220742f
fix tests
l0r1s Jun 11, 2025
34741c0
remove unused CommitmentsSignedExtension
l0r1s Jun 11, 2025
192e871
update check_nonce tx extension
l0r1s Jun 11, 2025
fba3eac
commit Cargo.lock
l0r1s Jun 11, 2025
64e9571
commit Cargo.lock
l0r1s Jun 11, 2025
9d88033
commit Cargo.lock
l0r1s Jun 11, 2025
c3c2baa
cargo fmt
l0r1s Jun 11, 2025
f048f13
commit Cargo.lock
l0r1s Jun 11, 2025
053c267
commit Cargo.lock
l0r1s Jun 11, 2025
4eb2946
commit Cargo.lock
l0r1s Jun 11, 2025
20c9dab
commit Cargo.lock
l0r1s Jun 11, 2025
07787d6
commit Cargo.lock
l0r1s Jun 11, 2025
b2dc9b0
commit Cargo.lock
l0r1s Jun 11, 2025
f9512f8
commit Cargo.lock
l0r1s Jun 11, 2025
1501629
cargo fmt
l0r1s Jun 11, 2025
e15ee92
commit Cargo.lock
l0r1s Jun 11, 2025
b9efc5a
cargo clippy
l0r1s Jun 11, 2025
b158e64
commit Cargo.lock
l0r1s Jun 11, 2025
308aeff
commit Cargo.lock
l0r1s Jun 11, 2025
3049a4d
Merge branch 'devnet-ready' into feat/upgrade-polkadot-sdk-to-2412
l0r1s Jun 11, 2025
4420885
fix runtime integrity test for admin-utils
l0r1s Jun 11, 2025
def7f18
Merge branch 'devnet-ready' into feat/upgrade-polkadot-sdk-to-2412
l0r1s Jun 11, 2025
c878ee5
Merge branch 'devnet-ready' into feat/upgrade-polkadot-sdk-to-2412
l0r1s Jun 12, 2025
91d80b1
fix zepter
l0r1s Jun 12, 2025
fee8b2a
add new host function
JohnReedV Jun 12, 2025
e929d6a
update weight
JohnReedV Jun 12, 2025
e9762ef
fix admin utils benchmarks
l0r1s Jun 12, 2025
984ea2c
update commitments weight
JohnReedV Jun 12, 2025
e0e5a7a
avoid keep running after node exit
open-junius Jun 13, 2025
8090503
Merge branch 'devnet-ready' into feat/upgrade-polkadot-sdk-to-2412
l0r1s Jun 16, 2025
ba9b1f5
fix network backend type selection
l0r1s Jun 16, 2025
4dac3c6
bump spec version
l0r1s Jun 16, 2025
56bcd39
Merge branch 'devnet-ready' into feat/upgrade-polkadot-sdk-to-2412
l0r1s Jun 17, 2025
8be6b0e
update benchmark weight
l0r1s Jun 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4,412 changes: 3,236 additions & 1,176 deletions Cargo.lock

Large diffs are not rendered by default.

205 changes: 103 additions & 102 deletions Cargo.toml

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions evm-tests/run-ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ if [ "$i" -eq 1000 ]; then
exit 1
fi

sleep 5

if ! nc -z localhost 9944; then
echo "node subtensor exit, port not available"
exit 1
fi

cd evm-tests

# required for papi in get-metadata.sh, but we cannot run yarn before papi as it adds the descriptors to the package.json which won't resolve
Expand Down
2 changes: 2 additions & 0 deletions node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ pallet-commitments = { path = "../pallets/commitments" }
pallet-drand = { workspace = true }
sp-crypto-ec-utils = { workspace = true }
sp-keystore = { workspace = true, default-features = false }
cumulus-primitives-proof-size-hostfunction = { workspace = true, default-features = false }


# These dependencies are used for the subtensor's RPCs
Expand Down Expand Up @@ -136,6 +137,7 @@ runtime-benchmarks = [
"sp-runtime/runtime-benchmarks",
"pallet-commitments/runtime-benchmarks",
"pallet-drand/runtime-benchmarks",
"pallet-transaction-payment/runtime-benchmarks",
]
pow-faucet = []

Expand Down
6 changes: 2 additions & 4 deletions node/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ pub fn create_benchmark_extrinsic(
.checked_next_power_of_two()
.map(|c| c / 2)
.unwrap_or(2) as u64;
let extra: runtime::SignedExtra = (
let extra: runtime::TransactionExtensions = (
frame_system::CheckNonZeroSender::<runtime::Runtime>::new(),
frame_system::CheckSpecVersion::<runtime::Runtime>::new(),
frame_system::CheckTxVersion::<runtime::Runtime>::new(),
Expand All @@ -135,8 +135,7 @@ pub fn create_benchmark_extrinsic(
check_nonce::CheckNonce::<runtime::Runtime>::from(nonce),
frame_system::CheckWeight::<runtime::Runtime>::new(),
pallet_transaction_payment::ChargeTransactionPayment::<runtime::Runtime>::from(0),
pallet_subtensor::SubtensorSignedExtension::<runtime::Runtime>::new(),
pallet_commitments::CommitmentsSignedExtension::<runtime::Runtime>::new(),
pallet_subtensor::SubtensorTransactionExtension::<runtime::Runtime>::new(),
frame_metadata_hash_extension::CheckMetadataHash::<runtime::Runtime>::new(true),
);

Expand All @@ -153,7 +152,6 @@ pub fn create_benchmark_extrinsic(
(),
(),
(),
(),
None,
),
);
Expand Down
2 changes: 2 additions & 0 deletions node/src/client.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use cumulus_primitives_proof_size_hostfunction::storage_proof_size::HostFunctions as ProofSize;
use node_subtensor_runtime::{RuntimeApi, opaque::Block};
use sc_executor::WasmExecutor;

Expand All @@ -14,5 +15,6 @@ pub type HostFunctions = (
sp_io::SubstrateHostFunctions,
frame_benchmarking::benchmarking::HostFunctions,
sp_crypto_ec_utils::bls12_381::host_calls::HostFunctions,
ProofSize,
);
pub type RuntimeExecutor = WasmExecutor<HostFunctions>;
3 changes: 2 additions & 1 deletion node/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,11 +196,12 @@ pub fn run() -> sc_cli::Result<()> {
let ext_builder = RemarkBuilder::new(client.clone());

cmd.run(
config,
config.chain_spec.name().into(),
client,
inherent_benchmark_data()?,
Vec::new(),
&ext_builder,
false,
)
}
BenchmarkCmd::Extrinsic(cmd) => {
Expand Down
108 changes: 71 additions & 37 deletions node/src/ethereum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@ use sc_client_api::client::BlockchainEvents;
use sc_network_sync::SyncingService;
use sc_rpc::SubscriptionTaskExecutor;
use sc_service::{Configuration, TaskManager, error::Error as ServiceError};
use sc_transaction_pool::ChainApi;
use sc_transaction_pool_api::TransactionPool;
use sp_inherents::CreateInherentDataProviders;
use sp_runtime::traits::Block as BlockT;
use sp_runtime::{OpaqueExtrinsic, traits::BlakeTwo256, traits::Block as BlockT};
use std::path::PathBuf;
use std::time::Duration;
use std::{
Expand Down Expand Up @@ -196,13 +195,18 @@ pub async fn spawn_frontier_tasks(
);
}

fn extend_rpc_aet_api<P, A, CT, CIDP, EC>(
fn extend_rpc_aet_api<P, CT, CIDP, EC>(
io: &mut RpcModule<()>,
deps: &EthDeps<P, A, CT, CIDP>,
deps: &EthDeps<P, CT, CIDP>,
) -> Result<(), Box<dyn std::error::Error + Send + Sync>>
where
P: TransactionPool<Block = Block> + 'static,
A: ChainApi<Block = Block> + 'static,
P: TransactionPool<
Block = Block,
Hash = <sp_runtime::generic::Block<
sp_runtime::generic::Header<u32, BlakeTwo256>,
OpaqueExtrinsic,
> as BlockT>::Hash,
> + 'static,
CT: ConvertTransaction<<Block as BlockT>::Extrinsic> + Send + Sync + Clone + 'static,
CIDP: CreateInherentDataProviders<Block, ()> + Send + Clone + 'static,
EC: EthConfig<Block, FullClient>,
Expand All @@ -213,7 +217,7 @@ where
}

io.merge(
Eth::<Block, FullClient, P, CT, FullBackend, A, CIDP, EC>::new(
Eth::<Block, FullClient, P, CT, FullBackend, CIDP, EC>::new(
deps.client.clone(),
deps.pool.clone(),
deps.graph.clone(),
Expand All @@ -239,13 +243,18 @@ where
Ok(())
}

fn extend_rpc_eth_filter<P, A, CT, CIDP>(
fn extend_rpc_eth_filter<P, CT, CIDP>(
io: &mut RpcModule<()>,
deps: &EthDeps<P, A, CT, CIDP>,
deps: &EthDeps<P, CT, CIDP>,
) -> Result<(), Box<dyn std::error::Error + Send + Sync>>
where
P: TransactionPool<Block = Block> + 'static,
A: ChainApi<Block = Block> + 'static,
P: TransactionPool<
Block = Block,
Hash = <sp_runtime::generic::Block<
sp_runtime::generic::Header<u32, BlakeTwo256>,
OpaqueExtrinsic,
> as BlockT>::Hash,
> + 'static,
CT: ConvertTransaction<<Block as BlockT>::Extrinsic> + Send + Sync + Clone + 'static,
CIDP: CreateInherentDataProviders<Block, ()> + Send + Clone + 'static,
{
Expand All @@ -267,9 +276,9 @@ where
}

// Function for EthPubSub merge
fn extend_rpc_eth_pubsub<P, A, CT, CIDP>(
fn extend_rpc_eth_pubsub<P, CT, CIDP>(
io: &mut RpcModule<()>,
deps: &EthDeps<P, A, CT, CIDP>,
deps: &EthDeps<P, CT, CIDP>,
subscription_task_executor: SubscriptionTaskExecutor,
pubsub_notification_sinks: Arc<
fc_mapping_sync::EthereumBlockNotificationSinks<
Expand All @@ -278,8 +287,13 @@ fn extend_rpc_eth_pubsub<P, A, CT, CIDP>(
>,
) -> Result<(), Box<dyn std::error::Error + Send + Sync>>
where
P: TransactionPool<Block = Block> + 'static,
A: ChainApi<Block = Block> + 'static,
P: TransactionPool<
Block = Block,
Hash = <sp_runtime::generic::Block<
sp_runtime::generic::Header<u32, BlakeTwo256>,
OpaqueExtrinsic,
> as BlockT>::Hash,
> + 'static,
CT: ConvertTransaction<<Block as BlockT>::Extrinsic> + Send + Sync + 'static,
CIDP: CreateInherentDataProviders<Block, ()> + Send + 'static,
{
Expand All @@ -297,13 +311,18 @@ where
Ok(())
}

fn extend_rpc_net<P, A, CT, CIDP>(
fn extend_rpc_net<P, CT, CIDP>(
io: &mut RpcModule<()>,
deps: &EthDeps<P, A, CT, CIDP>,
deps: &EthDeps<P, CT, CIDP>,
) -> Result<(), Box<dyn std::error::Error + Send + Sync>>
where
P: TransactionPool<Block = Block> + 'static,
A: ChainApi<Block = Block> + 'static,
P: TransactionPool<
Block = Block,
Hash = <sp_runtime::generic::Block<
sp_runtime::generic::Header<u32, BlakeTwo256>,
OpaqueExtrinsic,
> as BlockT>::Hash,
> + 'static,
CT: ConvertTransaction<<Block as BlockT>::Extrinsic> + Send + Sync + 'static,
CIDP: CreateInherentDataProviders<Block, ()> + Send + 'static,
{
Expand All @@ -318,27 +337,37 @@ where
Ok(())
}

fn extend_rpc_web3<P, A, CT, CIDP>(
fn extend_rpc_web3<P, CT, CIDP>(
io: &mut RpcModule<()>,
deps: &EthDeps<P, A, CT, CIDP>,
deps: &EthDeps<P, CT, CIDP>,
) -> Result<(), Box<dyn std::error::Error + Send + Sync>>
where
P: TransactionPool<Block = Block> + 'static,
A: ChainApi<Block = Block> + 'static,
P: TransactionPool<
Block = Block,
Hash = <sp_runtime::generic::Block<
sp_runtime::generic::Header<u32, BlakeTwo256>,
OpaqueExtrinsic,
> as BlockT>::Hash,
> + 'static,
CT: ConvertTransaction<<Block as BlockT>::Extrinsic> + Send + Sync + 'static,
CIDP: CreateInherentDataProviders<Block, ()> + Send + 'static,
{
io.merge(Web3::new(deps.client.clone()).into_rpc())?;
Ok(())
}

fn extend_rpc_debug<P, A, CT, CIDP>(
fn extend_rpc_debug<P, CT, CIDP>(
io: &mut RpcModule<()>,
deps: &EthDeps<P, A, CT, CIDP>,
deps: &EthDeps<P, CT, CIDP>,
) -> Result<(), Box<dyn std::error::Error + Send + Sync>>
where
P: TransactionPool<Block = Block> + 'static,
A: ChainApi<Block = Block> + 'static,
P: TransactionPool<
Block = Block,
Hash = <sp_runtime::generic::Block<
sp_runtime::generic::Header<u32, BlakeTwo256>,
OpaqueExtrinsic,
> as BlockT>::Hash,
> + 'static,
CT: ConvertTransaction<<Block as BlockT>::Extrinsic> + Send + Sync + 'static,
CIDP: CreateInherentDataProviders<Block, ()> + Send + 'static,
{
Expand All @@ -355,9 +384,9 @@ where
}

/// Extend RpcModule with Eth RPCs
pub fn create_eth<P, A, CT, CIDP, EC>(
pub fn create_eth<P, CT, CIDP, EC>(
mut io: RpcModule<()>,
deps: EthDeps<P, A, CT, CIDP>,
deps: EthDeps<P, CT, CIDP>,
subscription_task_executor: SubscriptionTaskExecutor,
pubsub_notification_sinks: Arc<
fc_mapping_sync::EthereumBlockNotificationSinks<
Expand All @@ -366,23 +395,28 @@ pub fn create_eth<P, A, CT, CIDP, EC>(
>,
) -> Result<RpcModule<()>, Box<dyn std::error::Error + Send + Sync>>
where
P: TransactionPool<Block = Block> + 'static,
A: ChainApi<Block = Block> + 'static,
P: TransactionPool<
Block = Block,
Hash = <sp_runtime::generic::Block<
sp_runtime::generic::Header<u32, BlakeTwo256>,
OpaqueExtrinsic,
> as BlockT>::Hash,
> + 'static,
CT: ConvertTransaction<<Block as BlockT>::Extrinsic> + Send + Sync + Clone + 'static,
CIDP: CreateInherentDataProviders<Block, ()> + Send + Clone + 'static,
EC: EthConfig<Block, FullClient>,
{
extend_rpc_aet_api::<P, A, CT, CIDP, EC>(&mut io, &deps)?;
extend_rpc_eth_filter::<P, A, CT, CIDP>(&mut io, &deps)?;
extend_rpc_eth_pubsub::<P, A, CT, CIDP>(
extend_rpc_aet_api::<P, CT, CIDP, EC>(&mut io, &deps)?;
extend_rpc_eth_filter::<P, CT, CIDP>(&mut io, &deps)?;
extend_rpc_eth_pubsub::<P, CT, CIDP>(
&mut io,
&deps,
subscription_task_executor,
pubsub_notification_sinks,
)?;
extend_rpc_net::<P, A, CT, CIDP>(&mut io, &deps)?;
extend_rpc_web3::<P, A, CT, CIDP>(&mut io, &deps)?;
extend_rpc_debug::<P, A, CT, CIDP>(&mut io, &deps)?;
extend_rpc_net::<P, CT, CIDP>(&mut io, &deps)?;
extend_rpc_web3::<P, CT, CIDP>(&mut io, &deps)?;
extend_rpc_debug::<P, CT, CIDP>(&mut io, &deps)?;

Ok(io)
}
26 changes: 15 additions & 11 deletions node/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@ use sc_consensus_manual_seal::EngineCommand;
use sc_network::service::traits::NetworkService;
use sc_network_sync::SyncingService;
use sc_rpc::SubscriptionTaskExecutor;
use sc_transaction_pool::{ChainApi, Pool};
use sc_transaction_pool_api::TransactionPool;
use sp_core::H256;
use sp_inherents::CreateInherentDataProviders;
use sp_runtime::traits::Block as BlockT;
use sp_runtime::{OpaqueExtrinsic, traits::BlakeTwo256, traits::Block as BlockT};
use subtensor_runtime_common::Hash;

use crate::{
Expand All @@ -31,13 +30,13 @@ use crate::{
};

/// Extra dependencies for Ethereum compatibility.
pub struct EthDeps<P, A: ChainApi, CT, CIDP> {
pub struct EthDeps<P, CT, CIDP> {
/// The client instance to use.
pub client: Arc<FullClient>,
/// Transaction pool instance.
pub pool: Arc<P>,
/// Graph pool instance.
pub graph: Arc<Pool<A>>,
pub graph: Arc<P>,
/// Ethereum transaction converter.
pub converter: Option<CT>,
/// The Node authority flag
Expand Down Expand Up @@ -84,20 +83,20 @@ impl fc_rpc::EthConfig<Block, FullClient> for DefaultEthConfig {
}

/// Full client dependencies.
pub struct FullDeps<P, A: ChainApi, CT, CIDP> {
pub struct FullDeps<P, CT, CIDP> {
/// The client instance to use.
pub client: Arc<FullClient>,
/// Transaction pool instance.
pub pool: Arc<P>,
/// Manual seal command sink
pub command_sink: Option<mpsc::Sender<EngineCommand<Hash>>>,
/// Ethereum-compatibility specific dependencies.
pub eth: EthDeps<P, A, CT, CIDP>,
pub eth: EthDeps<P, CT, CIDP>,
}

/// Instantiate all full RPC extensions.
pub fn create_full<P, A, CT, CIDP>(
deps: FullDeps<P, A, CT, CIDP>,
pub fn create_full<P, CT, CIDP>(
deps: FullDeps<P, CT, CIDP>,
subscription_task_executor: SubscriptionTaskExecutor,
pubsub_notification_sinks: Arc<
fc_mapping_sync::EthereumBlockNotificationSinks<
Expand All @@ -106,8 +105,13 @@ pub fn create_full<P, A, CT, CIDP>(
>,
) -> Result<RpcModule<()>, Box<dyn std::error::Error + Send + Sync>>
where
P: TransactionPool<Block = Block> + 'static,
A: ChainApi<Block = Block> + 'static,
P: TransactionPool<
Block = Block,
Hash = <sp_runtime::generic::Block<
sp_runtime::generic::Header<u32, BlakeTwo256>,
OpaqueExtrinsic,
> as BlockT>::Hash,
> + 'static,
CIDP: CreateInherentDataProviders<Block, ()> + Send + Clone + 'static,
CT: fp_rpc::ConvertTransaction<<Block as BlockT>::Extrinsic> + Send + Sync + Clone + 'static,
{
Expand Down Expand Up @@ -144,7 +148,7 @@ where
}

// Ethereum compatibility RPCs
let module = create_eth::<_, _, _, _, DefaultEthConfig>(
let module = create_eth::<_, _, _, DefaultEthConfig>(
module,
eth,
subscription_task_executor,
Expand Down
Loading
Loading