Skip to main content

krabka_raft/kraft/
mod.rs

1//! Hand-rolled `KRaft` consensus engine (KIP-595 and KIP-996).
2//!
3//! The engine is a pure, deterministic, sans-IO `on_event` state machine
4//! ([`core`]) over the `QuorumState` and `Role` model. The async
5//! [`controller::KraftController`] drives that state machine over the
6//! [`log::KraftLog`] and the real KIP-595 [`transport`] wire. This is Krabka's
7//! live metadata consensus engine.
8#![allow(dead_code, unused_imports)]
9
10// The pure, deterministic, sans-IO consensus core (the `on_event` state
11// machine, its event/action/role/type model, and the snapshot reassembler)
12// lives in the wasm-friendly leaf crate `krabka-kraft-core`. Re-export its
13// modules here so the async engine, real wire, and on-disk log below keep
14// referencing `crate::kraft::{core, types, event, ...}` unchanged.
15pub use krabka_kraft_core::{action, core, event, role, snapshot_fetch, types};
16
17pub mod controller;
18pub mod log;
19pub mod transport;
20
21pub use {
22    action::Action,
23    controller::{Activation, KraftConfig, KraftController},
24    core::{QuorumStateMachine, QuorumTimeouts},
25    event::Event,
26    log::KraftLog,
27    role::Role,
28    transport::{
29        Command, Inbound, MetadataFetchSlice, NullPeerSender, PeerSender, QuorumStateSnapshot,
30        TimerTick,
31    },
32    types::{Epoch, LogOffsetMetadata, LogView, NodeId, QuorumState, ReplicaKey, SimInstant},
33};