Skip to content

harden(audit): close all remaining HIGH/MEDIUM/LOW (H3, M4 reasoned-deferred)#8

Merged
drewstone merged 4 commits into
mainfrom
harden/audit-sweep
Jun 12, 2026
Merged

harden(audit): close all remaining HIGH/MEDIUM/LOW (H3, M4 reasoned-deferred)#8
drewstone merged 4 commits into
mainfrom
harden/audit-sweep

Conversation

@drewstone

Copy link
Copy Markdown
Contributor

Sweeps the remaining audit backlog. Closes every HIGH/MEDIUM/LOW that's safe to do well in one pass; two items are explicitly deferred with reasoning (not silently dropped). Full disposition in .evolve/audit-status.md.

Closed here

HIGH

  • H1 finality persistence — settled/cancelled journal to clob-finality.json, restored (expiry-filtered) on boot. Losing them re-opened a settled/cancelled order to a batch-reverting re-match.
  • H4 body-size cliff — clob router lifts the limit to 16MB so a full-pool proposal (~5MB) isn't 413'd at the load the cap allows.
  • H7 transport mode logged at boot + documented as a fleet-wide parameter (mixed fleets partition; gossip_send_failures/quorum_failed surface it).

MEDIUM

  • M3 deterministic expiry filter — proposer snapshot AND every peer's co-sign drop orders that won't survive to the epoch's settlement, via an epoch-derived cutoff (no wall-clock skew). Keeps match_epoch a pure function of the order set (the zk guest needs that), so the temporal check lives at the consensus layer.
  • M5 pin core2 by rev + blueprint-sdk/-networking/-crypto exact (no build drift).
  • M7 co-sign wait derives from epoch_secs (80%, clamped) instead of a fixed 8s that overlapped short epochs.

LOW

  • L1 e2e keys → gitignored .keys/ with ownership/mode refusal.
  • L2 out-of-i64-domain orders rejected at admission with a clear reason.

Plus: repaired main's forge build — the merged receipt/constructor change had left the H8 test files broken (97 forge tests now green).

Deferred, with reasoning

  • H3 (_applyBatch all-or-nothing + stateless verify) — the fix is finality-on-observed-settlement + pre-submit simulation, a consensus-semantics change to the live 3-node fleet. Its own focused PR with multi-node tests, not a sweep commit. Safety holds today; griefing self-limits by expiry.
  • M4 (god-object refactor) — pure-quality module split; own PR so it doesn't obscure security diffs.

53 Rust + 97 forge tests green; blueprint+chain+mesh builds clean.

🤖 Generated with Claude Code

… L2 domain reject

- M3: orders that won't survive to an epoch's settlement are dropped at both
  the proposer's snapshot AND every peer's co-sign, via an epoch-DETERMINISTIC
  cutoff ((epoch+1)*epoch_secs + margin) so verifiers never disagree. Closes
  the griefing where a malicious proposer slips in a near-expiry order that
  match_epoch (expiry-blind by design, for the zk guest) would co-sign into an
  on-chain OrderExpired revert. The temporal check lives at the consensus
  layer, keeping the matcher kernel a pure function of the order set.
- M5: pin core2 by rev (was a floating git branch) and blueprint-sdk /
  -networking / -crypto to exact alpha versions — no silent build drift.
- M7: the co-sign wait now derives from epoch_secs (80%, clamped 1-8s) instead
  of a fixed 8s that overlapped any short epoch into the next round.
- L2: orders whose price/qty exceed i64::MAX are rejected at admission with a
  clear reason instead of being silently dropped by match_epoch later.

51 Rust tests green (incl. mesh); blueprint+chain build clean.
…t visibility, L1 keys

- H1: settled + cancelled finality sets journal to DATA_DIR/clob-finality.json
  on mutation and restore (expiry-filtered) on boot. The pool stays in-memory
  (peers re-gossip it), but losing the finality record would re-admit a settled
  or cancelled order into a batch-reverting re-match. Round-trip unit-tested.
- H4: the clob router lifts the body limit to 16MB so a full-pool proposal
  (~5MB at MAX_POOL) isn't 413'd at the load the pool cap permits. Digest-list
  + pull-missing remains the scale-time redesign; this removes the cliff now.
- H7: transport mode (mesh vs HTTP peer list) is logged loudly at boot and
  documented as a fleet-wide parameter — a mixed fleet partitions, and
  gossip_send_failures/quorum_failed surface it.
- L1: e2e scripts moved ephemeral keys out of predictable /tmp into a
  gitignored repo-local .keys/ (0700 dir, 0600 files) and REFUSE a pre-seeded
  file not owned 0600 by the caller.
- attest_deadline scaling + finality journal serde unit-tested.

19 operator + mesh tests green; blueprint+chain clean.
…anges

The merged proof-of-service-receipt work changed receiptDigest /
settleRedemption to carry a workCommitment and added _challengeWindow to the
constructor, but the H8 test files (ErrorPaths, the invariant handler + suites)
weren't updated in that merge — main's forge build was red. Updated to the
new 7-arg constructor and the workCommitment receipt signature. 97 forge tests
green.
@drewstone drewstone merged commit 953f2ed into main Jun 12, 2026
1 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant