Skip to content

feat(val): add checked registry insertion tracking leanSpec#1184 - #58

Merged
adust09 merged 1 commit into
mainfrom
feat/track-1184-checked-registry
Jul 6, 2026
Merged

feat(val): add checked registry insertion tracking leanSpec#1184#58
adust09 merged 1 commit into
mainfrom
feat/track-1184-checked-registry

Conversation

@adust09

@adust09 adust09 commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Summary

Prepares the Lean side of the leanEthereum/leanSpec#1184 loop (the maintainers have invited a fix PR upstream). Unlike #57 this does not mirror pending upstream code — it implements the fix shape suggested in the issue, so it is safe to merge now and re-align (if needed) when the upstream fix lands.

What it adds (LeanSpec/Validator/Registry.lean)

  • addChecked — reject a same-seed entry at insertion (none mirrors the loader's ValueError). Every one-time key of an XMSS secret key derives from its master PRF seed, so two keys collide in OTS state exactly when their seeds coincide — the check compares the seeds; upstream will compare the manifest's two public keys, which equivalently fingerprint them
  • addChecked_wellFormed — an accepted entry passed the comparison, so checked insertion discharges the WellFormed distinctness at construction: once upstream enforces the check, every loaded registry is well-formed by construction — closing the loop the way #1179 did for the store invariants (Store.WellFormed)

lake build passes with no sorry.

The maintainers invited a fix PR for leanEthereum/leanSpec#1184; this
prepares the Lean side of that loop. addChecked rejects a same-seed
entry at insertion - every one-time key of an XMSS secret key derives
from its master PRF seed, so two keys collide in OTS state exactly
when their seeds coincide (upstream will compare the manifest's two
public keys, which equivalently fingerprint the seeds).

addChecked_wellFormed: an accepted entry passed the comparison, so
checked insertion discharges the WellFormed distinctness at
construction - once upstream enforces the check, every loaded
registry is well-formed by construction, closing the loop the way
#1179 did for the store invariants. Re-align the shape with the
merged fix when it lands.
@adust09
adust09 merged commit ac99516 into main Jul 6, 2026
1 check passed
@adust09
adust09 deleted the feat/track-1184-checked-registry branch July 6, 2026 14:57
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