SpineBlocks - zoobc/zoobc-core GitHub Wiki

Spine Blocks

Description

To implement functionalities such as snapshots and block backups a 'special' type of block, called spine block, is generated at regular intervals, at a slower rate than main blocks. This blocks don't contain transactions and reference two datasets:

  • Spine Public Key
  • Spine Block Manifest

Since there are no transactions, thus no associated mempool, this block type uses a simplified smithing algorithm that doesn't include a block pool and allows blocks to be confirmed at more regular intervals. Not having to decide what transactions to include in a block, the contents of a spine block is purely determined by the state of the blockchain. Therefore any node in consensus will produce precisely the same spine block that any other node would produce at the same block height. Other than that, spine blocks are also cryptographically chained one to another sequentially and broadcast to the network when generated or downloaded when a peer require them, but because of the above properties are more 'stable' and much less sensible to producing forks.

When a node joins the ZooBC network, it first download all spine blocks and after arriving at the latest one, it looks backward to find the latest registered snapshot hash. The node can then compute (as a function of the snapshot hash and the current state of the node registry) which nodes maintain this snapshot, and begin downloading it from them (see Snapshots for details on snapshot generation, download and import).

Spine Public Key

Contains a list of node public keys which have been added to, or removed from, the node registry since the last spine block. As the node applies spine blocks in sequence, the set of additions and removals tracks a “key pool” which roughly follows the set of node public keys in the node registry.

No field type description
1 node_public_key blob node's public key
2 public_key_action integer add (=0) or remove (=1)
3 main_block_height integer block height of reference of the transaction in the node registry
4 latest integer if this is the most updated record for this public key
5 height integer spine block height that references this record

Spine Block Manifest Table

Contains information about a snapshots and block backups (TODO), such as file content's hash and file chunks' hashes

No field type description
1 id integer little endian of hash of all spine_block_manifest fields but itself
2 full_file_hash blob hash of the (snapshot) file content
3 file_chunk_hashes blob sorted sequence of file chunks hashes referenced by the spine_block_manifest
4 manifest_reference_height integer height at which the snapshot was taken for the block type of reference (eg. main blocks)
5 chain_type integer block type this spine_block_manifest references
6 manifest_type integer type of spine_block_manifest (eg. snapshot or block_backup)
7 manifest_timestamp integer timestamp that marks the end of file chunks processing (grace time)