Skip to content

fix(tests): allow INVALID_CHAINID for legacy chain IDs over 64 bits - #3935

Merged
danceratopz merged 1 commit into
ethereum:forks/bogotafrom
rorupuntou:fix/test-legacy-chain-id-exceptions
Nov 3, 2026
Merged

danceratopz merged 1 commit into
ethereum:forks/bogotafrom
rorupuntou:fix/test-legacy-chain-id-exceptions

Conversation

@rorupuntou

Copy link
Copy Markdown
Contributor

Resolves #3930

Description

In test_legacy_chain_id_over_64_bits (test_chain_id.py), legacy transactions with a chain ID encoded in v that exceeds 64 bits (smallest_65_bit_chain_id and chain_id_plus_2_64) currently strictly expect TransactionException.INVALID_SIGNATURE_VRS.

As reported in #3930, client implementations handle this boundary in two valid ways:

  • Clients that narrow or bounds-check v against 64 bits during signature decoding (such as EELS, Nethermind, and Nimbus) reject with INVALID_SIGNATURE_VRS.
  • Clients that compute the full chain ID using 256-bit arithmetic (such as Erigon) reject with INVALID_CHAINID due to the chain ID mismatch against the configured network.

This change allows both INVALID_SIGNATURE_VRS and INVALID_CHAINID for these two cases via error = [TransactionException.INVALID_SIGNATURE_VRS, TransactionException.INVALID_CHAINID], generating the canonical INVALID_SIGNATURE_VRS|INVALID_CHAINID expectation in fixtures. The largest_64_bit_chain_id boundary case remains strictly INVALID_CHAINID.

Checklist

  • Ran fast static checks: just static
  • Verified test filling: uv run fill tests/spurious_dragon/eip155_simple_replay_attack_protection/test_chain_id.py --until=Bogota --clean
  • PR title follows <type>(<area>): <description> convention

@rorupuntou

Copy link
Copy Markdown
Contributor Author

Friendly bump on this fix for #3930 following up on tests@v21.0.2 (#3828)! Since no reviewers were auto-assigned, pinging @danceratopz @fselmo @spencer-tb @marioevz whenever you have a spare minute to approve the pending CI workflow run and give this +12/-4 diff a quick look. Thanks!

@danceratopz danceratopz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @rorupuntou, makes sense!

@codecov

codecov Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.10%. Comparing base (75955fb) to head (c4db3db).
⚠️ Report is 10 commits behind head on forks/bogota.

Additional details and impacted files
@@              Coverage Diff              @@
##           forks/bogota    #3935   +/-   ##
=============================================
  Coverage         95.10%   95.10%           
=============================================
  Files               673      673           
  Lines             40904    40904           
  Branches           3778     3778           
=============================================
  Hits              38903    38903           
  Misses             1393     1393           
  Partials            608      608           
Flag Coverage Δ
unittests 95.10% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@danceratopz

Copy link
Copy Markdown
Member

I ran this against erigon and geth, the original exception matching was too restrictive: This fixes 5 fails for Erigon v3.8.1 and 12 for geth v1.17.10. Will need a patch test fixture release to ensure no false positives.

@danceratopz
danceratopz merged commit 118c432 into ethereum:forks/bogota Nov 3, 2026
20 checks passed
@rorupuntou

Copy link
Copy Markdown
Contributor Author

Glad to hear it cleared those 17 failures on Erigon and Geth. Thanks for running the client checks and merging @danceratopz!

-1312

@rorupuntou

Copy link
Copy Markdown
Contributor Author

Followed up on the remaining lower-boundary cases for legacy v (chain ID 0 and sub-35 values) in #3955 for whenever you get a chance to take a look @danceratopz.

-1312

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tests: clarify oversized legacy chain-ID exception expectations

2 participants