Summary
This PR adds an "External Header Mode" for TBC to run in, which causes P2P to be disabled and for TBC to maintain lightweight BTC consensus knowledge based purely on headers that are added/removed by upstream code that manages the External Header Mode TBC instance. Also added a few methods for normal-mode TBC for fetching specific data desired for hVM.
Changes
External Header Mode:
Added the ability to spin up a TBC instance in ExternalHeaderMode which does not connect to P2P and receives header insertions/deletions from upstream code
Ability to associate ExternalHeaderMode TBC instance state with an upstream state ID for upstream reconciliation
Added the ability to remove headers from the chain's view of consensus and set a specific header as canonical afterwards, so that ExternalHeaderMode TBC can be rolled back to a previous consensus state
Added the ability for TBC in ExternalHeaderMode to be initialized with a specific "effective" genesis block, which is assumed permanently canonical so that lightweight conesnsus can be tracked from a specific non-genesis height
Updated methods that will not work with ExternalHeaderMode to return errors when called on ExternalHeaderMode TBC
Other Updates:
Added ScriptHashAvailableToSpend method to check for the existence of a single outpoint in the UTXO table of a normal-mode TBC node
Added FullBlockAvailable method to check whether a normal-mode TBC node has knowledge of a particular full block
Summary This PR adds an "External Header Mode" for TBC to run in, which causes P2P to be disabled and for TBC to maintain lightweight BTC consensus knowledge based purely on headers that are added/removed by upstream code that manages the External Header Mode TBC instance. Also added a few methods for normal-mode TBC for fetching specific data desired for hVM.
Changes External Header Mode:
Other Updates: