Skip to content

feat: Add migration backfill for mptoken_issuance_history#3128

Draft
BryanJ1ang wants to merge 16 commits into
XRPLF:developfrom
BryanJ1ang:brjiang-mpt-rpc-migration
Draft

feat: Add migration backfill for mptoken_issuance_history#3128
BryanJ1ang wants to merge 16 commits into
XRPLF:developfrom
BryanJ1ang:brjiang-mpt-rpc-migration

Conversation

@BryanJ1ang

@BryanJ1ang BryanJ1ang commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Note: this PR depends on previous ETL indexing PR here

Summary

Adds MPTTransactionHistoryMigrator, a Cassandra migration that backfills historical MPT issuance transaction history into the new MPT index tables:

  • mptoken_issuance_transactions
  • account_mptoken_issuance_transactions

The migrator full-scans the transactions table, reuses the live ETL MPT extractor, writes the same deterministic index rows produced by live indexing, and waits for queued async writes before marking the migration as complete.

Details

  • Registers MPTTransactionHistoryMigrator with the Cassandra migration manager.
  • Uses migration scan settings for full-table scanning:
    • migration.full_scan_threads
    • migration.full_scan_jobs
    • migration.cursors_per_job
  • Adds Cassandra driver paging support so token-range scans read all result pages.
  • Makes migration scans select explicit columns instead of relying on table column order.
  • Propagates full-table scanner worker failures so failed scans do not get marked migrated.
  • Keeps the migration non-blocking for Clio startup.

Testing

Added coverage for:

  • Migrator status before and after running.
  • Backfilling MPT issuance create paths and multi-issuance transaction fan-out.
  • Idempotent reruns.
  • Empty transaction tables.
  • Parity between migration backfill rows and live ETL rows.
  • Failed transactions with explicit MPT issuance references.
  • Cassandra paging across more than one driver page.
  • Full-table scanner validation and worker error propagation.

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