#include <grandpa_protocol.hpp>
|
| GrandpaProtocol ()=delete |
|
| ~GrandpaProtocol () override=default |
|
| GrandpaProtocol (libp2p::Host &host, std::shared_ptr< boost::asio::io_context > io_context, const application::AppConfiguration &app_config, std::shared_ptr< consensus::grandpa::GrandpaObserver > grandpa_observer, const OwnPeerInfo &own_info, std::shared_ptr< StreamEngine > stream_engine, std::shared_ptr< PeerManager > peer_manager, const primitives::BlockHash &genesis_hash, std::shared_ptr< libp2p::basic::Scheduler > scheduler) |
|
bool | start () override |
|
bool | stop () override |
|
const std::string & | protocolName () const override |
|
void | onIncomingStream (std::shared_ptr< Stream > stream) override |
|
void | newOutgoingStream (const PeerInfo &peer_info, std::function< void(outcome::result< std::shared_ptr< Stream >>)> &&cb) override |
|
void | vote (network::GrandpaVote &&vote_message, std::optional< const libp2p::peer::PeerId > peer_id) |
|
void | neighbor (GrandpaNeighborMessage &&msg) |
|
void | finalize (FullCommitMessage &&msg, std::optional< const libp2p::peer::PeerId > peer_id) |
|
void | catchUpRequest (const libp2p::peer::PeerId &peer_id, CatchUpRequest &&catch_up_request) |
|
void | catchUpResponse (const libp2p::peer::PeerId &peer_id, CatchUpResponse &&catch_up_response) |
|
| ProtocolBase ()=default |
|
| ProtocolBase (ProtocolBase &&) noexcept=delete |
|
| ProtocolBase (const ProtocolBase &)=delete |
|
virtual | ~ProtocolBase ()=default |
|
ProtocolBase & | operator= (ProtocolBase &&) noexcept=delete |
|
ProtocolBase & | operator= (ProtocolBase const &)=delete |
|
Definition at line 35 of file grandpa_protocol.hpp.
kagome::network::GrandpaProtocol::GrandpaProtocol |
( |
| ) |
|
|
delete |
kagome::network::GrandpaProtocol::~GrandpaProtocol |
( |
| ) |
|
|
overridedefault |
void kagome::network::GrandpaProtocol::catchUpRequest |
( |
const libp2p::peer::PeerId & |
peer_id, |
|
|
CatchUpRequest && |
catch_up_request |
|
) |
| |
void kagome::network::GrandpaProtocol::catchUpResponse |
( |
const libp2p::peer::PeerId & |
peer_id, |
|
|
CatchUpResponse && |
catch_up_response |
|
) |
| |
Impolite to send a catch up request to a peer in a new different Set ID.
Avoid sending useless response (if peer is already caught up)
Definition at line 649 of file grandpa_protocol.cpp.
void kagome::network::GrandpaProtocol::finalize |
( |
FullCommitMessage && |
msg, |
|
|
std::optional< const libp2p::peer::PeerId > |
peer_id |
|
) |
| |
void kagome::network::GrandpaProtocol::newOutgoingStream |
( |
const PeerInfo & |
peer_info | ) |
|
|
overridevirtual |
void kagome::network::GrandpaProtocol::onIncomingStream |
( |
std::shared_ptr< Stream > |
stream | ) |
|
|
overridevirtual |
const std::string& kagome::network::GrandpaProtocol::protocolName |
( |
| ) |
const |
|
inlineoverridevirtual |
void kagome::network::GrandpaProtocol::read |
( |
std::shared_ptr< Stream > |
stream | ) |
|
|
private |
void kagome::network::GrandpaProtocol::readHandshake |
( |
std::shared_ptr< Stream > |
stream, |
|
|
Direction |
direction, |
|
|
std::function< void(outcome::result< void >)> && |
cb |
|
) |
| |
|
private |
bool kagome::network::GrandpaProtocol::start |
( |
| ) |
|
|
overridevirtual |
bool kagome::network::GrandpaProtocol::stop |
( |
| ) |
|
|
overridevirtual |
void kagome::network::GrandpaProtocol::vote |
( |
network::GrandpaVote && |
vote_message, |
|
|
std::optional< const libp2p::peer::PeerId > |
peer_id |
|
) |
| |
void kagome::network::GrandpaProtocol::write |
( |
std::shared_ptr< Stream > |
stream, |
|
|
const int & |
msg |
|
) |
| |
|
private |
void kagome::network::GrandpaProtocol::writeHandshake |
( |
std::shared_ptr< Stream > |
stream, |
|
|
Direction |
direction, |
|
|
std::function< void(outcome::result< void >)> && |
cb |
|
) |
| |
|
private |
std::shared_ptr<boost::asio::io_context> kagome::network::GrandpaProtocol::io_context_ |
|
private |
const auto kagome::network::GrandpaProtocol::kGrandpaProtocolName = "GrandpaProtocol"s |
|
inlinestaticprivate |
constexpr std::chrono::milliseconds kagome::network::GrandpaProtocol::kRecentnessDuration |
|
staticprivate |
Initial value:=
std::chrono::seconds(300)
Node should send catch-up requests rarely to be polite, because processing of them consume more enough resources. How long replying outgoing catch-up requests must be suppressed
Definition at line 103 of file grandpa_protocol.hpp.
const OwnPeerInfo& kagome::network::GrandpaProtocol::own_info_ |
|
private |
std::shared_ptr<PeerManager> kagome::network::GrandpaProtocol::peer_manager_ |
|
private |
std::set<libp2p::peer::PeerId> kagome::network::GrandpaProtocol::recent_catchup_requests_by_peer_ |
|
private |
std::shared_ptr<libp2p::basic::Scheduler> kagome::network::GrandpaProtocol::scheduler_ |
|
private |
std::shared_ptr<StreamEngine> kagome::network::GrandpaProtocol::stream_engine_ |
|
private |
The documentation for this class was generated from the following files: