Skip to main content

Module consensus

Module consensus 

Source
Expand description

Distributed state & consensus (§28, legal_logic.md) — multi-agent sync.

Human-centric obligations span many person-controlled vaults; no single node holds the complete global state. A multi-party obligation must therefore be suspended until consensus, a norm valid locally does not bind the network until synchronised, and a network partition must not silently break standing obligations (those established before the split survive; new joint obligations pause until healing). Complements the engine’s CRDT (LWW) layer with the deontic transaction semantics. Zero-heap, total predicates.

Enums§

TxStatus
The state of a multi-party obligation/transaction.

Functions§

bft_committed
Has a safe BFT quorum been reached (votes ≥ bft_quorum(n))?
bft_max_faults
The maximum Byzantine faults f a network of n nodes tolerates: f = ⌊(n-1)/3⌋ (BFT safety needs n ≥ 3f+1).
bft_quorum
The BFT quorum size — the supermajority 2f+1 that makes a commit safe despite f Byzantine nodes (PBFT prepare/commit certificate, HotStuff QC).
can_form_joint_during_partition
During a partition, a NEW joint (multi-party) obligation may not be formed — it must wait for the network to heal so all parties can reach consensus.
is_active_validator
Dynamic validator rotation: is validator validator_idx in the active committee for epoch? A window of active_size validators rotates by one position per epoch over a set of set_size (round-robin), so committee membership churns deterministically. Indices and the window wrap modulo set_size.
is_equivocation
Equivocation (a slashable Byzantine fault): a validator signed TWO DIFFERENT values at the same height/round. (height_a, value_a) vs (height_b, value_b) from the SAME validator.
is_globally_valid
Local validity ≠ global validity: a norm an agent holds in its local cell does not bind the network until it has been synchronised. Both must hold.
lamport_recv
Lamport clock on receiving a message stamped msg: max(local, msg) + 1.
lamport_tick
Lamport clock tick on a local event.
light_client_accepts
A light client accepts consensus state only if a succinct zk proof of the quorum verifies (it does NOT re-execute the chain): accept iff proof_verified AND a BFT quorum was claimed.
survives_partition
Partition tolerance: an obligation established before a partition remains active across the split (standing duties are not silently broken by a network event).
transaction_status
A multi-party obligation is Committed only when every party has assented; otherwise it is Suspended (Pending). An obligation with no parties cannot commit.
vc_concurrent
Two vector clocks are concurrent iff neither happens-before the other.
vc_happens_before
Vector-clock happens-before a → b: a[i] ≤ b[i] for all i AND a ≠ b.
vc_merge
Merge vector clocks (componentwise max) into out — partition-healing reconciliation. Zero-heap (caller-supplied out).