Skip to content

state: Transaction destination is delegated before Prague #1824

Open

Description

@chfast

transition() in test/state/state.cpp resolves the EIP-7702 delegation of the transaction destination with get_delegate_address() at every revision. Delegations exist only from Prague, and the CALL instructions check state.rev < EVMC_PRAGUE before resolving them (get_target_address(), lib/evmone/instructions_calls.cpp:26).

So before Prague a transaction to an account with code 0xef0100 || D executes D's code with EVMC_DELEGATED and warms D, while a CALL to the same account executes the account's own code and fails on 0xEF. This matters only for synthetic states, e.g. in fuzzing or state tests: no code starting with 0xEF existed before London (EIP-3541), so a valid pre-Prague state has no such account. validate_state() accepts it in pre-London state tests. execution-specs executes the account's own code there.

Fix: resolve the delegation only for rev >= EVMC_PRAGUE.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions