Bitcoin ABC 0.31.1
P2P Digital Currency
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Classes | Public Member Functions | Static Public Member Functions | Public Attributes | Private Types | Private Member Functions | Private Attributes | Friends | List of all members
avalanche::Processor Class Referencefinal

#include <processor.h>

Inheritance diagram for avalanche::Processor:
[legend]
Collaboration diagram for avalanche::Processor:
[legend]

Classes

struct  GetLocalAcceptance
 
struct  IsWorthPolling
 
class  NotificationsHandler
 
struct  PeerData
 
struct  Query
 
struct  StakingReward
 

Public Member Functions

 ~Processor ()
 
bool addToReconcile (const AnyVoteItem &item) EXCLUSIVE_LOCKS_REQUIRED(!cs_finalizedItems)
 
bool reconcileOrFinalize (const ProofRef &proof) EXCLUSIVE_LOCKS_REQUIRED(!cs_peerManager
 Wrapper around the addToReconcile for proofs that adds back the finalization flag to the peer if it is not polled due to being recently finalized. More...
 
bool isAccepted (const AnyVoteItem &item) const
 
int getConfidence (const AnyVoteItem &item) const
 
bool isRecentlyFinalized (const uint256 &itemId) const EXCLUSIVE_LOCKS_REQUIRED(!cs_finalizedItems)
 
void setRecentlyFinalized (const uint256 &itemId) EXCLUSIVE_LOCKS_REQUIRED(!cs_finalizedItems)
 
void clearFinalizedItems () EXCLUSIVE_LOCKS_REQUIRED(!cs_finalizedItems)
 
void sendResponse (CNode *pfrom, Response response) const
 
bool registerVotes (NodeId nodeid, const Response &response, std::vector< VoteItemUpdate > &updates, int &banscore, std::string &error) EXCLUSIVE_LOCKS_REQUIRED(!cs_peerManager
 
template<typename Callable >
auto withPeerManager (Callable &&func) const EXCLUSIVE_LOCKS_REQUIRED(!cs_peerManager)
 
CPubKey getSessionPubKey () const
 
bool sendHello (CNode *pfrom) EXCLUSIVE_LOCKS_REQUIRED(!cs_delayedAvahelloNodeIds)
 Send a avahello message. More...
 
void sendDelayedAvahello () EXCLUSIVE_LOCKS_REQUIRED(!cs_delayedAvahelloNodeIds)
 
ProofRef getLocalProof () const
 
ProofRegistrationState getLocalProofRegistrationState () const
 
bool isAvalancheServiceAvailable ()
 
bool hasFinalizedTip () const EXCLUSIVE_LOCKS_REQUIRED(!cs_finalizationTip)
 Whether there is a finalized tip. More...
 
bool startEventLoop (CScheduler &scheduler)
 
bool stopEventLoop ()
 
void avaproofsSent (NodeId nodeid) LOCKS_EXCLUDED(cs_main) EXCLUSIVE_LOCKS_REQUIRED(!cs_peerManager)
 
int64_t getAvaproofsNodeCounter () const
 
bool isQuorumEstablished () LOCKS_EXCLUDED(cs_main) EXCLUSIVE_LOCKS_REQUIRED(!cs_peerManager
 
bool canShareLocalProof ()
 
bool computeStakingReward (const CBlockIndex *pindex) EXCLUSIVE_LOCKS_REQUIRED(!cs_peerManager
 
bool eraseStakingRewardWinner (const BlockHash &prevBlockHash) EXCLUSIVE_LOCKS_REQUIRED(!cs_stakingRewards)
 
void cleanupStakingRewards (const int minHeight) EXCLUSIVE_LOCKS_REQUIRED(!cs_stakingRewards
 
bool getStakingRewardWinners (const BlockHash &prevBlockHash, std::vector< std::pair< ProofId, CScript > > &winners) const EXCLUSIVE_LOCKS_REQUIRED(!cs_stakingRewards)
 
bool getStakingRewardWinners (const BlockHash &prevBlockHash, std::vector< CScript > &payouts) const EXCLUSIVE_LOCKS_REQUIRED(!cs_stakingRewards)
 
bool setStakingRewardWinners (const CBlockIndex *pprev, const std::vector< CScript > &payouts) EXCLUSIVE_LOCKS_REQUIRED(!cs_stakingRewards
 
bool setStakingRewardWinners (const CBlockIndex *pprev, const std::vector< std::pair< ProofId, CScript > > &winners) EXCLUSIVE_LOCKS_REQUIRED(!cs_stakingRewards)
 
void InitializeNode (const ::Config &config, CNode &pnode, ServiceFlags our_services) override
 
bool ProcessMessages (const ::Config &config, CNode *pnode, std::atomic< bool > &interrupt) override
 
bool SendMessages (const ::Config &config, CNode *pnode) override
 
void FinalizeNode (const ::Config &config, const CNode &node) override LOCKS_EXCLUDED(cs_main) EXCLUSIVE_LOCKS_REQUIRED(!cs_peerManager
 Handle removal of a node. More...
 
int getStakeContenderStatus (const StakeContenderId &contenderId) const EXCLUSIVE_LOCKS_REQUIRED(!cs_peerManager
 Track votes on stake contenders. More...
 
void acceptStakeContender (const StakeContenderId &contenderId) EXCLUSIVE_LOCKS_REQUIRED(!cs_peerManager)
 
void finalizeStakeContender (const StakeContenderId &contenderId) EXCLUSIVE_LOCKS_REQUIRED(!cs_peerManager
 
void rejectStakeContender (const StakeContenderId &contenderId) EXCLUSIVE_LOCKS_REQUIRED(!cs_peerManager)
 
void promoteStakeContendersToTip () EXCLUSIVE_LOCKS_REQUIRED(!cs_stakingRewards
 Promote stake contender cache entries to the latest chain tip. More...
 
- Public Member Functions inherited from NetEventsInterface
virtual void InitializeNode (const Config &config, CNode &node, ServiceFlags our_services)=0
 Initialize a peer (setup state, queue any initial messages) More...
 
virtual void FinalizeNode (const Config &config, const CNode &node)=0
 Handle removal of a peer (clear state) More...
 
virtual bool ProcessMessages (const Config &config, CNode *pnode, std::atomic< bool > &interrupt) EXCLUSIVE_LOCKS_REQUIRED(g_msgproc_mutex)=0
 Process protocol messages received from a given node. More...
 
virtual bool SendMessages (const Config &config, CNode *pnode) EXCLUSIVE_LOCKS_REQUIRED(g_msgproc_mutex)=0
 Send queued protocol messages to a given node. More...
 

Static Public Member Functions

static std::unique_ptr< ProcessorMakeProcessor (const ArgsManager &argsman, interfaces::Chain &chain, CConnman *connman, ChainstateManager &chainman, CTxMemPool *mempoolIn, CScheduler &scheduler, bilingual_str &error)
 

Public Attributes

const bool m_preConsensus {false}
 
const bool m_stakingPreConsensus {false}
 
bool !cs_finalizedItems
 
bool !cs_invalidatedBlocks
 
bool !cs_finalizationTip
 
bool !cs_stakingRewards
 
void !cs_peerManager
 
bool !cs_peerManager
 
void !cs_delayedAvahelloNodeIds
 
int !cs_stakingRewards
 
void !cs_stakingRewards
 
void !cs_finalizationTip
 
void !cs_finalizedItems
 

Private Types

using QuerySet = boost::multi_index_container< Query, boost::multi_index::indexed_by< boost::multi_index::hashed_unique< boost::multi_index::composite_key< Query, boost::multi_index::member< Query, NodeId, &Query::nodeid >, boost::multi_index::member< Query, uint64_t, &Query::round > > >, boost::multi_index::ordered_non_unique< boost::multi_index::tag< query_timeout >, boost::multi_index::member< Query, SteadyMilliseconds, &Query::timeout > > > >
 

Private Member Functions

std::unique_ptr< PeerManager > peerManager GUARDED_BY (cs_peerManager)
 
const CBlockIndex *finalizationTip GUARDED_BY (cs_finalizationTip)
 
std::unordered_set< NodeId > delayedAvahelloNodeIds GUARDED_BY (cs_delayedAvahelloNodeIds)
 A list of the nodes that did not get our proof announced via avahello yet because we had no inbound connection. More...
 
std::unordered_map< BlockHash, StakingReward, SaltedUint256Hasher > stakingRewards GUARDED_BY (cs_stakingRewards)
 
 Processor (Config avaconfig, interfaces::Chain &chain, CConnman *connmanIn, ChainstateManager &chainman, CTxMemPool *mempoolIn, CScheduler &scheduler, std::unique_ptr< PeerData > peerDataIn, CKey sessionKeyIn, uint32_t minQuorumTotalScoreIn, double minQuorumConnectedScoreRatioIn, int64_t minAvaproofsNodeCountIn, uint32_t staleVoteThresholdIn, uint32_t staleVoteFactorIn, Amount stakeUtxoDustThresholdIn, bool preConsensus, bool stakingPreConsensus)
 
void updatedBlockTip () EXCLUSIVE_LOCKS_REQUIRED(!cs_peerManager
 
void transactionAddedToMempool (const CTransactionRef &tx) EXCLUSIVE_LOCKS_REQUIRED(!cs_finalizedItems)
 
void runEventLoop () EXCLUSIVE_LOCKS_REQUIRED(!cs_peerManager
 
void clearTimedoutRequests () EXCLUSIVE_LOCKS_REQUIRED(!cs_peerManager)
 
std::vector< CInvgetInvsForNextPoll (bool forPoll=true) EXCLUSIVE_LOCKS_REQUIRED(!cs_peerManager
 
bool sendHelloInternal (CNode *pfrom) EXCLUSIVE_LOCKS_REQUIRED(cs_delayedAvahelloNodeIds)
 
AnyVoteItem getVoteItemFromInv (const CInv &inv) const EXCLUSIVE_LOCKS_REQUIRED(!cs_peerManager)
 
bool setContenderStatusForLocalWinners (const CBlockIndex *pindex, std::vector< StakeContenderId > &pollableContenders) EXCLUSIVE_LOCKS_REQUIRED(!cs_peerManager
 Helper to set the vote status for local winners in the contender cache. More...
 
CRollingBloomFilter invalidatedBlocks GUARDED_BY (cs_invalidatedBlocks)
 
CRollingBloomFilter finalizedItems GUARDED_BY (cs_finalizedItems)
 
bool isWorthPolling (const AnyVoteItem &item) const EXCLUSIVE_LOCKS_REQUIRED(!cs_finalizedItems)
 
bool getLocalAcceptance (const AnyVoteItem &item) const
 

Private Attributes

Config avaconfig
 
CConnmanconnman
 
ChainstateManagerchainman
 
CTxMemPoolmempool
 
RWCollection< VoteMapvoteRecords
 Items to run avalanche on. More...
 
std::atomic< uint64_t > round
 Keep track of peers and queries sent. More...
 
Mutex cs_peerManager
 Keep track of the peers and associated infos. More...
 
RWCollection< QuerySetqueries
 
std::unique_ptr< PeerDatapeerData
 
CKey sessionKey
 
EventLoop eventLoop
 Event loop machinery. More...
 
uint32_t minQuorumScore
 Quorum management. More...
 
double minQuorumConnectedScoreRatio
 
std::atomic< bool > quorumIsEstablished {false}
 
std::atomic< bool > m_canShareLocalProof {false}
 
int64_t minAvaproofsNodeCount
 
std::atomic< int64_t > avaproofsNodeCounter {0}
 
const uint32_t staleVoteThreshold
 Voting parameters. More...
 
const uint32_t staleVoteFactor
 
std::unique_ptr< interfaces::HandlerchainNotificationsHandler
 
Mutex cs_finalizationTip
 
Mutex cs_delayedAvahelloNodeIds
 
Mutex cs_stakingRewards
 
std::vector< CInv!cs_finalizedItems
 
Mutex cs_invalidatedBlocks
 We don't need many blocks but a low false positive rate. More...
 
Mutex cs_finalizedItems
 Rolling bloom filter to track recently finalized inventory items of any type. More...
 

Friends

struct ::avalanche::AvalancheTest
 

Additional Inherited Members

- Static Public Attributes inherited from NetEventsInterface
static Mutex g_msgproc_mutex
 Mutex for anything that is only accessed via the msg processing thread. More...
 
- Protected Member Functions inherited from NetEventsInterface
 ~NetEventsInterface ()=default
 Protected destructor so that instances can only be deleted by derived classes. More...
 

Detailed Description

Definition at line 159 of file processor.h.

Member Typedef Documentation

◆ QuerySet

using avalanche::Processor::QuerySet = boost::multi_index_container< Query, boost::multi_index::indexed_by< boost::multi_index::hashed_unique<boost::multi_index::composite_key< Query, boost::multi_index::member<Query, NodeId, &Query::nodeid>, boost::multi_index::member<Query, uint64_t, &Query::round> >>, boost::multi_index::ordered_non_unique< boost::multi_index::tag<query_timeout>, boost::multi_index::member<Query, SteadyMilliseconds, &Query::timeout> >> >
private

Definition at line 195 of file processor.h.

Constructor & Destructor Documentation

◆ Processor()

avalanche::Processor::Processor ( Config  avaconfig,
interfaces::Chain chain,
CConnman connmanIn,
ChainstateManager chainman,
CTxMemPool mempoolIn,
CScheduler scheduler,
std::unique_ptr< PeerData peerDataIn,
CKey  sessionKeyIn,
uint32_t  minQuorumTotalScoreIn,
double  minQuorumConnectedScoreRatioIn,
int64_t  minAvaproofsNodeCountIn,
uint32_t  staleVoteThresholdIn,
uint32_t  staleVoteFactorIn,
Amount  stakeUtxoDustThresholdIn,
bool  preConsensus,
bool  stakingPreConsensus 
)
private

Definition at line 145 of file processor.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ~Processor()

avalanche::Processor::~Processor ( )

Definition at line 208 of file processor.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ acceptStakeContender()

void avalanche::Processor::acceptStakeContender ( const StakeContenderId contenderId)

Definition at line 1060 of file processor.cpp.

◆ addToReconcile()

bool avalanche::Processor::addToReconcile ( const AnyVoteItem item)

Definition at line 426 of file processor.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ avaproofsSent()

void avalanche::Processor::avaproofsSent ( NodeId  nodeid)

Definition at line 774 of file processor.cpp.

Here is the call graph for this function:

◆ canShareLocalProof()

bool avalanche::Processor::canShareLocalProof ( )

Definition at line 874 of file processor.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cleanupStakingRewards()

void avalanche::Processor::cleanupStakingRewards ( const int  minHeight)

Definition at line 940 of file processor.cpp.

◆ clearFinalizedItems()

void avalanche::Processor::clearFinalizedItems ( )

Definition at line 499 of file processor.cpp.

◆ clearTimedoutRequests()

void avalanche::Processor::clearTimedoutRequests ( )
private

Definition at line 1255 of file processor.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ computeStakingReward()

bool avalanche::Processor::computeStakingReward ( const CBlockIndex pindex)

Definition at line 888 of file processor.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ eraseStakingRewardWinner()

bool avalanche::Processor::eraseStakingRewardWinner ( const BlockHash prevBlockHash)

Definition at line 935 of file processor.cpp.

◆ FinalizeNode()

void avalanche::Processor::FinalizeNode ( const ::Config config,
const CNode node 
)
override

Handle removal of a node.

Definition at line 1029 of file processor.cpp.

◆ finalizeStakeContender()

void avalanche::Processor::finalizeStakeContender ( const StakeContenderId contenderId)

Definition at line 1065 of file processor.cpp.

Here is the call graph for this function:

◆ getAvaproofsNodeCounter()

int64_t avalanche::Processor::getAvaproofsNodeCounter ( ) const
inline

Definition at line 343 of file processor.h.

◆ getConfidence()

int avalanche::Processor::getConfidence ( const AnyVoteItem item) const

Definition at line 477 of file processor.cpp.

Here is the call graph for this function:

◆ getInvsForNextPoll()

std::vector< CInv > avalanche::Processor::getInvsForNextPoll ( bool  forPoll = true)
private

Definition at line 1294 of file processor.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getLocalAcceptance()

bool avalanche::Processor::getLocalAcceptance ( const AnyVoteItem item) const
inlineprivate

Definition at line 483 of file processor.h.

Here is the caller graph for this function:

◆ getLocalProof()

ProofRef avalanche::Processor::getLocalProof ( ) const

Definition at line 755 of file processor.cpp.

Here is the caller graph for this function:

◆ getLocalProofRegistrationState()

ProofRegistrationState avalanche::Processor::getLocalProofRegistrationState ( ) const

Definition at line 759 of file processor.cpp.

◆ getSessionPubKey()

CPubKey avalanche::Processor::getSessionPubKey ( ) const

Definition at line 694 of file processor.cpp.

Here is the call graph for this function:

◆ getStakeContenderStatus()

int avalanche::Processor::getStakeContenderStatus ( const StakeContenderId contenderId) const

Track votes on stake contenders.

Definition at line 1037 of file processor.cpp.

Here is the call graph for this function:

◆ getStakingRewardWinners() [1/2]

bool avalanche::Processor::getStakingRewardWinners ( const BlockHash prevBlockHash,
std::vector< CScript > &  payouts 
) const

Definition at line 977 of file processor.cpp.

Here is the call graph for this function:

◆ getStakingRewardWinners() [2/2]

bool avalanche::Processor::getStakingRewardWinners ( const BlockHash prevBlockHash,
std::vector< std::pair< ProofId, CScript > > &  winners 
) const

Definition at line 964 of file processor.cpp.

Here is the caller graph for this function:

◆ getVoteItemFromInv()

AnyVoteItem avalanche::Processor::getVoteItemFromInv ( const CInv inv) const
private

Definition at line 1343 of file processor.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GUARDED_BY() [1/6]

std::unordered_set< NodeId > delayedAvahelloNodeIds avalanche::Processor::GUARDED_BY ( cs_delayedAvahelloNodeIds  )
private

A list of the nodes that did not get our proof announced via avahello yet because we had no inbound connection.

◆ GUARDED_BY() [2/6]

const CBlockIndex *finalizationTip avalanche::Processor::GUARDED_BY ( cs_finalizationTip  )
inlineprivate

Definition at line 238 of file processor.h.

◆ GUARDED_BY() [3/6]

CRollingBloomFilter finalizedItems avalanche::Processor::GUARDED_BY ( cs_finalizedItems  )
inlineprivate

Definition at line 451 of file processor.h.

◆ GUARDED_BY() [4/6]

CRollingBloomFilter invalidatedBlocks avalanche::Processor::GUARDED_BY ( cs_invalidatedBlocks  )
inlineprivate

Definition at line 438 of file processor.h.

◆ GUARDED_BY() [5/6]

std::unique_ptr< PeerManager > peerManager avalanche::Processor::GUARDED_BY ( cs_peerManager  )
private

◆ GUARDED_BY() [6/6]

std::unordered_map< BlockHash, StakingReward, SaltedUint256Hasher > stakingRewards avalanche::Processor::GUARDED_BY ( cs_stakingRewards  )
private

◆ hasFinalizedTip()

bool avalanche::Processor::hasFinalizedTip ( ) const
inline

Whether there is a finalized tip.

Definition at line 333 of file processor.h.

Here is the caller graph for this function:

◆ InitializeNode()

void avalanche::Processor::InitializeNode ( const ::Config config,
CNode pnode,
ServiceFlags  our_services 
)
inlineoverride

Definition at line 374 of file processor.h.

◆ isAccepted()

bool avalanche::Processor::isAccepted ( const AnyVoteItem item) const

Definition at line 463 of file processor.cpp.

Here is the call graph for this function:

◆ isAvalancheServiceAvailable()

bool avalanche::Processor::isAvalancheServiceAvailable ( )
inline

Definition at line 330 of file processor.h.

◆ isQuorumEstablished()

bool avalanche::Processor::isQuorumEstablished ( )

Definition at line 795 of file processor.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isRecentlyFinalized()

bool avalanche::Processor::isRecentlyFinalized ( const uint256 itemId) const

Definition at line 491 of file processor.cpp.

Here is the caller graph for this function:

◆ isWorthPolling()

bool avalanche::Processor::isWorthPolling ( const AnyVoteItem item) const
private

Definition at line 1436 of file processor.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MakeProcessor()

std::unique_ptr< Processor > avalanche::Processor::MakeProcessor ( const ArgsManager argsman,
interfaces::Chain chain,
CConnman connman,
ChainstateManager chainman,
CTxMemPool mempoolIn,
CScheduler scheduler,
bilingual_str error 
)
static

Definition at line 222 of file processor.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ProcessMessages()

bool avalanche::Processor::ProcessMessages ( const ::Config config,
CNode pnode,
std::atomic< bool > &  interrupt 
)
inlineoverride

Definition at line 376 of file processor.h.

◆ promoteStakeContendersToTip()

void avalanche::Processor::promoteStakeContendersToTip ( )

Promote stake contender cache entries to the latest chain tip.

Definition at line 1092 of file processor.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ reconcileOrFinalize()

bool avalanche::Processor::reconcileOrFinalize ( const ProofRef proof)

Wrapper around the addToReconcile for proofs that adds back the finalization flag to the peer if it is not polled due to being recently finalized.

Definition at line 444 of file processor.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ registerVotes()

bool avalanche::Processor::registerVotes ( NodeId  nodeid,
const Response response,
std::vector< VoteItemUpdate > &  updates,
int &  banscore,
std::string &  error 
)

Definition at line 540 of file processor.cpp.

Here is the call graph for this function:

◆ rejectStakeContender()

void avalanche::Processor::rejectStakeContender ( const StakeContenderId contenderId)

Definition at line 1087 of file processor.cpp.

◆ runEventLoop()

void avalanche::Processor::runEventLoop ( )
private

If we lost contact to that node, then we remove it from nodeids, but never add the request to queries, which ensures bad nodes get cleaned up over time.

Definition at line 1187 of file processor.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sendDelayedAvahello()

void avalanche::Processor::sendDelayedAvahello ( )

Definition at line 738 of file processor.cpp.

Here is the call graph for this function:

◆ sendHello()

bool avalanche::Processor::sendHello ( CNode pfrom)

Send a avahello message.

Parameters
pfromThe node to send the message to
Returns
True if a non-null delegation has been announced

Definition at line 733 of file processor.cpp.

Here is the call graph for this function:

◆ sendHelloInternal()

bool avalanche::Processor::sendHelloInternal ( CNode pfrom)
private

Definition at line 698 of file processor.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SendMessages()

bool avalanche::Processor::SendMessages ( const ::Config config,
CNode pnode 
)
inlineoverride

Definition at line 380 of file processor.h.

◆ sendResponse()

void avalanche::Processor::sendResponse ( CNode pfrom,
Response  response 
) const

Definition at line 533 of file processor.cpp.

Here is the call graph for this function:

◆ setContenderStatusForLocalWinners()

bool avalanche::Processor::setContenderStatusForLocalWinners ( const CBlockIndex pindex,
std::vector< StakeContenderId > &  pollableContenders 
)
private

Helper to set the vote status for local winners in the contender cache.

pollableContenders are the highest ranking contenders that we should poll.

Definition at line 1117 of file processor.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setRecentlyFinalized()

void avalanche::Processor::setRecentlyFinalized ( const uint256 itemId)

Definition at line 495 of file processor.cpp.

◆ setStakingRewardWinners() [1/2]

bool avalanche::Processor::setStakingRewardWinners ( const CBlockIndex pprev,
const std::vector< CScript > &  payouts 
)

Definition at line 993 of file processor.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setStakingRewardWinners() [2/2]

bool avalanche::Processor::setStakingRewardWinners ( const CBlockIndex pprev,
const std::vector< std::pair< ProofId, CScript > > &  winners 
)

Definition at line 1015 of file processor.cpp.

Here is the call graph for this function:

◆ startEventLoop()

bool avalanche::Processor::startEventLoop ( CScheduler scheduler)

Definition at line 765 of file processor.cpp.

Here is the call graph for this function:

◆ stopEventLoop()

bool avalanche::Processor::stopEventLoop ( )

Definition at line 770 of file processor.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ transactionAddedToMempool()

void avalanche::Processor::transactionAddedToMempool ( const CTransactionRef tx)
private

Definition at line 1181 of file processor.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ updatedBlockTip()

void avalanche::Processor::updatedBlockTip ( )
private

Definition at line 1129 of file processor.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ withPeerManager()

template<typename Callable >
auto avalanche::Processor::withPeerManager ( Callable &&  func) const
inline

Definition at line 306 of file processor.h.

Friends And Related Function Documentation

◆ ::avalanche::AvalancheTest

friend struct ::avalanche::AvalancheTest
friend

Definition at line 487 of file processor.h.

Member Data Documentation

◆ !cs_delayedAvahelloNodeIds

void avalanche::Processor::!cs_delayedAvahelloNodeIds

Definition at line 387 of file processor.h.

◆ !cs_finalizationTip [1/2]

void avalanche::Processor::!cs_finalizationTip

Definition at line 303 of file processor.h.

◆ !cs_finalizationTip [2/2]

void avalanche::Processor::!cs_finalizationTip

Definition at line 402 of file processor.h.

◆ !cs_finalizedItems [1/3]

void avalanche::Processor::!cs_finalizedItems

Definition at line 287 of file processor.h.

◆ !cs_finalizedItems [2/3]

void avalanche::Processor::!cs_finalizedItems

Definition at line 402 of file processor.h.

◆ !cs_finalizedItems [3/3]

std::vector< CInv > avalanche::Processor::!cs_finalizedItems
private

Definition at line 415 of file processor.h.

◆ !cs_invalidatedBlocks

bool avalanche::Processor::!cs_invalidatedBlocks

Definition at line 303 of file processor.h.

◆ !cs_peerManager [1/2]

void avalanche::Processor::!cs_peerManager

Definition at line 357 of file processor.h.

◆ !cs_peerManager [2/2]

bool avalanche::Processor::!cs_peerManager

Definition at line 367 of file processor.h.

◆ !cs_stakingRewards [1/3]

bool avalanche::Processor::!cs_stakingRewards

Definition at line 347 of file processor.h.

◆ !cs_stakingRewards [2/3]

int avalanche::Processor::!cs_stakingRewards

Definition at line 391 of file processor.h.

◆ !cs_stakingRewards [3/3]

void avalanche::Processor::!cs_stakingRewards

Definition at line 395 of file processor.h.

◆ avaconfig

Config avalanche::Processor::avaconfig
private

Definition at line 160 of file processor.h.

◆ avaproofsNodeCounter

std::atomic<int64_t> avalanche::Processor::avaproofsNodeCounter {0}
private

Definition at line 227 of file processor.h.

◆ chainman

ChainstateManager& avalanche::Processor::chainman
private

Definition at line 162 of file processor.h.

◆ chainNotificationsHandler

std::unique_ptr<interfaces::Handler> avalanche::Processor::chainNotificationsHandler
private

Definition at line 235 of file processor.h.

◆ connman

CConnman* avalanche::Processor::connman
private

Definition at line 161 of file processor.h.

◆ cs_delayedAvahelloNodeIds

Mutex avalanche::Processor::cs_delayedAvahelloNodeIds
mutableprivate

Definition at line 240 of file processor.h.

◆ cs_finalizationTip

Mutex avalanche::Processor::cs_finalizationTip
mutableprivate

Definition at line 237 of file processor.h.

◆ cs_finalizedItems

Mutex avalanche::Processor::cs_finalizedItems
mutableprivate

Rolling bloom filter to track recently finalized inventory items of any type.

Once placed in this filter, those items will not be polled again unless they roll out. Note that this one filter tracks all types so blocks may be rolled out by transaction activity for example.

We want a low false positive rate to prevent accidentally not polling for an item when it is first seen.

Definition at line 450 of file processor.h.

◆ cs_invalidatedBlocks

Mutex avalanche::Processor::cs_invalidatedBlocks
mutableprivate

We don't need many blocks but a low false positive rate.

In the event of a false positive the node might skip polling this block. Such a block will not get marked as finalized until it is reconsidered for polling (if the filter changed its state) or another block is found.

Definition at line 437 of file processor.h.

◆ cs_peerManager

Mutex avalanche::Processor::cs_peerManager
mutableprivate

Keep track of the peers and associated infos.

Definition at line 178 of file processor.h.

◆ cs_stakingRewards

Mutex avalanche::Processor::cs_stakingRewards
mutableprivate

Definition at line 254 of file processor.h.

◆ eventLoop

EventLoop avalanche::Processor::eventLoop
private

Event loop machinery.

Definition at line 217 of file processor.h.

◆ m_canShareLocalProof

std::atomic<bool> avalanche::Processor::m_canShareLocalProof {false}
private

Definition at line 225 of file processor.h.

◆ m_preConsensus

const bool avalanche::Processor::m_preConsensus {false}

Definition at line 268 of file processor.h.

◆ m_stakingPreConsensus

const bool avalanche::Processor::m_stakingPreConsensus {false}

Definition at line 269 of file processor.h.

◆ mempool

CTxMemPool* avalanche::Processor::mempool
private

Definition at line 163 of file processor.h.

◆ minAvaproofsNodeCount

int64_t avalanche::Processor::minAvaproofsNodeCount
private

Definition at line 226 of file processor.h.

◆ minQuorumConnectedScoreRatio

double avalanche::Processor::minQuorumConnectedScoreRatio
private

Definition at line 223 of file processor.h.

◆ minQuorumScore

uint32_t avalanche::Processor::minQuorumScore
private

Quorum management.

Definition at line 222 of file processor.h.

◆ peerData

std::unique_ptr<PeerData> avalanche::Processor::peerData
private

Definition at line 213 of file processor.h.

◆ queries

RWCollection<QuerySet> avalanche::Processor::queries
private

Definition at line 209 of file processor.h.

◆ quorumIsEstablished

std::atomic<bool> avalanche::Processor::quorumIsEstablished {false}
private

Definition at line 224 of file processor.h.

◆ round

std::atomic<uint64_t> avalanche::Processor::round
private

Keep track of peers and queries sent.

Definition at line 173 of file processor.h.

◆ sessionKey

CKey avalanche::Processor::sessionKey
private

Definition at line 214 of file processor.h.

◆ staleVoteFactor

const uint32_t avalanche::Processor::staleVoteFactor
private

Definition at line 231 of file processor.h.

◆ staleVoteThreshold

const uint32_t avalanche::Processor::staleVoteThreshold
private

Voting parameters.

Definition at line 230 of file processor.h.

◆ voteRecords

RWCollection<VoteMap> avalanche::Processor::voteRecords
private

Items to run avalanche on.

Definition at line 168 of file processor.h.


The documentation for this class was generated from the following files: