Skip to content

core: prevent no-op code change for 7702 edge-cases#32915

Closed
jwasinger wants to merge 3 commits intoethereum:masterfrom
jwasinger:noop-code-change-7702
Closed

core: prevent no-op code change for 7702 edge-cases#32915
jwasinger wants to merge 3 commits intoethereum:masterfrom
jwasinger:noop-code-change-7702

Conversation

@jwasinger
Copy link
Copy Markdown
Contributor

@jwasinger jwasinger commented Oct 15, 2025

There's two 7702 edge-cases where we will set code of an account when it did not actually change:

  • clearing a 7702 delegation on an account that wasn't previously delegated
  • re-delegating to the same contract that was previously-delegated to.

The motivation behind this PR is mainly that I think tracing code change hooks should only be invoked if there is an actual code change.

… account that wasn't previously delegated, re-delegating to the same contract that was previously-delegated.
@jwasinger jwasinger requested review from lightclient and s1na October 15, 2025 08:13
@s1na
Copy link
Copy Markdown
Contributor

s1na commented Oct 15, 2025

The motivation behind this PR is mainly that I think tracing code change hooks should only be invoked if there is an actual code change.

Makes sense, what about avoiding the hook invocation directly at SetCode?

@jwasinger
Copy link
Copy Markdown
Contributor Author

That's one option. it just feels a bit cleaner to do it this way.

Copy link
Copy Markdown
Member

@rjl493456442 rjl493456442 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Although the more general way to solve it is: avoid invoking the SetCode hooks if the code hash is not changed

@jwasinger jwasinger closed this Oct 21, 2025
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.

4 participants