Skip to content

test(registry): remove-compact-reregister counter parity at scale - #357

Merged
miss-yusrah merged 1 commit into
Stellar-TrustBridge:mainfrom
syndeybof-oss:feat/306-remove-reregister-compact-counter-parity
Aug 31, 2026
Merged

test(registry): remove-compact-reregister counter parity at scale#357
miss-yusrah merged 1 commit into
Stellar-TrustBridge:mainfrom
syndeybof-oss:feat/306-remove-reregister-compact-counter-parity

Conversation

@syndeybof-oss

Copy link
Copy Markdown

Remove-then-register counter parity under chunk compaction at scale

Problem

#93 and #110 are individually small, but combined with compact_index the
flat index, the chunked index, and the count / vcount counters can drift
apart. There was no test that:

  • fills chunks,
  • removes a middle band (leaving holes),
  • compacts,
  • re-registers the same names,
  • then checks count, vcount, and the index all agree.

What this adds

A scale-ish scenario test
(test_issue306_remove_compact_reregister_counter_parity in
tests/integration.rs) that:

  1. fills 400 records (8 CHUNK_SIZE chunk boundaries),
  2. removes a middle band spanning chunk boundaries,
  3. verifies a few stayers so vcount is non-trivial,
  4. compacts the sparse index,
  5. re-registers the exact same names at new addresses,
  6. asserts get_stats().total, get_verified_count(), the chunked index,
    and a full paginated export all agree with the live record set.

Also adds invariant I10 to docs/REGISTRY_INVARIANTS.md documenting the
parity guaranteed by this scenario.

No drift was found — the scenario passes.

Closes #306
Closes #303
Closes #304
Closes #305

Issue Stellar-TrustBridge#93/Stellar-TrustBridge#110 are small; combined with compact_index the count, verified
count, and chunked index can drift. Add a scale-ish scenario that fills
several chunks, removes a middle band, compacts, re-registers the same
names, then asserts count/vcount/index all agree with the live records.
Document the invariant (I10) in REGISTRY_INVARIANTS.md.
@drips-wave

drips-wave Bot commented Aug 31, 2026

Copy link
Copy Markdown

@syndeybof-oss Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@miss-yusrah
miss-yusrah merged commit 965f699 into Stellar-TrustBridge:main Aug 31, 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

2 participants