Closed
Conversation
notlesh
commented
Aug 24, 2021
runtime/moonbase/src/lib.rs
Outdated
| ::with_sensible_defaults(MAXIMUM_BLOCK_WEIGHT, NORMAL_DISPATCH_RATIO); | ||
| pub RuntimeBlockWeights: BlockWeights = BlockWeights::builder() | ||
| .for_class(DispatchClass::Normal, |weights| { | ||
| weights.base_extrinsic = EXTRINSIC_BASE_WEIGHT; |
Contributor
Author
There was a problem hiding this comment.
This PR is all about setting this value here.
notlesh
commented
Aug 24, 2021
runtime/moonbase/src/lib.rs
Outdated
| /// These values are dictated by Polkadot for the parachain. | ||
| pub BlockWeights: frame_system::limits::BlockWeights = frame_system::limits::BlockWeights | ||
| ::with_sensible_defaults(MAXIMUM_BLOCK_WEIGHT, NORMAL_DISPATCH_RATIO); | ||
| pub RuntimeBlockWeights: BlockWeights = BlockWeights::builder() |
Contributor
Author
There was a problem hiding this comment.
This impl is based on the previously used with_sensible_defaults() fn copied out of Substrate.
|
seems like I was mentioned here, but I don't see anything? 👀 |
Contributor
Author
Sorry, I should have left my original message. I was asking about Thanks for taking a look, though! |
Contributor
Author
|
Superceded by #1218 |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What does it do?
This PR uses a custom
BlockWeightsimplementation to enforce a base weight for extrinsics. Although the mechanics ofExtrinsicBaseWeighthas changed (it is now a private constant in Substrate), the Substrate docs still have this to say about it:"...an ExtrinsicBaseWeight that is declared in the runtime and applies to all extrinsics. The base weight covers inclusion overhead like signature verification."
source: https://substrate.dev/docs/en/knowledgebase/runtime/fees
What important points reviewers should know?
The goal is to account for the fact that our signature verification is relatively expensive.
I'm not quite clear yet how this will impact Ethereum transactions (which have their own way of accounting for this); this needs to NOT impact them.
Is there something left for follow-up PRs?
What alternative implementations were considered?
Providing our own weights through benchmarking. When I ran the
frame_systembenchmarks in our own codebase, the weights weren't consistently higher or lower. In particular, they did not seem to reflect the idea that our signature verification is more expensive (I don't believe this overhead is included when using the benchmarking system).Are there relevant PRs or issues in other repositories (Substrate, Polkadot, Frontier, Cumulus)?
It looks like Substrate used to allow a runtime to specify its own
ExtrinsicBaseWeightup until this PR:paritytech/substrate#6629
What value does it bring to the blockchain users?
Security
TODO
EXTRINSIC_BASE_WEIGHTvalue