3#include <xrpl/basics/base_uint.h>
4#include <xrpl/basics/chrono.h>
5#include <xrpl/json/json_value.h>
6#include <xrpl/protocol/HashPrefix.h>
7#include <xrpl/protocol/digest.h>
8#include <xrpl/protocol/jss.h>
38template <
class NodeId,
class LedgerId,
class Position>
143 return time_ <= cutoff;
155 Position
const& newPosition,
252template <
class NodeId,
class LedgerId,
class Position>
Represents a proposed position taken during a round of consensus.
std::uint32_t proposeSeq_
std::optional< uint256 > signingHash_
NetClock::time_point time_
json::Value getJson() const
Get JSON representation for debugging.
bool isInitial() const
Whether this is the first position taken during the current consensus round.
static std::uint32_t const kSeqLeave
NetClock::time_point const & seenTime() const
Get when this position was taken.
uint256 const & signingHash() const
The digest for this proposal, used for signing purposes.
std::uint32_t proposeSeq() const
Get the sequence number of this proposal.
std::string render() const
static std::uint32_t const kSeqJoin
TxSet::ID const & position() const
ConsensusProposal(LedgerId const &prevLedger, std::uint32_t seq, Position const &position, NetClock::time_point closeTime, NetClock::time_point now, NodeId const &nodeID)
Constructor.
Ledger::ID const & prevLedger() const
Ledger::ID previousLedger_
PeerID const & nodeID() const
bool isBowOut() const
Get whether this node left the consensus process.
void bowOut(NetClock::time_point now)
Leave consensus.
void changePosition(Position const &newPosition, NetClock::time_point newCloseTime, NetClock::time_point now)
Update the position during the consensus process.
NetClock::time_point const & closeTime() const
NetClock::time_point closeTime_
bool isStale(NetClock::time_point cutoff) const
Get whether this position is stale relative to the provided cutoff.
std::chrono::time_point< NetClock > time_point
@ Object
object value (collection of name/value pairs).
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
constexpr bool operator==(BaseUInt< Bits, Tag > const &lhs, BaseUInt< Bits, Tag > const &rhs)
sha512_half_hasher::result_type sha512Half(Args const &... args)
Returns the SHA512-Half of a series of objects.
std::string to_string(BaseUInt< Bits, Tag > const &a)
@ Proposal
proposal for signing