Skip to content

core/state: add GetStateAndCommittedState#31585

Merged
rjl493456442 merged 4 commits intoethereum:masterfrom
MariusVanDerWijden:getcommittedstate
Jul 3, 2025
Merged

core/state: add GetStateAndCommittedState#31585
rjl493456442 merged 4 commits intoethereum:masterfrom
MariusVanDerWijden:getcommittedstate

Conversation

@MariusVanDerWijden
Copy link
Copy Markdown
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
Copy Markdown
Member Author

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

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

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

@rjl493456442
Copy link
Copy Markdown
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 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>
gballet pushed a commit to gballet/go-ethereum that referenced this pull request Sep 11, 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>
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Apr 17, 2026
expose a combined state getter and use it in sstore gas accounting.

keep tracer test doubles compatible with the vm interface change.
AnilChinchawale pushed a commit to XinFinOrg/XDPoSChain that referenced this pull request May 7, 2026
…2316)

expose a combined state getter and use it in sstore gas accounting.

keep tracer test doubles compatible with the vm interface change.
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.

2 participants