0

Due to network latencies, some nodes may think they are at a different block height than the rest of the network. How then does a node decide if the target has been recalculated since that changes every 2016 blocks.

1

The target recalculation is not something that is broadcast or something that is announced to nodes. Rather nodes calculate the targets for each block according to a specific algorithm that only requires the blockchain data. It is based on the previous block's target, the block height, and the block timestamps. So each block's target is done completely independently from the network with the only information required being the the blockchain.

Since the algorithm for calculating the target is deterministic, each node will calculate the same difficulty for the same block heights given the same blockchain data.

1

A node will recalculate the difficulty itself every 2016 blocks, and it does so in a deterministic fashion, based upon the previous 2016 blocks.

So each node will, given the same 2016 previous blocks, arrive at the same result for the new network difficulty. We know that all the nodes will indeed have the same 2016 previous blocks, since the network remains in consensus.

If a node is not well connected to the network, and experiences high latency in receiving new blocks, this would not affect that node's ability to compute the new difficulty, once it receives the new block(s). Until the node receives the 2016th block in that period, it would continue to function just fine, even if it is a block behind the rest of the network.

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.