Skip to content

fix(lore-0521): the seed writes signers only for accounts newer than ours - #568

Merged
karolko9 merged 1 commit into
developfrom
fix/0521-entry-state-gate
Sep 30, 2026
Merged

karolko9 merged 1 commit into
developfrom
fix/0521-entry-state-gate

Conversation

@karolko9

@karolko9 karolko9 commented Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator

Logic, ops tool (backfill-runner snapshot-seed) — task 0521. The seed writes signers only for accounts newer than ours. Replaces #446.

Why

Pass 4 of snapshot-seed emitted every live account into account_entry_state on every run. That was right before the live signers writer existed and wrong since it deployed (2026-08-24): the second production pass re-emitted 10,872,072 rows identical to what we held. The data was never at risk (same version, RMT collapses them), but the summary line was a constant and could not show the live writer stopping.

#446 fixed this on the old seed.rs layout; task 0210 has since split the seed passes into modules, so the gate is rebuilt on the new structure.

What changes

  • snapshot/entry_state.rs (new, beside balances / claimable / pools): reads our newest last_updated_ledger per account (sliced on account_id, RMT duplicates grouped) and writes a row only when the snapshot's entry is newer — pools::need, the rule the classic-pool pass already applies.
  • seed.rs: pass 4 calls the module (−15 lines); summary.txt reports account_entry_state N (a new, b changed; c unchanged), the three summing to the live accounts.
  • docs/backfills.md: how to read that line — a later pass that writes millions again means the live signers writer stopped stamping.

Verified

  • backfill-runner tests: 84 pass, incl. new only_accounts_newer_than_ours_are_written (new, behind, same version, ours ahead, merged-away account); with the gate removed it fails ([1, 2, 3, 4] written instead of [1, 2])
  • clippy -D warnings, fmt clean
  • Production dry run (read-only, 2026-09-30, checkpoint 64,699,071, 1,339 s): account_entry_state 0 (0 new, 0 changed; 11004932 unchanged) — the three sum to the snapshot's 11,004,932 live accounts exactly; we hold 11,130,680. Every other correction as expected: 17 balance ghosts (16 classic, 1 native, 0.0061841 XLM), no stubs, no unresolved references.
  • Unrelated counter seen in the same run: native divergent SAME ledger 16,511 (18,363 on 2026-09-02) — task 0514, not touched here.

Deploy

None — an operator tool run by hand.

Refs task 0521.

…ours

Pass 4 of snapshot-seed emitted every live account on every run. Right
before the live signers writer existed, wrong since it deployed
(2026-08-24): the second production pass re-emitted 10,872,072 rows
identical to what we held, so its summary line was a constant.

The pass is now its own module, `snapshot::entry_state`, beside the
balances, claimable and pools passes task 0210 split out. It reads our
newest `last_updated_ledger` per account (sliced on account_id, RMT
duplicates grouped) and writes a row only when the snapshot's entry is
newer — `pools::need`, the rule the classic-pool pass already applies to
its snapshots. The summary reports new, changed and unchanged; they sum to
the live accounts.

Replaces #446, whose gate was built on the seed.rs layout 0210 changed;
the logic is the same, and #446's production dry run (0 written,
10,909,433 unchanged at checkpoint 64,237,951) is the expectation for a
re-run.
@karolko9
karolko9 merged commit 1cf944e into develop Sep 30, 2026
7 checks passed
karolko9 added a commit that referenced this pull request Sep 30, 2026
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