Skip to content

Withdrawn - #4392

Closed
suryuhh wants to merge 1 commit into
sei-protocol:devin/1789943071-stack-4-parallel-occfrom
suryuhh:executor/dependent-blocks-sequential
Closed

suryuhh wants to merge 1 commit into
sei-protocol:devin/1789943071-stack-4-parallel-occfrom
suryuhh:executor/dependent-blocks-sequential

Conversation

@suryuhh

@suryuhh suryuhh commented Sep 30, 2026 •

Copy link
Copy Markdown

No description provided.

executeBlockOCC speculates every transaction and then hands every result that read a lower write to the serial frontier in validateBlockSTM, which reruns them one at a time with a parallel validation pass between reruns. On a block where many transactions chain through shared state that is slower than executing the block in order.

The executor now speculates 256 of the block's transactions, in 16 runs of 16 consecutive transactions spaced evenly from its first transaction to its last (the whole block when it holds at most 256), so that a block whose dependent transactions sit in one part of it is measured as a whole. It measures from their read and write sets, in block order, how many read a key a lower one wrote and how long the longest such chain is, and runs the block on the sequential path when at least one in six does. Otherwise it speculates the transactions between the runs and continues on the frontier, keeping the results it already has. Fee credits to the coinbase are commutative deltas outside the write sets: they chain nothing between transactions that only pay fees, and a later read of the coinbase balance or account depends on every earlier non-zero credit, as it does in the frontier's validation. The decision uses only the executed state accesses, not calldata, so many calls to one function that each write the caller's own slot stay parallel. Blocks routed this way are counted as fallbacks with reason dependent.
@cursor

cursor Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

PR Summary

Medium Risk
Changes which execution path large blocks take based on a sampled heuristic; wrong routing affects performance, not correctness if sequential parity holds, but untested workloads could stay on a suboptimal path.

Overview
Adds an automatic OCC path (default) that speculates a cheap sample of up to 256 transactions (16×16 evenly spaced runs) before committing to parallel frontier validation. measureDependencies counts how many sampled txs read keys written by earlier txs (aligned with STM conflict rules, including coinbase fee credits). If at least one-sixth of the sample is “dependent,” the block falls back to sequential execution with OCCStats.FallbackReason dependent instead of paying for many one-at-a-time frontier reruns; otherwise the rest of the block is speculated while reusing the sample results, then validated as today.

Refactors speculation into speculate / speculationFailed, introduces test-only occPath (auto, frontier, sequential), wires the new reason into metrics (giga_occ_fallbacks_total{reason="dependent"}), updates README, and adds route tests/benchmarks plus differential checks that auto/frontier/sequential still match sequential output.

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

@github-actions

Copy link
Copy Markdown

We truly appreciate your contribution and the time you’ve invested in this PR.
Before we can merge it, we’d love your help addressing the remaining feedback or sharing your perspective.
If we don’t hear back within 2 day(s), this PR will close automatically — but don’t worry, you can reopen it anytime when you’re ready to continue.

@suryuhh
suryuhh force-pushed the executor/dependent-blocks-sequential branch from 79a4bd7 to 211e2fc Compare October 28, 2026 14:18
@suryuhh suryuhh changed the title evmonly: run blocks whose speculation shows chained reads sequentially evmonly: avoid wasted speculation on dependent blocks Oct 28, 2026
@suryuhh
suryuhh changed the base branch from devin/1789943071-stack-4-parallel-occ to main October 28, 2026 14:19
@suryuhh suryuhh changed the title evmonly: avoid wasted speculation on dependent blocks evmonly: run blocks whose speculation shows chained reads sequentially Oct 29, 2026
@suryuhh
suryuhh force-pushed the executor/dependent-blocks-sequential branch from 211e2fc to 79a4bd7 Compare October 29, 2026 02:22
@suryuhh
suryuhh requested a review from pompon0 as a code owner October 29, 2026 02:22
@suryuhh
suryuhh changed the base branch from main to devin/1789943071-stack-4-parallel-occ October 29, 2026 02:22
@suryuhh suryuhh changed the title evmonly: run blocks whose speculation shows chained reads sequentially Withdrawn Oct 29, 2026
@suryuhh suryuhh closed this Oct 29, 2026
@suryuhh
suryuhh deleted the executor/dependent-blocks-sequential branch October 29, 2026 02:24
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