WIP -- [Leios] LLF1-3: the endorser block, its announcement, and the vote (#1301) - #1307
Draft
williamdemeo wants to merge 5 commits into
Draft
WIP -- [Leios] LLF1-3: the endorser block, its announcement, and the vote (#1301)#1307williamdemeo wants to merge 5 commits into
williamdemeo wants to merge 5 commits into
Conversation
williamdemeo
marked this pull request as draft
September 2, 2026 03:05
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The abstract API cannot pass RBHeaderHash to the Ser-based BLS verifier, and documentation links currently target the contradictory unamended CIP.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds foundational Leios endorser-block, announcement, and vote types aligned with the amended CIP-164 design.
Changes:
- Defines Leios primitive types and decidable equality.
- Extends
CryptoStructurewith Leios hash abstractions. - Integrates the module into documentation and test/foreign structures.
File summaries
| File | Description |
|---|---|
src/Ledger/Dijkstra/Specification/Leios/Types.lagda.md |
Defines and documents Leios types. |
src/Ledger/Dijkstra/Specification.lagda.md |
Imports the Leios types module. |
src/Ledger/Core/Specification/Crypto.lagda.md |
Adds Leios hash carriers and equality instances. |
src/Ledger/Core/Foreign/Crypto/Structure.agda |
Implements foreign hash fields. |
formal-ledger-test/src/Test/LedgerImplementation.lagda.md |
Extends the test crypto implementation. |
CHANGELOG.md |
Records the new specification types. |
build-tools/static/mkdocs/mkdocs.yml |
Adds Leios types to documentation navigation. |
Review details
Suppressed comments (2)
src/Ledger/Core/Specification/Crypto.lagda.md:138
RBHeaderHashis independent ofSer, but the only BLS verifier acceptsSer(isSignedBy : BlsVKey → Ser → BlsSig → Type). Consequently, code parameterized byCryptoStructurecannot validateVote.vSigagainstVote.vAnn, despite that being the stated signed message. Add an abstract encoding such asRBHeaderHash → Ser(and implement it in each structure), or change the verification API so this carrier can be passed directly.
field EBHash TxRefHash RBHeaderHash : Type
hashEBRefs : List (TxRefHash × ℕ) → EBHash
src/Ledger/Dijkstra/Specification/Leios/Types.lagda.md:132
- This footnote points to
master, whereleios_votestill containsslot_noandendorser_block_hash; the announcing-header schema used above exists only in the open amendment PR. Link the amended document (or a pinned amendment commit) so the claimed wire-format mapping does not send readers to a contradictory schema.
[^1]: [CIP-164, Appendix B: Wire Format Specifications (CDDL)](https://github.com/cardano-foundation/CIPs/blob/master/CIP-0164/README.md#appendix-b-cddl).
- Files reviewed: 7/7 changed files
- Comments generated: 2
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
4 tasks
Member
Author
|
accidentally closed |
EBHash identifies an endorser block, TxRefHash a referenced transaction, RBHeaderHash the announcing ranking-block header, and hashEBRefs computes an EB's identifier from its reference list. All four stay abstract; TxRefHash hashes the complete transaction bytes rather than the body-only transaction id (CIP-164 Appendix B), and no byte-exact preimage is pinned for hashEBRefs. They sit beside the voting crypto as protocol-specific carriers in the way ScriptHash and VRF already are; the Foreign instance and the test implementation mirror the fields. AI-assisted development: Claude Fable 5 (Anthropic)
Ledger.Dijkstra.Specification.Leios.Types defines the endorser block (an ordered list of transaction references; duplicate-freedom is left to a validity condition, not a proof field), its identifier hashEB, the announcement a ranking-block header carries, and the vote of the amended CIP-164: the announcing header's hash as the signed message, the voter's seat index, and a BLS signature, with no slot and no EB hash, both redundant on the wire. The certificate is deliberately absent: LeiosCert lives beside the committee in the module #1300 introduces, and the prose points there. Both records carry derived DecEq instances. Registered in the era aggregator and the mkdocs nav. AI-assisted development: Claude Fable 5 (Anthropic)
williamdemeo
force-pushed
the
1301-llf1-3-leios-types
branch
from
September 10, 2026 06:36
94c9a8a to
8c38dac
Compare
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.
This PR adds
Ledger.Dijkstra.Specification.Leios.Types, the Leios primitive types of the design note and CIP-164 as amended by cardano-foundation/CIPs#1250: the endorser block, the announcement that names it, and the committee vote.EndorserBlockis the ordered list of transaction references,List (TxRefHash × ℕ). Duplicate-freedom of the reference hashes is a validity condition for the rules milestone, not a proof field, and the module prose records why (the rules must be able to mention a malformed object in order to reject it; a proof field would also forfeit derived decidable equality).hashEBfixes the EB identifier as the hash of the reference structure itself, via the abstracthashEBRefs; the byte-exact preimage stays deliberately unpinned, and the prose marks this boundary as the conformance cliff tracked in the design note.Announcement = EBHash × ℕmodels the optional header groupannounced_eb/announced_eb_size; the wire'scertified_ebbit is spec-derived and not modeled, which the prose also records.Votefollows the amended CIP: the hash of the announcing RB header (exactly the signed message), thevoter_idseat index, and the BLS vote signature. No slot and no EB hash, which the amended Appendix B declares redundant on the wire. Consumed by no transition rule, per the design-note addendum;ValidVoteand friends are later milestones.DecEqinstances, andAnnouncementinherits one from its components.The one design call flagged for review is carrier placement:
EBHash,TxRefHash,RBHeaderHash(each withDecEq) andhashEBRefs : List (TxRefHash × ℕ) → EBHashland as fields of the coreCryptoStructure, in a short visible "Leios Hashes" block beside the Leios voting crypto, on the precedent thatScriptHashandVRFare protocol-specific hash types already carried by that record. The alternative was leaving them as parameters of the new module.TxRefHashis the hash of the complete transaction bytes, not the body-only transaction id, and the prose keeps that distinction (CIP-164 Appendix B).There is deliberately no certificate type here:
LeiosCert(signer set plus aggregate signature) belongs beside the committee that produces it, in theLedger.Dijkstra.Specification.Leiosmodule that #1300 introduces, and this module's prose points there, so the two PRs compose without duplication.The Foreign crypto instance and
formal-ledger-test'sLedgerImplementationmirror the new fields; the latter typechecks locally (it is the surface only Hydra checks in CI).Gates:
agda src/Ledger/Dijkstra.lagda.mdandagda src/Ledger.lagda.mdboth exit 0.Stacked on #1298's PR; re-targets
leios-mainas the stack merges.Closes #1301.
🤖 AI-assisted development: Claude Fable 5 (Anthropic)