diff options
| author | tv <tv@krebsco.de> | 2026-11-19 04:00:12 +0000 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-11-19 05:13:38 +0100 |
| commit | 0d2467e15ec0c9c035b1074a2dd4eece6b24c599 (patch) | |
| tree | e544ce8ae1c31e9556191d3f99157b5bd61b1f14 /src/federation/client.rs | |
| parent | efaf79e7fd55db2b9704ccefedde33346f874a1d (diff) | |
federation: revisions shown, named, and moved to by hand
An operator moving the federation to a revision had nothing to say which revisions a
node knows, nor which one the current version follows, and a hash where a name would do.
`GET /events` lists the revisions the node's continuum knows, each its number, its ID,
the feature it adds and what that adds, and as people read it ("revision 1
(merge-events)"); `GET /events/counts`, the current version's. `continuum-party next
--revision FEATURE` begins a version following the revision adding it, never an earlier
one than the current version's, and `next` says so where the node knows a later one.
`proposals` shows a change of revision as people read it, a revision this continuum
doesn't know so said. A client backs a version moving to a revision only where its node
knows it, and says why otherwise: once passed, a node that doesn't stops there.
The upgrades guide walks through moving to a revision: upgrade every node, propose, vote,
and what follows; the proposing guide lists `revision`, and the API's spec the rest.
Diffstat (limited to 'src/federation/client.rs')
| -rw-r--r-- | src/federation/client.rs | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/federation/client.rs b/src/federation/client.rs index 4d61944..7b9d3d7 100644 --- a/src/federation/client.rs +++ b/src/federation/client.rs @@ -433,7 +433,8 @@ pub(crate) fn binding( /// What the version `proposed` changes of `current`, a line each: each field whose value /// differs, and of `keys` and `nodes` each party's, as `field: before -> after`, its JCS -/// on either side, `-` where a version lacks it. +/// on either side, `-` where a version lacks it; the revision as people read it +/// (`revision::described`). pub(crate) fn changes(current: &Json, proposed: &Json) -> Vec<String> { fn text(json: Option<&Json>) -> String { json.map_or_else( @@ -450,6 +451,14 @@ pub(crate) fn changes(current: &Json, proposed: &Json) -> Vec<String> { if before == after { continue; } + if name == "revision" { + lines.push(format!( + "revision: {} -> {}", + super::revision::described(before), + super::revision::described(after) + )); + continue; + } let by_party = matches!(name, "keys" | "nodes") && [before, after] .iter() @@ -887,5 +896,16 @@ mod tests { ] ); assert!(changes(¤t, ¤t).is_empty()); + let one = super::super::revision::Revision(1).id(); + let revised = read(&format!( + r#"{{"number": 0, "changes": null, "keys": {{"tv": {{"since": 0, "keys": ["a"]}}}}, + "revision": "{one}", "rules": []}}"# + )); + assert_eq!( + changes(¤t, &revised), + [format!( + "revision: the base revision -> revision 1 (merge-events), {one}" + )] + ); } } |
