diff --git a/Cargo.toml b/Cargo.toml index 3eb8697f..532f3e4d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -72,11 +72,11 @@ serde_json = { version = "1.0.92" } # EVM & Ethereum # (wasm) -evm = { version = "0.37.0", default-features = false } +evm = { version = "0.39.0", default-features = false } ethereum-types = { version = "0.14", default-features = false } ethereum = { version = "0.14.0", default-features = false } -evm-gasometer = { version = "0.37.0", default-features = false } -evm-runtime = { version = "0.37.0", default-features = false } +evm-gasometer = { version = "0.39.0", default-features = false } +evm-runtime = { version = "0.39.0", default-features = false } # jsonrpsee # (wasm) @@ -84,65 +84,65 @@ jsonrpsee = { version = "0.16.2", default-features = false } # Substrate # (wasm) -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -sp-arithmetic = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -sp-staking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -sp-runtime-interface = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -sp-externalities = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -sp-keyring = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } +frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +sp-arithmetic = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +sp-staking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +sp-runtime-interface = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +sp-externalities = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +sp-keyring = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } # (native) -sp-consensus-aura = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sp-tracing = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sc-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sc-transaction-pool-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sc-network = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sc-utils = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sp-block-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sp-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +sp-consensus-aura = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } +sp-tracing = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } +sc-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } +sc-transaction-pool-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } +sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } +sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } +sc-network = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } +sc-utils = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } +sp-block-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } +sp-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } # Substrate pallets # (wasm) -pallet-contracts = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -pallet-contracts-primitives = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -pallet-authorship = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -pallet-session = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -pallet-aura = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -pallet-assets = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } +pallet-contracts = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +pallet-contracts-primitives = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +pallet-authorship = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +pallet-session = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +pallet-aura = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +pallet-assets = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } # Polkadot # (wasm) -xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.39", default-features = false } -xcm-executor = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.39", default-features = false } -polkadot-parachain = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.39", default-features = false } -xcm-builder = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.39", default-features = false } +xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.40", default-features = false } +xcm-executor = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.40", default-features = false } +polkadot-parachain = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.40", default-features = false } +xcm-builder = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.40", default-features = false } # (native) -polkadot-runtime-parachains = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.39" } +polkadot-runtime-parachains = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.40" } # Frontier # (wasm) -fp-evm = { git = "https://github.com/AstarNetwork/frontier", branch = "polkadot-v0.9.39", default-features = false } -pallet-evm = { git = "https://github.com/AstarNetwork/frontier", branch = "polkadot-v0.9.39", default-features = false, features = ["forbid-evm-reentrancy"] } +fp-evm = { git = "https://github.com/AstarNetwork/frontier", branch = "polkadot-v0.9.40", default-features = false } +pallet-evm = { git = "https://github.com/AstarNetwork/frontier", branch = "polkadot-v0.9.40", default-features = false, features = ["forbid-evm-reentrancy"] } # (native) -fp-rpc = { git = "https://github.com/AstarNetwork/frontier", branch = "polkadot-v0.9.39" } -fc-rpc-core = { git = "https://github.com/AstarNetwork/frontier", branch = "polkadot-v0.9.39" } -fc-rpc = { git = "https://github.com/AstarNetwork/frontier", branch = "polkadot-v0.9.39" } -fc-consensus = { git = "https://github.com/AstarNetwork/frontier", branch = "polkadot-v0.9.39" } -fc-db = { git = "https://github.com/AstarNetwork/frontier", branch = "polkadot-v0.9.39" } -fc-storage = { git = "https://github.com/AstarNetwork/frontier", branch = "polkadot-v0.9.39" } +fp-rpc = { git = "https://github.com/AstarNetwork/frontier", branch = "polkadot-v0.9.40" } +fc-rpc-core = { git = "https://github.com/AstarNetwork/frontier", branch = "polkadot-v0.9.40" } +fc-rpc = { git = "https://github.com/AstarNetwork/frontier", branch = "polkadot-v0.9.40" } +fc-consensus = { git = "https://github.com/AstarNetwork/frontier", branch = "polkadot-v0.9.40" } +fc-db = { git = "https://github.com/AstarNetwork/frontier", branch = "polkadot-v0.9.40" } +fc-storage = { git = "https://github.com/AstarNetwork/frontier", branch = "polkadot-v0.9.40" } # Local deps # (wasm) diff --git a/chain-extensions/xvm/src/lib.rs b/chain-extensions/xvm/src/lib.rs index 851271c1..27952d22 100644 --- a/chain-extensions/xvm/src/lib.rs +++ b/chain-extensions/xvm/src/lib.rs @@ -90,7 +90,7 @@ where let actual_weight = pallet_xvm::consumed_weight(&call_result); // TODO: implement proof of size refund. - env.adjust_weight(charged_weight, Weight::from_ref_time(actual_weight)); + env.adjust_weight(charged_weight, Weight::from_parts(actual_weight, 0)); match call_result { Ok(success) => { diff --git a/frame/block-reward/src/mock.rs b/frame/block-reward/src/mock.rs index 5201fdd8..d2ded0fb 100644 --- a/frame/block-reward/src/mock.rs +++ b/frame/block-reward/src/mock.rs @@ -56,7 +56,7 @@ construct_runtime!( parameter_types! { pub const BlockHashCount: u64 = 250; pub BlockWeights: frame_system::limits::BlockWeights = - frame_system::limits::BlockWeights::simple_max(Weight::from_ref_time(1024)); + frame_system::limits::BlockWeights::simple_max(Weight::from_parts(1024, 0)); } impl frame_system::Config for TestRuntime { diff --git a/frame/block-reward/src/weights.rs b/frame/block-reward/src/weights.rs index a040a738..f3ebfd52 100644 --- a/frame/block-reward/src/weights.rs +++ b/frame/block-reward/src/weights.rs @@ -58,8 +58,8 @@ impl WeightInfo for SubstrateWeight { // Proof: BlockReward RewardDistributionConfigStorage (max_values: Some(1), max_size: Some(24), added: 519, mode: MaxEncodedLen) fn set_configuration() -> Weight { // Minimum execution time: 9_085 nanoseconds. - Weight::from_ref_time(9_328_000) - .saturating_add(Weight::from_proof_size(0)) + Weight::from_parts(9_328_000, 0) + .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1_u64)) } } @@ -70,8 +70,8 @@ impl WeightInfo for () { // Proof: BlockReward RewardDistributionConfigStorage (max_values: Some(1), max_size: Some(24), added: 519, mode: MaxEncodedLen) fn set_configuration() -> Weight { // Minimum execution time: 9_085 nanoseconds. - Weight::from_ref_time(9_328_000) - .saturating_add(Weight::from_proof_size(0)) + Weight::from_parts(9_328_000, 0) + .saturating_add(Weight::from_parts(0, 0)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } } \ No newline at end of file diff --git a/frame/collator-selection/src/lib.rs b/frame/collator-selection/src/lib.rs index 1f348e65..58c49e88 100644 --- a/frame/collator-selection/src/lib.rs +++ b/frame/collator-selection/src/lib.rs @@ -171,7 +171,6 @@ pub mod pallet { } #[pallet::pallet] - #[pallet::generate_store(pub(super) trait Store)] #[pallet::without_storage_info] pub struct Pallet(_); diff --git a/frame/collator-selection/src/weights.rs b/frame/collator-selection/src/weights.rs index ad80e6b2..1a89e8d0 100644 --- a/frame/collator-selection/src/weights.rs +++ b/frame/collator-selection/src/weights.rs @@ -66,28 +66,28 @@ impl WeightInfo for SubstrateWeight { /// The range of component `b` is `[1, 48]`. fn set_invulnerables(b: u32, ) -> Weight { // Minimum execution time: 14_956 nanoseconds. - Weight::from_ref_time(15_730_242) - .saturating_add(Weight::from_proof_size(408)) + Weight::from_parts(15_730_242, 0) + .saturating_add(Weight::from_parts(0, 408)) // Standard Error: 4_959 - .saturating_add(Weight::from_ref_time(2_577_606).saturating_mul(b.into())) + .saturating_add(Weight::from_parts(2_577_606, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(b.into()))) .saturating_add(T::DbWeight::get().writes(1_u64)) - .saturating_add(Weight::from_proof_size(2633).saturating_mul(b.into())) + .saturating_add(Weight::from_parts(0, 2633).saturating_mul(b.into())) } // Storage: CollatorSelection DesiredCandidates (r:0 w:1) // Proof Skipped: CollatorSelection DesiredCandidates (max_values: Some(1), max_size: None, mode: Measured) fn set_desired_candidates() -> Weight { // Minimum execution time: 7_042 nanoseconds. - Weight::from_ref_time(7_159_000) - .saturating_add(Weight::from_proof_size(0)) + Weight::from_parts(7_159_000, 0) + .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1_u64)) } // Storage: CollatorSelection CandidacyBond (r:0 w:1) // Proof Skipped: CollatorSelection CandidacyBond (max_values: Some(1), max_size: None, mode: Measured) fn set_candidacy_bond() -> Weight { // Minimum execution time: 7_245 nanoseconds. - Weight::from_ref_time(7_395_000) - .saturating_add(Weight::from_proof_size(0)) + Weight::from_parts(7_395_000, 0) + .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1_u64)) } // Storage: CollatorSelection Candidates (r:1 w:1) @@ -105,13 +105,13 @@ impl WeightInfo for SubstrateWeight { /// The range of component `c` is `[1, 148]`. fn register_as_candidate(c: u32, ) -> Weight { // Minimum execution time: 39_356 nanoseconds. - Weight::from_ref_time(42_616_377) - .saturating_add(Weight::from_proof_size(9891)) + Weight::from_parts(42_616_377, 0) + .saturating_add(Weight::from_parts(0, 9891)) // Standard Error: 670 - .saturating_add(Weight::from_ref_time(39_880).saturating_mul(c.into())) + .saturating_add(Weight::from_parts(39_880, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) - .saturating_add(Weight::from_proof_size(306).saturating_mul(c.into())) + .saturating_add(Weight::from_parts(0, 306).saturating_mul(c.into())) } // Storage: CollatorSelection Candidates (r:1 w:1) // Proof Skipped: CollatorSelection Candidates (max_values: Some(1), max_size: None, mode: Measured) @@ -120,13 +120,13 @@ impl WeightInfo for SubstrateWeight { /// The range of component `c` is `[6, 148]`. fn leave_intent(c: u32, ) -> Weight { // Minimum execution time: 28_341 nanoseconds. - Weight::from_ref_time(30_119_984) - .saturating_add(Weight::from_proof_size(1369)) + Weight::from_parts(30_119_984, 0) + .saturating_add(Weight::from_parts(0, 1369)) // Standard Error: 1_581 - .saturating_add(Weight::from_ref_time(42_495).saturating_mul(c.into())) + .saturating_add(Weight::from_parts(42_495, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) - .saturating_add(Weight::from_proof_size(98).saturating_mul(c.into())) + .saturating_add(Weight::from_parts(0, 98).saturating_mul(c.into())) } // Storage: System Account (r:2 w:2) // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) @@ -134,8 +134,8 @@ impl WeightInfo for SubstrateWeight { // Proof Skipped: CollatorSelection LastAuthoredBlock (max_values: None, max_size: None, mode: Measured) fn note_author() -> Weight { // Minimum execution time: 31_536 nanoseconds. - Weight::from_ref_time(31_986_000) - .saturating_add(Weight::from_proof_size(5497)) + Weight::from_parts(31_986_000, 0) + .saturating_add(Weight::from_parts(0, 5497)) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -153,15 +153,15 @@ impl WeightInfo for SubstrateWeight { /// The range of component `c` is `[1, 148]`. fn new_session(r: u32, c: u32, ) -> Weight { // Minimum execution time: 16_816 nanoseconds. - Weight::from_ref_time(17_132_000) - .saturating_add(Weight::from_proof_size(4714)) + Weight::from_parts(17_132_000, 0) + .saturating_add(Weight::from_parts(0, 4714)) // Standard Error: 475_405 - .saturating_add(Weight::from_ref_time(15_758_567).saturating_mul(c.into())) + .saturating_add(Weight::from_parts(15_758_567, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(c.into()))) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(c.into()))) - .saturating_add(Weight::from_proof_size(3131).saturating_mul(c.into())) - .saturating_add(Weight::from_proof_size(2751).saturating_mul(r.into())) + .saturating_add(Weight::from_parts(0, 3131).saturating_mul(c.into())) + .saturating_add(Weight::from_parts(0, 2751).saturating_mul(r.into())) } } @@ -174,28 +174,28 @@ impl WeightInfo for () { /// The range of component `b` is `[1, 48]`. fn set_invulnerables(b: u32, ) -> Weight { // Minimum execution time: 14_956 nanoseconds. - Weight::from_ref_time(15_730_242) - .saturating_add(Weight::from_proof_size(408)) + Weight::from_parts(15_730_242, 0) + .saturating_add(Weight::from_parts(0, 408)) // Standard Error: 4_959 - .saturating_add(Weight::from_ref_time(2_577_606).saturating_mul(b.into())) + .saturating_add(Weight::from_parts(2_577_606, 0).saturating_mul(b.into())) .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(b.into()))) .saturating_add(RocksDbWeight::get().writes(1_u64)) - .saturating_add(Weight::from_proof_size(2633).saturating_mul(b.into())) + .saturating_add(Weight::from_parts(0, 2633).saturating_mul(b.into())) } // Storage: CollatorSelection DesiredCandidates (r:0 w:1) // Proof Skipped: CollatorSelection DesiredCandidates (max_values: Some(1), max_size: None, mode: Measured) fn set_desired_candidates() -> Weight { // Minimum execution time: 7_042 nanoseconds. - Weight::from_ref_time(7_159_000) - .saturating_add(Weight::from_proof_size(0)) + Weight::from_parts(7_159_000, 0) + .saturating_add(Weight::from_parts(0, 0)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } // Storage: CollatorSelection CandidacyBond (r:0 w:1) // Proof Skipped: CollatorSelection CandidacyBond (max_values: Some(1), max_size: None, mode: Measured) fn set_candidacy_bond() -> Weight { // Minimum execution time: 7_245 nanoseconds. - Weight::from_ref_time(7_395_000) - .saturating_add(Weight::from_proof_size(0)) + Weight::from_parts(7_395_000, 0) + .saturating_add(Weight::from_parts(0, 0)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } // Storage: CollatorSelection Candidates (r:1 w:1) @@ -213,13 +213,13 @@ impl WeightInfo for () { /// The range of component `c` is `[1, 148]`. fn register_as_candidate(c: u32, ) -> Weight { // Minimum execution time: 39_356 nanoseconds. - Weight::from_ref_time(42_616_377) - .saturating_add(Weight::from_proof_size(9891)) + Weight::from_parts(42_616_377, 0) + .saturating_add(Weight::from_parts(0, 9891)) // Standard Error: 670 - .saturating_add(Weight::from_ref_time(39_880).saturating_mul(c.into())) + .saturating_add(Weight::from_parts(39_880, 0).saturating_mul(c.into())) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) - .saturating_add(Weight::from_proof_size(306).saturating_mul(c.into())) + .saturating_add(Weight::from_parts(0, 306).saturating_mul(c.into())) } // Storage: CollatorSelection Candidates (r:1 w:1) // Proof Skipped: CollatorSelection Candidates (max_values: Some(1), max_size: None, mode: Measured) @@ -228,13 +228,13 @@ impl WeightInfo for () { /// The range of component `c` is `[6, 148]`. fn leave_intent(c: u32, ) -> Weight { // Minimum execution time: 28_341 nanoseconds. - Weight::from_ref_time(30_119_984) - .saturating_add(Weight::from_proof_size(1369)) + Weight::from_parts(30_119_984, 0) + .saturating_add(Weight::from_parts(0, 1369)) // Standard Error: 1_581 - .saturating_add(Weight::from_ref_time(42_495).saturating_mul(c.into())) + .saturating_add(Weight::from_parts(42_495, 0).saturating_mul(c.into())) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) - .saturating_add(Weight::from_proof_size(98).saturating_mul(c.into())) + .saturating_add(Weight::from_parts(0, 98).saturating_mul(c.into())) } // Storage: System Account (r:2 w:2) // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) @@ -242,8 +242,8 @@ impl WeightInfo for () { // Proof Skipped: CollatorSelection LastAuthoredBlock (max_values: None, max_size: None, mode: Measured) fn note_author() -> Weight { // Minimum execution time: 31_536 nanoseconds. - Weight::from_ref_time(31_986_000) - .saturating_add(Weight::from_proof_size(5497)) + Weight::from_parts(31_986_000, 0) + .saturating_add(Weight::from_parts(0, 5497)) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } @@ -261,14 +261,14 @@ impl WeightInfo for () { /// The range of component `c` is `[1, 148]`. fn new_session(r: u32, c: u32, ) -> Weight { // Minimum execution time: 16_816 nanoseconds. - Weight::from_ref_time(17_132_000) - .saturating_add(Weight::from_proof_size(4714)) + Weight::from_parts(17_132_000, 0) + .saturating_add(Weight::from_parts(0, 4714)) // Standard Error: 475_405 - .saturating_add(Weight::from_ref_time(15_758_567).saturating_mul(c.into())) + .saturating_add(Weight::from_parts(15_758_567, 0).saturating_mul(c.into())) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(c.into()))) .saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(c.into()))) - .saturating_add(Weight::from_proof_size(3131).saturating_mul(c.into())) - .saturating_add(Weight::from_proof_size(2751).saturating_mul(r.into())) + .saturating_add(Weight::from_parts(0, 3131).saturating_mul(c.into())) + .saturating_add(Weight::from_parts(0, 2751).saturating_mul(r.into())) } } \ No newline at end of file diff --git a/frame/custom-signatures/src/lib.rs b/frame/custom-signatures/src/lib.rs index fa9dd1b3..530cfd9d 100644 --- a/frame/custom-signatures/src/lib.rs +++ b/frame/custom-signatures/src/lib.rs @@ -112,7 +112,7 @@ pub mod pallet { let dispatch_info = call.get_dispatch_info(); (dispatch_info.weight.saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) - .saturating_add(Weight::from_ref_time(10_000)), + .saturating_add(Weight::from_parts(10_000, 0)), dispatch_info.class) })] pub fn call( diff --git a/frame/dapps-staking/src/mock.rs b/frame/dapps-staking/src/mock.rs index d4df2cbc..fbe02791 100644 --- a/frame/dapps-staking/src/mock.rs +++ b/frame/dapps-staking/src/mock.rs @@ -77,7 +77,7 @@ construct_runtime!( parameter_types! { pub const BlockHashCount: u64 = 250; pub BlockWeights: frame_system::limits::BlockWeights = - frame_system::limits::BlockWeights::simple_max(Weight::from_ref_time(1024)); + frame_system::limits::BlockWeights::simple_max(Weight::from_parts(1024, 0)); } impl frame_system::Config for TestRuntime { diff --git a/frame/dapps-staking/src/pallet/mod.rs b/frame/dapps-staking/src/pallet/mod.rs index cfd09876..e9f8ad47 100644 --- a/frame/dapps-staking/src/pallet/mod.rs +++ b/frame/dapps-staking/src/pallet/mod.rs @@ -49,7 +49,6 @@ pub mod pallet { <::Currency as Currency<::AccountId>>::Balance; #[pallet::pallet] - #[pallet::generate_store(pub(crate) trait Store)] pub struct Pallet(PhantomData); // Negative imbalance type of this pallet. diff --git a/frame/dapps-staking/src/weights.rs b/frame/dapps-staking/src/weights.rs index 4e02ed39..193e0883 100644 --- a/frame/dapps-staking/src/weights.rs +++ b/frame/dapps-staking/src/weights.rs @@ -71,8 +71,8 @@ impl WeightInfo for SubstrateWeight { // Proof: DappsStaking RegisteredDapps (max_values: None, max_size: Some(86), added: 2561, mode: MaxEncodedLen) fn register() -> Weight { // Minimum execution time: 25_265 nanoseconds. - Weight::from_ref_time(26_091_000) - .saturating_add(Weight::from_proof_size(5117)) + Weight::from_parts(26_091_000, 0) + .saturating_add(Weight::from_parts(0, 5117)) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -82,8 +82,8 @@ impl WeightInfo for SubstrateWeight { // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) fn unregister() -> Weight { // Minimum execution time: 27_241 nanoseconds. - Weight::from_ref_time(27_411_000) - .saturating_add(Weight::from_proof_size(5164)) + Weight::from_parts(27_411_000, 0) + .saturating_add(Weight::from_parts(0, 5164)) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -101,8 +101,8 @@ impl WeightInfo for SubstrateWeight { // Proof: DappsStaking GeneralEraInfo (max_values: None, max_size: Some(76), added: 2551, mode: MaxEncodedLen) fn withdraw_from_unregistered() -> Weight { // Minimum execution time: 44_491 nanoseconds. - Weight::from_ref_time(45_042_000) - .saturating_add(Weight::from_proof_size(17003)) + Weight::from_parts(45_042_000, 0) + .saturating_add(Weight::from_parts(0, 17003)) .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } @@ -120,8 +120,8 @@ impl WeightInfo for SubstrateWeight { // Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen) fn bond_and_stake() -> Weight { // Minimum execution time: 43_099 nanoseconds. - Weight::from_ref_time(43_939_000) - .saturating_add(Weight::from_proof_size(16957)) + Weight::from_parts(43_939_000, 0) + .saturating_add(Weight::from_parts(0, 16957)) .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } @@ -139,8 +139,8 @@ impl WeightInfo for SubstrateWeight { // Proof: DappsStaking GeneralEraInfo (max_values: None, max_size: Some(76), added: 2551, mode: MaxEncodedLen) fn unbond_and_unstake() -> Weight { // Minimum execution time: 46_783 nanoseconds. - Weight::from_ref_time(47_487_000) - .saturating_add(Weight::from_proof_size(16957)) + Weight::from_parts(47_487_000, 0) + .saturating_add(Weight::from_parts(0, 16957)) .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } @@ -152,8 +152,8 @@ impl WeightInfo for SubstrateWeight { // Proof: DappsStaking GeneralEraInfo (max_values: None, max_size: Some(76), added: 2551, mode: MaxEncodedLen) fn withdraw_unbonded() -> Weight { // Minimum execution time: 30_952 nanoseconds. - Weight::from_ref_time(31_615_000) - .saturating_add(Weight::from_proof_size(9066)) + Weight::from_parts(31_615_000, 0) + .saturating_add(Weight::from_parts(0, 9066)) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -165,8 +165,8 @@ impl WeightInfo for SubstrateWeight { // Proof: DappsStaking ContractEraStake (max_values: None, max_size: Some(82), added: 2557, mode: MaxEncodedLen) fn nomination_transfer() -> Weight { // Minimum execution time: 38_247 nanoseconds. - Weight::from_ref_time(38_832_000) - .saturating_add(Weight::from_proof_size(15782)) + Weight::from_parts(38_832_000, 0) + .saturating_add(Weight::from_parts(0, 15782)) .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } @@ -186,8 +186,8 @@ impl WeightInfo for SubstrateWeight { // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) fn claim_staker_with_restake() -> Weight { // Minimum execution time: 60_558 nanoseconds. - Weight::from_ref_time(61_264_000) - .saturating_add(Weight::from_proof_size(24668)) + Weight::from_parts(61_264_000, 0) + .saturating_add(Weight::from_parts(0, 24668)) .saturating_add(T::DbWeight::get().reads(9_u64)) .saturating_add(T::DbWeight::get().writes(6_u64)) } @@ -203,8 +203,8 @@ impl WeightInfo for SubstrateWeight { // Proof: DappsStaking Ledger (max_values: None, max_size: Some(266), added: 2741, mode: MaxEncodedLen) fn claim_staker_without_restake() -> Weight { // Minimum execution time: 33_178 nanoseconds. - Weight::from_ref_time(33_576_000) - .saturating_add(Weight::from_proof_size(13183)) + Weight::from_parts(33_576_000, 0) + .saturating_add(Weight::from_parts(0, 13183)) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -216,27 +216,27 @@ impl WeightInfo for SubstrateWeight { // Proof: DappsStaking GeneralEraInfo (max_values: None, max_size: Some(76), added: 2551, mode: MaxEncodedLen) fn claim_dapp() -> Weight { // Minimum execution time: 25_126 nanoseconds. - Weight::from_ref_time(25_489_000) - .saturating_add(Weight::from_proof_size(7669)) + Weight::from_parts(25_489_000, 0) + .saturating_add(Weight::from_parts(0, 7669)) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } fn force_new_era() -> Weight { // Minimum execution time: 3_446 nanoseconds. - Weight::from_ref_time(3_676_000) - .saturating_add(Weight::from_proof_size(0)) + Weight::from_parts(3_676_000, 0) + .saturating_add(Weight::from_parts(0, 0)) } fn maintenance_mode() -> Weight { // Minimum execution time: 7_871 nanoseconds. - Weight::from_ref_time(8_137_000) - .saturating_add(Weight::from_proof_size(0)) + Weight::from_parts(8_137_000, 0) + .saturating_add(Weight::from_parts(0, 0)) } // Storage: DappsStaking Ledger (r:1 w:1) // Proof: DappsStaking Ledger (max_values: None, max_size: Some(266), added: 2741, mode: MaxEncodedLen) fn set_reward_destination() -> Weight { // Minimum execution time: 15_697 nanoseconds. - Weight::from_ref_time(16_009_000) - .saturating_add(Weight::from_proof_size(2741)) + Weight::from_parts(16_009_000, 0) + .saturating_add(Weight::from_parts(0, 2741)) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -250,8 +250,8 @@ impl WeightInfo for () { // Proof: DappsStaking RegisteredDapps (max_values: None, max_size: Some(86), added: 2561, mode: MaxEncodedLen) fn register() -> Weight { // Minimum execution time: 25_265 nanoseconds. - Weight::from_ref_time(26_091_000) - .saturating_add(Weight::from_proof_size(5117)) + Weight::from_parts(26_091_000, 0) + .saturating_add(Weight::from_parts(0, 5117)) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -261,8 +261,8 @@ impl WeightInfo for () { // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) fn unregister() -> Weight { // Minimum execution time: 27_241 nanoseconds. - Weight::from_ref_time(27_411_000) - .saturating_add(Weight::from_proof_size(5164)) + Weight::from_parts(27_411_000, 0) + .saturating_add(Weight::from_parts(0, 5164)) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -280,8 +280,8 @@ impl WeightInfo for () { // Proof: DappsStaking GeneralEraInfo (max_values: None, max_size: Some(76), added: 2551, mode: MaxEncodedLen) fn withdraw_from_unregistered() -> Weight { // Minimum execution time: 44_491 nanoseconds. - Weight::from_ref_time(45_042_000) - .saturating_add(Weight::from_proof_size(17003)) + Weight::from_parts(45_042_000, 0) + .saturating_add(Weight::from_parts(0, 17003)) .saturating_add(RocksDbWeight::get().reads(6_u64)) .saturating_add(RocksDbWeight::get().writes(5_u64)) } @@ -299,8 +299,8 @@ impl WeightInfo for () { // Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen) fn bond_and_stake() -> Weight { // Minimum execution time: 43_099 nanoseconds. - Weight::from_ref_time(43_939_000) - .saturating_add(Weight::from_proof_size(16957)) + Weight::from_parts(43_939_000, 0) + .saturating_add(Weight::from_parts(0, 16957)) .saturating_add(RocksDbWeight::get().reads(6_u64)) .saturating_add(RocksDbWeight::get().writes(5_u64)) } @@ -318,8 +318,8 @@ impl WeightInfo for () { // Proof: DappsStaking GeneralEraInfo (max_values: None, max_size: Some(76), added: 2551, mode: MaxEncodedLen) fn unbond_and_unstake() -> Weight { // Minimum execution time: 46_783 nanoseconds. - Weight::from_ref_time(47_487_000) - .saturating_add(Weight::from_proof_size(16957)) + Weight::from_parts(47_487_000, 0) + .saturating_add(Weight::from_parts(0, 16957)) .saturating_add(RocksDbWeight::get().reads(6_u64)) .saturating_add(RocksDbWeight::get().writes(5_u64)) } @@ -331,8 +331,8 @@ impl WeightInfo for () { // Proof: DappsStaking GeneralEraInfo (max_values: None, max_size: Some(76), added: 2551, mode: MaxEncodedLen) fn withdraw_unbonded() -> Weight { // Minimum execution time: 30_952 nanoseconds. - Weight::from_ref_time(31_615_000) - .saturating_add(Weight::from_proof_size(9066)) + Weight::from_parts(31_615_000, 0) + .saturating_add(Weight::from_parts(0, 9066)) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } @@ -344,8 +344,8 @@ impl WeightInfo for () { // Proof: DappsStaking ContractEraStake (max_values: None, max_size: Some(82), added: 2557, mode: MaxEncodedLen) fn nomination_transfer() -> Weight { // Minimum execution time: 38_247 nanoseconds. - Weight::from_ref_time(38_832_000) - .saturating_add(Weight::from_proof_size(15782)) + Weight::from_parts(38_832_000, 0) + .saturating_add(Weight::from_parts(0, 15782)) .saturating_add(RocksDbWeight::get().reads(6_u64)) .saturating_add(RocksDbWeight::get().writes(4_u64)) } @@ -365,8 +365,8 @@ impl WeightInfo for () { // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) fn claim_staker_with_restake() -> Weight { // Minimum execution time: 60_558 nanoseconds. - Weight::from_ref_time(61_264_000) - .saturating_add(Weight::from_proof_size(24668)) + Weight::from_parts(61_264_000, 0) + .saturating_add(Weight::from_parts(0, 24668)) .saturating_add(RocksDbWeight::get().reads(9_u64)) .saturating_add(RocksDbWeight::get().writes(6_u64)) } @@ -382,8 +382,8 @@ impl WeightInfo for () { // Proof: DappsStaking Ledger (max_values: None, max_size: Some(266), added: 2741, mode: MaxEncodedLen) fn claim_staker_without_restake() -> Weight { // Minimum execution time: 33_178 nanoseconds. - Weight::from_ref_time(33_576_000) - .saturating_add(Weight::from_proof_size(13183)) + Weight::from_parts(33_576_000, 0) + .saturating_add(Weight::from_parts(0, 13183)) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -395,27 +395,27 @@ impl WeightInfo for () { // Proof: DappsStaking GeneralEraInfo (max_values: None, max_size: Some(76), added: 2551, mode: MaxEncodedLen) fn claim_dapp() -> Weight { // Minimum execution time: 25_126 nanoseconds. - Weight::from_ref_time(25_489_000) - .saturating_add(Weight::from_proof_size(7669)) + Weight::from_parts(25_489_000, 0) + .saturating_add(Weight::from_parts(0, 7669)) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } fn force_new_era() -> Weight { // Minimum execution time: 3_446 nanoseconds. - Weight::from_ref_time(3_676_000) - .saturating_add(Weight::from_proof_size(0)) + Weight::from_parts(3_676_000, 0) + .saturating_add(Weight::from_parts(0, 0)) } fn maintenance_mode() -> Weight { // Minimum execution time: 7_871 nanoseconds. - Weight::from_ref_time(8_137_000) - .saturating_add(Weight::from_proof_size(0)) + Weight::from_parts(8_137_000, 0) + .saturating_add(Weight::from_parts(0, 0)) } // Storage: DappsStaking Ledger (r:1 w:1) // Proof: DappsStaking Ledger (max_values: None, max_size: Some(266), added: 2741, mode: MaxEncodedLen) fn set_reward_destination() -> Weight { // Minimum execution time: 15_697 nanoseconds. - Weight::from_ref_time(16_009_000) - .saturating_add(Weight::from_proof_size(2741)) + Weight::from_parts(16_009_000, 0) + .saturating_add(Weight::from_parts(0, 2741)) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } diff --git a/frame/pallet-xcm/Cargo.toml b/frame/pallet-xcm/Cargo.toml index ec72ad31..c2f814bd 100644 --- a/frame/pallet-xcm/Cargo.toml +++ b/frame/pallet-xcm/Cargo.toml @@ -1,7 +1,7 @@ [package] authors = ["Parity Technologies ", "Stake Technologies "] name = "pallet-xcm" -version = "0.9.39" +version = "0.9.40" edition.workspace = true homepage.workspace = true repository.workspace = true diff --git a/frame/pallet-xcm/src/lib.rs b/frame/pallet-xcm/src/lib.rs index 24970ede..470f5033 100644 --- a/frame/pallet-xcm/src/lib.rs +++ b/frame/pallet-xcm/src/lib.rs @@ -83,67 +83,67 @@ pub trait WeightInfo { pub struct TestWeightInfo; impl WeightInfo for TestWeightInfo { fn send() -> Weight { - Weight::from_ref_time(100_000_000) + Weight::from_parts(100_000_000, 0) } fn teleport_assets() -> Weight { - Weight::from_ref_time(100_000_000) + Weight::from_parts(100_000_000, 0) } fn reserve_transfer_assets() -> Weight { - Weight::from_ref_time(100_000_000) + Weight::from_parts(100_000_000, 0) } fn execute() -> Weight { - Weight::from_ref_time(100_000_000) + Weight::from_parts(100_000_000, 0) } fn force_xcm_version() -> Weight { - Weight::from_ref_time(100_000_000) + Weight::from_parts(100_000_000, 0) } fn force_default_xcm_version() -> Weight { - Weight::from_ref_time(100_000_000) + Weight::from_parts(100_000_000, 0) } fn force_subscribe_version_notify() -> Weight { - Weight::from_ref_time(100_000_000) + Weight::from_parts(100_000_000, 0) } fn force_unsubscribe_version_notify() -> Weight { - Weight::from_ref_time(100_000_000) + Weight::from_parts(100_000_000, 0) } fn migrate_supported_version() -> Weight { - Weight::from_ref_time(100_000_000) + Weight::from_parts(100_000_000, 0) } fn migrate_version_notifiers() -> Weight { - Weight::from_ref_time(100_000_000) + Weight::from_parts(100_000_000, 0) } fn already_notified_target() -> Weight { - Weight::from_ref_time(100_000_000) + Weight::from_parts(100_000_000, 0) } fn notify_current_targets() -> Weight { - Weight::from_ref_time(100_000_000) + Weight::from_parts(100_000_000, 0) } fn notify_target_migration_fail() -> Weight { - Weight::from_ref_time(100_000_000) + Weight::from_parts(100_000_000, 0) } fn migrate_version_notify_targets() -> Weight { - Weight::from_ref_time(100_000_000) + Weight::from_parts(100_000_000, 0) } fn migrate_and_notify_old_targets() -> Weight { - Weight::from_ref_time(100_000_000) + Weight::from_parts(100_000_000, 0) } fn reserve_withdraw_assets() -> Weight { - Weight::from_ref_time(100_000_000) + Weight::from_parts(100_000_000, 0) } } @@ -165,7 +165,6 @@ pub mod pallet { } #[pallet::pallet] - #[pallet::generate_store(pub(super) trait Store)] #[pallet::storage_version(migration::STORAGE_VERSION)] #[pallet::without_storage_info] pub struct Pallet(_); diff --git a/frame/pallet-xcm/src/migration.rs b/frame/pallet-xcm/src/migration.rs index 20d7739a..ddee5a43 100644 --- a/frame/pallet-xcm/src/migration.rs +++ b/frame/pallet-xcm/src/migration.rs @@ -16,7 +16,7 @@ // You should have received a copy of the GNU General Public License // along with Astar. If not, see . -use crate::{Config, Pallet, Store}; +use crate::{Config, Pallet, VersionNotifyTargets}; use frame_support::{ pallet_prelude::*, traits::{OnRuntimeUpgrade, StorageVersion}, @@ -53,7 +53,7 @@ pub mod v1 { Some(translated) }; - as Store>::VersionNotifyTargets::translate_values(translate); + VersionNotifyTargets::::translate_values(translate); log::info!("v1 applied successfully"); STORAGE_VERSION.put::>(); diff --git a/frame/pallet-xcm/src/mock.rs b/frame/pallet-xcm/src/mock.rs index be7091eb..c10d2df4 100644 --- a/frame/pallet-xcm/src/mock.rs +++ b/frame/pallet-xcm/src/mock.rs @@ -53,7 +53,6 @@ pub mod pallet_test_notifier { use xcm::latest::prelude::*; #[pallet::pallet] - #[pallet::generate_store(pub(super) trait Store)] pub struct Pallet(_); #[pallet::config] diff --git a/frame/pallet-xcm/src/weights.rs b/frame/pallet-xcm/src/weights.rs index f56e439c..bc5c452d 100644 --- a/frame/pallet-xcm/src/weights.rs +++ b/frame/pallet-xcm/src/weights.rs @@ -62,8 +62,8 @@ impl WeightInfo for SubstrateWeight { // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) fn send() -> Weight { // Minimum execution time: 28_954 nanoseconds. - Weight::from_ref_time(29_757_000) - .saturating_add(Weight::from_proof_size(5010)) + Weight::from_parts(29_757_000, 0) + .saturating_add(Weight::from_parts(0, 5010)) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -71,8 +71,8 @@ impl WeightInfo for SubstrateWeight { // Proof Skipped: Benchmark Override (max_values: None, max_size: None, mode: Measured) fn teleport_assets() -> Weight { // Minimum execution time: 18_446_744_073_709_551 nanoseconds. - Weight::from_ref_time(18_446_744_073_709_551_000) - .saturating_add(Weight::from_proof_size(0)) + Weight::from_parts(18_446_744_073_709_551_000, 0) + .saturating_add(Weight::from_parts(0, 0)) } // Storage: ParachainInfo ParachainId (r:1 w:0) // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) @@ -80,31 +80,31 @@ impl WeightInfo for SubstrateWeight { // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) fn reserve_transfer_assets() -> Weight { // Minimum execution time: 31_227 nanoseconds. - Weight::from_ref_time(31_863_000) - .saturating_add(Weight::from_proof_size(5705)) + Weight::from_parts(31_863_000, 0) + .saturating_add(Weight::from_parts(0, 5705)) .saturating_add(T::DbWeight::get().reads(3_u64)) } // Storage: Benchmark Override (r:0 w:0) // Proof Skipped: Benchmark Override (max_values: None, max_size: None, mode: Measured) fn execute() -> Weight { // Minimum execution time: 18_446_744_073_709_551 nanoseconds. - Weight::from_ref_time(18_446_744_073_709_551_000) - .saturating_add(Weight::from_proof_size(0)) + Weight::from_parts(18_446_744_073_709_551_000, 0) + .saturating_add(Weight::from_parts(0, 0)) } // Storage: PolkadotXcm SupportedVersion (r:0 w:1) // Proof Skipped: PolkadotXcm SupportedVersion (max_values: None, max_size: None, mode: Measured) fn force_xcm_version() -> Weight { // Minimum execution time: 9_393 nanoseconds. - Weight::from_ref_time(9_916_000) - .saturating_add(Weight::from_proof_size(0)) + Weight::from_parts(9_916_000, 0) + .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1_u64)) } // Storage: PolkadotXcm SafeXcmVersion (r:0 w:1) // Proof Skipped: PolkadotXcm SafeXcmVersion (max_values: Some(1), max_size: None, mode: Measured) fn force_default_xcm_version() -> Weight { // Minimum execution time: 2_828 nanoseconds. - Weight::from_ref_time(2_982_000) - .saturating_add(Weight::from_proof_size(0)) + Weight::from_parts(2_982_000, 0) + .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1_u64)) } // Storage: PolkadotXcm VersionNotifiers (r:1 w:1) @@ -125,8 +125,8 @@ impl WeightInfo for SubstrateWeight { // Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) fn force_subscribe_version_notify() -> Weight { // Minimum execution time: 32_918 nanoseconds. - Weight::from_ref_time(35_102_000) - .saturating_add(Weight::from_proof_size(8313)) + Weight::from_parts(35_102_000, 0) + .saturating_add(Weight::from_parts(0, 8313)) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } @@ -146,8 +146,8 @@ impl WeightInfo for SubstrateWeight { // Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) fn force_unsubscribe_version_notify() -> Weight { // Minimum execution time: 35_929 nanoseconds. - Weight::from_ref_time(36_954_000) - .saturating_add(Weight::from_proof_size(8988)) + Weight::from_parts(36_954_000, 0) + .saturating_add(Weight::from_parts(0, 8988)) .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } @@ -155,8 +155,8 @@ impl WeightInfo for SubstrateWeight { // Proof Skipped: PolkadotXcm SupportedVersion (max_values: None, max_size: None, mode: Measured) fn migrate_supported_version() -> Weight { // Minimum execution time: 17_936 nanoseconds. - Weight::from_ref_time(18_392_000) - .saturating_add(Weight::from_proof_size(10029)) + Weight::from_parts(18_392_000, 0) + .saturating_add(Weight::from_parts(0, 10029)) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -164,8 +164,8 @@ impl WeightInfo for SubstrateWeight { // Proof Skipped: PolkadotXcm VersionNotifiers (max_values: None, max_size: None, mode: Measured) fn migrate_version_notifiers() -> Weight { // Minimum execution time: 17_874 nanoseconds. - Weight::from_ref_time(18_353_000) - .saturating_add(Weight::from_proof_size(10033)) + Weight::from_parts(18_353_000, 0) + .saturating_add(Weight::from_parts(0, 10033)) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -173,8 +173,8 @@ impl WeightInfo for SubstrateWeight { // Proof Skipped: PolkadotXcm VersionNotifyTargets (max_values: None, max_size: None, mode: Measured) fn already_notified_target() -> Weight { // Minimum execution time: 20_320 nanoseconds. - Weight::from_ref_time(20_858_000) - .saturating_add(Weight::from_proof_size(12515)) + Weight::from_parts(20_858_000, 0) + .saturating_add(Weight::from_parts(0, 12515)) .saturating_add(T::DbWeight::get().reads(5_u64)) } // Storage: PolkadotXcm VersionNotifyTargets (r:2 w:1) @@ -191,8 +191,8 @@ impl WeightInfo for SubstrateWeight { // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) fn notify_current_targets() -> Weight { // Minimum execution time: 33_135 nanoseconds. - Weight::from_ref_time(33_575_000) - .saturating_add(Weight::from_proof_size(10473)) + Weight::from_parts(33_575_000, 0) + .saturating_add(Weight::from_parts(0, 10473)) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -200,16 +200,16 @@ impl WeightInfo for SubstrateWeight { // Proof Skipped: PolkadotXcm VersionNotifyTargets (max_values: None, max_size: None, mode: Measured) fn notify_target_migration_fail() -> Weight { // Minimum execution time: 8_047 nanoseconds. - Weight::from_ref_time(8_255_000) - .saturating_add(Weight::from_proof_size(7597)) + Weight::from_parts(8_255_000, 0) + .saturating_add(Weight::from_parts(0, 7597)) .saturating_add(T::DbWeight::get().reads(3_u64)) } // Storage: PolkadotXcm VersionNotifyTargets (r:4 w:2) // Proof Skipped: PolkadotXcm VersionNotifyTargets (max_values: None, max_size: None, mode: Measured) fn migrate_version_notify_targets() -> Weight { // Minimum execution time: 17_230 nanoseconds. - Weight::from_ref_time(17_749_000) - .saturating_add(Weight::from_proof_size(10040)) + Weight::from_parts(17_749_000, 0) + .saturating_add(Weight::from_parts(0, 10040)) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -227,8 +227,8 @@ impl WeightInfo for SubstrateWeight { // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) fn migrate_and_notify_old_targets() -> Weight { // Minimum execution time: 61_977 nanoseconds. - Weight::from_ref_time(62_285_000) - .saturating_add(Weight::from_proof_size(15447)) + Weight::from_parts(62_285_000, 0) + .saturating_add(Weight::from_parts(0, 15447)) .saturating_add(T::DbWeight::get().reads(9_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } @@ -238,8 +238,8 @@ impl WeightInfo for SubstrateWeight { // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) fn reserve_withdraw_assets() -> Weight { // Minimum execution time: 32_020 nanoseconds. - Weight::from_ref_time(32_452_000) - .saturating_add(Weight::from_proof_size(3102)) + Weight::from_parts(32_452_000, 0) + .saturating_add(Weight::from_parts(0, 3102)) .saturating_add(T::DbWeight::get().reads(2_u64)) } } @@ -258,8 +258,8 @@ impl WeightInfo for () { // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) fn send() -> Weight { // Minimum execution time: 28_954 nanoseconds. - Weight::from_ref_time(29_757_000) - .saturating_add(Weight::from_proof_size(5010)) + Weight::from_parts(29_757_000, 0) + .saturating_add(Weight::from_parts(0, 5010)) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -267,8 +267,8 @@ impl WeightInfo for () { // Proof Skipped: Benchmark Override (max_values: None, max_size: None, mode: Measured) fn teleport_assets() -> Weight { // Minimum execution time: 18_446_744_073_709_551 nanoseconds. - Weight::from_ref_time(18_446_744_073_709_551_000) - .saturating_add(Weight::from_proof_size(0)) + Weight::from_parts(18_446_744_073_709_551_000, 0) + .saturating_add(Weight::from_parts(0, 0)) } // Storage: ParachainInfo ParachainId (r:1 w:0) // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) @@ -276,31 +276,31 @@ impl WeightInfo for () { // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) fn reserve_transfer_assets() -> Weight { // Minimum execution time: 31_227 nanoseconds. - Weight::from_ref_time(31_863_000) - .saturating_add(Weight::from_proof_size(5705)) + Weight::from_parts(31_863_000, 0) + .saturating_add(Weight::from_parts(0, 5705)) .saturating_add(RocksDbWeight::get().reads(3_u64)) } // Storage: Benchmark Override (r:0 w:0) // Proof Skipped: Benchmark Override (max_values: None, max_size: None, mode: Measured) fn execute() -> Weight { // Minimum execution time: 18_446_744_073_709_551 nanoseconds. - Weight::from_ref_time(18_446_744_073_709_551_000) - .saturating_add(Weight::from_proof_size(0)) + Weight::from_parts(18_446_744_073_709_551_000, 0) + .saturating_add(Weight::from_parts(0, 0)) } // Storage: PolkadotXcm SupportedVersion (r:0 w:1) // Proof Skipped: PolkadotXcm SupportedVersion (max_values: None, max_size: None, mode: Measured) fn force_xcm_version() -> Weight { // Minimum execution time: 9_393 nanoseconds. - Weight::from_ref_time(9_916_000) - .saturating_add(Weight::from_proof_size(0)) + Weight::from_parts(9_916_000, 0) + .saturating_add(Weight::from_parts(0, 0)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } // Storage: PolkadotXcm SafeXcmVersion (r:0 w:1) // Proof Skipped: PolkadotXcm SafeXcmVersion (max_values: Some(1), max_size: None, mode: Measured) fn force_default_xcm_version() -> Weight { // Minimum execution time: 2_828 nanoseconds. - Weight::from_ref_time(2_982_000) - .saturating_add(Weight::from_proof_size(0)) + Weight::from_parts(2_982_000, 0) + .saturating_add(Weight::from_parts(0, 0)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } // Storage: PolkadotXcm VersionNotifiers (r:1 w:1) @@ -321,8 +321,8 @@ impl WeightInfo for () { // Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) fn force_subscribe_version_notify() -> Weight { // Minimum execution time: 32_918 nanoseconds. - Weight::from_ref_time(35_102_000) - .saturating_add(Weight::from_proof_size(8313)) + Weight::from_parts(35_102_000, 0) + .saturating_add(Weight::from_parts(0, 8313)) .saturating_add(RocksDbWeight::get().reads(7_u64)) .saturating_add(RocksDbWeight::get().writes(5_u64)) } @@ -342,8 +342,8 @@ impl WeightInfo for () { // Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) fn force_unsubscribe_version_notify() -> Weight { // Minimum execution time: 35_929 nanoseconds. - Weight::from_ref_time(36_954_000) - .saturating_add(Weight::from_proof_size(8988)) + Weight::from_parts(36_954_000, 0) + .saturating_add(Weight::from_parts(0, 8988)) .saturating_add(RocksDbWeight::get().reads(6_u64)) .saturating_add(RocksDbWeight::get().writes(4_u64)) } @@ -351,8 +351,8 @@ impl WeightInfo for () { // Proof Skipped: PolkadotXcm SupportedVersion (max_values: None, max_size: None, mode: Measured) fn migrate_supported_version() -> Weight { // Minimum execution time: 17_936 nanoseconds. - Weight::from_ref_time(18_392_000) - .saturating_add(Weight::from_proof_size(10029)) + Weight::from_parts(18_392_000, 0) + .saturating_add(Weight::from_parts(0, 10029)) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -360,8 +360,8 @@ impl WeightInfo for () { // Proof Skipped: PolkadotXcm VersionNotifiers (max_values: None, max_size: None, mode: Measured) fn migrate_version_notifiers() -> Weight { // Minimum execution time: 17_874 nanoseconds. - Weight::from_ref_time(18_353_000) - .saturating_add(Weight::from_proof_size(10033)) + Weight::from_parts(18_353_000, 0) + .saturating_add(Weight::from_parts(0, 10033)) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -369,8 +369,8 @@ impl WeightInfo for () { // Proof Skipped: PolkadotXcm VersionNotifyTargets (max_values: None, max_size: None, mode: Measured) fn already_notified_target() -> Weight { // Minimum execution time: 20_320 nanoseconds. - Weight::from_ref_time(20_858_000) - .saturating_add(Weight::from_proof_size(12515)) + Weight::from_parts(20_858_000, 0) + .saturating_add(Weight::from_parts(0, 12515)) .saturating_add(RocksDbWeight::get().reads(5_u64)) } // Storage: PolkadotXcm VersionNotifyTargets (r:2 w:1) @@ -387,8 +387,8 @@ impl WeightInfo for () { // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) fn notify_current_targets() -> Weight { // Minimum execution time: 33_135 nanoseconds. - Weight::from_ref_time(33_575_000) - .saturating_add(Weight::from_proof_size(10473)) + Weight::from_parts(33_575_000, 0) + .saturating_add(Weight::from_parts(0, 10473)) .saturating_add(RocksDbWeight::get().reads(7_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } @@ -396,16 +396,16 @@ impl WeightInfo for () { // Proof Skipped: PolkadotXcm VersionNotifyTargets (max_values: None, max_size: None, mode: Measured) fn notify_target_migration_fail() -> Weight { // Minimum execution time: 8_047 nanoseconds. - Weight::from_ref_time(8_255_000) - .saturating_add(Weight::from_proof_size(7597)) + Weight::from_parts(8_255_000, 0) + .saturating_add(Weight::from_parts(0, 7597)) .saturating_add(RocksDbWeight::get().reads(3_u64)) } // Storage: PolkadotXcm VersionNotifyTargets (r:4 w:2) // Proof Skipped: PolkadotXcm VersionNotifyTargets (max_values: None, max_size: None, mode: Measured) fn migrate_version_notify_targets() -> Weight { // Minimum execution time: 17_230 nanoseconds. - Weight::from_ref_time(17_749_000) - .saturating_add(Weight::from_proof_size(10040)) + Weight::from_parts(17_749_000, 0) + .saturating_add(Weight::from_parts(0, 10040)) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -423,8 +423,8 @@ impl WeightInfo for () { // Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) fn migrate_and_notify_old_targets() -> Weight { // Minimum execution time: 61_977 nanoseconds. - Weight::from_ref_time(62_285_000) - .saturating_add(Weight::from_proof_size(15447)) + Weight::from_parts(62_285_000, 0) + .saturating_add(Weight::from_parts(0, 15447)) .saturating_add(RocksDbWeight::get().reads(9_u64)) .saturating_add(RocksDbWeight::get().writes(4_u64)) } @@ -434,8 +434,8 @@ impl WeightInfo for () { // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) fn reserve_withdraw_assets() -> Weight { // Minimum execution time: 32_020 nanoseconds. - Weight::from_ref_time(32_452_000) - .saturating_add(Weight::from_proof_size(3102)) + Weight::from_parts(32_452_000, 0) + .saturating_add(Weight::from_parts(0, 3102)) .saturating_add(RocksDbWeight::get().reads(2_u64)) } } diff --git a/frame/xc-asset-config/src/mock.rs b/frame/xc-asset-config/src/mock.rs index 77cf85e7..143ddf8e 100644 --- a/frame/xc-asset-config/src/mock.rs +++ b/frame/xc-asset-config/src/mock.rs @@ -52,7 +52,7 @@ construct_runtime!( parameter_types! { pub const BlockHashCount: u64 = 250; pub BlockWeights: frame_system::limits::BlockWeights = - frame_system::limits::BlockWeights::simple_max(Weight::from_ref_time(1024)); + frame_system::limits::BlockWeights::simple_max(Weight::from_parts(1024, 0)); } impl frame_system::Config for Test { diff --git a/frame/xc-asset-config/src/weights.rs b/frame/xc-asset-config/src/weights.rs index 67ddd81b..07942580 100644 --- a/frame/xc-asset-config/src/weights.rs +++ b/frame/xc-asset-config/src/weights.rs @@ -65,8 +65,8 @@ impl WeightInfo for SubstrateWeight { // Proof Skipped: XcAssetConfig AssetLocationToId (max_values: None, max_size: None, mode: Measured) fn register_asset_location() -> Weight { // Minimum execution time: 15_540 nanoseconds. - Weight::from_ref_time(16_114_000) - .saturating_add(Weight::from_proof_size(2493)) + Weight::from_parts(16_114_000, 0) + .saturating_add(Weight::from_parts(0, 2493)) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -76,8 +76,8 @@ impl WeightInfo for SubstrateWeight { // Proof Skipped: XcAssetConfig AssetLocationUnitsPerSecond (max_values: None, max_size: None, mode: Measured) fn set_asset_units_per_second() -> Weight { // Minimum execution time: 15_297 nanoseconds. - Weight::from_ref_time(15_551_000) - .saturating_add(Weight::from_proof_size(2661)) + Weight::from_parts(15_551_000, 0) + .saturating_add(Weight::from_parts(0, 2661)) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -89,8 +89,8 @@ impl WeightInfo for SubstrateWeight { // Proof Skipped: XcAssetConfig AssetLocationToId (max_values: None, max_size: None, mode: Measured) fn change_existing_asset_location() -> Weight { // Minimum execution time: 22_357 nanoseconds. - Weight::from_ref_time(22_572_000) - .saturating_add(Weight::from_proof_size(5373)) + Weight::from_parts(22_572_000, 0) + .saturating_add(Weight::from_parts(0, 5373)) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } @@ -98,8 +98,8 @@ impl WeightInfo for SubstrateWeight { // Proof Skipped: XcAssetConfig AssetLocationUnitsPerSecond (max_values: None, max_size: None, mode: Measured) fn remove_payment_asset() -> Weight { // Minimum execution time: 9_707 nanoseconds. - Weight::from_ref_time(10_005_000) - .saturating_add(Weight::from_proof_size(0)) + Weight::from_parts(10_005_000, 0) + .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1_u64)) } // Storage: XcAssetConfig AssetIdToLocation (r:1 w:1) @@ -112,8 +112,8 @@ impl WeightInfo for SubstrateWeight { // Proof Skipped: XcAssetConfig AssetLocationToId (max_values: None, max_size: None, mode: Measured) fn remove_asset() -> Weight { // Minimum execution time: 18_645 nanoseconds. - Weight::from_ref_time(18_878_000) - .saturating_add(Weight::from_proof_size(2987)) + Weight::from_parts(18_878_000, 0) + .saturating_add(Weight::from_parts(0, 2987)) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } @@ -129,8 +129,8 @@ impl WeightInfo for () { // Proof Skipped: XcAssetConfig AssetLocationToId (max_values: None, max_size: None, mode: Measured) fn register_asset_location() -> Weight { // Minimum execution time: 15_540 nanoseconds. - Weight::from_ref_time(16_114_000) - .saturating_add(Weight::from_proof_size(2493)) + Weight::from_parts(16_114_000, 0) + .saturating_add(Weight::from_parts(0, 2493)) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } @@ -140,8 +140,8 @@ impl WeightInfo for () { // Proof Skipped: XcAssetConfig AssetLocationUnitsPerSecond (max_values: None, max_size: None, mode: Measured) fn set_asset_units_per_second() -> Weight { // Minimum execution time: 15_297 nanoseconds. - Weight::from_ref_time(15_551_000) - .saturating_add(Weight::from_proof_size(2661)) + Weight::from_parts(15_551_000, 0) + .saturating_add(Weight::from_parts(0, 2661)) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -153,8 +153,8 @@ impl WeightInfo for () { // Proof Skipped: XcAssetConfig AssetLocationToId (max_values: None, max_size: None, mode: Measured) fn change_existing_asset_location() -> Weight { // Minimum execution time: 22_357 nanoseconds. - Weight::from_ref_time(22_572_000) - .saturating_add(Weight::from_proof_size(5373)) + Weight::from_parts(22_572_000, 0) + .saturating_add(Weight::from_parts(0, 5373)) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(5_u64)) } @@ -162,8 +162,8 @@ impl WeightInfo for () { // Proof Skipped: XcAssetConfig AssetLocationUnitsPerSecond (max_values: None, max_size: None, mode: Measured) fn remove_payment_asset() -> Weight { // Minimum execution time: 9_707 nanoseconds. - Weight::from_ref_time(10_005_000) - .saturating_add(Weight::from_proof_size(0)) + Weight::from_parts(10_005_000, 0) + .saturating_add(Weight::from_parts(0, 0)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } // Storage: XcAssetConfig AssetIdToLocation (r:1 w:1) @@ -176,8 +176,8 @@ impl WeightInfo for () { // Proof Skipped: XcAssetConfig AssetLocationToId (max_values: None, max_size: None, mode: Measured) fn remove_asset() -> Weight { // Minimum execution time: 18_645 nanoseconds. - Weight::from_ref_time(18_878_000) - .saturating_add(Weight::from_proof_size(2987)) + Weight::from_parts(18_878_000, 0) + .saturating_add(Weight::from_parts(0, 2987)) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(4_u64)) } diff --git a/precompiles/assets-erc20/src/lib.rs b/precompiles/assets-erc20/src/lib.rs index 8195f418..0471098d 100644 --- a/precompiles/assets-erc20/src/lib.rs +++ b/precompiles/assets-erc20/src/lib.rs @@ -37,7 +37,7 @@ #![cfg_attr(not(feature = "std"), no_std)] #![cfg_attr(test, feature(assert_matches))] -use fp_evm::{PrecompileHandle, PrecompileOutput}; +use fp_evm::{IsPrecompileResult, PrecompileHandle, PrecompileOutput}; use frame_support::traits::fungibles::approvals::Inspect as ApprovalInspect; use frame_support::traits::fungibles::metadata::Inspect as MetadataInspect; use frame_support::traits::fungibles::Inspect; @@ -185,8 +185,8 @@ where None } - fn is_precompile(&self, address: H160) -> bool { - if let Some(asset_id) = Runtime::address_to_asset_id(address) { + fn is_precompile(&self, address: H160, _gas: u64) -> IsPrecompileResult { + let is_precompile = if let Some(asset_id) = Runtime::address_to_asset_id(address) { // If the assetId has non-zero supply // "total_supply" returns both 0 if the assetId does not exist or if the supply is 0 // The assumption I am making here is that a 0 supply asset is not interesting from @@ -197,6 +197,11 @@ where !pallet_assets::Pallet::::total_supply(asset_id).is_zero() } else { false + }; + + IsPrecompileResult::Answer { + is_precompile, + extra_cost: 0, } } } diff --git a/precompiles/assets-erc20/src/mock.rs b/precompiles/assets-erc20/src/mock.rs index 9e182181..9a33b8cb 100644 --- a/precompiles/assets-erc20/src/mock.rs +++ b/precompiles/assets-erc20/src/mock.rs @@ -223,7 +223,7 @@ impl pallet_balances::Config for Runtime { parameter_types! { pub const PrecompilesValue: Erc20AssetsPrecompileSet = Erc20AssetsPrecompileSet(PhantomData); - pub WeightPerGas: Weight = Weight::from_ref_time(1); + pub WeightPerGas: Weight = Weight::from_parts(1, 0); } impl pallet_evm::Config for Runtime { @@ -238,6 +238,7 @@ impl pallet_evm::Config for Runtime { type Runner = pallet_evm::runner::stack::Runner; type PrecompilesType = Erc20AssetsPrecompileSet; type PrecompilesValue = PrecompilesValue; + type Timestamp = Timestamp; type ChainId = (); type OnChargeTransaction = (); type BlockGasLimit = (); diff --git a/precompiles/dapps-staking/src/mock.rs b/precompiles/dapps-staking/src/mock.rs index cc6ffc10..3be46b8e 100644 --- a/precompiles/dapps-staking/src/mock.rs +++ b/precompiles/dapps-staking/src/mock.rs @@ -18,6 +18,7 @@ use super::*; +use fp_evm::IsPrecompileResult; use frame_support::{ construct_runtime, parameter_types, traits::{Currency, OnFinalize, OnInitialize}, @@ -147,7 +148,7 @@ pub const WRITE_WEIGHT: u64 = 7; parameter_types! { pub const BlockHashCount: u64 = 250; pub BlockWeights: frame_system::limits::BlockWeights = - frame_system::limits::BlockWeights::simple_max(Weight::from_ref_time(1024)); + frame_system::limits::BlockWeights::simple_max(Weight::from_parts(1024, 0)); pub const TestWeights: RuntimeDbWeight = RuntimeDbWeight { read: READ_WEIGHT, write: WRITE_WEIGHT, @@ -215,14 +216,17 @@ where } } - fn is_precompile(&self, address: sp_core::H160) -> bool { - address == precompile_address() + fn is_precompile(&self, address: sp_core::H160, _gas: u64) -> IsPrecompileResult { + IsPrecompileResult::Answer { + is_precompile: address == precompile_address(), + extra_cost: 0, + } } } parameter_types! { pub PrecompilesValue: DappPrecompile = DappPrecompile(Default::default()); - pub WeightPerGas: Weight = Weight::from_ref_time(1); + pub WeightPerGas: Weight = Weight::from_parts(1, 0); } impl pallet_evm::Config for TestRuntime { @@ -237,6 +241,7 @@ impl pallet_evm::Config for TestRuntime { type Runner = pallet_evm::runner::stack::Runner; type PrecompilesType = DappPrecompile; type PrecompilesValue = PrecompilesValue; + type Timestamp = Timestamp; type ChainId = (); type OnChargeTransaction = (); type BlockGasLimit = (); diff --git a/precompiles/sr25519/src/mock.rs b/precompiles/sr25519/src/mock.rs index 04b2d75d..7303be80 100644 --- a/precompiles/sr25519/src/mock.rs +++ b/precompiles/sr25519/src/mock.rs @@ -20,6 +20,7 @@ use super::*; +use fp_evm::IsPrecompileResult; use frame_support::{construct_runtime, parameter_types, traits::Everything, weights::Weight}; use parity_scale_codec::{Decode, Encode, MaxEncodedLen}; use scale_info::TypeInfo; @@ -148,8 +149,11 @@ where } } - fn is_precompile(&self, address: H160) -> bool { - address == PRECOMPILE_ADDRESS + fn is_precompile(&self, address: H160, _gas: u64) -> IsPrecompileResult { + IsPrecompileResult::Answer { + is_precompile: address == PRECOMPILE_ADDRESS, + extra_cost: 0, + } } } @@ -183,7 +187,7 @@ impl pallet_balances::Config for Runtime { parameter_types! { pub const PrecompilesValue: TestPrecompileSet = TestPrecompileSet(PhantomData); - pub const WeightPerGas: Weight = Weight::from_ref_time(1); + pub const WeightPerGas: Weight = Weight::from_parts(1, 0); } impl pallet_evm::Config for Runtime { @@ -198,6 +202,7 @@ impl pallet_evm::Config for Runtime { type Runner = pallet_evm::runner::stack::Runner; type PrecompilesType = TestPrecompileSet; type PrecompilesValue = PrecompilesValue; + type Timestamp = Timestamp; type ChainId = (); type OnChargeTransaction = (); type BlockGasLimit = (); diff --git a/precompiles/substrate-ecdsa/src/mock.rs b/precompiles/substrate-ecdsa/src/mock.rs index d093e4e6..06a1a9f4 100644 --- a/precompiles/substrate-ecdsa/src/mock.rs +++ b/precompiles/substrate-ecdsa/src/mock.rs @@ -20,6 +20,7 @@ use super::*; +use fp_evm::IsPrecompileResult; use frame_support::{construct_runtime, parameter_types, traits::Everything, weights::Weight}; use parity_scale_codec::{Decode, Encode, MaxEncodedLen}; use scale_info::TypeInfo; @@ -148,8 +149,11 @@ where } } - fn is_precompile(&self, address: H160) -> bool { - address == PRECOMPILE_ADDRESS + fn is_precompile(&self, address: H160, _gas: u64) -> IsPrecompileResult { + IsPrecompileResult::Answer { + is_precompile: address == PRECOMPILE_ADDRESS, + extra_cost: 0, + } } } @@ -183,7 +187,7 @@ impl pallet_balances::Config for Runtime { parameter_types! { pub const PrecompilesValue: TestPrecompileSet = TestPrecompileSet(PhantomData); - pub WeightPerGas: Weight = Weight::from_ref_time(1); + pub WeightPerGas: Weight = Weight::from_parts(1, 0); } impl pallet_evm::Config for Runtime { @@ -198,6 +202,7 @@ impl pallet_evm::Config for Runtime { type Runner = pallet_evm::runner::stack::Runner; type PrecompilesType = TestPrecompileSet; type PrecompilesValue = PrecompilesValue; + type Timestamp = Timestamp; type ChainId = (); type OnChargeTransaction = (); type BlockGasLimit = (); diff --git a/precompiles/xcm/src/lib.rs b/precompiles/xcm/src/lib.rs index 985efcdf..98bab3ad 100644 --- a/precompiles/xcm/src/lib.rs +++ b/precompiles/xcm/src/lib.rs @@ -266,7 +266,7 @@ where }, Transact { origin_kind: OriginKind::SovereignAccount, - require_weight_at_most: Weight::from_ref_time(transact_weight), + require_weight_at_most: Weight::from_parts(transact_weight, 0), call: remote_call.into(), }, ]); diff --git a/precompiles/xcm/src/mock.rs b/precompiles/xcm/src/mock.rs index 839484ab..e85ba0c2 100644 --- a/precompiles/xcm/src/mock.rs +++ b/precompiles/xcm/src/mock.rs @@ -20,6 +20,7 @@ use super::*; +use fp_evm::IsPrecompileResult; use frame_support::{ construct_runtime, parameter_types, traits::{AsEnsureOriginWithArg, Everything, Nothing}, @@ -199,8 +200,11 @@ where } } - fn is_precompile(&self, address: H160) -> bool { - address == PRECOMPILE_ADDRESS + fn is_precompile(&self, address: H160, _gas: u64) -> IsPrecompileResult { + IsPrecompileResult::Answer { + is_precompile: address == PRECOMPILE_ADDRESS, + extra_cost: 0, + } } } @@ -287,7 +291,7 @@ where parameter_types! { pub const PrecompilesValue: TestPrecompileSet = TestPrecompileSet(PhantomData); - pub WeightPerGas: Weight = Weight::from_ref_time(1); + pub WeightPerGas: Weight = Weight::from_parts(1, 0); } impl pallet_evm::Config for Runtime { @@ -302,6 +306,7 @@ impl pallet_evm::Config for Runtime { type Runner = pallet_evm::runner::stack::Runner; type PrecompilesType = TestPrecompileSet; type PrecompilesValue = PrecompilesValue; + type Timestamp = Timestamp; type ChainId = (); type OnChargeTransaction = (); type BlockGasLimit = (); diff --git a/precompiles/xvm/src/mock.rs b/precompiles/xvm/src/mock.rs index 2ac15830..5ebfaad7 100644 --- a/precompiles/xvm/src/mock.rs +++ b/precompiles/xvm/src/mock.rs @@ -20,6 +20,7 @@ use super::*; +use fp_evm::IsPrecompileResult; use frame_support::{construct_runtime, parameter_types, traits::Everything, weights::Weight}; use parity_scale_codec::{Decode, Encode, MaxEncodedLen}; use scale_info::TypeInfo; @@ -159,8 +160,11 @@ where } } - fn is_precompile(&self, address: H160) -> bool { - address == PRECOMPILE_ADDRESS + fn is_precompile(&self, address: H160, _gas: u64) -> IsPrecompileResult { + IsPrecompileResult::Answer { + is_precompile: address == PRECOMPILE_ADDRESS, + extra_cost: 0, + } } } @@ -194,7 +198,7 @@ impl pallet_balances::Config for Runtime { parameter_types! { pub const PrecompilesValue: TestPrecompileSet = TestPrecompileSet(PhantomData); - pub WeightPerGas: Weight = Weight::from_ref_time(1); + pub WeightPerGas: Weight = Weight::from_parts(1, 0); } impl pallet_evm::Config for Runtime { @@ -209,6 +213,7 @@ impl pallet_evm::Config for Runtime { type Runner = pallet_evm::runner::stack::Runner; type PrecompilesType = TestPrecompileSet; type PrecompilesValue = PrecompilesValue; + type Timestamp = Timestamp; type ChainId = (); type OnChargeTransaction = (); type BlockGasLimit = (); diff --git a/primitives/xcm/src/tests.rs b/primitives/xcm/src/tests.rs index a1ba9600..8d2b3c12 100644 --- a/primitives/xcm/src/tests.rs +++ b/primitives/xcm/src/tests.rs @@ -134,7 +134,7 @@ fn fixed_rate_of_foreign_asset_buy_is_ok() { id: xcm::latest::AssetId::Concrete(PARENT), fun: Fungibility::Fungible(total_payment), }; - let weight: Weight = Weight::from_ref_time(1_000_000_000); + let weight: Weight = Weight::from_parts(1_000_000_000, 0); // Calculate the expected execution fee for the execution weight let expected_execution_fee = execution_fee( @@ -168,7 +168,7 @@ fn fixed_rate_of_foreign_asset_buy_is_ok() { // 2. Buy more weight, using the same trader and asset type. Verify it works as expected. let (old_weight, old_consumed) = (fixed_rate_trader.weight, fixed_rate_trader.consumed); - let weight: Weight = Weight::from_ref_time(3_500_000_000); + let weight: Weight = Weight::from_parts(3_500_000_000, 0); let expected_execution_fee = execution_fee( weight, ExecutionPayment::get_units_per_second(PARENT).unwrap(), @@ -209,7 +209,7 @@ fn fixed_rate_of_foreign_asset_buy_is_ok() { fun: Fungibility::Fungible(total_payment), }; - let weight: Weight = Weight::from_ref_time(1_750_000_000); + let weight: Weight = Weight::from_parts(1_750_000_000, 0); let expected_execution_fee = execution_fee( weight, ExecutionPayment::get_units_per_second(PARACHAIN).unwrap(), @@ -250,7 +250,7 @@ fn fixed_rate_of_foreign_asset_buy_execution_fails() { id: xcm::latest::AssetId::Concrete(PARENT), fun: Fungibility::Fungible(total_payment), }; - let weight: Weight = Weight::from_ref_time(3_000_000_000); + let weight: Weight = Weight::from_parts(3_000_000_000, 0); // Calculate the expected execution fee for the execution weight let expected_execution_fee = execution_fee( @@ -287,7 +287,7 @@ fn fixed_rate_of_foreign_asset_refund_is_ok() { id: xcm::latest::AssetId::Concrete(PARENT), fun: Fungibility::Fungible(total_payment), }; - let weight: Weight = Weight::from_ref_time(1_000_000_000); + let weight: Weight = Weight::from_parts(1_000_000_000, 0); // Calculate the expected execution fee for the execution weight and buy it let expected_execution_fee = execution_fee( @@ -313,7 +313,7 @@ fn fixed_rate_of_foreign_asset_refund_is_ok() { // Refund more than remains and expect it to pass (saturated) let assets_to_refund = fixed_rate_trader.consumed; - let result = fixed_rate_trader.refund_weight(weight + Weight::from_ref_time(10000)); + let result = fixed_rate_trader.refund_weight(weight + Weight::from_parts(10000, 0)); if let Some(asset_location) = result { assert_eq!(asset_location, (PARENT, assets_to_refund).into()); @@ -430,7 +430,7 @@ fn allow_paid_exec_with_descend_origin_works() { let res = AllowPaidExecWithDescendOriginFrom::::should_execute( &Here.into(), &mut valid_message, - Weight::from_ref_time(150), + Weight::from_parts(150, 0), &mut Weight::zero(), ); assert_eq!(res, Ok(())); @@ -441,7 +441,7 @@ fn allow_paid_exec_with_descend_origin_works() { let res = AllowPaidExecWithDescendOriginFrom::::should_execute( &Here.into(), &mut valid_message, - Weight::from_ref_time(100), + Weight::from_parts(100, 0), &mut Weight::zero(), ); assert_eq!(res, Ok(())); @@ -452,7 +452,7 @@ fn allow_paid_exec_with_descend_origin_with_weight_correction_works() { let mut valid_message = desc_origin_barrier_valid_sequence(); // Ensure that `Limited` gets adjusted to the provided enforced_weight_limit - let enforced_weight_limit = Weight::from_ref_time(3); + let enforced_weight_limit = Weight::from_parts(3, 0); let res = AllowPaidExecWithDescendOriginFrom::::should_execute( &Here.into(), &mut valid_message, @@ -507,7 +507,7 @@ fn allow_paid_exec_with_descend_origin_with_unsupported_origin_fails() { let res = AllowPaidExecWithDescendOriginFrom::::should_execute( &Here.into(), &mut valid_message, - Weight::from_ref_time(100), + Weight::from_parts(100, 0), &mut Weight::zero(), ); assert_eq!(res, Err(())); @@ -520,7 +520,7 @@ fn allow_paid_exec_with_descend_origin_with_invalid_message_fails() { let res = AllowPaidExecWithDescendOriginFrom::::should_execute( &Here.into(), &mut invalid_message, - Weight::from_ref_time(100), + Weight::from_parts(100, 0), &mut Weight::zero(), ); assert_eq!(res, Err(())); @@ -530,7 +530,7 @@ fn allow_paid_exec_with_descend_origin_with_invalid_message_fails() { let res = AllowPaidExecWithDescendOriginFrom::::should_execute( &Here.into(), &mut invalid_message, - Weight::from_ref_time(100), + Weight::from_parts(100, 0), &mut Weight::zero(), ); assert_eq!(res, Err(())); @@ -539,7 +539,7 @@ fn allow_paid_exec_with_descend_origin_with_invalid_message_fails() { #[test] fn allow_paid_exec_with_descend_origin_too_small_weight_fails() { let mut valid_message = desc_origin_barrier_valid_sequence(); - let enforced_weight_limit = Weight::from_ref_time(29); + let enforced_weight_limit = Weight::from_parts(29, 0); // Ensure that we use `BuyExecution` with `Limited` weight but with insufficient weight. // This means that not enough execution time (weight) is being bought compared to the diff --git a/vendor/rpc/debug/src/lib.rs b/vendor/rpc/debug/src/lib.rs index f6c68c37..d917c1ef 100644 --- a/vendor/rpc/debug/src/lib.rs +++ b/vendor/rpc/debug/src/lib.rs @@ -13,7 +13,7 @@ // You should have received a copy of the GNU General Public License // along with Moonbeam. If not, see . -use futures::{SinkExt, StreamExt}; +use futures::StreamExt; use jsonrpsee::core::{async_trait, RpcResult}; pub use moonbeam_rpc_core_debug::{DebugServer, TraceParams}; @@ -71,13 +71,12 @@ impl DebugServer for Debug { transaction_hash: H256, params: Option, ) -> RpcResult { - let mut requester = self.requester.clone(); + let requester = self.requester.clone(); let (tx, rx) = oneshot::channel(); // Send a message from the rpc handler to the service level task. requester - .send(((RequesterInput::Transaction(transaction_hash), params), tx)) - .await + .unbounded_send(((RequesterInput::Transaction(transaction_hash), params), tx)) .map_err(|err| { internal_err(format!( "failed to send request to debug service : {:?}", @@ -99,13 +98,12 @@ impl DebugServer for Debug { id: RequestBlockId, params: Option, ) -> RpcResult> { - let mut requester = self.requester.clone(); + let requester = self.requester.clone(); let (tx, rx) = oneshot::channel(); // Send a message from the rpc handler to the service level task. requester - .send(((RequesterInput::Block(id), params), tx)) - .await + .unbounded_send(((RequesterInput::Block(id), params), tx)) .map_err(|err| { internal_err(format!( "failed to send request to debug service : {:?}", @@ -319,15 +317,19 @@ where let api = client.runtime_api(); // Get Blockchain backend let blockchain = backend.blockchain(); + // Get the header I want to work with. let Ok(hash) = client.expect_block_hash_from_id(&reference_id) else { - return Err(internal_err("Block header not found")) - }; + return Err(internal_err("Block header not found")) + }; let header = match client.header(hash) { Ok(Some(h)) => h, _ => return Err(internal_err("Block header not found")), }; - let schema = fc_storage::onchain_storage_schema(client.as_ref(), hash); + // Get parent blockid. + let parent_block_hash = *header.parent_hash(); + + let schema = fc_storage::onchain_storage_schema::(client.as_ref(), hash); // Using storage overrides we align with `:ethereum_schema` which will result in proper // SCALE decoding in case of migration. @@ -335,7 +337,12 @@ where Some(schema) => schema .current_transaction_statuses(hash) .unwrap_or_default(), - _ => return Err(internal_err(format!("No storage override at {:?}", hash))), + _ => { + return Err(internal_err(format!( + "No storage override at {:?}", + reference_id + ))) + } }; // Known ethereum transaction hashes. @@ -352,9 +359,6 @@ where .map_err(|e| internal_err(format!("Fail to read blockchain db: {:?}", e)))? .unwrap_or_default(); - // Get parent blockid. - let parent_block_hash = *header.parent_hash(); - // Trace the block. let f = || -> RpcResult<_> { api.initialize_block(parent_block_hash, &header) @@ -397,7 +401,7 @@ where } _ => Err(internal_err( "debug_traceBlock functions currently only support callList mode (enabled - by providing `{{'tracer': 'callTracer'}}` in the request)." + by providing `{{'tracer': 'callTracer'}}` in the request)." .to_string(), )), }; @@ -447,8 +451,8 @@ where let blockchain = backend.blockchain(); // Get the header I want to work with. let Ok(reference_hash) = client.expect_block_hash_from_id(&reference_id) else { - return Err(internal_err("Block header not found")) - }; + return Err(internal_err("Block header not found")) + }; let header = match client.header(reference_hash) { Ok(Some(h)) => h, _ => return Err(internal_err("Block header not found")), @@ -473,7 +477,8 @@ where )); }; - let schema = fc_storage::onchain_storage_schema(client.as_ref(), reference_hash); + let schema = + fc_storage::onchain_storage_schema::(client.as_ref(), reference_hash); // Get the block that contains the requested transaction. Using storage overrides we align // with `:ethereum_schema` which will result in proper SCALE decoding in case of migration. @@ -549,7 +554,7 @@ where moonbeam_client_evm_tracing::formatters::Raw::format(proxy).ok_or( internal_err( "replayed transaction generated too much data. \ - try disabling memory or storage?", + try disabling memory or storage?", ), )?, )) diff --git a/vendor/rpc/trace/src/lib.rs b/vendor/rpc/trace/src/lib.rs index 6ccb0afa..265d13cb 100644 --- a/vendor/rpc/trace/src/lib.rs +++ b/vendor/rpc/trace/src/lib.rs @@ -24,7 +24,7 @@ //! - For each traced block an async task responsible to wait for a permit, spawn a blocking //! task and waiting for the result, then send it to the main `CacheTask`. -use futures::{select, stream::FuturesUnordered, FutureExt, SinkExt, StreamExt}; +use futures::{select, stream::FuturesUnordered, FutureExt, StreamExt}; use std::{collections::BTreeMap, future::Future, marker::PhantomData, sync::Arc, time::Duration}; use tokio::{ sync::{mpsc, oneshot, Semaphore}, @@ -282,14 +282,13 @@ impl CacheRequester { #[instrument(skip(self))] pub async fn start_batch(&self, blocks: Vec) -> Result { let (response_tx, response_rx) = oneshot::channel(); - let mut sender = self.0.clone(); + let sender = self.0.clone(); sender - .send(CacheRequest::StartBatch { + .unbounded_send(CacheRequest::StartBatch { sender: response_tx, blocks, }) - .await .map_err(|e| { format!( "Failed to send request to the trace cache task. Error : {:?}", @@ -312,14 +311,13 @@ impl CacheRequester { #[instrument(skip(self))] pub async fn get_traces(&self, block: H256) -> TxsTraceRes { let (response_tx, response_rx) = oneshot::channel(); - let mut sender = self.0.clone(); + let sender = self.0.clone(); sender - .send(CacheRequest::GetTraces { + .unbounded_send(CacheRequest::GetTraces { sender: response_tx, block, }) - .await .map_err(|e| { format!( "Failed to send request to the trace cache task. Error : {:?}", @@ -342,13 +340,12 @@ impl CacheRequester { /// this batch and still in the waiting pool will be discarded. #[instrument(skip(self))] pub async fn stop_batch(&self, batch_id: CacheBatchId) { - let mut sender = self.0.clone(); + let sender = self.0.clone(); // Here we don't care if the request has been accepted or refused, the caller can't // do anything with it. let _ = sender - .send(CacheRequest::StopBatch { batch_id }) - .await + .unbounded_send(CacheRequest::StopBatch { batch_id }) .map_err(|e| { format!( "Failed to send request to the trace cache task. Error : {:?}", @@ -788,9 +785,10 @@ where .ok_or_else(|| format!("Subtrate block {} don't exist", substrate_hash))?; let height = *block_header.number(); - let substrate_parent_id = *block_header.parent_hash(); + let substrate_parent_hash = *block_header.parent_hash(); - let schema = fc_storage::onchain_storage_schema(client.as_ref(), substrate_hash); + let schema = + fc_storage::onchain_storage_schema::(client.as_ref(), substrate_hash); // Get Ethereum block data. let (eth_block, eth_transactions) = match overrides.schemas.get(&schema) { @@ -829,11 +827,11 @@ where // Trace the block. let f = || -> Result<_, String> { - api.initialize_block(substrate_parent_id, &block_header) + api.initialize_block(substrate_parent_hash, &block_header) .map_err(|e| format!("Runtime api access error: {:?}", e))?; let _result = api - .trace_block(substrate_parent_id, extrinsics, eth_tx_hashes) + .trace_block(substrate_parent_hash, extrinsics, eth_tx_hashes) .map_err(|e| format!("Blockchain error when replaying block {} : {:?}", height, e))? .map_err(|e| { tracing::warn!( diff --git a/vendor/rpc/txpool/src/lib.rs b/vendor/rpc/txpool/src/lib.rs index bdac2268..48d174bf 100644 --- a/vendor/rpc/txpool/src/lib.rs +++ b/vendor/rpc/txpool/src/lib.rs @@ -73,21 +73,20 @@ where .collect(); // Use the runtime to match the (here) opaque extrinsics against ethereum transactions. - let best_block_hash = self.client.info().best_hash; + let best_block = self.client.info().best_hash; let api = self.client.runtime_api(); - let api_version = if let Ok(Some(api_version)) = - api.api_version::>(best_block_hash) - { - api_version - } else { - return Err(internal_err( - "failed to retrieve Runtime Api version".to_string(), - )); - }; + let api_version = + if let Ok(Some(api_version)) = api.api_version::>(best_block) { + api_version + } else { + return Err(internal_err( + "failed to retrieve Runtime Api version".to_string(), + )); + }; let ethereum_txns: TxPoolResponse = if api_version == 1 { #[allow(deprecated)] let res = api - .extrinsic_filter_before_version_2(best_block_hash, txs_ready, txs_future) + .extrinsic_filter_before_version_2(best_block, txs_ready, txs_future) .map_err(|err| { internal_err(format!("fetch runtime extrinsic filter failed: {:?}", err)) })?; @@ -104,7 +103,7 @@ where .collect(), } } else { - api.extrinsic_filter(best_block_hash, txs_ready, txs_future) + api.extrinsic_filter(best_block, txs_ready, txs_future) .map_err(|err| { internal_err(format!("fetch runtime extrinsic filter failed: {:?}", err)) })?