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/fork.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/fork.rs')
| -rw-r--r-- | src/federation/fork.rs | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/federation/fork.rs b/src/federation/fork.rs index c5ce727..0333a52 100644 --- a/src/federation/fork.rs +++ b/src/federation/fork.rs @@ -1,8 +1,9 @@ //! Forks (`docs/federation.md`, Forks): a node holding a federation's history makes the //! root of a fork at heads it holds, by a version (`make`), and checks one it is given //! (`check`): whether it builds that root at its heads, what it holds that those heads -//! lack, what the fork's version changes of the one current there, and, party by party, -//! the keys the fork's version gives where they aren't the keys the party had there. A +//! lack, what the fork's version changes of the one current there, and so who writes the +//! places holding a value, and, party by party, the keys the fork's version gives where +//! they aren't the keys the party had there. A //! node that doesn't hold that history takes a fork's root on its operator's word, who //! names the fork by its root's ID (`--store-id`). //! @@ -64,6 +65,9 @@ pub(crate) struct Check { /// What the fork's version changes of the version current at those heads, a line each /// (`client::changes`): its rules among them, whose order says who writes where. pub(crate) changes: Vec<String>, + /// Of the places holding a value there, those whose writer the fork's version changes, + /// a line each (`client::writers`). + pub(crate) writers: Vec<String>, /// Each party whose keys the fork's version gives otherwise than the party had at /// those heads, with its keys there and in the fork. pub(crate) keys: Vec<(String, Vec<String>, Vec<String>)>, @@ -90,6 +94,7 @@ pub(crate) fn check(store: &Store<Federation>, root: &[u8]) -> Result<Check, Str why, lacking: Vec::new(), changes: Vec::new(), + writers: Vec::new(), keys: Vec::new(), }); } @@ -97,6 +102,7 @@ pub(crate) fn check(store: &Store<Federation>, root: &[u8]) -> Result<Check, Str let at = store.state_at(heads); let current = at.current(); let changes = super::client::changes(¤t.json, &version.json); + let writers = super::client::writers(current, version, at.values().keys().map(String::as_str)); let sorted = |mut keys: Vec<String>| { keys.sort(); keys @@ -129,6 +135,7 @@ pub(crate) fn check(store: &Store<Federation>, root: &[u8]) -> Result<Check, Str why, lacking, changes, + writers, keys, }) } @@ -170,6 +177,7 @@ mod tests { why: None, lacking: Vec::new(), changes: check.changes.clone(), + writers: Vec::new(), keys: Vec::new(), } ); |
