Skip to content

fix: publish EIP-7702 code changes - #519

Open
AshinGau wants to merge 1 commit into
risechain:mainfrom
AshinGau:fix/eip7702-redelegation-code-hash
Open

fix: publish EIP-7702 code changes#519
AshinGau wants to merge 1 commit into
risechain:mainfrom
AshinGau:fix/eip7702-redelegation-code-hash

Conversation

@AshinGau

Copy link
Copy Markdown

Summary

  • detect code changes by comparing the post-state code hash with the value read during execution
  • publish the updated code hash and bytecode when an EIP-7702 authority is re-delegated
  • add a regression test that compares sequential and parallel execution for two delegations followed by a call

Context

When an authority is delegated from contract X to contract Y later in the same block, its previous code hash is already non-empty. Treating code as new only when the previous hash is absent skips the second code publication, so a later transaction can resolve X instead of Y from multi-version memory.

The regression test makes the difference observable by having X and Y store different values in the authority account.

Tests

  • cargo fmt --all -- --check
  • RUSTFLAGS=-Dwarnings cargo clippy --workspace --all-targets
  • cargo test -p pevm --lib
  • cargo test --release -p pevm --test eip7702 -- --test-threads=1

Closes #518

@AshinGau
AshinGau requested review from a team as code owners July 23, 2026 09:04
@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

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.

EIP-7702 re-delegation can leave a stale code hash in MV memory

1 participant