Skip to content

asset-hub-polkadot: use inmemorydb weights#1025

Merged
alexggh merged 7 commits into
polkadot-fellows:mainfrom
alexggh:polkadot-asset-hub-weights
Dec 12, 2025
Merged

asset-hub-polkadot: use inmemorydb weights#1025
alexggh merged 7 commits into
polkadot-fellows:mainfrom
alexggh:polkadot-asset-hub-weights

Conversation

@alexggh
Copy link
Copy Markdown
Contributor

@alexggh alexggh commented Dec 4, 2025

Modify asset-hub-polkadot to use the read/write costs computed in validate block on validator reference hardware, since these are weights that guarantee the blocks will pass validation and make it on the relay chain.

This were obtained with the benchmark created here: paritytech/polkadot-sdk#8069.

Part of: #800

Signed-off-by: Alexandru Gheorghe <alexandru.gheorghe@parity.io>
@alexggh alexggh requested a review from athei December 4, 2025 23:05
@alexggh alexggh requested a review from AndreiEres December 4, 2025 23:05
@alexggh alexggh requested a review from bkchr December 4, 2025 23:05
Signed-off-by: Alexandru Gheorghe <alexandru.gheorghe@parity.io>
Signed-off-by: Alexandru Gheorghe <alexandru.gheorghe@parity.io>
@alexggh
Copy link
Copy Markdown
Contributor Author

alexggh commented Dec 10, 2025

@claravanstaden with this PR I see tests::snowbridge_v2_config::asset_hub_weights_should_be_equal_or_gte_bridge_hub_weights fails, because reads/writes weights just became lower, could you give me a bit more context about this test, is it mandatory for asset_hub_weights to always be bigger that bridge_hub for this extrinscs or is it there just to make sure things are kept in sync ?

If this is mandatory I can do something like this to make sure the weights for extrinsics snowbridge_pallet_system_backend.rs don't get affected.

        fn transact_register_token() -> Weight {
                Weight::from_parts(53_009_000, 0)
                        .saturating_add(Weight::from_parts(0, 4115))
-                       .saturating_add(T::DbWeight::get().reads(4))
-                       .saturating_add(T::DbWeight::get().writes(4))
+                       .saturating_add(RocksDbWeight::get().reads(4))
+                       .saturating_add(RocksDbWeight::get().writes(4))

@claravanstaden
Copy link
Copy Markdown
Contributor

Hey @alexggh!

is it mandatory for asset_hub_weights to always be bigger that bridge_hub for this extrinscs or is it there just to make sure things are kept in sync ?

Yes, it is mandatory for the AH weights to be equal or bigger than the BH extrinsics, because these AH extrinsics call a corresponding extrinsic on BH. So the caller needs to cover both the AH and BH extrinsic costs.

Signed-off-by: Alexandru Gheorghe <alexandru.gheorghe@parity.io>
@alexggh
Copy link
Copy Markdown
Contributor Author

alexggh commented Dec 10, 2025

Hey @alexggh!

is it mandatory for asset_hub_weights to always be bigger that bridge_hub for this extrinscs or is it there just to make sure things are kept in sync ?

Yes, it is mandatory for the AH weights to be equal or bigger than the BH extrinsics, because these AH extrinsics call a corresponding extrinsic on BH. So the caller needs to cover both the AH and BH extrinsic costs.

Alright totally makes sense, then I'll keep them that same e2c5830, let me know if you have any concern.

Copy link
Copy Markdown
Contributor

@claravanstaden claravanstaden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alexggh perfect!

@github-actions
Copy link
Copy Markdown

Review required! Latest push from author must always be reviewed

@alexggh alexggh enabled auto-merge (squash) December 11, 2025 14:21
@alexggh alexggh merged commit 9e6c9aa into polkadot-fellows:main Dec 12, 2025
51 of 65 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants