Implement duties streaming #1
Merged
Merged
Conversation
moshe-blox
pushed a commit
that referenced
this pull request
Jun 13, 2024
* use latest go-eth2-client version * return block data as versioned & hashroot * improve log * upgrade go-eth2-client v0.15.8 * proposerCalls interface change * versioned block spec tests * generate test json * include all versioned block spec tests * remove unused fields * use block version instead of hardcoded * keep only bellatrix block version * mention github issue * SSV comparable state #215 * use proper package names * Create beacon_node_versioned.go * Create ssv_msgs_versioned.go * versioned state comparison example * TestProposerWithJustificationsConsensusData versioned example * versioned TestingProposerDutyNextEpoch example * versioned PostConsensusWrongProposerMsg example * versioned PostConsensusWrongSigProposerMsg example * versioned PostConsensusProposerTooManyRootsMsg example * versioned PostConsensusSigProposerWrongBeaconSignerMsg example * return testing blocks as versioned * use TestingProposerDuty versioned slot * add versioned PostConsensusProposerTooFewRootsMsg * versioned PostConsensusProposerTooFewRootsMsg example * versioned runner decided msgs * randao versioned * versioned PreConsensusRandaoMsg SSVDecidingMsgs example * versioned PreConsensusRandaoNextEpochMsg example * versioned PreConsensusRandaoDifferentEpochMsg example * versioned PreConsensusRandaoTooManyRootsMsg example * versioned PreConsensusRandaoTooFewRootsMsg example * versioned PreConsensusRandaoWrongBeaconSigMsg example * versioned PreConsensusRandaoDifferentSignerMsg example * go fmt ./... * use versioned PreConsensusRandaoMsg * use versioned TestingProposerDuty * delete redundant tests (#1) * remove (versioned) name * remove unused * versioned GetBeaconBlock/GetBlindedBeaconBlock * fix merge conflict * use TestingDutySlotBellatrixNextEpoch * add versioned TestingInvalidDutySlot * versioned TestingInvalidDutySlot example * versioned TestingInvalidDutySlot example2 * add an issue comment --------- Co-authored-by: Gal Rogozinski <galrogogit@gmail.com>
moshe-blox
pushed a commit
that referenced
this pull request
Jun 13, 2024
* implementation * tmp * remove unused * use latest go-eth2-client version * use latest go-eth2-client version * return block data as versioned & hashroot * improve log * upgrade go-eth2-client v0.15.8 * proposerCalls interface change * versioned block spec tests * generate test json * include all versioned block spec tests * remove unused fields * use block version instead of hardcoded * keep only bellatrix block version * mention github issue * SSV comparable state #215 * use proper package names * Create beacon_node_versioned.go * Create ssv_msgs_versioned.go * versioned state comparison example * TestProposerWithJustificationsConsensusData versioned example * versioned TestingProposerDutyNextEpoch example * versioned PostConsensusWrongProposerMsg example * versioned PostConsensusWrongSigProposerMsg example * versioned PostConsensusProposerTooManyRootsMsg example * versioned PostConsensusSigProposerWrongBeaconSignerMsg example * return testing blocks as versioned * use TestingProposerDuty versioned slot * add versioned PostConsensusProposerTooFewRootsMsg * versioned PostConsensusProposerTooFewRootsMsg example * versioned runner decided msgs * randao versioned * versioned PreConsensusRandaoMsg SSVDecidingMsgs example * versioned PreConsensusRandaoNextEpochMsg example * versioned PreConsensusRandaoDifferentEpochMsg example * versioned PreConsensusRandaoTooManyRootsMsg example * versioned PreConsensusRandaoTooFewRootsMsg example * versioned PreConsensusRandaoWrongBeaconSigMsg example * versioned PreConsensusRandaoDifferentSignerMsg example * go fmt ./... * use versioned PreConsensusRandaoMsg * use versioned TestingProposerDuty * delete redundant tests (#1) * remove (versioned) name * remove unused * versioned GetBeaconBlock/GetBlindedBeaconBlock * fix merge conflict * use TestingDutySlotBellatrixNextEpoch * add versioned TestingInvalidDutySlot * versioned TestingInvalidDutySlot example * versioned TestingInvalidDutySlot example2 * add an issue comment * versioned messages tests * versioned runner consensus * versioned runner/duties/newduty * versioned runner/duties/proposer * versioned runner/full_happy_flow * versioned runner/postconsensus * versioned runner/pre_consensus_justifications * versioned runner/preconsensus * versioned valcheck/valcheckduty * versioned consensusdata/proposer * versioned beacon_node_test * remove non-versioned funcs * ssz withdrawals * capella support * versioned SSZWithdrawalsMarshaling * introduce versioned epoch + use goerli capella epoch fork * remove versioned block IsEmpty func * review adjustments * beacon_node_consts * multi version FullHappyFlow example * ExpectedDecidingMsgsForHeightWithRoot * ExpectedSSVDecidingMsgsV * use ExpectedSSVDecidingMsgsV * adjust multi version FullHappyFlow example * future_decided sc test * post_decided sc test * post_finish sc test * valid_decided sc test * valid_decided_7_operators sc test * comparable StartNewRunnerDutySpecTest * decided sc test * not_decided sc test * duplicate_msg sc test * duplicate_msg_different_roots sc test * inconsistent_beacon_signer sc test * post_quorum sc test * pre_decided sc test * quorum sc test * quorum_7_operators sc test * unknown_signer sc test * preconsensus/duplicate_msg sc test * preconsensus/no_running_duty sc test * preconsensus/post_decided_sc sc test * preconsensus/post_finish sc test * preconsensus/post_quorum sc test * preconsensus/quorum sc test * preconsensus/quorum_7_operators sc test * preconsensus/unknown_signer sc test * multi version TestBeaconBlockRoot * fix deadlock * add required fields to pass json tests * fix test comment * fix test * preconsensus/duplicate_msg full sc test * preconsensus/no_running_duty full sc test * preconsensus/post_decided full sc test * preconsensus/post_finish full sc test * preconsensus/post_quorum full sc test * preconsensus/quorum full sc test * preconsensus/quorum_7_operators full sc test * preconsensus/unknown_signer full sc test * root -> runner (#11) --------- Co-authored-by: Gal Rogozinski <galrogogit@gmail.com>
moshe-blox
pushed a commit
that referenced
this pull request
Jun 13, 2024
* implementation * tmp * remove unused * use latest go-eth2-client version * use latest go-eth2-client version * return block data as versioned & hashroot * improve log * upgrade go-eth2-client v0.15.8 * proposerCalls interface change * versioned block spec tests * generate test json * include all versioned block spec tests * remove unused fields * use block version instead of hardcoded * keep only bellatrix block version * mention github issue * SSV comparable state #215 * use proper package names * Create beacon_node_versioned.go * Create ssv_msgs_versioned.go * versioned state comparison example * TestProposerWithJustificationsConsensusData versioned example * versioned TestingProposerDutyNextEpoch example * versioned PostConsensusWrongProposerMsg example * versioned PostConsensusWrongSigProposerMsg example * versioned PostConsensusProposerTooManyRootsMsg example * versioned PostConsensusSigProposerWrongBeaconSignerMsg example * return testing blocks as versioned * use TestingProposerDuty versioned slot * add versioned PostConsensusProposerTooFewRootsMsg * versioned PostConsensusProposerTooFewRootsMsg example * versioned runner decided msgs * randao versioned * versioned PreConsensusRandaoMsg SSVDecidingMsgs example * versioned PreConsensusRandaoNextEpochMsg example * versioned PreConsensusRandaoDifferentEpochMsg example * versioned PreConsensusRandaoTooManyRootsMsg example * versioned PreConsensusRandaoTooFewRootsMsg example * versioned PreConsensusRandaoWrongBeaconSigMsg example * versioned PreConsensusRandaoDifferentSignerMsg example * go fmt ./... * use versioned PreConsensusRandaoMsg * use versioned TestingProposerDuty * delete redundant tests (#1) * remove (versioned) name * remove unused * versioned GetBeaconBlock/GetBlindedBeaconBlock * fix merge conflict * use TestingDutySlotBellatrixNextEpoch * add versioned TestingInvalidDutySlot * versioned TestingInvalidDutySlot example * versioned TestingInvalidDutySlot example2 * add an issue comment * versioned messages tests * versioned runner consensus * versioned runner/duties/newduty * versioned runner/duties/proposer * versioned runner/full_happy_flow * versioned runner/postconsensus * versioned runner/pre_consensus_justifications * versioned runner/preconsensus * versioned valcheck/valcheckduty * versioned consensusdata/proposer * versioned beacon_node_test * remove non-versioned funcs * ssz withdrawals * capella support * versioned SSZWithdrawalsMarshaling * introduce versioned epoch + use goerli capella epoch fork * remove versioned block IsEmpty func * review adjustments * beacon_node_consts * multi version FullHappyFlow example * ExpectedDecidingMsgsForHeightWithRoot * ExpectedSSVDecidingMsgsV * use ExpectedSSVDecidingMsgsV * adjust multi version FullHappyFlow example * future_decided sc test * post_decided sc test * post_finish sc test * valid_decided sc test * valid_decided_7_operators sc test * comparable StartNewRunnerDutySpecTest * decided sc test * not_decided sc test * duplicate_msg sc test * duplicate_msg_different_roots sc test * inconsistent_beacon_signer sc test * post_quorum sc test * pre_decided sc test * quorum sc test * quorum_7_operators sc test * unknown_signer sc test * preconsensus/duplicate_msg sc test * preconsensus/no_running_duty sc test * preconsensus/post_decided_sc sc test * preconsensus/post_finish sc test * preconsensus/post_quorum sc test * preconsensus/quorum sc test * preconsensus/quorum_7_operators sc test * preconsensus/unknown_signer sc test * multi version TestBeaconBlockRoot * fix deadlock * add required fields to pass json tests * fix test comment * fix test * postconsensus/duplicate_msg sc full test * postconsensus/duplicate_msg_different_roots full sc test * postconsensus/inconsistent_beacon_signer full sc test * postconsensus/post_quorum full sc test * postconsensus/pre_decided full sc test * postconsensus/quorum full sc test * postconsensus/quorum_7_operators full sc test * postconsensus/unknown_signer full sc test * fix comment (#8) * root -> runner (#10) * add comments (#15) --------- Co-authored-by: Gal Rogozinski <galrogogit@gmail.com>
moshe-blox
pushed a commit
that referenced
this pull request
Jun 13, 2024
* implementation * tmp * remove unused * use latest go-eth2-client version * use latest go-eth2-client version * return block data as versioned & hashroot * improve log * upgrade go-eth2-client v0.15.8 * proposerCalls interface change * versioned block spec tests * generate test json * include all versioned block spec tests * remove unused fields * use block version instead of hardcoded * keep only bellatrix block version * mention github issue * SSV comparable state #215 * use proper package names * Create beacon_node_versioned.go * Create ssv_msgs_versioned.go * versioned state comparison example * TestProposerWithJustificationsConsensusData versioned example * versioned TestingProposerDutyNextEpoch example * versioned PostConsensusWrongProposerMsg example * versioned PostConsensusWrongSigProposerMsg example * versioned PostConsensusProposerTooManyRootsMsg example * versioned PostConsensusSigProposerWrongBeaconSignerMsg example * return testing blocks as versioned * use TestingProposerDuty versioned slot * add versioned PostConsensusProposerTooFewRootsMsg * versioned PostConsensusProposerTooFewRootsMsg example * versioned runner decided msgs * randao versioned * versioned PreConsensusRandaoMsg SSVDecidingMsgs example * versioned PreConsensusRandaoNextEpochMsg example * versioned PreConsensusRandaoDifferentEpochMsg example * versioned PreConsensusRandaoTooManyRootsMsg example * versioned PreConsensusRandaoTooFewRootsMsg example * versioned PreConsensusRandaoWrongBeaconSigMsg example * versioned PreConsensusRandaoDifferentSignerMsg example * go fmt ./... * use versioned PreConsensusRandaoMsg * use versioned TestingProposerDuty * delete redundant tests (#1) * remove (versioned) name * remove unused * versioned GetBeaconBlock/GetBlindedBeaconBlock * fix merge conflict * use TestingDutySlotBellatrixNextEpoch * add versioned TestingInvalidDutySlot * versioned TestingInvalidDutySlot example * versioned TestingInvalidDutySlot example2 * add an issue comment * versioned messages tests * versioned runner consensus * versioned runner/duties/newduty * versioned runner/duties/proposer * versioned runner/full_happy_flow * versioned runner/postconsensus * versioned runner/pre_consensus_justifications * versioned runner/preconsensus * versioned valcheck/valcheckduty * versioned consensusdata/proposer * versioned beacon_node_test * remove non-versioned funcs * ssz withdrawals * capella support * versioned SSZWithdrawalsMarshaling * introduce versioned epoch + use goerli capella epoch fork * remove versioned block IsEmpty func * review adjustments * beacon_node_consts * multi version FullHappyFlow example * ExpectedDecidingMsgsForHeightWithRoot * ExpectedSSVDecidingMsgsV * use ExpectedSSVDecidingMsgsV * adjust multi version FullHappyFlow example * future_decided sc test * post_decided sc test * post_finish sc test * valid_decided sc test * valid_decided_7_operators sc test * comparable StartNewRunnerDutySpecTest * decided sc test * not_decided sc test * duplicate_msg sc test * duplicate_msg_different_roots sc test * inconsistent_beacon_signer sc test * post_quorum sc test * pre_decided sc test * quorum sc test * quorum_7_operators sc test * unknown_signer sc test * preconsensus/duplicate_msg sc test * preconsensus/no_running_duty sc test * preconsensus/post_decided_sc sc test * preconsensus/post_finish sc test * preconsensus/post_quorum sc test * preconsensus/quorum sc test * preconsensus/quorum_7_operators sc test * preconsensus/unknown_signer sc test * multi version TestBeaconBlockRoot * fix deadlock * add required fields to pass json tests * fix test comment * fix test * rearrange full_happy_flow_sc * newduty/decided full sc test * newduty/not_decided full sc test * add comments (#7) * change root -> runner + comments (#9) --------- Co-authored-by: Gal Rogozinski <galrogogit@gmail.com>
moshe-blox
pushed a commit
that referenced
this pull request
Jun 13, 2024
* implementation * tmp * remove unused * use latest go-eth2-client version * use latest go-eth2-client version * return block data as versioned & hashroot * improve log * upgrade go-eth2-client v0.15.8 * proposerCalls interface change * versioned block spec tests * generate test json * include all versioned block spec tests * remove unused fields * use block version instead of hardcoded * keep only bellatrix block version * mention github issue * SSV comparable state #215 * use proper package names * Create beacon_node_versioned.go * Create ssv_msgs_versioned.go * versioned state comparison example * TestProposerWithJustificationsConsensusData versioned example * versioned TestingProposerDutyNextEpoch example * versioned PostConsensusWrongProposerMsg example * versioned PostConsensusWrongSigProposerMsg example * versioned PostConsensusProposerTooManyRootsMsg example * versioned PostConsensusSigProposerWrongBeaconSignerMsg example * return testing blocks as versioned * use TestingProposerDuty versioned slot * add versioned PostConsensusProposerTooFewRootsMsg * versioned PostConsensusProposerTooFewRootsMsg example * versioned runner decided msgs * randao versioned * versioned PreConsensusRandaoMsg SSVDecidingMsgs example * versioned PreConsensusRandaoNextEpochMsg example * versioned PreConsensusRandaoDifferentEpochMsg example * versioned PreConsensusRandaoTooManyRootsMsg example * versioned PreConsensusRandaoTooFewRootsMsg example * versioned PreConsensusRandaoWrongBeaconSigMsg example * versioned PreConsensusRandaoDifferentSignerMsg example * go fmt ./... * use versioned PreConsensusRandaoMsg * use versioned TestingProposerDuty * delete redundant tests (#1) * remove (versioned) name * remove unused * versioned GetBeaconBlock/GetBlindedBeaconBlock * fix merge conflict * use TestingDutySlotBellatrixNextEpoch * add versioned TestingInvalidDutySlot * versioned TestingInvalidDutySlot example * versioned TestingInvalidDutySlot example2 * add an issue comment * versioned messages tests * versioned runner consensus * versioned runner/duties/newduty * versioned runner/duties/proposer * versioned runner/full_happy_flow * versioned runner/postconsensus * versioned runner/pre_consensus_justifications * versioned runner/preconsensus * versioned valcheck/valcheckduty * versioned consensusdata/proposer * versioned beacon_node_test * remove non-versioned funcs * ssz withdrawals * capella support * versioned SSZWithdrawalsMarshaling * introduce versioned epoch + use goerli capella epoch fork * remove versioned block IsEmpty func * review adjustments * beacon_node_consts * multi version FullHappyFlow example * ExpectedDecidingMsgsForHeightWithRoot * ExpectedSSVDecidingMsgsV * use ExpectedSSVDecidingMsgsV * adjust multi version FullHappyFlow example * future_decided sc test * post_decided sc test * post_finish sc test * valid_decided sc test * valid_decided_7_operators sc test * comparable StartNewRunnerDutySpecTest * decided sc test * not_decided sc test * duplicate_msg sc test * duplicate_msg_different_roots sc test * inconsistent_beacon_signer sc test * post_quorum sc test * pre_decided sc test * quorum sc test * quorum_7_operators sc test * unknown_signer sc test * preconsensus/duplicate_msg sc test * preconsensus/no_running_duty sc test * preconsensus/post_decided_sc sc test * preconsensus/post_finish sc test * preconsensus/post_quorum sc test * preconsensus/quorum sc test * preconsensus/quorum_7_operators sc test * preconsensus/unknown_signer sc test * multi version TestBeaconBlockRoot * fix deadlock * add required fields to pass json tests * fix test comment * fix test * future_decided full sc test * post_decided full sc test * post_finish full sc test * valid_decided full sc test * valid_decided_7_operators full sc test * fix #250 * generate tests.json * unwrap slice (#6) * Fix comments (#12) --------- Co-authored-by: Gal Rogozinski <galrogogit@gmail.com>
iurii-ssv
added a commit
that referenced
this pull request
May 8, 2026
#8 — runner.go: fetch deadline used cfg.TCommit − cfg.Layers[layer]. BroadcastBudget directly, which gives broadcastMax = TCommit when budgets are unset (=0) — too lax (should be the single-cap fallback TCommit − 2*BTT). Switch to cfg.BroadcastMaxOffsetForLayer(layer) which handles both modes correctly. Tests passed before only because fetch is fast in tests and the wrong-but-lenient deadline didn't trigger. #1 — obft/types.go and obft/config_test.go: two stale doc-comments still referenced "2*(D+Delta)" / "2*(D+δ)"; updated to "2*BTT" matching the field rename. #2 — obft/phase2.go ObserveCommit: the witness rehydration loop reduced to a no-op after the value_root refactor (match → already-counted via Phase 1; no-match → V-drop, unusable). Replace the dead loop with a clear comment block; future Rule 5 / ship-full-V extensions would add processing here. #2 — sizes.go: top doc-comment for Commit wire format updated from "Witnesses × (..., Value(|V|), ...)" to "ValueRoot(32)" matching the new on-the-wire shape. All tests pass under -race; vet and gofmt clean.
iurii-ssv
added a commit
that referenced
this pull request
May 8, 2026
) Per spec §Application / Timing budget — leader's MEV-fetch budget IS the full window from RANDAO_done to T_broadcast_max[k]. Single-shot fetch (call hook once at FetchAt, broadcast immediately) caps the MEV window at the (FetchAt → T_broadcast_max) gap; iterative-fetch uses the entire available window. Implementation: - iterativeFetch helper polls hooks.FetchCandidate at pollInterval (default 200ms = 1 BTT at Config A) throughout [now, ctx.deadline − buildBuffer]. Keeps the freshest non-error result. buildBuffer (default 50ms) reserves time at the end of the window for BuildPhase1Bundle + sign + wrap + dispatch. - FetchAndBroadcastBundle now calls iterativeFetch first, then builds and broadcasts the freshest. Existing hook contract unchanged (hooks.FetchCandidate is still single-call returning a candidate). - Production hook obftFetchCandidate (proposer_obft.go) calls beacon.GetBeaconBlock which returns the relay's current best bid; iterative polling thus captures fresher MEV bids as they accumulate at the relay throughout the window. - Single-shot degenerates naturally: when the window is too short for another iteration, the loop breaks after one fetch (matches legacy behavior for short windows). - Scheduler.SetFetchTiming exposes pollInterval and buildBuffer for test fixtures with shorter windows. MEV-fetch budget delta: - Before (single-shot, default FetchAt close to T_broadcast_max): 200ms. - After (iterative-fetch, same FetchAt): up to ~150ms loss (200ms FetchAt buffer + 50ms buildBuffer); measurable improvement requires deployments to override FetchAt earlier. - After (iterative-fetch, FetchAt set to ~RANDAO_done): up to ~3000ms vs spec target 3050ms. Within ~50ms of spec at Config A. Tests: - TestScheduler_IterativeFetch_PicksFreshest: configures fetchFn to return increasing values, verifies the freshest (last poll) is what gets used. - TestScheduler_IterativeFetch_DegradesToSingleShot: pollInterval > window → single fetch + return without spinning.
iurii-ssv
added a commit
that referenced
this pull request
May 8, 2026
#1) The iterative-fetch impl shipped in 9ae442e had infrastructure but no spec parity at default config: FetchAt = [3000, 2900, 2700, 2100]ms left only ~150ms of poll window per layer (broadcastMax − fetchAt − buildBuffer), collapsing to single-shot effectively. Production with this default still captured ~200ms of MEV freshness — same as pre-iterative. Update default schedule to start polling just past RANDAO_done (~150ms), matching spec §Application's iterative-fetch model where leaders poll relay throughout [RANDAO_done, T_broadcast_max[k]] and broadcast the freshest at deadline. K=4: fetchAt = [180, 170, 160, 150]ms. K=3: fetchAt = [170, 160, 150]ms. K>4 endpoints: 180ms (L_0) → 150ms (deepest), linear interpolation. The 1ms-per-layer staggering preserves the strict-decreasing fetchAt validation (a single-shot-era constraint) while keeping all layers clustered just past RANDAO_done. Spec's "deeper layer fetches from deeper-confirmed parent" pattern is preserved as a hook concern (which parent to query) — fetchAt only sets when polling starts. V_0 MEV-fetch budget at iterative-fetch = T_broadcast_max[0] − fetchAt[0] − buildBuffer = 3200 − 180 − 50 = 2970ms (vs spec's 3050ms target — ~80ms shy due to staggering and buildBuffer; both small). Tests use explicit FetchAt overrides → unaffected by default change. Production setup_obft.go uses defaults → now exercises iterative-fetch over the full window.
iurii-ssv
added a commit
that referenced
this pull request
May 8, 2026
Code: - scheduler.go: defaultFetchBuildBuffer 50ms → 10ms. The 50ms was 25× conservative for sign+wrap+dispatch (typically <2ms with herumi BLS); 10ms keeps a 5× safety margin while recovering 40ms of MEV freshness. - config.go: tightened K=4 fetchAt schedule from [180,170,160,150] to [153,152,151,150]. The staggering is symbolic for the strict-decreasing validation constraint; iterative-fetch uses the full window per layer regardless. K=3 schedule and K>4 interpolation endpoints follow. - L_0 MEV-fetch budget: 2970ms → 3037ms (vs spec target 3050ms — within 13ms). - instance.go: gofmt fix on EvidenceObserver field alignment. Spec text (docs/OBFT.md): - #3 §Head-change handling: clarify that the looser "no per-receiver parent_root validation" path is acceptable, with relay/beacon-node rejection at submit as the catch. Add an explicit "SSV's implementation choice (proposer duty, OBFT and QBFT)" paragraph noting both protocols take this path. - #10 §Setting / IBE keypair: add an "Implementation note (Option A reuse)" callout permitting V-keypair reuse via DST separation, citing docs/IBE-INTEGRATION.md. Pigeonhole 1 algebra preserved; framing unchanged for the safety argument. - #2 §Phase 2 wire format: rewrite the witness-section paragraph to describe the (layer, value_root, σ_V) triple shipped on the wire (no full V); explain that V-drop receivers fall back to KindCertificate gossip; update bandwidth claim 1.5 KB → 2.3 KB to include the 32-byte ValueRoot field. Update the cross-reference in Appendix C and the bandwidth lines in the OBFTR-comparison and QBFT-comparison tables. Code-area review (no issues found): - evidenceObserved map: lazy-allocated, single-threaded under instanceMu (Controller.lookup acquires per-instance mutex before all method calls). - iterativeFetch loop: bounded by ctx deadline; no spin (pollInterval guarded against ≤0); ctx.Done check inside select handles mid-loop cancellation; lastErr stale only when freshest is non-nil (benign). - ConfigOverrides accessors: derivation chain (BTT → Δ_2 → T_commit) unchanged from e0a02f1. All tests pass under -race; vet + gofmt clean.
iurii-ssv
added a commit
that referenced
this pull request
May 11, 2026
…yboard + cross-sweep panel
Two pieces of user feedback plus the eight tracked follow-ups:
Header (compact + balanced):
- CSS grid: title + controls on top row, lead text + metadata pills
flowing into the second row. Pills shrunk (smaller padding, lighter
border, narrower min-width). Title 1.85em → 1.4em. Pads everywhere
tightened. Header height drops ~50% without losing information.
Sub-TOC scope clarity (the duplicate "Silent operators" / "Propagation
issues" mystery):
- Added a labeled "OBFT-only:" divider in the group sub-row, with a
warm-brown left border. Same-named groups in the two scopes now
read clearly as different anchors.
#1 Lazy chart init:
- scheduleChartInit(details, fn) binds an init to each pack's first
`toggle` event. Default-open packs fire immediately at page load
(5 charts); the other 35 wait until their <details> opens. Initial
chart count drops 40 → 5; expand-all reaches 40 on demand.
#2 URL hash sync:
- setupHashSync() on load and on hashchange opens the target pack
(firing its lazy init), then scrolls it into view. Sub-TOC anchors
and external deep links now both expand-and-scroll.
#3 Bandwidth in matrix cells:
- Each numeric cell adds a third right-aligned span showing
clusterBandwidth.p50 formatted as "16 KB" / "1.2 MB". The trend
matrix cells get the same third token alongside the protocol's
success% and P99 ms.
#4 Miss reasons:
- Added MissReasons map[string]int to cellPayload (omitempty,
sourced from BatchCell.MissReasons populated by batch.go). When a
cell has misses the matrix shows the top reason as a small line
underneath ("missed relay deadline" etc.); trend-matrix cells
expose it via the cell's title attribute (hover tooltip).
#5 Cross-sweep scenario panel:
- Every matrix row now has a small ↗ button next to the scenario
title (visible on row hover/focus). Click opens a native <dialog>
showing that scenario's behaviour across all 5 sweeps: per-sweep
summary line ("OBFT: 100% · P99 3850 ms · QBFT: 100% · P99 1700ms")
plus a mini chart (bar for 1-point sweeps, line for multi-point).
Backdrop / × close.
#6 Filter/search box:
- New input row in the sticky TOC. Typing hides non-matching matrix
rows (case-insensitive substring on scenario title) and dims/italicizes
packs whose matrix has no remaining rows.
#7 Expand-all / collapse-all:
- Two header buttons. Expand triggers all packs' lazy inits in one
pass (so charts are ready when scrolled to). Collapse just removes
`open` attributes.
#8 Keyboard navigation in matrices:
- Rows are now `tabindex="0"` (active row) / "-1" (others) with
`role="button"`. ArrowDown / ArrowUp move the selection to the next
/ previous visible (non-filtered) row, focus it, and update the
chart. Click still works as before.
CSS additions across all of the above: filter row + scenario-filter
input styles, OBFT-only divider in sub-TOC, .cross-sweep-btn (hover-
visible), .bw / .miss-reason spans, focus ring on matrix rows, full
<dialog.cross-sweep> styling (header gradient, scrollable body,
per-sweep section dividers, mini-chart wrappers).
iurii-ssv
added a commit
that referenced
this pull request
May 12, 2026
… relaxation everywhere it leaked
Self-review of the schedule-relaxation pass surfaced three residual
issues:
(1) SSV adapter still rejected at T_commit ≤ 2.5·BTT. The base- and
2ab-layer Validates were relaxed but the SSV adapter's helper
DefaultBroadcastBudgetSchedule kept its own copy of the OOE error
guard. Behavior now mirrors the consensustest helper: cap each
shallow B_k at T_commit so the schedule stays non-decreasing; capped
layers share T_broadcast_max_k = max(BFT_start, T_commit − B_k) =
BFT_start at runtime. Test
TestDefaultBroadcastBudgetSchedule_TCommitTooSmall_Errors →
_TCommitTooSmall_Caps inverts to assert the cap behaviour.
(2) Stale "strict-increasing" / "strict-decreasing" wording in code
docstrings + comments. Most call sites' invariants weakened to
non-decreasing / non-increasing in the prior commit but the
descriptions hadn't caught up:
- obft/base/types.go and obft/twoab/config.go BroadcastBudget
docstrings now say "rejects ... decreasing-in-k schedules" with
a forward reference to the BFT_start clamp behaviour.
- ssv/runner/obft/config.go's defaultLayerSchedules / FetchAt /
DefaultBroadcastBudgetSchedule / defaultFetchSchedule docstrings
now state explicitly that the SSV adapter's own defaults are
strictly monotonic by convention but the underlying Validate
only requires non-strict ordering.
- obft/blsbackend/integration_test.go comment updated to
non-increasing FetchAt + BFT_start clamp.
- obft/twoab/config_test.go test-setup comment updated.
- ssv/runner/obft/config_test.go K=7 / K=10 schedule tests assert
non-decreasing (was strict-increasing).
(3) Adapter errors at extreme operating points surfaced as
"unexpected error" → cell n/a + log spam. Wrapped now with
ct.ErrConfigOutOfEnvelope so the framework renders those cells as
red 0% (already a documented branch in reduceCellResults):
- consensustest/obft/des.go: wraps obft.base.Config.Validate
failures inside runDES.
- consensustest/twoab/des.go: wraps twoab.Config.Validate failures.
- consensustest/twoab/adapter.go: wraps the T_commit-non-positive
pre-check.
- consensustest/obft/adapter.go, qbft/adapter.go,
twoab/adapter.go: wrap SimConfig.Validate failures at the
adapter entry point. Same semantic — the SimConfig is
operating-point-incompatible at this BTT.
Phase-2 smoke test (TestPhase2_AllSweepPoints_NoSetupErrors) updated:
- Per-cell OOE check relaxed: assert "at least one protocol runs
cleanly at each baseline point" instead of "no protocol OOE".
Per-protocol envelope mismatches are valid data — e.g. 2abOBFT at
BTT=500ms (its 4·BTT phase-2 tax pushes T_verdict_start below
BFT-min) now renders as red 0% rather than n/a, and the user gets
that signal in the heatmap.
Stale historical plan annotated: docs/BROADCAST-BUDGET-REDESIGN-PLAN.md
gains a top-of-doc note documenting that Decision #1 (return error
when T_commit ≤ 2.5·BTT) has been reversed.
iurii-ssv
added a commit
that referenced
this pull request
May 18, 2026
#1 (math bug): SafeMaxProposalSoftDeadline 1800ms -> 1100ms. The previous 1800ms claimed "round-2 QBFT fits" but the math doesn't: with QBFT worst-case 2-round = 2500ms, signing 150ms, submission 200ms, plus 50ms BN->SSV transport, deadline must be <= 1100ms for round-2 to fit within the 4000ms slot deadline. Updated the comment in options.go, the warning text in node.go, and references in MEV_CONSIDERATIONS.md (Path 2 section, Example B narrative + SSV-side note). options_test.go updated for the new safe-max boundary. #5: waitForFirstValidProposal now joins accumulated BN failure errors with ctx.Err() on slot deadline, preserving diagnostic context. #6 (doc): clarify that 700-1000ms ProposerDelay is permitted by the safety guard but is risky and not recommended. Doc-only change; the 1000ms cap stays as the hard safety threshold. #7: re-add concrete measurement function references (measurements.PreConsensusTime / ConsensusTime in protocol/v2/ssv/runner/) and the SubmitBeaconBlock entry-point to the "What to measure first" section. Operators without Grafana exports need these to instrument their stack. #8 partial: add TestGetBeaconBlock_MultiBN_SoftDeadlineFires_FallsBackToFirstValid verifying that paths 1/2 fall through to waitForFirstValidProposal when the slot-relative soft deadline has already fired. Uses a slot in the past so softCtx is done immediately at collection-loop entry. #9 (doc): tighten Example A's legacy-arrival range (~1300-2000ms, not ~1500-2000ms), and rewrite Example B's "latest practical value" framing to match the corrected 1100ms threshold from #1. #2 + #3: add a multi-BN pointer to TL;DR directing operators with multiple Beacon nodes to opt into Path 2 by setting ProposalSoftDeadline. Pushed back on (with rationale): - Reviewer claim that single-BN sees the "did not receive any valid proposals" log: incorrect. Single-BN goes through the direct fetchProposal path in GetBeaconBlock (proposer.go:103) and never enters getProposalParallel*; the log is multi-BN only. - Lowering MinProposalSoftDeadline below 1000ms: marginal value. Operators with low PBS cutoffs can still opt into Path 2 with the 1000ms floor (just wastes some wait time, not broken). - Lowering the ProposerDelay safety cap from 1000ms to 700ms: behavior change affecting existing operators using 700-1000ms. Clarified the gap in doc instead. - Startup-fatal end-to-end test for ProposerDelay+ProposalSoftDeadline combo: more infra for marginal return; unit test on DetermineBlockFetchPath already covers the logic. - Code-duplication parameterization for getProposalParallelSafe vs getProposalParallelMEVOptimized: the explicit split was deliberate per design discussion; merging would add control-flow complexity.
iurii-ssv
added a commit
that referenced
this pull request
May 23, 2026
…ase A+B+C design Adds the design plan for 2abOBFT-fast (wire version 0x05), an optimization that targets the structural 3·BTT-vs-OBFT-2·BTT healthy-path latency gap while restoring spec-intended wire-level V-binding (closes v4 first-pass deviations #1 and #2). The plan went through 4 rounds of structured review: Round 1: OBFT-vs-2abOBFT-fast gap walk surfaced Op11 (forward L0Witness in KindValue for peer-reflood-V authentication) and Op8/Op12 deferral to Phase D. Round 2: from-scratch review surfaced 4 critical + 7 medium issues including the contradiction with §Implementation deviations, dropping EvidenceFakeLeaderWitness in favor of Rule 5, the 3-state EKM machine, retroactive cross-firing complexity bound, Phase A/B merge, single-pass spec rewrite sequencing, validation reframing, K=2-vs-K≥3 production scope, and wire-version migration policy. Round 3: 13 impl-detail issues including resolveDeadline formula update, SafetyBuffer reframing post-Op5, Phase-2b equivocation trigger dead-code, NR-eligibility cannot-σ gate semantics, σ-pool head-start framing, L0Witness verify cost bound, content-hash decision, Rule 5 forwarded- witness keying (leader gets evidence, not forwarder), test churn estimate revision, spec rewrite scope expansion. Round 4: doc-structural cleanup + production rollout content. Added supersession banner, canonical resolveDeadline formula, reframed motivation to lead with structural wins (slow-profile recovery, V-drop recovery, wire-level security) not 200ms healthy-path latency. New Production rollout subsection covering Phase L prerequisite, message- validation touch-points, observability metrics, rollback procedure, mixed-version cluster behavior, and 5-phase validation cascade. The chosen optimization set: - Op3: Leader L0Witness in Phase-1 bundle (BLS partial on V_0, verifiable against leader's pubKeyShare). - Op5: σ partial in KindValue, drops KindCommit-Signed wire kind. - Op6: Async Phase-2a fire on L0Ready (consequence of Op5). TPhase2a becomes a KindNoValue backstop only. - Op11: Forward L0Witness in KindValue for peer-reflood-V authentication (enables A1 upgrade path under degraded mesh). Trade-offs accepted: A3 host-flip pivot, A4 equivocation pivot, A6/A7 multi-message sequences obsolete. Authorized Phase-2 emission pairs shrink from 8 to 3 (A1, A5, A8 remain). Phase D (Op8 + Op12, per-layer witnesses for L_k>0) deferred — required for K≥3 deployments, optional at K=2 default. This commit is the design plan only. The v4 sections of the doc remain as historical context (clearly marked) until Phase A+B lands.
iurii-ssv
added a commit
that referenced
this pull request
May 23, 2026
…-commit) First chunk of the 2abOBFT-fast Phase A+B execution per docs/2abOBFT-REDESIGN-PLAN.md §Healthy-path optimizations. Adds the leader's σ partial on V (L0Witness) to the Phase-1 bundle, restoring the spec-intended wire-level V-binding that v4-first-pass deferred per §Implementation deviations #1. Seeds σ-pool[V_0] from the moment a bundle is observed. Wire format changes: - Phase1Bundle gains L0Witness Signature field (required, non-empty at L_0; empty allowed at L_k>0 until Phase D / Op8). - Phase1BundleVersionV1 bumped to Phase1BundleVersionV2. Wire- incompatible with v4 — coordinated cluster cutover required at deployment time (deferred to production rollout phase, not this chunk). Protocol changes: - BuildPhase1Bundle at L_0 signs L0Witness via signer.SignPartial(V), caches in ownPartials[0], acquires σ-side EKM lock at L_0 via transitionToSigma, and self-pools into σ-pool[V_0]. Idempotent on (layer, value). - ObservePhase1Bundle verifies L0Witness at L_0 against the leader's pubKeyShare via verifyL0SigmaPartial; on success pools the partial into σ-pool[V_0]; on failure fires Rule 5 (EvidenceFakePlaintextSigma) keyed on (op=leader, layer=0) per the redesign-plan decision to reuse the existing slashing taxonomy rather than introducing a new EvidenceFakeLeaderWitness rule. - ValidatePhase1Bundle requires non-empty L0Witness at L_0. - deepCopyBundle now defensively copies L0Witness bytes. Test updates: - sim_test.go: new buildByzEquivocatingBundle helper signs L0Witness via direct signer access, bypassing EKM. Used to simulate byz leader equivocation (signs on multiple V's, which BLS permits; only honest paths are EKM-gated). - deliverPhase1Equivocation now uses byz-bypass for BOTH bundles since equivocation is inherently byz behavior. - phase2b_test.go TestMaybeBuildAndBroadcastCommit_EquivocationFires reframed to use a non-leader op (op 2) for the A4 pivot — leader is now σ-locked from Phase-1 build, can't pivot. Non-leader can still pivot under Op3-only (Op5 will close even that path). - scenarios_test.go TestScenario_HostFlipMidSlot_4NV_FallsThroughToL1 skipped with TODO — A3 host-flip pivot is the trade-off Op5 will obsolete; reframed when Op5 lands rather than constantly re-fixing. - validation_test.go: all Phase1Bundle{} literals populated with stubWitness; added TestValidatePhase1Bundle_RejectsEmptyL0WitnessAtL0. - 6 new Op3-specific tests covering build-populates-L0Witness, σ-lock acquisition, observe-verifies+pools, fake-witness Rule 5, wire round- trip, validation rejection. Adapter (consensustest/twoab): - des.go: sim retains the per-op signer for byz-forging paths. - events.go evtLeaderFetch byz-forge branch signs L0Witness via direct signer access (matching the byz-bypass test helper pattern). Catalog update: - catalog_equivocation.go PartialEquivocation_NaturalRecovery: 2abOBFT expectation flips from ExpectMiss to ExpectSuccessFastest. The leader's L0Witness in the Phase-1 bundle (V_a path) seeds σ-pool[V_a] cluster- wide, letting the 2 V_a recipients reach qV=3 naturally. Matches OBFT's pre-existing behavior. This is the intended Op3 improvement — restores the σ-pool head-start that v4 lacked. Tests: - All protocol/v2/obft/... and protocol/v2/consensustest/... tests pass. - 6 new Op3-specific tests pass and exercise the build/verify/pool/Rule-5 paths.
iurii-ssv
added a commit
that referenced
this pull request
May 23, 2026
…ions Follow-up to 8f6edc8. Addressed findings from a thorough self-review of sub-chunk #1: Correctness: - BuildPhase1Bundle now signs L0Witness FIRST, then acquires σ-side EKM lock. Previous ordering (transitionToSigma → SignPartial) could leave the EKM σ-locked without a corresponding partial if signer infra transiently failed; the new ordering ensures sign-fail leaves Instance state untouched (signed bytes discarded, leader can retry). Doc accuracy: - consensustest/twoab/events.go: removed two stale comments claiming "2abOBFT has no Phase-1 σ_V partial" — Op3 explicitly adds one. Replaced with accurate description of the L0Witness verify+pool path that runs on bundle observation. - catalog_equivocation.go: PartialEquivocation_NaturalRecovery 2abOBFT comment mis-attributed the leader equivocation to Rule 3 (cross-σ-V). Fixed to Rule 2 (leader equivocation) — ObservePhase1Bundle fires Rule 2 on distinct-V bundles from the same leader; Rule 3 fires only from ObserveValueMsg / ObserveCommit on cross-σ-V emissions. Test coverage: - New TestBuildPhase1Bundle_IdempotentOnSameValue verifies the docstring claim that repeated builds on the same (layer, value) succeed and produce byte-equal L0Witness (cached partial + idempotent σ-lock). - Renamed TestPhase1Bundle_WireRoundTrip → TestObservePhase1Bundle_ PreservesL0WitnessThroughRetention. The prior name implied wire encode/decode coverage; the test actually exercises the deepCopyBundle path inside ObservePhase1Bundle. Real wire coverage is now in wire/wire_test.go. - TestPhase1Bundle_EncodeDecodeRoundTrip extended to populate + verify L0Witness round-trip. - New TestPhase1Bundle_EncodeDecodeRoundTrip_EmptyL0Witness covers the L_k>0 case (empty witness at the wire level; non-empty enforcement lives in ValidatePhase1Bundle as separation of concerns). All tests green; no behavior change for shipped paths.
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.
No description provided.