[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:
- Make a backup of the Chronik DB
- Build using ninja
- Run node (using -debug=chronik), it should upgrade automatically to 13
- 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