Skip to content

Constrain the size of leios_certificate signers - #5888

Merged
ch1bo merged 1 commit into
masterfrom
ch1bo/constrain-leios-cert-signers
Aug 31, 2026
Merged

ch1bo merged 1 commit into
masterfrom
ch1bo/constrain-leios-cert-signers

Conversation

@ch1bo

@ch1bo ch1bo commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

The maximum length is determined by the maximum LeiosVoterId. As this is a Word16, the max number of entries is 65535 bits = 8192 bytes

This is now based on the upcoming cardano-crypto-leios 0.3 and requires IntersectMBO/cardano-base#697

Checklist

  • Commits in meaningful sequence and with useful messages.
  • Tests added or updated when needed.
  • CHANGELOG.md files updated for packages with externally visible changes.
    NOTE: New section is never added with the code changes. (See RELEASING.md).
  • Versions updated in .cabal and CHANGELOG.md files when necessary, according to the
    versioning process.
  • Version bounds in .cabal files updated when necessary.
    NOTE: If bounds change in a cabal file, that package itself must have a version increase. (See RELEASING.md).
  • Code formatted (use scripts/fourmolize.sh).
  • Cabal files formatted (use scripts/cabal-format.sh).
  • CDDL files are up to date (use scripts/gen-cddl.sh)
  • hie.yaml updated (use scripts/gen-hie.sh).
  • Self-reviewed the diff.

@ch1bo
ch1bo requested a review from a team as a code owner June 30, 2026 06:00
@ch1bo
ch1bo marked this pull request as draft June 30, 2026 06:00
@ch1bo ch1bo mentioned this pull request Jun 30, 2026
10 tasks
Base automatically changed from ch1bo/cardano-crypto-leios to master June 30, 2026 08:05
@ch1bo
ch1bo force-pushed the ch1bo/constrain-leios-cert-signers branch from 8618cd2 to 4ae4181 Compare June 30, 2026 09:41
@ch1bo ch1bo added the Leios Tickets related in some form to work on Leios label Jul 1, 2026
@ch1bo
ch1bo changed the base branch from master to leios-prototype July 3, 2026 07:21
@ch1bo
ch1bo force-pushed the ch1bo/constrain-leios-cert-signers branch from 4ae4181 to a68f977 Compare July 3, 2026 07:21
@ch1bo
ch1bo force-pushed the leios-prototype branch from d108a4d to 17a4149 Compare July 3, 2026 07:41
@ch1bo
ch1bo force-pushed the ch1bo/constrain-leios-cert-signers branch 2 times, most recently from eef6599 to e099c92 Compare July 5, 2026 16:55
@koslambrou
koslambrou force-pushed the leios-prototype branch 2 times, most recently from f0b2085 to 9edd1c6 Compare July 16, 2026 21:08

@lehins lehins left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to me that we can merge this PR.

Comment thread eras/dijkstra/impl/cddl/data/dijkstra.cddl Outdated
@ch1bo ch1bo self-assigned this Aug 4, 2026
@ch1bo
ch1bo force-pushed the ch1bo/constrain-leios-cert-signers branch from e099c92 to d514faa Compare August 27, 2026 19:19
@ch1bo
ch1bo force-pushed the ch1bo/constrain-leios-cert-signers branch 2 times, most recently from c8407af to c10bb7f Compare August 28, 2026 12:19
@ch1bo
ch1bo changed the base branch from leios-prototype to master August 28, 2026 12:20
@ch1bo
ch1bo marked this pull request as ready for review August 28, 2026 12:22
Copilot AI lite review requested due to automatic review settings August 28, 2026 12:22
@ch1bo
ch1bo force-pushed the ch1bo/constrain-leios-cert-signers branch from c10bb7f to 2f008af Compare August 28, 2026 12:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces an upper bound on the decoded size of Leios certificate signer bitfields, aligning the ledger’s CBOR decoding and Dijkstra-era CDDL/spec generation with the maximum addressable Leios committee size.

Changes:

  • Add maxLeiosCertSignersBytes and enforce it in the DecCBOR instance for LeiosCert (reject oversized signer bitfields).
  • Update Dijkstra CDDL/Huddle spec to constrain leios_certificate.signers byte size and rename the signature field to signature.
  • Update Dijkstra’s cardano-crypto-leios lower bound and pin cardano-base via cabal.project for the required dependency state.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
libs/cardano-ledger-binary/src/Cardano/Ledger/Binary/Decoding/DecCBOR.hs Adds max signer-size constant and rejects oversized LeiosCert signer bitfields during decoding.
libs/cardano-ledger-binary/CHANGELOG.md Documents the new LeiosCert decoding constraint.
eras/dijkstra/impl/cddl/lib/Cardano/Ledger/Dijkstra/HuddleSpec.hs Constrains signers bytes in generated spec; renames cert signature field to signature.
eras/dijkstra/impl/cddl/data/dijkstra.cddl Reflects signer size bound (0..8192) and signature field rename in the published CDDL.
eras/dijkstra/impl/cardano-ledger-dijkstra.cabal Bumps cardano-crypto-leios lower bound to >=0.3.
cabal.project Pins cardano-base to a specific git tag needed by upcoming dependencies.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@ch1bo
ch1bo force-pushed the ch1bo/constrain-leios-cert-signers branch 2 times, most recently from c946442 to 953ea4b Compare August 28, 2026 13:02
@ch1bo
ch1bo requested a lite review from Copilot August 28, 2026 13:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

The maximum length is determined by the maximum LeiosSeatId and now
exported by cardano-crypto-leios
@ch1bo
ch1bo force-pushed the ch1bo/constrain-leios-cert-signers branch from 953ea4b to 02bef48 Compare August 31, 2026 08:31
@ch1bo
ch1bo enabled auto-merge August 31, 2026 08:32
@ch1bo
ch1bo merged commit 9b133ac into master Aug 31, 2026
52 checks passed
@ch1bo
ch1bo deleted the ch1bo/constrain-leios-cert-signers branch August 31, 2026 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Leios Tickets related in some form to work on Leios

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants