Skip to content

[DS-3860] whole round snapshot consistency - #255

Merged
brunotm merged 2 commits into
masterfrom
bm/DS-3860-whole-round-snapshot-consistency
Aug 19, 2026
Merged

[DS-3860] whole round snapshot consistency#255
brunotm merged 2 commits into
masterfrom
bm/DS-3860-whole-round-snapshot-consistency

Conversation

@brunotm

@brunotm brunotm commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

on v31 is possible to fully defer definitions updates to the next round as state doesn't have to be carried by the previous outcome.

@brunotm
brunotm requested a review from a team as a code owner August 18, 2026 11:04
@github-actions

Copy link
Copy Markdown

👋 brunotm, thanks for creating this pull request!

To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team.

Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks!

@cl-efornaciari cl-efornaciari left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deferred channel definitions: changes agreed in round N are persisted to c/defs immediately but only take effect at N+1, so Observation, StateTransition and Reports always operate on the exact definitions (and opts) the round's stream values were gathered under. This closes the v30-inherited inconsistency where a mid-round definition change could produce reports encoded under definitions/opts that the observations behind them did not match. The effective/pending two-set construction is clean, carrying channelStateSeqNr in the precursor keeps Reports self-sufficient (and wire-compat with the LLOOutcomeProtoV1 layout is preserved), and the test coverage of the new semantics — addition effective at N+1 / first reportable at N+2, deferred removal, opts tracking, SyncTo watermark gating — is thorough. Build + go vet + v31/protocol suites pass locally.

One concern I consider blocking, detailed inline: the shared OptsCache is now written by two paths at different seqNrs (channelCache.put from the store, Reports from the precursor) while being read mid-round by StateTransition (ProcessCalculatedStreams, isReportable) and Reports (reportableChannels, codecs). After a defs-change round, a late or overlapping Reports call can leave the cache pinned at an older seqNr indefinitely (the cache-hit path never re-syncs) or flip it mid-round — making StateTransition/Reports outputs depend on node-local interleaving, which conflicts with the ReportingPlugin determinism contract (memoization side effects must be unobservable). Concrete interleavings and suggested fixes inline.

Also one doc nit on applyChannelVotes.

Comment thread llo/dev/v31/reports.go Outdated
Comment thread llo/dev/v31/kv.go Outdated
Comment thread llo/dev/v31/statetransition.go
@brunotm
brunotm force-pushed the bm/DS-3860-whole-round-snapshot-consistency branch from 4e5d987 to ea2dc78 Compare August 18, 2026 22:07
calvwang9
calvwang9 previously approved these changes Aug 19, 2026
Comment thread llo/dev/v31/reports.go Outdated
@brunotm
brunotm merged commit c8fe1eb into master Aug 19, 2026
15 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.

4 participants