-
Notifications
You must be signed in to change notification settings - Fork 147
feat(tests): add worst-case block test for 7702 set code #1758
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
base: main
Are you sure you want to change the base?
Conversation
""" | ||
env = Environment() | ||
attack_gas_limit = env.gas_limit | ||
sender = pre.fund_eoa() |
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 probably need to pre-set these to an authorization for the reset to do something.
sender = pre.fund_eoa() | |
sender = pre.fund_eoa(delegation=Address(0x1)) |
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.
Agree, but sounds it would only have effects for the first tx of the list. Starting with the second and further txs, the delegation will be considered a noop, no? So most tx won't be doing any real work.
I wonder if this test should probably:
- Try calculating the maximum number of delegations possible for
gas_limit
(and remove theiteration_count
parameter). - Create N different accounts as suggested by @marioevz code suggestion.
- Create the N different delegations for target T in a single tx (to save as much intrinsic gas as possible? But not sure this will have a limit reg tx size)
- Let
T
in the bullet above be parametrizable, i.e.:0x00
for testing as many resets, andnon-0x00
for testing real delegations.
def test_block_full_of_7702_set_code( | ||
blockchain_test: BlockchainTestFiller, | ||
pre: Alloc, | ||
iteration_count: int, |
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.
Is this missing a defined parametrization?
(Edit: see also my message below)
""" | ||
env = Environment() | ||
attack_gas_limit = env.gas_limit | ||
sender = pre.fund_eoa() |
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.
Agree, but sounds it would only have effects for the first tx of the list. Starting with the second and further txs, the delegation will be considered a noop, no? So most tx won't be doing any real work.
I wonder if this test should probably:
- Try calculating the maximum number of delegations possible for
gas_limit
(and remove theiteration_count
parameter). - Create N different accounts as suggested by @marioevz code suggestion.
- Create the N different delegations for target T in a single tx (to save as much intrinsic gas as possible? But not sure this will have a limit reg tx size)
- Let
T
in the bullet above be parametrizable, i.e.:0x00
for testing as many resets, andnon-0x00
for testing real delegations.
ποΈ Description
Add blockchain test for EIP-7702 set code transaction.
π Related Issues
Issue #1453
β Checklist
mkdocs serve
locally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.