-
Notifications
You must be signed in to change notification settings - Fork 1.1k
[pallet-revive] update evm create benchmark #10366
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
Changes from all commits
f102025
a7414b0
2ee22fc
8c6cfa1
2aceb4c
8412f5a
687d93e
a087885
e2ab1b3
5b65d12
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| title: '[pallet-revive] update evm create benchmark' | ||
| doc: | ||
| - audience: Runtime Dev | ||
| description: | | ||
| Add a benchmark for the EVM CREATE instruction. | ||
|
|
||
| We are currently reusing the `seal_instantiate` benchmark from PVM instantiation, which is incorrect because instantiating an EVM contract takes different arguments and follows a different code path than creating a PVM contract. | ||
|
|
||
| This benchmark performs the following steps: | ||
|
|
||
| - Generates init bytecode of size i, optionally including a balance with dust. | ||
| - Executes the init code that triggers a single benchmark opcode returning a runtime code of the maximum allowed size (qrevm::primitives::eip170::MAX_CODE_SIZE`). | ||
| crates: | ||
| - name: pallet-revive | ||
| bump: patch | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -46,11 +46,8 @@ pub fn create<const IS_CREATE2: bool, E: Ext>( | |
| let [value, code_offset, len] = interpreter.stack.popn()?; | ||
| let len = as_usize_or_halt::<E::T>(len)?; | ||
|
|
||
| // TODO: We do not charge for the new code in storage. When implementing the new gas: | ||
| // Introduce EthInstantiateWithCode, which shall charge gas based on the code length. | ||
| // See #9577 for more context. | ||
| interpreter.ext.charge_or_halt(RuntimeCosts::Instantiate { | ||
| input_data_len: len as u32, // We charge for initcode execution | ||
| interpreter.ext.charge_or_halt(RuntimeCosts::Create { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What aboute
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah true we could add it in there, or find out which one is slowest and use that, we will do that as a follow up, I think the overall impact on the weight is negligible |
||
| init_code_len: len as u32, | ||
| balance_transfer: Pallet::<E::T>::has_balance(value), | ||
| dust_transfer: Pallet::<E::T>::has_dust(value), | ||
| })?; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.