Skip to content

consensus/bor, eth, miner, internal/cli: add sequence store publisher - #2355

Open
cffls wants to merge 1 commit into
sequencingfrom
cffls/sequence-publisher
Open

consensus/bor, eth, miner, internal/cli: add sequence store publisher#2355
cffls wants to merge 1 commit into
sequencingfrom
cffls/sequence-publisher

Conversation

@cffls

@cffls cffls commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Block producers publish each block's lifecycle (open context, per-tx records, sealed header) to the sequence store as it happens; RPC nodes follow the stream, re-execute it deterministically, and hold preconfirmation receipts for the block being built. Design doc: docs/sequencer-bor.md.

Producer (eth/sequencer.Publisher, miner hooks): read-before-write follow model — a foreign unsealed window on our tip is followed, not superseded; the only supersede is the seal flush that makes the store match sealed truth. Pre-seal barrier awaits sequencing; the post-seal gate turns store acks into broadcast verdicts (foreign seal refuses, budget expiry broadcasts for liveness after a recheck). Recovery is the reconcile position ladder (anchor, block-anchor probe, floor read) with delta-only re-anchors; producer rotation adopts the dangling window instead of revoking it. Transport hardening: bounded in-flight sends with ack refill, ack-stall watchdog, and a self-heal redial after prolonged channel silence. Consensus-side: a signer outside the active producer set no longer builds at all, so its sequence can never reach the store.

Consumer (eth/sequencer.Consumer): follows the gateway stream with warm/cold resume, verifies the commitment chain per entry, re-executes on canonical or parked speculative state (author-nil EVM context, speculative BLOCKHASH, EIP-2935), cross-checks seals (context, gas, receipts root, state root), voids-and-skips on divergence, and fills a capped receipt index evicted on canonical import. The RPC read path that serves these receipts ships separately.

Everything is gated behind the [sequencer] config section; the role derives from the sealer flag (mining node publishes, non-mining node consumes). With the section unset there is no behavior change.

Validated on kurtosis devnets: a 12-phase chaos campaign (store component restarts, pauses, 200s outages, flapping, partitions, producer and heimdall kills) ended with zero store gaps, zero revoked or reordered preconfirmations, and zero absent heights across 859k entries; preconfirmation receipts measured at p50 ~100ms against ~2.5-2.9s canonical inclusion at 4s blocks, byte-consistent with canonical receipts after import.

… and consumer

Block producers publish each block's lifecycle (open context, per-tx
records, sealed header) to the sequence store as it happens; RPC nodes
follow the stream, re-execute it deterministically, and hold
preconfirmation receipts for the block being built. Design doc:
docs/sequencer-bor.md.

Producer (eth/sequencer.Publisher, miner hooks): read-before-write
follow model — a foreign unsealed window on our tip is followed, not
superseded; the only supersede is the seal flush that makes the store
match sealed truth. Pre-seal barrier awaits sequencing; the post-seal
gate turns store acks into broadcast verdicts (foreign seal refuses,
budget expiry broadcasts for liveness after a recheck). Recovery is the
reconcile position ladder (anchor, block-anchor probe, floor read) with
delta-only re-anchors; producer rotation adopts the dangling window
instead of revoking it. Transport hardening: bounded in-flight sends
with ack refill, ack-stall watchdog, and a self-heal redial after
prolonged channel silence. Consensus-side: a signer outside the active
producer set no longer builds at all, so its sequence can never reach
the store.

Consumer (eth/sequencer.Consumer): follows the gateway stream with
warm/cold resume, verifies the commitment chain per entry, re-executes
on canonical or parked speculative state (author-nil EVM context,
speculative BLOCKHASH, EIP-2935), cross-checks seals (context, gas,
receipts root, state root), voids-and-skips on divergence, and fills a
capped receipt index evicted on canonical import. The RPC read path
that serves these receipts ships separately.

Everything is gated behind the [sequencer] config section; the role
derives from the sealer flag (mining node publishes, non-mining node
consumes). With the section unset there is no behavior change.

Validated on kurtosis devnets: a 12-phase chaos campaign (store
component restarts, pauses, 200s outages, flapping, partitions,
producer and heimdall kills) ended with zero store gaps, zero revoked
or reordered preconfirmations, and zero absent heights across 859k
entries; preconfirmation receipts measured at p50 ~100ms against
~2.5-2.9s canonical inclusion at 4s blocks, byte-consistent with
canonical receipts after import.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@claude claude 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.

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.

Tip: disable this comment in your organization's Code Review settings.

@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedgolang/​github.com/​0xPolygon/​sequence-store-proto@​v0.0.0-20260719224427-276104d12aff10010010010070

View full report

@codecov

codecov Bot commented Aug 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 78.52349% with 736 lines in your changes missing coverage. Please review.
✅ Project coverage is 54.74%. Comparing base (bea1a20) to head (ed9a4a6).

Files with missing lines Patch % Lines
eth/sequencer/consumer.go 13.28% 219 Missing and 3 partials ⚠️
eth/sequencer/adoption.go 80.42% 71 Missing and 22 partials ⚠️
eth/sequencer/exec.go 0.00% 88 Missing ⚠️
eth/sequencer/classify.go 85.71% 51 Missing and 19 partials ⚠️
miner/worker.go 82.35% 33 Missing and 6 partials ⚠️
eth/backend.go 46.47% 35 Missing and 3 partials ⚠️
eth/sequencer/reader.go 86.57% 30 Missing and 8 partials ⚠️
eth/sequencer/publish.go 83.09% 26 Missing and 9 partials ⚠️
eth/sequencer/gate.go 86.74% 18 Missing and 6 partials ⚠️
eth/sequencer/stream.go 93.76% 15 Missing and 7 partials ⚠️
... and 10 more

❌ Your patch check has failed because the patch coverage (78.52%) is below the target coverage (90.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff               @@
##           sequencing    #2355      +/-   ##
==============================================
+ Coverage       54.23%   54.74%   +0.51%     
==============================================
  Files             908      922      +14     
  Lines          162243   165629    +3386     
==============================================
+ Hits            87987    90673    +2686     
- Misses          68825    69428     +603     
- Partials         5431     5528      +97     
Files with missing lines Coverage Δ
eth/ethconfig/config.go 78.94% <ø> (ø)
internal/cli/server/config.go 65.01% <100.00%> (+1.12%) ⬆️
internal/cli/server/flags.go 100.00% <100.00%> (ø)
consensus/bor/bor.go 86.05% <83.33%> (+0.24%) ⬆️
internal/cli/dumpconfig.go 0.00% <0.00%> (ø)
miner/fake_miner.go 89.50% <0.00%> (-1.12%) ⬇️
miner/miner.go 71.20% <0.00%> (-1.16%) ⬇️
eth/sequencer/reconcile.go 95.94% <95.94%> (ø)
eth/sequencer/receipts.go 94.38% <94.38%> (ø)
eth/sequencer/journal.go 94.92% <94.92%> (ø)
... and 13 more

... and 20 files with indirect coverage changes

Files with missing lines Coverage Δ
eth/ethconfig/config.go 78.94% <ø> (ø)
internal/cli/server/config.go 65.01% <100.00%> (+1.12%) ⬆️
internal/cli/server/flags.go 100.00% <100.00%> (ø)
consensus/bor/bor.go 86.05% <83.33%> (+0.24%) ⬆️
internal/cli/dumpconfig.go 0.00% <0.00%> (ø)
miner/fake_miner.go 89.50% <0.00%> (-1.12%) ⬇️
miner/miner.go 71.20% <0.00%> (-1.16%) ⬇️
eth/sequencer/reconcile.go 95.94% <95.94%> (ø)
eth/sequencer/receipts.go 94.38% <94.38%> (ø)
eth/sequencer/journal.go 94.92% <94.92%> (ø)
... and 13 more

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

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