Skip to content

[giga] remove Snapshot() call in Prepare()#2957

Merged
codchen merged 3 commits intomainfrom
tony/prepare-no-snapshot
Mar 6, 2026
Merged

[giga] remove Snapshot() call in Prepare()#2957
codchen merged 3 commits intomainfrom
tony/prepare-no-snapshot

Conversation

@codchen
Copy link
Collaborator

@codchen codchen commented Feb 23, 2026

Describe your changes and provide context

The Snapshot() call would return a rev number for potential Revert(rev) calls to revert to. However the Snapshot call in Prepare has its rev value discarded, so it isn't useful from a reverting perspective. The other side effects, like creating another nested layer of CacheKV, is also meaningless under the context of EVM (there will just be a layer of CacheKV with zero dirty values). So it can be removed in theory.

Removing it resulted in a 1k increase in theoretical tps (from 20k to 21k)

Testing performed to validate your change

existing tests should still stand

@github-actions
Copy link

github-actions bot commented Feb 23, 2026

The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedMar 6, 2026, 3:30 AM

coinbaseEvmAddress: feeCollector,
}
s.Snapshot() // take an initial snapshot for GetCommitted
if k.ShouldUseRegularStore() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

eventually for performance/clarity it might be good to have a way to only check these kind of flags initially when setting handlers (like set a s.Snapshot handler at init/creation). This is fine - just thinking out loud.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stevenlanders i think that change was due to my stale local main. Rebased and this PR is just a one-liner

@codchen codchen force-pushed the tony/prepare-no-snapshot branch 2 times, most recently from 67efdc2 to dfe9ee6 Compare February 23, 2026 14:43
@codecov
Copy link

codecov bot commented Feb 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 58.25%. Comparing base (9fcac13) to head (656463c).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2957      +/-   ##
==========================================
- Coverage   58.25%   58.25%   -0.01%     
==========================================
  Files        2077     2077              
  Lines      171295   171294       -1     
==========================================
- Hits        99787    99786       -1     
  Misses      62609    62609              
  Partials     8899     8899              
Flag Coverage Δ
sei-chain-pr 69.54% <ø> (?)
sei-db 70.41% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
giga/deps/xevm/state/accesslist.go 96.00% <ø> (-0.08%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@codchen codchen force-pushed the tony/prepare-no-snapshot branch from dfe9ee6 to 656463c Compare March 6, 2026 03:29
@codchen codchen merged commit 105d090 into main Mar 6, 2026
40 checks passed
@codchen codchen deleted the tony/prepare-no-snapshot branch March 6, 2026 07:36
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