Variable FullNode.stateDB

Persistence-related fields

class FullNode
{
  // ...
  ManagedDatabase stateDB ;
  // ...
}

The node implement persistence through 3 databases.

The blockchain data is binary serialized in a custom format to the disk to allow disk space usage to be reduced, as some data can be pruned in the long run, and there's almost no overhead in the binary serializer. Deleting the blockchain data invalidates both state and cache DB.

State data, which is derived from the blockchain, such as UTXO set and validator set, are stored in the `"state DB". The state DB can be removed, either by user action or if found corrupted or inconsistent with the blockchain data. In such an event, the Ledger would rebuild it from scratch using the blockchain data, an operation which might take some time dependening on the number of blocks.

Cache data is transient data that the node can reasonably loose without compromising its role. This includes the pools (enrollments and txs), as well as any additional metadata, for example peer list.