feat(val): prove VAL-4 double-voting in the same slot is impossible - #48
Merged
Conversation
Open the Validator domain: LeanSpec/Validator/Service.lean models the attestation arm of ValidatorService.run (node/validator/service.py, post leanEthereum/leanSpec#1180). Upstream guards double voting with the service-wide _attested_slots set - one attestation pass covers every validator the node manages - and the gate silently skips an already-attested slot rather than failing, retrying gated slots on later passes. The retention prune (max(0, slot - 4)) bounds the set. The runtime around the gate (async clock loop, sync service, gossip publishers, counters) is IO; the gate's inputs from it - the current interval and the _is_synced_for_duties verdict - enter as arguments. no_double_vote: the gate never fires for an attested slot. attested_after_duty: a fired duty records its slot through the prune. no_double_vote_after: once fired, never again for that slot.
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.
Summary
Opens the Validator domain (
LeanSpec/Validator/) with VAL-4, modeling the attestation duty gate ofValidatorService.run(src/lean_spec/node/validator/service.py, post leanEthereum/leanSpec#1180).Upstream reality vs the catalog sample
The catalog sample imagined a per-validator
attestedSlotsmap and an erroringproduceAttestation. Upstream instead:_attested_slots) — one attestation pass covers every validator the node managesmax(0, slot - ATTESTED_SLOT_RETENTION), retention = 4) bounds the setThe model mirrors that shape; the catalog entry documents the divergence.
What is modeled
ValidatorService— the duty-relevant state (_attested_slots); the async runtime (clock loop, sync service, publishers, counters) is IO, its two gate inputs (current interval,_is_synced_for_dutiesverdict) enter as argumentsattestationDue— the gate: from interval 1 on, at most once per slot, only when syncedattestationDutyStep— one pass:nonewhen gated,somewith the slot recorded and the window pruned when the duty firespruneAttested— truncated-Natsubtraction mirrors Python'smax(0, ·)clampTheorems
no_double_vote(VAL-4) — the gate never fires for an already-attested slotattested_after_duty— a fired duty records its slot (the fresh slot survives its own retention prune)no_double_vote_after— sharpened VAL-4: once fired for a slot, no later pass can fire for it again, regardless of interval or sync verdictCatalog: VAL-4 checked, progress table 22/8/1 (VAL 3 proved / 2 open — remaining: VAL-2 dual keys, VAL-5 XMSS preparation monotonicity).
lake buildpasses with nosorry.