Status |
---|
| |||||||||||||||||
Stakeholders | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Outcome |
| ||||||||||||||||
Due date | |||||||||||||||||
Owner |
Background
Block synchronization is briefly discussed in whitepaper, nevertheless much more details are needed for this feature. Also several design decisions were taken during the implementation that influence other core modules. Therefore this document is meant to review in detail the current design of block synchronization and start a discussion of what changes are accepted by the core team and what needs to be corrected in the future.
...
- New peer joins the validator network and needs to get the whole blockchain.
- The peer lost several commit messages due to poor internet connection and needs to get the latest blocks.
- The peer was stopped and restarted after some time and needs to get the latest blocks.
- ...
Solution
Gossip
For peers to discover that they do not have latest blocks, peers send their latest block hashes to all other peers in the network every N seconds. If a peer discovers that it has a different latest block hash, it will request the missing blocks from other peers.
...
With this design both the set of validating peers and their roles are known to the synchronizing peer for each new block.