Skip to main content

Module checkpoint

Module checkpoint 

Source
Expand description

Certified checkpoints and state transfer (W5; docs/rhdl_ubft-checkpoints.md).

Problem. A replica that falls behind cannot catch up: ubft_new has no checkpoints (N18); upstream throws “state transfer not implemented” (U12), spins on a tail gap (U09), and accepts a checkpoint equal to its own without binding the certificate to the content (UE-C20).

Idea.

  • At every C = 2^CS decided instances the application reports the digest a of its state; the replica signs CHECKPOINT(low, a) (role 5, share context with view 0, instance low >> CS, digest a) and sends the share to every replica. q verified shares certify exactly (low, a).
  • A replica behind a checkpoint it never computed takes a peer’s offer (low, a) with its shares (forwarded into the same collector), and adopts it only once every share verifies here.
  • Behind a certified checkpoint, it requests the state at low, hashes the K chunks as they arrive (a chain, one SHA-512 block each), writes them to the application’s shadow copy, and commits only if the digest equals a; otherwise it aborts and asks the next peer. Then consensus jumps to low.
  • Every index, length and peer id from the network is range-checked before use; every wait has a deadline.

Modules§

phase
Phases of the catch-up.

Structs§

AppDigest
The application’s digest at a checkpoint.
Chunk
One state chunk from a peer.
CkConfig
Configuration.
CkDigest
A chain digest answer.
CkDigestReq
Chain digest request (a 128-byte block; the job adds the pad block).
CkIn
Inputs.
CkKey
Open a checkpoint-collector key (0, low >> CS, digest), or give it our own share.
CkOut
Outputs (holding registers).
CkSignReq
Sign request.
CkState
State.
Offer
A peer’s offer of a certified checkpoint (its shares follow on the collector’s share input).
ShadowCommit
Shadow commit or discard.
ShadowWrite
Shadow write.
StateReq
State request.

Constants§

CHUNK
Words per state chunk (64 bytes).
ROLE_CHECKPOINT
Role byte of a checkpoint share.
STA_DOMAIN
"RUB2-STA" as a little-endian word.

Functions§

ck_step
One cycle of checkpointing and catch-up. K chunks make a state; CS is log2 of the checkpoint interval.
state_block
One link of the state chain: "RUB2-STA" ‖ session ‖ low ‖ j ‖ h_j ‖ chunk_j (128 bytes, big-endian SHA-512 words).