Expand description
The view change (W4 steps 3–4; docs/rhdl_ubft-view-change.md): uBFT Algorithm 5 with every NEWVIEW check upstream leaves out.
Problem. ubft_new’s views are local only and never synchronize (UN-F3); its recovery takes the highest self-reported proposal (N14). The original accepts a NEWVIEW from anyone (U02), at any time and more than once (U03, U06), with one replica’s history counted repeatedly (U04), from any sealed view (U05), and never starts a view change by itself (U13).
Idea. A step kernel beside the consensus kernel (crate::consensus):
- Records. For every replica
rit keeps, per window slot, the latest COMMITrCTB-broadcast (view, instance, digest, value), with a flag set once that COMMIT’s certificate is held here. - Seal. On the consensus kernel’s
stalled, or SEALVIEW fromf + 1others for this view, it asks the consensus kernel to seal (the bridge certifies our fast commits) and then CTB-broadcastsSEALVIEW(v), the view named explicitly. - History shares. When
r’s SEALVIEW(v) is delivered and every one ofr’s records is certified, it digestsr’s records (a hash chain, one SHA-512 job per record) and signsHISTORY(v, r, digest)(role 4). A replica whose records never all certify is never vouched for (upstream busy-waits, then crashes on an invalid one). - NEWVIEW.
leader(v + 1)broadcastsNEWVIEW(v + 1, subjects)onceqsubjects’ histories are certified here. A receiver takes it only fromleader(v + 1)(U02), only forv + 1and only once (U03, U06, UE-C6), with exactlyqdistinct in-range subjects (U04, UE-C8), and only when each subject’s certificate is for sealed viewvand its own digest of that subject’s records (U05, U01). Until then it waits. - Safe values. Per slot, the record with the highest view among the subjects; two different digests at the highest view refuse the NEWVIEW. The consensus kernel installs them.
Modules§
- kind
- CTB message kinds of the view change (after the consensus kinds).
Structs§
- Link
- Which link of which history: the sealed view, the subject, the record.
- Record
- One record of replica
r’s commits. - VcConfig
- Configuration.
- VcDigest
- Its answer (the first 32 bytes, little-endian words).
- VcDigest
Req - A digest job of the history chain, for
(subject, j). - VcIn
- Inputs.
- VcKey
- A history-collector key (
instanceis the subject), or our share. - VcOut
- Outputs (requests are holding registers).
- VcSign
Req - Sign
HISTORY(v, subject, digest). - VcSigned
- Our signature for
subject’s history. - VcState
- State.
Constants§
- HIS_
DOMAIN "RUB2-HIS"as a little-endian word.
Functions§
- empty_
record - An empty record, for kernels.
- history_
block - One link of a history chain: 128 bytes,
"RUB2-HIS" ‖ session ‖ view ‖ subject ‖ j ‖ flags ‖ h_j ‖ record view ‖ record instance ‖ record digest ‖ len ‖ value (P ≤ 4 words) ‖ 0, as big-endian SHA-512 words.flagsis 1 for a valid record, 0 for an empty slot. - idle_
install - An idle install, for kernels.
- r_all
- The mask of ids below
n. - vc_
idle_ msg - An idle CTB message, for kernels.
- vc_step
- One cycle of the view change.