Skip to content

Conversation

MariusVanDerWijden
Copy link
Member

@MariusVanDerWijden MariusVanDerWijden commented Apr 7, 2025

Improves the SSTORE gas calculation a bit. Previously we would pull up the state object twice. This is okay for existing objects, since they are cached, however non-existing objects are not cached, thus we needed to go through all 128 diff layers as well as the disk layer twice, just for the gas calculation

goos: linux
goarch: amd64
pkg: github.com/ethereum/go-ethereum/core/vm
cpu: AMD Ryzen 9 5900X 12-Core Processor            
               │ /tmp/old.txt │            /tmp/new.txt             │
               │    sec/op    │   sec/op     vs base                │
Interpreter-24   1118.0n ± 2%   602.8n ± 1%  -46.09% (p=0.000 n=10)

@MariusVanDerWijden MariusVanDerWijden marked this pull request as ready for review June 23, 2025 10:04
@MariusVanDerWijden
Copy link
Member Author

I don't like the naming, open for suggestions there

rjl493456442
rjl493456442 previously approved these changes Jul 2, 2025
Copy link
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

But I would try to run a full-sync to ensure nothing is broken.

@rjl493456442
Copy link
Member

Deployed on bench06

@rjl493456442 rjl493456442 added this to the 1.16.2 milestone Jul 3, 2025
@rjl493456442 rjl493456442 merged commit 34f00a4 into ethereum:master Jul 3, 2025
3 of 4 checks passed
@Copilot Copilot AI mentioned this pull request Jul 6, 2025
7 tasks
howjmay pushed a commit to iotaledger/go-ethereum that referenced this pull request Aug 27, 2025
Improves the SSTORE gas calculation a bit. Previously we would pull up
the state object twice. This is okay for existing objects, since they
are cached, however non-existing objects are not cached, thus we needed
to go through all 128 diff layers as well as the disk layer twice, just
for the gas calculation

```
goos: linux
goarch: amd64
pkg: github.com/ethereum/go-ethereum/core/vm
cpu: AMD Ryzen 9 5900X 12-Core Processor            
               │ /tmp/old.txt │            /tmp/new.txt             │
               │    sec/op    │   sec/op     vs base                │
Interpreter-24   1118.0n ± 2%   602.8n ± 1%  -46.09% (p=0.000 n=10)
```

---------

Co-authored-by: Gary Rong <garyrong0905@gmail.com>
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants