-
Notifications
You must be signed in to change notification settings - Fork 8
CIP Draft #396
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
CIP Draft #396
Changes from 123 commits
Commits
Show all changes
343 commits
Select commit
Hold shift + click to select a range
6ab4156
docs(cip): epoch boundary bheavio
will-break-it db1b3cd
docs(cip): node behavior steps descriptions - merge step 7/8
will-break-it 64505f4
docs(cip): node behavior steps descriptions - merge step 11
will-break-it f31ea60
docs(cip): node behavior steps descriptions - step 9
will-break-it 16fbbcd
docs(cip): node behavior steps descriptions - step 9
will-break-it 1a2b6fe
docs(cip): protocol overview - match 5 voting requirements
will-break-it 5ae56c7
docs(cip): validation dependency
will-break-it 1991def
docs(cip): node behavior steps descriptions - step 6
will-break-it 25c410c
Changes done by SN and WW on hackmd
ch1bo aa5c1b7
docs(cip): rbheaderrelay minimal
will-break-it 82caa2c
docs(cip): integrated review for protocol overview, flow, components …
will-break-it 5f10438
docs(cip): update votes and certificates
will-break-it a0096b7
docs(cip): update votes and certificates
will-break-it a1eee84
docs(cip): update votes and certificates
will-break-it 96022be
docs(cip): fix appendix
will-break-it b59225c
docs(cip): fix appendix
will-break-it cf95e50
docs(cip): fix appendix
will-break-it cf80092
docs(cip): fix appendix & cddls
will-break-it 0460e16
docs(cip): fix cddls
will-break-it 1647291
docs(cip): update node behavior with integrated steps description; cl…
will-break-it 8aaf1a9
docs(cip): fix anchor naming
will-break-it 17a0bfe
docs(cip): add eb chain selection paragraph
will-break-it f55ff59
docs(cip): fix paragraph grammar
will-break-it 258cd1f
docs(cip): add Fiat Accompli reference
will-break-it c538935
docs(cip): minor fix
will-break-it 70deb7b
docs(cip): remove state machine svgs
will-break-it 60a9e38
docs(cip): remove mini protocol md doc from PR
will-break-it 96fc648
docs(cip): fix link
will-break-it 5b6fcc8
docs(cip): add reviewers to CIP authors
will-break-it 7c76fff
docs(cip): add 4th rule for inclusion of empty EBs; update EB delta d…
will-break-it d861440
docs(cip): integrate dual mode for protocol
will-break-it dc5b8ad
docs(cip): update protocol flow mode
will-break-it a9ef8df
docs(cip): update protocol flow mode
will-break-it c70e6d2
docs(cip): fix link
will-break-it 2311c54
docs(cip): test svg links
will-break-it ee4e766
docs(cip): add interactive links for svg components to CIP sections
will-break-it 1abdf05
CIP/Rationale & Motivation (#487)
will-break-it 7fe3f54
docs(cip): add table of figures/ tables
will-break-it c68d9a6
docs(cip): rename modes
will-break-it c86a397
docs(cip): clarify corrections with reference
will-break-it cfd0418
docs(cip): update mode transition descriptions
will-break-it c4e47c5
docs(cip): update note
will-break-it dad02e9
docs(cip): update acronyms
will-break-it 26e5e06
docs(cip): fix hashes to transaction ids
will-break-it 4a92d3e
docs(cip): update protocol parameters table to include L_recover
will-break-it 1bac91a
docs(cip): update legends for protocol flow
will-break-it 27bca0b
docs(cip): clarify corrections
will-break-it 4b53bcf
Linear Leios simulation text and figures for CIP (#490)
bwbush 3513fcd
docs(cip): add bitmap size constraints
will-break-it 94a5423
docs(cip): add bitmap size constraints
will-break-it ea248ce
docs(cip): remove preprod min tx size since we mainnet
will-break-it 75855e9
docs(cip): add bitmap size constraints (#494)
will-break-it 18dde0e
docs(cip): reference mainnet min tx
will-break-it 61f698e
docs(cip): merged corrections PR
will-break-it c4c04e6
docs(cip): fix mainnet min tx size reference
will-break-it 63a77ca
doc(cip): update figures for L_recover specification approach
will-break-it e84c8e0
docs(cip): refactor specification for L_recover
will-break-it 8034766
docs(cip): update figures
will-break-it 9e59ae8
docs(cip): add EB availability limitations
will-break-it ec3ae79
Cip/l recover (#496)
will-break-it 98f10d6
docs(cip): trim to two key factors
will-break-it d5be1fb
docs(cip): fix formula in subcaption
will-break-it ff5aa72
docs(cip): fix pp section
will-break-it 0bd85df
docs(cip): fix pp section
will-break-it 0800fb9
docs(cip): integrate Nicks feedback on node behavior
will-break-it 1c63a75
docs(cip): draft incentives
will-break-it dbcb255
docs(cip): fix section headline
will-break-it abeaeae
docs(cip): add node behavior sequence svg
will-break-it 2fc40df
docs(cip): update node behavior sequence svg
will-break-it 6159f3c
docs(cip): integrate Brians review
will-break-it db92c1a
docs(cip): replace unprecise wording
will-break-it 7c80c45
docs(cip): assume worst case sortition for max sized bitmap corrections
will-break-it 5b0f76e
docs(cip): updates from PR feedback by Simon & Yves
will-break-it 0ce7cd1
docs(cip): add Simon as co-author
will-break-it b370e44
docs(cip): fix wording
will-break-it 0718c82
docs(cip): add auto format workflow; minor changes
will-break-it 8bd847a
docs(cip): update formatting workflow & be precise about bitmap inclu…
will-break-it 36d2c16
docs(cip): clarify certificate creation
will-break-it fdfb519
docs(cip): define equivocation
will-break-it 36e5c98
docs(cip): wording
will-break-it 54124b2
docs(cip): format & workflow
will-break-it 6567dab
docs(cip): workflow fix
will-break-it 24da411
docs(cip): workflow fix; move equivocation definition
will-break-it 6c212c3
Auto-format CIP [skip ci]
actions-user 00fc10d
docs(cip): link equivocation definition
will-break-it ff7e3fb
docs(cip): improve label for detailed figure
will-break-it 5ce59d0
docs(cip): fix rationale conflict res
will-break-it a01b753
Remove accidentally committed partial-eb-certification-proposal.md
will-break-it 62374c2
Fix vote eligibility determination and disable auto-formatting
will-break-it 72a75df
Partial revert: Keep vote eligibility fixes, restore auto-formatting
will-break-it 1eb7687
docs(cip): format
will-break-it 91697b8
docs(cip): update/ simplify format workflow
will-break-it 2791f50
scripts: format CIP script
will-break-it 74468c1
docs(cip): update formatting & generated TOC to include abstract
will-break-it b2ff78b
docs(format): convert appendix headlines into links
will-break-it 0eac20b
Auto-format CIP: TOC, figures/tables, and markdown formatting [skip ci]
actions-user eef8a08
docs(format): convert appendix headlines into links
will-break-it ae35f1e
Auto-format CIP: TOC, figures/tables, and markdown formatting [skip ci]
actions-user 75d7480
docs(cip): integrate Girgos feedback
will-break-it 4f61059
Recomputed operating costs for CIP (#499)
bwbush 169bfe6
Updated figures based on sim-rs-0.1.0.0 (#501)
bwbush eca73ed
docs(cip): integrate Girgos feedback
will-break-it 4f73ebf
docs(cip): integrate Girgos feedback
will-break-it 78909fa
docs(cip): update protocol flow figures overview and detail
will-break-it 7f42ff3
docs(cip): update incentives
will-break-it ddc558e
docs(cip): reduce number of votes for uncertified EBs
will-break-it ed3f28f
docs(cip): remove paragraph
will-break-it 328304c
docs(cip): fix EB reference
will-break-it fb9f8d0
docs(cip): update authors
will-break-it efee9a0
docs(cip): add EB plutus pps; fix network charactersitics table
will-break-it 2c7a3dc
Auto-format CIP: TOC, figures/tables, and markdown formatting [skip ci]
actions-user b016fd1
docs(cip): add EB plutus pps; fix network charactersitics table; fix …
will-break-it 5c113db
docs(cip): fix voting conditions
will-break-it 36f4e33
docs(cip): add design rationales for parameters
will-break-it 1ebdd9a
docs(cip): add 3Δ_hdr to figure
will-break-it 8185a9d
docs(cip): update figure
will-break-it df8ae99
docs(cip): add 3Δ_hdr to detailed figure
will-break-it 6186c27
docs(cip): update overview figure
will-break-it d85ac7b
docs(cip): improve condition order for when to vote
will-break-it 45b2590
docs(cip): improve condition order for when to vote
will-break-it 013cf17
docs(cip): remove warnings; update header diffusion pp value
will-break-it 09d2071
Auto-format CIP: TOC, figures/tables, and markdown formatting [skip ci]
actions-user 02e6376
docs(cip): add draft for roadmap
will-break-it 44f340d
docs(cip): clean up; formatting
will-break-it 7d040f2
docs(cip): paragraph update for rationale
will-break-it 53db621
Auto-format CIP: TOC, figures/tables, and markdown formatting [skip ci]
actions-user 13916c2
docs(cip): update formatting script to preserve TOC format
will-break-it 88a8614
docs(cip): improve voting conditions
will-break-it 8468c16
Auto-format CIP: TOC, figures/tables, and markdown formatting [skip ci]
actions-user 7a3c36d
docs(cip): improve validation mode description
will-break-it 1f231aa
docs(cip): fix arrow in figure
will-break-it 8c268e5
docs(cip): add mempool design - reuse validation work
will-break-it a52a10e
Auto-format CIP: TOC, figures/tables, and markdown formatting [skip ci]
actions-user b398603
CIP: Path to active (#507)
ch1bo 7c0c0c7
Draft more detailed Network section (#513)
nfrisby ed6a562
CIP: Alternatives & Extensions (#512)
ch1bo a225308
docs(cip): add draft trade-offs and limitations section
will-break-it b7366bb
docs(cip): update figure
will-break-it 34c4fa7
CIP (v2) Draft (#514)
will-break-it 34881bc
cip: typo
will-break-it cf4ad6a
cip: fix formula
will-break-it db05299
Auto-format CIP: TOC, figures/tables, and markdown formatting [skip ci]
actions-user 21edc75
cip: fix formula
will-break-it d579013
cip: remove invalid mini protocol mention
will-break-it ab57668
Auto-format CIP: TOC, figures/tables, and markdown formatting [skip ci]
actions-user c0aec1c
cip: add missing Delta QSD links
will-break-it 32537e9
Auto-format CIP: TOC, figures/tables, and markdown formatting [skip ci]
actions-user 84b7931
Updated CIP figures and text with latest simulation results (#517)
bwbush 4182faf
docs(cip): integrate Nicks feedback
will-break-it 3fb9457
docs(cip): format
will-break-it b9e50da
docs(cip): add delta_tx_wc to figure
will-break-it 4ce3b49
docs(cip): uppercase CPU
will-break-it 4ff0fb3
docs(cip): format figure
will-break-it bd29fc6
docs(cip): fix broken link
will-break-it 42910f6
Update docs/cip/README.md
will-break-it 800759e
docs(cip): integrate feedback
will-break-it b7740ca
docs(cip): integrate feedback
will-break-it 0d59694
docs(cip): format
will-break-it 2cf50c9
docs(cip): format
will-break-it c6d7d93
docs(cip): format month metric
will-break-it 1fee202
Auto-format CIP: TOC, figures/tables, and markdown formatting [skip ci]
actions-user 77ea2e2
docs(cip): fix pp table
will-break-it 17b1efc
docs(cip): format
will-break-it ec2e775
docs(cip): rephrased phases/ protocol flow
will-break-it a031c23
docs(cip): add legend
will-break-it 7374e06
Converted footnotes to links (#520)
bwbush d0efe96
docs(cip): update length for L_diff figure
will-break-it dbe1d0a
Update docs/cip/README.md
will-break-it d08e5ed
Auto-format CIP: TOC, figures/tables, and markdown formatting [skip ci]
actions-user 5c5f695
docs(cip): add reference for economic breakeven source
will-break-it 81207ab
docs(cip): improve description of use of idle time between RBs
will-break-it 228bca8
CIP Security Argument (#521)
will-break-it 65862a7
Update docs/cip/README.md
will-break-it a70afee
cip: Minor edits in the Network section (#518)
nfrisby 796c652
docs(cip): clarify what forks to keep around
will-break-it 316a569
docs(cip): rephase network to be less undermining
will-break-it 72a597c
docs(cip): format fixes
will-break-it 8921dc3
docs(cip): format
will-break-it 019c617
docs(cip): update security argument
will-break-it 3d49a91
docs(cip): phase removal
will-break-it c427765
Auto-format CIP: TOC, figures/tables, and markdown formatting [skip ci]
actions-user ed9e00c
docs(cip): reduce colorfulness figure 4
will-break-it 2955c3a
docs(cip): replace honest/ adversarial with optimistic/ worst-case
will-break-it 4352312
docs(cip): integrate feedback
will-break-it 15140e0
docs(cip): integrate feedback
will-break-it 475c6ab
docs(cip): update step 3
will-break-it a2e3988
docs(cip): fix typos in Network
nfrisby 59c4f93
docs(cip): more explicit motivation for compact addressing of txs in EBs
nfrisby 23b6c1b
docs(cip): add line about reuse in Network
nfrisby c1c7d3d
docs(cip): update stale heading and first paragraph
nfrisby 1fae5d2
docs(cip): distinguish the two mini-protocol messages to request blocks
nfrisby da1c380
docs(cip): integrate feedback
will-break-it e7a30b2
docs(cip): integrate feedback
will-break-it f0b5116
docs(cip): integrate feedback
will-break-it 5611844
docs(cip): integrate feedback
will-break-it 1e5b821
docs(cip): integrate feedback
will-break-it 714f0bd
Auto-format CIP: TOC, figures/tables, and markdown formatting [skip ci]
actions-user 076fd2c
docs(cip): add sentence about other Leios mini-protocols being plausible
nfrisby 0966452
Auto-format CIP: TOC, figures/tables, and markdown formatting [skip ci]
actions-user b95fc32
docs(cip): add references to cddls
will-break-it 4adf102
Auto-format CIP: TOC, figures/tables, and markdown formatting [skip ci]
actions-user 667e5a1
docs(cip): motivate the certified_eb bit
nfrisby 6e9942e
Auto-format CIP: TOC, figures/tables, and markdown formatting [skip ci]
actions-user 017eeef
Reduce incentives to not propose any change
ch1bo 0804dfc
docs(cip): replace L_equi with 3L_hdr
will-break-it 1973994
docs(cip): replace L_equi with 3L_hdr
will-break-it e3f25c7
docs(cip): format
will-break-it 3a57b3f
docs(cip): simplify step 5
will-break-it 5629b5e
docs(cip): clarify announced_eb_size cannot invalidate an RB
nfrisby e3a0f11
docs(cip): clarify that votes/certs must be for RB headers rather tha…
nfrisby 00b141a
Auto-format CIP: TOC, figures/tables, and markdown formatting [skip ci]
actions-user 690421d
Update docs/cip/README.md
will-break-it cb5e451
Auto-format CIP: TOC, figures/tables, and markdown formatting [skip ci]
actions-user 9282792
docs(cip): remove paragraph
will-break-it 7698d27
docs(cip): shorten pp header
will-break-it 0e50521
docs(cip): format
will-break-it 734a2a1
docs(cip): requested changes
will-break-it d361bc1
docs(cip): requested changes - clarify equivocation delay
will-break-it a8d916f
docs(cip): requested changes
will-break-it 4abaae7
Auto-format CIP: TOC, figures/tables, and markdown formatting [skip ci]
actions-user f1be2c4
docs(cip): requested changes
will-break-it 0547c9b
docs(cip): remove redundant paragraph
will-break-it e296f89
Auto-format CIP: TOC, figures/tables, and markdown formatting [skip ci]
actions-user 84cb568
docs(cip): requested changes
will-break-it f9f9f61
docs(cip): requested changes
will-break-it 930f5f3
docs(cip): requested changes
will-break-it f2692bc
docs(cip): requested changes
will-break-it 739b781
docs(cip): requested changes
will-break-it 84d5d5b
docs(cip): requested changes
will-break-it 26bb573
docs(cip): requested changes
will-break-it de9dcef
docs(cip): requested changes
will-break-it bab20b0
docs(cip): requested changes
will-break-it 7e4b884
docs(cip): requested changes
will-break-it 85c54cc
docs(cip): requested changes
will-break-it e037887
docs(cip): requested changes
will-break-it 5f9b438
Auto-format CIP: TOC, figures/tables, and markdown formatting [skip ci]
actions-user d386966
docs(cip): more careful OCIN claims
nfrisby 9e70893
Auto-format CIP: TOC, figures/tables, and markdown formatting [skip ci]
actions-user 552c83b
docs(cip): requested changes
will-break-it 6398aa9
docs(cip): requested changes
will-break-it f8dc792
docs(cip): requested changes
will-break-it 75b4344
docs(cip): requested changes
will-break-it b511baf
docs(cip): requested changes
will-break-it d5a9943
docs(cip): requested changes
will-break-it a08acb2
Removed misplaced obselete paragraph about txs in RBs (#524)
bwbush d8b6d5a
docs(cip): relocate OCIN discussion
nfrisby d2c8837
Auto-format CIP: TOC, figures/tables, and markdown formatting [skip ci]
actions-user cbce7ed
docs(cip): change status
will-break-it 45950a3
Drop opening note in path to active
ch1bo 9a54266
Auto-format CIP: TOC, figures/tables, and markdown formatting [skip ci]
actions-user File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
# Endorser Blocks - Leios CDDL | ||
|
||
Endorser Blocks (EBs) are new block types in Leios that aggregate multiple Input Blocks from the current pipeline. | ||
|
||
## Endorser Block Sortition | ||
|
||
**Single EB Limit**: Each producer can generate **at most one Endorser Block per pipeline**, following the crypto-benchmarks implementation approach rather than the full Poisson sortition used in simulations. | ||
|
||
**VRF Lottery**: Eligibility uses the simplified probability model: | ||
|
||
$$P = 1 - e^{-f_{EB} \cdot \sigma}$$ | ||
|
||
Where $f_{EB}$ is the per-pipeline EB generation rate and $\sigma$ is the producer's stake fraction. | ||
|
||
> [!Important] | ||
> **Precision Requirements**: This computation MUST be performed using machine precision-independent arithmetic to ensure deterministic results across all implementations. The exponential function SHALL be computed using rational arithmetic (e.g., `num_rational::Ratio<BigInt>`) with a Taylor series expansion to a predefined precision (minimum 34 decimal places as implemented in crypto-benchmarks). This prevents floating-point precision variations between different hardware architectures and ensures consensus consistency. | ||
|
||
Sources: [Crypto-benchmarks Sortition](https://github.com/input-output-hk/ouroboros-leios/blob/main/crypto-benchmarks.rs/Specification.md#L63-L65), [Rust Simulation EB Generation](https://github.com/input-output-hk/ouroboros-leios/blob/main/sim-rs/sim-core/src/sim/node.rs#L606-L641), [Rational Arithmetic Implementation](https://github.com/input-output-hk/ouroboros-leios/blob/main/crypto-benchmarks.rs/src/sortition.rs#L1-L25), [Technical Report - Deterministic Computation](https://github.com/input-output-hk/ouroboros-leios/blob/main/docs/technical-report-1.md?plain=1#L510-L513) | ||
|
||
## Block Structure | ||
|
||
```diff | ||
+ endorser_block = | ||
+ [ eb_header : eb_header | ||
+ , eb_body : eb_body | ||
+ ] | ||
``` | ||
|
||
## Header Structure | ||
|
||
```diff | ||
+ eb_header = | ||
+ [ eb_header_body : eb_header_body | ||
+ , body_signature : kes_signature | ||
+ ] | ||
+ | ||
+ eb_header_body = | ||
+ [ slot : slot_no ; Slot when EB was created | ||
+ , producer : pool_id ; Block producer identifier | ||
+ , ? vrf_proof : vrf_cert ; VRF proof of eligibility to produce EB | ||
+ ] | ||
``` | ||
Sources: [Haskell Simulation EndorserBlock](https://github.com/input-output-hk/ouroboros-leios/blob/main/simulation/src/LeiosProtocol/Common.hs#L160-L171), [Rust Simulation EndorserBlock](https://github.com/input-output-hk/ouroboros-leios/blob/main/sim-rs/sim-core/src/model.rs#L167-L176), [Formal Spec EndorserBlockOSig](https://github.com/input-output-hk/ouroboros-leios-formal-spec/blob/main/formal-spec/Leios/Blocks.agda#L97-L106) | ||
|
||
## Body Structure | ||
|
||
**Design Rationale**: The block references are separated into the body to align with the network protocol design. At high TPS, the combined size of IB and EB references could exceed TCP MTU, making separate header/body transmission essential for efficient network diffusion. | ||
|
||
```diff | ||
+ eb_body = | ||
+ [ input_blocks : [* ib_reference] ; References to input blocks | ||
+ , ? endorser_blocks : [* eb_reference] ; References to earlier endorser blocks (Full Leios) | ||
+ ] | ||
``` | ||
Sources: [Network Specification - Relay Protocol](https://github.com/input-output-hk/ouroboros-leios/blob/main/docs/technical-report-2.md#relay-mini-protocol), [Network Specification - Fetch Protocol](https://github.com/input-output-hk/ouroboros-leios/blob/main/docs/technical-report-2.md#fetch-mini-protocol) | ||
|
||
## Input Block Reference Structure | ||
|
||
```diff | ||
+ ; References to input blocks within endorser blocks | ||
+ ib_reference = hash32 ; Hash identifier of the input block | ||
``` | ||
|
||
**Design Rationale**: IB references contain only the hash identifier, following the principle that references should include only what's needed for unique identification. Producer and slot information can be obtained by fetching the block header when needed. This aligns with the formal specification's `IBRef = Hash` approach. | ||
|
||
Sources: [Haskell Simulation - InputBlockId](https://github.com/input-output-hk/ouroboros-leios/blob/main/simulation/src/LeiosProtocol/Common.hs#L100-L105), [Rust Simulation - InputBlockId](https://github.com/input-output-hk/ouroboros-leios/blob/main/sim-rs/sim-core/src/model.rs#L98-L105), [Formal Spec - IBRef](https://github.com/input-output-hk/ouroboros-leios-formal-spec/blob/main/formal-spec/Leios/Blocks.agda#L33), [Formal Spec - ibRefs](https://github.com/input-output-hk/ouroboros-leios-formal-spec/blob/main/formal-spec/Leios/Blocks.agda#L101) | ||
|
||
## Endorser Block Reference Structure | ||
|
||
```diff | ||
+ ; References to earlier endorser blocks (for Full Leios) | ||
+ eb_reference = hash32 ; Hash identifier of the endorser block | ||
``` | ||
Sources: [Haskell Simulation](https://github.com/input-output-hk/ouroboros-leios/blob/main/simulation/src/LeiosProtocol/Common.hs#L161-L163), [Rust Simulation](https://github.com/input-output-hk/ouroboros-leios/blob/main/sim-rs/sim-core/src/model.rs#L148-L152), [Formal Spec](https://github.com/input-output-hk/ouroboros-leios-formal-spec/blob/main/formal-spec/Leios/Blocks.agda#L34) | ||
|
||
## Supporting Types | ||
|
||
```diff | ||
+ pool_id = bytes .size 28 ; Stake pool identifier (28 bytes) | ||
+ slot_no = uint64 ; Slot number | ||
+ hash32 = bytes .size 32 ; 32-byte hash | ||
+ vrf_cert = bytes ; VRF certificate/proof | ||
+ kes_signature = bytes ; KES signature | ||
``` | ||
|
||
## Next | ||
**→ [Input Block - CDDL](input-blocks.md)** |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# Input Blocks - Leios CDDL | ||
|
||
**Single IB Limit**: Each producer can generate **at most one Input Block per slot**, following the crypto-benchmarks implementation approach rather than the full Poisson sortition used in simulations. | ||
|
||
**VRF Lottery**: Eligibility uses the simplified probability model: | ||
|
||
$$P = 1 - e^{-f_{IB} \cdot \sigma}$$ | ||
|
||
Where $f_{IB}$ is the per-slot IB generation rate and $\sigma$ is the producer's stake fraction. | ||
|
||
Sources: [Crypto-benchmarks Sortition](https://github.com/input-output-hk/ouroboros-leios/blob/main/crypto-benchmarks.rs/Specification.md?plain=1#L64), [Rust Simulation IB Generation](https://github.com/input-output-hk/ouroboros-leios/blob/main/sim-rs/sim-core/src/sim/node.rs#L561-L597) | ||
|
||
## Block Structure | ||
|
||
```diff | ||
+ input_block = | ||
+ [ ib_header : ib_header | ||
+ , transaction_bodies : [* transaction_body] | ||
+ , transaction_witness_sets : [* transaction_witness_set] | ||
+ , auxiliary_data_set : {* transaction_index => auxiliary_data} | ||
+ , invalid_transactions : [* transaction_index] | ||
+ ] | ||
``` | ||
Sources: [Formal Spec](https://github.com/input-output-hk/ouroboros-leios-formal-spec/blob/main/formal-spec/Leios/Blocks.agda#L40-L57), [Haskell Simulation](https://github.com/input-output-hk/ouroboros-leios/blob/main/simulation/src/LeiosProtocol/Common.hs#L138-L142), [Rust Simulation](https://github.com/input-output-hk/ouroboros-leios/blob/main/sim-rs/sim-core/src/model.rs#L136-L141) | ||
|
||
## Header Structure | ||
|
||
```diff | ||
+ ib_header = | ||
+ [ ib_header_body : ib_header_body | ||
+ , body_signature : kes_signature | ||
+ ] | ||
+ | ||
+ ib_header_body = | ||
+ [ slot : slot_no ; Slot when IB was created | ||
+ , producer_id : pool_id ; Block producer identifier | ||
+ , vrf_proof : vrf_cert ; VRF proof of eligibility to produce IB | ||
+ , ranking_block_ref : hash32 ; Reference to ranking block for ledger state | ||
+ ] | ||
``` | ||
Sources: [Formal Spec](https://github.com/input-output-hk/ouroboros-leios-formal-spec/blob/main/formal-spec/Leios/Blocks.agda#L40-L45), [Haskell Simulation](https://github.com/input-output-hk/ouroboros-leios/blob/main/simulation/src/LeiosProtocol/Common.hs#L114-L124), [Rust Simulation](https://github.com/input-output-hk/ouroboros-leios/blob/main/sim-rs/sim-core/src/model.rs#L127-L133) | ||
|
||
## Supporting Types | ||
|
||
```diff | ||
+ ; Block identifiers | ||
+ ib_id = hash32 ; Input block identifier (hash) | ||
+ | ||
+ ; Basic types | ||
+ pool_id = bytes ; Pool/producer identifier | ||
+ slot_no = uint64 ; Slot number | ||
+ hash32 = bytes .size 32 ; 32-byte hash | ||
+ vrf_cert = bytes ; VRF certificate/proof | ||
+ kes_signature = bytes ; KES signature | ||
``` |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Ranking Blocks - Leios CDDL | ||
|
||
Ranking Blocks (RBs) are extended Praos blocks that include optional Leios certificates. | ||
|
||
## Block Structure - (Conway) Extension | ||
|
||
```diff | ||
ranking_block = | ||
[ header : block_header | ||
, transaction_bodies : [* transaction_body] | ||
, transaction_witness_sets : [* transaction_witness_set] | ||
, auxiliary_data_set : {* transaction_index => auxiliary_data} | ||
, invalid_transactions : [* transaction_index] | ||
+ , ? leios_cert : leios_certificate | ||
] | ||
``` | ||
Sources: [Conway Base](https://github.com/IntersectMBO/cardano-ledger/blob/master/eras/conway/impl/cddl-files/conway.cddl#L8-L14), [Leios Base](https://github.com/input-output-hk/ouroboros-leios-formal-spec/blob/main/formal-spec/Leios/Base.agda#L21-L22) | ||
|
||
## Next | ||
**→ [Votes and Certificates - CDDL](votes-certificates.md)** |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
# Votes and Certificates - Leios CDDL | ||
|
||
Leios introduces a new BLS-based voting system with certificates for endorser block validation. | ||
|
||
## Certificate Structure | ||
|
||
Leios certificates are embedded in Ranking Blocks as described in [Ranking Block - CDDL](ranking-blocks.md). These certificates attest to the validity of Endorser Blocks as described in [Endorser Block - CDDL](endorser-blocks.md). Here is the complete certificate structure: | ||
|
||
```cddl | ||
; Complete Leios certificate structure (from crypto-benchmarks implementation) | ||
leios_certificate = | ||
[ election_id : election_id ; 8-byte election identifier (EID) | ||
, endorser_block_hash : hash32 ; Hash of the endorsed block (EB) | ||
, persistent_voters : [* persistent_voter_id] ; Set of persistent voter IDs | ||
, nonpersistent_voters : {* pool_id => bls_signature} ; Non-persistent voters with eligibility proofs | ||
, ? aggregate_elig_sig : bls_signature ; Aggregate eligibility signature (present when non-persistent voters exist) | ||
, aggregate_vote_sig : bls_signature ; Aggregate BLS signature on (election_id || endorser_block_hash) | ||
] | ||
``` | ||
Sources: [Certificate Reference Implementation](https://github.com/input-output-hk/ouroboros-leios/blob/main/crypto-benchmarks.rs/src/cert.rs#L13-L21), [Certificate Abstract Interface](https://github.com/input-output-hk/ouroboros-leios-formal-spec/blob/main/formal-spec/Leios/Base.agda#L24-L28) | ||
|
||
## Vote Structure | ||
|
||
The Leios voting system supports two types of voters: persistent voters (selected per epoch) and non-persistent voters (selected per election via local sortition). | ||
|
||
> [!Note] | ||
> Individual votes are ephemeral data structures used during the voting process. They are aggregated into certificates and do not appear on the ledger or persistent storage. Only the resulting certificates are stored permanently. | ||
|
||
```cddl | ||
; Vote bundle containing votes for multiple endorser blocks from same voter | ||
leios_vote_bundle = persistent_vote_bundle / non_persistent_vote_bundle | ||
|
||
persistent_vote_bundle = | ||
[ 0 ; Vote type identifier for persistent voter | ||
, election_id ; 8-byte election identifier | ||
, persistent_voter_id ; 2-byte epoch-specific pool identifier | ||
, vote_entries ; Map of endorser blocks to signatures | ||
] | ||
|
||
non_persistent_vote_bundle = | ||
[ 1 ; Vote type identifier for non-persistent voter | ||
, election_id ; 8-byte election identifier | ||
, pool_id ; 28-byte pool identifier | ||
, eligibility_signature ; 48-byte BLS signature proving eligibility | ||
, vote_entries ; Map of endorser blocks to signatures | ||
] | ||
|
||
vote_entries = {* endorser_block_hash => vote_signature} | ||
``` | ||
Sources: [Vote Reference Implementation](https://github.com/input-output-hk/ouroboros-leios/blob/main/crypto-benchmarks.rs/src/vote.rs#L13-L27), [Formal Specification - Vote Abstract Interface](https://github.com/input-output-hk/ouroboros-leios-formal-spec/blob/main/formal-spec/Leios/Abstract.agda#L24-L27), [Haskell Bundle Usage](https://github.com/input-output-hk/ouroboros-leios/blob/main/simulation/src/LeiosProtocol/Short.hs#L231-L234), [Rust Vote Bundle](https://github.com/input-output-hk/ouroboros-leios/blob/main/sim-rs/sim-core/src/model.rs#L208-L212) | ||
|
||
## BLS Key Registration | ||
|
||
For pools to participate in Leios voting, they must register BLS keys in their operational certificates: | ||
|
||
```diff | ||
operational_cert = | ||
[ hot_vkey : kes_vkey | ||
, sequence_number : uint .size 8 | ||
, kes_period : uint | ||
, sigma : signature | ||
+ , ? bls_key_reg : bls_key_registration | ||
] | ||
``` | ||
Sources: [Conway Base](https://github.com/IntersectMBO/cardano-ledger/blob/master/eras/conway/impl/cddl-files/conway.cddl#L114-L119) | ||
|
||
```cddl | ||
; BLS key registration for voting (included in operational certificates) | ||
bls_key_registration = | ||
[ pool_id : pool_id ; Pool identifier (28 bytes) | ||
, bls_public_key : bls_vkey ; BLS12-381 G2 public key (96 bytes) | ||
, proof_of_possession : bls_proof_of_possession ; Proof of secret key possession (96 bytes) | ||
, kes_signature : kes_signature ; KES signature over the registration (448 bytes) | ||
] | ||
|
||
; Total size: 28 + 96 + 96 + 448 = 668 bytes | ||
``` | ||
Sources: [Registration Struct](https://github.com/input-output-hk/ouroboros-leios/blob/main/crypto-benchmarks.rs/src/key.rs#L156-L162), [Proof Generation](https://github.com/input-output-hk/ouroboros-leios/blob/main/crypto-benchmarks.rs/src/bls_vote.rs#L19-L23) | ||
|
||
## Cryptographic Types | ||
|
||
```cddl | ||
; Core BLS cryptographic primitives | ||
bls_signature = bytes .size 48 ; BLS12-381 G1 signature (compressed) | ||
bls_vkey = bytes .size 96 ; BLS12-381 G2 public key (compressed) | ||
bls_proof_of_possession = | ||
[ mu1 : bls_signature ; Signature on public key | ||
, mu2 : bls_signature ; Signature on empty message | ||
] | ||
|
||
; Leios-specific identifiers | ||
election_id = bytes .size 8 ; Slot-based election identifier | ||
persistent_voter_id = uint .size 2 ; Epoch-specific voter identifier (0-65535) | ||
pool_id = bytes .size 28 ; Stake pool identifier | ||
endorser_block_hash = bytes .size 32 ; Hash of endorser block | ||
|
||
; Additional Cardano types used | ||
kes_signature = bytes .size 448 ; KES signature | ||
hash32 = bytes .size 32 ; 32-byte hash (used for endorser_block_hash) | ||
``` | ||
Sources: [Sig](https://github.com/input-output-hk/ouroboros-leios/blob/main/crypto-benchmarks.rs/src/key.rs#L100), [PubKey](https://github.com/input-output-hk/ouroboros-leios/blob/main/crypto-benchmarks.rs/src/key.rs#L62), [PoP](https://github.com/input-output-hk/ouroboros-leios/blob/main/crypto-benchmarks.rs/src/key.rs#L139-L143), [Eid](https://github.com/input-output-hk/ouroboros-leios/blob/main/crypto-benchmarks.rs/src/primitive.rs#L76), [PersistentId](https://github.com/input-output-hk/ouroboros-leios/blob/main/crypto-benchmarks.rs/src/registry.rs#L14), [PoolKeyhash](https://github.com/input-output-hk/ouroboros-leios/blob/main/crypto-benchmarks.rs/src/primitive.rs#L14), [EbHash](https://github.com/input-output-hk/ouroboros-leios/blob/main/crypto-benchmarks.rs/src/primitive.rs#L117), [KesSig](https://github.com/input-output-hk/ouroboros-leios/blob/main/crypto-benchmarks.rs/src/primitive.rs#L170) | ||
|
||
|
||
|
||
## Next | ||
**→ [Endorser Block - CDDL](endorser-blocks.md)** |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Endorser Blocks - Eb-Only Leios | ||
|
||
This file specifies the CDDL modifications for Endorser Blocks in Stracciatella Leios, which contain transaction references directly instead of introducing input blocks (IBs). | ||
|
||
## EB Extensions | ||
|
||
Stracciatella Leios extends the common endorser block structure from [Common Endorser Blocks](../common/endorser-blocks.md): | ||
|
||
```diff | ||
eb_body = | ||
[ | ||
- input_blocks : [* ib_reference] ; References to input blocks | ||
, ? endorser_blocks : [* eb_reference] ; References to earlier endorser blocks (Full Leios) | ||
+ , transaction_references: [* tx_reference] ; Transaction references instead of full transactions | ||
] | ||
``` | ||
|
||
## Transaction Reference Structure | ||
|
||
```cddl | ||
tx_reference = bytes .size 32, ; Transaction ID (hash) | ||
``` |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Full Sharding - Leios | ||
|
||
This directory contains CDDL specifications for the **full sharding** approach to Leios ledger design. | ||
|
||
## Sharding Approaches | ||
|
||
The full sharding design provides two complementary mechanisms that **prevent transaction conflicts and duplicates** by ensuring potentially conflicting transactions are processed sequentially within the same shard rather than concurrently across different shards: | ||
|
||
### 1. UTxO Sharding ([Spec](./utxo.md)) | ||
|
||
- **Mechanism**: Explicit `shard_label` field in transaction outputs matches implicit IB `shard` derived by its VRF proof | ||
- **Shard Assignment**: IB shard derived from VRF proof: | ||
|
||
$$\text{shardId} = \text{vrf\_value} \bmod \text{totalShards}$$ | ||
- **Network Overhead**: +2 bytes per labeled output | ||
|
||
### 2. Reward Account Sharding ([Spec](./reward-account.md)) | ||
|
||
- **Mechanism**: Implicit shard assignment where transactions using reward accounts for collateral/withdrawals must match the IB's shard | ||
- **Shard Assignment**: Reward account shard derived from hash function: | ||
|
||
$$\text{shardId} = \text{hash}(\text{rewardAccount}) \bmod \text{totalShards}$$ | ||
- **Network Overhead**: 0 bytes (computed on-demand) | ||
|
||
## Sharding Benefits | ||
|
||
Both mechanisms contribute to the broader sharding strategy that: | ||
- **Prevents conflicts** by processing potentially conflicting transactions sequentially within the same shard | ||
- **Reduces duplicates** through per-shard mempool segmentation | ||
|
||
## Comparison | ||
|
||
| Aspect | UTxO Sharding | Reward Account Sharding | | ||
|--------|---------------|------------------------| | ||
| **Explicitness** | Explicit `shard_label` field | Implicit hash-based | | ||
| **Network Overhead** | +2 bytes per output | 0 bytes | | ||
| **Flexibility** | Can choose shard | Deterministic shard | | ||
| **Bootstrapping** | Requires labeled UTxOs | Immediate availability | | ||
|
||
> [!Note] | ||
> **Design Rationale**: These approaches serve different purposes and can be used together or independently. Reward account sharding enables immediate onboarding while UTxO sharding provides operational control. |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.