Skip to content

core: Add tests for EIP-7702 authorization validation and application #31802

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MozirDmitriy
Copy link

This pull request adds unit tests for the validateAuthorization and applyAuthorization
functions in core/state_transition.go. These functions are critical components
of the EIP-7702 implementation, which allows accounts to delegate code execution
to other accounts.

The tests cover:

  • Chain ID validation to prevent replay attacks across networks
  • Nonce validation to prevent transaction replay
  • Nonce overflow protection
  • Code validation to prevent setting delegations on contract accounts
  • Proper delegation code setting and clearing
  • Gas refund handling for existing accounts

While the EIP-7702 functionality has integration tests in blockchain_test.go and
transaction pool tests in legacypool_test.go, these unit tests provide more
focused coverage of the core authorization validation and application logic.

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.

1 participant