execution/protocol: a sender with an EIP-7702 designator is accepted before Prague

Open Beginner friendly
#26,523 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
go

Research direction

Start in execution/protocol/txn_executor.go at the preCheck sender code exemption, and compare it with the Prague-gated exemption in execution/builder/exec.go. Reproduce with the EIP-7702 sender fixture using evm statetest for a pre-Prague fork. Done when pre-Prague execution returns SENDER_NOT_EOA and the Prague case still passes.

Written by the indexing model from the issue text.

Description

Before Prague, Erigon accepts a transaction from a sender whose code is an EIP-7702 delegation designator. EIP-3607 rejects every sender that has code. EIP-7702 adds the exemption for the designator, so the exemption starts at Prague.

EELS rejects the sender with "not EOA" at every fork before Prague (cancun/fork.py L500-L501). From Prague, it exempts only a valid designator (prague/fork.py L532-L536).

Erigon's block builder already applies the exemption only from Prague (execution/builder/exec.go L479-L496). The consensus path exempts the designator at every fork (execution/protocol/txn_executor.go L273-L292). So Erigon does not build such a block. But when it executes such a block, it accepts the transaction. The payload is then INVALID only because the gas used does not match the header.

Priority: low. Only a genesis allocation can give a sender a designator before Prague.

Test: the open PR ethereum/execution-specs#4028 adds test_sender_with_delegation_designator. The sender holds the 23-byte designator and sends a plain value transfer. Before Prague, the test expects SENDER_NOT_EOA.

Tested: Erigon main ecd128a6.

  • evm statetest on the filled fixture, for each fork from Frontier to Cancun: expected error "TransactionException.SENDER_NOT_EOA", got no error. The Prague case passes.
  • Engine API: Erigon rejects the block, but only for the gas mismatch: gas used by execution: 21000, in header: 0.

To reproduce, fill the test from the branch of ethereum/execution-specs#4028 and run evm statetest on the output. The second command runs the Cancun fixture. Repeat it for each for_<fork> directory, from Frontier to Cancun:

uv run fill tests/prague/eip7702_set_code_tx/test_set_code_sender_check.py --until Prague
evm statetest fixtures/state_tests/for_cancun/prague/eip7702_set_code_tx/set_code_sender_check/sender_with_delegation_designator.json

A possible fix is a fork gate on the exemption in preCheck, where rules is already in scope:

if !ok || !rules.IsPrague {
Dominant language
Go
Stars
3.6k
Forks
1.6k
Avg merge
1d 17h
Merged PRs (30d)
820

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from erigontech/erigon

All issues in erigontech/erigon

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.