xrpld
Loading...
Searching...
No Matches
events.h
1#pragma once
2
3#include <csf/Tx.h>
4#include <csf/Validation.h>
5#include <csf/ledgers.h>
6
7namespace xrpl::test::csf {
8
9// Events are emitted by peers at a variety of points during the simulation.
10// Each event is emitted by a particular peer at a particular time. Collectors
11// process these events, perhaps calculating statistics or storing events to
12// a log for post-processing.
13//
14// The Event types can be arbitrary, but should be copyable and lightweight.
15//
16// Example collectors can be found in collectors.h, but have the general
17// interface:
18//
19// @code
20// template <class T>
21// struct Collector
22// {
23// template <class Event>
24// void
25// on(peerID who, SimTime when, Event e);
26// };
27// @endcode
28//
29// CollectorRef.f defines a type-erased holder for arbitrary Collectors. If
30// any new events are added, the interface there needs to be updated.
31
35template <class V>
36struct Share
37{
41 V val;
42};
43
47template <class V>
48struct Relay
49{
54
58 V val;
59};
60
64template <class V>
65struct Receive
66{
71
75 V val;
76};
77
82{
87};
88
104
109{
110 // The ledger closed on
112
113 // Initial txs for including in ledger
115};
116
121{
122 // The newly created ledger
124
125 // The prior ledger (this is a jump if prior.id() != ledger.parentID())
127};
128
133{
134 // ID of wrong ledger we had
136 // ID of what we think is the correct ledger
138};
139
156
157} // namespace xrpl::test::csf
A ledger is a set of observed transactions and a sequence number identifying the ledger.
Definition ledgers.h:48
TaggedInteger< std::uint32_t, IdTag > ID
Definition ledgers.h:56
A single transaction.
Definition Tx.h:24
boost::container::flat_set< Tx > TxSetType
Definition Tx.h:65
TaggedInteger< std::uint32_t, PeerIDTag > PeerID
Definition Validation.h:17
Peer accepted consensus results.
Definition events.h:121
Peer closed the open ledger.
Definition events.h:109
Peer fully validated a new ledger.
Definition events.h:144
Ledger prior
The prior fully validated ledger This is a jump if prior.id() != ledger.parentID().
Definition events.h:154
Ledger ledger
The new fully validated ledger.
Definition events.h:148
A value received from another peer as part of flooding.
Definition events.h:66
V val
The received value.
Definition events.h:75
PeerID from
Peer that sent the value.
Definition events.h:70
A value relayed to another peer as part of flooding.
Definition events.h:49
V val
The value to relay.
Definition events.h:58
PeerID to
Peer relaying to.
Definition events.h:53
A value to be flooded to all other peers starting from this peer.
Definition events.h:37
V val
Event that is shared.
Definition events.h:41
Peer starts a new consensus round.
Definition events.h:93
Ledger::ID bestLedger
The preferred ledger for the start of consensus.
Definition events.h:97
Ledger prevLedger
The prior ledger on hand.
Definition events.h:102
A transaction submitted to a peer.
Definition events.h:82
Tx tx
The submitted transaction.
Definition events.h:86
Peer detected a wrong prior ledger during consensus.
Definition events.h:133