refactor(rust-client): collapse NoteObserver into OnNoteReceived#2322
Open
VAIBHAVJINDAL3012 wants to merge 1 commit into
Open
refactor(rust-client): collapse NoteObserver into OnNoteReceived#2322VAIBHAVJINDAL3012 wants to merge 1 commit into
VAIBHAVJINDAL3012 wants to merge 1 commit into
Conversation
Contributor
Author
|
There is small discussion required for the following- |
Fold the standalone NoteObserver trait into OnNoteReceived, removing one abstraction. StateSync now holds a list of OnNoteReceived observers instead of a single screener plus a separate observer list. on_note_received takes the committed/public note by reference and gains the note's attachments; the trait gains defaulted name() and post-sync apply() hooks. NoteUpdateAction gains an Observe variant that marks a block relevant without storing the note; when multiple observers vote, verdicts fold by precedence (Commit > Insert > Observe > Discard). PswapChainObserver is re-expressed as an OnNoteReceived. No behavioral change to PSWAP lineage tracking. Also extends pswap_multi_round_chain_tracking_test with a private-note case (registering the actual minted round notes), confirming private multi-round lineage tracking works end-to-end. Attachments are passed as a separate parameter for now; moving them onto CommittedNote is deferred to a follow-up (0xMiden#2118).
VAIBHAVJINDAL3012
force-pushed
the
vaibhav/2279-collapse-note-observer
branch
from
July 14, 2026 21:24
7bec4e2 to
83ceddb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements #2279 — folds the standalone
NoteObservertrait into the pre-existingOnNoteReceived, removing one abstraction (follow-up from the PR 2231 review).StateSyncnow holds a singleVec<Arc<dyn OnNoteReceived>>(the screener plus any additional observers) rather than a separate screener + observer list — matching the "list ofOnNoteReceived" direction from rust-sdk 2209.on_note_receivednow takescommitted_note/public_noteby reference and gains anattachments: Option<&NoteAttachments>parameter; the trait gains defaultedname()and a post-syncapply()method (folded in fromNoteObserver).NoteUpdateActiongains anObservevariant — "mark the block relevant, don't store the note" — replacing the observer's oldOk(true)block-relevance signal.Commit > Insert > Observe > Discard(first observer at the winning precedence supplies the payload).PswapChainObserveris re-expressed as anOnNoteReceived.No behavioral change to PSWAP lineage tracking.