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^CSdecided instances the application reports the digestaof its state; the replica signsCHECKPOINT(low, a)(role 5, share context with view 0, instancelow >> CS, digesta) and sends the share to every replica.qverified 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 theKchunks as they arrive (a chain, one SHA-512 block each), writes them to the application’s shadow copy, and commits only if the digest equalsa; otherwise it aborts and asks the next peer. Then consensus jumps tolow. - 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.
- CkDigest
Req - 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).
- CkSign
Req - Sign request.
- CkState
- State.
- Offer
- A peer’s offer of a certified checkpoint (its shares follow on the collector’s share input).
- Shadow
Commit - Shadow commit or discard.
- Shadow
Write - Shadow write.
- State
Req - 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.
Kchunks make a state;CSis 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).