20 #include <ripple/app/main/Application.h>
21 #include <ripple/core/TimeKeeper.h>
22 #include <ripple/nodestore/ShardInfo.h>
23 #include <ripple/protocol/SecretKey.h>
24 #include <ripple/protocol/digest.h>
62 if (boost::icl::contains(
finalized_, shardIndex))
73 protocol::TMPeerShardInfoV2
76 protocol::TMPeerShardInfoV2 message;
84 message.set_timestamp(timestamp);
90 message.mutable_incomplete()->Reserve(
incomplete_.size());
93 auto tmIncomplete{message.add_incomplete()};
95 tmIncomplete->set_shardindex(shardIndex);
102 tmIncomplete->set_state(state);
106 auto const percentProgress{
incomplete.percentProgress()};
107 if (percentProgress > 0)
109 tmIncomplete->set_progress(percentProgress);
110 s.
add32(percentProgress);
118 message.set_finalized(str);
119 s.
addRaw(str.data(), str.size());
124 message.set_publickey(publicKey.data(), publicKey.size());
130 message.set_signature(signature.data(), signature.size());
std::map< std::uint32_t, Incomplete > incomplete_
virtual TimeKeeper & timeKeeper()=0
bool update(std::uint32_t shardIndex, ShardState state, std::uint32_t percentProgress)
T time_since_epoch(T... args)
RangeSet< std::uint32_t > finalized_
std::map< std::uint32_t, Incomplete > const & incomplete() const
protocol::TMPeerShardInfoV2 makeMessage(Application &app)
virtual std::pair< PublicKey, SecretKey > const & nodeIdentity()=0
int addRaw(Blob const &vector)
Slice slice() const noexcept
NetClock::time_point msgTimestamp_
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Buffer sign(PublicKey const &pk, SecretKey const &sk, Slice const &m)
Generate a signature for a message.
std::string incompleteToString() const
std::string finalizedToString() const
virtual time_point now() const override=0
Returns the estimate of wall time, in network time.
std::string to_string(Manifest const &m)
Format the specified manifest to a string for debugging purposes.
int add32(std::uint32_t i)
@ shardInfo
shard info for signing