diff options
| author | tv <tv@krebsco.de> | 2026-11-19 14:13:39 +0000 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-11-19 15:18:52 +0100 |
| commit | 841897b79838f97a809356471baf2f41e186cdfa (patch) | |
| tree | 6fb5e0ac21b69986c87e8d87e87806ff514b451f /src/federation/party.rs | |
| parent | 27b76d5748f23a879d9fc82c725a58b514020ef9 (diff) | |
continuum-party: which places a proposal gives another writer
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`).
Diffstat (limited to 'src/federation/party.rs')
| -rw-r--r-- | src/federation/party.rs | 15 |
1 files changed, 15 insertions, 0 deletions
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"), } |
