From 4a5d52db1ea018cf3d890142e00747db3eb32ef5 Mon Sep 17 00:00:00 2001 From: Rodrigo Quelhas <22591718+RomarQ@users.noreply.github.com> Date: Fri, 2 Aug 2024 08:28:05 +0100 Subject: [PATCH] Update rocksDB weights (#2786) * Update rocksDB weights * fix rust-tests * fix D01282201 * fix some xcm tests * fmt * fix more tests * fix test-xcm-v3/4 tests * fix unsaved changed * Increase the gas to accommodate the new wight change * update test values * Revert "Increase the gas to accommodate the new wight change" This reverts commit 4d5b9c89755ef7552dd6f54581d2acf92ecfd5a2. --------- Co-authored-by: noandrea Co-authored-by: Agusrodri Co-authored-by: Tarek Mohamed Abdalla --- runtime/common/src/weights/db/mod.rs | 17 +++ runtime/common/src/weights/db/rocksdb.rs | 117 ++++++++++++++++++ runtime/common/src/weights/mod.rs | 1 + runtime/moonbase/src/asset_config.rs | 6 +- runtime/moonbase/src/governance/councils.rs | 6 +- runtime/moonbase/src/governance/referenda.rs | 8 +- runtime/moonbase/src/lib.rs | 51 ++++---- runtime/moonbase/src/xcm_config.rs | 10 +- runtime/moonbase/tests/integration_test.rs | 48 +++---- runtime/moonbeam/src/lib.rs | 7 +- runtime/moonbeam/tests/integration_test.rs | 38 +++--- runtime/moonriver/src/asset_config.rs | 6 +- runtime/moonriver/src/governance/councils.rs | 4 +- runtime/moonriver/src/governance/referenda.rs | 6 +- runtime/moonriver/src/lib.rs | 49 ++++---- runtime/moonriver/src/xcm_config.rs | 8 +- runtime/moonriver/tests/integration_test.rs | 38 +++--- .../moonbase/test-pov/test-xcm-to-evm-pov.ts | 4 +- .../test-precompile/test-precompile-batch.ts | 6 +- .../test-precompile-xcm-utils.ts | 4 +- .../test-mock-hrmp-transact-ethereum-1.ts | 16 +-- .../test-mock-hrmp-transact-ethereum-12.ts | 8 +- .../test-mock-hrmp-transact-ethereum-3.ts | 6 +- .../test-mock-hrmp-transact-ethereum-6.ts | 4 +- .../test-mock-hrmp-transact-ethereum-1.ts | 6 +- .../test-mock-hrmp-transact-ethereum-6.ts | 5 +- 26 files changed, 312 insertions(+), 167 deletions(-) create mode 100644 runtime/common/src/weights/db/mod.rs create mode 100644 runtime/common/src/weights/db/rocksdb.rs diff --git a/runtime/common/src/weights/db/mod.rs b/runtime/common/src/weights/db/mod.rs new file mode 100644 index 0000000000..64793abcb7 --- /dev/null +++ b/runtime/common/src/weights/db/mod.rs @@ -0,0 +1,17 @@ +// Copyright 2024 Moonbeam foundation +// This file is part of Moonbeam. + +// Moonbeam is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Moonbeam is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Moonbeam. If not, see . + +pub mod rocksdb; diff --git a/runtime/common/src/weights/db/rocksdb.rs b/runtime/common/src/weights/db/rocksdb.rs new file mode 100644 index 0000000000..3d0dee0932 --- /dev/null +++ b/runtime/common/src/weights/db/rocksdb.rs @@ -0,0 +1,117 @@ +// Copyright 2024 Moonbeam foundation +// This file is part of Moonbeam. + +// Moonbeam is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Moonbeam is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Moonbeam. If not, see . + +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 +//! DATE: 2024-04-27 (Y/M/D) +//! HOSTNAME: `ip-10-0-0-176`, CPU: `Intel(R) Xeon(R) Platinum 8375C CPU @ 2.90GHz` +//! +//! DATABASE: `RocksDb`, RUNTIME: `Moonbeam` +//! BLOCK-NUM: `BlockId::Number(5962022)` +//! SKIP-WRITE: `false`, SKIP-READ: `false`, WARMUPS: `1` +//! STATE-VERSION: `V0`, STATE-CACHE-SIZE: `` +//! WEIGHT-PATH: `/home/ubuntu/projects/moonbeam/weights-rocksdb-moonbeam.rs` +//! METRIC: `Average`, WEIGHT-MUL: `1.1`, WEIGHT-ADD: `0` + +// Executed Command: +// /home/ubuntu/projects/moonbeam/target/release/moonbeam +// benchmark +// storage +// --db=rocksdb +// --state-version=0 +// --mul=1.1 +// --weight-path +// /home/ubuntu/projects/moonbeam/weights-rocksdb-moonbeam.rs +// --chain +// moonbeam +// --base-path +// /var/lib/rocksdb-moonbeam-data +// --keys-limit +// 10000000 +// --random-seed +// 1024 + +/// Storage DB weights for the `Moonbeam` runtime and `RocksDb`. +pub mod constants { + use frame_support::weights::{constants, RuntimeDbWeight}; + use sp_core::parameter_types; + + parameter_types! { + /// By default, Substrate uses `RocksDB`, so this will be the weight used throughout + /// the runtime. + pub const RocksDbWeight: RuntimeDbWeight = RuntimeDbWeight { + // Time to read one storage item. + // Calculated by multiplying the *Average* of all values with `1.1` and adding `0`. + // + // Stats nanoseconds: + // Min, Max: 2_300, 2_841_169 + // Average: 37_947 + // Median: 38_669 + // Std-Dev: 7331.86 + // + // Percentiles nanoseconds: + // 99th: 55_974 + // 95th: 49_824 + // 75th: 42_570 + read: 41_742 * constants::WEIGHT_REF_TIME_PER_NANOS, + + // Time to write one storage item. + // Calculated by multiplying the *Average* of all values with `1.1` and adding `0`. + // + // Stats nanoseconds: + // Min, Max: 18_981, 16_772_373 + // Average: 73_893 + // Median: 72_807 + // Std-Dev: 24543.58 + // + // Percentiles nanoseconds: + // 99th: 97_152 + // 95th: 85_751 + // 75th: 77_392 + write: 81_283 * constants::WEIGHT_REF_TIME_PER_NANOS, + }; + } + + #[cfg(test)] + mod test_db_weights { + use super::constants::RocksDbWeight as W; + use frame_support::weights::constants; + + /// Checks that all weights exist and have sane values. + // NOTE: If this test fails but you are sure that the generated values are fine, + // you can delete it. + #[test] + fn bound() { + // At least 1 µs. + assert!( + W::get().reads(1).ref_time() >= constants::WEIGHT_REF_TIME_PER_MICROS, + "Read weight should be at least 1 µs." + ); + assert!( + W::get().writes(1).ref_time() >= constants::WEIGHT_REF_TIME_PER_MICROS, + "Write weight should be at least 1 µs." + ); + // At most 1 ms. + assert!( + W::get().reads(1).ref_time() <= constants::WEIGHT_REF_TIME_PER_MILLIS, + "Read weight should be at most 1 ms." + ); + assert!( + W::get().writes(1).ref_time() <= constants::WEIGHT_REF_TIME_PER_MILLIS, + "Write weight should be at most 1 ms." + ); + } + } +} diff --git a/runtime/common/src/weights/mod.rs b/runtime/common/src/weights/mod.rs index 02b423721e..314d5e30c4 100644 --- a/runtime/common/src/weights/mod.rs +++ b/runtime/common/src/weights/mod.rs @@ -17,6 +17,7 @@ //! Moonbeam common weights. pub mod cumulus_pallet_xcmp_queue; +pub mod db; pub mod pallet_asset_manager; pub mod pallet_assets; pub mod pallet_author_inherent; diff --git a/runtime/moonbase/src/asset_config.rs b/runtime/moonbase/src/asset_config.rs index 8aa9e2979e..7238148bca 100644 --- a/runtime/moonbase/src/asset_config.rs +++ b/runtime/moonbase/src/asset_config.rs @@ -24,7 +24,7 @@ use super::{ RuntimeCall, RuntimeEvent, RuntimeOrigin, FOREIGN_ASSET_PRECOMPILE_ADDRESS_PREFIX, }; -use moonbeam_runtime_common::weights as moonbeam_weights; +use moonbeam_runtime_common::weights as moonbase_weights; use moonkit_xcm_primitives::AccountIdAssetIdConversion; use frame_support::{ @@ -98,7 +98,7 @@ impl pallet_assets::Config for Runtime { type Freezer = (); type Extra = (); type AssetAccountDeposit = ConstU128<{ currency::deposit(1, 18) }>; - type WeightInfo = moonbeam_weights::pallet_assets::WeightInfo; + type WeightInfo = moonbase_weights::pallet_assets::WeightInfo; type RemoveItemsLimit = ConstU32<{ REMOVE_ITEMS_LIMIT }>; type AssetIdParameter = Compact; type CreateOrigin = AsEnsureOriginWithArg>; @@ -187,7 +187,7 @@ impl pallet_asset_manager::Config for Runtime { type ForeignAssetType = xcm_config::AssetType; type AssetRegistrar = AssetRegistrar; type ForeignAssetModifierOrigin = ForeignAssetModifierOrigin; - type WeightInfo = moonbeam_weights::pallet_asset_manager::WeightInfo; + type WeightInfo = moonbase_weights::pallet_asset_manager::WeightInfo; } // Instruct how to go from an H160 to an AssetID diff --git a/runtime/moonbase/src/governance/councils.rs b/runtime/moonbase/src/governance/councils.rs index d6addeae11..e1fb310935 100644 --- a/runtime/moonbase/src/governance/councils.rs +++ b/runtime/moonbase/src/governance/councils.rs @@ -17,7 +17,7 @@ //! Councils for Gov1 and Gov2 use super::*; -use moonbeam_runtime_common::weights as moonbeam_weights; +use moonbeam_runtime_common::weights as moonbase_weights; pub type TreasuryCouncilInstance = pallet_collective::Instance3; pub type OpenTechCommitteeInstance = pallet_collective::Instance4; @@ -39,7 +39,7 @@ impl pallet_collective::Config for Runtime { /// The maximum number of treasury council members. type MaxMembers = ConstU32<9>; type DefaultVote = pallet_collective::MoreThanMajorityThenPrimeDefaultVote; - type WeightInfo = moonbeam_weights::pallet_collective::WeightInfo; + type WeightInfo = moonbase_weights::pallet_collective::WeightInfo; type SetMembersOrigin = referenda::GeneralAdminOrRoot; type MaxProposalWeight = MaxProposalWeight; } @@ -56,7 +56,7 @@ impl pallet_collective::Config for Runtime { /// The maximum number of technical committee members. type MaxMembers = ConstU32<100>; type DefaultVote = pallet_collective::MoreThanMajorityThenPrimeDefaultVote; - type WeightInfo = moonbeam_weights::pallet_collective::WeightInfo; + type WeightInfo = moonbase_weights::pallet_collective::WeightInfo; type SetMembersOrigin = referenda::GeneralAdminOrRoot; type MaxProposalWeight = MaxProposalWeight; } diff --git a/runtime/moonbase/src/governance/referenda.rs b/runtime/moonbase/src/governance/referenda.rs index 96bb3628d2..36cd0420e6 100644 --- a/runtime/moonbase/src/governance/referenda.rs +++ b/runtime/moonbase/src/governance/referenda.rs @@ -24,7 +24,7 @@ use super::*; use crate::currency::*; use frame_support::traits::{EitherOf, MapSuccess}; use frame_system::EnsureRootWithSuccess; -use moonbeam_runtime_common::weights as moonbeam_weights; +use moonbeam_runtime_common::weights as moonbase_weights; use sp_runtime::traits::Replace; parameter_types! { @@ -32,7 +32,7 @@ parameter_types! { } impl pallet_conviction_voting::Config for Runtime { - type WeightInfo = moonbeam_weights::pallet_conviction_voting::WeightInfo; + type WeightInfo = moonbase_weights::pallet_conviction_voting::WeightInfo; type RuntimeEvent = RuntimeEvent; type Currency = Balances; type Polls = Referenda; @@ -59,7 +59,7 @@ impl custom_origins::Config for Runtime {} // The purpose of this pallet is to queue calls to be dispatched as by root later => the Dispatch // origin corresponds to the Gov2 Whitelist track. impl pallet_whitelist::Config for Runtime { - type WeightInfo = moonbeam_weights::pallet_whitelist::WeightInfo; + type WeightInfo = moonbase_weights::pallet_whitelist::WeightInfo; type RuntimeEvent = RuntimeEvent; type RuntimeCall = RuntimeCall; type WhitelistOrigin = EitherOf< @@ -81,7 +81,7 @@ impl pallet_whitelist::Config for Runtime { pallet_referenda::impl_tracksinfo_get!(TracksInfo, Balance, BlockNumber); impl pallet_referenda::Config for Runtime { - type WeightInfo = moonbeam_weights::pallet_referenda::WeightInfo; + type WeightInfo = moonbase_weights::pallet_referenda::WeightInfo; type RuntimeCall = RuntimeCall; type RuntimeEvent = RuntimeEvent; type Scheduler = Scheduler; diff --git a/runtime/moonbase/src/lib.rs b/runtime/moonbase/src/lib.rs index 50d5dafd4c..395af492f3 100644 --- a/runtime/moonbase/src/lib.rs +++ b/runtime/moonbase/src/lib.rs @@ -70,9 +70,8 @@ use frame_support::{ OnUnbalanced, }, weights::{ - constants::{RocksDbWeight, WEIGHT_REF_TIME_PER_SECOND}, - ConstantMultiplier, Weight, WeightToFeeCoefficient, WeightToFeeCoefficients, - WeightToFeePolynomial, + constants::WEIGHT_REF_TIME_PER_SECOND, ConstantMultiplier, Weight, WeightToFeeCoefficient, + WeightToFeeCoefficients, WeightToFeePolynomial, }, PalletId, }; @@ -82,7 +81,7 @@ use governance::councils::*; use moonbeam_rpc_primitives_txpool::TxPoolResponse; use moonbeam_runtime_common::{ timestamp::{ConsensusHookWrapperForRelayTimestamp, RelayTimestamp}, - weights as moonbeam_weights, + weights as moonbase_weights, }; use nimbus_primitives::CanAuthor; use pallet_ethereum::Call::transact; @@ -282,7 +281,7 @@ impl frame_system::Config for Runtime { type AccountData = pallet_balances::AccountData; type OnNewAccount = (); type OnKilledAccount = (); - type DbWeight = RocksDbWeight; + type DbWeight = moonbase_weights::db::rocksdb::constants::RocksDbWeight; type BaseCallFilter = MaintenanceMode; type SystemWeightInfo = (); /// This is used as an identifier of the chain. 42 is the generic substrate prefix. @@ -300,7 +299,7 @@ impl pallet_utility::Config for Runtime { type RuntimeEvent = RuntimeEvent; type RuntimeCall = RuntimeCall; type PalletsOrigin = OriginCaller; - type WeightInfo = moonbeam_weights::pallet_utility::WeightInfo; + type WeightInfo = moonbase_weights::pallet_utility::WeightInfo; } impl pallet_timestamp::Config for Runtime { @@ -308,7 +307,7 @@ impl pallet_timestamp::Config for Runtime { type Moment = u64; type OnTimestampSet = (); type MinimumPeriod = ConstU64<3000>; - type WeightInfo = moonbeam_weights::pallet_timestamp::WeightInfo; + type WeightInfo = moonbase_weights::pallet_timestamp::WeightInfo; } #[cfg(not(feature = "runtime-benchmarks"))] @@ -336,7 +335,7 @@ impl pallet_balances::Config for Runtime { type MaxFreezes = ConstU32<0>; type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; - type WeightInfo = moonbeam_weights::pallet_balances::WeightInfo; + type WeightInfo = moonbase_weights::pallet_balances::WeightInfo; } pub struct DealWithFees(sp_std::marker::PhantomData); @@ -412,7 +411,7 @@ impl pallet_transaction_payment::Config for Runtime { impl pallet_sudo::Config for Runtime { type RuntimeCall = RuntimeCall; type RuntimeEvent = RuntimeEvent; - type WeightInfo = moonbeam_weights::pallet_sudo::WeightInfo; + type WeightInfo = moonbase_weights::pallet_sudo::WeightInfo; } impl pallet_evm_chain_id::Config for Runtime {} @@ -544,7 +543,7 @@ impl pallet_evm::Config for Runtime { type SuicideQuickClearLimit = ConstU32<0>; type GasLimitStorageGrowthRatio = GasLimitStorageGrowthRatio; type Timestamp = RelayTimestamp; - type WeightInfo = moonbeam_weights::pallet_evm::WeightInfo; + type WeightInfo = moonbase_weights::pallet_evm::WeightInfo; } parameter_types! { @@ -560,7 +559,7 @@ impl pallet_scheduler::Config for Runtime { type MaximumWeight = MaximumSchedulerWeight; type ScheduleOrigin = EnsureRoot; type MaxScheduledPerBlock = ConstU32<50>; - type WeightInfo = moonbeam_weights::pallet_scheduler::WeightInfo; + type WeightInfo = moonbase_weights::pallet_scheduler::WeightInfo; type OriginPrivilegeCmp = EqualPrivilegeOnly; type Preimages = Preimage; } @@ -573,7 +572,7 @@ parameter_types! { } impl pallet_preimage::Config for Runtime { - type WeightInfo = moonbeam_weights::pallet_preimage::WeightInfo; + type WeightInfo = moonbase_weights::pallet_preimage::WeightInfo; type RuntimeEvent = RuntimeEvent; type Currency = Balances; type ManagerOrigin = EnsureRoot; @@ -617,7 +616,7 @@ impl pallet_treasury::Config for Runtime { type Burn = (); type BurnDestination = (); type MaxApprovals = ConstU32<100>; - type WeightInfo = moonbeam_weights::pallet_treasury::WeightInfo; + type WeightInfo = moonbase_weights::pallet_treasury::WeightInfo; type SpendFunds = (); type ProposalBondMaximum = (); #[cfg(not(feature = "runtime-benchmarks"))] @@ -670,7 +669,7 @@ impl pallet_identity::Config for Runtime { type PendingUsernameExpiration = PendingUsernameExpiration; type MaxSuffixLength = MaxSuffixLength; type MaxUsernameLength = MaxUsernameLength; - type WeightInfo = moonbeam_weights::pallet_identity::WeightInfo; + type WeightInfo = moonbase_weights::pallet_identity::WeightInfo; } pub struct TransactionConverter; @@ -870,7 +869,7 @@ impl pallet_parachain_staking::Config for Runtime { type OnInactiveCollator = OnInactiveCollator; type OnNewRound = OnNewRound; type SlotProvider = RelayChainSlotProvider; - type WeightInfo = moonbeam_weights::pallet_parachain_staking::WeightInfo; + type WeightInfo = moonbase_weights::pallet_parachain_staking::WeightInfo; type MaxCandidates = ConstU32<200>; type SlotDuration = ConstU64<6_000>; type BlockTime = ConstU64<6_000>; @@ -881,7 +880,7 @@ impl pallet_author_inherent::Config for Runtime { type AccountLookup = MoonbeamOrbiters; type CanAuthor = AuthorFilter; type AuthorId = AccountId; - type WeightInfo = moonbeam_weights::pallet_author_inherent::WeightInfo; + type WeightInfo = moonbase_weights::pallet_author_inherent::WeightInfo; } #[cfg(test)] @@ -902,7 +901,7 @@ impl pallet_author_slot_filter::Config for Runtime { #[cfg(test)] type RandomnessSource = mock::MockRandomness; type PotentialAuthors = ParachainStaking; - type WeightInfo = moonbeam_weights::pallet_author_slot_filter::WeightInfo; + type WeightInfo = moonbase_weights::pallet_author_slot_filter::WeightInfo; } impl pallet_async_backing::Config for Runtime { @@ -933,7 +932,7 @@ impl pallet_crowdloan_rewards::Config for Runtime { type SignatureNetworkIdentifier = SignatureNetworkIdentifier; type VestingBlockNumber = relay_chain::BlockNumber; type VestingBlockProvider = RelaychainDataProvider; - type WeightInfo = moonbeam_weights::pallet_crowdloan_rewards::WeightInfo; + type WeightInfo = moonbase_weights::pallet_crowdloan_rewards::WeightInfo; } // This is a simple session key manager. It should probably either work with, or be replaced @@ -943,7 +942,7 @@ impl pallet_author_mapping::Config for Runtime { type DepositCurrency = Balances; type DepositAmount = ConstU128<{ 100 * currency::UNIT * currency::SUPPLY_FACTOR }>; type Keys = session_keys_primitives::VrfId; - type WeightInfo = moonbeam_weights::pallet_author_mapping::WeightInfo; + type WeightInfo = moonbase_weights::pallet_author_mapping::WeightInfo; } /// The type used to represent the kinds of proxying allowed. @@ -1139,7 +1138,7 @@ impl pallet_proxy::Config for Runtime { // Additional storage item size of 21 bytes (20 bytes AccountId + 1 byte sizeof(ProxyType)). type ProxyDepositFactor = ConstU128<{ currency::deposit(0, 21) }>; type MaxProxies = ConstU32<32>; - type WeightInfo = moonbeam_weights::pallet_proxy::WeightInfo; + type WeightInfo = moonbase_weights::pallet_proxy::WeightInfo; type MaxPending = ConstU32<32>; type CallHasher = BlakeTwo256; type AnnouncementDepositBase = ConstU128<{ currency::deposit(1, 8) }>; @@ -1162,7 +1161,7 @@ impl pallet_migrations::Config for Runtime { } impl pallet_moonbeam_lazy_migrations::Config for Runtime { - type WeightInfo = moonbeam_weights::pallet_moonbeam_lazy_migrations::WeightInfo; + type WeightInfo = moonbase_weights::pallet_moonbeam_lazy_migrations::WeightInfo; } /// Maintenance mode Call filter @@ -1281,7 +1280,7 @@ impl pallet_moonbeam_orbiters::Config for Runtime { type RotatePeriod = ConstU32<3>; /// Round index type. type RoundIndex = pallet_parachain_staking::RoundIndex; - type WeightInfo = moonbeam_weights::pallet_moonbeam_orbiters::WeightInfo; + type WeightInfo = moonbase_weights::pallet_moonbeam_orbiters::WeightInfo; } /// Only callable after `set_validation_data` is called which forms this proof the same way @@ -1345,7 +1344,7 @@ impl pallet_randomness::Config for Runtime { type MaxBlockDelay = ConstU32<2_000>; type BlockExpirationDelay = ConstU32<10_000>; type EpochExpirationDelay = ConstU64<10_000>; - type WeightInfo = moonbeam_weights::pallet_randomness::WeightInfo; + type WeightInfo = moonbase_weights::pallet_randomness::WeightInfo; } impl pallet_root_testing::Config for Runtime { @@ -1367,17 +1366,17 @@ impl pallet_multisig::Config for Runtime { type DepositBase = DepositBase; type DepositFactor = DepositFactor; type MaxSignatories = MaxSignatories; - type WeightInfo = moonbeam_weights::pallet_multisig::WeightInfo; + type WeightInfo = moonbase_weights::pallet_multisig::WeightInfo; } impl pallet_relay_storage_roots::Config for Runtime { type MaxStorageRoots = ConstU32<30>; type RelaychainStateProvider = cumulus_pallet_parachain_system::RelaychainDataProvider; - type WeightInfo = moonbeam_weights::pallet_relay_storage_roots::WeightInfo; + type WeightInfo = moonbase_weights::pallet_relay_storage_roots::WeightInfo; } impl pallet_precompile_benchmarks::Config for Runtime { - type WeightInfo = moonbeam_weights::pallet_precompile_benchmarks::WeightInfo; + type WeightInfo = moonbase_weights::pallet_precompile_benchmarks::WeightInfo; } construct_runtime! { diff --git a/runtime/moonbase/src/xcm_config.rs b/runtime/moonbase/src/xcm_config.rs index 7b1da02f32..4e44f607a4 100644 --- a/runtime/moonbase/src/xcm_config.rs +++ b/runtime/moonbase/src/xcm_config.rs @@ -24,7 +24,7 @@ use super::{ RuntimeCall, RuntimeEvent, RuntimeOrigin, Treasury, XcmpQueue, }; use crate::OpenTechCommitteeInstance; -use moonbeam_runtime_common::weights as moonbeam_weights; +use moonbeam_runtime_common::weights as moonbase_weights; use moonkit_xcm_primitives::AccountIdAssetIdConversion; use sp_runtime::{ traits::{Hash as THash, MaybeEquivalence, PostDispatchInfoOf}, @@ -381,7 +381,7 @@ impl pallet_xcm::Config for Runtime { type MaxRemoteLockConsumers = ConstU32<0>; type RemoteLockConsumerIdentifier = (); // TODO pallet-xcm weights - type WeightInfo = moonbeam_weights::pallet_xcm::WeightInfo; + type WeightInfo = moonbase_weights::pallet_xcm::WeightInfo; type AdminOrigin = EnsureRoot; } @@ -398,7 +398,7 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime { type MaxInboundSuspended = sp_core::ConstU32<1_000>; type ControllerOrigin = EnsureRoot; type ControllerOriginConverter = XcmOriginToTransactDispatchOrigin; - type WeightInfo = moonbeam_weights::cumulus_pallet_xcmp_queue::WeightInfo; + type WeightInfo = moonbase_weights::cumulus_pallet_xcmp_queue::WeightInfo; type PriceForSiblingDelivery = polkadot_runtime_common::xcm_sender::NoPriceForMessageDelivery< cumulus_primitives_core::ParaId, >; @@ -710,7 +710,7 @@ impl pallet_xcm_transactor::Config for Runtime { type BaseXcmWeight = BaseXcmWeight; type AssetTransactor = AssetTransactors; type ReserveProvider = AbsoluteAndRelativeReserve; - type WeightInfo = moonbeam_weights::pallet_xcm_transactor::WeightInfo; + type WeightInfo = moonbase_weights::pallet_xcm_transactor::WeightInfo; type HrmpManipulatorOrigin = GeneralAdminOrRoot; type HrmpOpenOrigin = FastGeneralAdminOrRoot; type MaxHrmpFee = xcm_builder::Case; @@ -774,7 +774,7 @@ impl pallet_moonbeam_foreign_assets::Config for Runtime { type OnForeignAssetCreated = (); type MaxForeignAssets = ConstU32<256>; type RuntimeEvent = RuntimeEvent; - type WeightInfo = moonbeam_weights::pallet_moonbeam_foreign_assets::WeightInfo; + type WeightInfo = moonbase_weights::pallet_moonbeam_foreign_assets::WeightInfo; type XcmLocationToH160 = LocationToH160; } diff --git a/runtime/moonbase/tests/integration_test.rs b/runtime/moonbase/tests/integration_test.rs index 3647d37bb3..a6df600cd9 100644 --- a/runtime/moonbase/tests/integration_test.rs +++ b/runtime/moonbase/tests/integration_test.rs @@ -1092,7 +1092,7 @@ fn is_contributor_via_precompile() { contributor: Address(BOB.into()), }, ) - .expect_cost(1000) + .expect_cost(1669) .expect_no_logs() .execute_returns(false); @@ -1105,7 +1105,7 @@ fn is_contributor_via_precompile() { contributor: Address(CHARLIE.into()), }, ) - .expect_cost(1000) + .expect_cost(1669) .expect_no_logs() .execute_returns(true); }) @@ -1176,7 +1176,7 @@ fn reward_info_via_precompile() { contributor: Address(AccountId::from(CHARLIE).into()), }, ) - .expect_cost(1000) + .expect_cost(1669) .expect_no_logs() .execute_returns((expected_total, expected_claimed)); }) @@ -1353,7 +1353,7 @@ fn xcm_asset_erc20_precompiles_supply_and_balance() { asset_precompile_address, ForeignAssetsPCall::total_supply {}, ) - .expect_cost(2000) + .expect_cost(3338) .expect_no_logs() .execute_returns(U256::from(1000 * UNIT)); @@ -1366,7 +1366,7 @@ fn xcm_asset_erc20_precompiles_supply_and_balance() { who: Address(ALICE.into()), }, ) - .expect_cost(2000) + .expect_cost(3338) .expect_no_logs() .execute_returns(U256::from(1000 * UNIT)); }); @@ -1408,7 +1408,7 @@ fn xcm_asset_erc20_precompiles_transfer() { value: { 400 * UNIT }.into(), }, ) - .expect_cost(24342) + .expect_cost(24695) .expect_log(log3( asset_precompile_address, SELECTOR_LOG_TRANSFER, @@ -1427,7 +1427,7 @@ fn xcm_asset_erc20_precompiles_transfer() { who: Address(BOB.into()), }, ) - .expect_cost(2000) + .expect_cost(3338) .expect_no_logs() .execute_returns(U256::from(400 * UNIT)); }); @@ -1469,7 +1469,7 @@ fn xcm_asset_erc20_precompiles_approve() { value: { 400 * UNIT }.into(), }, ) - .expect_cost(14424) + .expect_cost(15604) .expect_log(log3( asset_precompile_address, SELECTOR_LOG_APPROVAL, @@ -1490,7 +1490,7 @@ fn xcm_asset_erc20_precompiles_approve() { value: { 400 * UNIT }.into(), }, ) - .expect_cost(29686) + .expect_cost(29960) .expect_log(log3( asset_precompile_address, SELECTOR_LOG_TRANSFER, @@ -1509,7 +1509,7 @@ fn xcm_asset_erc20_precompiles_approve() { who: Address(CHARLIE.into()), }, ) - .expect_cost(2000) + .expect_cost(3338) .expect_no_logs() .execute_returns(U256::from(400 * UNIT)); }); @@ -1568,7 +1568,7 @@ fn xtokens_precompiles_transfer() { weight: 4_000_000, }, ) - .expect_cost(209239) + .expect_cost(211090) .expect_no_logs() // We expect an evm subcall ERC20.burnFrom .with_subcall_handle(move |subcall| { @@ -1659,7 +1659,7 @@ fn xtokens_precompiles_transfer_multiasset() { weight: 4_000_000, }, ) - .expect_cost(209239) + .expect_cost(211090) .expect_no_logs() // We expect an evm subcall ERC20.burnFrom .with_subcall_handle(move |subcall| { @@ -1869,7 +1869,7 @@ fn initial_gas_fee_is_correct() { TransactionPaymentAsGasPrice::min_gas_price(), ( 10_000_000_000u128.into(), - Weight::from_parts(25_000_000u64, 0) + Weight::from_parts(41_742_000u64, 0) ) ); }); @@ -2282,7 +2282,7 @@ fn transact_through_signed_precompile_works_v1() { call: bytes.into(), }, ) - .expect_cost(18748) + .expect_cost(23278) .expect_no_logs() .execute_returns(()); }); @@ -2322,7 +2322,7 @@ fn transact_through_signed_precompile_works_v2() { overall_weight: total_weight, }, ) - .expect_cost(18748) + .expect_cost(23278) .expect_no_logs() .execute_returns(()); }); @@ -2404,7 +2404,7 @@ fn author_mapping_precompile_associate_update_and_clear() { nimbus_id: [1u8; 32].into(), }, ) - .expect_cost(15119) + .expect_cost(14212) .expect_no_logs() .execute_returns(()); @@ -2426,7 +2426,7 @@ fn author_mapping_precompile_associate_update_and_clear() { new_nimbus_id: [2u8; 32].into(), }, ) - .expect_cost(14723) + .expect_cost(13817) .expect_no_logs() .execute_returns(()); @@ -2447,7 +2447,7 @@ fn author_mapping_precompile_associate_update_and_clear() { nimbus_id: [2u8; 32].into(), }, ) - .expect_cost(15158) + .expect_cost(14251) .expect_no_logs() .execute_returns(()); @@ -2490,7 +2490,7 @@ fn author_mapping_register_and_set_keys() { .into(), }, ) - .expect_cost(16233) + .expect_cost(15996) .expect_no_logs() .execute_returns(()); @@ -2515,7 +2515,7 @@ fn author_mapping_register_and_set_keys() { .into(), }, ) - .expect_cost(16233) + .expect_cost(15996) .expect_no_logs() .execute_returns(()); @@ -2546,7 +2546,7 @@ fn test_xcm_utils_ml_tp_account() { location: Location::parent(), }, ) - .expect_cost(1000) + .expect_cost(1669) .expect_no_logs() .execute_returns(Address(expected_address_parent)); @@ -2566,7 +2566,7 @@ fn test_xcm_utils_ml_tp_account() { location: parachain_2000_multilocation, }, ) - .expect_cost(1000) + .expect_cost(1669) .expect_no_logs() .execute_returns(Address(expected_address_parachain)); @@ -2596,7 +2596,7 @@ fn test_xcm_utils_ml_tp_account() { location: alice_in_parachain_2000_multilocation, }, ) - .expect_cost(1000) + .expect_cost(1669) .expect_no_logs() .execute_returns(Address(expected_address_alice_in_parachain_2000)); }); @@ -2636,7 +2636,7 @@ fn test_xcm_utils_get_units_per_second() { Precompiles::new() .prepare_test(ALICE, xcm_utils_precompile_address, input) - .expect_cost(1000) + .expect_cost(1669) .expect_no_logs() .execute_returns(expected_units); }); diff --git a/runtime/moonbeam/src/lib.rs b/runtime/moonbeam/src/lib.rs index 94d7cb217d..a7d93818b9 100644 --- a/runtime/moonbeam/src/lib.rs +++ b/runtime/moonbeam/src/lib.rs @@ -53,9 +53,8 @@ use frame_support::{ OnUnbalanced, }, weights::{ - constants::{RocksDbWeight, WEIGHT_REF_TIME_PER_SECOND}, - ConstantMultiplier, Weight, WeightToFeeCoefficient, WeightToFeeCoefficients, - WeightToFeePolynomial, + constants::WEIGHT_REF_TIME_PER_SECOND, ConstantMultiplier, Weight, WeightToFeeCoefficient, + WeightToFeeCoefficients, WeightToFeePolynomial, }, PalletId, }; @@ -274,7 +273,7 @@ impl frame_system::Config for Runtime { type AccountData = pallet_balances::AccountData; type OnNewAccount = (); type OnKilledAccount = (); - type DbWeight = RocksDbWeight; + type DbWeight = moonbeam_weights::db::rocksdb::constants::RocksDbWeight; type BaseCallFilter = MaintenanceMode; type SystemWeightInfo = (); /// This is used as an identifier of the chain. 42 is the generic substrate prefix. diff --git a/runtime/moonbeam/tests/integration_test.rs b/runtime/moonbeam/tests/integration_test.rs index c52ee25fb7..2f8ea8eaeb 100644 --- a/runtime/moonbeam/tests/integration_test.rs +++ b/runtime/moonbeam/tests/integration_test.rs @@ -1101,7 +1101,7 @@ fn is_contributor_via_precompile() { contributor: Address(AccountId::from(BOB).into()), }, ) - .expect_cost(1000) + .expect_cost(1669) .expect_no_logs() .execute_returns(false); @@ -1114,7 +1114,7 @@ fn is_contributor_via_precompile() { contributor: Address(AccountId::from(CHARLIE).into()), }, ) - .expect_cost(1000) + .expect_cost(1669) .expect_no_logs() .execute_returns(true); }) @@ -1186,7 +1186,7 @@ fn reward_info_via_precompile() { contributor: Address(AccountId::from(CHARLIE).into()), }, ) - .expect_cost(1000) + .expect_cost(1669) .expect_no_logs() .execute_returns((expected_total, expected_claimed)); }) @@ -1379,7 +1379,7 @@ fn initial_gas_fee_is_correct() { TransactionPaymentAsGasPrice::min_gas_price(), ( 125_000_000_000u128.into(), - Weight::from_parts(25_000_000u64, 0) + Weight::from_parts(41_742_000u64, 0) ) ); }); @@ -1401,7 +1401,7 @@ fn min_gas_fee_is_correct() { TransactionPaymentAsGasPrice::min_gas_price(), ( 125_000_000_000u128.into(), - Weight::from_parts(25_000_000u64, 0) + Weight::from_parts(41_742_000u64, 0) ) ); }); @@ -1721,7 +1721,7 @@ fn xcm_asset_erc20_precompiles_supply_and_balance() { asset_precompile_address, ForeignAssetsPCall::total_supply {}, ) - .expect_cost(2000) + .expect_cost(3338) .expect_no_logs() .execute_returns(U256::from(1000 * GLMR)); @@ -1734,7 +1734,7 @@ fn xcm_asset_erc20_precompiles_supply_and_balance() { who: Address(ALICE.into()), }, ) - .expect_cost(2000) + .expect_cost(3338) .expect_no_logs() .execute_returns(U256::from(1000 * GLMR)); }); @@ -1780,7 +1780,7 @@ fn xcm_asset_erc20_precompiles_transfer() { value: { 400 * GLMR }.into(), }, ) - .expect_cost(24360) + .expect_cost(24713) .expect_log(log3( asset_precompile_address, SELECTOR_LOG_TRANSFER, @@ -1799,7 +1799,7 @@ fn xcm_asset_erc20_precompiles_transfer() { who: Address(BOB.into()), }, ) - .expect_cost(2000) + .expect_cost(3338) .expect_no_logs() .execute_returns(U256::from(400 * GLMR)); }); @@ -1845,7 +1845,7 @@ fn xcm_asset_erc20_precompiles_approve() { value: { 400 * GLMR }.into(), }, ) - .expect_cost(14407) + .expect_cost(15587) .expect_log(log3( asset_precompile_address, SELECTOR_LOG_APPROVAL, @@ -1866,7 +1866,7 @@ fn xcm_asset_erc20_precompiles_approve() { value: { 400 * GLMR }.into(), }, ) - .expect_cost(29695) + .expect_cost(29969) .expect_log(log3( asset_precompile_address, SELECTOR_LOG_TRANSFER, @@ -1885,7 +1885,7 @@ fn xcm_asset_erc20_precompiles_approve() { who: Address(CHARLIE.into()), }, ) - .expect_cost(2000) + .expect_cost(3338) .expect_no_logs() .execute_returns(U256::from(400 * GLMR)); }); @@ -1945,7 +1945,7 @@ fn xtokens_precompile_transfer() { weight: 4_000_000, }, ) - .expect_cost(57639) + .expect_cost(59490) .expect_no_logs() .execute_returns(()) }) @@ -1997,7 +1997,7 @@ fn xtokens_precompile_transfer_multiasset() { weight: 4_000_000, }, ) - .expect_cost(57639) + .expect_cost(59490) .expect_no_logs() .execute_returns(()); }) @@ -2148,7 +2148,7 @@ fn transact_through_signed_precompile_works_v2() { overall_weight: total_weight, }, ) - .expect_cost(18748) + .expect_cost(23278) .expect_no_logs() .execute_returns(()); }); @@ -2354,7 +2354,7 @@ fn test_xcm_utils_ml_tp_account() { location: Location::parent(), }, ) - .expect_cost(1000) + .expect_cost(1669) .expect_no_logs() .execute_returns(Address(expected_address_parent)); @@ -2374,7 +2374,7 @@ fn test_xcm_utils_ml_tp_account() { location: parachain_2000_location, }, ) - .expect_cost(1000) + .expect_cost(1669) .expect_no_logs() .execute_returns(Address(expected_address_parachain)); @@ -2404,7 +2404,7 @@ fn test_xcm_utils_ml_tp_account() { location: alice_in_parachain_2000_location, }, ) - .expect_cost(1000) + .expect_cost(1669) .expect_no_logs() .execute_returns(Address(expected_address_alice_in_parachain_2000)); }); @@ -2444,7 +2444,7 @@ fn test_xcm_utils_get_units_per_second() { Precompiles::new() .prepare_test(ALICE, xcm_utils_precompile_address, input) - .expect_cost(1000) + .expect_cost(1669) .expect_no_logs() .execute_returns(expected_units); }); diff --git a/runtime/moonriver/src/asset_config.rs b/runtime/moonriver/src/asset_config.rs index 7ecc6bd182..957fb04a4a 100644 --- a/runtime/moonriver/src/asset_config.rs +++ b/runtime/moonriver/src/asset_config.rs @@ -23,7 +23,7 @@ use super::{ FOREIGN_ASSET_PRECOMPILE_ADDRESS_PREFIX, }; -use moonbeam_runtime_common::weights as moonbeam_weights; +use moonbeam_runtime_common::weights as moonriver_weights; use moonkit_xcm_primitives::AccountIdAssetIdConversion; use frame_support::{ @@ -97,7 +97,7 @@ impl pallet_assets::Config for Runtime { type Freezer = (); type Extra = (); type AssetAccountDeposit = ConstU128<{ currency::deposit(1, 18) }>; - type WeightInfo = moonbeam_weights::pallet_assets::WeightInfo; + type WeightInfo = moonriver_weights::pallet_assets::WeightInfo; type RemoveItemsLimit = ConstU32<{ REMOVE_ITEMS_LIMIT }>; type AssetIdParameter = Compact; type CreateOrigin = AsEnsureOriginWithArg>; @@ -186,7 +186,7 @@ impl pallet_asset_manager::Config for Runtime { type ForeignAssetType = xcm_config::AssetType; type AssetRegistrar = AssetRegistrar; type ForeignAssetModifierOrigin = ForeignAssetModifierOrigin; - type WeightInfo = moonbeam_weights::pallet_asset_manager::WeightInfo; + type WeightInfo = moonriver_weights::pallet_asset_manager::WeightInfo; } // Instruct how to go from an H160 to an AssetID diff --git a/runtime/moonriver/src/governance/councils.rs b/runtime/moonriver/src/governance/councils.rs index 1c51423e70..b09c47a4b1 100644 --- a/runtime/moonriver/src/governance/councils.rs +++ b/runtime/moonriver/src/governance/councils.rs @@ -38,7 +38,7 @@ impl pallet_collective::Config for Runtime { /// The maximum number of treasury council members. type MaxMembers = ConstU32<9>; type DefaultVote = pallet_collective::MoreThanMajorityThenPrimeDefaultVote; - type WeightInfo = moonbeam_weights::pallet_collective::WeightInfo; + type WeightInfo = moonriver_weights::pallet_collective::WeightInfo; type SetMembersOrigin = referenda::GeneralAdminOrRoot; type MaxProposalWeight = MaxProposalWeight; } @@ -55,7 +55,7 @@ impl pallet_collective::Config for Runtime { /// The maximum number of technical committee members. type MaxMembers = ConstU32<100>; type DefaultVote = pallet_collective::MoreThanMajorityThenPrimeDefaultVote; - type WeightInfo = moonbeam_weights::pallet_collective::WeightInfo; + type WeightInfo = moonriver_weights::pallet_collective::WeightInfo; type SetMembersOrigin = referenda::GeneralAdminOrRoot; type MaxProposalWeight = MaxProposalWeight; } diff --git a/runtime/moonriver/src/governance/referenda.rs b/runtime/moonriver/src/governance/referenda.rs index 8177e88e38..d3c06af793 100644 --- a/runtime/moonriver/src/governance/referenda.rs +++ b/runtime/moonriver/src/governance/referenda.rs @@ -31,7 +31,7 @@ parameter_types! { } impl pallet_conviction_voting::Config for Runtime { - type WeightInfo = moonbeam_weights::pallet_conviction_voting::WeightInfo; + type WeightInfo = moonriver_weights::pallet_conviction_voting::WeightInfo; type RuntimeEvent = RuntimeEvent; type Currency = Balances; type Polls = Referenda; @@ -58,7 +58,7 @@ impl custom_origins::Config for Runtime {} // The purpose of this pallet is to queue calls to be dispatched as by root later => the Dispatch // origin corresponds to the Gov2 Whitelist track. impl pallet_whitelist::Config for Runtime { - type WeightInfo = moonbeam_weights::pallet_whitelist::WeightInfo; + type WeightInfo = moonriver_weights::pallet_whitelist::WeightInfo; type RuntimeEvent = RuntimeEvent; type RuntimeCall = RuntimeCall; type WhitelistOrigin = EitherOf< @@ -80,7 +80,7 @@ impl pallet_whitelist::Config for Runtime { pallet_referenda::impl_tracksinfo_get!(TracksInfo, Balance, BlockNumber); impl pallet_referenda::Config for Runtime { - type WeightInfo = moonbeam_weights::pallet_referenda::WeightInfo; + type WeightInfo = moonriver_weights::pallet_referenda::WeightInfo; type RuntimeCall = RuntimeCall; type RuntimeEvent = RuntimeEvent; type Scheduler = Scheduler; diff --git a/runtime/moonriver/src/lib.rs b/runtime/moonriver/src/lib.rs index a2253b0b43..97fc306abd 100644 --- a/runtime/moonriver/src/lib.rs +++ b/runtime/moonriver/src/lib.rs @@ -54,9 +54,8 @@ use frame_support::{ OnUnbalanced, }, weights::{ - constants::{RocksDbWeight, WEIGHT_REF_TIME_PER_SECOND}, - ConstantMultiplier, Weight, WeightToFeeCoefficient, WeightToFeeCoefficients, - WeightToFeePolynomial, + constants::WEIGHT_REF_TIME_PER_SECOND, ConstantMultiplier, Weight, WeightToFeeCoefficient, + WeightToFeeCoefficients, WeightToFeePolynomial, }, PalletId, }; @@ -68,7 +67,7 @@ pub use moonbeam_core_primitives::{ use moonbeam_rpc_primitives_txpool::TxPoolResponse; use moonbeam_runtime_common::{ timestamp::{ConsensusHookWrapperForRelayTimestamp, RelayTimestamp}, - weights as moonbeam_weights, + weights as moonriver_weights, }; use pallet_ethereum::Call::transact; use pallet_ethereum::{PostLogContent, Transaction as EthereumTransaction}; @@ -276,7 +275,7 @@ impl frame_system::Config for Runtime { type AccountData = pallet_balances::AccountData; type OnNewAccount = (); type OnKilledAccount = (); - type DbWeight = RocksDbWeight; + type DbWeight = moonriver_weights::db::rocksdb::constants::RocksDbWeight; type BaseCallFilter = MaintenanceMode; type SystemWeightInfo = (); /// This is used as an identifier of the chain. 42 is the generic substrate prefix. @@ -294,7 +293,7 @@ impl pallet_utility::Config for Runtime { type RuntimeEvent = RuntimeEvent; type RuntimeCall = RuntimeCall; type PalletsOrigin = OriginCaller; - type WeightInfo = moonbeam_weights::pallet_utility::WeightInfo; + type WeightInfo = moonriver_weights::pallet_utility::WeightInfo; } impl pallet_timestamp::Config for Runtime { @@ -302,7 +301,7 @@ impl pallet_timestamp::Config for Runtime { type Moment = u64; type OnTimestampSet = (); type MinimumPeriod = ConstU64<3000>; - type WeightInfo = moonbeam_weights::pallet_timestamp::WeightInfo; + type WeightInfo = moonriver_weights::pallet_timestamp::WeightInfo; } parameter_types! { @@ -324,7 +323,7 @@ impl pallet_balances::Config for Runtime { type MaxFreezes = ConstU32<0>; type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; - type WeightInfo = moonbeam_weights::pallet_balances::WeightInfo; + type WeightInfo = moonriver_weights::pallet_balances::WeightInfo; } pub struct DealWithFees(sp_std::marker::PhantomData); @@ -529,7 +528,7 @@ impl pallet_evm::Config for Runtime { type SuicideQuickClearLimit = ConstU32<0>; type GasLimitStorageGrowthRatio = GasLimitStorageGrowthRatio; type Timestamp = RelayTimestamp; - type WeightInfo = moonbeam_weights::pallet_evm::WeightInfo; + type WeightInfo = moonriver_weights::pallet_evm::WeightInfo; } parameter_types! { @@ -544,7 +543,7 @@ impl pallet_scheduler::Config for Runtime { type MaximumWeight = MaximumSchedulerWeight; type ScheduleOrigin = EnsureRoot; type MaxScheduledPerBlock = ConstU32<50>; - type WeightInfo = moonbeam_weights::pallet_scheduler::WeightInfo; + type WeightInfo = moonriver_weights::pallet_scheduler::WeightInfo; type OriginPrivilegeCmp = EqualPrivilegeOnly; type Preimages = Preimage; } @@ -557,7 +556,7 @@ parameter_types! { } impl pallet_preimage::Config for Runtime { - type WeightInfo = moonbeam_weights::pallet_preimage::WeightInfo; + type WeightInfo = moonriver_weights::pallet_preimage::WeightInfo; type RuntimeEvent = RuntimeEvent; type Currency = Balances; type ManagerOrigin = EnsureRoot; @@ -601,7 +600,7 @@ impl pallet_treasury::Config for Runtime { type Burn = (); type BurnDestination = (); type MaxApprovals = ConstU32<100>; - type WeightInfo = moonbeam_weights::pallet_treasury::WeightInfo; + type WeightInfo = moonriver_weights::pallet_treasury::WeightInfo; type SpendFunds = (); type ProposalBondMaximum = (); #[cfg(not(feature = "runtime-benchmarks"))] @@ -654,7 +653,7 @@ impl pallet_identity::Config for Runtime { type PendingUsernameExpiration = PendingUsernameExpiration; type MaxSuffixLength = MaxSuffixLength; type MaxUsernameLength = MaxUsernameLength; - type WeightInfo = moonbeam_weights::pallet_identity::WeightInfo; + type WeightInfo = moonriver_weights::pallet_identity::WeightInfo; } pub struct TransactionConverter; @@ -855,7 +854,7 @@ impl pallet_parachain_staking::Config for Runtime { type OnInactiveCollator = OnInactiveCollator; type OnNewRound = OnNewRound; type SlotProvider = RelayChainSlotProvider; - type WeightInfo = moonbeam_weights::pallet_parachain_staking::WeightInfo; + type WeightInfo = moonriver_weights::pallet_parachain_staking::WeightInfo; type MaxCandidates = ConstU32<200>; type SlotDuration = ConstU64<6_000>; type BlockTime = ConstU64<6_000>; @@ -866,14 +865,14 @@ impl pallet_author_inherent::Config for Runtime { type AccountLookup = MoonbeamOrbiters; type CanAuthor = AuthorFilter; type AuthorId = AccountId; - type WeightInfo = moonbeam_weights::pallet_author_inherent::WeightInfo; + type WeightInfo = moonriver_weights::pallet_author_inherent::WeightInfo; } impl pallet_author_slot_filter::Config for Runtime { type RuntimeEvent = RuntimeEvent; type RandomnessSource = Randomness; type PotentialAuthors = ParachainStaking; - type WeightInfo = moonbeam_weights::pallet_author_slot_filter::WeightInfo; + type WeightInfo = moonriver_weights::pallet_author_slot_filter::WeightInfo; } impl pallet_async_backing::Config for Runtime { @@ -903,7 +902,7 @@ impl pallet_crowdloan_rewards::Config for Runtime { type SignatureNetworkIdentifier = SignatureNetworkIdentifier; type VestingBlockNumber = relay_chain::BlockNumber; type VestingBlockProvider = RelaychainDataProvider; - type WeightInfo = moonbeam_weights::pallet_crowdloan_rewards::WeightInfo; + type WeightInfo = moonriver_weights::pallet_crowdloan_rewards::WeightInfo; } // This is a simple session key manager. It should probably either work with, or be replaced @@ -913,7 +912,7 @@ impl pallet_author_mapping::Config for Runtime { type DepositCurrency = Balances; type DepositAmount = ConstU128<{ 100 * currency::MOVR * currency::SUPPLY_FACTOR }>; type Keys = session_keys_primitives::VrfId; - type WeightInfo = moonbeam_weights::pallet_author_mapping::WeightInfo; + type WeightInfo = moonriver_weights::pallet_author_mapping::WeightInfo; } /// The type used to represent the kinds of proxying allowed. @@ -1136,7 +1135,7 @@ impl pallet_proxy::Config for Runtime { // Additional storage item size of 21 bytes (20 bytes AccountId + 1 byte sizeof(ProxyType)). type ProxyDepositFactor = ConstU128<{ currency::deposit(0, 21) }>; type MaxProxies = ConstU32<32>; - type WeightInfo = moonbeam_weights::pallet_proxy::WeightInfo; + type WeightInfo = moonriver_weights::pallet_proxy::WeightInfo; type MaxPending = ConstU32<32>; type CallHasher = BlakeTwo256; type AnnouncementDepositBase = ConstU128<{ currency::deposit(1, 8) }>; @@ -1157,7 +1156,7 @@ impl pallet_migrations::Config for Runtime { } impl pallet_moonbeam_lazy_migrations::Config for Runtime { - type WeightInfo = moonbeam_weights::pallet_moonbeam_lazy_migrations::WeightInfo; + type WeightInfo = moonriver_weights::pallet_moonbeam_lazy_migrations::WeightInfo; } /// Maintenance mode Call filter @@ -1282,7 +1281,7 @@ impl pallet_moonbeam_orbiters::Config for Runtime { type RotatePeriod = ConstU32<3>; /// Round index type. type RoundIndex = pallet_parachain_staking::RoundIndex; - type WeightInfo = moonbeam_weights::pallet_moonbeam_orbiters::WeightInfo; + type WeightInfo = moonriver_weights::pallet_moonbeam_orbiters::WeightInfo; } /// Only callable after `set_validation_data` is called which forms this proof the same way @@ -1346,7 +1345,7 @@ impl pallet_randomness::Config for Runtime { type MaxBlockDelay = ConstU32<2_000>; type BlockExpirationDelay = ConstU32<10_000>; type EpochExpirationDelay = ConstU64<10_000>; - type WeightInfo = moonbeam_weights::pallet_randomness::WeightInfo; + type WeightInfo = moonriver_weights::pallet_randomness::WeightInfo; } impl pallet_root_testing::Config for Runtime { @@ -1368,17 +1367,17 @@ impl pallet_multisig::Config for Runtime { type DepositBase = DepositBase; type DepositFactor = DepositFactor; type MaxSignatories = MaxSignatories; - type WeightInfo = moonbeam_weights::pallet_multisig::WeightInfo; + type WeightInfo = moonriver_weights::pallet_multisig::WeightInfo; } impl pallet_relay_storage_roots::Config for Runtime { type MaxStorageRoots = ConstU32<30>; type RelaychainStateProvider = cumulus_pallet_parachain_system::RelaychainDataProvider; - type WeightInfo = moonbeam_weights::pallet_relay_storage_roots::WeightInfo; + type WeightInfo = moonriver_weights::pallet_relay_storage_roots::WeightInfo; } impl pallet_precompile_benchmarks::Config for Runtime { - type WeightInfo = moonbeam_weights::pallet_precompile_benchmarks::WeightInfo; + type WeightInfo = moonriver_weights::pallet_precompile_benchmarks::WeightInfo; } construct_runtime! { diff --git a/runtime/moonriver/src/xcm_config.rs b/runtime/moonriver/src/xcm_config.rs index 82ed01caaa..d9486a8fe5 100644 --- a/runtime/moonriver/src/xcm_config.rs +++ b/runtime/moonriver/src/xcm_config.rs @@ -27,7 +27,7 @@ use frame_support::{ parameter_types, traits::{EitherOfDiverse, Everything, Nothing, PalletInfoAccess, TransformOrigin}, }; -use moonbeam_runtime_common::weights as moonbeam_weights; +use moonbeam_runtime_common::weights as moonriver_weights; use moonkit_xcm_primitives::AccountIdAssetIdConversion; use sp_runtime::{ traits::{Hash as THash, MaybeEquivalence, PostDispatchInfoOf}, @@ -377,7 +377,7 @@ impl pallet_xcm::Config for Runtime { type MaxRemoteLockConsumers = ConstU32<0>; type RemoteLockConsumerIdentifier = (); // TODO pallet-xcm weights - type WeightInfo = moonbeam_weights::pallet_xcm::WeightInfo; + type WeightInfo = moonriver_weights::pallet_xcm::WeightInfo; type AdminOrigin = EnsureRoot; } @@ -394,7 +394,7 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime { type MaxInboundSuspended = sp_core::ConstU32<1_000>; type ControllerOrigin = EnsureRoot; type ControllerOriginConverter = XcmOriginToTransactDispatchOrigin; - type WeightInfo = moonbeam_weights::cumulus_pallet_xcmp_queue::WeightInfo; + type WeightInfo = moonriver_weights::cumulus_pallet_xcmp_queue::WeightInfo; type PriceForSiblingDelivery = polkadot_runtime_common::xcm_sender::NoPriceForMessageDelivery< cumulus_primitives_core::ParaId, >; @@ -691,7 +691,7 @@ impl pallet_xcm_transactor::Config for Runtime { type BaseXcmWeight = BaseXcmWeight; type AssetTransactor = AssetTransactors; type ReserveProvider = AbsoluteAndRelativeReserve; - type WeightInfo = moonbeam_weights::pallet_xcm_transactor::WeightInfo; + type WeightInfo = moonriver_weights::pallet_xcm_transactor::WeightInfo; type HrmpManipulatorOrigin = GeneralAdminOrRoot; type HrmpOpenOrigin = FastGeneralAdminOrRoot; type MaxHrmpFee = xcm_builder::Case; diff --git a/runtime/moonriver/tests/integration_test.rs b/runtime/moonriver/tests/integration_test.rs index e0751c97e6..8edf274a57 100644 --- a/runtime/moonriver/tests/integration_test.rs +++ b/runtime/moonriver/tests/integration_test.rs @@ -1085,7 +1085,7 @@ fn is_contributor_via_precompile() { contributor: Address(AccountId::from(BOB).into()), }, ) - .expect_cost(1000) + .expect_cost(1669) .expect_no_logs() .execute_returns(false); @@ -1098,7 +1098,7 @@ fn is_contributor_via_precompile() { contributor: Address(AccountId::from(CHARLIE).into()), }, ) - .expect_cost(1000) + .expect_cost(1669) .expect_no_logs() .execute_returns(true); }) @@ -1170,7 +1170,7 @@ fn reward_info_via_precompile() { contributor: Address(AccountId::from(CHARLIE).into()), }, ) - .expect_cost(1000) + .expect_cost(1669) .expect_no_logs() .execute_returns((expected_total, expected_claimed)); }) @@ -1364,7 +1364,7 @@ fn initial_gas_fee_is_correct() { TransactionPaymentAsGasPrice::min_gas_price(), ( 12_500_000_000u128.into(), - Weight::from_parts(25_000_000u64, 0) + Weight::from_parts(41_742_000u64, 0) ) ); }); @@ -1386,7 +1386,7 @@ fn min_gas_fee_is_correct() { TransactionPaymentAsGasPrice::min_gas_price(), ( 1_250_000_000u128.into(), - Weight::from_parts(25_000_000u64, 0) + Weight::from_parts(41_742_000u64, 0) ) ); }); @@ -1703,7 +1703,7 @@ fn xcm_asset_erc20_precompiles_supply_and_balance() { asset_precompile_address, ForeignAssetsPCall::total_supply {}, ) - .expect_cost(2000) + .expect_cost(3338) .expect_no_logs() .execute_returns(U256::from(1000 * MOVR)); @@ -1716,7 +1716,7 @@ fn xcm_asset_erc20_precompiles_supply_and_balance() { who: Address(ALICE.into()), }, ) - .expect_cost(2000) + .expect_cost(3338) .expect_no_logs() .execute_returns(U256::from(1000 * MOVR)); }); @@ -1761,7 +1761,7 @@ fn xcm_asset_erc20_precompiles_transfer() { value: { 400 * MOVR }.into(), }, ) - .expect_cost(24360) + .expect_cost(24713) .expect_log(log3( asset_precompile_address, SELECTOR_LOG_TRANSFER, @@ -1780,7 +1780,7 @@ fn xcm_asset_erc20_precompiles_transfer() { who: Address(BOB.into()), }, ) - .expect_cost(2000) + .expect_cost(3338) .expect_no_logs() .execute_returns(U256::from(400 * MOVR)); }); @@ -1825,7 +1825,7 @@ fn xcm_asset_erc20_precompiles_approve() { value: { 400 * MOVR }.into(), }, ) - .expect_cost(14407) + .expect_cost(15587) .expect_log(log3( asset_precompile_address, SELECTOR_LOG_APPROVAL, @@ -1846,7 +1846,7 @@ fn xcm_asset_erc20_precompiles_approve() { value: { 400 * MOVR }.into(), }, ) - .expect_cost(29695) + .expect_cost(29969) .expect_log(log3( asset_precompile_address, SELECTOR_LOG_TRANSFER, @@ -1865,7 +1865,7 @@ fn xcm_asset_erc20_precompiles_approve() { who: Address(CHARLIE.into()), }, ) - .expect_cost(2000) + .expect_cost(3338) .expect_no_logs() .execute_returns(U256::from(400 * MOVR)); }); @@ -1925,7 +1925,7 @@ fn xtokens_precompiles_transfer() { weight: 4_000_000, }, ) - .expect_cost(57639) + .expect_cost(59490) .expect_no_logs() .execute_returns(()) }) @@ -1977,7 +1977,7 @@ fn xtokens_precompiles_transfer_multiasset() { weight: 4_000_000, }, ) - .expect_cost(57639) + .expect_cost(59490) .expect_no_logs() .execute_returns(()); }) @@ -2148,7 +2148,7 @@ fn transact_through_signed_precompile_works_v2() { overall_weight: total_weight, }, ) - .expect_cost(18748) + .expect_cost(23278) .expect_no_logs() .execute_returns(()); }); @@ -2266,7 +2266,7 @@ fn test_xcm_utils_ml_tp_account() { location: Location::parent(), }, ) - .expect_cost(1000) + .expect_cost(1669) .expect_no_logs() .execute_returns(Address(expected_address_parent)); @@ -2286,7 +2286,7 @@ fn test_xcm_utils_ml_tp_account() { location: parachain_2000_multilocation, }, ) - .expect_cost(1000) + .expect_cost(1669) .expect_no_logs() .execute_returns(Address(expected_address_parachain)); @@ -2316,7 +2316,7 @@ fn test_xcm_utils_ml_tp_account() { location: alice_in_parachain_2000_location, }, ) - .expect_cost(1000) + .expect_cost(1669) .expect_no_logs() .execute_returns(Address(expected_address_alice_in_parachain_2000)); }); @@ -2356,7 +2356,7 @@ fn test_xcm_utils_get_units_per_second() { Precompiles::new() .prepare_test(ALICE, xcm_utils_precompile_address, input) - .expect_cost(1000) + .expect_cost(1669) .expect_no_logs() .execute_returns(expected_units); }); diff --git a/test/suites/dev/moonbase/test-pov/test-xcm-to-evm-pov.ts b/test/suites/dev/moonbase/test-pov/test-xcm-to-evm-pov.ts index bbb7323712..fd3baafec4 100644 --- a/test/suites/dev/moonbase/test-pov/test-xcm-to-evm-pov.ts +++ b/test/suites/dev/moonbase/test-pov/test-xcm-to-evm-pov.ts @@ -123,7 +123,7 @@ describeSuite({ Transact: { originKind: "SovereignAccount", requireWeightAtMost: { - refTime: 50_025_000_000, + refTime: 50_041_742_000, proofSize: GAS_LIMIT / GAS_LIMIT_POV_RATIO, }, call: { @@ -223,7 +223,7 @@ describeSuite({ Transact: { originKind: "SovereignAccount", requireWeightAtMost: { - refTime: 160_025_000_000, + refTime: 160_041_742_000, proofSize: GAS_LIMIT / GAS_LIMIT_POV_RATIO, }, call: { diff --git a/test/suites/dev/moonbase/test-precompile/test-precompile-batch.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-batch.ts index 3178a78e7c..87d1330a2d 100644 --- a/test/suites/dev/moonbase/test-precompile/test-precompile-batch.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-batch.ts @@ -91,9 +91,9 @@ describeSuite({ .viem("public") .getTransactionReceipt({ hash: batchSomeUntilFailureResult as `0x${string}` }); - expect(batchAllReceipt["gasUsed"]).to.equal(44932n); - expect(batchSomeReceipt["gasUsed"]).to.equal(44932n); - expect(batchSomeUntilFailureReceipt["gasUsed"]).to.equal(44932n); + expect(batchAllReceipt["gasUsed"]).to.equal(45601n); + expect(batchSomeReceipt["gasUsed"]).to.equal(45601n); + expect(batchSomeUntilFailureReceipt["gasUsed"]).to.equal(45601n); }, }); diff --git a/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-utils.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-utils.ts index 6200aa44e8..d9000fe7eb 100644 --- a/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-utils.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-utils.ts @@ -172,7 +172,7 @@ describeSuite({ { Transact: { originType: "SovereignAccount", - requireWeightAtMost: 525_000_000n + 100_000_000n, // 21_000 gas limit + requireWeightAtMost: 566_742_000n, // 21_000 gas limit call: { encoded: transferCallEncoded, }, @@ -233,7 +233,7 @@ describeSuite({ { Transact: { originType: "SovereignAccount", - requireWeightAtMost: 525_000_000n + 25_000_000n, // 21_000 gas limit + requireWeightAtMost: 566_742_000n, // 21_000 gas limit call: { encoded: transferCallEncoded, }, diff --git a/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-1.ts b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-1.ts index 8d25f0ba70..b5522e6a6f 100644 --- a/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-1.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-1.ts @@ -52,12 +52,14 @@ describeSuite({ .index.toNumber(); const amountToTransfer = transferredBalance / 10n; - const GAS_LIMIT = 21_000; + const TX_GAS_LIMIT = 21_000; + // TODO: move this to the constant file + const STORAGE_READ_COST = 41_742_000n; const xcmTransactions = [ { V1: { - gas_limit: GAS_LIMIT, + gas_limit: TX_GAS_LIMIT, fee_payment: { Auto: { Low: null, @@ -73,7 +75,7 @@ describeSuite({ }, { V2: { - gas_limit: GAS_LIMIT, + gas_limit: TX_GAS_LIMIT, action: { Call: random.address, }, @@ -87,7 +89,7 @@ describeSuite({ let expectedTransferredAmount = 0n; let expectedTransferredAmountPlusFees = 0n; - const targetXcmWeight = 1_325_000_000n + 25_000_000n; + const targetXcmWeight = 1_325_000_000n + STORAGE_READ_COST; const targetXcmFee = targetXcmWeight * 50_000n; for (const xcmTransaction of xcmTransactions) { @@ -113,7 +115,7 @@ describeSuite({ ], weight_limit: { refTime: targetXcmWeight, - proofSize: (GAS_LIMIT / GAS_LIMIT_POV_RATIO) * 7, + proofSize: (TX_GAS_LIMIT / GAS_LIMIT_POV_RATIO) * 7, } as any, descend_origin: sendingAddress, }) @@ -125,8 +127,8 @@ describeSuite({ originKind: "SovereignAccount", // 21_000 gas limit + db read requireWeightAtMost: { - refTime: 550_000_000, - proofSize: GAS_LIMIT / GAS_LIMIT_POV_RATIO, + refTime: 550_000_000n + STORAGE_READ_COST, + proofSize: TX_GAS_LIMIT / GAS_LIMIT_POV_RATIO, }, call: { encoded: transferCallEncoded, diff --git a/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-12.ts b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-12.ts index b0d2468ada..32fa0959f6 100644 --- a/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-12.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-12.ts @@ -54,6 +54,8 @@ describeSuite({ const amountToTransfer = transferredBalance / 10n; const GAS_LIMIT = 500_000; + // TODO: move this to the constant file + const STORAGE_READ_COST = 41_742_000n; // We will put a very high gas limit. However, the weight accounted // for the block should only @@ -79,7 +81,7 @@ describeSuite({ let expectedTransferredAmount = 0n; let expectedTransferredAmountPlusFees = 0n; - const targetXcmWeight = 500_000n * 25000n + 25_000_000n + 800000000n; + const targetXcmWeight = 500_000n * 25000n + STORAGE_READ_COST + 800000000n; const targetXcmFee = targetXcmWeight * 50_000n; for (const xcmTransaction of xcmTransactions) { @@ -115,9 +117,9 @@ describeSuite({ .push_any({ Transact: { originKind: "SovereignAccount", - // 500_000 gas limit + db read + // 500_000 gas limit + db read (41_742_000) requireWeightAtMost: { - refTime: 12_525_000_000, + refTime: 12_525_000_000n + STORAGE_READ_COST, proofSize: GAS_LIMIT / GAS_LIMIT_POV_RATIO, }, call: { diff --git a/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-3.ts b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-3.ts index c9a034ed50..8bf4b6de8e 100644 --- a/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-3.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-3.ts @@ -172,6 +172,8 @@ describeSuite({ ]; let expectedCalls = 0n; + // TODO: move this to the constant file + const STORAGE_READ_COST = 41_742_000n; for (const xcmTransaction of xcmTransactions) { expectedCalls++; @@ -201,9 +203,9 @@ describeSuite({ .push_any({ Transact: { originKind: "SovereignAccount", - // 100_000 gas + 1 db read + // 100_000 gas + 1 db read (41_742_000) requireWeightAtMost: { - refTime: 2_525_000_000, + refTime: 2_525_000_000n + STORAGE_READ_COST, proofSize: GAS_LIMIT / GAS_LIMIT_POV_RATIO, }, call: { diff --git a/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-6.ts b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-6.ts index 90ee12553f..cc131fca47 100644 --- a/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-6.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-6.ts @@ -72,6 +72,8 @@ describeSuite({ const amountToTransfer = transferredBalance / 10n; const GAS_LIMIT = 21_000; + // TODO: move this to the constant file + const STORAGE_READ_COST = 41_742_000n; const xcmTransactions = [ { @@ -146,7 +148,7 @@ describeSuite({ originKind: "SovereignAccount", // 100_000 gas + 2db reads requireWeightAtMost: { - refTime: 575_000_000, + refTime: 575_000_000n + STORAGE_READ_COST, proofSize: GAS_LIMIT / GAS_LIMIT_POV_RATIO, }, call: { diff --git a/test/suites/dev/moonbase/test-xcm-v4/test-mock-hrmp-transact-ethereum-1.ts b/test/suites/dev/moonbase/test-xcm-v4/test-mock-hrmp-transact-ethereum-1.ts index 2eedebc08d..a2577ffc2b 100644 --- a/test/suites/dev/moonbase/test-xcm-v4/test-mock-hrmp-transact-ethereum-1.ts +++ b/test/suites/dev/moonbase/test-xcm-v4/test-mock-hrmp-transact-ethereum-1.ts @@ -52,6 +52,8 @@ describeSuite({ .index.toNumber(); const amountToTransfer = transferredBalance / 10n; + // TODO: move this to the constant file + const STORAGE_READ_COST = 41_742_000n; const xcmTransactions = [ { @@ -86,7 +88,7 @@ describeSuite({ let expectedTransferredAmount = 0n; let expectedTransferredAmountPlusFees = 0n; - const targetXcmWeight = 1_325_000_000n + 25_000_000n; + const targetXcmWeight = 1_325_000_000n + STORAGE_READ_COST; const targetXcmFee = targetXcmWeight * 50_000n; for (const xcmTransaction of xcmTransactions) { @@ -124,7 +126,7 @@ describeSuite({ originKind: "SovereignAccount", // 21_000 gas limit + db read requireWeightAtMost: { - refTime: 550_000_000n, + refTime: 550_000_000n + STORAGE_READ_COST, proofSize: 80000n, }, call: { diff --git a/test/suites/dev/moonbase/test-xcm-v4/test-mock-hrmp-transact-ethereum-6.ts b/test/suites/dev/moonbase/test-xcm-v4/test-mock-hrmp-transact-ethereum-6.ts index fdb47ed8fa..8f9c05e999 100644 --- a/test/suites/dev/moonbase/test-xcm-v4/test-mock-hrmp-transact-ethereum-6.ts +++ b/test/suites/dev/moonbase/test-xcm-v4/test-mock-hrmp-transact-ethereum-6.ts @@ -72,6 +72,9 @@ describeSuite({ const amountToTransfer = transferredBalance / 10n; + // TODO: move this to the constant file + const STORAGE_READ_COST = 41_742_000n; + const xcmTransactions = [ { V1: { @@ -145,7 +148,7 @@ describeSuite({ originKind: "SovereignAccount", // 100_000 gas + 2db reads requireWeightAtMost: { - refTime: 575_000_000n, + refTime: 575_000_000n + STORAGE_READ_COST, proofSize: 80000n, }, call: {