Skip to content

Revert persisting the EVM-only execution cursor with FlatKV state - #4212

Open
masih wants to merge 3 commits into
giga-1from
masih/1789584107-revert-evmonly-cursor
Open

masih wants to merge 3 commits into
giga-1from
masih/1789584107-revert-evmonly-cursor

Conversation

@masih

@masih masih commented Sep 16, 2026

Copy link
Copy Markdown
Collaborator

This reverts #4190, which persisted the EVM-only execution cursor (height, app hash, parent hash, gas limit) as an evmonly/cursor changeset alongside each block's FlatKV state and taught NewEVMOnlyApplication to reload it so Info() reported the durable height after a restart. The app returns to keeping its position in the in-memory evmOnlyState, advanced by Commit, and the BlockChangeSetEncoder hook on the executor is removed. Consequently a restarted EVM-only node again reports height 0 from Info(), so #4169 is reopened by this change.

Three commits landed on top of #4190 in evmonlyapp (#4183, #4194, #4205) and conflicted with the automatic revert. Their behaviour is preserved: checkedSenders, EvmChainConfig, EvmBaseFee and EvmCall are re-applied onto the pre-#4190 struct, with EvmCall reading committedHeight, gasLimit, parentHash and the new lastBlockTime field instead of the removed cursor. The chained SHA-256 app hash is unchanged, and the existing evmonlyapp, proxy, giga/evmonly, node and p2p tests pass.

@devin-ai-integration

Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@github-actions

github-actions Bot commented Sep 16, 2026

Copy link
Copy Markdown

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

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedSep 16, 2026, 8:10 PM

@codecov

codecov Bot commented Sep 16, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 89.09091% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 65.52%. Comparing base (7e3ca24) to head (bcb74c7).
⚠️ Report is 18 commits behind head on giga-1.

Files with missing lines Patch % Lines
sei-tendermint/internal/evmonlyapp/app.go 88.88% 6 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           giga-1    #4212      +/-   ##
==========================================
- Coverage   65.55%   65.52%   -0.03%     
==========================================
  Files        2081     2077       -4     
  Lines      157460   157042     -418     
==========================================
- Hits       103222   102909     -313     
+ Misses      54097    53992     -105     
  Partials      141      141              
Flag Coverage Δ
sei-chain-pr 83.53% <89.09%> (?)
sei-db ?

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

Files with missing lines Coverage Δ
giga/evmonly/executor.go 91.28% <ø> (+0.07%) ⬆️
giga/evmonly/giga_store.go 93.33% <ø> (+0.22%) ⬆️
sei-tendermint/internal/p2p/giga_router_common.go 78.35% <ø> (+0.15%) ⬆️
sei-tendermint/node/public.go 82.47% <100.00%> (ø)
sei-tendermint/internal/evmonlyapp/app.go 82.97% <88.88%> (+1.20%) ⬆️

... and 7 files with indirect coverage changes

🚀 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.

@masih
masih marked this pull request as ready for review September 16, 2026 20:08
@cursor

cursor Bot commented Sep 16, 2026

Copy link
Copy Markdown

PR Summary

High Risk
Restart and crash recovery for EVM-only Autobahn nodes no longer align ABCI height/app hash with durable Giga state, which can re-run InitChain or mis-handshake until #4169-style persistence is restored.

Overview
Reverts durable EVM-only chain position in FlatKV: the BlockChangeSetEncoder hook and WithBlockChangeSetEncoder are removed from giga/evmonly, so commits only carry the FlatKV state encoder’s changesets.

evmonlyapp drops cursor.go and storage load on startup. NewEVMOnlyApplication always returns an app with empty in-memory evmOnlyState (height, app hash, parent hash, pending block) advanced by Commit after FinalizeBlock stages evmOnlyPending. Info() and EvmCall read that memory, not disk—so a restarted process reports height 0 until InitChain runs again, even when Giga state on disk is ahead. Init-chain seeding is simplified (no “already seeded at initialHeight−1” resume path). Restart/resume tests are deleted; node no longer handles a restore error from app construction.

Docs and giga router comments no longer say apps must derive Info() from storage or refuse InitChain when blocks already exist.

Reviewed by Cursor Bugbot for commit bcb74c7. Bugbot is set up for automated code reviews on this repo. Configure here.

@seidroid seidroid Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

A clean, complete revert of #4190: no dangling references to the removed cursor remain, and the three commits that landed on top (checkedSenders, EvmChainConfig, EvmBaseFee, EvmCall) are faithfully re-applied onto the pre-#4190 struct. The only finding is the restart regression the description itself acknowledges (#4169 reopened), which is deliberate but leaves no test recording the restored behaviour.

Findings: 0 blocking | 2 non-blocking | 1 posted inline

Blockers

  • None at the file/PR level.

Non-blocking

  • [suggestion] The three restart tests and cursor_test.go are removed along with the feature, which is correct, but nothing now pins the restored behaviour. reopenEVMOnlyTestApp survives and is only used for its storage side effect (_, storage = reopenEVMOnlyTestApp(...) at app_test.go:135, so its *evmOnlyApplication return and the require.True(t, ok) assertion are dead). Reusing it for a short characterization test — reopen after committing a block, assert Info().LastBlockHeight == 0 — would record the reopened #4169 behaviour in the tree, so re-landing cursor persistence flips a visible assertion rather than adding one from scratch.
  • 1 suggestion(s)/nit(s) flagged inline on specific lines.

storage *bootstrap.GigaStorageManager,
changeSetEncoder evmonly.NamedChangeSetEncoder,
) (abci.Application, error) {
) abci.Application {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[suggestion] Dropping the constructor's error return also drops the only path that reloaded a durable position, so a restarted node starts at committedHeight == 0 with a state store that still holds every prior block. The consequence is worse than Info() reporting 0: gigaRouterCommon.runExecute branches on last == 0 and calls InitChain, seedInitialStateVersion returns early for InitialHeight == 1 without inspecting the store, and block 1 is then re-executed against state whose nonces and balances have already advanced — the executor refuses it (or CommitStateChanges(1, ...) fails against a store at a higher version), and runExecute returns, so the node does not come up at all.

This is the #4169 regression the description acknowledges reopening, and the scope is the Autobahn load-test application rather than production (TODO(evmonly-production) still gates real traffic), so I read it as an accepted cost of the revert rather than something to fix here. Worth confirming that no load-test environment currently relies on restarting a node over existing EVM-only storage, since those will now fail to start rather than degrade.

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