Skip to content

fix: add SMT root mismatch verification in operator sender#2

Open
gitteri wants to merge 1 commit into
mainfrom
fix/indexer-smt-verification
Open

fix: add SMT root mismatch verification in operator sender#2
gitteri wants to merge 1 commit into
mainfrom
fix/indexer-smt-verification

Conversation

@gitteri

@gitteri gitteri commented Feb 20, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds a critical safety check: before the operator proceeds with a withdrawal batch, it now verifies that the locally-computed SMT root matches the on-chain root stored in the instance account.
  • If a mismatch is detected (e.g. after an operator crash between on-chain tx confirmation and local DB update), it logs detailed diagnostic info and returns a new SmtRootMismatch error instead of silently diverging.

Changed files

  • indexer/src/error/transaction.rs -- new SmtRootMismatch error variant
  • indexer/src/operator/sender/state.rs -- root verification logic before withdrawal processing

Test plan

  • Verify operator starts normally when local and on-chain roots match
  • Simulate a root mismatch and confirm the operator halts with the SmtRootMismatch error and diagnostic logs

Made with Cursor

Verify local SMT root matches on-chain root before proceeding with
withdrawals. Prevents silent state divergence after operator crashes
between on-chain tx and database update.
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.

1 participant