diff options
| -rw-r--r-- | docs/federation-tests.md | 22 | ||||
| -rw-r--r-- | docs/federation.md | 86 | ||||
| -rw-r--r-- | docs/store.md | 34 | ||||
| -rw-r--r-- | src/federation/store/memory.rs | 69 | ||||
| -rw-r--r-- | src/federation/store/mod.rs | 4 | ||||
| -rw-r--r-- | src/federation/store/testfold.rs | 15 |
6 files changed, 84 insertions, 146 deletions
diff --git a/docs/federation-tests.md b/docs/federation-tests.md index 4ab3f64..104df96 100644 --- a/docs/federation-tests.md +++ b/docs/federation-tests.md @@ -30,9 +30,9 @@ are. * **Keys.** Ed25519 keys made from seeds, signing as `ssh-keygen -Y sign` does; a vector checks one signature against `ssh-keygen` itself. * **Events.** A builder for every kind (writes, key sets, node lists, proposals, votes, - version events, checkpoints, roots, forks and merges), each from a party, a key and - its dependencies, encoded and signed as the design says; and for what is none: bytes - that aren't JCS, a field missing or more, another key, a broken signature, too large. + version events, checkpoints, roots and forks), each from a party, a key and its + dependencies, encoded and signed as the design says; and for what is none: bytes that + aren't JCS, a field missing or more, another key, a broken signature, too large. * **Scenarios.** A scenario is a value: the parties and the first version, events by name with their dependencies, which node is given which events in which order, and what is expected (each node's verdicts, the current version, what counts, the @@ -50,7 +50,7 @@ are. passing and dead, for every number of parties from 1 to 20; one yes at a time; which version a node takes, and the current one; a party's keys and node list by their `since`; a place's value; rules matching (`{party}`, `*`, `**`, first match); what - counts, item by item; checkpoints and what they keep; forks and merges. + counts, item by item; checkpoints and what they keep; forks. * **The attacks marked unit**, each by a scenario, its expectation the row's. * **The store** with a fold made for its tests, smaller than the federation's, for what `store.md` checks (Tests): order, history, refusal, checkpoints. @@ -79,10 +79,8 @@ each after its dependencies), and for seeded histories and orders beyond that. judging it with the whole history gives; reading gives what the whole history reads but for what counted no more; nodes moving at different times read the same once they hold the same; moving refuses nothing that decided it. -8. **Forks and merges.** A fork takes nothing of the stores it came from after its - heads, nor they of it; a merge's state is the values that count on each side at - places its version gives their party, and a key dropped on one side brings back - nothing until its party lists it again. +8. **Forks.** A fork takes nothing of the store it came from after its heads, nor that + store of it; and its root keeps what counts at its heads with its version current. 9. **Votes a node casts by itself.** By its rules a node casts one yes at a time, never `true` and `false` on one proposal, and, by a rule for checkpoints, backs nothing that changes more. @@ -113,9 +111,9 @@ each row marked sim expects. ## Fixed bytes Vectors for: an event and its ID, a signature, a version and its hash, a checkpoint and -its ID, the genesis change of a federation's root, of a fork's and of a merge's, and a -snapshot after a checkpoint. A vector that changes is a change of the federation, which -takes its next number ([`federation.md`](federation.md), Changing the federation). +its ID, the genesis change of a federation's root and of a fork's, and a snapshot after +a checkpoint. A vector that changes is a change of the federation, which takes its next +number ([`federation.md`](federation.md), Changing the federation). ## Fuzzing and mutants @@ -144,7 +142,7 @@ takes its next number ([`federation.md`](federation.md), Changing the federation 3. **The store on Automerge**: the same as in memory, changes that stay sound, the store's attacks marked unit, the simulations of a federation without forks or remakes, the vectors of genesis changes. -4. **Forks**, merges among them: their rows, properties and vectors. +4. **Forks**: their rows, properties and vectors. 5. **Remakes**: their rows and simulations, and the vector of a snapshot after a checkpoint. 6. **The registry**: its rules by example, and the tools reading and writing kartei. diff --git a/docs/federation.md b/docs/federation.md index 46404d9..2041d7e 100644 --- a/docs/federation.md +++ b/docs/federation.md @@ -58,8 +58,8 @@ nothing coming from any node breaks a promise for the others. keys voting twice, a version that passed stays, on every node; with them, the nodes part, and the parties fork (Changing the policy). 3. **Any group carries on as it chooses.** Its parties fork with the policy they want, - and whoever wants to follow does; groups that parted come together the same way. - Nobody is held by parties it doesn't follow. + and whoever wants to follow does; groups that parted come together as parties come + in, one letting the other's in (Forks). Nobody is held by parties it doesn't follow. Not promised: @@ -100,7 +100,7 @@ What it asks of the store: before, and an operator having its node drop what it took. * **Checkpoints**: the store starting anew from what counts at heads the parties name, forgetting the rest. -* **Forks**: a store whose root is a checkpoint at heads of another store, or of several. +* **Forks**: a store whose root is a checkpoint at heads of another store. * **Members**: the nodes that carry the store, which the federation names. ### Events @@ -155,8 +155,7 @@ history, and no other store takes it ([`store.md`](store.md), Forks). An event i What the policy says is in its **versions**, a chain: each is a JSON object, named by the SHA-256 of its JCS bytes, numbered, and naming the version it changes (`null` for the first, number 0, which only the federation's root holds; a fork's changes the one -current at its heads, and a merge's lists those current at its heads, Forks). Spread -out: +current at its heads, Forks). Spread out: ```json { "federation": 1, "number": 7, "changes": "<hash of the version it changes>", @@ -176,7 +175,7 @@ out: ``` * **The federation** it follows, and its **number**, one more than that of the version - it changes (of the highest, for a merge's). + it changes. * **The parties and their keys** (`keys`): one party at least, each by name, as continuum's user names, 1 to 64 of `A-Z a-z 0-9 . _ @ -`, with one `ssh-ed25519` key or more, compared as keys (their comments aside), none twice in the @@ -387,13 +386,12 @@ with the lower ID; the party writes again, after both, to choose. A **checkpoint** writes down what counts at some heads: those heads, a version (the one current there, or a fork's), and the IDs of the events that count there with that -version current, version events aside, as it holds the version itself (What counts; a -merge's root keeps otherwise, Forks), as the JCS encoding of -`{"at": [<IDs>], "keeps": [<IDs>], "version": <version>}`, its IDs ascending and its -version the version itself, the object, named by its SHA-256 ([`store.md`](store.md), -Checkpoints). Every node holding the history up to those heads builds the same one, and -its version counts as written: a version event of it that comes later is one the node -took. +version current, version events aside, as it holds the version itself (What counts), as +the JCS encoding of `{"at": [<IDs>], "keeps": [<IDs>], "version": <version>}`, its IDs +ascending and its version the version itself, the object, named by its SHA-256 +([`store.md`](store.md), Checkpoints). Every node holding the history up to those heads +builds the same one, and its version counts as written: a version event of it that comes +later is one the node took. A version names a checkpoint by its heads (`checkpoint`): events after the current checkpoint, at which it is current too, none in another's history, their IDs ascending, @@ -436,8 +434,7 @@ A version that changes nothing but its number, what it changes and its checkpoin moves the store on. Like any version, it lapses the proposals on the version before, so a party proposes one where nothing that can still pass is proposed on the current version. A federation's root is its first checkpoint, without heads (Starting a -federation), and a fork's root a checkpoint at the heads it forks at, of one store or of -several (Forks). +federation), and a fork's root a checkpoint at the heads it forks at (Forks). ### Votes a node casts by itself @@ -519,28 +516,10 @@ in by a version, as they would anyone new. A fork's version may name parties tha weren't among the first to go (every party its founders consider honest, say), so that they can follow whenever they like, without asking. -Groups that parted come together the same way: a fork at heads of several stores -**merges** them, the federation and a fork of it, say, or two forks -([`store.md`](store.md), Forks). Its root differs from a fork's in three things: - -* its version's `changes` lists the versions current at those heads, ascending, and its - number is one past the highest of them; -* its version names every party's keys and node list anew, so that no key set or node - list of any side counts in the merge: it may give a party the keys it had on the - sides, or others, and each party writes its set anew; -* it keeps, of each side, the values that count there at places its version gives their - party, and nothing else. One counts in the merge once the key that signed it is among - its party's keys there (Keys), so that what a key one side dropped signed counts only - where the party lists that key again. - -The events a merge's root keeps are in none of each other's histories: where a party -wrote one place on two sides, the lower ID counts until it writes there again, whatever -either side's history held; where the sides gave an identifier to different parties, the -merge's rules say whose values count. What a side writes after those heads isn't taken -in the merge, and its party signs it again. A node holding the history up to all those -heads builds the root and checks it; one holding some of it says, side by side, what it -holds that those heads lack, and party by party what keys the merge gives; one holding -none takes the root on its operator's word. +Groups that parted come together as any party comes in: one side lets the other side's +parties in, by a version, or by a fork naming them, and they sign there again what they +keep, as a party's client signs again what a move refused. What one side signed counts +on the other only once it is signed there. What a party's nodes do of themselves is their operators' business, written nowhere: join a fork their operator follows, vote by rules their operator set (Votes a node casts @@ -671,18 +650,12 @@ crafted events. *Sim*: a simulation. *Bench*: measured, not judged. | 59 | Two checkpoints proposed at once, by nodes voting by themselves | The votes split; nays from the nodes backing one make the other dead, and its backers are free | sim | | 60 | Two nodes of one party, each voting by itself | They can vote twice, answered as any party voting twice: a party has one node vote by itself | — | | 61 | A key a version names, kept on a node that votes by itself, stolen with it | As 23: it counts while that version is current | unit | -| 62 | A merge whose version doesn't name every party's keys and node list anew, or whose `changes` doesn't list the versions current at its heads | No merge | unit | -| 63 | A key one side dropped, still in the party's set on the other, then a merge | What it signed counts only where the party lists it again | unit | -| 64 | A party wrote one place on two sides, one write built on the other before they parted, then a merge | The lower ID counts until it writes there again: a merge's kept events are in none of each other's histories | unit | -| 65 | An identifier given to different parties on two sides, then a merge | The merge's rules say whose values count; the others' aren't kept | unit | -| 66 | A merge's root keeping a value that didn't count on its side, or at a place its version gives another | Nodes holding that side build the root, find it differs, and don't join; others take it on their operator's word | sim | -| 67 | Events a side writes after a merge's heads, brought to the merge | Never taken: their history lacks its root; their party signs them again | unit | -| 68 | A party's event spelled anew by another: its `sig` or `key` encoded otherwise, its signature's S not canonical, its blob naming another key | None: `key` and `sig` read back to themselves, the signature is checked strictly, and the blob's key is `key` | unit | -| 69 | A node joining from the root is shown a chain old keys grew, beside the one the others took | It takes neither, and reports; once a checkpoint passed, it joins from a pinned one, where that chain is refused | unit | -| 70 | Checkpoint heads before the current checkpoint, or at which it isn't current, or one in another's history | No version: a version event naming it is refused | unit | -| 71 | After a checkpoint, a party that backed a second proposal once its first was dead, the nays that freed it withheld by those who cast them | Not named: its client keeps those nays with its `true` | unit | -| 72 | Two clients of one party back two proposals at once | Voting twice: a party votes from one client | — | -| 73 | A party keeps a proposal alive that nobody else backs, holding back automatic checkpoints | The party a node follows votes it `false`, and its followers with it, until it is dead | sim | +| 62 | A party's event spelled anew by another: its `sig` or `key` encoded otherwise, its signature's S not canonical, its blob naming another key | None: `key` and `sig` read back to themselves, the signature is checked strictly, and the blob's key is `key` | unit | +| 63 | A node joining from the root is shown a chain old keys grew, beside the one the others took | It takes neither, and reports; once a checkpoint passed, it joins from a pinned one, where that chain is refused | unit | +| 64 | Checkpoint heads before the current checkpoint, or at which it isn't current, or one in another's history | No version: a version event naming it is refused | unit | +| 65 | After a checkpoint, a party that backed a second proposal once its first was dead, the nays that freed it withheld by those who cast them | Not named: its client keeps those nays with its `true` | unit | +| 66 | Two clients of one party back two proposals at once | Voting twice: a party votes from one client | — | +| 67 | A party keeps a proposal alive that nobody else backs, holding back automatic checkpoints | The party a node follows votes it `false`, and its followers with it, until it is dead | sim | ## Roads not taken @@ -737,11 +710,14 @@ crafted events. *Sim*: a simulation. *Bench*: measured, not judged. * **A place where a party says which fork it went to.** A node following it by itself would follow a stolen key into a swarm with any policy; parties say where they went as they like. -* **Merging in place**: two stores each passing a version that moves them to one - checkpoint. It needs a version that changes two, nodes on each side taking the other - side's part on someone's word, and leaves two swarms, one of whose nodes move to the - other's anyway. A merge is a fork from both: whoever wants to carry on together - follows it. +* **Merges**: a fork at heads of several stores, keeping what counts on each side. Its + version names every party's keys anew, so that a party writes its key set again + before anything a key of its set signed counts; and a value a party replaced on one + side comes back where the other side's write has the lower ID. Letting the other + side's parties in, who sign again what they keep, does the same with nothing new. Nor + merging in place, two stores each passing a version that moves them to one + checkpoint: it needs a version that changes two, and nodes on each side taking the + other side's part on someone's word. * **Forks within one store**, each side judging by its own chain of versions. It needs judging per chain, judging again when a node changes sides, and members per chain. A store of its own needs none of it. @@ -813,7 +789,7 @@ continuum builds and behaves as it does, and its tests pass untouched. no remake: from stage 4 on, one that grows too large starts afresh by a fork whose version names the same parties, keys and rules. 4. **Forks**: a store whose root is a checkpoint at another's heads, named by its root, - checked by the nodes holding that history; merges, forks at heads of several stores. + checked by the nodes holding that history. 5. **Remakes**: compaction only, the snapshot holding the store as it is at its base, and every event beyond it put again. 6. **The registry**: the rules for krebs, the tool that signs kartei's entries in as diff --git a/docs/store.md b/docs/store.md index 1531fa4..aef814a 100644 --- a/docs/store.md +++ b/docs/store.md @@ -44,7 +44,7 @@ dependencies, so it holds every event's history back to its checkpoint. A store's first checkpoint is its **root**, taken without judging, whose ID is the store's: its bytes are a checkpoint's, which no fold reads as an event, so the store takes it as its own before the fold sees any event. A root without heads starts a store -anew; one at heads of other stores starts a fork (Forks). Its events build on the root +anew; one at heads of another store starts a fork (Forks). Its events build on the root itself, whatever heads it was built at: until the store moves to a later checkpoint, the root's ID is the one head they all have in their history. @@ -89,8 +89,8 @@ A fold says, of its events: the state of a node's store, and the state at an event's history, which judging reads; * **the checkpoint at some heads**: what of the history before them it keeps, and what it says of the rest; and when the store moves to one; -* **a fork's root**, from the states at heads of one store or of several, and what makes - the fork (the federation: its version); +* **a fork's root**, from the state at heads of another store, and what makes the fork + (the federation: its version); * **the store's members**, the nodes that carry it, at a state, each with the name of its group (Members); * where it needs to, **what a node refuses that its history takes**, by what the node @@ -117,8 +117,8 @@ pub trait Fold { fn parts(checkpoint: &[u8]) -> Option<(Vec<Id>, Vec<Id>)>; /// The state a checkpoint reads as, with the events it keeps. fn start(checkpoint: &[u8], kept: &[(Id, Vec<u8>)]) -> Result<Self::State, Refused>; - /// The root of a fork at `heads` of the stores reading as `at`, made by `spec`. - fn fork(at: &[&Self::State], heads: &[Id], spec: &[u8]) + /// The root of a fork at `heads` of the store reading as `at`, made by `spec`. + fn fork(at: &Self::State, heads: &[Id], spec: &[u8]) -> Result<(Vec<u8>, Vec<Id>), Refused>; /// The heads of a later checkpoint, where a store reading as `now` moves to one. fn moves_to(now: &Self::State) -> Option<Vec<Id>>; @@ -177,18 +177,16 @@ the same read the same. ## Forks -A **fork** is a store whose root is a checkpoint at heads of another, or of several, -which its maker chooses, with what the fork's fold says there (the federation: the -fork's version). A fork at heads of several stores **merges** them: its root keeps what -its fold takes of each (the federation: what counted on each side, as the fork's version -has it). A node holding the history up to all those heads builds the root and checks it; -one that doesn't takes it on its operator's word, which names the fork anyway. The fork -takes only events with its root in their history: what the stores it came from take -after those heads, the fork never takes; nor do they take what the fork takes, as no -store takes another's root, nor anything built on it. A node's own refusals are its -store's. What a fork's root holds, and who makes one, is its fold's: the federation -builds one byte for byte from its version and its heads, so that one version and one set -of heads make one fork ([`federation.md`](federation.md), Forks). +A **fork** is a store whose root is a checkpoint at heads of another, which its maker +chooses, with what the fork's fold says there (the federation: the fork's version). A +node holding the history up to those heads builds the root and checks it; one that +doesn't takes it on its operator's word, which names the fork anyway. The fork takes +only events with its root in their history: what the stores it came from take after +those heads, the fork never takes; nor do they take what the fork takes, as no store +takes another's root, nor anything built on it. A node's own refusals are its store's. +What a fork's root holds, and who makes one, is its fold's: the federation builds one +byte for byte from its version and its heads, so that one version and one set of heads +make one fork ([`federation.md`](federation.md), Forks). ## On Automerge @@ -412,7 +410,7 @@ What the tests check of the store, with a fold made for them those a store given the same events alone takes, and honest nodes hold the same document whatever each takes from it. * **Bytes.** Fixed vectors, byte for byte: events and their IDs, checkpoints, a genesis - change, a fork's, a merge's, a snapshot. + change, a fork's, a snapshot. ## Roads not taken diff --git a/src/federation/store/memory.rs b/src/federation/store/memory.rs index 6a67bfa..8f97299 100644 --- a/src/federation/store/memory.rs +++ b/src/federation/store/memory.rs @@ -113,31 +113,27 @@ impl<F: Fold> Store<F> { }) } - /// The root of a fork at heads of one store or of several, each given with its heads, - /// made by `spec`: its bytes, and those of the events it keeps. A fork at heads of - /// several stores merges them. + /// The root of a fork at `heads`, which the store holds, made by `spec`: its bytes, and + /// those of the events it keeps. pub(crate) fn fork( - sides: &[(&Self, &[Id])], + &self, + heads: &[Id], spec: &[u8], ) -> Result<(Vec<u8>, Vec<Vec<u8>>), Refused> { - let mut states = Vec::new(); - let mut heads = BTreeSet::new(); - for (store, at) in sides { - if let Some(head) = at.iter().find(|head| !store.holds(head)) { - return Err(Refused::new(format!("{head} isn't held there"))); - } - states.push(store.state_at(at)); - heads.extend(at.iter().copied()); + if let Some(head) = heads.iter().find(|head| !self.holds(head)) { + return Err(Refused::new(format!("{head} isn't held here"))); } - let heads: Vec<Id> = heads.into_iter().collect(); - let states: Vec<&F::State> = states.iter().collect(); - let (root, keeps) = F::fork(&states, &heads, spec)?; + let heads: Vec<Id> = heads + .iter() + .copied() + .collect::<BTreeSet<_>>() + .into_iter() + .collect(); + let (root, keeps) = F::fork(&self.state_at(&heads), &heads, spec)?; let kept = keeps .iter() .map(|id| { - sides - .iter() - .find_map(|(store, _)| store.get(id)) + self.get(id) .map(<[u8]>::to_vec) .ok_or_else(|| Refused::new(format!("{id} isn't held"))) }) @@ -145,10 +141,10 @@ impl<F: Fold> Store<F> { Ok((root, kept)) } - /// Whether `root` is the root of the fork at those heads, made by `spec`, as a node - /// holding them builds it. - pub(crate) fn checks_fork(sides: &[(&Self, &[Id])], spec: &[u8], root: &[u8]) -> bool { - Self::fork(sides, spec).is_ok_and(|(built, _)| built == root) + /// Whether `root` is the root of the fork at `heads`, made by `spec`, as this store + /// builds it. + pub(crate) fn checks_fork(&self, heads: &[Id], spec: &[u8], root: &[u8]) -> bool { + self.fork(heads, spec).is_ok_and(|(built, _)| built == root) } /// Whether the store holds an event: taken after its checkpoint, or one of its heads. @@ -816,14 +812,11 @@ mod tests { let root = store.id(); let here = taken(store.offer(testfold::put(&[root], "a", "1"))); let spec = testfold::fork_spec(1, "fork"); - let (fork_root, kept) = Store::fork(&[(&store, &[here])], &spec).expect("a fork"); + let (fork_root, kept) = store.fork(&[here], &spec).expect("a fork"); let mut fork: Store<TestFold> = Store::new(fork_root.clone(), kept).expect("its root"); - assert!(Store::checks_fork(&[(&store, &[here])], &spec, &fork_root)); - assert!(!Store::checks_fork( - &[(&store, &[here])], - &testfold::fork_spec(2, "fork"), - &fork_root - )); + assert!(store.checks_fork(&[here], &spec, &fork_root)); + assert!(!store.checks_fork(&[here], &testfold::fork_spec(2, "fork"), &fork_root)); + assert!(store.fork(&[Id::of(b"nothing held")], &spec).is_err()); assert_eq!(fork.state().counts()["a"], "1"); assert_eq!(fork.state().era(), (1, Some(&"fork".to_owned()))); let stayed = testfold::put(&[here], "a", "2"); @@ -837,24 +830,6 @@ mod tests { } #[test] - fn a_merge_keeps_each_sides_values_the_lower_id_across() { - let mut left = store(); - let mut right: Store<TestFold> = - Store::new(testfold::root("other"), Vec::new()).expect("a root"); - let l = taken(left.offer(testfold::put(&[left.id()], "a", "left"))); - let only = taken(left.offer(testfold::put(&[l], "b", "left"))); - let r = taken(right.offer(testfold::put(&[right.id()], "a", "right"))); - let spec = testfold::fork_spec(1, "merge"); - let (merge_root, kept) = - Store::fork(&[(&left, &[only]), (&right, &[r])], &spec).expect("a merge"); - let merged: Store<TestFold> = Store::new(merge_root, kept).expect("its root"); - let lower = if l < r { "left" } else { "right" }; - assert_eq!(merged.state().counts()["a"], lower); - assert_eq!(merged.state().counts()["b"], "left"); - assert!(Store::fork(&[(&left, &[r])], &spec).is_err()); - } - - #[test] fn an_event_waits_until_all_it_builds_on_is_held() { let mut store = store(); let root = store.id(); diff --git a/src/federation/store/mod.rs b/src/federation/store/mod.rs index c87f337..b11c81a 100644 --- a/src/federation/store/mod.rs +++ b/src/federation/store/mod.rs @@ -97,9 +97,9 @@ pub(crate) trait Fold { /// The state a checkpoint reads as, with the events it keeps. fn start(checkpoint: &[u8], kept: &[(Id, Vec<u8>)]) -> Result<Self::State, Refused>; - /// The root of a fork at `heads` of the stores reading as `at`, made by `spec`: its + /// The root of a fork at `heads` of the store reading as `at`, made by `spec`: its /// bytes, and the events it keeps. - fn fork(at: &[&Self::State], heads: &[Id], spec: &[u8]) -> Result<(Vec<u8>, Vec<Id>), Refused>; + fn fork(at: &Self::State, heads: &[Id], spec: &[u8]) -> Result<(Vec<u8>, Vec<Id>), Refused>; /// The heads of a later checkpoint, where a store reading as `now` moves to one. fn moves_to(now: &Self::State) -> Option<Vec<Id>>; diff --git a/src/federation/store/testfold.rs b/src/federation/store/testfold.rs index 094c424..bbe0307 100644 --- a/src/federation/store/testfold.rs +++ b/src/federation/store/testfold.rs @@ -406,19 +406,10 @@ impl Fold for TestFold { Ok(state) } - fn fork(at: &[&State], heads: &[Id], spec: &[u8]) -> Result<(Vec<u8>, Vec<Id>), Refused> { + fn fork(at: &State, heads: &[Id], spec: &[u8]) -> Result<(Vec<u8>, Vec<Id>), Refused> { let (era, tag): (u64, String) = serde_json::from_slice(spec).map_err(|_| Refused::new("no spec"))?; - let mut counting: BTreeMap<String, Id> = BTreeMap::new(); - let mut locks = BTreeSet::new(); - for state in at { - for (key, id) in state.counting() { - let lowest = counting.entry(key).or_insert(id); - *lowest = (*lowest).min(id); - } - locks.extend(state.locks.iter().cloned()); - } - let keeps: Vec<Id> = counting.into_values().collect(); + let keeps: Vec<Id> = at.counting().into_values().collect(); let root = Checkpoint { name: String::new(), at: hex(heads.iter().copied()), @@ -426,7 +417,7 @@ impl Fold for TestFold { era, tag, cut: 0, - locks: locks.into_iter().collect(), + locks: at.locks.iter().cloned().collect(), }; let bytes = serde_json::to_vec(&root).expect("a root encodes"); Ok((bytes, keeps)) |
