diff options
| author | tv <tv@krebsco.de> | 2026-11-19 21:36:52 +0000 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-11-19 22:38:55 +0100 |
| commit | 5aa649bcb366ed6863732dac68ce081bacdbe4a8 (patch) | |
| tree | 4ab5498bb23cc0f0c30c804efbb5b5321c6c0f14 | |
| parent | 237c79efc5d25f438d024522fd89ea7fc600cbd1 (diff) | |
continuum-party status: IDs and hashes whole
Now that `status` gives each thing a line of its own, there's no line to
keep short: the store's ID, its checkpoint's and the version's hash are
written whole, as node IDs and proposals' hashes were already; so are the
proposals' hashes in what a vote's guard says. Keys still go by their
fingerprints.
| -rw-r--r-- | docs/guides/federation/watching.md | 18 | ||||
| -rw-r--r-- | src/federation/party.rs | 19 |
2 files changed, 15 insertions, 22 deletions
diff --git a/docs/guides/federation/watching.md b/docs/guides/federation/watching.md index 7b71bf4..8105286 100644 --- a/docs/guides/federation/watching.md +++ b/docs/guides/federation/watching.md @@ -12,10 +12,10 @@ version, the party's keys and nodes, the node's stop, the proposals on the curre the versions the node refused of its own, and what the party signs again after a move: ``` -store 6d1e8a0c4f2b… - checkpoint 6d1e8a0c4f2b… +store 6d1e8a0c4f2b9d77… + checkpoint 6d1e8a0c4f2b9d77… 3 heads, 120 events taken after the checkpoint -version 3 (a7c2e81b9d04…) +version 3 (a7c2e81b9d0453f6…) federation 1, the base revision 3 parties, 2 passing a change: lass @@ -28,15 +28,17 @@ tv ssh-ed25519 SHA256:pX4c… (--key) ssh-ed25519 SHA256:r82M… nodes: - continuum:5be1… (alpha) - continuum:77d0… + continuum:5be1a3c09f2e4d6b… (alpha) + continuum:77d0c2e4f6a8b0c2… the node: lass's 1 proposal on version 3 (show says more): - 8d02…: can still pass, 1 more `true` passing it (2 of 3); true: tv; false: nobody + 8d02f1e3a5c7b9d0…: can still pass, 1 more `true` passing it (2 of 3); true: tv; false: nobody ``` -Each node goes by the name it gave itself (`--alias`), where it did: `names` of each -party in `GET /events/counts`. +IDs and hashes are cut short here; the client writes them whole, the shortest prefix +naming a proposal in bold on a terminal, and keys by their fingerprints. Each node goes +by the name it gave itself (`--alias`), where it did: `names` of each party in `GET +/events/counts`; one that gave itself none goes by its ID alone. * **A version the node refused** (`own` in `GET /events/refused` not empty): keys voted twice, and nodes may be apart. Act on it at once diff --git a/src/federation/party.rs b/src/federation/party.rs index a1eb6a0..29d9cb8 100644 --- a/src/federation/party.rs +++ b/src/federation/party.rs @@ -1604,14 +1604,13 @@ fn consistent(counts: &JsonValue, current: &Version, record: &Record) -> Result< /// How the party's votes on `current` that `counts` shows differ from `record`'s: those the /// node shows that the record lacks, and those the record holds that the node doesn't show; -/// each as `true on 8d02…`. +/// each as `` `true` on <proposal's hash> ``. fn unrecorded( counts: &JsonValue, current: &Version, record: &Record, ) -> (Vec<String>, Vec<String>) { let party = record.party.as_str(); - let short = |hash: &str| format!("{}…", hash.get(..12).unwrap_or(hash)); let mut shown = Vec::new(); for (hash, ballot) in counts["proposals"].as_object().into_iter().flatten() { for (what, yes) in [("yes", true), ("no", false)] { @@ -1628,7 +1627,7 @@ fn unrecorded( .into_iter() .map(|(proposal, yes)| (proposal.to_string(), yes)) .collect(); - let spelled = |(hash, yes): &(String, bool)| format!("`{yes}` on {}", short(hash)); + let spelled = |(hash, yes): &(String, bool)| format!("`{yes}` on {hash}"); ( shown .iter() @@ -1828,16 +1827,12 @@ async fn status(node: &Node, options: &Options, party: Option<&str>) -> Result<( let summary = node.get("/events").await?; let counts = node.counts().await?; let current = current(&counts)?; - let short = |id: &str| match id.get(..12) { - Some(start) if id.len() > 12 => format!("{start}…"), - _ => id.to_owned(), - }; let text = |value: &JsonValue| value.as_str().unwrap_or_default().to_owned(); let plural = |n: usize, one: &str, many: &str| format!("{n} {}", if n == 1 { one } else { many }); let heads = summary["heads"].as_array().map_or(0, Vec::len); - println!("store {}", short(&text(&summary["store"]))); - println!(" checkpoint {}", short(&text(&summary["checkpoint"]))); + println!("store {}", text(&summary["store"])); + println!(" checkpoint {}", text(&summary["checkpoint"])); println!( " {}, {} taken after the checkpoint", plural(heads, "head", "heads"), @@ -1848,11 +1843,7 @@ async fn status(node: &Node, options: &Options, party: Option<&str>) -> Result<( ) ); let needed = (2 * current.parties.len()).div_ceil(3); - println!( - "version {} ({})", - current.number, - short(¤t.hash.to_string()) - ); + println!("version {} ({})", current.number, current.hash); println!( " federation {}, {}", counts["version"]["version"]["federation"], current.revision |
