From 841897b79838f97a809356471baf2f41e186cdfa Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 19 Nov 2026 14:13:39 +0000 Subject: continuum-party: which places a proposal gives another writer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rules go by first match, and `{party}` matches only the names of the version's parties: admitting a party named as a segment of a place, or changing the rules or their order, moves who writes the places below it, and what their writer wrote there counts no more once the version passes. Nothing said so: a proposal showed only its fields' changes. `client::writers` names, of the places holding a value, those whose writer a version changes, as `place: before -> after` (`nobody` where no rule gives it one). `continuum-party proposals` prints them under each proposal's changes (`who writes …`), and a fork's check does for the fork's version (`writers` in POST /events/fork). The guides and federation.md say so; row 72 is tested (`federation_attack_72`). --- src/federation/party.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/federation/party.rs') diff --git a/src/federation/party.rs b/src/federation/party.rs index de8d9f9..f64746b 100644 --- a/src/federation/party.rs +++ b/src/federation/party.rs @@ -363,6 +363,9 @@ pub(crate) async fn main() -> Result<()> { for line in changes { println!(" {line}"); } + for line in check["writers"].as_array().into_iter().flatten() { + println!(" who writes {}", line.as_str().unwrap_or_default()); + } for (party, keys) in check["keys"].as_object().into_iter().flatten() { println!( "{party}'s keys: {} here, {} in the fork", @@ -891,6 +894,13 @@ async fn again(node: &Node, signer: &Signer, record: &mut Record, path: &Path) - async fn proposals(node: &Node) -> Result<()> { let counts = node.counts().await?; let current = current(&counts)?; + // The places holding a value, whose writer a proposal may move. + let places: Vec<&str> = counts["values"] + .as_object() + .into_iter() + .flatten() + .map(|(place, _)| place.as_str()) + .collect(); let parties = |names: &JsonValue| -> String { let names: Vec<&str> = names .as_array() @@ -933,6 +943,11 @@ async fn proposals(node: &Node) -> Result<()> { for line in client::changes(¤t.json, &version) { println!(" {line}"); } + if let Ok(proposed) = Version::read(&version) { + for line in client::writers(¤t, &proposed, places.iter().copied()) { + println!(" who writes {line}"); + } + } } _ => println!(" the event {id} proposes no version of that hash"), } -- cgit v1.3.1