20#ifndef RIPPLE_TEST_CSF_UNL_H_INCLUDED
21#define RIPPLE_TEST_CSF_UNL_H_INCLUDED
23#include <test/csf/random.h>
25#include <boost/container/flat_set.hpp>
140 for (
int i = 0; i < uniqueUNLs.
size(); ++i)
142 for (
int j = (i + 1); j < uniqueUNLs.
size(); ++j)
144 auto const& unlA = uniqueUNLs[i];
145 auto const& unlB = uniqueUNLs[j];
147 2.0 * (1. - quorum) *
std::max(unlA.size(), unlB.size());
149 int intersectionSize =
151 return unlB.find(p) != unlB.end();
154 if (intersectionSize < rhs)
157 ForkInfo{unlA, unlB, intersectionSize, rhs});
bool connected(Vertex source, Vertex target) const
Check if two vertices are connected.
auto outVertices() const
Range over vertices in the graph.
bool disconnect(Vertex source, Vertex target)
Disconnect two vertices.
bool connect(Vertex source, Vertex target, EdgeData e)
Connect two vertices.
void trust(Peer const &from, Peer const &to)
Create trust.
bool canFork(double quorum) const
Check whether this trust graph satisfies the whitepaper no-forking condition.
void untrust(Peer const &from, Peer const &to)
Remove trust.
std::vector< ForkInfo > forkablePairs(double quorum) const
auto trustedPeers(Peer const &a) const
Range over trusted peers.
bool trusts(Peer const &from, Peer const &to) const
TrustGraph()=default
Create an empty trust graph.
T emplace_back(T... args)
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
A single peer in the simulation.
An example of nodes that fail the whitepaper no-forking condition.