rippled
Loading...
Searching...
No Matches
events.h
1#ifndef XRPL_TEST_CSF_EVENTS_H_INCLUDED
2#define XRPL_TEST_CSF_EVENTS_H_INCLUDED
3
4#include <test/csf/Proposal.h>
5#include <test/csf/Tx.h>
6#include <test/csf/Validation.h>
7#include <test/csf/ledgers.h>
8
9#include <chrono>
10
11namespace ripple {
12namespace test {
13namespace csf {
14
15// Events are emitted by peers at a variety of points during the simulation.
16// Each event is emitted by a particlar peer at a particular time. Collectors
17// process these events, perhaps calculating statistics or storing events to
18// a log for post-processing.
19//
20// The Event types can be arbitrary, but should be copyable and lightweight.
21//
22// Example collectors can be found in collectors.h, but have the general
23// interface:
24//
25// @code
26// template <class T>
27// struct Collector
28// {
29// template <class Event>
30// void
31// on(peerID who, SimTime when, Event e);
32// };
33// @endcode
34//
35// CollectorRef.f defines a type-erased holder for arbitrary Collectors. If
36// any new events are added, the interface there needs to be updated.
37
40template <class V>
41struct Share
42{
44 V val;
45};
46
49template <class V>
50struct Relay
51{
54
56 V val;
57};
58
61template <class V>
62struct Receive
63{
66
68 V val;
69};
70
73{
76};
77
88
92{
93 // The ledger closed on
95
96 // Initial txs for including in ledger
98};
99
102{
103 // The newly created ledger
105
106 // The prior ledger (this is a jump if prior.id() != ledger.parentID())
108};
109
112{
113 // ID of wrong ledger we had
115 // ID of what we think is the correct ledger
117};
118
129
130} // namespace csf
131} // namespace test
132} // namespace ripple
133
134#endif
A ledger is a set of observed transactions and a sequence number identifying the ledger.
Definition ledgers.h:45
A single transaction.
Definition Tx.h:23
boost::container::flat_set< Tx > TxSetType
Definition Tx.h:60
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:6
Peer accepted consensus results.
Definition events.h:102
Peer closed the open ledger.
Definition events.h:92
Peer fully validated a new ledger.
Definition events.h:121
Ledger prior
The prior fully validated ledger This is a jump if prior.id() != ledger.parentID()
Definition events.h:127
Ledger ledger
The new fully validated ledger.
Definition events.h:123
A value received from another peer as part of flooding.
Definition events.h:63
PeerID from
Peer that sent the value.
Definition events.h:65
V val
The received value.
Definition events.h:68
A value relayed to another peer as part of flooding.
Definition events.h:51
PeerID to
Peer relaying to.
Definition events.h:53
V val
The value to relay.
Definition events.h:56
A value to be flooded to all other peers starting from this peer.
Definition events.h:42
V val
Event that is shared.
Definition events.h:44
Peer starts a new consensus round.
Definition events.h:81
Ledger prevLedger
The prior ledger on hand.
Definition events.h:86
Ledger::ID bestLedger
The preferred ledger for the start of consensus.
Definition events.h:83
A transaction submitted to a peer.
Definition events.h:73
Tx tx
The submitted transaction.
Definition events.h:75
Peer detected a wrong prior ledger during consensus.
Definition events.h:112