Skip to content

Conversation

rakita
Copy link
Member

@rakita rakita commented Aug 20, 2025

If we dont have enough gas for cold load, we would still load the account/storage from database and leave it inside the journal. It made it simpler.

This load had a effect on prestate rpc call (noticed in paradigmxyz/reth#17765), and it would be a consensus error for BAL (When EIP gets included)

Affected opcodes and behaviours:

  • CALL/STATICCALL/DELEGATECALL/CALLCODE:
    • Static gas + warm load + Transfer of value gas.
    • Do check for cold load. LOAD ACCOUNT here
    • Deduct new account cost or
    • If it is delegated, deduct warm gas
      • Do check for cold load of delegated code. LOAD ACCOUNT here
  • BALANCE/EXTCODESIZE/EXTCODEHASH: static gas first and then special check for cold
  • EXTCODECOPY:
    • Cover edgecase with len == 0.
    • Memory resize oog and warm gas, should be done before cold loading. LOAD ACCOUNT here
  • SLOAD: static gas first and then check for cold load.
  • SSTORE:
    • EIP-1706 Disable SSTORE with gasleft lower than call stipend
    • static gas first and then check for cold load. LOAD ACCOUNT here
    • then gas for preset/original value, and if value set or not set.
    • refund
  • SELFDESTRUCT:
    • static gas first + warm load.
    • check for cold load. LOAD ACCOUNT here.
    • Deduct new account cost and refund

Copy link

codspeed-hq bot commented Aug 25, 2025

CodSpeed Performance Report

Merging #2903 will improve performances by 4.7%

Comparing rakita/skip-load-on-oog (024bb29) with main (5992cc0)

Summary

⚡ 2 improvements
✅ 171 untouched benchmarks

Benchmarks breakdown

Benchmark BASE HEAD Change
transact_commit_1000txs 2.8 ms 2.7 ms +4.7%
transfer_finalize 16.6 µs 15.9 µs +4.17%

@rakita rakita changed the title Wip feat: skip cold load on oog fix: skip cold load on oog Aug 26, 2025
@rakita rakita marked this pull request as ready for review August 26, 2025 16:24
@rakita rakita merged commit 8e22194 into main Aug 27, 2025
33 checks passed
@rakita rakita deleted the rakita/skip-load-on-oog branch August 27, 2025 13:55
This was referenced Aug 27, 2025
@github-actions github-actions bot mentioned this pull request Sep 8, 2025
This was referenced Sep 9, 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.

1 participant