-
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
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
9113580
the gas limit API
xermicus 4ca3271
Merge branch 'master' into cl/gaslimit
xermicus d1d557e
Update from xermicus running command 'prdoc --audience runtime_dev --…
e7cd288
Update from xermicus running command 'bench --runtime dev --pallet pa…
23e145f
Merge branch 'master' into cl/gaslimit
xermicus 1dfbcdd
slightly bump the limit
xermicus 9ccddba
Merge branch 'master' into cl/gaslimit
xermicus 911c823
Merge branch 'master' into cl/gaslimit
xermicus 13dfd9b
Update from xermicus running command 'bench --runtime dev --pallet pa…
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| title: '[pallet-revive] implement the gas limit API' | ||
| doc: | ||
| - audience: Runtime Dev | ||
| description: 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. | ||
| crates: | ||
| - name: pallet-revive-fixtures | ||
| bump: major | ||
| - name: pallet-revive | ||
| bump: major | ||
| - name: pallet-revive-uapi | ||
| bump: major |
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 |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| // This file is part of Substrate. | ||
|
|
||
| // Copyright (C) Parity Technologies (UK) Ltd. | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| // Licensed under the Apache License, Version 2.0 (the "License"); | ||
| // you may not use this file except in compliance with the License. | ||
| // You may obtain a copy of the License at | ||
| // | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // | ||
| // Unless required by applicable law or agreed to in writing, software | ||
| // distributed under the License is distributed on an "AS IS" BASIS, | ||
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| // See the License for the specific language governing permissions and | ||
| // limitations under the License. | ||
|
|
||
| //! Returns the block ref_time limit back to the caller. | ||
|
|
||
| #![no_std] | ||
| #![no_main] | ||
|
|
||
| extern crate common; | ||
| use uapi::{HostFn, HostFnImpl as api, ReturnFlags}; | ||
|
|
||
| #[no_mangle] | ||
| #[polkavm_derive::polkavm_export] | ||
| pub extern "C" fn deploy() {} | ||
|
|
||
| #[no_mangle] | ||
| #[polkavm_derive::polkavm_export] | ||
| pub extern "C" fn call() { | ||
| api::return_value(ReturnFlags::empty(), &api::gas_limit().to_le_bytes()); | ||
| } |
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
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
Oops, something went wrong.
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.
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.
We should tune to 2s: https://wiki.polkadot.network/docs/maintain-guides-async-backing#phase-3---activate-async-backing
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.