Node sync

Nodes within a Kolme chain communicate with each other using the Kolme gossip component. See that document for details of peer discovery and communication.

This page discusses how nodes synchronize with each other. This is the process of finding the latest block and populating the node's storage with the blocks and state hashes necessary to run the Kolme core.

There are three sync approaches. (At time of writing, only the third, slowest, is implemented.)

State transfer (fast sync)

With fast sync, a node requests both the most recent block itself, as well as all Merkle hash blobs necessary to load up the framework and app state for that block. This has the advantage of being not only fast, but being able to fast forward over an arbitrary number of blocks. It has two downsides:

  1. Bandwidth usage may be high, since it needs to transfer the entirety of the state, which could be large. And while the MerkleMap approach to data storage provides for lots of data sharing, that data sharing also increases the storage size for a single copy of the data.
  2. It requires full trust in the processor's version of the state.

Just blocks (medium sync)

In this approach, we transfer just the block data itself over the network. Each node is then responsible to execute the blocks one by one and populate their own data store, validating that the state hashes are identical to the claims of the block at each step.

This may be lighter on bandwidth usage, since it doesn't require transferring the full state. However, it does require transferring all missing blocks, which may be significant.

Side note: we have plans to provide for optimized, bulk downloads of large numbers of blocks. We may do the same thing for fast sync with occasional compressed state files being made available. This also improves on the trust model, by verifying the results of each block execution.

Validated blocks (slow sync)

In addition to the steps taken in "just blocks," we also validate all data loads performed during execution. The impact of this varies by application. For an app that uses cryptographic data loads, verification may require no network traffic and be trivial to perform. For verification that requires an HTTP request for each data load, it could end up being significant.

At time of writing, this is the only sync mechanism implemented.