diff options
| author | tv <tv@krebsco.de> | 2026-11-15 21:43:18 +0000 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-11-15 21:43:18 +0000 |
| commit | 56fbbcf61ae77aed17b1fc04e914ccd3939df26f (patch) | |
| tree | 485f84fa83f043d7556a67435193a0c337cc39f7 /src/simtest | |
| parent | d2f72861bacf22542ceb29297ccd97dc440a608e (diff) | |
rules: a swarm turns strict only at its start or through a strict remake
A strict policy written into a running swarm left a time before it:
changes written there, beside the turn, were refused by the nodes that
took the turn first and taken by the others where they came first (a
signed policy that isn't strict, among them, unseated the turn there);
and a remake whose base preceded the turn had every switching node
replay the turn as one of its own, each refusing the others'.
A change writing a strict policy where the policy at its history isn't
strict (`"signed"` at its `values`, or an envelope there asking for
signed values) is now refused, in every swarm. A swarm turns strict at
its start (`--bootstrap-policy`) or through a strict remake, each its
epoch's first change: no change of a strict epoch is from before its
policy, and the rule for the time before goes, with the walk that found
the changes that turned a swarm strict and what kept them
(`before_strict`, `turned_strict`, `Reads::strict_now`,
`Reads::turned_now`, `store::writers`, `store::made`,
`changes::in_history`). The strict swarm's simulation starts strict.
access.md says so, and that a strict swarm can't move to a policy its
nodes don't know by writing it.
Diffstat (limited to 'src/simtest')
| -rw-r--r-- | src/simtest/policy.rs | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/src/simtest/policy.rs b/src/simtest/policy.rs index e5665cd..8f89b39 100644 --- a/src/simtest/policy.rs +++ b/src/simtest/policy.rs @@ -261,10 +261,10 @@ async fn plain(node: &AppState, at: &str) -> Option<serde_json::Value> { .flatten() } -/// A strict swarm (`"values": "signed"`), its first user's key given at genesis: values -/// signed by their user go everywhere, before and after a remake, which carries them -/// over; a node writing the registry plain, for a user that may, gets nothing past the -/// others. +/// A strict swarm (`"values": "signed"`), strict from its genesis change with its first +/// user's key: values signed by their user go everywhere, before and after a remake, +/// which carries them over; a node writing the registry plain, for a user that may, gets +/// nothing past the others. #[tokio::test(flavor = "multi_thread", worker_threads = 4)] async fn a_strict_swarm() { let key = ed25519_dalek::SigningKey::from_bytes(&[11; 32]); @@ -276,6 +276,7 @@ async fn a_strict_swarm() { [("laptop".to_owned(), line.clone())].into(), )] .into(); + config.first_policy = Some(json!({"version": 1, "values": "signed"})); }); let b = sim.start("b", &["a"], Start::Join); let c = sim.start("c", &["a"], Start::Join); @@ -293,20 +294,14 @@ async fn a_strict_swarm() { } }) .await; - write_as( + write_signed( &a, "alice", + &key, "_continuum/access/userSigned", json!([["config"]]), ) .await; - write_as( - &a, - "alice", - "_continuum/access/policy", - json!({"version": 1, "values": "signed"}), - ) - .await; sim.wait_converged(&[&a, &b, &c], SOON).await; // Signed, on any node: everywhere. |
