19 #include <ripple/beast/clock/manual_clock.h>
20 #include <ripple/beast/unit_test.h>
42 SimDuration
const delay =
43 date::round<milliseconds>(0.2 * parms.ledgerGRANULARITY);
44 PeerGroup a = sim.createGroup(1);
45 PeerGroup b = sim.createGroup(1);
46 PeerGroup c = sim.createGroup(1);
47 PeerGroup d = sim.createGroup(1);
48 PeerGroup e = sim.createGroup(1);
49 PeerGroup f = sim.createGroup(1);
50 PeerGroup g = sim.createGroup(1);
52 a.trustAndConnect(a + b + c + g, delay);
53 b.trustAndConnect(b + a + c + d + e, delay);
54 c.trustAndConnect(c + a + b + d + e, delay);
55 d.trustAndConnect(d + b + c + e + f, delay);
56 e.trustAndConnect(e + b + c + d + f, delay);
57 f.trustAndConnect(f + d + e + g, delay);
58 g.trustAndConnect(g + a + f, delay);
60 PeerGroup network = a + b + c + d + e + f + g;
64 sim.collectors.add(sc);
66 for (TrustGraph<Peer*>::ForkInfo
const& fi :
67 sim.trustGraph.forkablePairs(0.8))
69 std::cout <<
"Can fork " << PeerGroup{fi.unlA} <<
" "
70 <<
" " << PeerGroup{fi.unlB}
71 <<
" overlap " << fi.overlap <<
" required "
72 << fi.required <<
"\n";
78 PeerGroup byzantineNodes = a + b + c + g;
80 for (
Peer * peer : network)
85 if (byzantineNodes.contains(peer))
87 peer->txInjections.emplace(
88 peer->lastClosedLedger.seq(), Tx{42});
92 std::cout <<
"Branches: " << sim.branches() <<
"\n";
94 << sim.synchronized() <<
"\n";