Skip to content

Commit d246964

Browse files
authored
Merge pull request #1723 from opentensor/feat/upgrade-polkadot-sdk-to-2412
Upgrade Polkadot SDK to stable2412-6
2 parents 3db0cb7 + 8be6b0e commit d246964

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+4578
-2226
lines changed

Cargo.lock

Lines changed: 3236 additions & 1176 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 103 additions & 102 deletions
Large diffs are not rendered by default.

evm-tests/run-ci.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ if [ "$i" -eq 1000 ]; then
1919
exit 1
2020
fi
2121

22+
sleep 5
23+
24+
if ! nc -z localhost 9944; then
25+
echo "node subtensor exit, port not available"
26+
exit 1
27+
fi
28+
2229
cd evm-tests
2330

2431
# 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

node/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ pallet-commitments = { path = "../pallets/commitments" }
6767
pallet-drand = { workspace = true }
6868
sp-crypto-ec-utils = { workspace = true }
6969
sp-keystore = { workspace = true, default-features = false }
70+
cumulus-primitives-proof-size-hostfunction = { workspace = true, default-features = false }
7071

7172

7273
# These dependencies are used for the subtensor's RPCs
@@ -136,6 +137,7 @@ runtime-benchmarks = [
136137
"sp-runtime/runtime-benchmarks",
137138
"pallet-commitments/runtime-benchmarks",
138139
"pallet-drand/runtime-benchmarks",
140+
"pallet-transaction-payment/runtime-benchmarks",
139141
]
140142
pow-faucet = []
141143

node/src/benchmarking.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ pub fn create_benchmark_extrinsic(
123123
.checked_next_power_of_two()
124124
.map(|c| c / 2)
125125
.unwrap_or(2) as u64;
126-
let extra: runtime::SignedExtra = (
126+
let extra: runtime::TransactionExtensions = (
127127
frame_system::CheckNonZeroSender::<runtime::Runtime>::new(),
128128
frame_system::CheckSpecVersion::<runtime::Runtime>::new(),
129129
frame_system::CheckTxVersion::<runtime::Runtime>::new(),
@@ -135,8 +135,7 @@ pub fn create_benchmark_extrinsic(
135135
check_nonce::CheckNonce::<runtime::Runtime>::from(nonce),
136136
frame_system::CheckWeight::<runtime::Runtime>::new(),
137137
pallet_transaction_payment::ChargeTransactionPayment::<runtime::Runtime>::from(0),
138-
pallet_subtensor::SubtensorSignedExtension::<runtime::Runtime>::new(),
139-
pallet_commitments::CommitmentsSignedExtension::<runtime::Runtime>::new(),
138+
pallet_subtensor::SubtensorTransactionExtension::<runtime::Runtime>::new(),
140139
frame_metadata_hash_extension::CheckMetadataHash::<runtime::Runtime>::new(true),
141140
);
142141

@@ -153,7 +152,6 @@ pub fn create_benchmark_extrinsic(
153152
(),
154153
(),
155154
(),
156-
(),
157155
None,
158156
),
159157
);

node/src/client.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use cumulus_primitives_proof_size_hostfunction::storage_proof_size::HostFunctions as ProofSize;
12
use node_subtensor_runtime::{RuntimeApi, opaque::Block};
23
use sc_executor::WasmExecutor;
34

@@ -14,5 +15,6 @@ pub type HostFunctions = (
1415
sp_io::SubstrateHostFunctions,
1516
frame_benchmarking::benchmarking::HostFunctions,
1617
sp_crypto_ec_utils::bls12_381::host_calls::HostFunctions,
18+
ProofSize,
1719
);
1820
pub type RuntimeExecutor = WasmExecutor<HostFunctions>;

node/src/command.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,11 +196,12 @@ pub fn run() -> sc_cli::Result<()> {
196196
let ext_builder = RemarkBuilder::new(client.clone());
197197

198198
cmd.run(
199-
config,
199+
config.chain_spec.name().into(),
200200
client,
201201
inherent_benchmark_data()?,
202202
Vec::new(),
203203
&ext_builder,
204+
false,
204205
)
205206
}
206207
BenchmarkCmd::Extrinsic(cmd) => {

node/src/ethereum.rs

Lines changed: 71 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,9 @@ use sc_client_api::client::BlockchainEvents;
1717
use sc_network_sync::SyncingService;
1818
use sc_rpc::SubscriptionTaskExecutor;
1919
use sc_service::{Configuration, TaskManager, error::Error as ServiceError};
20-
use sc_transaction_pool::ChainApi;
2120
use sc_transaction_pool_api::TransactionPool;
2221
use sp_inherents::CreateInherentDataProviders;
23-
use sp_runtime::traits::Block as BlockT;
22+
use sp_runtime::{OpaqueExtrinsic, traits::BlakeTwo256, traits::Block as BlockT};
2423
use std::path::PathBuf;
2524
use std::time::Duration;
2625
use std::{
@@ -196,13 +195,18 @@ pub async fn spawn_frontier_tasks(
196195
);
197196
}
198197

199-
fn extend_rpc_aet_api<P, A, CT, CIDP, EC>(
198+
fn extend_rpc_aet_api<P, CT, CIDP, EC>(
200199
io: &mut RpcModule<()>,
201-
deps: &EthDeps<P, A, CT, CIDP>,
200+
deps: &EthDeps<P, CT, CIDP>,
202201
) -> Result<(), Box<dyn std::error::Error + Send + Sync>>
203202
where
204-
P: TransactionPool<Block = Block> + 'static,
205-
A: ChainApi<Block = Block> + 'static,
203+
P: TransactionPool<
204+
Block = Block,
205+
Hash = <sp_runtime::generic::Block<
206+
sp_runtime::generic::Header<u32, BlakeTwo256>,
207+
OpaqueExtrinsic,
208+
> as BlockT>::Hash,
209+
> + 'static,
206210
CT: ConvertTransaction<<Block as BlockT>::Extrinsic> + Send + Sync + Clone + 'static,
207211
CIDP: CreateInherentDataProviders<Block, ()> + Send + Clone + 'static,
208212
EC: EthConfig<Block, FullClient>,
@@ -213,7 +217,7 @@ where
213217
}
214218

215219
io.merge(
216-
Eth::<Block, FullClient, P, CT, FullBackend, A, CIDP, EC>::new(
220+
Eth::<Block, FullClient, P, CT, FullBackend, CIDP, EC>::new(
217221
deps.client.clone(),
218222
deps.pool.clone(),
219223
deps.graph.clone(),
@@ -239,13 +243,18 @@ where
239243
Ok(())
240244
}
241245

242-
fn extend_rpc_eth_filter<P, A, CT, CIDP>(
246+
fn extend_rpc_eth_filter<P, CT, CIDP>(
243247
io: &mut RpcModule<()>,
244-
deps: &EthDeps<P, A, CT, CIDP>,
248+
deps: &EthDeps<P, CT, CIDP>,
245249
) -> Result<(), Box<dyn std::error::Error + Send + Sync>>
246250
where
247-
P: TransactionPool<Block = Block> + 'static,
248-
A: ChainApi<Block = Block> + 'static,
251+
P: TransactionPool<
252+
Block = Block,
253+
Hash = <sp_runtime::generic::Block<
254+
sp_runtime::generic::Header<u32, BlakeTwo256>,
255+
OpaqueExtrinsic,
256+
> as BlockT>::Hash,
257+
> + 'static,
249258
CT: ConvertTransaction<<Block as BlockT>::Extrinsic> + Send + Sync + Clone + 'static,
250259
CIDP: CreateInherentDataProviders<Block, ()> + Send + Clone + 'static,
251260
{
@@ -267,9 +276,9 @@ where
267276
}
268277

269278
// Function for EthPubSub merge
270-
fn extend_rpc_eth_pubsub<P, A, CT, CIDP>(
279+
fn extend_rpc_eth_pubsub<P, CT, CIDP>(
271280
io: &mut RpcModule<()>,
272-
deps: &EthDeps<P, A, CT, CIDP>,
281+
deps: &EthDeps<P, CT, CIDP>,
273282
subscription_task_executor: SubscriptionTaskExecutor,
274283
pubsub_notification_sinks: Arc<
275284
fc_mapping_sync::EthereumBlockNotificationSinks<
@@ -278,8 +287,13 @@ fn extend_rpc_eth_pubsub<P, A, CT, CIDP>(
278287
>,
279288
) -> Result<(), Box<dyn std::error::Error + Send + Sync>>
280289
where
281-
P: TransactionPool<Block = Block> + 'static,
282-
A: ChainApi<Block = Block> + 'static,
290+
P: TransactionPool<
291+
Block = Block,
292+
Hash = <sp_runtime::generic::Block<
293+
sp_runtime::generic::Header<u32, BlakeTwo256>,
294+
OpaqueExtrinsic,
295+
> as BlockT>::Hash,
296+
> + 'static,
283297
CT: ConvertTransaction<<Block as BlockT>::Extrinsic> + Send + Sync + 'static,
284298
CIDP: CreateInherentDataProviders<Block, ()> + Send + 'static,
285299
{
@@ -297,13 +311,18 @@ where
297311
Ok(())
298312
}
299313

300-
fn extend_rpc_net<P, A, CT, CIDP>(
314+
fn extend_rpc_net<P, CT, CIDP>(
301315
io: &mut RpcModule<()>,
302-
deps: &EthDeps<P, A, CT, CIDP>,
316+
deps: &EthDeps<P, CT, CIDP>,
303317
) -> Result<(), Box<dyn std::error::Error + Send + Sync>>
304318
where
305-
P: TransactionPool<Block = Block> + 'static,
306-
A: ChainApi<Block = Block> + 'static,
319+
P: TransactionPool<
320+
Block = Block,
321+
Hash = <sp_runtime::generic::Block<
322+
sp_runtime::generic::Header<u32, BlakeTwo256>,
323+
OpaqueExtrinsic,
324+
> as BlockT>::Hash,
325+
> + 'static,
307326
CT: ConvertTransaction<<Block as BlockT>::Extrinsic> + Send + Sync + 'static,
308327
CIDP: CreateInherentDataProviders<Block, ()> + Send + 'static,
309328
{
@@ -318,27 +337,37 @@ where
318337
Ok(())
319338
}
320339

321-
fn extend_rpc_web3<P, A, CT, CIDP>(
340+
fn extend_rpc_web3<P, CT, CIDP>(
322341
io: &mut RpcModule<()>,
323-
deps: &EthDeps<P, A, CT, CIDP>,
342+
deps: &EthDeps<P, CT, CIDP>,
324343
) -> Result<(), Box<dyn std::error::Error + Send + Sync>>
325344
where
326-
P: TransactionPool<Block = Block> + 'static,
327-
A: ChainApi<Block = Block> + 'static,
345+
P: TransactionPool<
346+
Block = Block,
347+
Hash = <sp_runtime::generic::Block<
348+
sp_runtime::generic::Header<u32, BlakeTwo256>,
349+
OpaqueExtrinsic,
350+
> as BlockT>::Hash,
351+
> + 'static,
328352
CT: ConvertTransaction<<Block as BlockT>::Extrinsic> + Send + Sync + 'static,
329353
CIDP: CreateInherentDataProviders<Block, ()> + Send + 'static,
330354
{
331355
io.merge(Web3::new(deps.client.clone()).into_rpc())?;
332356
Ok(())
333357
}
334358

335-
fn extend_rpc_debug<P, A, CT, CIDP>(
359+
fn extend_rpc_debug<P, CT, CIDP>(
336360
io: &mut RpcModule<()>,
337-
deps: &EthDeps<P, A, CT, CIDP>,
361+
deps: &EthDeps<P, CT, CIDP>,
338362
) -> Result<(), Box<dyn std::error::Error + Send + Sync>>
339363
where
340-
P: TransactionPool<Block = Block> + 'static,
341-
A: ChainApi<Block = Block> + 'static,
364+
P: TransactionPool<
365+
Block = Block,
366+
Hash = <sp_runtime::generic::Block<
367+
sp_runtime::generic::Header<u32, BlakeTwo256>,
368+
OpaqueExtrinsic,
369+
> as BlockT>::Hash,
370+
> + 'static,
342371
CT: ConvertTransaction<<Block as BlockT>::Extrinsic> + Send + Sync + 'static,
343372
CIDP: CreateInherentDataProviders<Block, ()> + Send + 'static,
344373
{
@@ -355,9 +384,9 @@ where
355384
}
356385

357386
/// Extend RpcModule with Eth RPCs
358-
pub fn create_eth<P, A, CT, CIDP, EC>(
387+
pub fn create_eth<P, CT, CIDP, EC>(
359388
mut io: RpcModule<()>,
360-
deps: EthDeps<P, A, CT, CIDP>,
389+
deps: EthDeps<P, CT, CIDP>,
361390
subscription_task_executor: SubscriptionTaskExecutor,
362391
pubsub_notification_sinks: Arc<
363392
fc_mapping_sync::EthereumBlockNotificationSinks<
@@ -366,23 +395,28 @@ pub fn create_eth<P, A, CT, CIDP, EC>(
366395
>,
367396
) -> Result<RpcModule<()>, Box<dyn std::error::Error + Send + Sync>>
368397
where
369-
P: TransactionPool<Block = Block> + 'static,
370-
A: ChainApi<Block = Block> + 'static,
398+
P: TransactionPool<
399+
Block = Block,
400+
Hash = <sp_runtime::generic::Block<
401+
sp_runtime::generic::Header<u32, BlakeTwo256>,
402+
OpaqueExtrinsic,
403+
> as BlockT>::Hash,
404+
> + 'static,
371405
CT: ConvertTransaction<<Block as BlockT>::Extrinsic> + Send + Sync + Clone + 'static,
372406
CIDP: CreateInherentDataProviders<Block, ()> + Send + Clone + 'static,
373407
EC: EthConfig<Block, FullClient>,
374408
{
375-
extend_rpc_aet_api::<P, A, CT, CIDP, EC>(&mut io, &deps)?;
376-
extend_rpc_eth_filter::<P, A, CT, CIDP>(&mut io, &deps)?;
377-
extend_rpc_eth_pubsub::<P, A, CT, CIDP>(
409+
extend_rpc_aet_api::<P, CT, CIDP, EC>(&mut io, &deps)?;
410+
extend_rpc_eth_filter::<P, CT, CIDP>(&mut io, &deps)?;
411+
extend_rpc_eth_pubsub::<P, CT, CIDP>(
378412
&mut io,
379413
&deps,
380414
subscription_task_executor,
381415
pubsub_notification_sinks,
382416
)?;
383-
extend_rpc_net::<P, A, CT, CIDP>(&mut io, &deps)?;
384-
extend_rpc_web3::<P, A, CT, CIDP>(&mut io, &deps)?;
385-
extend_rpc_debug::<P, A, CT, CIDP>(&mut io, &deps)?;
417+
extend_rpc_net::<P, CT, CIDP>(&mut io, &deps)?;
418+
extend_rpc_web3::<P, CT, CIDP>(&mut io, &deps)?;
419+
extend_rpc_debug::<P, CT, CIDP>(&mut io, &deps)?;
386420

387421
Ok(io)
388422
}

node/src/rpc.rs

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,10 @@ use sc_consensus_manual_seal::EngineCommand;
1818
use sc_network::service::traits::NetworkService;
1919
use sc_network_sync::SyncingService;
2020
use sc_rpc::SubscriptionTaskExecutor;
21-
use sc_transaction_pool::{ChainApi, Pool};
2221
use sc_transaction_pool_api::TransactionPool;
2322
use sp_core::H256;
2423
use sp_inherents::CreateInherentDataProviders;
25-
use sp_runtime::traits::Block as BlockT;
24+
use sp_runtime::{OpaqueExtrinsic, traits::BlakeTwo256, traits::Block as BlockT};
2625
use subtensor_runtime_common::Hash;
2726

2827
use crate::{
@@ -31,13 +30,13 @@ use crate::{
3130
};
3231

3332
/// Extra dependencies for Ethereum compatibility.
34-
pub struct EthDeps<P, A: ChainApi, CT, CIDP> {
33+
pub struct EthDeps<P, CT, CIDP> {
3534
/// The client instance to use.
3635
pub client: Arc<FullClient>,
3736
/// Transaction pool instance.
3837
pub pool: Arc<P>,
3938
/// Graph pool instance.
40-
pub graph: Arc<Pool<A>>,
39+
pub graph: Arc<P>,
4140
/// Ethereum transaction converter.
4241
pub converter: Option<CT>,
4342
/// The Node authority flag
@@ -84,20 +83,20 @@ impl fc_rpc::EthConfig<Block, FullClient> for DefaultEthConfig {
8483
}
8584

8685
/// Full client dependencies.
87-
pub struct FullDeps<P, A: ChainApi, CT, CIDP> {
86+
pub struct FullDeps<P, CT, CIDP> {
8887
/// The client instance to use.
8988
pub client: Arc<FullClient>,
9089
/// Transaction pool instance.
9190
pub pool: Arc<P>,
9291
/// Manual seal command sink
9392
pub command_sink: Option<mpsc::Sender<EngineCommand<Hash>>>,
9493
/// Ethereum-compatibility specific dependencies.
95-
pub eth: EthDeps<P, A, CT, CIDP>,
94+
pub eth: EthDeps<P, CT, CIDP>,
9695
}
9796

9897
/// Instantiate all full RPC extensions.
99-
pub fn create_full<P, A, CT, CIDP>(
100-
deps: FullDeps<P, A, CT, CIDP>,
98+
pub fn create_full<P, CT, CIDP>(
99+
deps: FullDeps<P, CT, CIDP>,
101100
subscription_task_executor: SubscriptionTaskExecutor,
102101
pubsub_notification_sinks: Arc<
103102
fc_mapping_sync::EthereumBlockNotificationSinks<
@@ -106,8 +105,13 @@ pub fn create_full<P, A, CT, CIDP>(
106105
>,
107106
) -> Result<RpcModule<()>, Box<dyn std::error::Error + Send + Sync>>
108107
where
109-
P: TransactionPool<Block = Block> + 'static,
110-
A: ChainApi<Block = Block> + 'static,
108+
P: TransactionPool<
109+
Block = Block,
110+
Hash = <sp_runtime::generic::Block<
111+
sp_runtime::generic::Header<u32, BlakeTwo256>,
112+
OpaqueExtrinsic,
113+
> as BlockT>::Hash,
114+
> + 'static,
111115
CIDP: CreateInherentDataProviders<Block, ()> + Send + Clone + 'static,
112116
CT: fp_rpc::ConvertTransaction<<Block as BlockT>::Extrinsic> + Send + Sync + Clone + 'static,
113117
{
@@ -144,7 +148,7 @@ where
144148
}
145149

146150
// Ethereum compatibility RPCs
147-
let module = create_eth::<_, _, _, _, DefaultEthConfig>(
151+
let module = create_eth::<_, _, _, DefaultEthConfig>(
148152
module,
149153
eth,
150154
subscription_task_executor,

0 commit comments

Comments
 (0)