From 6be5646df342b21fe82c63f59cfec5a369ab54f8 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 15 Nov 2026 12:28:33 +0000 Subject: signed values: value and meta apart, numbered; the highest seq is read A member could put a user's older signed value back beside a newer one: a change made with dependencies from before both is judged where the place was empty, so the older envelope (`prev` empty) is taken; and of values written at once, the one read was the one with the highest operation, which whoever writes the change steers. A revoked capability, a lifted ban or an earlier policy came back that way, signed by whoever signed it then. An envelope is now `cv2...`: the value as its user wrote it, and apart from it what continuum adds (swarm, path, user, at, seq, prev), the signature over the value's line and the meta's. `seq` is one more than that of the envelope it replaces, 0 where it replaces none; every node checks it with `prev`. Of the values a place holds, written at once, signed ones are read before any other, the highest `seq` first, of equal ones the lower digest (`store::candidates`): reads, snapshots and writes all go by it. An older envelope beside a newer one changes nothing. `application/continuum-signed` is the value's line, the meta's, then the signature; `scripts/continuum-signed` writes and checks it so. The wire version goes up: nodes must agree on what a place's value is. --- src/access/rules.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/access/rules.rs') diff --git a/src/access/rules.rs b/src/access/rules.rs index 5c839af..738cdf8 100644 --- a/src/access/rules.rs +++ b/src/access/rules.rs @@ -964,14 +964,15 @@ mod tests { ); let sealed = |at: &str, prev: &str| { let payload = envelope::Payload { + value: json!({"mode": "fast"}), swarm: "s".to_owned(), path: path(at), - value: json!({"mode": "fast"}), user: "alice".to_owned(), at: 1, + seq: u64::from(!prev.is_empty()), prev: prev.to_owned(), }; - let bytes = serde_json::to_vec(&payload).unwrap(); + let bytes = payload.signed(); envelope::seal(&bytes, &sshsig::sign(&key, envelope::NAMESPACE, &bytes)).unwrap() }; let judged = |doc: &Document, ops: Vec| { -- cgit v1.3.1