|
| PeerManager (const Amount &stakeUtxoDustThresholdIn, ChainstateManager &chainmanIn, const ProofRef &localProofIn=ProofRef()) |
|
bool | addNode (NodeId nodeid, const ProofId &proofid) |
| Node API.
|
|
bool | removeNode (NodeId nodeid) |
|
size_t | getNodeCount () const |
|
size_t | getPendingNodeCount () const |
|
bool | updateNextRequestTime (NodeId nodeid, SteadyMilliseconds timeout) |
|
bool | latchAvaproofsSent (NodeId nodeid) |
| Flag that a node did send its compact proofs.
|
|
NodeId | selectNode () |
|
bool | shouldRequestMoreNodes () |
| Returns true if we encountered a lack of node since the last call.
|
|
template<typename Callable > |
bool | forNode (NodeId nodeid, Callable &&func) const |
|
template<typename Callable > |
void | forEachNode (const Peer &peer, Callable &&func) const |
|
bool | updateNextPossibleConflictTime (PeerId peerid, const std::chrono::seconds &nextTime) |
| Proof and Peer related API.
|
|
bool | setFinalized (PeerId peerid) |
| Latch on that this peer has a finalized proof.
|
|
bool | registerProof (const ProofRef &proof, ProofRegistrationState ®istrationState, RegistrationMode mode=RegistrationMode::DEFAULT) |
|
bool | registerProof (const ProofRef &proof, RegistrationMode mode=RegistrationMode::DEFAULT) |
|
bool | rejectProof (const ProofId &proofid, RejectionMode mode=RejectionMode::DEFAULT) |
|
bool | exists (const ProofId &proofid) const |
| Return true if the (valid) proof exists, but only for non-dangling proofs.
|
|
void | cleanupDanglingProofs (std::unordered_set< ProofRef, SaltedProofHasher > ®isteredProofs) |
|
template<typename Callable > |
bool | forPeer (const ProofId &proofid, Callable &&func) const |
|
template<typename Callable > |
void | forEachPeer (Callable &&func) const |
|
std::unordered_set< ProofRef, SaltedProofHasher > | updatedBlockTip () |
| Update the peer set when a new block is connected.
|
|
void | addUnbroadcastProof (const ProofId &proofid) |
| Proof broadcast API.
|
|
void | removeUnbroadcastProof (const ProofId &proofid) |
|
auto | getUnbroadcastProofs () const |
|
uint32_t | getTotalPeersScore () const |
|
uint32_t | getConnectedPeersScore () const |
|
bool | saveRemoteProof (const ProofId &proofid, const NodeId nodeid, const bool present) |
|
std::vector< RemoteProof > | getRemoteProofs (const NodeId nodeid) const |
|
bool | isRemoteProof (const ProofId &proofid) const |
|
bool | setFlaky (const ProofId &proofid) |
|
bool | unsetFlaky (const ProofId &proofid) |
|
template<typename Callable > |
void | forEachFlakyProof (Callable &&func) const |
|
template<typename Callable > |
void | updateAvailabilityScores (const double decayFactor, Callable &&getNodeAvailabilityScore) |
|
bool | removePeer (const PeerId peerid) |
| Remove an existing peer.
|
|
PeerId | selectPeer () const |
| Randomly select a peer to poll.
|
|
uint64_t | compact () |
| Trigger maintenance of internal data structures.
|
|
bool | verify () const |
| Perform consistency check on internal data structures.
|
|
uint64_t | getSlotCount () const |
|
uint64_t | getFragmentation () const |
|
const ProofPool & | getValidProofPool () const |
|
const ProofPool & | getConflictingProofPool () const |
|
const ProofPool & | getImmatureProofPool () const |
|
ProofRef | getProof (const ProofId &proofid) const |
|
bool | isBoundToPeer (const ProofId &proofid) const |
|
bool | isImmature (const ProofId &proofid) const |
|
bool | isInConflictingPool (const ProofId &proofid) const |
|
bool | isDangling (const ProofId &proofid) const |
|
void | setInvalid (const ProofId &proofid) |
|
bool | isInvalid (const ProofId &proofid) const |
|
void | clearAllInvalid () |
|
const ProofRadixTree & | getShareableProofsSnapshot () const |
|
const Amount & | getStakeUtxoDustThreshold () const |
|
bool | selectStakingRewardWinner (const CBlockIndex *pprev, std::vector< std::pair< ProofId, CScript > > &winners) |
| Deterministically select a list of payout scripts based on the proof set and the previous block hash.
|
|
bool | dumpPeersToFile (const fs::path &dumpPath) const |
|
bool | loadPeersFromFile (const fs::path &dumpPath, std::unordered_set< ProofRef, SaltedProofHasher > ®isteredProofs) |
|
|
using | PeerSet = boost::multi_index_container< Peer, bmi::indexed_by< bmi::hashed_unique< bmi::member< Peer, PeerId, &Peer::peerid > >, bmi::hashed_unique< bmi::tag< by_proofid >, proof_index, SaltedProofIdHasher >, bmi::ordered_non_unique< bmi::tag< by_score >, score_index, std::greater< uint32_t > > > > |
| Several nodes can make an avalanche peer.
|
|
using | ProofRadixTree = RadixTree< const Proof, ProofRadixTreeAdapter > |
|
using | NodeSet = boost::multi_index_container< Node, bmi::indexed_by< bmi::hashed_unique< bmi::member< Node, NodeId, &Node::nodeid > >, bmi::ordered_non_unique< bmi::tag< next_request_time >, bmi::composite_key< Node, bmi::member< Node, PeerId, &Node::peerid >, bmi::member< Node, SteadyMilliseconds, &Node::nextRequestTime > > > > > |
|
using | PendingNodeSet = boost::multi_index_container< PendingNode, bmi::indexed_by< bmi::hashed_non_unique< bmi::tag< by_proofid >, bmi::member< PendingNode, ProofId, &PendingNode::proofid >, SaltedProofIdHasher >, bmi::hashed_unique< bmi::tag< by_nodeid >, bmi::member< PendingNode, NodeId, &PendingNode::nodeid > > > > |
|
using | RemoteProofSet = boost::multi_index_container< RemoteProof, bmi::indexed_by< bmi::hashed_unique< bmi::composite_key< RemoteProof, bmi::member< RemoteProof, ProofId, &RemoteProof::proofid >, bmi::member< RemoteProof, NodeId, &RemoteProof::nodeid > >, bmi::composite_key_hash< SaltedProofIdHasher, boost::hash< NodeId > > >, bmi::hashed_non_unique< bmi::tag< by_proofid >, bmi::member< RemoteProof, ProofId, &RemoteProof::proofid >, SaltedProofIdHasher >, bmi::hashed_non_unique< bmi::tag< by_nodeid >, bmi::member< RemoteProof, NodeId, &RemoteProof::nodeid > >, bmi::ordered_non_unique< bmi::tag< by_lastUpdate >, bmi::composite_key< RemoteProof, bmi::member< RemoteProof, NodeId, &RemoteProof::nodeid >, bmi::member< RemoteProof, std::chrono::seconds, &RemoteProof::lastUpdate > > > > > |
|
Definition at line 162 of file peermanager.h.
Filter for proofs that are consensus-invalid or were recently invalidated by avalanche (finalized rejection).
These are not rerequested until they are rolled out of the filter.
Without this filter we'd be re-requesting proofs from each of our peers, increasing bandwidth consumption considerably.
Decreasing the false positive rate is fairly cheap, so we pick one in a million to make it highly unlikely for users to have issues with this filter.
Definition at line 295 of file peermanager.h.