Skip to content

feat(val): prove VAL-1 proposers are selected round-robin - #39

Merged
adust09 merged 1 commit into
mainfrom
feat/val-1-proposer-round-robin
Jul 3, 2026
Merged

feat(val): prove VAL-1 proposers are selected round-robin#39
adust09 merged 1 commit into
mainfrom
feat/val-1-proposer-round-robin

Conversation

@adust09

@adust09 adust09 commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Discharges VAL-1 from docs/lean4-proof-propositions.md: proposers are selected round-robin (slot % n).

  • New LeanSpec/Forks/Lstar/Containers/Identifiers.lean (mirrors upstream containers/identifiers.py):
    • ValidatorIndex.proposerForSlot — round-robin selection, UInt64.ofNat (slot.toNat % n).
    • proposer_index_round_robin (VAL-1, catalog form — ValidatorIndex.mk realized as UInt64.ofNat).
    • proposerForSlot_toNat — the substantive half: the UInt64 construction never wraps (slot % n ≤ slot < 2^64), so the selected index is exactly slot.toNat % n at the Nat level.
  • StateTransition.leanprocessBlockHeader's proposer check refactored to consume proposerForSlot (upstream compares block.proposer_index != proposer_for_slot(...) directly), so the theorem speaks about the deployed selection rather than an orphan definition. Equivalent to the previous Nat-level check for all inputs by proposerForSlot_toNat; all ST proofs pass unchanged.
  • Catalog: VAL-1 checked off (VAL 1/4/0, total 15 proved).

Note: no GitHub issue exists for VAL-1 (issue creation is blocked in-session); the catalog entry is the tracking artifact.

Verification

  • lake build green with zero warnings; no sorry, no new axioms.

Part of the Validator domain (VAL-3 follows in a stacked PR).

Extract ValidatorIndex.proposerForSlot mirroring proposer_for_slot in
upstream containers/identifiers.py and refactor processBlockHeader's
proposer check to consume it (semantics unchanged: the UInt64
construction never wraps since slot % n <= slot < 2^64, recorded as
proposerForSlot_toNat). Prove proposer_index_round_robin, the catalog
form of the round-robin selection. Axiom-free, no Mathlib.
@adust09
adust09 merged commit 4b5d7ef into main Jul 3, 2026
1 check passed
@adust09
adust09 deleted the feat/val-1-proposer-round-robin branch July 3, 2026 00:42
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