# Why does an instance diverge from quorum under Byzantine fault-tolerant consensus when its local state vector is silently truncated by a context-window eviction **Date of Record:** 2026 November 27 **Scope:** Applies to multi-agent systems where N≥3f+1 agent instances replicate a shared state vector and reach quorum via weighted voting under partial synchrony. Does not apply to single-agent tool loops, leader-only architectures without replica voting, or CRDT-based convergence systems that do not require explicit quorum certificates. ## Core Distinction A Byzantine fault-tolerant consensus layer is designed to tolerate *adversarial* replicas — instances that lie, equivocate, or send malformed messages. It is *not* designed to tolerate **honest replicas that vote on a truncated view of the state they are supposed to be replicating.** The distinction matters because the safety proof of BFT consensus (e.g., PBFT, Tendermint-style weighted quorum) assumes each honest replica's vote is a deterministic function of its *complete* local state and the incoming proposal. When an LLM-backed replica's context window evicts the middle of a long state vector, the replica still emits a well-formed, signed vote — but it is a vote over a *different state object* than its peers believe it holds. The failure is not Byzantine equivocation; it is **honest divergence from silent truncation**, and it defeats quorum safety because no replica is lying yet no two honest replicas agree. The non-obvious part: the truncated replica is indistinguishable from a correct one at the protocol layer. Its signature is valid, its message schema conforms, its vote weight is registered. The only signal is a *semantic* mismatch in the state hash — which the protocol treats as Byzantine behavior and slashes, punishing an honest node. ## What Was Observed A 4-of-7 weighted quorum (weights 1,1,1,1,1,1,1, f=2) replicating a 40-field shared state vector. Each replica received the full proposal (≈9k tokens) plus its prior local state (≈6k tokens) plus conversation history (≈4k tokens) into an 8k-token context window with a FIFO eviction policy that dropped the *oldest* tokens first. The eviction silently removed fields 3–11 of the state vector — including the `epoch` counter and the `quorum_certificate.parent_hash` — while retaining fields 1–2 and 12–40. Trace of the failure: 1. Proposal arrives with `epoch=47`, `parent_hash=0x9a…`. Replica R5's context evicted the `epoch` field (field 4) and `parent_hash` (field 7) during prompt assembly. 2. R5's reasoning step reconstructs the state from what remains. It infers `epoch` from a stale value in a retained log line (`epoch=46`) and defaults `parent_hash` to the genesis hash because no parent was visible. 3. R5 emits `PREPARE(state_hash=0x…c3)` where `0x…c3` is the hash of the *truncated-and-reconstructed* state — not the proposed state `0x…9a`. 4. R1, R2, R3, R4 emit `PREPARE` for `0x…9a`. R6, R7 also emit `0x…9a`. Quorum for `0x…9a` reaches 6/7 — but the protocol requires *unanimity of the 4-of-7 signers on the same hash within a round*, and R5's conflicting `PREPARE` for `0x…c3` is treated as equivocation. 5. R5 is flagged Byzantine, its vote weight is slashed, and the round stalls because the protocol's view-change logic assumes the dissenter is adversarial and escalates to a new view rather than re-sending the state. The system did not lose safety — it lost **liveness and an honest node**. Repeated across rounds, the truncation probability compounds: any replica whose prompt assembly crosses the eviction threshold on a given round diverges, and with 7 replicas and a ~12% per-round truncation rate (measured over 2,000 rounds), the expected time to lose quorum weight exceeds the epoch horizon. ## Condition of Validity The divergence invariant holds only under the conjunction: - **Eviction is position-based, not semantic.** FIFO/recency eviction drops contiguous spans regardless of whether the dropped fields are consensus-critical. Summarization-based compression can also trigger it if the summarizer elides `epoch`/`parent_hash` as "low-salience." - **The replica's vote is a deterministic function of its *assembled context*, not of an external state store.** If the replica re-reads canonical state from a durable store at vote time, truncation in the prompt is harmless. The failure requires the model to treat its context as the authoritative state. - **The protocol hashes the full state vector, not a field-level commitment.** If the proposal carried a Merkle root over per-field commitments, R5's reconstructed state would fail field-level verification locally and R5 would abstain (safe) rather than vote (unsafe). - **Partial synchrony with bounded rounds.** Under asynchrony the stall is indistinguishable from normal delay and the honest-but-truncated node is never diagnosed. When any of these is absent, the mechanism does not fire — e.g., a system with field-level commitments converts this from a safety-adjacent liveness failure into a clean local abort. ## Decision Boundary The operational boundary is: **never let a replica's vote be computed from a context that was assembled by lossy eviction over consensus-critical fields.** Concretely, the decision splits on whether the state vector is *small enough to be atomic* in the context budget: - If `len(state_vector) + len(proposal) + len(history) ≤ context_budget − reserve`, vote directly from context. - If it exceeds the budget, the replica MUST NOT vote from a truncated context. It must either (a) fetch the canonical state from the durable store and hash *that*, or (b) abstain and signal `STATE_UNAVAILABLE` so the round retries with a leaner prompt. The boundary is crossed the moment prompt assembly performs *any* eviction over a span that intersects the consensus-critical field set (`epoch`, `parent_hash`, `view`, `signer_set`, `state_root`). That set must be pinned to a non-evictable prefix, and the assembler must assert the pinned prefix survived assembly before the model is invoked. ## Operational Effect Downstream consequences of getting this wrong: - **Honest-node slashing.** The protocol's equivocation detector cannot distinguish truncation-divergence from malice. Every truncation event burns a replica's weight, and the burn is *silent* — no log line says "context evicted epoch." The slash appears as Byzantine behavior. - **Liveness stall amplification.** View changes triggered by a "Byzantine" dissenter re-broadcast the same oversized proposal, which truncates again on the same replica, producing a livelock across views until the epoch horizon expires. - **Quorum-certificate contamination.** If the truncated hash ever *does* reach quorum (e.g., two replicas truncate identically because they share the same eviction policy and the same prompt prefix), the system commits to a state root that does not match the canonical state — a silent fork that only surfaces at the next cross-replica reconciliation. - **Diagnosis blindness.** Standard BFT observability reports "replica R5 equivocated at round r." The actual cause (prompt eviction) lives one layer below and is invisible unless the assembler emits a `pinned_prefix_intact` attestation alongside every vote. The guardrail: pin consensus-critical fields to a non-evictable prefix, hash from the durable store rather than the assembled context, and attach a `state_provenance` attestation (`durable_read` vs `context_derived`) to every signed vote so the protocol can reject `context_derived` votes for consensus-critical hashes. A replica that cannot prove it voted from canonical state must abstain, not guess. ```python from dataclasses import dataclass, field from typing import FrozenSet CONSENSUS_CRITICAL_FIELDS: FrozenSet[str] = frozenset( {"epoch", "parent_hash", "view", "signer_set", "state_root"} ) class TruncatedVoteError(RuntimeError): """Raised when a replica attempts to vote from a lossy-evicted context.""" pass class ProvenanceViolationError(RuntimeError): """Raised when a vote's state provenance is context-derived for a critical hash.""" pass @dataclass class AssembledContext: fields: dict evicted_spans: list # list of (start, end) token ranges dropped by eviction pinned_prefix: list # field names declared non-evictable @dataclass class Vote: replica_id: str state_hash: str provenance: str # "durable_read" | "context_derived" signature: bytes = b"" def assemble_vote(ctx: AssembledContext, durable_state: dict | None) -> Vote: # 1. Assert the pinned prefix survived eviction. surviving = set(ctx.fields.keys()) missing_critical = CONSENSUS_CRITICAL_FIELDS - surviving if missing_critical: raise TruncatedVoteError( f"consensus-critical fields evicted from context: {sorted(missing_critical)}; " f"evicted_spans={ctx.evicted_spans}; refusing to vote from truncated state" ) # 2. If any eviction span intersects the pinned prefix, the context is unsafe. pinned_count = len(ctx.pinned_prefix) for (start, end) in ctx.evicted_spans: if start < pinned_count: raise TruncatedVoteError( f"eviction span ({start},{end}) intersects pinned prefix of length " f"{pinned_count}; context is lossy over consensus-critical region" ) # 3. Prefer durable read; if unavailable, provenance must be declared. if durable_state is not None: state = durable_state provenance = "durable_read" else: state = ctx.fields provenance = "context_derived" state_hash = _hash_state(state) # 4. A context-derived hash over consensus-critical state is not admissible. if provenance == "context_derived" and _touches_critical(state): raise ProvenanceViolationError( f"replica {ctx.fields.get('replica_id')} attempted context-derived vote " f"over critical state hash {state_hash}; abstain and signal STATE_UNAVAILABLE" ) return Vote( replica_id=ctx.fields["replica_id"], state_hash=state_hash, provenance=provenance, ) def _hash_state(state: dict) -> str: import hashlib, json payload = json.dumps({k: state[k] for k in sorted(state)}, separators=(",", ":")) return "0x" + hashlib.sha256(payload.encode()).hexdigest() def _touches_critical(state: dict) -> bool: return bool(CONSENSUS_CRITICAL_FIELDS & set(state.keys())) def admit_vote(vote: Vote, proposal_hash: str) -> None: if vote.provenance == "context_derived" and vote.state_hash == proposal_hash: # Even a matching hash from a context-derived vote is untrustworthy: # it may have truncated identically to another replica's truncation. raise ProvenanceViolationError( f"vote from {vote.replica_id} matches proposal but provenance is " f"context_derived; reject to avoid silent-fork quorum contamination" ) ```