Skip to content

feat(st): prove ST-7 checkpoint replacement is strictly forward - #60

Merged
adust09 merged 2 commits into
mainfrom
feat/st7-checkpoint-forward
Jul 20, 2026
Merged

feat(st): prove ST-7 checkpoint replacement is strictly forward#60
adust09 merged 2 commits into
mainfrom
feat/st7-checkpoint-forward

Conversation

@adust09

@adust09 adust09 commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Summary

Stacked on #59 (merge that first; this PR retargets to main automatically when its branch is deleted).

ST-3/ST-6 bound only the checkpoint slots, so they still admitted a transition that swaps latest_justified / latest_finalized to a different root at the same slot. This PR adds ST-7 to the catalog and proves it: across a successful transition, each checkpoint is either unchanged as a whole value (root included) or replaced by one at a strictly higher slot — mirroring Checkpoint.advance_to's strict comparison and the finalized < source.slot finalization guard.

Changes

  • New LeanSpec/Forks/Lstar/CheckpointForward.lean: the per-phase lemma chain applyJustification_forwardprocessAttestation_forwardfoldlM_processAttestation_forwardprocessAttestations_forward, plus processBlockHeader_checkpoints_of_ne_zero and the top-level State.checkpoint_forward (composition via the forward_trans helper).
  • Genesis anchoring (the first block filling in its parent root at slot 0) is the one designed same-slot replacement; it is excluded by the latestBlockHeader.slot ≠ 0 hypothesis, verified necessary: the same proof fails without it.
  • Cross-branch root ancestry is deliberately not claimed: upstream leanSpec#1182 documents on Checkpoint.advance_to that "selection is by slot only" and on Store.latest_finalized that ancestry is a separate store invariant — that is the next FC-side work item, not an STF property.
  • Catalog: ST-7 entry added under State Transition; progress table now 31 proved / 1 axiom / 32 total.

Verification

lake build succeeds (36 jobs); #print axioms State.checkpoint_forward[propext, Quot.sound] only; no sorry.

adust09 added 2 commits July 20, 2026 20:08
Upstream leanEthereum/leanSpec#1185 (closes #1184) now rejects a
manifest whose attestation and proposal public keys coincide, at load
time and without touching secret bytes. The model's addChecked
previously compared PRF seeds as a placeholder for the invited fix;
re-align it with the merged shape:

- addChecked now compares public keys, with the Arklib-side derivation
  entering as the publicKeyOf parameter (the repo's crypto-as-parameter
  pattern).
- addChecked_wellFormed holds for every derivation: distinct public
  keys imply distinct secret keys by congruence alone.
- addChecked_seed_distinct keeps the OTS-reuse core of #1184: for
  seed-fingerprinting derivations an accepted entry's keys have
  distinct master seeds.
- Registry.lean and catalog docstrings drop the stale 'upstream does
  not enforce' caveat: WellFormed is established by construction since
  #1185.
ST-3/ST-6 bound only the checkpoint slots, so they still admitted a
transition that swaps latest_justified / latest_finalized to a different
root at the same slot. ST-7 closes that gap at the STF level: across a
successful transition each checkpoint is either unchanged as a whole
value (root included) or replaced by one at a strictly higher slot,
mirroring Checkpoint.advance_to's strict comparison and the
finalized < source.slot finalization guard.

- New LeanSpec/Forks/Lstar/CheckpointForward.lean with the per-phase
  chain applyJustification_forward -> processAttestation_forward ->
  foldlM -> processAttestations_forward, plus
  processBlockHeader_checkpoints_of_ne_zero (past genesis anchoring the
  header stage leaves both checkpoints untouched) and the top-level
  checkpoint_forward.
- Genesis anchoring (the first block filling in its parent root at
  slot 0) is the one designed same-slot replacement; it is excluded by
  the latestBlockHeader.slot != 0 hypothesis and documented in the
  catalog entry.
- Root ancestry across branches stays a store invariant per upstream
  leanSpec#1182's Checkpoint.advance_to / Store.latest_finalized notes;
  it is future FC work, not an STF property.
- Catalog: ST-7 entry added, progress table now 31 proved / 1 axiom.
Base automatically changed from feat/val2-track-upstream-1185 to main July 20, 2026 11:23
@adust09
adust09 merged commit dac113a into main Jul 20, 2026
1 check passed
@adust09
adust09 deleted the feat/st7-checkpoint-forward branch July 20, 2026 11:30
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