Skip to content

feat: add termination on root mismatch in store#1569

Merged
drahnr merged 5 commits intonextfrom
bernhard-1328-fail
Jan 22, 2026
Merged

feat: add termination on root mismatch in store#1569
drahnr merged 5 commits intonextfrom
bernhard-1328-fail

Conversation

@drahnr
Copy link
Contributor

@drahnr drahnr commented Jan 22, 2026

When the store finds itself in a situation where the nullifier tree update doesn't align with the nullifier root in the block_header

Review notes:

  • uses an mpsc so we don't have to Option wrap, we can have multiple concurrent requests that trigger the code-path, having channel capacity small means the first to hit the path will block all following ones and trigger termination
  • State::load is not called via RPC, so the error does terminate correctly

Closes #1328

Copy link
Collaborator

@Mirko-von-Leipzig Mirko-von-Leipzig left a comment

Choose a reason for hiding this comment

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

Only question for me is whether this is the correct sync primitive, but its probably just semantics tbh. e.g. https://docs.rs/tokio/latest/tokio/sync/struct.Notify.html.

Co-authored-by: Mirko <48352201+Mirko-von-Leipzig@users.noreply.github.com>
@drahnr
Copy link
Contributor Author

drahnr commented Jan 22, 2026

I considered notify, but then we'd lose context on what failed, and I am not aware of a better primitive to transfer a few bytes.

@drahnr drahnr merged commit 3758846 into next Jan 22, 2026
7 checks passed
@drahnr drahnr deleted the bernhard-1328-fail branch January 22, 2026 11:15
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.

AccountTree: Establish re-synchronization between sqlite and rocksdb storage

2 participants