![]() |
Bitcoin ABC 0.31.1
P2P Digital Currency
|
#include <processor.h>
Classes | |
struct | GetLocalAcceptance |
struct | IsWorthPolling |
class | NotificationsHandler |
struct | PeerData |
struct | Query |
struct | StakingReward |
Static Public Member Functions | |
static std::unique_ptr< Processor > | MakeProcessor (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 Attributes | |
Config | avaconfig |
CConnman * | connman |
ChainstateManager & | chainman |
CTxMemPool * | mempool |
RWCollection< VoteMap > | voteRecords |
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< QuerySet > | queries |
std::unique_ptr< PeerData > | peerData |
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::Handler > | chainNotificationsHandler |
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 Mutex | g_msgproc_mutex |
Mutex for anything that is only accessed via the msg processing thread. More... | |
![]() | |
~NetEventsInterface ()=default | |
Protected destructor so that instances can only be deleted by derived classes. More... | |
Definition at line 159 of file processor.h.
|
private |
Definition at line 195 of file processor.h.
|
private |
Definition at line 145 of file processor.cpp.
avalanche::Processor::~Processor | ( | ) |
void avalanche::Processor::acceptStakeContender | ( | const StakeContenderId & | contenderId | ) |
Definition at line 1060 of file processor.cpp.
bool avalanche::Processor::addToReconcile | ( | const AnyVoteItem & | item | ) |
Definition at line 426 of file processor.cpp.
void avalanche::Processor::avaproofsSent | ( | NodeId | nodeid | ) |
bool avalanche::Processor::canShareLocalProof | ( | ) |
Definition at line 874 of file processor.cpp.
void avalanche::Processor::cleanupStakingRewards | ( | const int | minHeight | ) |
Definition at line 940 of file processor.cpp.
void avalanche::Processor::clearFinalizedItems | ( | ) |
Definition at line 499 of file processor.cpp.
|
private |
Definition at line 1255 of file processor.cpp.
bool avalanche::Processor::computeStakingReward | ( | const CBlockIndex * | pindex | ) |
Definition at line 888 of file processor.cpp.
bool avalanche::Processor::eraseStakingRewardWinner | ( | const BlockHash & | prevBlockHash | ) |
Definition at line 935 of file processor.cpp.
Handle removal of a node.
Definition at line 1029 of file processor.cpp.
void avalanche::Processor::finalizeStakeContender | ( | const StakeContenderId & | contenderId | ) |
|
inline |
Definition at line 343 of file processor.h.
int avalanche::Processor::getConfidence | ( | const AnyVoteItem & | item | ) | const |
|
private |
Definition at line 1294 of file processor.cpp.
|
inlineprivate |
ProofRef avalanche::Processor::getLocalProof | ( | ) | const |
ProofRegistrationState avalanche::Processor::getLocalProofRegistrationState | ( | ) | const |
Definition at line 759 of file processor.cpp.
CPubKey avalanche::Processor::getSessionPubKey | ( | ) | const |
int avalanche::Processor::getStakeContenderStatus | ( | const StakeContenderId & | contenderId | ) | const |
Track votes on stake contenders.
Definition at line 1037 of file processor.cpp.
|
private |
Definition at line 1343 of file processor.cpp.
|
private |
A list of the nodes that did not get our proof announced via avahello yet because we had no inbound connection.
|
inlineprivate |
Definition at line 238 of file processor.h.
|
inlineprivate |
Definition at line 451 of file processor.h.
|
inlineprivate |
Definition at line 438 of file processor.h.
|
private |
|
private |
|
inline |
Whether there is a finalized tip.
Definition at line 333 of file processor.h.
|
inlineoverride |
Definition at line 374 of file processor.h.
bool avalanche::Processor::isAccepted | ( | const AnyVoteItem & | item | ) | const |
|
inline |
Definition at line 330 of file processor.h.
bool avalanche::Processor::isQuorumEstablished | ( | ) |
Definition at line 795 of file processor.cpp.
bool avalanche::Processor::isRecentlyFinalized | ( | const uint256 & | itemId | ) | const |
|
private |
Definition at line 1436 of file processor.cpp.
|
static |
Definition at line 222 of file processor.cpp.
|
inlineoverride |
Definition at line 376 of file processor.h.
void avalanche::Processor::promoteStakeContendersToTip | ( | ) |
Promote stake contender cache entries to the latest chain tip.
Definition at line 1092 of file processor.cpp.
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.
bool avalanche::Processor::registerVotes | ( | NodeId | nodeid, |
const Response & | response, | ||
std::vector< VoteItemUpdate > & | updates, | ||
int & | banscore, | ||
std::string & | error | ||
) |
void avalanche::Processor::rejectStakeContender | ( | const StakeContenderId & | contenderId | ) |
Definition at line 1087 of file processor.cpp.
|
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.
void avalanche::Processor::sendDelayedAvahello | ( | ) |
bool avalanche::Processor::sendHello | ( | CNode * | pfrom | ) |
Send a avahello message.
pfrom | The node to send the message to |
Definition at line 733 of file processor.cpp.
|
private |
Definition at line 698 of file processor.cpp.
Definition at line 380 of file processor.h.
|
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.
void avalanche::Processor::setRecentlyFinalized | ( | const uint256 & | itemId | ) |
Definition at line 495 of file processor.cpp.
bool avalanche::Processor::setStakingRewardWinners | ( | const CBlockIndex * | pprev, |
const std::vector< CScript > & | payouts | ||
) |
Definition at line 993 of file processor.cpp.
bool avalanche::Processor::setStakingRewardWinners | ( | const CBlockIndex * | pprev, |
const std::vector< std::pair< ProofId, CScript > > & | winners | ||
) |
bool avalanche::Processor::startEventLoop | ( | CScheduler & | scheduler | ) |
bool avalanche::Processor::stopEventLoop | ( | ) |
Definition at line 770 of file processor.cpp.
|
private |
Definition at line 1181 of file processor.cpp.
|
private |
Definition at line 1129 of file processor.cpp.
|
inline |
Definition at line 306 of file processor.h.
|
friend |
Definition at line 487 of file processor.h.
void avalanche::Processor::!cs_delayedAvahelloNodeIds |
Definition at line 387 of file processor.h.
void avalanche::Processor::!cs_finalizationTip |
Definition at line 303 of file processor.h.
void avalanche::Processor::!cs_finalizationTip |
Definition at line 402 of file processor.h.
void avalanche::Processor::!cs_finalizedItems |
Definition at line 287 of file processor.h.
void avalanche::Processor::!cs_finalizedItems |
Definition at line 402 of file processor.h.
|
private |
Definition at line 415 of file processor.h.
bool avalanche::Processor::!cs_invalidatedBlocks |
Definition at line 303 of file processor.h.
void avalanche::Processor::!cs_peerManager |
Definition at line 357 of file processor.h.
bool avalanche::Processor::!cs_peerManager |
Definition at line 367 of file processor.h.
bool avalanche::Processor::!cs_stakingRewards |
Definition at line 347 of file processor.h.
int avalanche::Processor::!cs_stakingRewards |
Definition at line 391 of file processor.h.
void avalanche::Processor::!cs_stakingRewards |
Definition at line 395 of file processor.h.
|
private |
Definition at line 160 of file processor.h.
|
private |
Definition at line 227 of file processor.h.
|
private |
Definition at line 162 of file processor.h.
|
private |
Definition at line 235 of file processor.h.
|
private |
Definition at line 161 of file processor.h.
|
mutableprivate |
Definition at line 240 of file processor.h.
|
mutableprivate |
Definition at line 237 of file processor.h.
|
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.
|
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.
|
mutableprivate |
Keep track of the peers and associated infos.
Definition at line 178 of file processor.h.
|
mutableprivate |
Definition at line 254 of file processor.h.
|
private |
Event loop machinery.
Definition at line 217 of file processor.h.
|
private |
Definition at line 225 of file processor.h.
const bool avalanche::Processor::m_preConsensus {false} |
Definition at line 268 of file processor.h.
const bool avalanche::Processor::m_stakingPreConsensus {false} |
Definition at line 269 of file processor.h.
|
private |
Definition at line 163 of file processor.h.
|
private |
Definition at line 226 of file processor.h.
|
private |
Definition at line 223 of file processor.h.
|
private |
Quorum management.
Definition at line 222 of file processor.h.
|
private |
Definition at line 213 of file processor.h.
|
private |
Definition at line 209 of file processor.h.
|
private |
Definition at line 224 of file processor.h.
|
private |
Keep track of peers and queries sent.
Definition at line 173 of file processor.h.
|
private |
Definition at line 214 of file processor.h.
|
private |
Definition at line 231 of file processor.h.
|
private |
Voting parameters.
Definition at line 230 of file processor.h.
|
private |
Items to run avalanche on.
Definition at line 168 of file processor.h.