Skip to content

fix(precompute): enforce frame replay lineage - #597

Merged
zzylol merged 2 commits into
mainfrom
fix/589-delta-replay-lineage
Sep 4, 2026
Merged

zzylol merged 2 commits into
mainfrom
fix/589-delta-replay-lineage

Conversation

@zzylol

@zzylol zzylol commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Closes #589.

Implements receiver-side frame validation and replay state for ObserveEnvelope:

  • canonical ASAP-FRAME-V1 SHA-256 sealing and verification;
  • duplicate delivery is an idempotent no-op;
  • sequence gaps, conflicting replays, and unknown delta bases return typed errors before sketch mutation;
  • sender attaches the checksum after the payload is finalized;
  • framed envelope processing is serialized per precompute instance so validation/application/commit is atomic.

Legacy envelopes without frame attributes remain accepted for compatibility.

Tests cover exact replay, gap, bad base, and payload corruption.

Validation: go test . ./controlchannel ./monitor ./sketches

@zzylol

zzylol commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

Follow-up review fix: receiver replay state is now bounded by MaxSeries (100k safety default when unset) with LRU retirement. A frame for a retired lineage must restart at sequence 1/full checkpoint or returns the existing typed gap/base error for resync.

@zzylol
zzylol merged commit 8f6e4be into main Sep 4, 2026
1 check 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.

asap-precompute-go: make delta frame replay idempotent and enforce lineage/sequence

1 participant