2

The Bitcoin developer guide mentions stale blocks as not being in the longest chain, then moves on to orphan blocks. It states you don't get orphan blocks, "and if you do" they are just dropped. But it doesn't mention whether stale blocks are also "abandoned" (for lack of a better term).

p.s. I'm thinking of using a blockchain for scores in my game, to have a universal top ten sort of thing. Any comments welcome.

4

Stale and orphan blocks are confusing terms with many meanings, depending on whom you ask.

If by stale blocks you mean "blocks that are on branches off the main chain, but are otherwise valid", yes, those still exist. They are inherent to proof-of-work chains, as you can't avoid the case where occasionally two miners produce a competing block. Necessarily, at most one of them can win, and the other one will become stale.

If by orphan blocks you mean "blocks whose parent header is unknown", those indeed don't exist anymore. They were an artefact of the synchronization implementation used until 0.9. Since 0.10, we only request blocks once we have validated all the headers in their ancestry, so blocks without headers known cannot occur anymore.

  • Ok, you just did the same thing. – Engineer May 28 '16 at 21:11
  • @SiteNook: If you meant to ask Pieter to be clearer about a point, I don't think you got your point across understandably. – Murch Jun 13 '16 at 13:46
  • 1
    It's important to note that the term "orphan block" is used almost universally to mean "stale block". The reason for this confusion is that if you are a miner and you mine a block and later that block becomes stale the coinbase transaction showing the payment in your wallet shows a state of "orphaned" because the wallet no longer tracks the block it came from-- from the wallet's perspective the transaction has no parent. So people started calling stale blocks orphan blocks, even though "orphan blocks" was already used in the system and meant something clearly different. – G. Maxwell Jul 23 '18 at 1:17
0

OK, I found out more about stale blocks in Memory Pools.
There's a description of how stale blocks get re-added into the pool one by one with replacements, to be immediately removed if the replacement block are already included, or otherwise re-added by the Bitcoin Core as new transactions, removing confirmed transactions.
Here's the paragraph, in case the link fails:

Transactions which are mined into blocks that later become stale blocks may be added back into the memory pool. These re-added transactions may be re-removed from the pool almost immediately if the replacement blocks include them. This is the case in Bitcoin Core, which removes stale blocks from the chain one by one, starting with the tip (highest block). As each block is removed, its transactions are added back to the memory pool. After all of the stale blocks are removed, the replacement blocks are added to the chain one by one, ending with the new tip. As each block is added, any transactions it confirms are removed from the memory pool.

  • Judging from your answer, I think you're trying to figure out how a chain reorganization happens. Perhaps you want to check out the questions labeled with the chain-reorganization tag. – Murch Jun 13 '16 at 13:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.