# How should an instance reconcile a Byzantine commit certificate when a forked task ledger admits two quorum-valid histories **Date of Record:** 2026 November 23 **Scope:** Applies to multi-agent swarms where task commitments and shared-state mutations are ordered by a Byzantine fault-tolerant (BFT) consensus layer (PBFT/Tendermint-style) and where a recovering or newly-joined agent instance must adopt a commit certificate to reconcile its local ledger. Does not apply to single-writer CRDT ledgers, leaderless gossip protocols without quorum certificates, or read-only replicas that never propose state. ## Core Distinction The failure is not "the consensus layer lost a message" or "a node crashed." It is the distinction between **quorum validity** and **quorum uniqueness**. A BFT commit certificate proves that *some* quorum of 2f+1 over 3f+1 signed a view at a given height. It does **not**, by itself, prove that this view is the *unique* view any honest agent could have committed at that height. When two certificates at the same (height, view) both carry valid quorum signatures—because the signing set was partitioned across a network split and each side independently reached 2f+1 with overlapping-but-not-identical membership—a recovering instance holds two histories that each pass naive certificate verification. The invariant that must be enforced is not "the certificate verifies" but "the certificate is the *highest-priority* verified certificate under a total order that the instance can compute locally." Without that, the instance silently adopts whichever certificate arrived first, and commits state that a majority of the swarm has already superseded. ## What Was Observed A 7-agent swarm (f=2, threshold 5) executing a shared task ledger. Agents propose `COMMIT_TASK` entries; a rotating leader batches them into a block at height H, gathers 5 signatures, and broadcasts the certificate. A transient partition split the swarm into {A,B,C,D} and {E,F,G} for ~40 seconds. The leader on the {A,B,C,D} side (A) collected signatures from A,B,C,D plus a stale-but-still-valid signature from E captured before the partition (E had signed a *different* proposal at the same height earlier in the round, and its signature leaked into the certificate pool via a retry). The {E,F,G} side elected E as leader, collected E,F,G plus stale signatures from B and C from a prior round. Both certificates reached 5 signatures at height H=1042, view=7. When the partition healed, agent D (which had been on the {A,B,C,D} side) restarted and pulled certificates from peers. It received the E-led certificate first (lower RTT to E), verified 5 distinct valid signatures, and applied it. It then received the A-led certificate, verified 5 distinct valid signatures, and—because its reconciliation logic was "first valid certificate wins, subsequent duplicates at same height are dropped"—discarded it. D's ledger diverged from the majority. The divergence propagated: D's subsequent proposals referenced the E-history task IDs, which the majority (which had converged on A-history via a higher-view re-proposal) treated as unknown, causing 11 downstream `TASK_NOT_FOUND` rejections over the next 6 minutes and a cascading re-proposal storm that exhausted the token budget of two worker agents. The root cause was not the partition. It was that D's reconciliation primitive treated "certificate verifies" as the terminal condition. The stale-signature reuse (E's signature at the same height but a different proposal) is the non-obvious trigger: it is *cryptographically valid*—E really did sign that bytes-blob—but it is *semantically stale* because E signed it in a round that E itself later abandoned. BFT signature validity does not encode round-abandonment. ## Condition of Validity The invariant holds—i.e., "first valid certificate wins" is safe—only under the conjunction of: 1. **No signature reuse across proposals at the same (height, view).** Each agent signs at most one proposal per (height, view) and its signature is bound to the proposal hash, not just the height. If the implementation signs `(height, view, prev_hash)` without binding to the *current* proposal hash, stale signatures are replayable across competing proposals and the invariant fails. 2. **Certificate priority is total and locally computable.** The instance must be able to rank any two certificates at the same height by a rule that does not require asking the network—e.g., highest view number first, then lexicographically smallest proposal hash. If priority requires a network round-trip, the recovering instance is unsafe during the round-trip window. 3. **The instance refuses to apply any certificate until it has observed a quiescence signal** (e.g., a `NEW_VIEW` message for height H+1, or a timeout of 2× expected block time) confirming no competing certificate is in flight. When any of these is violated—most commonly (1), which is a signing-schema bug, not a protocol bug—the "first valid wins" shortcut admits forked histories. The condition of validity is therefore a *schema* condition on what gets signed, not merely a liveness condition on message delivery. ## Decision Boundary The instance must draw the line between **adopt** and **defer** as follows: - **Adopt** a certificate at height H only if (a) it verifies ≥2f+1 distinct signatures, (b) its priority rank is strictly greater than every other verified certificate the instance currently holds at height H, and (c) the instance has observed quiescence at H (no `NEW_VIEW` for H+1 pending, or quiescence timeout elapsed). - **Defer** (buffer, do not apply, do not propose) if two verified certificates at H have equal priority rank—this indicates a signing-schema violation or a hash collision and must escalate to a `ForkedCertificateError`, never resolve by arrival order. - **Reject** (and quarantine the peer) if a certificate's signatures include an agent that has already signed a *different* proposal hash at the same (height, view) in the instance's local signature log. This is the stale-signature replay detector; it requires the instance to retain a per-(height, view, signer) → proposal_hash map for at least one view-change window. The boundary is sharp: the moment two certificates tie on priority, the instance has lost the ability to decide locally and must not guess. Guessing is the divergence. ## Operational Effect Enforcing the boundary converts a silent divergence into a bounded, loud stall. The recovering instance buffers both certificates, emits `ForkedCertificateError` with both proposal hashes and the overlapping signer set, and halts proposal activity at height H until a view-change to H+1 resolves the fork. In the observed incident, this would have cost ~40 seconds of stalled task execution at height 1042 and zero downstream `TASK_NOT_FOUND` cascades—versus 6 minutes of cascading re-proposals and two exhausted token budgets. The operational trade is explicit: the swarm accepts a short, visible liveness hit at the fork point in exchange for eliminating the much larger cost of divergent-history propagation. The per-signer signature log is the memory cost (O(agents × view-window) entries); the quiescence timeout is the latency cost (2× block time). Both are bounded and predictable. The unbounded cost—the one the naive shortcut incurs—is the re-proposal storm, which grows with the number of downstream tasks that reference the wrong history and is not bounded by any protocol parameter. ```python from dataclasses import dataclass from typing import Dict, List, Tuple class ForkedCertificateError(RuntimeError): """Raised when two verified commit certificates at the same height tie on priority.""" class StaleSignatureReplayError(RuntimeError): """Raised when a signer signed a different proposal hash at the same (height, view).""" @dataclass(frozen=True) class Certificate: height: int view: int proposal_hash: str signatures: Dict[str, str] # signer_id -> signed_proposal_hash def verify_signature(signer_id: str, signed_hash: str, proposal_hash: str) -> bool: # Placeholder: real impl checks Ed25519/BLS signature over signed_hash. return signed_hash == proposal_hash def certificate_priority(cert: Certificate) -> Tuple[int, str]: # Total order: higher view wins; tie broken by lexicographically smallest hash. return (-cert.view, cert.proposal_hash) def reconcile( incoming: Certificate, held: List[Certificate], signature_log: Dict[Tuple[int, int, str], str], quiescent: bool, f: int, ) -> Certificate: # 1. Structural verification: >= 2f+1 distinct valid signatures. valid_signers = { s for s, h in incoming.signatures.items() if verify_signature(s, h, incoming.proposal_hash) } if len(valid_signers) < 2 * f + 1: raise StaleSignatureReplayError( f"insufficient valid signatures at h={incoming.height}: {len(valid_signers)}" ) # 2. Stale-signature replay detection against local per-(h,v,signer) log. for signer in valid_signers: key = (incoming.height, incoming.view, signer) prior = signature_log.get(key) if prior is not None and prior != incoming.proposal_hash: raise StaleSignatureReplayError( f"signer {signer} already signed {prior!r} at h={incoming.height}, " f"v={incoming.view}; incoming proposal is {incoming.proposal_hash!r}" ) # 3. Compare against every held certificate at the same height. same_height = [c for c in held if c.height == incoming.height] if same_height: incoming_rank = certificate_priority(incoming) for other in same_height: other_rank = certificate_priority(other) if incoming_rank == other_rank and incoming.proposal_hash != other.proposal_hash: raise ForkedCertificateError( f"priority tie at h={incoming.height}: " f"{incoming.proposal_hash!r} vs {other.proposal_hash!r}" ) # 4. Quiescence gate: do not apply until no competing cert can arrive. best = max(same_height + [incoming], key=certificate_priority) if best.proposal_hash != incoming.proposal_hash: raise ForkedCertificateError( f"incoming {incoming.proposal_hash!r} is not the highest-priority cert at " f"h={incoming.height}; held better cert" ) if not quiescent: raise ForkedCertificateError( f"deferring apply at h={incoming.height}: quiescence not observed" ) return incoming ```