-
Notifications
You must be signed in to change notification settings - Fork 864
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
Allow configuration of worst case buy execution weight #7944
base: master
Are you sure you want to change the base?
Allow configuration of worst case buy execution weight #7944
Conversation
…-buy-execution-weight
…-buy-execution-weight
I remember back in that PR there were a couple of things that needed to be analyzed:
|
CC @RomarQ |
Any opinion on this? |
/// By default returns ((AssetId(Here.into()), 100_000_000u128), Unlimited) | ||
fn worst_case_buy_execution() -> Result<(Asset, WeightLimit), BenchmarkError> { | ||
Ok(((AssetId(Junctions::Here.into()), 100_000_000u128).into(), WeightLimit::Unlimited)) | ||
} |
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.
I would not add here default, we want runtimes to set the worst case:
/// By default returns ((AssetId(Here.into()), 100_000_000u128), Unlimited) | |
fn worst_case_buy_execution() -> Result<(Asset, WeightLimit), BenchmarkError> { | |
Ok(((AssetId(Junctions::Here.into()), 100_000_000u128).into(), WeightLimit::Unlimited)) | |
} | |
fn worst_case_buy_execution() -> Result<(Asset, WeightLimit), BenchmarkError>; |
Just thinking about fn fee_asset()
which is supposed to do the same for PayFees
,
maybe we could have something like fn worst_case_for_trader()
and use it for PayFees
and BuyExecution
benchmarks.
the case where does not even need to go into the Trader. This PR allows | ||
developers to set the worst-case scenario as they wish. | ||
crates: | ||
- name: pallet-xcm-benchmarks |
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.
- name: pallet-xcm-benchmarks | |
- name: pallet-xcm-benchmarks | |
- bump: major |
It's major since you're adding a function with no default.
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.
well.. shit! how are we gonna backport then?
I guess we'll have to limit "backport" to just 2503 which hasn't been published yet
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.
ah, nevermind, that's fine, we don't really need to backport this too far back
Adds
worst_case_buy_execution
to the Config trait ofpallet-xcm-benchmarks
with a default implementation that mimics the code that existed previous to this PR.Rationale: not allowing to set the
WeightLimit
and theFeeAsset
might mean that we dont benchmark the worst case, as withWeightLimit::Unlimited
theTrader
does not even execute:polkadot-sdk/polkadot/xcm/xcm-executor/src/lib.rs
Line 833 in c01dbeb
The new configurable function allows projects to customize the parameters with which the benchmark is run to make sure they account for the worst-case scenario
This is very likely the case of the assethub system chain, with several traders being analyzed and possibly several reads being made:
polkadot-sdk/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/xcm_config.rs
Line 403 in 38d2fa8