-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix claim_rewards_to benchmark to enable Snowbridge reward claims
#10952
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
claravanstaden
wants to merge
5
commits into
paritytech:master
Choose a base branch
from
claravanstaden:fix-claim-rewards-to
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,25 +16,32 @@ | |
| //! Autogenerated weights for `pallet_bridge_relayers` | ||
| //! | ||
| //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 | ||
| //! DATE: 2025-02-21, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` | ||
| //! DATE: 2026-01-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` | ||
| //! WORST CASE MAP SIZE: `1000000` | ||
| //! HOSTNAME: `d3b41be4aae8`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` | ||
| //! HOSTNAME: `MacBook-Pro-4.local`, CPU: `<UNKNOWN>` | ||
| //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 | ||
|
|
||
| // Executed Command: | ||
| // frame-omni-bencher | ||
| // ./target/release/frame-omni-bencher | ||
| // v1 | ||
| // benchmark | ||
| // pallet | ||
| // --extrinsic=* | ||
| // --runtime=target/production/wbuild/bridge-hub-westend-runtime/bridge_hub_westend_runtime.wasm | ||
| // --pallet=pallet_bridge_relayers | ||
| // --header=/__w/polkadot-sdk/polkadot-sdk/cumulus/file_header.txt | ||
| // --output=./cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/weights | ||
| // --wasm-execution=compiled | ||
| // --steps=50 | ||
| // --repeat=20 | ||
| // --heap-pages=4096 | ||
| // --runtime | ||
| // target/release/wbuild/bridge-hub-westend-runtime/bridge_hub_westend_runtime.wasm | ||
| // -p | ||
| // pallet_bridge_relayers | ||
| // -e | ||
| // * | ||
| // --output | ||
| // ./cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/weights/pallet_bridge_relayers.rs | ||
| // --header | ||
| // ./cumulus/file_header.txt | ||
| // -s | ||
| // 50 | ||
| // -r | ||
| // 20 | ||
| // --heap-pages | ||
| // 4096 | ||
| // --no-storage-info | ||
| // --no-min-squares | ||
| // --no-median-slopes | ||
|
|
@@ -50,84 +57,52 @@ use core::marker::PhantomData; | |
| /// Weight functions for `pallet_bridge_relayers`. | ||
| pub struct WeightInfo<T>(PhantomData<T>); | ||
| impl<T: frame_system::Config> pallet_bridge_relayers::WeightInfo for WeightInfo<T> { | ||
| /// Storage: `BridgeRelayers::RelayerRewards` (r:1 w:1) | ||
| /// Proof: `BridgeRelayers::RelayerRewards` (`max_values`: None, `max_size`: Some(74), added: 2549, mode: `MaxEncodedLen`) | ||
| /// Storage: `System::Account` (r:1 w:1) | ||
| /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) | ||
| fn claim_rewards() -> Weight { | ||
| // Proof Size summary in bytes: | ||
| // Measured: `245` | ||
| // Estimated: `3593` | ||
| // Minimum execution time: 53_074_000 picoseconds. | ||
| Weight::from_parts(54_759_000, 0) | ||
| .saturating_add(Weight::from_parts(0, 3593)) | ||
| .saturating_add(T::DbWeight::get().reads(2)) | ||
| .saturating_add(T::DbWeight::get().writes(2)) | ||
| // Estimated: `0` | ||
| // Minimum execution time: 39_000_000 picoseconds. | ||
| Weight::from_parts(40_000_000, 0) | ||
| .saturating_add(Weight::from_parts(0, 0)) | ||
| } | ||
| /// Storage: `Benchmark::Override` (r:0 w:0) | ||
| /// Proof: `Benchmark::Override` (`max_values`: None, `max_size`: None, mode: `Measured`) | ||
| fn claim_rewards_to() -> Weight { | ||
| // Proof Size summary in bytes: | ||
| // Measured: `0` | ||
| // Measured: `297` | ||
| // Estimated: `0` | ||
| // Minimum execution time: 18_446_744_073_709_551_000 picoseconds. | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| Weight::from_parts(18_446_744_073_709_551_000, 0) | ||
| // Minimum execution time: 40_000_000 picoseconds. | ||
| Weight::from_parts(41_000_000, 0) | ||
| .saturating_add(Weight::from_parts(0, 0)) | ||
| } | ||
| /// Storage: `BridgeRelayers::RegisteredRelayers` (r:1 w:1) | ||
| /// Proof: `BridgeRelayers::RegisteredRelayers` (`max_values`: None, `max_size`: Some(68), added: 2543, mode: `MaxEncodedLen`) | ||
| /// Storage: UNKNOWN KEY `0x1e8445dc201eeb8560e5579a5dd54655` (r:1 w:0) | ||
| /// Proof: UNKNOWN KEY `0x1e8445dc201eeb8560e5579a5dd54655` (r:1 w:0) | ||
| /// Storage: `Balances::Reserves` (r:1 w:1) | ||
| /// Proof: `Balances::Reserves` (`max_values`: None, `max_size`: Some(1249), added: 3724, mode: `MaxEncodedLen`) | ||
| fn register() -> Weight { | ||
| // Proof Size summary in bytes: | ||
| // Measured: `97` | ||
| // Estimated: `4714` | ||
| // Minimum execution time: 28_995_000 picoseconds. | ||
| Weight::from_parts(29_546_000, 0) | ||
| .saturating_add(Weight::from_parts(0, 4714)) | ||
| .saturating_add(T::DbWeight::get().reads(3)) | ||
| .saturating_add(T::DbWeight::get().writes(2)) | ||
| // Estimated: `0` | ||
| // Minimum execution time: 20_000_000 picoseconds. | ||
| Weight::from_parts(20_000_000, 0) | ||
| .saturating_add(Weight::from_parts(0, 0)) | ||
| } | ||
| /// Storage: `BridgeRelayers::RegisteredRelayers` (r:1 w:1) | ||
| /// Proof: `BridgeRelayers::RegisteredRelayers` (`max_values`: None, `max_size`: Some(68), added: 2543, mode: `MaxEncodedLen`) | ||
| /// Storage: `Balances::Reserves` (r:1 w:1) | ||
| /// Proof: `Balances::Reserves` (`max_values`: None, `max_size`: Some(1249), added: 3724, mode: `MaxEncodedLen`) | ||
| fn deregister() -> Weight { | ||
| // Proof Size summary in bytes: | ||
| // Measured: `197` | ||
| // Estimated: `4714` | ||
| // Minimum execution time: 29_628_000 picoseconds. | ||
| Weight::from_parts(30_523_000, 0) | ||
| .saturating_add(Weight::from_parts(0, 4714)) | ||
| .saturating_add(T::DbWeight::get().reads(2)) | ||
| .saturating_add(T::DbWeight::get().writes(2)) | ||
| // Estimated: `0` | ||
| // Minimum execution time: 20_000_000 picoseconds. | ||
| Weight::from_parts(20_000_000, 0) | ||
| .saturating_add(Weight::from_parts(0, 0)) | ||
| } | ||
| /// Storage: `BridgeRelayers::RegisteredRelayers` (r:1 w:1) | ||
| /// Proof: `BridgeRelayers::RegisteredRelayers` (`max_values`: None, `max_size`: Some(68), added: 2543, mode: `MaxEncodedLen`) | ||
| /// Storage: `Balances::Reserves` (r:1 w:1) | ||
| /// Proof: `Balances::Reserves` (`max_values`: None, `max_size`: Some(1249), added: 3724, mode: `MaxEncodedLen`) | ||
| fn slash_and_deregister() -> Weight { | ||
| // Proof Size summary in bytes: | ||
| // Measured: `197` | ||
| // Estimated: `4714` | ||
| // Minimum execution time: 23_510_000 picoseconds. | ||
| Weight::from_parts(24_095_000, 0) | ||
| .saturating_add(Weight::from_parts(0, 4714)) | ||
| .saturating_add(T::DbWeight::get().reads(2)) | ||
| .saturating_add(T::DbWeight::get().writes(2)) | ||
| // Estimated: `0` | ||
| // Minimum execution time: 17_000_000 picoseconds. | ||
| Weight::from_parts(18_000_000, 0) | ||
| .saturating_add(Weight::from_parts(0, 0)) | ||
| } | ||
| /// Storage: `BridgeRelayers::RelayerRewards` (r:1 w:1) | ||
| /// Proof: `BridgeRelayers::RelayerRewards` (`max_values`: None, `max_size`: Some(74), added: 2549, mode: `MaxEncodedLen`) | ||
| fn register_relayer_reward() -> Weight { | ||
| // Proof Size summary in bytes: | ||
| // Measured: `42` | ||
| // Estimated: `3539` | ||
| // Minimum execution time: 7_212_000 picoseconds. | ||
| Weight::from_parts(7_552_000, 0) | ||
| .saturating_add(Weight::from_parts(0, 3539)) | ||
| .saturating_add(T::DbWeight::get().reads(1)) | ||
| .saturating_add(T::DbWeight::get().writes(1)) | ||
| // Estimated: `0` | ||
| // Minimum execution time: 4_000_000 picoseconds. | ||
| Weight::from_parts(6_000_000, 0) | ||
| .saturating_add(Weight::from_parts(0, 0)) | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| title: 'Fix `claim_rewards_to` benchmark to enable Snowbridge reward claims' | ||
| doc: | ||
| - audience: Runtime Dev | ||
| description: |- | ||
| The `prepare_rewards_account` benchmark helper was returning `None`, causing `claim_rewards_to` | ||
| to be assigned `Weight::MAX` and effectively disabling the extrinsic in production. This fix | ||
| returns a valid beneficiary account, enabling Snowbridge relayers to claim rewards to AssetHub | ||
| as intended. | ||
| crates: | ||
| - name: bridge-hub-westend-runtime | ||
| bump: patch |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In what configuration does it makes sense that this function return
None? :DThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not completely sure. My guess is this what stub code and had to be updated once claim_rewards_to was implemented, and I missed it.
@bkontur may you confirm, just want to make sure I'm not affecting anything on the P<>K bridge relayers side.