Skip to content

Commit

Permalink
feat: Enable storage weight reclaiming (#2931)
Browse files Browse the repository at this point in the history
* feat: Enable storage weight reclaiming
* fix test
  • Loading branch information
RomarQ authored Sep 4, 2024
1 parent c6a71e5 commit a8ca4d3
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 6 deletions.
3 changes: 3 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ cumulus-primitives-parachain-inherent = { git = "https://github.com/moonbeam-fou
cumulus-primitives-timestamp = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.11.0", default-features = false }
cumulus-primitives-utility = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.11.0", default-features = false }
cumulus-test-relay-sproof-builder = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.11.0", default-features = false }
cumulus-primitives-storage-weight-reclaim = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.11.0", default-features = false }
parachain-info = { package = "staging-parachain-info", git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.11.0", default-features = false }
parachains-common = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.11.0", default-features = false }

Expand Down Expand Up @@ -375,9 +376,7 @@ slices = "0.2.0"
smallvec = "1.8.0"
strum = { version = "0.24", default-features = false, features = ["derive"] }
strum_macros = "0.24"
p256 = { version = "0.13.2", default-features = false, features = [
"ecdsa",
] }
p256 = { version = "0.13.2", default-features = false, features = ["ecdsa"] }

# Other (client)

Expand Down
3 changes: 2 additions & 1 deletion node/service/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -461,10 +461,11 @@ where
let executor = wasm_builder.build();

let (client, backend, keystore_container, task_manager) =
sc_service::new_full_parts::<Block, RuntimeApi, _>(
sc_service::new_full_parts_record_import::<Block, RuntimeApi, _>(
config,
telemetry.as_ref().map(|(_, telemetry)| telemetry.handle()),
executor,
true,
)?;

if let Some(block_number) = Customizations::first_block_number_compatible_with_ed25519_zebra() {
Expand Down
4 changes: 3 additions & 1 deletion runtime/moonbase/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ cumulus-pallet-xcmp-queue = { workspace = true }
cumulus-primitives-core = { workspace = true }
cumulus-primitives-timestamp = { workspace = true }
cumulus-primitives-utility = { workspace = true }
cumulus-primitives-storage-weight-reclaim = { workspace = true }
parachain-info = { workspace = true }
parachains-common = { workspace = true }

Expand Down Expand Up @@ -212,6 +213,7 @@ std = [
"cumulus-primitives-core/std",
"cumulus-primitives-timestamp/std",
"cumulus-primitives-utility/std",
"cumulus-primitives-storage-weight-reclaim/std",
"evm-tracing-events/std",
"fp-evm/std",
"fp-rpc/std",
Expand Down Expand Up @@ -262,7 +264,7 @@ std = [
"pallet-evm-precompile-xcm-utils/std",
"pallet-evm-precompile-xtokens/std",
"pallet-evm-precompileset-assets-erc20/std",
"pallet-evm-precompile-storage-cleaner/std",
"pallet-evm-precompile-storage-cleaner/std",
"pallet-evm-precompile-p256verify/std",
"pallet-evm/std",
"pallet-identity/std",
Expand Down
1 change: 1 addition & 0 deletions runtime/moonbase/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1475,6 +1475,7 @@ pub type SignedExtra = (
frame_system::CheckNonce<Runtime>,
frame_system::CheckWeight<Runtime>,
pallet_transaction_payment::ChargeTransactionPayment<Runtime>,
cumulus_primitives_storage_weight_reclaim::StorageWeightReclaim<Runtime>,
);
/// Unchecked extrinsic type as expected by this runtime.
pub type UncheckedExtrinsic =
Expand Down
2 changes: 2 additions & 0 deletions runtime/moonbeam/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ cumulus-pallet-xcmp-queue = { workspace = true }
cumulus-primitives-core = { workspace = true }
cumulus-primitives-timestamp = { workspace = true }
cumulus-primitives-utility = { workspace = true }
cumulus-primitives-storage-weight-reclaim = { workspace = true }
parachain-info = { workspace = true }
parachains-common = { workspace = true }

Expand Down Expand Up @@ -205,6 +206,7 @@ std = [
"cumulus-primitives-core/std",
"cumulus-primitives-timestamp/std",
"cumulus-primitives-utility/std",
"cumulus-primitives-storage-weight-reclaim/std",
"evm-tracing-events/std",
"fp-evm/std",
"fp-rpc/std",
Expand Down
1 change: 1 addition & 0 deletions runtime/moonbeam/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1524,6 +1524,7 @@ pub type SignedExtra = (
frame_system::CheckNonce<Runtime>,
frame_system::CheckWeight<Runtime>,
pallet_transaction_payment::ChargeTransactionPayment<Runtime>,
cumulus_primitives_storage_weight_reclaim::StorageWeightReclaim<Runtime>,
);
/// Unchecked extrinsic type as expected by this runtime.
pub type UncheckedExtrinsic =
Expand Down
2 changes: 2 additions & 0 deletions runtime/moonriver/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ cumulus-pallet-xcmp-queue = { workspace = true }
cumulus-primitives-core = { workspace = true }
cumulus-primitives-timestamp = { workspace = true }
cumulus-primitives-utility = { workspace = true }
cumulus-primitives-storage-weight-reclaim = { workspace = true }
parachain-info = { workspace = true }
parachains-common = { workspace = true }

Expand Down Expand Up @@ -206,6 +207,7 @@ std = [
"cumulus-primitives-core/std",
"cumulus-primitives-timestamp/std",
"cumulus-primitives-utility/std",
"cumulus-primitives-storage-weight-reclaim/std",
"evm-tracing-events/std",
"fp-evm/std",
"fp-rpc/std",
Expand Down
1 change: 1 addition & 0 deletions runtime/moonriver/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1525,6 +1525,7 @@ pub type SignedExtra = (
frame_system::CheckNonce<Runtime>,
frame_system::CheckWeight<Runtime>,
pallet_transaction_payment::ChargeTransactionPayment<Runtime>,
cumulus_primitives_storage_weight_reclaim::StorageWeightReclaim<Runtime>,
);
/// Unchecked extrinsic type as expected by this runtime.
pub type UncheckedExtrinsic =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
// export const TARGET_FILL_AMOUNT =
// ((MAX_BLOCK_WEIGHT * 0.75 * 0.25 - EXTRINSIC_BASE_WEIGHT) / MAX_BLOCK_WEIGHT) * 1_000_000_000;
// In 0.9.43 rootTesting::fillBlock() now uses more weight so we need to account for that
const TARGET_FILL_AMOUNT = 262_212_900;
const TARGET_FILL_AMOUNT = 262_349_350;

// Note on the values from 'transactionPayment.nextFeeMultiplier': this storage item is actually a
// FixedU128, which is basically a u128 with an implicit denominator of 10^18. However, this
Expand Down

0 comments on commit a8ca4d3

Please sign in to comment.