Skip to content

feat(tests-execute): EOA pkey support for stub account#2624

Merged
LouisTsai-Csie merged 10 commits intoethereum:forks/amsterdamfrom
LouisTsai-Csie:pk-stub-support
Apr 8, 2026
Merged

feat(tests-execute): EOA pkey support for stub account#2624
LouisTsai-Csie merged 10 commits intoethereum:forks/amsterdamfrom
LouisTsai-Csie:pk-stub-support

Conversation

@LouisTsai-Csie
Copy link
Copy Markdown
Collaborator

@LouisTsai-Csie LouisTsai-Csie commented Apr 6, 2026

🗒️ Description

Originally, the stub file account only supported contracts, so we only provide contract addresses to the stub file. This becomes a problem when we want to do EIP-7702 interaction on-chain, which requires providing the private key of an EOA.

In the previous PR, we embed the private key in the test, which led to RPC issues (see PR #2617 ). This PR refactors everything into the stub account.

Add private key (pkey) support to stub configuration, enabling EOA stubs for benchmark tests that need tx signing (e.g., EIP-7702 authorization lists).

Stub file format change: entries are now objects with mandatory addr and optional pkey:

  {
    "contract_stub": {"addr": "0x..."},
    "eoa_stub": {"addr": "0x...", "pkey": "0x..."}
  }

When pkey is provided, the derived address is validated against addr at parse time.

🔗 Related Issues or PRs

PR #2617

✅ Checklist

  • All: Ran fast static checks to avoid unnecessary CI fails, see also Code Standards and Enabling Pre-commit Checks:
    just static
  • All: PR title adheres to the repo standard - it will be used as the squash commit message and should start type(scope):.
  • All: Considered updating the online docs in the ./docs/ directory.
  • All: Set appropriate labels for the changes (only maintainers can apply labels).
  • Tests: Ran mkdocs serve locally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.
  • Tests: For PRs implementing a missed test case, update the post-mortem document to add an entry the list.
  • Ported Tests: All converted JSON/YML tests from ethereum/tests or tests/static have been assigned @ported_from marker.

Cute Animal Picture

Put a link to a cute animal picture inside the parenthesis-->

@LouisTsai-Csie LouisTsai-Csie self-assigned this Apr 6, 2026
@LouisTsai-Csie LouisTsai-Csie added the A-test-execute Area: execution_testing.cli.pytest_commands.plugins.execute label Apr 6, 2026
@LouisTsai-Csie LouisTsai-Csie marked this pull request as ready for review April 6, 2026 09:41
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.24%. Comparing base (4bf8bbe) to head (602d57c).

Additional details and impacted files
@@               Coverage Diff                @@
##           forks/amsterdam    #2624   +/-   ##
================================================
  Coverage            86.24%   86.24%           
================================================
  Files                  599      599           
  Lines                36984    36984           
  Branches              3795     3795           
================================================
  Hits                 31895    31895           
  Misses                4525     4525           
  Partials               564      564           
Flag Coverage Δ
unittests 86.24% <ø> (ø)

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

☔ View full report in Codecov by Sentry.
📢 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.

Copy link
Copy Markdown
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.

Some comments, mainly cleaning up a bit of technical debt surrounding this feature.

Copy link
Copy Markdown
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.

LGTM, much better, thanks for the changes!

@LouisTsai-Csie LouisTsai-Csie merged commit 9e7225a into ethereum:forks/amsterdam Apr 8, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-test-execute Area: execution_testing.cli.pytest_commands.plugins.execute

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants