Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core/state: fix read-meters + simplify code #24304

Merged
merged 1 commit into from
Feb 14, 2022
Merged

Conversation

holiman
Copy link
Contributor

@holiman holiman commented Jan 28, 2022

I noticed that our meters are still not quite 100%.
Screenshot 2022-01-28 at 15-33-32 Dual Geth - Grafana

I think the fault lies on the s.SnapshotAccountReads handling. The SnapshotStorageReads/StorageReads were seemingly correct, because they did this litlte dance with pointers, to ensure that the final defer-method would update the correct counter, which the SnapshotAccountReads/AccountReads was missing.

When looking into it a bit, I found that it could be simplified. This slightly changes the semantics of the timer -- the timer measurement in this PR covers only the pure lookup from snapshot/trie, not the time for rlp decoding and other paths -- the time for that will wind up on the execution timer. I don't think either approach is more correct than the other, but it does simplify the code to do it like this. The alternative would be to add the same complex pointer-dance to the AccountReads handling.

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.

@holiman holiman added this to the 1.10.16 milestone Feb 14, 2022
@holiman holiman merged commit 51e7968 into ethereum:master Feb 14, 2022
sidhujag pushed a commit to syscoin/go-ethereum that referenced this pull request Feb 14, 2022
JacekGlen pushed a commit to JacekGlen/go-ethereum that referenced this pull request May 26, 2022
maoueh pushed a commit to streamingfast/go-ethereum that referenced this pull request Sep 30, 2022
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.

3 participants