Skip to content

Optimise CREATE(2) by removing redundant check#9580

Merged
Marchhill merged 2 commits into
masterfrom
optimise-create-already-deployed
Oct 28, 2025
Merged

Optimise CREATE(2) by removing redundant check#9580
Marchhill merged 2 commits into
masterfrom
optimise-create-already-deployed

Conversation

@Marchhill

@Marchhill Marchhill commented Oct 27, 2025

Copy link
Copy Markdown
Contributor

Changes

  • Remove redundant check for dead account to clear storage. This is safe to do as we implement EIP-7610, so the contract deployment would have already failed if the address had storage
  • Microoptimisations

Types of changes

What types of changes does your code introduce?

  • Bugfix (a non-breaking change that fixes an issue)
  • New feature (a non-breaking change that adds functionality)
  • Breaking change (a change that causes existing functionality not to work as expected)
  • Optimization
  • Refactoring
  • Documentation update
  • Build-related changes
  • Other: Description

Testing

Requires testing

  • Yes
  • No

If yes, did you write tests?

  • Yes
  • No

Documentation

Requires documentation update

  • Yes
  • No

Requires explanation in Release Notes

  • Yes
  • No

@flcl42

flcl42 commented Oct 28, 2025

Copy link
Copy Markdown
Contributor

Any way to test it?

@marcindsobczak marcindsobczak left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

From what I understand, state.ClearStorage() is already unreachable if state is non-empty, so this PR is removing indeed redundant check.

The better question is, why our archive sync is working fine when we already have this kind of bug? Clearing non-empty storage never happened in history?

@Marchhill

Copy link
Copy Markdown
Contributor Author

From what I understand, state.ClearStorage() is already unreachable if state is non-empty, so this PR is removing indeed redundant check.

The better question is, why our archive sync is working fine when we already have this kind of bug? Clearing non-empty storage never happened in history?

I think it probably hasn't happened as would require a hash collision so extremely unlikely

@Marchhill

Marchhill commented Oct 28, 2025

Copy link
Copy Markdown
Contributor Author

Any way to test it?

Not really as the code is unreachable

@Marchhill Marchhill merged commit b4fd430 into master Oct 28, 2025
80 checks passed
@Marchhill Marchhill deleted the optimise-create-already-deployed branch October 28, 2025 14:13
@LukaszRozmej

Copy link
Copy Markdown
Member

please check if no regressions in hive!

@flcl42

flcl42 commented Oct 29, 2025

Copy link
Copy Markdown
Contributor

Any way to test it?

Not really as the code is unreachable

I can't find any collision tests, might be good to have some

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants