You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When starting node we must synchronize our local DB and download new blocks.
Further algorithm will describe this process in details:
We discover current blockchain height
We optionally discover top blockchain height from the network (via hello message)
We send
BlockHeadersRequest {
low: m
high: m + d
}
Receive
BlockHeadersResponse{
headers []*BlockHeader
}
We can receive chunk less than m +d height, it's normal. The only requirement here that we must receive correct subchain without block absence, orphans will be filtered.
If chunk is incorrect, we add ban score and retry request (next)
We can receive chunk without head on height m, it is normal, since previous responser could not have this exact fork. In this case we start requesting block headers of potential fork sequentially, until we find parent in current blockchain or hit depthLimit.
If we received correct chunk and we are able to add it to existing chain and new chain is correct, we start to download block bodies in parallel.
It is possible not to receive arbitrary block. In this case we simply drop chunk till this height and request blocks on next height again (go to start)
When we receive all blocks, request next blocks.
For each request we have peer group (f + 1), we send query to first one and expect to receive correct request in time. If we can't, we go to next peer in group. If we asked every peer, we report error.
The text was updated successfully, but these errors were encountered:
When starting node we must synchronize our local DB and download new blocks.
Further algorithm will describe this process in details:
We discover current blockchain height
We optionally discover top blockchain height from the network (via hello message)
We send
BlockHeadersRequest {
low: m
high: m + d
}
Receive
BlockHeadersResponse{
headers []*BlockHeader
}
We can receive chunk less than m +d height, it's normal. The only requirement here that we must receive correct subchain without block absence, orphans will be filtered.
If chunk is incorrect, we add ban score and retry request (next)
For each request we have peer group (f + 1), we send query to first one and expect to receive correct request in time. If we can't, we go to next peer in group. If we asked every peer, we report error.
The text was updated successfully, but these errors were encountered: