refactor(pxe): append only NoteStore and PrivateEventStore - #23785
Merged
mverzilli merged 62 commits intoJun 5, 2026
Conversation
… as nullified at finality
merge-train/fairies had reverted the CanonicalBlockStore foundation this slice builds on. Resolution: slice-owned PXE storage paths take this branch's version (re-applying the foundation + reorg work, dropping the revert's stale pre-foundation artifacts); merge-train's other changes (stdlib, simulator, txe rpc) are merged in. No merge-train work in slice paths was lost (zero file overlap).
… stores Reads are now unconditional: delete-on-prune keeps the note and private-event stores canonical by construction, so a recorded nullification origin always reflects the canonical chain and event visibility depends only on the block range. Removes the CanonicalityCheck interface (and canonicality_check.ts), the per-store #check field/constructor arg, and flips every store construction to a single argument. Obsolete pure-canonicality tests are removed; behavioral tests are retained and adapted.
mverzilli
commented
Jun 4, 2026
Thunkar
reviewed
Jun 4, 2026
Thunkar
reviewed
Jun 4, 2026
nchamo
approved these changes
Jun 4, 2026
Contributor
|
Oh, and don't forget to change the target branch! |
mverzilli
changed the base branch from
merge-train/fairies
to
merge-train/fairies-v5
June 5, 2026 09:04
mverzilli
enabled auto-merge (squash)
June 5, 2026 09:37
This was referenced Jun 5, 2026
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.
Refactors mainly NoteStore so that discovered nullifiers are modeled as append-only rows instead of mutating stored notes. Note the store isn't 100% append-only: adding scopes to a note still causes a modification. I deemed this less cumbersome than introducing more indexes just to track scopes.
Includes some minor touches to PrivateEventStore mostly to align style, since it was already mostly in the shape we need it to.
Context: this is preliminary work for the "time-travelling pxe db" project. We need reorg semantics to be consistent between stores, dealing with mutation on reorgs makes the whole model harder to reason about.
You'll see a longer than expected commit history: this is because I originally set out to change the way we handle reorgs much more fundamentally, by making the stores tolerate multiple versions of notes and events as long as they are recorded as having been originated from different blocks (which could happen in reorg scenarios). Implementing said approach made me realize we don't win much from the additional complexity: in order to filter out "orphaned" data and eventually being able to reap it, we would need to keep track of height->hash mappings from genesis.
At that point, the delete-on-chain-prune original approach seemed more sensible, which ostensibly reduced the scope of this change to what I describe above.