Skip to content

fix(alpenglow): fault picker whale overshoot & dead-slot hero tx loss - #2

Merged
AkashJana18 merged 1 commit into
mainfrom
fix/alpenglow-liveness
Sep 24, 2026
Merged

AkashJana18 merged 1 commit into
mainfrom
fix/alpenglow-liveness

Conversation

@AkashJana18

Copy link
Copy Markdown
Owner

Summary

Two Alpenglow liveness bugs, both surfaced by the alpenglow_20pct_offline_is_safe_and_live proptest at ~19% offline:

Bug Seed Root cause Fix
Fault picker whale overshoot 9684 Target::StakePct overshoot heuristic grabbed the 94.6% whale when the 11 small nodes only summed to 5.4% → 100% offline, zero blocks, hero never submitted Overshoot with the smallest remaining node only when it lands closer to the target than stopping short (with.abs_diff(goal) < acc.abs_diff(goal))
Dead-slot hero tx loss 19 (n=12) Leader kept producing slices for slots already closed by a Skip certificate; hero landed in a dead block, RPC saw the block and stopped retrying Leader early-returns in produce_slice when pool.is_skipped(slot); on_block_complete no longer treats a block in a skipped slot as "landed"

Changes

  • crates/sim-core/src/scenario.rs — overshoot guard refinement + 2 new unit tests (stake_pct_never_overshoots_with_a_whale, stake_pct_lands_near_target_for_pareto_stakes)
  • crates/sim-core/src/protocol/alpenglow/mod.rs — dead-slot guard in produce_slice + skip check in on_block_complete
  • CLAUDE.md — documents both fixes and the picker caveat
  • web/e2e/screenshots/compare-leader-down.png — regenerated

Verification

  • cargo test --workspace — 22/22 pass (18 unit + 4 property, incl. alpenglow_20pct_offline_is_safe_and_live)
  • Sweep 164 seeds × 19.1% offline: 0 failures (was 5/104 before fixes)
  • Builtin scenario timings unchanged; wasm rebuilt; 4 Playwright specs pass

Caveat

The picker can now land below the target when stake is whale-dominated (19% → ~5% realized). Correct per the fix and documented in CLAUDE.md; the proptest liveness bound still holds since realized offline ≤ target.

…ro tx loss

Seed 9684: fault picker, not consensus. Pareto draw gave node 0 94.6% of
stake. Picker took all 11 small nodes (5.4%), fell short, then
"overshoot with one more node" grabbed the only one left: the whale.
100% offline, zero blocks, hero never submitted. Same code on main, so
pre-existing. Fix: overshoot only when it lands closer to target than
stopping short. New unit tests stake_pct_never_overshoots_with_a_whale,
stake_pct_lands_near_target_for_pareto_stakes.

Seed 19 (n=12): dead-slot inclusion. Leader kept producing slices for
slots already Skip-certified. Hero landed in dead slot 2 after its Skip
cert, so skip handler never fired, RPC saw block, stopped retrying. Fix:
leader stops producing once Pool has Skip cert for slot; receivers
ignore hero in skipped slot.

Evidence
- Sweep 164 seeds × 19.1% offline: 0 failures (was 5/104 before fixes).
- cargo test --workspace green, 18 unit + 4 property tests.
- Builtin scenario timings unchanged, wasm rebuilt, 4 Playwright specs
pass.
@AkashJana18
AkashJana18 merged commit c7dae1b into main Sep 24, 2026
2 checks passed
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