-
Notifications
You must be signed in to change notification settings - Fork 1.1k
[pallet-revive] implement the gas limit API #6926
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
Conversation
Signed-off-by: Cyrill Leutwiler <[email protected]>
|
bot fmt |
|
@xermicus https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/7927502 was started for your command Comment |
|
@xermicus Command |
|
/cmd prdoc --audience runtime_dev --bump major |
|
/cmd bench --runtime dev --pallet pallet_revive |
|
Command "bench --runtime dev --pallet pallet_revive" has started 🚀 See logs here |
substrate/frame/revive/src/limits.rs
Outdated
|
|
||
| /// Maximum size of events (including topics) and storage values. | ||
| pub const PAYLOAD_BYTES: u32 = 512; | ||
| pub const PAYLOAD_BYTES: u32 = 384; |
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.
This seems unrelated. Why was this changed?
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.
Should have pointed out. The integrity checks fail with 2 seconds ref_time and payload bytes of 512 because the max_events_size < storage_size_limit fails. I lowered this because I think we want 2s ref_time per block.
If there is a better solution or the integrity check is incorrect we should fix that, I'm open.
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.
On a parachain you only have 0.5s of execution time. With async backing its 1 second I think. But probably better to lower this ratio in order to future proof.
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.
|
Command "bench --runtime dev --pallet pallet_revive" has finished ✅ See logs here Subweight results:
Command output:✅ Successful benchmarks of runtimes/pallets: |
| pub BlockWeights: frame_system::limits::BlockWeights = | ||
| frame_system::limits::BlockWeights::simple_max( | ||
| Weight::from_parts(2u64 * WEIGHT_REF_TIME_PER_SECOND, u64::MAX), | ||
| Weight::from_parts(2 * WEIGHT_REF_TIME_PER_SECOND, u64::MAX), | ||
| ); |
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.
can't we delete this and just use the default
https://github.com/paritytech/polkadot-sdk/blob/pg/fix-gas-encoding/substrate/frame/system/src/limits.rs?plain=1#L208
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.
Yeah I think we should have this consistent. But I think it should be the maximum we aim to support. What would that be?
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.
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.
Bumped it a bit further to 448, approaching the 2s limit closely.
|
/cmd bench --runtime dev --pallet pallet_revive |
|
Command "bench --runtime dev --pallet pallet_revive" has started 🚀 See logs here |
|
All GitHub workflows were cancelled due to failure one of the required jobs. |
|
Command "bench --runtime dev --pallet pallet_revive" has finished ✅ See logs here Subweight results:
Command output:✅ Successful benchmarks of runtimes/pallets: |
This PR implements the gas limit API, returning the maximum ref_time per block. Solidity contracts only know a single weight dimension and can use this method to get the block ref_time limit. --------- Signed-off-by: Cyrill Leutwiler <[email protected]> Signed-off-by: xermicus <[email protected]> Co-authored-by: command-bot <>
This PR implements the gas limit API, returning the maximum ref_time per block. Solidity contracts only know a single weight dimension and can use this method to get the block ref_time limit.