sidetree icon indicating copy to clipboard operation
sidetree copied to clipboard

Investigate custom pruning of non-Sidetree txns

Open thehenrytsai opened this issue 5 years ago • 7 comments

It's possible to set a Bitcoin node to allow custom pruning of select transactions. Investigate what it would take to prune all non-Sidetree transactions, which should reduce retained storage considerably.

thehenrytsai avatar May 21 '19 18:05 thehenrytsai

A temporal workaround would be to prune everything before the sidetree genesis, this way allows to keep a Bitcoin node with small space requirements for a good amount of time.

AlexITC avatar Jun 15 '19 00:06 AlexITC

@AlexITC I agree that we should automatically prune all txns before Sidetree genesis - @thehenrytsai, perhaps we can take a look at this to avoid even iterating those txns to inspect for sidetree hashes?

I wonder if @jlopp has any experience using the prune utilities in Core to prune txns selectively?

csuwildcat avatar Jul 02 '19 14:07 csuwildcat

I'm only familiar with the high-level setting of "keep X megabytes of trailing blocks"

Regarding not pruning specific transactions, I suspect that it won't prune any transactions that are added to the wallet, though I'm not sure if you could add sidetree transactions as watch-only in order to achieve that goal.

jlopp avatar Jul 02 '19 14:07 jlopp

It looks like you MAY be able to achieve this with the 'importPrunedFunds' RPC https://bitcoin.org/en/developer-reference#importprunedfunds

jlopp avatar Jul 02 '19 14:07 jlopp

If you store the raw transaction for each side tree transaction, you shouldn't care if bitcoind prunes those transactions, and you can setup bitcoind to just prune blocks where a rollback is improbable (keeping last 100 blocks on bitcoin is more than enough, which should take around 500 MB on disk).

AlexITC avatar Jul 02 '19 15:07 AlexITC

@csuwildcat Sidetree core only inspect bitcoin transactions for Sidetree hashes from the Sidetree genesis block already. But pruning Bitcoin transaction before Sidetree genesis block is a good idea.

thehenrytsai avatar Jul 20 '19 01:07 thehenrytsai

@csuwildcat to propose a solution on the issue, and get this ready for a reference implementation PR.

OR13 avatar Jul 07 '20 20:07 OR13