node-engine client: RootContract, the contract from which an engine judges an account's root (B5g; ADR 0634 §4; issue 1966)

Claude-Session: https://claude.ai/code/session_01NcbgfFSnn24M3GcqttoU7i
This commit is contained in:
2026-11-05 16:02:42 +01:00
parent 2e0563e983
commit 311654f224
2 changed files with 15 additions and 0 deletions
+4
View File
@@ -13,6 +13,10 @@ import (
// a module declares as the engine placed them (the state data, `<node>.<module>`): their layouts are the seat's contract
// (seat.HealthByNodeValue, seat.DataByNodeModuleValue); this file is their codec, shared by the engine and its readers.
// RootContract is the statement contract from which an engine judges an account's root: a report whose contract is lower
// judged nothing about root, and a reader must not read its empty root verdicts as healthy (HealthByNodeValue.Contract).
const RootContract = 3
// EncodeHealth is h as JSON at the current version; it refuses a report naming no node, and a fall back to the old login
// that names another node, no login fallen back from, no reason or no time.
func EncodeHealth(h seat.HealthByNodeValue) ([]byte, error) {
@@ -0,0 +1,11 @@
package nodeengineclient
import "testing"
// A report below RootContract judged nothing about root; the number is the one engines have written since the root
// judgement began, so a change of it is a change of what a reader trusts.
func TestRootContractIsTheOneEnginesJudgeRootFrom(t *testing.T) {
if RootContract != 3 {
t.Fatalf("RootContract = %d, the engines write 3", RootContract)
}
}