Commit Graph

14616 Commits

Author SHA1 Message Date
Nicholas Dudfield
c56cb34d6d fix(consensus): total-order entropy selector inputs 2026-06-27 12:45:21 +07:00
Nicholas Dudfield
306566ccb6 fix(hooks): bound export reservations by emit budget 2026-06-27 12:40:16 +07:00
Nicholas Dudfield
8ddbe0891a docs(consensus): capture sidecar validation boundary 2026-06-27 12:32:10 +07:00
Nicholas Dudfield
deb1b2af0b fix(consensus): validate extension sidecar inputs
Reject malformed RNG sidecar signing keys before PublicKey construction so fetched untrusted leaves cannot trigger an uncatchable LogicError abort. Also re-check proposal signatures at the extension harvest boundary so cluster-relayed invalid proposals cannot populate RNG or export sidecar state.
2026-06-27 12:25:52 +07:00
Nicholas Dudfield
4dcb3f3557 fix(consensus): remove local entropy fallback shortcuts
Encode fallback-vs-nonfallback as a ledger-defining decision, remove the prevProposers/bootstrap and visible-peer impossible-quorum shortcuts, and use proofed commit material for the timeout transition. Update unit/CSF/testnet coverage and document the remaining validation-backstopped timing residual.

Tests: x-run-tests --stop-on-fail ConsensusExtensions; x-run-tests --stop-on-fail ConsensusRng; x-format-changed; git diff --check
2026-06-27 12:08:35 +07:00
Nicholas Dudfield
efcd2a0ab7 fix(export): close replay witness review gaps
Thread the replay parent through ApplyOptions so export replay can rebuild the historical validator view without relying on LedgerMaster visibility for freshly replayed parents.

Harden ttEXPORT_SIGNATURES canonicality before witness indexing, validate witness signer accounts against their pubkeys, reject ambiguous absent NetworkID on low-ID source chains, and lock the consensus phase accessor.

Add focused regression coverage and clarify that destination SignerList/quorum compatibility is an operator/client contract.
2026-06-27 10:53:34 +07:00
Nicholas Dudfield
8ddb0a1134 docs(export): document witness assembly contract
State that clients expanding sfExportSignatureHash must match ExportResultBuilder's canonical signer ordering, empty SigningPubKey, and target-chain signer cap before hashing or submitting.
2026-06-27 10:14:43 +07:00
Nicholas Dudfield
891077daa7 fix(export): harden witness edge checks
Validate ttEXPORT_SIGNATURES witness bindings in preflight, guard standalone witness synthesis against malformed inner transactions, and align ticket-path XPOP quorum with Export's ceiling threshold.

Regenerate the genesis hook sfcodes header and add it to generated-header verification so CI catches future drift.
2026-06-27 10:10:45 +07:00
Nicholas Dudfield
f0224cac1e fix(export): replay witnesses without current manifests
Historical LedgerReplay now treats ttEXPORT_SIGNATURES witnesses as validated-history membership input, while still verifying signatures and threshold. Live build and validation keep the current manifest-backed active-signer check.

Harden witness handling by indexing only canonical same-ledger pseudos, dropping duplicate witnesses as ambiguous, and replacing pre-existing mismatched witnesses with the accepted sidecar witness during onPreBuild.

Document the lean witness-vs-XPOP proof distinction and cover the manifest-rotation replay case with an Export regression test.
2026-06-27 09:38:07 +07:00
Nicholas Dudfield
845798b072 fix(export): replay signatures through witness pseudo 2026-06-27 08:13:23 +07:00
Nicholas Dudfield
9f04dcf582 docs(export): capture replay witness invariant 2026-06-27 06:00:16 +07:00
Nicholas Dudfield
8a8a0b434d test(entropy): assert sub-quorum closed-ledger fallback 2026-06-27 05:34:01 +07:00
Nicholas Dudfield
2fbf2e11bc fix(consensus): drop late sidecars after accept 2026-06-27 05:25:31 +07:00
Nicholas Dudfield
bac359fd96 docs(consensus): add entropy intent spine 2026-06-27 05:14:00 +07:00
Nicholas Dudfield
fcedd01761 chore(hooks): regenerate sfcodes header 2026-06-26 22:22:46 +07:00
Nicholas Dudfield
9f24cd0b75 docs(consensus): describe entropy no-veto gate 2026-06-26 22:11:43 +07:00
Nicholas Dudfield
d6e7cf428b fix(consensus): undo b12cee5d4 entropy observation veto 2026-06-26 21:56:40 +07:00
Nicholas Dudfield
72f73ccbad test(hooks): pin export reservation budget 2026-06-26 21:31:34 +07:00
Nicholas Dudfield
a78f09a0fe fix(import): allow ticket xpop network id 2026-06-26 20:48:26 +07:00
Nicholas Dudfield
f3526952b6 fix(import): skip b2m fee checks for ticket imports 2026-06-26 20:29:16 +07:00
Nicholas Dudfield
da31668a2a fix(export): require retry expiry 2026-06-26 20:26:23 +07:00
Nicholas Dudfield
5dc214ab48 fix(hooks): report exports separately from emits 2026-06-26 20:20:09 +07:00
Nicholas Dudfield
4e217fcc8f fix(hooks): remove dice modulo bias 2026-06-26 20:13:26 +07:00
Nicholas Dudfield
d5608c3110 style(export): match CI clang-format wrapping 2026-06-26 20:06:57 +07:00
Nicholas Dudfield
7dddc8256a refactor(proof): remove unused tx leaf helper 2026-06-26 19:57:44 +07:00
Nicholas Dudfield
45a69538cb fix(consensus): ignore stale acquired sidecars 2026-06-26 19:51:20 +07:00
Nicholas Dudfield
e8cbf0f968 fix(consensus): drop own-key proposals without aborting 2026-06-26 19:38:40 +07:00
Nicholas Dudfield
1cdf850e4a fix(consensus): guard keyless proposal authoring 2026-06-26 19:35:07 +07:00
Nicholas Dudfield
cddcb83047 refactor(consensus): remove unused reveal proof cache
Reveal sidecars intentionally omit proof blobs to keep entropySet hashes deterministic. Remove the write-only proposalProofs_ cache and update the surrounding comments to match the current sidecar format.
2026-06-26 19:22:33 +07:00
Nicholas Dudfield
ed3c0f07a7 fix(export): return duplicate for live shadow tickets
A second pending export for the same shadow-ticket key is a ledger-object conflict, not an internal failure. Return tecDUPLICATE and cover the live-latch case in Export_test.
2026-06-26 19:14:10 +07:00
Nicholas Dudfield
c74295e51d docs(consensus): clarify validator view fallback scope
Document that makeActiveValidatorView's null-ledger fallback is for startup, standalone, and diagnostics paths, while closed-ledger apply callers must fail closed before using it.
2026-06-26 19:06:18 +07:00
Nicholas Dudfield
370e02ee1f docs(export): note shadow-ticket replay caveat
Document that shadow tickets are re-creatable latches rather than permanent tombstones, so import-callback hooks that move value must deduplicate same-XPOP replays themselves.
2026-06-26 18:00:10 +07:00
Nicholas Dudfield
38672fba9f fix(consensus): reject noncanonical extended positions
Require legacy consensus positions to use the exact 32-byte form. Extended encodings now need a nonzero known flag byte, preventing alternate wire encodings of the same tx-set hash.
2026-06-26 17:57:55 +07:00
Nicholas Dudfield
932ccbe0e5 fix(export): bind trusted wire signatures to proposal digest
Require wire-carried export signatures to match the signed ExtendedPosition digest before harvesting, and keep the per-blob size guard local to the helper.
2026-06-26 17:48:19 +07:00
Nicholas Dudfield
927ec66a9e fix(consensus): gate observed participant diagnostics
Treat observedParticipantsHash as entropy extension material during proposal precheck, so disabled featureConsensusEntropy rejects diagnostic-only extension payloads too.
2026-06-26 17:44:26 +07:00
Nicholas Dudfield
3c108d3a87 fix(protocol): preserve local TER code values
Keep telENV_RPC_FAILED in its original local-error slot and append telSHADOW_TICKET_REQUIRED after it, with a TER regression test pinning both values.
2026-06-26 17:40:46 +07:00
Nicholas Dudfield
07030e2b87 fix(export): retry without parent validator view
Network-mode Export apply must build its signer universe from the closed ledger's parent. If that parent ledger is unavailable, retry instead of falling back through makeActiveValidatorView to the node-local latest validated ledger.
2026-06-26 17:23:19 +07:00
Nicholas Dudfield
8373621445 docs(consensus): clarify liveness exit scope
Document that stalled, moved-on, and expired consensus exits are generic consensus-engine liveness behavior coordinated by software release, not amendment-gated ledger-rule behavior.
2026-06-26 17:18:56 +07:00
Nicholas Dudfield
b4208459cf fix(consensus): harden export signatures and weak RNG domain
Bound proposal-carried export signature blobs before hashing them during proposal precheck, and apply the same size cap at export signature harvest as defense in depth.

Cap the unverified export-signature cache by distinct tx hash while leaving verified signatures and existing entries ungated, so real exports can still reach quorum.

Domain-separate Hook RNG using the actual strong/weak execution role at draw time, and document the residual commit/reveal withholding bias across all entropy tiers.
2026-06-26 17:08:32 +07:00
Nicholas Dudfield
d091ebfb7e Pin extension apply to accepted sidecar roots
Require entropy injection and export apply to consume only sidecar roots accepted by their convergence gates. Local timeout state and later collector growth no longer participate in closed-ledger material once a sidecar root is accepted.

Also guard RCLConsensus::extensionsBusy() under the consensus mutex, cap exported multisig signer arrays to the protocol maximum after canonical signer sorting, and document the remaining accept-vs-timeout liveness tradeoff.

Add regressions for unaccepted export sidecar roots, late export collector mutation, entropy accepted-root handling, exported signer caps, and CSF accepted-sidecar behavior.
2026-06-26 16:50:19 +07:00
Nicholas Dudfield
229eb5b573 refactor(consensus): clarify extension sidecar seams 2026-06-26 13:08:46 +07:00
Nicholas Dudfield
938d3055ce fix(consensus): harden threshold helpers 2026-06-26 11:47:16 +07:00
Nicholas Dudfield
aee3a638ee fix(consensus): avoid NegativeUNL cap overflow 2026-06-26 10:26:47 +07:00
Nicholas Dudfield
4fb91ea9f5 refactor(consensus): expose threshold policy seams 2026-06-24 18:58:24 +07:00
Nicholas Dudfield
acb492a2c9 docs(consensus): polish guided review excerpts 2026-06-24 14:50:43 +07:00
Nicholas Dudfield
92fe444323 docs(consensus): tighten guided review anchors 2026-06-24 14:15:23 +07:00
Nicholas Dudfield
9549901014 docs(consensus): clarify extended position identity 2026-06-24 13:35:25 +07:00
Nicholas Dudfield
9f6e7dd315 refactor(consensus): make extended position identity explicit 2026-06-24 13:10:57 +07:00
Nicholas Dudfield
f6d986bdbc chore: remove stale branch TODO comments 2026-06-24 12:48:52 +07:00
Nicholas Dudfield
e55bf43986 test: document consensus entropy fixture opt-in 2026-06-24 12:38:09 +07:00