rippled
|
Namespaces | |
detail | |
Classes | |
struct | AcceptLedger |
Peer accepted consensus results. More... | |
class | BasicNetwork |
Peer to peer network simulator. More... | |
class | BasicSink |
Sink that prepends simulation time to messages. More... | |
struct | CloseLedger |
Peer closed the open ledger. More... | |
struct | CollectByNode |
Maintain an instance of a Collector per peer. More... | |
class | CollectorRef |
Holds a type-erased reference to an arbitray collector. More... | |
class | CollectorRefs |
A container of CollectorRefs. More... | |
class | Collectors |
Group of collectors. More... | |
class | ConstantDistribution |
Constant "distribution" that always returns the same value. More... | |
class | Digraph |
Directed graph. More... | |
struct | FullyValidateLedger |
Peer fully validated a new ledger. More... | |
class | HeartbeatTimer |
Gives heartbeat of simulation to signal simulation progression. More... | |
class | Histogram |
Basic histogram. More... | |
struct | JumpCollector |
Saves information about Jumps for closed and fully validated ledgers. More... | |
class | Ledger |
A ledger is a set of observed transactions and a sequence number identifying the ledger. More... | |
struct | LedgerCollector |
Tracks the accepted -> validated evolution of ledgers. More... | |
struct | LedgerHistoryHelper |
Helper for writing unit tests with controlled ledger histories. More... | |
class | LedgerOracle |
Oracle maintaining unique ledgers for a simulation. More... | |
struct | NullCollector |
Collector which ignores all events. More... | |
struct | Peer |
A single peer in the simulation. More... | |
class | PeerGroup |
A group of simulation Peers. More... | |
class | PowerLawDistribution |
Power-law distribution with PDF. More... | |
struct | Rate |
Represents rate as a count/duration. More... | |
struct | Receive |
A value received from another peer as part of flooding. More... | |
struct | Relay |
A value relayed to another peer as part of flooding. More... | |
class | Scheduler |
Simulated discrete-event scheduler. More... | |
class | Selector |
Invocable that returns random samples from a range according to a discrete distribution. More... | |
struct | Share |
A value to be flooded to all other peers starting from this peer. More... | |
class | Sim |
struct | SimDurationCollector |
Tracks the overall duration of a simulation. More... | |
struct | StartRound |
Peer starts a new consensus round. More... | |
struct | StreamCollector |
Write out stream of ledger activity. More... | |
class | Submitter |
Submits transactions to a specified peer. More... | |
struct | SubmitTx |
A transaction submitted to a peer. More... | |
class | TrustGraph |
Trust graph. More... | |
class | Tx |
A single transaction. More... | |
struct | TxCollector |
Tracks the submission -> accepted -> validated evolution of transactions. More... | |
class | TxSet |
TxSet is a set of transactions to consider including in the ledger. More... | |
class | Validation |
Validation of a specific ledger by a specific Peer. More... | |
class | Validations_test |
struct | WrongPrevLedger |
Peer detected a wrong prior ledger during consensus. More... | |
Typedefs | |
using | Proposal = ConsensusProposal< PeerID, Ledger::ID, TxSet::ID > |
Proposal is a position taken in the consensus process and is represented directly from the generic types. More... | |
using | RealClock = std::chrono::system_clock |
using | RealDuration = RealClock::duration |
using | RealTime = RealClock::time_point |
using | SimClock = beast::manual_clock< std::chrono::steady_clock > |
using | SimDuration = typename SimClock::duration |
using | SimTime = typename SimClock::time_point |
using | TxSetType = boost::container::flat_set< Tx > |
using | PeerID = tagged_integer< std::uint32_t, PeerIDTag > |
using | PeerKey = std::pair< PeerID, std::uint32_t > |
The current key of a peer. More... | |
Functions | |
BEAST_DEFINE_TESTSUITE (Validations, consensus, ripple) | |
template<class... Cs> | |
Collectors< Cs... > | makeCollectors (Cs &... cs) |
Create an instance of Collectors<Cs...> More... | |
Ledger::Seq | mismatch (Ledger const &a, Ledger const &b) |
template<class RandomNumberDistribution , class Generator > | |
std::vector< PeerGroup > | randomRankedGroups (PeerGroup &peers, std::vector< double > const &ranks, int numGroups, RandomNumberDistribution sizeDist, Generator &g) |
Randomly generate peer groups according to ranks. More... | |
template<class RandomNumberDistribution , class Generator > | |
void | randomRankedTrust (PeerGroup &peers, std::vector< double > const &ranks, int numGroups, RandomNumberDistribution sizeDist, Generator &g) |
Generate random trust groups based on peer rankings. More... | |
template<class RandomNumberDistribution , class Generator > | |
void | randomRankedConnect (PeerGroup &peers, std::vector< double > const &ranks, int numGroups, RandomNumberDistribution sizeDist, Generator &g, SimDuration delay) |
Generate random network groups based on peer rankings. More... | |
template<class T , class G > | |
std::vector< T > | random_weighted_shuffle (std::vector< T > v, std::vector< double > w, G &g) |
Return a randomly shuffled copy of vector based on weights w. More... | |
template<class RandomNumberDistribution , class Generator > | |
std::vector< typename RandomNumberDistribution::result_type > | sample (std::size_t size, RandomNumberDistribution dist, Generator &g) |
Generate a vector of random samples. More... | |
template<typename Iter , typename Generator > | |
Selector< Iter, Generator > | makeSelector (Iter first, Iter last, std::vector< double > const &w, Generator &g) |
template<class Distribution , class Generator , class Selector > | |
Submitter< Distribution, Generator, Selector > | makeSubmitter (Distribution dist, SimTime start, SimTime end, Selector &sel, Scheduler &s, Generator &g) |
std::ostream & | operator<< (std::ostream &o, const Tx &t) |
template<class T > | |
std::ostream & | operator<< (std::ostream &o, boost::container::flat_set< T > const &ts) |
std::string | to_string (TxSetType const &txs) |
template<class Hasher > | |
void | hash_append (Hasher &h, Tx const &tx) |
using ripple::test::csf::Proposal = typedef ConsensusProposal<PeerID, Ledger::ID, TxSet::ID> |
Proposal is a position taken in the consensus process and is represented directly from the generic types.
Definition at line 33 of file Proposal.h.
using ripple::test::csf::RealClock = typedef std::chrono::system_clock |
using ripple::test::csf::RealDuration = typedef RealClock::duration |
using ripple::test::csf::RealTime = typedef RealClock::time_point |
using ripple::test::csf::SimClock = typedef beast::manual_clock<std::chrono::steady_clock> |
using ripple::test::csf::SimDuration = typedef typename SimClock::duration |
using ripple::test::csf::SimTime = typedef typename SimClock::time_point |
using ripple::test::csf::TxSetType = typedef boost::container::flat_set<Tx> |
using ripple::test::csf::PeerID = typedef tagged_integer<std::uint32_t, PeerIDTag> |
Definition at line 35 of file Validation.h.
using ripple::test::csf::PeerKey = typedef std::pair<PeerID, std::uint32_t> |
The current key of a peer.
Eventually, the second entry in the pair can be used to model ephemeral keys. Right now, the convention is to have the second entry 0 as the master key.
Definition at line 43 of file Validation.h.
ripple::test::csf::BEAST_DEFINE_TESTSUITE | ( | Validations | , |
consensus | , | ||
ripple | |||
) |
Collectors<Cs...> ripple::test::csf::makeCollectors | ( | Cs &... | cs | ) |
Create an instance of Collectors<Cs...>
Definition at line 96 of file collectors.h.
Ledger::Seq ripple::test::csf::mismatch | ( | Ledger const & | a, |
Ledger const & | b | ||
) |
Definition at line 58 of file ledgers.cpp.
std::vector<PeerGroup> ripple::test::csf::randomRankedGroups | ( | PeerGroup & | peers, |
std::vector< double > const & | ranks, | ||
int | numGroups, | ||
RandomNumberDistribution | sizeDist, | ||
Generator & | g | ||
) |
Randomly generate peer groups according to ranks.
Generates random peer groups based on a provided ranking of peers. This mimics a process of randomly generating UNLs, where more "important" peers are more likely to appear in a UNL.
numGroups
subgroups are generated by randomly sampling without without replacement from peers according to the ranks
.
peers | The group of peers |
ranks | The relative importance of each peer, must match the size of peers. Higher relative rank means more likely to be sampled. |
numGroups | The number of peer link groups to generate |
sizeDist | The distribution that determines the size of a link group |
g | The uniform random bit generator |
Definition at line 299 of file PeerGroup.h.
void ripple::test::csf::randomRankedTrust | ( | PeerGroup & | peers, |
std::vector< double > const & | ranks, | ||
int | numGroups, | ||
RandomNumberDistribution | sizeDist, | ||
Generator & | g | ||
) |
Generate random trust groups based on peer rankings.
Definition at line 326 of file PeerGroup.h.
void ripple::test::csf::randomRankedConnect | ( | PeerGroup & | peers, |
std::vector< double > const & | ranks, | ||
int | numGroups, | ||
RandomNumberDistribution | sizeDist, | ||
Generator & | g, | ||
SimDuration | delay | ||
) |
Generate random network groups based on peer rankings.
Definition at line 350 of file PeerGroup.h.
std::vector<T> ripple::test::csf::random_weighted_shuffle | ( | std::vector< T > | v, |
std::vector< double > | w, | ||
G & | g | ||
) |
Return a randomly shuffled copy of vector based on weights w.
v | The set of values |
w | The set of weights of each value |
g | A pseudo-random number generator |
Definition at line 41 of file test/csf/random.h.
std::vector<typename RandomNumberDistribution::result_type> ripple::test::csf::sample | ( | std::size_t | size, |
RandomNumberDistribution | dist, | ||
Generator & | g | ||
) |
Generate a vector of random samples.
size | the size of the sample |
dist | the distribution to sample |
g | the pseudo-random number generator |
Definition at line 66 of file test/csf/random.h.
Selector<Iter, Generator> ripple::test::csf::makeSelector | ( | Iter | first, |
Iter | last, | ||
std::vector< double > const & | w, | ||
Generator & | g | ||
) |
Definition at line 118 of file test/csf/random.h.
Submitter<Distribution, Generator, Selector> ripple::test::csf::makeSubmitter | ( | Distribution | dist, |
SimTime | start, | ||
SimTime | end, | ||
Selector & | sel, | ||
Scheduler & | s, | ||
Generator & | g | ||
) |
Definition at line 114 of file submitters.h.
std::ostream& ripple::test::csf::operator<< | ( | std::ostream & | o, |
const Tx & | t | ||
) |
std::ostream& ripple::test::csf::operator<< | ( | std::ostream & | o, |
boost::container::flat_set< T > const & | ts | ||
) |
std::string ripple::test::csf::to_string | ( | TxSetType const & | txs | ) |