Commit Graph

14635 Commits

Author SHA1 Message Date
Nicholas Dudfield
46207a3fca test(export): initialize account root before reserve edit 2026-06-28 11:38:48 +07:00
Nicholas Dudfield
a16e8886c2 test(testnet): resolve export signature witnesses 2026-06-28 11:24:14 +07:00
Nicholas Dudfield
268db0b6d2 fix(export): enforce shadow ticket reserve 2026-06-28 11:24:06 +07:00
Nicholas Dudfield
73f3b7a167 fix(consensus): reject miskeyed rng sidecar leaves 2026-06-28 11:24:00 +07:00
Nicholas Dudfield
1b4535cee5 docs(consensus): clarify rng proposal key checks 2026-06-28 10:30:17 +07:00
Nicholas Dudfield
bb6242213b fix(hooks): enforce xport emit budget 2026-06-28 10:16:53 +07:00
Nicholas Dudfield
0aa8e3ca67 fix(consensus): reject non-secp rng proposal proofs 2026-06-28 10:16:29 +07:00
Nicholas Dudfield
516edb8147 fix(hooks): return export wrapper hash from xport 2026-06-28 10:09:00 +07:00
Nicholas Dudfield
1186a3a7c4 style: apply clang-format 2026-06-27 17:38:11 +07:00
Nicholas Dudfield
9d9329ece4 refactor: reuse proof parser and named entropy tiers 2026-06-27 17:32:37 +07:00
Nicholas Dudfield
465131bb3e refactor: name legacy NetworkID transaction boundary 2026-06-27 16:59:20 +07:00
Nicholas Dudfield
1b0c633eda refactor(consensus): trim small duplicated extension constants
Reuse SidecarPeerAlignment::quorumAligned for export sidecar gates, name the shared sidecar convergence timeout, and centralize the RNG commitment tuple.

Also make ExportLimits::maxExportsPerHook the value enforced by xport_reserve, with a static assertion against the hook ABI constant.
2026-06-27 15:24:06 +07:00
Nicholas Dudfield
ceabb893bf docs(consensus): tighten proposal proof wording
Clarify that fetched RNG commit proofs carry the signed proposal fields plus signature, not only the serialized position bytes.
2026-06-27 15:16:35 +07:00
Nicholas Dudfield
d5ca581cea docs(consensus): explain sidecar reconciliation model
Document the common proposal-relay path, why RNG/Export use fixed-denominator quorum over proposal-borne material, and how sidecar SHAMap fetch/proofs act as secondary distribution rather than authority.

This captures the reconciliation cost/benefit in the committed design doc, separate from the reviewer-facing PR description.
2026-06-27 15:13:22 +07:00
Nicholas Dudfield
8a81588b71 fix(consensus): let quorum-aligned entropy conflicts proceed
Use the fixed-denominator entropy threshold as the conflict boundary: once our entropy hash is quorum-aligned, a below-threshold conflicting minority or silent peer cannot force fallback by withholding full observation.

Update the consensus entropy invariant spine and design doc so the no-veto conflict rule is explicit, and flip the regression test to cover the liveness-preserving path.
2026-06-27 15:09:30 +07:00
Nicholas Dudfield
0a9023c334 fix(export): avoid live manifest filtering of accepted witnesses
Materialize ttEXPORT_SIGNATURES from the accepted export sidecar root during live consensus builds, then let apply trust that tx-stream witness membership while still verifying each signature and enforcing quorum.

Direct apply paths remain conservative, and historical replay uses the same witness-membership rule after manifests may have rotated. Update the intent docs and tests for live, direct, and replay modes.
2026-06-27 13:39:58 +07:00
Nicholas Dudfield
c38567792e fix(hooks): separate callback rng streams 2026-06-27 13:06:28 +07:00
Nicholas Dudfield
3cfc79ea59 fix(consensus): bind rng sidecar proofs to round parent 2026-06-27 13:04:08 +07:00
Nicholas Dudfield
eb3a3b888f fix(consensus): allow shared diagnostics in export-only rounds 2026-06-27 12:56:19 +07:00
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