Double Spend Proofs
- run unit tests + extended functional tests
ninja all check check-functional-extended)
- run the benchmark test plan from 308c8d26
- run the fuzzing test plan (cmake only) from cc5b98f7
- review docs
The original MR !700 (closed) description is below.
The specification as it is now; spec
The double spend proof code detects double spends, sends an INV to peers and handles getdata requests by introducing a new 'dsproof-beta' message.
This adds a DoubleSpendProof and a DoubleSpendProofStorage set of classes which are as you'd expect. The storage is owned by the mempool and the mempool will delete DSPs from the DSPStorage as the transaction they belong to go away (for instance if they are mined). The link between a transaction in the mempool and its proof are by the addition of the
dsproof int in the
Known issue: the code currently only manages to create DSPs when the UTXO it double spends is a p2pkh. This helps for the majority of the cases on the net, but this issue is the main reason we have the name 'beta' in the message name. The current message structure might just work for this, but lets get something deployed and tested in wallets first, ok? The second reason for calling it 'beta' is because I don't pretend to be a genius that can predict the issues we get when this is deployed and PoS systems start using this. Again, lets get this deployed first :)
DO NOT SQUASH
(This has already been squashed down from https://gitlab.com/freetrader/bitcoin-cash-node/-/commits/dsproof_resume_after_rebase )