feat(blockchain): add --disable-duty-sync-gate to ungate duties#452
Draft
MegaRedHand wants to merge 3 commits into
Draft
feat(blockchain): add --disable-duty-sync-gate to ungate duties#452MegaRedHand wants to merge 3 commits into
MegaRedHand wants to merge 3 commits into
Conversation
The sync-gate suppresses block proposal, attestation production, and aggregate re-derivation whenever a node judges itself to be syncing (local head lagging wall clock while the network still progresses). In practice this feedback loop has driven finality stalls on the devnets: dead/slow proposers create empty slots, head lag crosses the threshold, nodes flap into Syncing and stop attesting, which widens the head-finalized gap further. Add a `--disable-duty-sync-gate` flag (default off, so gating stays on) that makes the gate observe-only: `SyncStatusTracker::update` still tracks the syncing state and drives `lean_node_sync_status`, but `duties_allowed()` always returns true. This lets us A/B the hypothesis on a devnet without a rebuild while keeping the metric for observability.
When --disable-duty-sync-gate is set, the node may believe it is syncing yet run duties anyway. Surface that counterfactual: at each of the three gate sites (propose, attest, reaggregate) emit a warn when the gate would have suppressed the duty had it been enabled. Makes the override visible and greppable during devnet experiments. Also drops the two unit tests added in the previous commit.
Replace the per-duty counterfactual logs with a single transition log in SyncStatusTracker::update: emit a debug line only when the syncing state actually flips, carrying the slot/lag context that drove the decision. Quieter than per-duty logging and applies whether or not the duty gate is enabled.
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.
What
Adds a
--disable-duty-sync-gateCLI flag (defaultfalse, so current behavior is preserved). When set, the sync-gate becomes observe-only: it still tracks the syncing state and exportslean_node_sync_status, but no longer suppresses any validator duty.Why
The sync-gate suppresses three things while a node judges itself to be syncing (local head lagging wall clock while the network still progresses):
lib.rs:264:289:738On the devnets this gate has repeatedly driven a head-finalized sawtooth / non-finality feedback loop: dead or slow proposers create empty slots, head lag crosses
SYNC_LAG_THRESHOLD, nodes flap intoSyncingand stop attesting, which only widens the gap. This flag lets us A/B that hypothesis on a live devnet without a rebuild, keeping the metric intact for observability.How
SyncStatusTrackergains agate_dutiesfield (defaulttrue).update()(the metric path) is unchanged.duties_allowed()returnstrueunconditionally when gating is disabled.duties_allowed(), so the flag covers proposal, attestation, and reaggregation uniformly.Behavior matrix
--disable-duty-sync-gatelean_node_sync_statusTesting
cargo test -p ethlambda-blockchain sync_status— 8/8 pass, incl. two new tests covering gate-on (default) and gate-disabled.cargo build,cargo fmt,cargo clippyclean.Draft: intended for devnet experimentation, not immediate merge.