Skip to content

evmonly/evmonlyapp: revert the execution optimizations (#4254, #4258, #4260, #4261) ahead of a reviewable stack - #4269

Merged
bdchatham merged 4 commits into
giga-1from
devin/1789943071-revert-exec-opts
Sep 20, 2026
Merged

bdchatham merged 4 commits into
giga-1from
devin/1789943071-revert-exec-opts

Conversation

@bdchatham

@bdchatham bdchatham commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

giga-1 went from ~72k to ~96k tx/s through four execution changes (#4254, #4258, #4260, #4261) that were merged quickly during the testnet-2 tuning. To get them genuinely reviewed, this PR takes all four back out, and stack #4274 re-opens each one on top of it in dependency order so that the top of the stack is byte-identical to today's giga-1.

The branch is four git revert -m 1 commits and nothing else, newest first: #4261 (parallel OCC validation and merge; occ_shards.go goes, occ.go is the serial walk again), #4260 (PrepareBlock(n+1) while n executes; the router is back to fetch → execute, PrepareBlock leaves evmOnlyApplication and the proxy, and the router test's CheckBlocks helper goes with it), #4258 (Executor.ReadLatestAccount and the pending overlay; the mempool's first-seen lookup is back under the store lock), and #4254 (FinalizeBlock calls executor.ExecuteBlock synchronously again, so settler/AwaitCommits go). Conflicts were resolved so that only those four change: #4259's evmonly_finalize timer stays as take_sendersexecutetx_results (the prepare phase returns with #4254), and #4263's storage-tail phases and #4265's enable_receipt_store with its test are untouched. One thing is not preservable: #4267's evmonly_prepare timer wraps evmOnlyApplication.PrepareBlock, so evmonly_prepare_phase_duration_seconds_total goes dark until stack 3/4 re-lands #4260.

No config keys or wire formats change. The image at this commit should perform like the pre-#4254 build (~72k tx/s) and is not meant to be rolled out on its own. Validated with make lint/fmtcheck, scripts/ramtest.sh -race ./giga/evmonly/..., and go test -race on sei-tendermint/internal/{evmonlyapp,mempool,p2p,proxy} and sei-tendermint/node.

Link to Devin session: https://app.devin.ai/sessions/ff612badcded4aa5914ea408dbb41888
Open in Devin Desktop: https://app.devin.ai/desktop/session/ff612badcded4aa5914ea408dbb41888?variant=devin
Requested by: @bdchatham

@devin-ai-integration

Copy link
Copy Markdown
Contributor

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@cursor

cursor Bot commented Sep 20, 2026

Copy link
Copy Markdown

PR Summary

High Risk
Changes core block execution, optimistic concurrency validation, async state commits, and RPC/mempool account reads—areas where subtle ordering bugs would affect correctness and chain halt behavior.

Overview
Reverts four performance-oriented changes (commits #4254, #4258, #4260, #4261) so they can land again as a reviewable stack. Expected throughput drops from the ~96k tx/s path back toward the pre-optimization ~72k tx/s baseline; this branch is not meant for production rollout.

Block-STM / OCC (giga/evmonly): Removes sharded parallel validation, parallel prefix acceptance, and parallel changeset merge (occ_shards.go deleted). Validation again walks transactions in order on one goroutine, with a simpler write index (conflictsWithAfter vs span-based conflictsWithin). Accepted prefix state is a single blockSTMState instead of address shards. Merge still uses optional account-row prefetch via the worker pool for large blocks before serial ChangeSetInto.

Commit pipeline: Pending block state is a cloned StateChangeSet plus newPendingOverlay again—no ReadLatestAccount, pipelineGeneration, or executor API to read balances/nonces ahead of landed commits. Merge no longer falls back to sequential execution when the OCC worker pool is closed during parallel merge (that path is gone).

EVM-only app & node: FinalizeBlock calls executor.ExecuteBlock directly—no PrepareBlock, prepared-block cache, executeBlockPipelined, or settler/AwaitCommits. EvmNonce, EvmBalance, and EvmCall read the committed store view (with the usual pending-block cursor rules for calls), not in-flight commit overlays. Shutdown no longer waits for background commits before closing Giga storage.

Mempool: Drops lock-free prefetch of first-seen EVM accounts on insert (and related epoch invalidation on Update).

Giga router / proxy: Block loop is fetch → FinalizeBlock → execute again; PrepareBlock and Proxy.AwaitCommits are removed.

Tests and docs are trimmed to match the serial behavior; load-test bench drops the ERC20 scenario in favor of transfer-only workloads.

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

@github-actions

github-actions Bot commented Sep 20, 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 20, 2026, 10:51 PM

@codecov

codecov Bot commented Sep 20, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.94009% with 24 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.01%. Comparing base (7e3ca24) to head (8789d48).
⚠️ Report is 49 commits behind head on giga-1.

Files with missing lines Patch % Lines
sei-tendermint/internal/p2p/giga_router_common.go 72.72% 8 Missing and 1 partial ⚠️
sei-tendermint/internal/evmonlyapp/app.go 86.44% 8 Missing ⚠️
giga/evmonly/occ.go 94.16% 7 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           giga-1    #4269       +/-   ##
===========================================
+ Coverage   65.55%   83.01%   +17.45%     
===========================================
  Files        2081       65     -2016     
  Lines      157460     8725   -148735     
===========================================
- Hits       103222     7243    -95979     
+ Misses      54097     1480    -52617     
+ Partials      141        2      -139     
Flag Coverage Δ
sei-chain ?
sei-chain-pr 83.01% <88.94%> (?)
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.25% <ø> (+0.04%) ⬆️
giga/evmonly/giga_store.go 91.48% <100.00%> (-1.62%) ⬇️
giga/evmonly/pipeline_overlay.go 96.29% <100.00%> (ø)
sei-tendermint/internal/mempool/tx.go 95.03% <ø> (ø)
sei-tendermint/internal/proxy/proxy.go 88.88% <ø> (-2.23%) ⬇️
sei-tendermint/node/node.go 73.44% <ø> (-1.29%) ⬇️
giga/evmonly/occ.go 90.73% <94.16%> (+1.54%) ⬆️
sei-tendermint/internal/evmonlyapp/app.go 83.98% <86.44%> (+2.21%) ⬆️
sei-tendermint/internal/p2p/giga_router_common.go 78.44% <72.72%> (+0.24%) ⬆️

... and 2029 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.

@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 faithful, self-consistent revert of #4254/#4258/#4260/#4261: no dangling references to the removed shard/pipeline/prepare machinery remain, and the synchronous Executor.ExecuteBlock (which still calls AwaitCommits) is what makes the app-level settle removals safe. Two non-blocking notes: the PR description overstates what is retained, and one standalone router test assertion was dropped that did not need to be.

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

Blockers

  • None at the file/PR level.

Non-blocking

  • [suggestion] The description says "#4267's evmonly_prepare timer [is] unchanged in the serial loop", but it is removed outright: #4267 only re-added that timer around evmOnlyApplication.PrepareBlock, which this PR deletes with #4260. There is no synchronous preparation step left in the app to wrap (executor-internal preparation is inside ExecuteBlock), so nothing is preservable here — but the claim should be corrected, and operators should know evmonly_prepare_phase_duration_seconds_total goes dark until #4260 is re-landed.
  • 1 suggestion(s)/nit(s) flagged inline on specific lines.
  • 1 non-blocking pre-existing issue(s) listed below under pre-existing issues.

Pre-existing issues

  • [suggestion] evmOnlyApplication.EvmCall (sei-tendermint/internal/evmonlyapp/app.go) releases the cursor lock before executor.Call opens its store view, so a full FinalizeBlock+Commit can land between the block context being captured and the snapshot being opened, mixing height N's NUMBER/TIMESTAMP with N+1's state. The pending.IsPresent() guard closes the wide window (pending is staged before the state commit starts), but this narrow gap is present on the base branch too — the base's context recheck loop does not eliminate it either.

Comment thread sei-tendermint/internal/p2p/giga_router_validator_test.go
@bdchatham
bdchatham enabled auto-merge September 20, 2026 22:46
@devin-ai-integration
devin-ai-integration Bot force-pushed the devin/1789943071-revert-exec-opts branch from 8789d48 to c0c4c4e Compare September 20, 2026 22:50
@bdchatham
bdchatham added this pull request to the merge queue Sep 20, 2026
Merged via the queue into giga-1 with commit 6cc7ba8 Sep 20, 2026
124 of 142 checks passed
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.

1 participant