# Why does an instance commit to a task quorum that no longer exists: Byzantine quorum-certificate divergence under membership churn in agent consensus **Date of Record:** 2026 December 2 **Scope:** Applies to multi-agent systems that commit tasks and shared state via Byzantine fault-tolerant (BFT) quorum certificates (e.g., PBFT-style, HotStuff-style, or Tendermint-style commit rules) where the validator/agent set is dynamic. Does not apply to static-membership consensus, single-writer state stores, or leaderless CRDT-based replication where commits do not require a quorum certificate. ## Core Distinction The failure is not "a Byzantine agent lies." It is that a *correct* agent commits a task against a quorum certificate (QC) that was valid at the epoch in which it was formed but is no longer a quorum under the current validator set — and no subsequent honest agent can reconstruct why the commit was legal. The distinction that matters: **quorum validity is epoch-relative, but commit finality is asserted as epoch-absolute.** A QC is a set of signatures over a (task_id, state_root, view) tuple. Its validity predicate is `|signers ∩ validator_set(epoch)| ≥ ⌈(2n+1)/3⌉` where `n = |validator_set(epoch)|`. When `validator_set` changes between formation and verification, the same signature bundle can cross the threshold in one direction or the other. The dangerous direction is a certificate that was *sufficient* under epoch `e` but is *insufficient* under epoch `e+1` because the set grew — or *sufficient* under `e+1` only because a validator that was honest under `e` was evicted, so its signature is now counted against a smaller, differently-composed denominator. ## What Was Observed A three-phase commit protocol (prepare → commit → decide) with epoch-based validator rotation. Epoch `e` had validators `{A, B, C, D}` (n=4, threshold ⌈(2·4+1)/3⌉ = 3). A task-commit QC for `task_7` was formed with signatures from `{A, B, C}`. The prepare phase completed; the commit phase was in flight when the epoch boundary triggered. Epoch `e+1` validator set became `{A, B, D, E, F}` (n=5, threshold ⌈(2·5+1)/3⌉ = 4). Validator `C` was evicted (decommissioned). The commit-phase message carrying the `e`-epoch QC for `task_7` arrived at `E` and `F`, which had no record of the prepare phase. They verified the QC against `validator_set(e+1)`: - Signers `{A, B, C}` ∩ `{A, B, D, E, F}` = `{A, B}`. - `|{A, B}| = 2 < 4`. QC rejected. Meanwhile `A` and `B`, which held the `e`-epoch view, had already advanced to `decide` for `task_7` because under `validator_set(e)` the QC was valid (3 ≥ 3). The system reached a state where **`A` and `B` consider `task_7` committed and final; `E` and `F` consider it uncommitted and will accept a conflicting task with the same `task_id`.** `D` was partitioned during the transition and, on rejoin, saw both a `decide(task_7)` from `A` and a fresh `prepare(task_7')` from `E`/`F` — a direct equivocation from the perspective of `D`'s local log. The trace, concretely: 1. `e`-epoch: QC_e(task_7) = sigs{A,B,C}, threshold 3, valid. 2. Epoch bump: validator_set → {A,B,D,E,F}, C evicted. 3. `A`,`B` execute `decide(task_7)` using their cached `validator_set(e)`. 4. `E`,`F` receive QC_e(task_7), evaluate against `validator_set(e+1)`, reject (2 < 4). 5. `E`,`F` (as new leader for view in `e+1`) propose `task_7'` (different payload, same `task_id`) and form QC_{e+1}(task_7') = sigs{D,E,F,G?} — with `D` joining after rejoin. 6. `D` now holds `decide(task_7)` (from `A`) and `prepare(task_7')` (from `E`). Safety violation: two conflicting decisions for the same task slot. Root cause: **the QC carries no epoch binding in its verification predicate.** The signature bundle is over `(task_id, state_root, view)` but the *threshold check* is performed against the verifier's current `validator_set`, not the `validator_set` at the QC's `view`. The certificate is a set of signatures; the *meaning* of the set is a function of the epoch, and that function was applied at the wrong time. ## Condition of Validity The invariant that was silently assumed and is false under churn: > A QC that is valid under `validator_set(e)` remains valid under `validator_set(e')` for all `e' > e`. This holds only if the validator set is monotonically growing *and* the threshold fraction is non-decreasing *and* no signer is ever removed. Under any eviction, the intersection `signers ∩ validator_set(e')` can shrink below threshold even though the original signers were a supermajority of the old set. The correct invariant is: > A commit is final iff there exists an epoch `e` such that `QC.view ∈ epoch(e)` and `|signers ∩ validator_set(e)| ≥ threshold(e)`, *and* every subsequent epoch's validator set was derived by a transition certified under `e`. The second clause is the one agents omit. Epoch transitions themselves must carry a QC (`epoch_change_cert`) signed by the *old* set, and any verifier evaluating a QC from epoch `e` must first validate the chain of epoch-change certs from `e` to its current epoch. Without that chain, `E` and `F` have no basis to know that `C`'s eviction was legitimate and that `A`,`B`'s commit under `e` should be honored. ## Decision Boundary An agent must choose between two policies at the moment it receives a QC whose `view` maps to an epoch other than its own: - **Policy A (reject-on-mismatch):** reject any QC not formed under the verifier's current epoch. This is what `E` and `F` did. It is safe against forged cross-epoch QCs but *loses liveness and safety across churn* — it allows a conflicting task to be committed in the new epoch while the old epoch's commit stands, producing equivocation. - **Policy B (verify-chain-then-honor):** accept a foreign-epoch QC iff (i) the QC validates under its own epoch's validator set, and (ii) a contiguous chain of `epoch_change_cert`s from that epoch to the current epoch validates. This preserves safety across churn but requires every agent to retain epoch-change certs for at least the maximum in-flight task lifetime. The boundary is crossed when **the maximum task in-flight duration exceeds the epoch-change cert retention window.** If `E` and `F` garbage-collected the `e → e+1` transition cert before the `task_7` commit message arrived, Policy B is unavailable and they are forced into Policy A — which is exactly the equivocation path. The decision boundary is therefore a *retention* parameter, not a logic parameter: agents must retain epoch-change certs for `max_task_lifetime + max_network_delay`, and the protocol must reject any QC whose epoch is older than the retention horizon rather than silently re-evaluating it against the current set. ## Operational Effect The observable outcome is **split-brain finality**: a subset of agents holds a finalized task that the rest of the network will overwrite. Downstream effects compound because agents treat `decide` as irreversible — they emit side effects (tool calls, external API writes, state mutations) on decide. When the conflicting `task_7'` later commits on the other partition, the side effects of `task_7` are neither rolled back nor reconciled; the system has executed two different tasks under one `task_id`. Reconciliation requires a compensating transaction that no agent is authorized to issue, because from each partition's local view its own commit was correct. The guardrail is architectural, not logical: **bind the epoch into the QC's signed payload** (`(task_id, state_root, view, epoch, validator_set_hash)`) so that threshold evaluation is performed against the *signed* `validator_set_hash`, not the verifier's local set, and **require epoch-change certs to be carried in every cross-epoch QC's proof**. An agent that cannot present the chain must treat the QC as *unknown*, not *invalid* — and must halt rather than proceed to a conflicting proposal. ## Code ```python import hashlib from dataclasses import dataclass, field class QuorumCertificateDivergence(RuntimeError): """Raised when a QC's epoch-relative validity cannot be reconciled with the verifier's current epoch under the retention horizon.""" pass @dataclass class ValidatorSet: epoch: int members: frozenset @property def threshold(self): n = len(self.members) return (2 * n + 1) // 3 + ((2 * n + 1) % 3 > 0) @dataclass class QuorumCertificate: task_id: str state_root: str view: int epoch: int validator_set_hash: str signers: frozenset epoch_change_chain: list = field(default_factory=list) def _hash_set(vs: ValidatorSet) -> str: return hashlib.sha256( repr(sorted(vs.members)).encode() ).hexdigest() def verify_qc( qc: QuorumCertificate, current_set: ValidatorSet, known_sets: dict, retention_horizon: int, ) -> bool: """Verify a QC under the epoch it was formed in, not the current epoch. Raises QuorumCertificateDivergence when the QC's epoch is outside the retention horizon and no epoch-change chain bridges it to current_set. """ if qc.epoch == current_set.epoch: target = current_set else: if qc.epoch < current_set.epoch - retention_horizon: raise QuorumCertificateDivergence( f"QC epoch {qc.epoch} is {current_set.epoch - qc.epoch} " f"epochs behind current {current_set.epoch}; " f"retention horizon is {retention_horizon}. " f"Cannot re-evaluate signers against current set without " f"epoch-change chain — refusing to treat as invalid " f"(that path causes split-brain finality)." ) # Walk the epoch-change chain from qc.epoch to current_set.epoch. chain = {c["from_epoch"]: c for c in qc.epoch_change_chain} e = qc.epoch while e < current_set.epoch: link = chain.get(e) if link is None: raise QuorumCertificateDivergence( f"Missing epoch-change cert for transition {e} -> " f"{e + 1}; cannot establish that evictions were " f"certified under epoch {e}." ) if link["certified_by"] != _hash_set(known_sets[e]): raise QuorumCertificateDivergence( f"Epoch-change cert for {e} -> {e + 1} not signed by " f"the epoch-{e} validator set." ) e += 1 target = known_sets[qc.epoch] if qc.validator_set_hash != _hash_set(target): raise QuorumCertificateDivergence( f"QC {qc.task_id} claims validator_set_hash " f"{qc.validator_set_hash[:12]} but epoch {qc.epoch} set hashes " f"to {_hash_set(target)[:12]}; QC was formed against a " f"different membership than claimed." ) effective = qc.signers & target.members if len(effective) < target.threshold: # Under the QC's OWN epoch this is a genuine failure, not a # cross-epoch artifact — safe to reject. return False return True def commit_task( qc: QuorumCertificate, current_set: ValidatorSet, known_sets: dict, retention_horizon: int, ) -> str: if not verify_qc(qc, current_set, known_sets, retention_horizon): raise QuorumCertificateDivergence( f"QC for {qc.task_id} failed threshold under its own epoch " f"{qc.epoch}; refusing to commit." ) return f"committed:{qc.task_id}@epoch{qc.epoch}" ```