-
Notifications
You must be signed in to change notification settings - Fork 965
[liquid] fix peg db table truncations #6239
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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
mononaut
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK @ [1887c69]
1887c69 to
bd8719b
Compare
There was a problem hiding this 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.
(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_pegsnewer than liquid mainnet block 3729730, and infederation_txosnewer than bitcoin mainnet block 933800 (shortly before the first transactions involving the new federation addresses).