Skip to main content

Module storage

Module storage 

Source
Expand description

What may be assumed about anything read back from storage.

Every result elsewhere in this specification reads state before it reasons about it: a vote is justified by the manager state, a block by its ancestors, a bundle by an inbox cursor. What entitles the reader to act on those bytes is the subject here.

Stored data divides by what its validity proof is — the artifact a reader could check to establish that what came back is what should have been there:

kindvalidity proofif it were wrong
certifieda certificate, checked once on admissiondetected by re-verifying signatures
derivednoneundetectable; can only be recomputed from the certified prefix
configurationnone; assumed identical network-widenot detectable

Content addressing sits beside this rather than inside it. A hash key proves integrity — that the bytes are the ones the key names — which is a different question from whether the data ought to be there at all. A blob’s validity proof is a certificate like anything else’s.

The third row is the one that carries risk, and the specification has been quietly relying on it: the ChainError::CorruptedChainState sites in linera_chain::chain are assertions about derived data, made at the point of use because there is nothing to check it against earlier.

The last statement turns the classification outward: two correct validators at equal heights agree on everything with a validity proof, and are entitled to differ on everything without one.

Shared storage is partitioned by RootKeyBlobId, BlockHash, Event, BlockByHeight, EventBlockHeight, ChainState, NetworkDescription, BlockExporterState — and the classification runs across that partition rather than along it: ChainState alone holds fields of three different kinds.

Traits§

AdmissionChecksTheValidityProof
Lemma (Nothing enters shared storage without its validity proof having been checked). A certificate, a blob or an event in a correct validator’s shared storage was verified against the committee for its epoch before it was written.
BlobValidityRestsOnCertificates
Lemma (A blob’s validity rests on certificates, not on its hash). A blob held by a correct validator is one that a confirmed block published — and so paid for — and every later block that uses it re-attests that it is still owed. Its hash establishes which bytes it is; its certificates establish that it is entitled to exist.
ContentAddressingProvesIntegrity
Lemma (Content addressing proves integrity, not validity). For a blob, the key determines the value: a BlobId is a hash of the content together with its BlobType, so bytes stored under it are either the ones the key names or detectably wrong, with no appeal to who wrote them. Certificates are keyed the same way, by the hash of the block they confirm.
DerivedStateAgreesWithCertifiedPrefix
Invariant (Derived state agrees with the certified prefix). The parts of a chain’s state that are not certified — the block-height indexes, the outbox counters and queues, the inbox cursors — are functions of that chain’s committed blocks, and equal the value that recomputing them from those blocks would give.
InboxEntriesAreNeverReclaimed
Caveat (An inbox entry is never reclaimed). Every structure cross-chain messaging uses is bounded except one: a recipient keeps an inbox entry for each chain that has ever sent it a message, permanently.
StorageConvergesAtEqualHeights
Theorem (Storage converges at equal heights). Take two correct validators that agree on the tip height of every chain. Once cross-chain delivery has quiesced at both — no bundle derivable from a committed block is still undelivered internally — their storage agrees on everything the protocol determines: