xrpld
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::test::csf {
11
12// Events are emitted by peers at a variety of points during the simulation.
13// Each event is emitted by a particular peer at a particular time. Collectors
14// process these events, perhaps calculating statistics or storing events to
15// a log for post-processing.
16//
17// The Event types can be arbitrary, but should be copyable and lightweight.
18//
19// Example collectors can be found in collectors.h, but have the general
20// interface:
21//
22// @code
23// template <class T>
24// struct Collector
25// {
26// template <class Event>
27// void
28// on(peerID who, SimTime when, Event e);
29// };
30// @endcode
31//
32// CollectorRef.f defines a type-erased holder for arbitrary Collectors. If
33// any new events are added, the interface there needs to be updated.
34
37template <class V>
38struct Share
39{
41 V val;
42};
43
46template <class V>
47struct Relay
48{
51
53 V val;
54};
55
58template <class V>
59struct Receive
60{
63
65 V val;
66};
67
70{
73};
74
85
89{
90 // The ledger closed on
92
93 // Initial txs for including in ledger
95};
96
99{
100 // The newly created ledger
102
103 // The prior ledger (this is a jump if prior.id() != ledger.parentID())
105};
106
109{
110 // ID of wrong ledger we had
112 // ID of what we think is the correct ledger
114};
115
126
127} // namespace xrpl::test::csf
A ledger is a set of observed transactions and a sequence number identifying the ledger.
Definition ledgers.h:41
TaggedInteger< std::uint32_t, IdTag > ID
Definition ledgers.h:49
A single transaction.
Definition Tx.h:21
boost::container::flat_set< Tx > TxSetType
Definition Tx.h:58
TaggedInteger< std::uint32_t, PeerIDTag > PeerID
Definition Validation.h:15
Peer accepted consensus results.
Definition events.h:99
Peer closed the open ledger.
Definition events.h:89
Peer fully validated a new ledger.
Definition events.h:118
Ledger ledger
The new fully validated ledger.
Definition events.h:120
A value received from another peer as part of flooding.
Definition events.h:60
V val
The received value.
Definition events.h:65
PeerID from
Peer that sent the value.
Definition events.h:62
A value relayed to another peer as part of flooding.
Definition events.h:48
V val
The value to relay.
Definition events.h:53
PeerID to
Peer relaying to.
Definition events.h:50
A value to be flooded to all other peers starting from this peer.
Definition events.h:39
V val
Event that is shared.
Definition events.h:41
Peer starts a new consensus round.
Definition events.h:78
Ledger::ID bestLedger
The preferred ledger for the start of consensus.
Definition events.h:80
Ledger prevLedger
The prior ledger on hand.
Definition events.h:83
A transaction submitted to a peer.
Definition events.h:70
Tx tx
The submitted transaction.
Definition events.h:72
Peer detected a wrong prior ledger during consensus.
Definition events.h:109