[svm-acc] feat: off-chain backfill migration tooling#50
Open
bengtlofgren wants to merge 4 commits into
Open
Conversation
bengtlofgren
force-pushed
the
ntt-accountant-backfill
branch
from
July 21, 2026 11:06
e6da074 to
3b990a0
Compare
Standalone ga-backfill CLI (own Cargo workspace, isolated deps): reads the wormchain snapshot catalogue and drives the on-chain WTT/NTT backfill programs at scale (chunking, cursor/progress tracking, submission, balance reconciliation, stats).
reconcile_balances.rs previously inlined the entire reconciliation loop in fn main(), making it untestable from tests/ (it compiled as its own bin crate root, not part of the ga_backfill library). Move the logic to a new balance_reconcile module (mirroring the compute/run split already used by stats.rs); the binary becomes a thin CLI shim over it. Behavior-preserving — same sign rule, same output format. Also drops two stale doc-comment references: a `just reconcile-ntt`/ `just reconcile-wtt` pointer (no such recipes exist in this branch's justfile) and a `.claude/tasks/...` pointer (excluded from this PR).
Covers both transfer sign-rule directions (native lock/wrapped mint, wrapped burn/native unlock), a mismatch against a wrong committed balance, unexpected net activity with no committed row, zero-net activity correctly not flagged, modification add/subtract netting, credit overflow surfacing as an error, and a sanity check against the shared sample fixture.
bengtlofgren
force-pushed
the
accountant-backfill-tooling
branch
from
July 21, 2026 11:07
cff2e39 to
e115700
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
Split out of
bengt/global-accountant-svm-scaffold. Base is #49 (NTT backfill program) — this tool'stx_builder.rsimportsntt_global_accountant_backfill::Instructionandreconcile.rs/tx_builder.rsuse the NTT PDA layouts/seed prefixes directly, so #49 (and transitively #23) must merge first.Adds
tools/backfill/— a standalone Rust CLI (ga-backfill, its own isolated Cargo workspace/lockfile) that reads the wormchain snapshot catalogue and drives the on-chain WTT/NTT backfill programs at scale:catalogue.rs/chunker.rs/cursor.rs— snapshot ingestion, tx-size chunking, progress cursorsubmitter.rs/tx_builder.rs— async submission, instruction building for both backfill programsreconcile.rs/reconcile_balances.rs/stats.rs— post-migration balance reconciliation and reportingByte-identical to the scaffold branch's version — no adaptation needed since it's a new standalone crate with no pre-existing local divergence to reconcile.
Test plan
cargo testfromsvm/accountant/tools/backfill/(standalone workspace)cargo check --locked— copied Cargo.lock from scaffold verbatim, not re-verified with a toolchain in this environment#[ignore]d e2e tests (e2e_against_surfpool.rs,e2e_ntt_against_surfpool.rs) against a local surfpool instance