Skip to content

Conversation

@mononaut
Copy link
Contributor

(NOTE: requires restoring the database to before the migration to previous schema version 105)

change the latest liquid database migration to truncate indexed peg data much less aggressively.

instead of truncating the whole tables, deletes entries in elements_pegs newer than liquid mainnet block 3729730, and in federation_txos newer than bitcoin mainnet block 933800 (shortly before the first transactions involving the new federation addresses).

Copilot AI review requested due to automatic review settings January 27, 2026 01:41
@cla-bot cla-bot bot added the cla-signed label Jan 27, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR modifies the Liquid database migration (version 105) to be less aggressive when truncating indexed peg data. Instead of completely truncating the elements_pegs, federation_txos, and federation_addresses tables, it selectively deletes newer entries while preserving historical data up to specific block heights.

Changes:

  • Changed from TRUNCATE to DELETE operations with block height filters (Liquid block 3729730, Bitcoin block 933800)
  • Added two new federation addresses using INSERT IGNORE instead of truncating and re-inserting all addresses
  • Set state restart points to the cutoff block heights instead of 0

Copy link
Contributor Author

@mononaut mononaut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK @ [1887c69]

@mononaut mononaut requested a review from natsoni January 27, 2026 12:46
@natsoni natsoni force-pushed the mononaut/fix-liquid-peg-migration branch from 1887c69 to bd8719b Compare January 27, 2026 13:28
Copy link
Contributor

@natsoni natsoni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested ACK @ [bd8719b]

Noticed that a few of the first federation UTXOs to the new address were missing with the previous migration parameters, I fixed it by re-indexing further back. It takes a few minutes on my machine, and probably ~an hour on slower servers.

@mononaut mononaut merged commit 735e352 into master Jan 27, 2026
13 of 14 checks passed
@mononaut mononaut deleted the mononaut/fix-liquid-peg-migration branch January 27, 2026 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants