Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Allow nodes to (manually) recover from dreaded "Already Spent" error #3018
We still have scenarios and edge cases where we see the dreaded "Already Spent" error in the logs and a node fails to accept new blocks.
Assuming this is not a double spend attempt this indicates the local UTXO set was corrupted somehow. The UTXO set consists of -
It would be really useful if a node could recover from this somehow.
Potential steps to recover -
aka Minimal fast-sync given preexisting txhashset MMRs and header MMRs
This would not need to be a realtime or automatic resolution. Node operators could explicitly start a node in recovery mode or something similar - this should primarily be used by devs/qa messing with code on branches etc.
This should not be something that triggers automatically on regular nodes (risking bigger underlying issues getting hidden and not surfacing).
Just had a related thought - maybe we do not need to ask peers for a fresh leafset.
When we download a txhashset.zip as part of fast sync we receive a snapshot leafset like
As long as we have full blocks in our local db for all blocks after that leafset snapshot/backup we should be able to rebuild our MMRs robustly locally.