Skip to content

[WIP] 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

Draft
wants to merge 191 commits into
base: main
Choose a base branch
from
Draft

[WIP] CIP draft #396

wants to merge 191 commits into from

Conversation

will-break-it
Copy link
Contributor

@will-break-it will-break-it commented Jun 10, 2025

Rendered Version

  • Abstract
  • Motivation
  • Specification
    • Protocol Overview
    • Protocol Components
    • Protocol Flow
    • Leios protocol parameters
    • Specification of votes and certificates
    • Node behavior
    • Network
      • Overview
      • Details [WIP by Nick]
    • Incentives
  • Rationale
    • Why is Leios practical to implement?
    • Evidence
    • Trade-off & Limitations
    • Roadmap/ Next steps
  • Path to active
    • Acceptance criteria
    • Implementation plan
  • Versioning
  • References
  • Appendix [To be extended]

@will-break-it will-break-it changed the title Cip/review [WIP] CIP Jun 10, 2025
Copy link

@rphair rphair left a comment

Choose a reason for hiding this comment

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

thanks @will-break-it for inviting review from the CIP community. I've also read through the rest of the text in the same branch and it looks like it will be well in order for posting as a CIP pull request as soon as the bulk of TODO items are completed.

Comment on lines 81 to 89
**Five-Stage Pipeline**: The protocol operates through a structured five-stage pipeline: (1) **Propose** - IBs generated uniformly, (2) **Deliver 1** - IB diffusion using freshest-first strategy, (3) **Deliver 2** - complete IB delivery, (4) **Endorse** - EBs generated at stage start, (5) **Vote** - voting on EBs and certificate creation. This pipeline approach enables concurrent transaction processing while maintaining deterministic ordering and conflict resolution.

**Input Blocks (IBs)**: Transaction-containing blocks produced at a uniform rate during the "Propose" stage of each [pipeline](#pipeline). IBs are generated by stake pools that win VRF-based [sortition](#sortition), with the protocol utilizing approximately one-third of available network bandwidth for IB traffic. Multiple IBs can be produced concurrently across the network.

**Endorser Blocks (EBs)**: Aggregation blocks that reference multiple IBs from the current pipeline. EBs are produced at the beginning of the "Endorse" stage by selected stake pools. An EB represents a consensus view of which IBs should be included in the permanent ledger, referencing all IBs that were delivered by specific pipeline deadlines.

**Votes and Certificates**: During the "Vote" stage, stake pools [vote](#vote) on EBs if they meet strict criteria: all referenced IBs must be available, all IBs seen by the "Deliver 1" deadline must be referenced, and all referenced IBs must validate. When enough votes are collected (achieving a [quorum](#quorum)), a [certificate](#certificate) is created and included in an RB.

**Ranking Blocks (RBs)**: The main Praos consensus chain blocks that contain at most one certificate per block, attesting to the validity of an EB. RBs anchor the Leios consensus into the established Praos security model and may also contain regular transactions.
Copy link

Choose a reason for hiding this comment

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

Suggested change
**Five-Stage Pipeline**: The protocol operates through a structured five-stage pipeline: (1) **Propose** - IBs generated uniformly, (2) **Deliver 1** - IB diffusion using freshest-first strategy, (3) **Deliver 2** - complete IB delivery, (4) **Endorse** - EBs generated at stage start, (5) **Vote** - voting on EBs and certificate creation. This pipeline approach enables concurrent transaction processing while maintaining deterministic ordering and conflict resolution.
**Input Blocks (IBs)**: Transaction-containing blocks produced at a uniform rate during the "Propose" stage of each [pipeline](#pipeline). IBs are generated by stake pools that win VRF-based [sortition](#sortition), with the protocol utilizing approximately one-third of available network bandwidth for IB traffic. Multiple IBs can be produced concurrently across the network.
**Endorser Blocks (EBs)**: Aggregation blocks that reference multiple IBs from the current pipeline. EBs are produced at the beginning of the "Endorse" stage by selected stake pools. An EB represents a consensus view of which IBs should be included in the permanent ledger, referencing all IBs that were delivered by specific pipeline deadlines.
**Votes and Certificates**: During the "Vote" stage, stake pools [vote](#vote) on EBs if they meet strict criteria: all referenced IBs must be available, all IBs seen by the "Deliver 1" deadline must be referenced, and all referenced IBs must validate. When enough votes are collected (achieving a [quorum](#quorum)), a [certificate](#certificate) is created and included in an RB.
**Ranking Blocks (RBs)**: The main Praos consensus chain blocks that contain at most one certificate per block, attesting to the validity of an EB. RBs anchor the Leios consensus into the established Praos security model and may also contain regular transactions.
##### Five-Stage Pipeline
The protocol operates through a structured five-stage pipeline: (1) **Propose** - IBs generated uniformly, (2) **Deliver 1** - IB diffusion using freshest-first strategy, (3) **Deliver 2** - complete IB delivery, (4) **Endorse** - EBs generated at stage start, (5) **Vote** - voting on EBs and certificate creation. This pipeline approach enables concurrent transaction processing while maintaining deterministic ordering and conflict resolution.
##### Input Blocks (IBs)
Transaction-containing blocks produced at a uniform rate during the "Propose" stage of each [pipeline](#pipeline). IBs are generated by stake pools that win VRF-based [sortition](#sortition), with the protocol utilizing approximately one-third of available network bandwidth for IB traffic. Multiple IBs can be produced concurrently across the network.
##### Endorser Blocks (EBs)
Aggregation blocks that reference multiple IBs from the current pipeline. EBs are produced at the beginning of the "Endorse" stage by selected stake pools. An EB represents a consensus view of which IBs should be included in the permanent ledger, referencing all IBs that were delivered by specific pipeline deadlines.
##### Votes and Certificates
During the "Vote" stage, stake pools [vote](#vote) on EBs if they meet strict criteria: all referenced IBs must be available, all IBs seen by the "Deliver 1" deadline must be referenced, and all referenced IBs must validate. When enough votes are collected (achieving a [quorum](#quorum)), a [certificate](#certificate) is created and included in an RB.
##### Ranking Blocks (RBs)
The main Praos consensus chain blocks that contain at most one certificate per block, attesting to the validity of an EB. RBs anchor the Leios consensus into the established Praos security model and may also contain regular transactions.

The rest of the document currently has no sections for elaboration of these components. Therefore these should have their own headers — rather than inline headings — to make these definitions deep-linkable. I believe making this information accessible is more important than any goal of keeping this information textually dense.

Copy link

@rphair rphair left a comment

Choose a reason for hiding this comment

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

References

Optional

There is such abundant information here for readers at any level — including development & discussion history for so much of this material — that I would editorially support adding a link here from the Abstract to ensure the reader knows early that it's available... rather than having them wait until the final References section.

@ch1bo ch1bo changed the title [WIP] CIP [WIP] CIP specification section Jun 12, 2025
@ch1bo ch1bo force-pushed the cip/review branch 2 times, most recently from 452236a to 737b8ec Compare June 12, 2025 12:16
@ch1bo
Copy link
Member

ch1bo commented Jun 17, 2025

FWIW, I have started to write down more things on this branch and my approval is moot. @will-break-it should we create a new branch / PR for our soon-to-be-more-complete specification section with the phased approach?

will-break-it and others added 14 commits June 26, 2025 10:20
* docs: add collateralized transaction

* docs: fix source links

* docs: shorten notes

* docs(cddl): remove uneeded block body hash

* docs(cddl): remove IB header shard id as it can be derived from the VRF

* docs: headline fix

* docs(cddl): add sharded reward account

* docs(cddl): fix formula

* docs(cddl): add collateral tx field for reward accounts

* docs(cddl): add more context for sharded reward account

* docs(cddl): clarify sharding benefits

* docs(cddl): clarify shard assignment for reward account
Copy link
Contributor

🔧 Auto-formatter applied - Figure captions standardized and links validated.

Copy link
Contributor

🔧 Auto-formatter applied - Figure captions standardized and links validated.

Also includes:
- Fix vote eligibility determination by clarifying election_id uses EB's announcing RB slot
- Disable auto-formatting GitHub Action to prevent unwanted changes
- Clarify that election_id must use EB's announcing RB slot number for deterministic sortition
- Add detailed explanation of vote eligibility requirements for verifiable consensus
- Disable GitHub Actions auto-formatting to prevent unwanted document changes
- Keep critical vote eligibility determination fixes in CIP README
- Restore GitHub Actions auto-formatting workflow
- Remove accidentally added formal-spec symlink
- Restore original VS Code workspace settings
Copy link
Contributor

🔧 Auto-formatter applied - Figure captions standardized and links validated.

Copy link
Contributor

🔧 Auto-formatter applied - Generated TOC, table of figures/tables, removed trailing periods, and formatted markdown with proper line length.

Copy link
Contributor

🔧 Auto-formatter applied - Generated TOC, table of figures/tables, removed trailing periods, and formatted markdown with proper line length.

Copy link
Contributor

@pagio pagio left a comment

Choose a reason for hiding this comment

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

Reviewed up to the parameters section. Will look at the rest later today.

### Non-normative overview of Leios
The protocol's behavior is governed by a **rolling window mechanism** that
tracks certificate inclusion timing. When a committee successfully certifies an
EB, this triggers a rolling window of $L_\text{recover}$ slots during which the
Copy link
Contributor

Choose a reason for hiding this comment

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

may also say here: "and the certificate is included in an RB". Certification on its own is not sufficient to enter Leios mode.

<div align="center">
<a name="figure-4" id="figure-4"></a>
<p name="protocol-flow-figure">
<img src="images/protocol-flow-overview.svg" alt="Leios Protocol Flow">
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe move the L_vote part closer to the EB, to better highlight that the time start when the EB is created.

extended header fields to optionally certify one previously announced EB and
optionally announce one EB for the next subsequent RB to certify.
1. **[Endorser Block (EB)](#endorser-blocks-ebs)** A larger block containing
additional transaction references. There are no other ways to create EBs.
Copy link
Contributor

Choose a reason for hiding this comment

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

There are no other ways to create EBs.
Maybe this is an overkill and should be removed.


##### Key registration
Nodes receiving the RB header discover the announced EB, via its referencing by
Copy link
Contributor

Choose a reason for hiding this comment

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

It is not that clear here if the RB header was received as part of chain dissemination or through a separate mechanism (which should be the case)

Altogether, a key registration occupies $28 + 96 + 2 \times 48 + 448 = 668$ bytes. This registration needs to be recorded on chain so that certificates can be later verified independently. Ideally, the BLS keys would be registered as part of the SPO's *operational certificate*, which is renewed every ninety days.
1. It has received the EB within $L_\text{vote}$ slots from its creation,
2. It has **not** received an equivocated RB header for this EB within
$L_\text{vote}$ slots,
Copy link
Contributor

Choose a reason for hiding this comment

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

3 \Delta_\text{hdr} instead of L_vote here

<div align="center">
<a name="figure-5" id="figure-5"></a>
<p name="mode-transitions-figure">
<img src="images/protocol-flow-detail.svg" alt="Rolling Window Timeline">
Copy link
Contributor

Choose a reason for hiding this comment

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

I would suggest changing EB1 and EB2 to EB2 and EB4 to match the index of the RBs. It is somewhat confusing; EB1 sounds like it is related to RB1.


**Enhanced Throughput** (within window): Block producers are permitted to create
RBs before receiving all previously certified EBs due to network delays. Since
they cannot determine complete ledger state, Leios allows temporary inclusion of
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe say Leios cannot prevent temporary inclusion of unvalidated txs.

Our suggestion is to create empty blocks if you are not up to date, and we may punish inclusion of invalid txs.

certificate-active periods (RB<sub>3</sub> to RB<sub>7</sub> inclusive, marked
with red dashed borders) are permitted to contain such transactions.

**Correction Mechanisms**: To maintain ledger integrity when unvalidated
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe highlight that these mechanisms are solely for the benefit of light nodes. Full nodes can check whether a tx was executed when they catch up.

than $L$<sub>recover</sub> slots after the latest EB certificate, the
`tx_execution_bitmap` field must indicate the execution status of transactions
in RBs produced after that EB certificate was included, up to but not including
this correcting RB. This ensures the ledger state is fully determined before
Copy link
Contributor

Choose a reason for hiding this comment

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

This is only for the benefit of light nodes.

> [!WARNING] **TODO:** Add transaction confirmation levels and their
> implications for applications

Transactions from certified EBs are included in the ledger alongside direct RB
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe say that txs from certified EBs are included before txs directly included in the RB to preserve correctness.

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.

[INN-434] 2025Q3 SRL 5 - Leios CIP full draft
9 participants