diff options
Diffstat (limited to 'src/federation')
| -rw-r--r-- | src/federation/attacks.rs | 4 | ||||
| -rw-r--r-- | src/federation/fold.rs | 6 | ||||
| -rw-r--r-- | src/federation/party.rs | 3 |
3 files changed, 13 insertions, 0 deletions
diff --git a/src/federation/attacks.rs b/src/federation/attacks.rs index 8782528..3f44ad0 100644 --- a/src/federation/attacks.rs +++ b/src/federation/attacks.rs @@ -928,6 +928,10 @@ fn federation_attack_48() { let mut bad = fed.first.after(on); bad.rules.push(("_continuum/x".to_owned(), s("tv"))); let proposal = fed.take(tv.propose(&[root], &bad.json())); + // A node shows why a client backs it not (`none` in `GET /events/counts`). + let state = fed.store.state(); + let why = super::client::backable(state.current(), state.proposal(&bad.hash()).unwrap()); + assert!(why.unwrap_err().contains("_continuum/x")); let yes = fed.take(tv.vote(&[proposal], on, bad.hash(), true)); let also = fed.take(lass.vote(&[proposal], on, bad.hash(), true)); fed.stops(harness::version_event(&[yes, also], bad.hash())); diff --git a/src/federation/fold.rs b/src/federation/fold.rs index fddedc0..3ebeebf 100644 --- a/src/federation/fold.rs +++ b/src/federation/fold.rs @@ -341,6 +341,12 @@ impl State { ballots } + /// The version the proposal of hash `proposal` proposes, as JSON, where it holds one: + /// whether it is a version is asked apart (`Version::read`). + pub(crate) fn proposal(&self, proposal: &Id) -> Option<&Json> { + self.proposed.get(proposal) + } + /// The version event writing the proposal of hash `proposal` on the current version, /// where it passed here: on the `true` votes of the first parties by name that pass it, /// each party's of the lowest ID, so that nodes holding those votes write the same. diff --git a/src/federation/party.rs b/src/federation/party.rs index 60b7e18..04837c3 100644 --- a/src/federation/party.rs +++ b/src/federation/party.rs @@ -807,6 +807,9 @@ async fn proposals(node: &Node) -> Result<()> { does: Does::Proposal { hash: of, version }, .. })) if of.to_string() == *hash => { + if let Err(why) = client::backable(¤t, &version) { + println!(" backed by no client: {why}"); + } for line in client::changes(¤t.json, &version) { println!(" {line}"); } |
