-
Notifications
You must be signed in to change notification settings - Fork 183
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_calldata By definition: tokens_in_calldata = zero_bytes_in_calldata + 4 * nonzero_bytes_in_calldata We 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 |
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 π π
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! π π
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
ποΈ Description
Create benchmark test with pure payload data, there are two scenario: null / non-null bytes payload.
π Related Issues or PRs
Issue #1734
β Checklist
tox
checks to avoid unnecessary CI fails, see also Code Standards and Enabling Pre-commit Checks:uvx --with=tox-uv tox -e lint,typecheck,spellcheck,markdownlint
type(scope):
.mkdocs serve
locally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.@ported_from
marker.