Skip to content

[DO-NOT-MERGE] Leios prototype#1793

Draft
bladyjoker wants to merge 503 commits into
nfrisby/issue-1701-anchorfrom
leios-prototype
Draft

[DO-NOT-MERGE] Leios prototype#1793
bladyjoker wants to merge 503 commits into
nfrisby/issue-1701-anchorfrom
leios-prototype

Conversation

@bladyjoker
Copy link
Copy Markdown
Contributor

This PR hosts changes to ouroboros-consensus related to Leios. I'm opening a PR for easier management and transparency to make changes visible at a glance.

More importantly, this branch will be tagged and sourced for Leios demos.

IT IS NOT INTENDED TO BE REVIEWED OR MERGED!

@bladyjoker bladyjoker self-assigned this Dec 3, 2025
@bladyjoker bladyjoker changed the base branch from main to nfrisby/issue-1701-anchor December 3, 2025 09:49
@ch1bo ch1bo force-pushed the leios-prototype branch 2 times, most recently from a123a84 to a571776 Compare January 21, 2026 13:17
@bladyjoker bladyjoker linked an issue Jan 27, 2026 that may be closed by this pull request
20 tasks
@bladyjoker bladyjoker moved this to 🏗 In progress in Consensus Team Backlog Jan 28, 2026
ch1bo added 20 commits February 10, 2026 10:03
for batched tx updates as first, next step
None of the indices are actually needed (given the current queries).
Stumbled on this when analysing the sql_select_ebTxs_missing
The previous name suggested it was only the connection to the database
that was initialized. With the new notification responsibility, however,
we do want to share the handle instance across threads. This was
consistent already for the in-memory implementation (which must be
shared too for consistent "persistence"). If we want multiple
connections later, we can still create them from the same handle later.
This was seemingly off by one
ch1bo and others added 27 commits May 4, 2026 14:43
This is obviously a dirty hack, but works to drive the development right
now and side-steps key registration, while already exploring how to pass
the voting key into the right consensus components.
This results in votes being forwarded already. However, this is
obviously not safe to do this way in adversarial settings.
This is now possible because of de-duplication of the vote notification mechanism
This is consistent with the naiive N^2 diffusion of votes early sketch
that is implemented.
Drops lenses/folds in favor of list comprehensions
This was raised by a reviewer and re-uses the haskell type we already
have. The encoding, however, is deliberately flat to have small votes.
First PR to add voting capabilities to the `leios-prototype`:

- Naiive N^2 vote diffusion via `LeiosNotify`
- A new `VoteState` that allows to `addVote` and `subscribeVotes`
- A voting thread that votes on completed EB closures
  - Missing: EB too old to vote check
  - Missing: EB validation
- Mocked voting key registration (re-uses KES key bytes)
- No vote validation (yet)
- Threadnet properties that drove the implementation so far
- Fixed re-trigger of EB notifications for already completed closures

Roughly the components that were implemented in this PR:

<img width="2872" height="904" alt="Leios voting (Current)(1)"
src="https://github.com/user-attachments/assets/7e9e032c-d581-4dd1-b30d-9ced05967edc"
/>

**NOTE**: The failing test with seed `(SMGen 15462600834920737326
9156690725779514573,20)` is actually a lucky one that conflates two
`VoterId` from the hacked KES key bytes. It will drive the follow-up PR
that explores commitee selection paths.
This will avoid us needing to change the cardano-node code when we
change message formats of the notify protocol. The abstraction over
'vote' is needed to avoid a cyclic dependency. Moving the toObject
function would have been the alternative, but I followed the existing
pattern.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: 🏗 In progress

Development

Successfully merging this pull request may close these issues.

4 participants