diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 91bb9e89..cd6a754c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -202,12 +202,12 @@ jobs: - name: Cargo build uses: ./.github/workflow-templates/cargo-build - name: Upload runtimes - uses: actions/upload-artifact@v3.1.2 + uses: actions/upload-artifact@v4 with: name: runtimes path: runtimes - name: Upload binary - uses: actions/upload-artifact@v3.1.2 + uses: actions/upload-artifact@v4 with: name: moonkit-template path: build/moonkit-template @@ -228,7 +228,7 @@ jobs: with: features: "try-runtime,runtime-benchmarks" - name: Upload binary - uses: actions/upload-artifact@v3.1.2 + uses: actions/upload-artifact@v4 with: name: moonkit-template-features path: build/moonkit-template diff --git a/client/consensus/nimbus-consensus/src/collators/lookahead.rs b/client/consensus/nimbus-consensus/src/collators/lookahead.rs index 45a29194..f4939ea5 100644 --- a/client/consensus/nimbus-consensus/src/collators/lookahead.rs +++ b/client/consensus/nimbus-consensus/src/collators/lookahead.rs @@ -23,7 +23,7 @@ use cumulus_client_consensus_common::{ }; use cumulus_client_consensus_proposer::ProposerInterface; use cumulus_primitives_core::{ - relay_chain::{AsyncBackingParams, CoreIndex, vstaging::CoreState, Hash as PHash}, + relay_chain::{vstaging::CoreState, AsyncBackingParams, CoreIndex, Hash as PHash}, CollectCollationInfo, ParaId, }; use cumulus_relay_chain_interface::{OverseerHandle, RelayChainInterface}; diff --git a/precompiles/assets-erc20/src/mock.rs b/precompiles/assets-erc20/src/mock.rs index 04355176..31c3bd2f 100644 --- a/precompiles/assets-erc20/src/mock.rs +++ b/precompiles/assets-erc20/src/mock.rs @@ -194,6 +194,9 @@ impl pallet_evm::Config for Runtime { type GasLimitStorageGrowthRatio = (); type Timestamp = Timestamp; type WeightInfo = pallet_evm::weights::SubstrateWeight; + type CreateOrigin = (); + type CreateInnerOrigin = (); + type SuicideQuickClearLimit = (); } type ForeignAssetInstance = pallet_assets::Instance1; diff --git a/precompiles/balances-erc20/src/mock.rs b/precompiles/balances-erc20/src/mock.rs index 341103b5..ccd0700a 100644 --- a/precompiles/balances-erc20/src/mock.rs +++ b/precompiles/balances-erc20/src/mock.rs @@ -143,6 +143,9 @@ impl pallet_evm::Config for Runtime { type GasLimitStorageGrowthRatio = (); type Timestamp = Timestamp; type WeightInfo = pallet_evm::weights::SubstrateWeight; + type CreateOrigin = (); + type CreateInnerOrigin = (); + type SuicideQuickClearLimit = (); } // Configure a mock runtime to test the pallet. diff --git a/precompiles/batch/src/mock.rs b/precompiles/batch/src/mock.rs index eb02e28c..a6618af5 100644 --- a/precompiles/batch/src/mock.rs +++ b/precompiles/batch/src/mock.rs @@ -158,6 +158,9 @@ impl pallet_evm::Config for Runtime { type GasLimitStorageGrowthRatio = (); type Timestamp = Timestamp; type WeightInfo = pallet_evm::weights::SubstrateWeight; + type CreateOrigin = (); + type CreateInnerOrigin = (); + type SuicideQuickClearLimit = (); } parameter_types! { @@ -201,9 +204,10 @@ impl ExtBuilder { let mut ext = sp_io::TestExternalities::new(t); ext.execute_with(|| { System::set_block_number(1); - pallet_evm::Pallet::::create_account( + let _ = pallet_evm::Pallet::::create_account( Revert.into(), hex_literal::hex!("1460006000fd").to_vec(), + None, ); }); ext diff --git a/precompiles/batch/src/tests.rs b/precompiles/batch/src/tests.rs index a0e484c0..d150efa8 100644 --- a/precompiles/batch/src/tests.rs +++ b/precompiles/batch/src/tests.rs @@ -1008,7 +1008,7 @@ fn batch_not_callable_by_smart_contract() { .execute_with(|| { // "deploy" SC to alice address let alice_h160: H160 = Alice.into(); - pallet_evm::Pallet::::create_account(alice_h160, vec![10u8]); + let _ = pallet_evm::Pallet::::create_account(alice_h160, vec![10u8], None); // succeeds if not called by SC, see `evm_batch_recursion_under_limit` let input = PCall::batch_all { @@ -1049,9 +1049,10 @@ fn batch_is_not_callable_by_dummy_code() { .execute_with(|| { // "deploy" dummy code to alice address let alice_h160: H160 = Alice.into(); - pallet_evm::Pallet::::create_account( + let _ = pallet_evm::Pallet::::create_account( alice_h160, [0x60, 0x00, 0x60, 0x00, 0xfd].to_vec(), + None, ); // succeeds if called by dummy code, see `evm_batch_recursion_under_limit` diff --git a/precompiles/call-permit/src/mock.rs b/precompiles/call-permit/src/mock.rs index 4737bbb4..568d1f06 100644 --- a/precompiles/call-permit/src/mock.rs +++ b/precompiles/call-permit/src/mock.rs @@ -144,6 +144,9 @@ impl pallet_evm::Config for Runtime { type GasLimitStorageGrowthRatio = (); type Timestamp = Timestamp; type WeightInfo = pallet_evm::weights::SubstrateWeight; + type CreateOrigin = (); + type CreateInnerOrigin = (); + type SuicideQuickClearLimit = (); } parameter_types! { @@ -187,9 +190,10 @@ impl ExtBuilder { let mut ext = sp_io::TestExternalities::new(t); ext.execute_with(|| { System::set_block_number(1); - pallet_evm::Pallet::::create_account( + let _ = pallet_evm::Pallet::::create_account( Revert.into(), hex_literal::hex!("1460006000fd").to_vec(), + None, ); }); ext diff --git a/precompiles/pallet-xcm/src/mock.rs b/precompiles/pallet-xcm/src/mock.rs index 67d8993d..611797f5 100644 --- a/precompiles/pallet-xcm/src/mock.rs +++ b/precompiles/pallet-xcm/src/mock.rs @@ -276,6 +276,9 @@ impl pallet_evm::Config for Runtime { type GasLimitStorageGrowthRatio = (); type Timestamp = Timestamp; type WeightInfo = pallet_evm::weights::SubstrateWeight; + type CreateOrigin = (); + type CreateInnerOrigin = (); + type SuicideQuickClearLimit = (); } parameter_types! { diff --git a/precompiles/proxy/src/mock.rs b/precompiles/proxy/src/mock.rs index e7d9d1bd..381dd461 100644 --- a/precompiles/proxy/src/mock.rs +++ b/precompiles/proxy/src/mock.rs @@ -181,6 +181,9 @@ impl pallet_evm::Config for Runtime { type GasLimitStorageGrowthRatio = (); type Timestamp = Timestamp; type WeightInfo = pallet_evm::weights::SubstrateWeight; + type CreateOrigin = (); + type CreateInnerOrigin = (); + type SuicideQuickClearLimit = (); } parameter_types! { diff --git a/precompiles/proxy/src/tests.rs b/precompiles/proxy/src/tests.rs index b055d53a..a2cc843a 100644 --- a/precompiles/proxy/src/tests.rs +++ b/precompiles/proxy/src/tests.rs @@ -578,7 +578,8 @@ fn fails_if_called_by_smart_contract() { .build() .execute_with(|| { // Set code to Alice address as it if was a smart contract. - pallet_evm::Pallet::::create_account(H160::from(Alice), vec![10u8]); + let _ = + pallet_evm::Pallet::::create_account(H160::from(Alice), vec![10u8], None); PrecompilesValue::get() .prepare_test( @@ -776,8 +777,10 @@ fn proxy_proxy_should_fail_if_called_by_smart_contract_for_a_non_eoa_account() { .build() .execute_with(|| { // Set code to Alice & Bob addresses as if they are smart contracts. - pallet_evm::Pallet::::create_account(H160::from(Alice), vec![10u8]); - pallet_evm::Pallet::::create_account(H160::from(Bob), vec![10u8]); + let _ = + pallet_evm::Pallet::::create_account(H160::from(Alice), vec![10u8], None); + let _ = + pallet_evm::Pallet::::create_account(H160::from(Bob), vec![10u8], None); // Bob allows Alice to make calls on his behalf assert_ok!(RuntimeCall::Proxy(ProxyCall::add_proxy { diff --git a/precompiles/xcm-utils/src/mock.rs b/precompiles/xcm-utils/src/mock.rs index 95cf42a8..aa2d8eb6 100644 --- a/precompiles/xcm-utils/src/mock.rs +++ b/precompiles/xcm-utils/src/mock.rs @@ -278,6 +278,9 @@ impl pallet_evm::Config for Runtime { type GasLimitStorageGrowthRatio = (); type Timestamp = Timestamp; type WeightInfo = pallet_evm::weights::SubstrateWeight; + type CreateOrigin = (); + type CreateInnerOrigin = (); + type SuicideQuickClearLimit = (); } parameter_types! { diff --git a/precompiles/xcm-utils/src/tests.rs b/precompiles/xcm-utils/src/tests.rs index 6fccf41b..74015621 100644 --- a/precompiles/xcm-utils/src/tests.rs +++ b/precompiles/xcm-utils/src/tests.rs @@ -242,7 +242,8 @@ fn execute_fails_if_called_by_smart_contract() { .build() .execute_with(|| { // Set code to Alice address as it if was a smart contract. - pallet_evm::Pallet::::create_account(H160::from(Alice), vec![10u8]); + let _ = + pallet_evm::Pallet::::create_account(H160::from(Alice), vec![10u8], None); let xcm_to_execute = VersionedXcm::<()>::from(Xcm(vec![ClearOrigin])).encode(); diff --git a/template/node/src/service.rs b/template/node/src/service.rs index b73c126d..6702c3ab 100644 --- a/template/node/src/service.rs +++ b/template/node/src/service.rs @@ -18,7 +18,6 @@ use cumulus_client_consensus_common::ParachainBlockImport as TParachainBlockImpo use cumulus_client_consensus_proposer::Proposer; use cumulus_client_network::RequireSecondedInBlockAnnounce; use cumulus_client_parachain_inherent::{MockValidationDataInherentDataProvider, MockXcmConfig}; -use cumulus_primitives_core::CollectCollationInfo; #[allow(deprecated)] use cumulus_client_service::{ prepare_node_config, start_relay_chain_tasks, DARecoveryProfile, StartRelayChainTasksParams, @@ -31,7 +30,6 @@ use cumulus_relay_chain_minimal_node::build_minimal_relay_chain_node_with_rpc; use polkadot_primitives::UpgradeGoAhead; use polkadot_service::CollatorPair; -use polkadot_primitives::UpgradeGoAhead; // Substrate Imports use futures::FutureExt; @@ -142,14 +140,14 @@ pub fn new_partial( // And sovereign nodes, so we create it anyway. let select_chain = sc_consensus::LongestChain::new(backend.clone()); - let transaction_pool = sc_transaction_pool::Builder::new( - task_manager.spawn_essential_handle(), - client.clone(), - config.role.is_authority().into(), - ) - .with_options(config.transaction_pool.clone()) - .with_prometheus(config.prometheus_registry()) - .build(); + let transaction_pool = sc_transaction_pool::Builder::new( + task_manager.spawn_essential_handle(), + client.clone(), + config.role.is_authority().into(), + ) + .with_options(config.transaction_pool.clone()) + .with_prometheus(config.prometheus_registry()) + .build(); let block_import = ParachainBlockImport::new(client.clone(), backend.clone()); @@ -164,6 +162,7 @@ pub fn new_partial( &task_manager.spawn_essential_handle(), config.prometheus_registry().clone(), false, + true, )?; Ok(PartialComponents { @@ -191,9 +190,11 @@ async fn build_relay_chain_interface( if let cumulus_client_cli::RelayChainMode::ExternalRpc(rpc_target_urls) = collator_options.relay_chain_mode { - build_minimal_relay_chain_node_with_rpc(polkadot_config, - parachain_config.prometheus_registry(), - task_manager, rpc_target_urls, + build_minimal_relay_chain_node_with_rpc( + polkadot_config, + parachain_config.prometheus_registry(), + task_manager, + rpc_target_urls, ) .await } else { @@ -561,21 +562,20 @@ where let hrmp_xcm_receiver = hrmp_xcm_receiver.clone(); let client_for_xcm = client_set_aside_for_cidp.clone(); - let current_para_head = client_set_aside_for_cidp - .header(block) - .expect("Header lookup should succeed") - .expect("Header passed in as parent should be present in backend."); - let should_send_go_ahead = match client_set_aside_for_cidp - .runtime_api() - .collect_collation_info(block, ¤t_para_head) - { - Ok(info) => info.new_validation_code.is_some(), - Err(e) => { - log::error!("Failed to collect collation info: {:?}", e); - false - }, - }; - + let current_para_head = client_set_aside_for_cidp + .header(block) + .expect("Header lookup should succeed") + .expect("Header passed in as parent should be present in backend."); + let should_send_go_ahead = match client_set_aside_for_cidp + .runtime_api() + .collect_collation_info(block, ¤t_para_head) + { + Ok(info) => info.new_validation_code.is_some(), + Err(e) => { + log::error!("Failed to collect collation info: {:?}", e); + false + } + }; async move { let time = sp_timestamp::InherentDataProvider::from_system_time(); @@ -595,13 +595,12 @@ where raw_downward_messages: downward_xcm_receiver.drain().collect(), raw_horizontal_messages: hrmp_xcm_receiver.drain().collect(), para_id: para_id.into(), - upgrade_go_ahead: should_send_go_ahead.then(|| { - log::info!( - "Detected pending validation code, sending go-ahead signal." - ); - UpgradeGoAhead::GoAhead - }), - + upgrade_go_ahead: should_send_go_ahead.then(|| { + log::info!( + "Detected pending validation code, sending go-ahead signal." + ); + UpgradeGoAhead::GoAhead + }), }; Ok((time, mocked_parachain)) diff --git a/template/runtime/src/lib.rs b/template/runtime/src/lib.rs index b9ecaeca..65de19d7 100644 --- a/template/runtime/src/lib.rs +++ b/template/runtime/src/lib.rs @@ -347,7 +347,7 @@ impl frame_system::Config for Runtime { type PreInherents = (); type PostInherents = (); type PostTransactions = (); - type ExtensionsWeightInfo = (); + type ExtensionsWeightInfo = (); } parameter_types! { @@ -384,7 +384,7 @@ impl pallet_balances::Config for Runtime { type RuntimeFreezeReason = (); type FreezeIdentifier = (); type MaxFreezes = ConstU32<0>; - type DoneSlashHandler = (); + type DoneSlashHandler = (); } parameter_types! {