Skip to content

Comments

OOG if not enough gas for self-destruct#10064

Merged
Marchhill merged 1 commit intoNethermindEth:bal-devnet-1from
fselmo:bal-devnet-1
Jan 5, 2026
Merged

OOG if not enough gas for self-destruct#10064
Marchhill merged 1 commit intoNethermindEth:bal-devnet-1from
fselmo:bal-devnet-1

Conversation

@fselmo
Copy link

@fselmo fselmo commented Dec 29, 2025

Changes

  • OOG if not enough gas for self-destruct. This prevents reaching into state unnecessarily on new account gas check.

I believe this is directly related to the latest issues on devnet 1 where the BAL generated by Nethermind did not agree with all other clients by touching state unnecessarily with OOG on selfdestruct check.

I think this line is quite relevant here. Since this was a precompile, it did not charge any gas for access and moved on. This may have actually executed the selfdestruct successfully if we don't hit any other checks on availableGas in the logic here even though there wasn't enough gas for selfdestruct (we deducted it from availableGas but never performed any other "successful" check on the value where it would have triggered the OOG). On the devnet this may have happened on the parent call somewhere, not quite sure. Either way we need to OOG early to keep with consensus for BALs if there is not enough gas.

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

Notes on testing

I saw there weren't a lot of tests for instructions that revolve around these. If one is desired I can include it here or feel free to push to my branch.

  • ethereum/execution-specs tests: I will make sure we add new test cases for selfdestruct to precompiles as this seems like it was a unique code path that was triggered, related to precompile as beneficiary.
    • ^ update: OOG test scenarios for selfdestruct to precompiles updated in this PR. I confirmed on hive that Nethermind indeed does not pass the oog_before_state_access cases in this PR.

Documentation

Requires documentation update

  • Yes
  • No

Requires explanation in Release Notes

  • Yes
  • No

Remarks

Happy to close this or update here if there is a better option. Thanks.

@fselmo
Copy link
Author

fselmo commented Dec 30, 2025

I can confirm the tests all pass with this change. I'm not sure about the CI failures here, I will wait for someone merge this I suppose :). But let me know if this needs to be updated anywhere.

@Marchhill Marchhill merged commit 86b869c into NethermindEth:bal-devnet-1 Jan 5, 2026
57 of 64 checks passed
@fselmo fselmo deleted the bal-devnet-1 branch January 9, 2026 20:41
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