I'm trying to get an understanding of the chain reorganisations my node has experienced by looking at
The "status" of the different branches tells me the following:
1. "invalid" This branch contains at least one invalid block 2. "headers-only" Not all blocks for this branch are available, but the headers are valid 3. "valid-headers" All blocks are available for this branch, but they were never fully validated 4. "valid-fork" This branch is not part of the active chain, but is fully validated 5. "active" This is the tip of the active main chain, which is certainly valid
However I'm not 100% sure what each of these mean in terms of a chain reorganisation. Would I be correct in saying the following:
valid-fork- My node performed a chain reorganisation. I downloaded and validated the blocks in the branch and had them as part of my active chain, but later deactivated them after receiving a new longer chain.
valid-headers- My node observed a possible chain reorganisation. I heard about a competing longest chain, however I did not download the full blocks and activate them as the branch never became longer than my current active chain.
headers-only- My node observed a possible chain reorganisation. I received some (but not all) of the block headers for a competing branch?
Does that sound about right?
I'm trying to get a more practical understanding of what my node is doing when it hears about a potential chain reorganisation. I'm most unsure about the difference between
valid-fork means that the blocks were fully downloaded and validated. It is likely that they were part of the active chain but were reorganized after a better chain was received.
valid-headers means that the blocks were fully downloaded but not fully validated. Only the headers were validated to have a valid Proof of Work before the block was written to disk. Tips with this status could have been
valid-fork, but they never had the chance to become part of the active chain and thus never actually fully validated.
headers-only means that the node only has the block headers but not the full blocks themselves. This could happen for a variety of reasons - maybe a node announced those headers but failed to provide the block itself.
headers-only entry you may see is the Bitcoin Cash fork. This is listed as
headers-only your node may have received the block headers for that fork (up until the PoW changed) but did not download the blocks for those headers after it found that the first block in that fork was invalid.