rippled
Loading...
Searching...
No Matches
events.h
1#pragma once
2
3#include <test/csf/Proposal.h>
4#include <test/csf/Tx.h>
5#include <test/csf/Validation.h>
6#include <test/csf/ledgers.h>
7
8#include <chrono>
9
10namespace xrpl {
11namespace test {
12namespace csf {
13
14// Events are emitted by peers at a variety of points during the simulation.
15// Each event is emitted by a particular peer at a particular time. Collectors
16// process these events, perhaps calculating statistics or storing events to
17// a log for post-processing.
18//
19// The Event types can be arbitrary, but should be copyable and lightweight.
20//
21// Example collectors can be found in collectors.h, but have the general
22// interface:
23//
24// @code
25// template <class T>
26// struct Collector
27// {
28// template <class Event>
29// void
30// on(peerID who, SimTime when, Event e);
31// };
32// @endcode
33//
34// CollectorRef.f defines a type-erased holder for arbitrary Collectors. If
35// any new events are added, the interface there needs to be updated.
36
39template <class V>
40struct Share
41{
43 V val;
44};
45
48template <class V>
49struct Relay
50{
53
55 V val;
56};
57
60template <class V>
61struct Receive
62{
65
67 V val;
68};
69
72{
75};
76
87
91{
92 // The ledger closed on
94
95 // Initial txs for including in ledger
97};
98
101{
102 // The newly created ledger
104
105 // The prior ledger (this is a jump if prior.id() != ledger.parentID())
107};
108
111{
112 // ID of wrong ledger we had
114 // ID of what we think is the correct ledger
116};
117
128
129} // namespace csf
130} // namespace test
131} // namespace xrpl
A ledger is a set of observed transactions and a sequence number identifying the ledger.
Definition ledgers.h:44
A single transaction.
Definition Tx.h:22
boost::container::flat_set< Tx > TxSetType
Definition Tx.h:59
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
Peer accepted consensus results.
Definition events.h:101
Peer closed the open ledger.
Definition events.h:91
Peer fully validated a new ledger.
Definition events.h:120
Ledger prior
The prior fully validated ledger This is a jump if prior.id() != ledger.parentID()
Definition events.h:126
Ledger ledger
The new fully validated ledger.
Definition events.h:122
A value received from another peer as part of flooding.
Definition events.h:62
V val
The received value.
Definition events.h:67
PeerID from
Peer that sent the value.
Definition events.h:64
A value relayed to another peer as part of flooding.
Definition events.h:50
V val
The value to relay.
Definition events.h:55
PeerID to
Peer relaying to.
Definition events.h:52
A value to be flooded to all other peers starting from this peer.
Definition events.h:41
V val
Event that is shared.
Definition events.h:43
Peer starts a new consensus round.
Definition events.h:80
Ledger::ID bestLedger
The preferred ledger for the start of consensus.
Definition events.h:82
Ledger prevLedger
The prior ledger on hand.
Definition events.h:85
A transaction submitted to a peer.
Definition events.h:72
Tx tx
The submitted transaction.
Definition events.h:74
Peer detected a wrong prior ledger during consensus.
Definition events.h:111