HomePhabricator

[Chronik] Clear OP_RETURN scripts from script index, enable DB upgrade to…

Description

[Chronik] Clear OP_RETURN scripts from script index, enable DB upgrade to version 13

Summary:
Deletes all OP_RETURN scripts from the DB (using ranges). Also report on oversized (and thus unspendable Scripts). We might want to not add those to the DB in the future, too.

Also, we enable the DB upgrade to version 13, this is currently disabled until all upgrades are in place.

This way, we have all three upgrades in one batch:

  • Add the missing MINT VAULT txs (patched out in D16916), using the (later deleted) OP_RETURNs still indexed in the DB
  • Fixing invalidly compressed P2PK scripts (patched out in D16899)
  • Removing the OP_RETURN scripts (patched out in D16917)

Depends on D16938.

Test Plan:

  1. Make a backup of the Chronik DB
  2. Build using ninja
  3. Run node (using -debug=chronik), it should upgrade automatically to 13
  4. It should now update first the MINT VAULT txs, then the P2PK scripts, then remove the OP_RETURNs

Reviewers: #bitcoin_abc, PiRK

Reviewed By: #bitcoin_abc, PiRK

Differential Revision: https://reviews.bitcoinabc.org/D16941

Details

Provenance
tobias_ruckAuthored on Oct 19 2024, 22:39
tobias_ruckPushed on Oct 22 2024, 08:54
Reviewer
Restricted Project
Differential Revision
D16941: [Chronik] Clear OP_RETURN scripts from script index, enable DB upgrade to version 13
Parents
rABC9032f454dcf8: [Chronik] Fix incorrectly compressed P2PK scripts
Branches
Unknown
Tags
Unknown