Skip to content

Conversation

jochem-brouwer
Copy link
Member

@jochem-brouwer jochem-brouwer commented Mar 31, 2025

🗒️ Description

PR built on top of #1280 to add EIP-6110 DepositEvent log layout tests as described in ethereum/EIPs#9460

It tests:

  • LOG with correct layout and an ERC20 Transfer event (Sepolia-like case) (VALID)
  • LOG with log data > 576 (INVALID block)
  • LOG with log data < 576 (INVALID block)

For each param (pubkey, withdrawal_credentials, amount, signature, index)

  • LOG with offsets not at the right location (INVALID block)
  • LOG with sizes not at the right sizes (INVALID block)

🔗 Related Issues

Closes #1360

✅ Checklist

  • All: Set appropriate labels for the changes.
  • All: Considered squashing commits to improve commit history.
  • All: Added an entry to CHANGELOG.md.
  • All: Considered updating the online docs in the ./docs/ directory.
  • Tests: All converted JSON/YML tests from ethereum/tests have been added to converted-ethereum-tests.txt.
  • Tests: A PR with removal of converted JSON/YML tests from ethereum/tests have been opened.
  • Tests: Included the type and version of evm t8n tool used to locally execute test cases: e.g., ref with commit hash or geth 1.13.1-stable-3f40e65.
  • Tests: Ran mkdocs serve locally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.

@jochem-brouwer jochem-brouwer changed the title Eip6110 event layout tests feat(tests): EIP-6110 DepositEvent layout+topic tests Mar 31, 2025
@spencer-tb spencer-tb added scope:tests Scope: Changes EL client test cases in `./tests` type:feat type: Feature labels Apr 3, 2025
@spencer-tb spencer-tb added the fork:prague Prague hardfork label Apr 14, 2025
Copy link
Member

@marioevz marioevz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for these!

I think it looks pretty good overall, and just some minor linting issues to get to calm down ruff and mypy :)

If you need help with anything please just ping me and I can help out, but basically once we fix the comments we should be able to go ahead and merge 👍

@jochem-brouwer jochem-brouwer force-pushed the eip6110-event-layout-tests branch from 71b9c65 to 75391a6 Compare April 16, 2025 17:09
@jochem-brouwer jochem-brouwer force-pushed the eip6110-event-layout-tests branch from ca41b73 to 4f5cc55 Compare April 16, 2025 23:09
@jochem-brouwer jochem-brouwer marked this pull request as ready for review April 16, 2025 23:17
@jochem-brouwer
Copy link
Member Author

CI passes, ready for review!

NOTE: the current tests will check for the "failed transaction error" for the invalid deposit logs. This will fail on client implementations which check the deposit contract logs after ALL transactions (EthJS) and not after EACH transaction (EELS). Any client which has this bug likely implements it the "EthJS" way and is therefore not suitable to fill the tests. Note that EIP-6110 specs parsing the deposit logs after all transactions, not after each transaction.

Copy link
Member

@marioevz marioevz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks so much for these!

@marioevz marioevz merged commit 2757408 into ethereum:main Apr 16, 2025
11 checks passed
pacrob pushed a commit to pacrob/execution-spec-tests that referenced this pull request May 5, 2025
* new(tests): Add EIP-6110 Sepolia Variant Contract test

* fix(tests): Log code

* fix(tests): Log code

* fix: ABI encoding optional

* fix: parametrize for ABI (No-ABI test disabled)

* fix(docs): add docs to helper

* fix(tests): lint modified_contract (?)

* feat(tests): add DEPOSIT_EVENT_SIGNATURE_HASH EIP-6110

* tmp: add sepolia deposit log data

* change test and helper methods

* convert back to little-endian encoding

* feat(helpers): add helper method to construct modified deposit logs

* feat(tests): use new helper in modified contract tests

* update test modified contract

* fix test filler to produce the correct requests hash

* feat(tests): add EIP6110 invalid event layout tests

* feat(tests): add exception to transaction

* cleanup(tests): use DEFAULTs where appropriate

* feat(tests): add invalid log length test

* chore(tests) lint

* Update tests/prague/eip6110_deposits/helpers.py

Co-authored-by: Mario Vega <marioevz@gmail.com>

* Update tests/prague/eip6110_deposits/helpers.py

Co-authored-by: Mario Vega <marioevz@gmail.com>

* Update tests/prague/eip6110_deposits/test_modified_contract.py

Co-authored-by: Mario Vega <marioevz@gmail.com>

* Update tests/prague/eip6110_deposits/test_modified_contract.py

Co-authored-by: Mario Vega <marioevz@gmail.com>

* Update tests/prague/eip6110_deposits/helpers.py

Co-authored-by: Mario Vega <marioevz@gmail.com>

* Update tests/prague/eip6110_deposits/helpers.py

Co-authored-by: Mario Vega <marioevz@gmail.com>

* chore(tests): lint

* chore(tests): make typecheck say "congratulations"

* chore(tests): add pytestmark

* chore(tests): remove TODO

* Update tests/prague/eip6110_deposits/test_modified_contract.py

---------

Co-authored-by: Mario Vega <marioevz@gmail.com>
felix314159 pushed a commit to felix314159/execution-spec-tests that referenced this pull request May 16, 2025
* new(tests): Add EIP-6110 Sepolia Variant Contract test

* fix(tests): Log code

* fix(tests): Log code

* fix: ABI encoding optional

* fix: parametrize for ABI (No-ABI test disabled)

* fix(docs): add docs to helper

* fix(tests): lint modified_contract (?)

* feat(tests): add DEPOSIT_EVENT_SIGNATURE_HASH EIP-6110

* tmp: add sepolia deposit log data

* change test and helper methods

* convert back to little-endian encoding

* feat(helpers): add helper method to construct modified deposit logs

* feat(tests): use new helper in modified contract tests

* update test modified contract

* fix test filler to produce the correct requests hash

* feat(tests): add EIP6110 invalid event layout tests

* feat(tests): add exception to transaction

* cleanup(tests): use DEFAULTs where appropriate

* feat(tests): add invalid log length test

* chore(tests) lint

* Update tests/prague/eip6110_deposits/helpers.py

Co-authored-by: Mario Vega <marioevz@gmail.com>

* Update tests/prague/eip6110_deposits/helpers.py

Co-authored-by: Mario Vega <marioevz@gmail.com>

* Update tests/prague/eip6110_deposits/test_modified_contract.py

Co-authored-by: Mario Vega <marioevz@gmail.com>

* Update tests/prague/eip6110_deposits/test_modified_contract.py

Co-authored-by: Mario Vega <marioevz@gmail.com>

* Update tests/prague/eip6110_deposits/helpers.py

Co-authored-by: Mario Vega <marioevz@gmail.com>

* Update tests/prague/eip6110_deposits/helpers.py

Co-authored-by: Mario Vega <marioevz@gmail.com>

* chore(tests): lint

* chore(tests): make typecheck say "congratulations"

* chore(tests): add pytestmark

* chore(tests): remove TODO

* Update tests/prague/eip6110_deposits/test_modified_contract.py

---------

Co-authored-by: Mario Vega <marioevz@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fork:prague Prague hardfork scope:tests Scope: Changes EL client test cases in `./tests` type:feat type: Feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat(tests): add tests for the new stricter rules of EIP-6110 (deposit requests)
4 participants