Skip to content

Commit 075a913

Browse files
Add storage-weight-reclaim to polkadot system chains (#1047)
This adds storage-weight-reclaim to polkadot-system-chains. --------- Co-authored-by: GitHub Action <[email protected]>
1 parent 4d9eca7 commit 075a913

File tree

24 files changed

+434
-60
lines changed

24 files changed

+434
-60
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
1010
- Bridge-Hubs - Add proxy pallet ([#1045](https://github.com/polkadot-fellows/runtimes/pull/1045)).
1111
- AH Polkadot - A new stepped curve primitive. Used for the 'Hard Pressure' inflation changes from [Ref 1710](https://polkadot.subsquare.io/referenda/1710) ([#898](https://github.com/polkadot-fellows/runtimes/pull/898)).
1212
- AH Polkadot - Added `pallet_revive` and changed proof size fee formula ([polkadot-fellows/runtimes/pull/1050](https://github.com/polkadot-fellows/runtimes/pull/1050))
13+
- Add `cumulus-pallet-weight-reclaim` to all Polkadot system parachains (Asset Hub, Bridge Hub, Coretime, People, Collectives) for storage weight reclaim functionality ([#1047](https://github.com/polkadot-fellows/runtimes/pull/1047)).
1314

1415
### Changed
1516

Cargo.lock

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

system-parachains/asset-hubs/asset-hub-polkadot/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ xcm-runtime-apis = { workspace = true }
122122
cumulus-pallet-aura-ext = { workspace = true }
123123
cumulus-pallet-parachain-system = { workspace = true }
124124
cumulus-pallet-session-benchmarking = { workspace = true }
125+
cumulus-pallet-weight-reclaim = { workspace = true }
125126
cumulus-pallet-xcm = { workspace = true }
126127
cumulus-pallet-xcmp-queue = { features = ["bridging"], workspace = true }
127128
cumulus-primitives-aura = { workspace = true }
@@ -167,6 +168,7 @@ runtime-benchmarks = [
167168
"bp-bridge-hub-polkadot/runtime-benchmarks",
168169
"cumulus-pallet-parachain-system/runtime-benchmarks",
169170
"cumulus-pallet-session-benchmarking/runtime-benchmarks",
171+
"cumulus-pallet-weight-reclaim/runtime-benchmarks",
170172
"cumulus-pallet-xcmp-queue/runtime-benchmarks",
171173
"cumulus-primitives-core/runtime-benchmarks",
172174
"cumulus-primitives-utility/runtime-benchmarks",
@@ -239,6 +241,7 @@ try-runtime = [
239241
"assets-common/try-runtime",
240242
"cumulus-pallet-aura-ext/try-runtime",
241243
"cumulus-pallet-parachain-system/try-runtime",
244+
"cumulus-pallet-weight-reclaim/try-runtime",
242245
"cumulus-pallet-xcm/try-runtime",
243246
"cumulus-pallet-xcmp-queue/try-runtime",
244247
"frame-election-provider-support/try-runtime",
@@ -311,6 +314,7 @@ std = [
311314
"cumulus-pallet-aura-ext/std",
312315
"cumulus-pallet-parachain-system/std",
313316
"cumulus-pallet-session-benchmarking/std",
317+
"cumulus-pallet-weight-reclaim/std",
314318
"cumulus-pallet-xcm/std",
315319
"cumulus-pallet-xcmp-queue/std",
316320
"cumulus-primitives-aura/std",

system-parachains/asset-hubs/asset-hub-polkadot/src/lib.rs

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1454,6 +1454,10 @@ impl pallet_revive::Config for Runtime {
14541454
type GasScale = ConstU32<80_000>;
14551455
}
14561456

1457+
impl cumulus_pallet_weight_reclaim::Config for Runtime {
1458+
type WeightInfo = weights::cumulus_pallet_weight_reclaim::WeightInfo<Runtime>;
1459+
}
1460+
14571461
// Create the runtime by composing the FRAME pallets that were previously configured.
14581462
construct_runtime!(
14591463
pub enum Runtime
@@ -1467,6 +1471,7 @@ construct_runtime!(
14671471
Preimage: pallet_preimage = 5,
14681472
Scheduler: pallet_scheduler = 6,
14691473
Parameters: pallet_parameters = 7,
1474+
WeightReclaim: cumulus_pallet_weight_reclaim = 8,
14701475

14711476
// Monetary stuff.
14721477
Balances: pallet_balances = 10,
@@ -1546,18 +1551,21 @@ pub type SignedBlock = generic::SignedBlock<Block>;
15461551
/// BlockId type as expected by this runtime.
15471552
pub type BlockId = generic::BlockId<Block>;
15481553
/// The `TransactionExtension` to the basic transaction logic.
1549-
pub type TxExtension = (
1550-
frame_system::CheckNonZeroSender<Runtime>,
1551-
frame_system::CheckSpecVersion<Runtime>,
1552-
frame_system::CheckTxVersion<Runtime>,
1553-
frame_system::CheckGenesis<Runtime>,
1554-
frame_system::CheckEra<Runtime>,
1555-
frame_system::CheckNonce<Runtime>,
1556-
frame_system::CheckWeight<Runtime>,
1557-
pallet_asset_conversion_tx_payment::ChargeAssetTxPayment<Runtime>,
1558-
frame_metadata_hash_extension::CheckMetadataHash<Runtime>,
1559-
pallet_revive::evm::tx_extension::SetOrigin<Runtime>,
1560-
);
1554+
pub type TxExtension = cumulus_pallet_weight_reclaim::StorageWeightReclaim<
1555+
Runtime,
1556+
(
1557+
frame_system::CheckNonZeroSender<Runtime>,
1558+
frame_system::CheckSpecVersion<Runtime>,
1559+
frame_system::CheckTxVersion<Runtime>,
1560+
frame_system::CheckGenesis<Runtime>,
1561+
frame_system::CheckEra<Runtime>,
1562+
frame_system::CheckNonce<Runtime>,
1563+
frame_system::CheckWeight<Runtime>,
1564+
pallet_asset_conversion_tx_payment::ChargeAssetTxPayment<Runtime>,
1565+
frame_metadata_hash_extension::CheckMetadataHash<Runtime>,
1566+
pallet_revive::evm::tx_extension::SetOrigin<Runtime>,
1567+
),
1568+
>;
15611569

15621570
/// Default extensions applied to Ethereum transactions.
15631571
#[derive(Clone, PartialEq, Eq, Debug)]
@@ -1580,6 +1588,7 @@ impl pallet_revive::evm::runtime::EthExtra for EthExtraImpl {
15801588
frame_metadata_hash_extension::CheckMetadataHash::<Runtime>::new(false),
15811589
pallet_revive::evm::tx_extension::SetOrigin::<Runtime>::new_from_eth_transaction(),
15821590
)
1591+
.into()
15831592
}
15841593
}
15851594

@@ -1716,6 +1725,7 @@ mod benches {
17161725
[pallet_transaction_payment, TransactionPayment]
17171726
[pallet_collator_selection, CollatorSelection]
17181727
[cumulus_pallet_parachain_system, ParachainSystem]
1728+
[cumulus_pallet_weight_reclaim, WeightReclaim]
17191729
[cumulus_pallet_xcmp_queue, XcmpQueue]
17201730
[pallet_conviction_voting, ConvictionVoting]
17211731
[pallet_referenda, Referenda]

system-parachains/asset-hubs/asset-hub-polkadot/src/weights/cumulus_pallet_weight_reclaim.rs

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

system-parachains/asset-hubs/asset-hub-polkadot/src/weights/mod.rs

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

system-parachains/bridge-hubs/bridge-hub-polkadot/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ xcm-runtime-apis = { workspace = true }
7777
cumulus-pallet-aura-ext = { workspace = true }
7878
cumulus-pallet-parachain-system = { workspace = true }
7979
cumulus-pallet-session-benchmarking = { workspace = true }
80+
cumulus-pallet-weight-reclaim = { workspace = true }
8081
cumulus-pallet-xcm = { workspace = true }
8182
cumulus-pallet-xcmp-queue = { features = ["bridging"], workspace = true }
8283
cumulus-primitives-aura = { workspace = true }
@@ -155,6 +156,7 @@ std = [
155156
"cumulus-pallet-aura-ext/std",
156157
"cumulus-pallet-parachain-system/std",
157158
"cumulus-pallet-session-benchmarking/std",
159+
"cumulus-pallet-weight-reclaim/std",
158160
"cumulus-pallet-xcm/std",
159161
"cumulus-pallet-xcmp-queue/std",
160162
"cumulus-primitives-aura/std",
@@ -246,6 +248,7 @@ runtime-benchmarks = [
246248
"bridge-runtime-common/runtime-benchmarks",
247249
"cumulus-pallet-parachain-system/runtime-benchmarks",
248250
"cumulus-pallet-session-benchmarking/runtime-benchmarks",
251+
"cumulus-pallet-weight-reclaim/runtime-benchmarks",
249252
"cumulus-pallet-xcmp-queue/runtime-benchmarks",
250253
"cumulus-primitives-core/runtime-benchmarks",
251254
"cumulus-primitives-utility/runtime-benchmarks",
@@ -296,6 +299,7 @@ runtime-benchmarks = [
296299
try-runtime = [
297300
"cumulus-pallet-aura-ext/try-runtime",
298301
"cumulus-pallet-parachain-system/try-runtime",
302+
"cumulus-pallet-weight-reclaim/try-runtime",
299303
"cumulus-pallet-xcm/try-runtime",
300304
"cumulus-pallet-xcmp-queue/try-runtime",
301305
"frame-executive/try-runtime",

system-parachains/bridge-hubs/bridge-hub-polkadot/src/lib.rs

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -116,19 +116,22 @@ pub type SignedBlock = generic::SignedBlock<Block>;
116116
pub type BlockId = generic::BlockId<Block>;
117117

118118
/// The `TransactionExtension` to the basic transaction logic.
119-
pub type TxExtension = (
120-
frame_system::CheckNonZeroSender<Runtime>,
121-
frame_system::CheckSpecVersion<Runtime>,
122-
frame_system::CheckTxVersion<Runtime>,
123-
frame_system::CheckGenesis<Runtime>,
124-
frame_system::CheckEra<Runtime>,
125-
frame_system::CheckNonce<Runtime>,
126-
frame_system::CheckWeight<Runtime>,
127-
pallet_transaction_payment::ChargeTransactionPayment<Runtime>,
128-
BridgeRejectObsoleteHeadersAndMessages,
129-
bridge_to_kusama_config::OnBridgeHubPolkadotRefundBridgeHubKusamaMessages,
130-
frame_metadata_hash_extension::CheckMetadataHash<Runtime>,
131-
);
119+
pub type TxExtension = cumulus_pallet_weight_reclaim::StorageWeightReclaim<
120+
Runtime,
121+
(
122+
frame_system::CheckNonZeroSender<Runtime>,
123+
frame_system::CheckSpecVersion<Runtime>,
124+
frame_system::CheckTxVersion<Runtime>,
125+
frame_system::CheckGenesis<Runtime>,
126+
frame_system::CheckEra<Runtime>,
127+
frame_system::CheckNonce<Runtime>,
128+
frame_system::CheckWeight<Runtime>,
129+
pallet_transaction_payment::ChargeTransactionPayment<Runtime>,
130+
BridgeRejectObsoleteHeadersAndMessages,
131+
bridge_to_kusama_config::OnBridgeHubPolkadotRefundBridgeHubKusamaMessages,
132+
frame_metadata_hash_extension::CheckMetadataHash<Runtime>,
133+
),
134+
>;
132135

133136
bridge_runtime_common::generate_bridge_reject_obsolete_headers_and_messages! {
134137
RuntimeCall, AccountId,
@@ -652,6 +655,10 @@ impl pallet_proxy::Config for Runtime {
652655
type BlockNumberProvider = System;
653656
}
654657

658+
impl cumulus_pallet_weight_reclaim::Config for Runtime {
659+
type WeightInfo = weights::cumulus_pallet_weight_reclaim::WeightInfo<Runtime>;
660+
}
661+
655662
// Create the runtime by composing the FRAME pallets that were previously configured.
656663
construct_runtime!(
657664
pub enum Runtime
@@ -661,6 +668,7 @@ construct_runtime!(
661668
ParachainSystem: cumulus_pallet_parachain_system = 1,
662669
Timestamp: pallet_timestamp = 2,
663670
ParachainInfo: parachain_info = 3,
671+
WeightReclaim: cumulus_pallet_weight_reclaim = 4,
664672

665673
// Monetary stuff.
666674
Balances: pallet_balances = 10,
@@ -733,6 +741,7 @@ mod benches {
733741
[pallet_transaction_payment, TransactionPayment]
734742
[pallet_collator_selection, CollatorSelection]
735743
[cumulus_pallet_parachain_system, ParachainSystem]
744+
[cumulus_pallet_weight_reclaim, WeightReclaim]
736745
[cumulus_pallet_xcmp_queue, XcmpQueue]
737746
// XCM
738747
[pallet_xcm, PalletXcmExtrinsicsBenchmark::<Runtime>]

system-parachains/bridge-hubs/bridge-hub-polkadot/src/weights/cumulus_pallet_weight_reclaim.rs

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

system-parachains/bridge-hubs/bridge-hub-polkadot/src/weights/mod.rs

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)