-
Notifications
You must be signed in to change notification settings - Fork 1.1k
pallet-revive: Fix the contract size related benchmarks #7568
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
10 commits
Select commit
Hold shift + click to select a range
8fea89f
Change the sizes benchmark
athei 2996e66
Merge branch 'master' into at/fix-benchmarks
athei 65f4668
Update from athei running command 'bench --runtime dev --pallet palle…
github-actions[bot] 2634eb6
Propagate std
athei 2b6ecd0
Integrity test: Account for host function cost
athei 4c61a4d
Update the CodeLoad token with new benchmark
athei dd17823
Update from athei running command 'prdoc --audience runtime_dev --bum…
github-actions[bot] 91b8326
Update from athei running command 'fmt --clean'
github-actions[bot] eafd837
Update substrate/frame/revive/src/benchmarking/code.rs
athei 88a0ce9
Update substrate/frame/revive/src/benchmarking/code.rs
athei 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,24 @@ | ||
| title: 'pallet-revive: Fix the contract size related benchmarks' | ||
| doc: | ||
| - audience: Runtime Dev | ||
| description: |- | ||
| Partly addresses https://github.com/paritytech/polkadot-sdk/issues/6157 | ||
|
|
||
| The benchmarks measuring the impact of contract sizes on calling or instantiating a contract were bogus because they needed to be written in assembly in order to tightly control the basic block size. | ||
|
|
||
| This fixes the benchmarks for: | ||
| - call_with_code_per_byte | ||
| - upload_code | ||
| - instantiate_with_code | ||
|
|
||
| And adds a new benchmark that accounts for the fact that the interpreter will always compile whole basic blocks: | ||
| - basic_block_compilation | ||
|
|
||
| After this PR only the weight we assign to instructions need to be addressed. | ||
| crates: | ||
| - name: pallet-revive | ||
| bump: major | ||
| - name: pallet-revive-fixtures | ||
| 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
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.
Uh oh!
There was an error while loading. Please reload this page.
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.
Could you please explain why we divide by 3? Is it a minimal instruction size?
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 is the average size of an instruction in the PolkaVM blob. But since it uses variable size encoding its not excact (see comment above). I played around a little with divisors until i get roughly the amount of instructions to hit the max blob size.