Skip to content

feat(consume): add ExceptionMapper support to the consume-engine simulator #1416

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

Merged
merged 40 commits into from
Apr 17, 2025

Conversation

marioevz
Copy link
Member

@marioevz marioevz commented Apr 9, 2025

🗒️ Description

Adds support of the exception mapper to consume-engine:

consume engine now checks exceptions returned by the execution clients in their Engine API responses, specifically in the validationErrorfield of the engine_newPayloadVX method.

Exception mappers of all current mainnet clients have been added to the ethereum_clis library.

The feature can be disabled by using --disable-strict-exception-matching for specific clients or forks.

🔗 Related Issues

✅ 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.

@danceratopz danceratopz changed the title feat(plugins/consume): Support Exception Mapper feat(consume): add ExceptionMapper support to the consume-engine simulator Apr 11, 2025
@danceratopz danceratopz added type:feat type: Feature scope:consume Scope: Consume command suite labels Apr 11, 2025
@spencer-tb spencer-tb added the fork:prague Prague hardfork label Apr 14, 2025
@winsvega
Copy link
Contributor

winsvega commented Apr 14, 2025

I found there are some issue with refactored exception mapper. perhaps this can be address in here in this PR
if not fixed already (some)
#1440

Copy link
Contributor

@winsvega winsvega left a comment

Choose a reason for hiding this comment

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

waut the complexity of exception mapper is growing. I need to study python again.

Copy link
Member

@danceratopz danceratopz left a comment

Choose a reason for hiding this comment

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

Love this, few suggestions, also in #1464.

@marioevz marioevz marked this pull request as ready for review April 16, 2025 17:07
@marioevz marioevz force-pushed the exception-mapper-consume branch from 27845aa to ce47dbb Compare April 16, 2025 23:53
Copy link
Member

@danceratopz danceratopz left a comment

Choose a reason for hiding this comment

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

LGTM!

@marioevz marioevz merged commit cb4ccde into main Apr 17, 2025
22 checks passed
@marioevz marioevz deleted the exception-mapper-consume branch April 17, 2025 18:53
somnathb1 added a commit to erigontech/erigon that referenced this pull request Apr 24, 2025
Temporarily increase failure threshold. Failures because of mismatch in
error mappings or sequence. Some of these are nice to have but not
urgent:
ethereum/execution-spec-tests#1416
pacrob pushed a commit to pacrob/execution-spec-tests that referenced this pull request May 5, 2025
…mulator (ethereum#1416)

* fix(exceptions): UndefinedException return on new

* feat(rpc,plugins/consume): Support exception mapper

* fix(exceptions): Allow undefined mapper

* feat(plugins/consume): Add more mappers

* fix(logging): don't use newlines within log messages

* refactor(exceptions,specs): ExceptionWithMessage contains a list

* new(exceptions): Add `INVALID_BLOCK_HASH` exception

* feat(clis): Add ethjs exceptions

* feat(clis): Add geth exceptions

* feat(plugins/consume): Add besu exceptions

* feat(plugins/consume): Add nethermind exceptions

* feat(plugins/consume): Add reth exceptions

* feat(consume): add `--strict-exception-matching` parameter

* more reth exceptions

* refactor mappers

* add ethjs exception

* fix(tests): EIP-7685: Add expected exception to `test_invalid_multi_type_requests_engine`

* add reth exception

* fix(plugins/consume): log failure

* feat(clis): Add Erigon Exception Mapper

* feat(specs): Allow setting expected block exception for state tests (only affects generated block tests)

* fix(tests): Add block exceltion to test_blob_type_tx_pre_fork

* fix(clis): Exceptions in mappers

* change(plugins/consume): Enable strict exception matching by default

* fix(specs): Exception message check on strict match

* docs: changelog

* chore(clis): update exception mappers for TYPE_4_TX_PRE_FORK

* refactor(consume): cache exception mappers in session-scoped fixture

* refactor(consume): make string match more robust by applying `lower()`

* feat(consume): allow disabling of strict exception checking per fork

* refactor(consume/hive): create `strict_exception_matching` fixture

* fix: whitelist

* changelog: Add exception

* changelog: Invalid versioned hashes exception

* refactor(consume/engine): Better error logging

* fix(clis/reth): Exception mapper

* fix(clis/besu): Exception mapper

* fix(clis/geth): Exception mapper

* fix(clis/ethereumjs): Exception mapper

* fix(clis/erigon): Exception mapper

---------

Co-authored-by: danceratopz <[email protected]>
felix314159 pushed a commit to felix314159/execution-spec-tests that referenced this pull request May 16, 2025
…mulator (ethereum#1416)

* fix(exceptions): UndefinedException return on new

* feat(rpc,plugins/consume): Support exception mapper

* fix(exceptions): Allow undefined mapper

* feat(plugins/consume): Add more mappers

* fix(logging): don't use newlines within log messages

* refactor(exceptions,specs): ExceptionWithMessage contains a list

* new(exceptions): Add `INVALID_BLOCK_HASH` exception

* feat(clis): Add ethjs exceptions

* feat(clis): Add geth exceptions

* feat(plugins/consume): Add besu exceptions

* feat(plugins/consume): Add nethermind exceptions

* feat(plugins/consume): Add reth exceptions

* feat(consume): add `--strict-exception-matching` parameter

* more reth exceptions

* refactor mappers

* add ethjs exception

* fix(tests): EIP-7685: Add expected exception to `test_invalid_multi_type_requests_engine`

* add reth exception

* fix(plugins/consume): log failure

* feat(clis): Add Erigon Exception Mapper

* feat(specs): Allow setting expected block exception for state tests (only affects generated block tests)

* fix(tests): Add block exceltion to test_blob_type_tx_pre_fork

* fix(clis): Exceptions in mappers

* change(plugins/consume): Enable strict exception matching by default

* fix(specs): Exception message check on strict match

* docs: changelog

* chore(clis): update exception mappers for TYPE_4_TX_PRE_FORK

* refactor(consume): cache exception mappers in session-scoped fixture

* refactor(consume): make string match more robust by applying `lower()`

* feat(consume): allow disabling of strict exception checking per fork

* refactor(consume/hive): create `strict_exception_matching` fixture

* fix: whitelist

* changelog: Add exception

* changelog: Invalid versioned hashes exception

* refactor(consume/engine): Better error logging

* fix(clis/reth): Exception mapper

* fix(clis/besu): Exception mapper

* fix(clis/geth): Exception mapper

* fix(clis/ethereumjs): Exception mapper

* fix(clis/erigon): Exception mapper

---------

Co-authored-by: danceratopz <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fork:prague Prague hardfork scope:consume Scope: Consume command suite type:feat type: Feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants