From 2ae7562083f5f96490f90e9398762cf6a024d51e Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 29 Nov 2026 04:00:43 +0000 Subject: document: a unit's name, which the swarm passes on by document::UnitId: the name of a unit of a document as its kind has it, an Automerge change's hash. What the swarm announces, forwards along trees, tells a peer it refused and drops is named so (the dissemination, relay, refusals, AppState::drop_taken), and the session is told so what a peer gets from another; a change's hash it is where the document is asked, and on the wire. --- src/state/host.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/state') diff --git a/src/state/host.rs b/src/state/host.rs index 357814e..66bb71c 100644 --- a/src/state/host.rs +++ b/src/state/host.rs @@ -105,7 +105,7 @@ impl AppState { /// second member to say so (`peer` the first, `why` its rules' reason), where it has /// another neighbour: its rules and one peer's word might both be off, the swarm's /// not. Two members colluding pass it; it guards against one. - pub(crate) async fn drop_taken(&self, root: ChangeHash, peer: &str, why: &str) { + pub(crate) async fn drop_taken(&self, root: crate::document::UnitId, peer: &str, why: &str) { /// Changes a drop takes, at most, on one peer's word: more, or more than a tenth /// of the document (past `SMALL_DROP`), wait for another's. const BIG_DROP: usize = 100; @@ -125,7 +125,7 @@ impl AppState { return None; } use crate::document::dropping::{Kept, Tainted}; - let tainted = match Tainted::of(&replica.doc, root)? { + let tainted = match Tainted::of(&replica.doc, root.into())? { Ok(tainted) => tainted, Err(Kept::Root) => { error!(change = %root, "Asked to drop the epoch's root; kept it"); @@ -144,7 +144,7 @@ impl AppState { let mut screening = state.screening.lock_or_recover(); let said = screening .of(replica.epoch_seq) - .hold_drop(root, &peer); + .hold_drop(root.into(), &peer); if said < 2 { error!(change = %root, peer = %peer, changes = count, why = %why, "A peer says we hold a change the swarm's rules refuse, and ours do too, but dropping it takes much: waiting for another member to say so"); return None; -- cgit v1.3.1