aboutsummaryrefslogtreecommitdiffstats
path: root/src/federation/attacks.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-18 17:23:18 +0000
committertv <tv@krebsco.de>2026-11-18 18:30:32 +0100
commitf261a80b88c1fb640f4c892934809e15a7e05a95 (patch)
treeb899d8994ab6fd320d0094c8e6e56487c73cc53d /src/federation/attacks.rs
parentd130c0612b4c63f2d30da65ebcc231018c1f2606 (diff)
attacks: rows 45, 58 and 65 tested beside the code they test
The check that every attack row of the federation has its test looks beside the code a row is about too: a node's (`held`), a party's client's (`client`), and a node voting by itself (`vote`). Rows 45 (a version written on the side a node doesn't read, refused as its own and reported apart, the change that put it taken), 58 (a node following on checkpoints only, unless its operator chose any version) and 65 (a client keeping the nays that freed its `true`) have their tests there, and wait no more.
Diffstat (limited to 'src/federation/attacks.rs')
-rw-r--r--src/federation/attacks.rs16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/federation/attacks.rs b/src/federation/attacks.rs
index 0d90461..d3dc660 100644
--- a/src/federation/attacks.rs
+++ b/src/federation/attacks.rs
@@ -1,7 +1,8 @@
//! The attacks of `docs/federation.md` marked unit, each a test named by its row
-//! (`docs/federation-tests.md`), on the federation's fold and the store in memory; those
+//! (`docs/federation-tests.md`), on the federation's fold and the store in memory; of what
+//! a node or a party's client does, beside that code (`held`, `client`, `vote`); those
//! marked sim are simulations (`simtest::holding`). A test checks that every row has its
-//! test, or waits for a later stage.
+//! test, or waits.
use super::event::Checkpoint;
use super::fold::Federation;
@@ -12,8 +13,8 @@ use super::store::memory::{Offered, Refusal, Store};
use super::store::{Fold, Id};
use super::version::Version;
-/// Rows whose tests wait: what a node, a party's client or a tool does, and flooding.
-const LATER: &[u32] = &[30, 39, 45, 51, 58, 63, 65, 68];
+/// Rows whose tests wait: what a node or a party's client doesn't do yet, and flooding.
+const LATER: &[u32] = &[30, 39, 51, 63, 68];
fn tv() -> Party {
Party::new("tv", 1)
@@ -103,7 +104,12 @@ fn every_row_has_its_test() {
harness::every_row_has_its_test(
include_str!("../../docs/federation.md"),
"federation_attack_",
- &[include_str!("attacks.rs")],
+ &[
+ include_str!("attacks.rs"),
+ include_str!("held.rs"),
+ include_str!("client.rs"),
+ include_str!("vote.rs"),
+ ],
&[include_str!("../simtest/holding.rs")],
LATER,
);