-
Notifications
You must be signed in to change notification settings - Fork 186
feat(benchmark): add pure calldata transaction case #1820
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
0c8ce83 to
bf8948c
Compare
|
This test located in |
|
#1804 got merged! Please rebase the branch and move the tests to the appropriate folder. |
bf8948c to
0d2840f
Compare
|
@marioevz thank you, I've rebased accordingly. And this PR is ready for review now |
|
I read the proposal as well as some analysis (this is a good one), and refactored the benchmark accordingly. Please let me know if my understanding is incorrect: According to EIP-7623, the gas cost is calculated as follows: tx.gasUsed = 21000 + max(
STANDARD_TOKEN_COST * tokens_in_calldata
+ execution_gas_used
+ isContractCreation * (32000 + INITCODE_WORD_COST * words(calldata)),
TOTAL_COST_FLOOR_PER_TOKEN * tokens_in_calldata,
)In this test case, since the transaction only includes a payload and does not execute any bytecode or create a contract, both tx.gasUsed = 21000 + max(
STANDARD_TOKEN_COST * tokens_in_calldata,
TOTAL_COST_FLOOR_PER_TOKEN * tokens_in_calldata,
)Given that tx.gasUsed = 21000 + 10 * tokens_in_calldataBy definition: tokens_in_calldata = zero_bytes_in_calldata + 4 * nonzero_bytes_in_calldataWe use this relationship to compute the total number of bytes that can fit in the payload under the available gas limit. Note: I also add the explanation in the test case for clarity |
jochem-brouwer
left a comment
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.
One question/remark π π
jochem-brouwer
left a comment
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.
LGTM! π π
spencer-tb
left a comment
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.
LGTM! Thanks
* refactor: rename eth transfer cost * feat(benchmark): add empty payload test case * refactor: apply eip7623 for empty payload test * fix(benchmark): update max token in calldata formula * refactor(benchmark): rename test for block with full data payload
ποΈ Description
Create benchmark test with pure payload data, there are two scenario: null / non-null bytes payload.
π Related Issues or PRs
Issue #1734
β Checklist
toxchecks to avoid unnecessary CI fails, see also Code Standards and Enabling Pre-commit Checks:uvx --with=tox-uv tox -e lint,typecheck,spellcheck,markdownlinttype(scope):.mkdocs servelocally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.@ported_frommarker.