Repository navigation
Conversation
Executor.ReadLatestAccount lays the in-flight block's pending changes over a store view, so EvmNonce and EvmBalance no longer wait for the block's commit to land. A commit generation restarts a read that a commit overtook. The mempool fetches a first-seen account outside the store lock and installs it only if the accounts epoch is unchanged. Backport of #4271 (giga-1 #4258). Adapted to main: the closed executor's synchronous commit and the mempool's refresh also advance their counters, the account read uses baseAccountReader, and the app's package constants move to the top of the file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@seidroid review |
PR SummaryMedium Risk Overview The EVM-only app routes Pending overlay plumbing is refactored: indexed state lives in Mempool inserts prefetch first-seen sender balance/nonce outside the store mutex; an Reviewed by Cursor Bugbot for commit 300a701. Bugbot is set up for automated code reviews on this repo. Configure here. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4458 +/- ##
=======================================
Coverage 56.81% 56.81%
=======================================
Files 2127 2127
Lines 167022 167089 +67
=======================================
+ Hits 94888 94936 +48
- Misses 72129 72148 +19
Partials 5 5
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
@seidroid review |
|
The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).
|
There was a problem hiding this comment.
This change serves EvmNonce and EvmBalance on the EVM-only app through the executor's pending overlay, using a commit-generation retry instead of waiting for the in-flight commit, and moves the mempool's first-seen account fetch outside the store lock behind an accounts epoch. Against the store's point-in-time view contract, the generation check, the synchronous-commit bump, the failed-commit fallback and the epoch bumps on every accounts reset all hold, so nothing blocks; codex's one finding was dropped as pre-existing, because insert's account() already adds the sender before the old-nonce, duplicate-hash and same-nonce rejections and accounts are rebuilt on every Update, while the one newly reachable path (a byHash duplicate) already has its sender tracked, so prefetch does nothing there. Go was unavailable in the sandbox, so the tests were not run.
seidroid review · decision approve · session 7c3bfb9c2afd4b079a0e9d3ff0779f27 · turn resp_claude_00363251295d048fe117e02f75c43f39 · item 9419d2491ecf5af78c6af8b839bdb57e
Findings: 0 blocking | 0 non-blocking | 0 posted inline
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 300a701. Configure here.
| func (e *Executor) readLatestAccount(snapshot gigatypes.EVMStateView, pending *pendingChanges, generation uint64, addr common.Address) (LatestAccount, bool) { | ||
| e.pipelineMu.Lock() | ||
| moved := e.pipelineGeneration != generation | ||
| e.pipelineMu.Unlock() |
There was a problem hiding this comment.
Failed commit can still succeed a read
Medium Severity
ReadLatestAccount checks pipelineFailureLocked only before OpenView, and readLatestAccount rechecks generation but not failure. A commit that fails during that window leaves generation unchanged, so the read can still overlay the failed block and return success. latestAccount then keeps that never-committed nonce and balance instead of falling back to the settled store.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 300a701. Configure here.


This is a backport to main of #4271 (original giga-1 PR #4258) from the giga-1 PR stack #4270–#4273. That stack targeted stacked giga-1 branches and never reached main, except #4270, which landed as #4366. @codchen approved #4271 at 313568b. Since that commit, the port uses main's
baseAccountReaderand movesapp.go's package constants to the top. It also makes the closed executor's synchronous commit advance the commit generation, and makes the mempool'srefresh()advance the accounts epoch; a straight port would have shipped both bugs, and each fix has a test that fails without it. Tracked in PLT-1378.EvmNonceandEvmBalanceon the EVM-only app no longer wait for the in-flight block commit.Executor.ReadLatestAccountlays the pending block's changes over a store view and starts over when a commit starts under it. After a failed commit, reads fall back to the settled store. The mempool fetches a first-seen account outside its lock and installs it only if the accounts epoch is unchanged. The autobahn producer's nonce reads use the same path, including the onepruneMempoolmakes under the producer lock.This is not app-hash-breaking. Execution reads the same overlay, and a read returns the value the settled store returns once the commit lands;
TestEVMOnlyApplicationLatestAccountMatchesTheSettledStorechecks this across blocks. In a local run with 2,000-transfer blocks, a nonce read issued right after FinalizeBlock dropped from p50 0.6 ms (max 11 ms) to under 10 µs (max 27 µs). FinalizeBlock time did not change, and main-loop execution cost does not drop. Review theReadLatestAccountretry loop, which is bounded in practice by the block rate, and note that a steady-state read now loads the full account row (about +10–25 µs). It merges cleanly with #4452 and the #4272 backport in any order.