19 #include <ripple/beast/clock/manual_clock.h>
20 #include <ripple/beast/unit_test.h>
42 SimDuration
const delay =
43 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} <<
" overlap " << fi.overlap
71 <<
" required " << fi.required <<
"\n";
77 PeerGroup byzantineNodes = a + b + c + g;
79 for (
Peer* peer : network)
84 if (byzantineNodes.contains(peer))
86 peer->txInjections.emplace(
87 peer->lastClosedLedger.seq(), Tx{42});
91 std::cout <<
"Branches: " << sim.branches() <<
"\n";
93 << sim.synchronized() <<
"\n";