[consensus] gate slim block emission on subscriber lag - #27740
Open
arun-koshy wants to merge 1 commit into
Open
Conversation
arun-koshy
deployed
to
sui-typescript-aws-kms-test-env
August 18, 2026 07:57 — with
GitHub Actions
Active
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
8 tasks
8 tasks
arun-koshy
force-pushed
the
ak/minimal-block-codec
branch
from
August 20, 2026 04:09
490b089 to
25bf122
Compare
arun-koshy
force-pushed
the
ak/minimal-block-lag-gate
branch
from
August 20, 2026 04:13
f761ac5 to
4bb8425
Compare
arun-koshy
deployed
to
sui-typescript-aws-kms-test-env
August 20, 2026 04:13 — with
GitHub Actions
Active
arun-koshy
force-pushed
the
ak/minimal-block-lag-gate
branch
from
August 21, 2026 19:12
4bb8425 to
7c49914
Compare
arun-koshy
deployed
to
sui-typescript-aws-kms-test-env
August 21, 2026 19:12 — with
GitHub Actions
Active
arun-koshy
marked this pull request as ready for review
August 21, 2026 19:24
arun-koshy
deployed
to
sui-typescript-aws-kms-test-env
August 21, 2026 19:24 — with
GitHub Actions
Active
Serves full blocks to a subscriber that has fallen too far behind to rebuild slim ones, and re-decides as its lag changes. Reconstruction is all-or-nothing across a block's ancestors: one unresolvable slot fails the whole block, so a receiver trailing the omission horizon fails most of them and both sides waste the work. Full blocks put such a subscriber back on the ordinary path -- verify, suspend, fetch missing ancestors -- which is how it catches up. Thresholds are fractions of gc_depth, the horizon within which a receiver can still resolve ancestors: slim is lost above three quarters of it and earned back at half. The gap keeps lag noise around a single boundary from driving the mode, and stopping short of the horizon leaves room before the receiver's own GC collects the slots a reconstruction waits on. Lag is measured only from the peer's own latest block in the local DAG. The round a subscriber reports when it connects is its own unverified claim, used solely as the replay resume point. Re-evaluation is bounded to once per second per subscriber so the fan-out path does not take the DagState read lock per block. A dwell bounds how fast a subscription may return to slim blocks; losing them is never delayed. With the flag off the handler returns the previous fan-out stream unchanged.
arun-koshy
force-pushed
the
ak/minimal-block-codec
branch
from
August 21, 2026 21:22
064530a to
0893cd7
Compare
arun-koshy
force-pushed
the
ak/minimal-block-lag-gate
branch
from
August 21, 2026 21:22
7c49914 to
137936b
Compare
arun-koshy
deployed
to
sui-typescript-aws-kms-test-env
August 21, 2026 21:22 — with
GitHub Actions
Active
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Serves full blocks to a subscriber that has fallen too far behind to rebuild minimal ones, and re-decides as its lag changes. Required before
consensus_slim_block_propagationcan be turned on.Reconstruction is all-or-nothing across a block's ~100 ancestors: one unresolvable slot fails the whole block, so a small per-ancestor miss rate compounds into near-total failure once a receiver trails the omission horizon. A lagging cohort measured 76% of blocks failing to rebuild against 16% at the frontier, and sending those blocks wastes both sides' work. Full blocks put such a subscriber back on the ordinary path — verify, suspend, fetch missing ancestors — which is how it catches up.
Thresholds are expressed against
gc_depthbecause that is the horizon reconstruction can resolve within. They are asymmetric: a subscription loses slim blocks at the horizon but earns them back only well inside it. Without that gap a subscriber sitting on a single threshold flapped at ~100 transitions/s in each direction, sustained, while the fleet stalled — each flip changes the wire form mid-stream, so neither mode took effect. A dwell timer bounds how often a subscription may switch at all.Entry uses the strict threshold, since bootstrap starts every subscriber far from the frontier. The gate then keeps tracking: a node that falls behind mid-stream would otherwise be served slim blocks indefinitely on a decision made while it was healthy — a lagging cohort held a ~450-round deficit while still being sent 347 slim blocks/s, 84% of which it could not rebuild.
Catch-up replay is unchanged and still sends full blocks; it serves rounds where the subscriber's state is unpredictable by construction.
Stacked on #27702 — review that first; this targets its branch.
Test plan
Four tests. The mode decision is extracted to
gate_next_modeso the hysteresis is testable without a stream harness: the thresholds leave a real gap (mutation-verified — collapsing it fails the test), the mode holds inside the gap from either direction, and it switches outside it.subscriber_lagis tested against a realDagStateto confirm it takes the later of the peer's reported position and its observed one.With the flag off — every chain today — the gate evaluates once at subscribe time to
falseand the re-evaluation branch never runs.Release notes
Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required.
For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates.