New translations code.json (Spanish)
[ci skip]
[ci skip]
Wire LeiosNotify and LeiosFetch mini-protocols into the node-to-node
diffusion layer, plus the consensus-side adaptation to the network
fork's BearerBytes + arrival-time 'Reception' API.
Mini-protocols (live in consensus, not network)
- LeiosDemoOnlyTestFetch — request/response for EB bodies and the
accompanying tx closures.
- LeiosDemoOnlyTestNotify — server pushes 'MsgLeiosBlockOffer' /
'MsgLeiosBlockTxsOffer' as EBs arrive, plus 'MsgLeiosVotes' which
this chunk handles as a no-op stub (the voting chunk replaces it).
- New 'NodeKernel' fields: 'getLeiosDB', 'getLeiosPeersVars',
'getLeiosOutstanding', 'getLeiosReady'. The 'leiosFetchLogic'
thread (0.5s loop) reads peers' offerings, runs the fetch-decision
iteration and dispatches fetches.
Network wiring
- 'Ouroboros.Consensus.Network.NodeToNode' grows codecs + handlers
for both protocols and threads the LeiosDbConnection through to the
inbound side.
- 'Ouroboros.Consensus.Node' opens the in-memory LeiosDb and passes
the handle + connection to the kernel / NTN / ChainDB layers.
BearerBytes + Reception migration
- All codec entry points drop the 'dataSize :: bytes -> Word'
argument (now a 'BearerBytes' constraint).
- 'recv' returns 'Maybe (Reception a)' carrying per-chunk arrival
times; the threadnet harness wraps reads via 'MkReception
IntMap.empty', the PeerSimulator strips via 'fmap received'.
- 'TraceSendRecv' grows arrival-time on the receive side
('TraceRecvMsg :: Maybe Time -> AnyMessage ps -> ...').
Threadnet harness
- 'MinimalChainDbArgs.mcdbLeiosDbVar' backs the in-memory LeiosDb
with a TVar so the test infrastructure can inspect it.
cabal
- Exposes 'LeiosDemoOnlyTestFetch' / 'LeiosDemoOnlyTestNotify' and
adds network-mux, pretty-simple, typed-protocols:cborg deps.
Co-Authored-By: Claude Opus 4.7 <[email protected]>
The only non-default instance (Dijkstra-era ShelleyBlock) consumes only the Praos chain-dep state from its HeaderState argument, the tip is never used. Taking the full HeaderState forced the HFC dispatch in Cardano.Block to fabricate a HeaderState with 'headerStateTip = Origin' purely to satisfy the record. The original leios-prototype branch worked around the same smell with a partial toConwayHeaderState projection and an 'error "Must be in Conway"' arm. Narrowing the class to only taking the chain-dep state collapses the HFC instance to a single combined case on (chainDepState, block), using the existing ChainDepStateDijkstra pattern synonym. Also, the Dijkstra-era Shelley instance drops the redundant 'headerStateChainDep' projection on its argument.
Adapt the ImmDBServer tool to drive a Leios demo from a pre-recorded schedule: replay EBs / cert-blocks at slot timestamps and serve them over the LeiosNotify / LeiosFetch mini-protocols introduced in the diffusion chunk. The actual schedule generator lives at 'ouroboros-consensus/app/leios-schedule-gen.hs' (committed with the diffusion chunk for cabal layout reasons). - 'immdb-server' grows --leios-db / --leios-schedule / --initial-slot / --initial-time / --address. - 'Cardano.Tools.ImmDBServer.Diffusion' adds the LeiosSchedule type and a scheduler thread that ticks through schedule entries. - 'Cardano.Tools.ImmDBServer.MiniProtocols' grows LeiosNotify / LeiosFetch responders, send/recv tracers, and a slot-delay aware chainSyncServer. Co-Authored-By: Claude Opus 4.7 <[email protected]>
Add the voting capability on top of the diffusion layer: an EB becomes eligible for certification once enough peers have voted 'yes' on it (via the 'MsgLeiosVotes' message on the LeiosNotify protocol from the previous chunk). Voting state - 'LeiosVoteState' (new module) — aggregated vote state across all peers, with 'addVote' / 'subscribeVotes' write/read API. - 'NodeKernel.getLeiosVoteState' field plus the 'NodeKernelArgs.leiosVotingKey' / 'NodeKernel.leiosVoting' background thread that subscribes to local 'AcquiredEbTxs' notifications and emits one vote per acquired EB. LeiosNotify wiring - The 'MsgLeiosVotes' server case now calls 'addVote' on each incoming vote (replacing the chunk-2 no-op stub). - The notify server multiplexes EB offers with a 'processVote' loop that drains 'subscribeVotes leiosVoteState' and publishes 'MsgLeiosVotes' to peers. Tests - 'Test.LeiosVoteState' (foundation-level unit tests). - 'Test.ThreadNet.Leios' — end-to-end threadnet driver that asserts cert blocks happen, no vacuous runs, gap > 'minCertificationGap', all nodes converge, and the post-resolve replay matches the live ledger. cabal - Exposes 'LeiosVoteState'; wires 'Test.LeiosVoteState' / 'Test.ThreadNet.Leios' into the test suites. Co-Authored-By: Claude Opus 4.7 <[email protected]>
Plumb a 'ResolveLeiosBlock' typeclass through the block-application
pipeline so a Dijkstra-era block carrying 'SJust LeiosCert' has its
(empty) tx list spliced in from the EB closure in the LeiosDb before
validation. Plumbing only — no chain-selection rule change.
- 'Storage.LedgerDB.Forker' defines 'ResolveLeiosBlock' as a typeclass
with a no-op default, and the 'applyBlock' hook calls
'resolveLeiosBlock leiosDb hdrSt b' before
'tickThen{Apply,Reapply}'. The forker reads the 'ExtLedgerState' to
extract 'headerState' for the splice (used to look up the previous
EB announcement on the chain-dep state).
- 'Storage.LedgerDB.V2' threads 'LeiosDbConnection' alongside the
existing args so the new 'applyBlock' signature reaches the V2
pipeline.
- Explicit no-op instances for every block type that doesn't carry
Leios: 'ByronBlock', 'DualBlock', 'ShelleyBlock proto era',
'HardForkBlock xs' (OVERLAPPABLE), 'TestBlockWith ptype', the
storage-test 'TestBlock', the mock 'SimpleBlock''.
- Real-work instance: 'ShelleyBlock (Praos c) DijkstraEra' splices the
EB closure from the previously-announced point (looked up via
'praosStateLeiosAnnouncement' + 'praosStateLastSlot' on the Praos
chain-dep state).
- 'Ouroboros.Consensus.Cardano.Block' routes per-era dispatch to the
appropriate instance.
Co-Authored-By: Claude Opus 4.7 <[email protected]>
Mempend a small OuroborosBundle with leiosNotify/leiosFetch on the Hot temperature onto the existing five-protocol bundle in initiator and initiatorAndResponder. Define the matching ingress-queue limits from the demo's LeiosFetchStaticEnv. This matches the upstream leios-prototype pattern - the change is contained to consensus and leaves the network NodeToNodeProtocols record untouched. Co-Authored-By: Claude Opus 4.7 <[email protected]>
This is not only a hack, but even the hack will change in the voting committee prototype work where we derive keys from cold verification key hashes instead of the KES key.
Introduces 'Cardano.Node.Configuration.Leios.LeiosDbConfig' with two
constructors:
- LeiosDbInMemory (matches 'LeiosDbConnection's in-memory backend)
- LeiosDbSQLite !FilePath (SQLite backend, file relative to node CWD)
Wired through 'PartialNodeConfiguration' / 'NodeConfiguration' as
'ncLeiosDbConfig' with JSON parsing ('"LeiosDbConfig":{"Backend":...,
"Filepath":...}') and a default of 'LeiosDbSQLite "leios.db"'.
At node startup ('Cardano.Node.Run.handleSimpleNode'), the configured
backend is materialised into a 'LeiosDbHandle' (via 'newLeiosDBInMemory'
/ 'newLeiosDBSQLite') and passed into 'RunNodeArgs' through a new
'rnLeiosDb :: Maybe (LeiosDbHandle m)' field, which consensus's
'runWith' threads into the Leios kernel's shared connection.
'Nothing' falls back to the in-memory default.
Co-Authored-By: Claude Opus 4.7 <[email protected]>
The consensus Leios chunks added four fields to the consensus tracer records that cardano-node assembles in 'Cardano.Tracing.Tracers' (old style) and 'Cardano.Node.Tracing.Tracers' (new style): - Consensus.Tracers' gained 'leiosKernelTracer' and 'leiosPeerTracer' - NodeToNode.Tracers' gained 'tLeiosNotifyTracer' and 'tLeiosFetchTracer' This commit populates those fields in both 'mkTracers' code paths so the record-construction sites are total. All four are wired to 'nullTracer' for now; the corresponding 'Transformable' / 'MetaTrace' instances and EKG metrics are left as TODO. The new-style tracing system will accordingly emit a 'TracerConsistencyWarnings' for the four Leios namespaces declared in the config.yaml — that surfaces the gap explicitly rather than silently dropping the configuration. Adds the corresponding selectors to 'TraceSelection' / 'PartialTraceSelection' and their JSON parsing: - traceLeiosKernel / Consensus.LeiosKernel - traceLeiosPeer / Consensus.LeiosPeer - traceLeiosNotifyProtocol / LeiosNotify.Remote - traceLeiosFetchProtocol / LeiosFetch.Remote Also drops the duplicate 'LogFormatting (Simple/Stateful.TraceSendRecv)' and 'MetaTrace (Simple/Stateful.TraceSendRecv)' instances that the upstream leios-prototype branch carried in 'Cardano/Node/Tracing/Tracers/NodeToClient.hs' — they are now provided by 'ouroboros-network:framework-tracing' and would collide if redefined here. Co-Authored-By: Claude Opus 4.7 <[email protected]>