Bitcoin ABC  0.24.10
P2P Digital Currency
Classes | Typedefs | Enumerations | Functions | Variables
avalanche Namespace Reference

Classes

struct  ConflictingProofComparator
 Compare conflicting proofs. More...
 
class  Delegation
 
class  DelegationBuilder
 
struct  DelegationId
 
class  DelegationState
 
class  Hello
 
struct  LimitedProofId
 
struct  next_request_time
 
struct  Node
 
struct  Peer
 
class  PeerManager
 
struct  PendingNode
 
class  Poll
 
class  Processor
 
class  Proof
 
struct  proof_index
 
class  ProofBuilder
 
struct  ProofComparator
 Compare proofs by score, then by id in case of equality. More...
 
struct  ProofId
 
class  ProofPool
 Map a proof to each utxo. More...
 
struct  ProofPoolEntry
 
struct  ProofPoolEntryProofIdKeyExtractor
 
class  ProofValidationState
 
struct  query_timeout
 
class  Response
 
class  SaltedProofIdHasher
 
class  SignedStake
 
struct  Slot
 
class  Stake
 
struct  StakeCommitment
 
struct  TestProofBuilder
 
class  Vote
 
class  VoteItemUpdate
 
struct  VoteRecord
 Vote history. More...
 

Typedefs

using BlockUpdate = VoteItemUpdate< CBlockIndex * >
 
using ProofUpdate = VoteItemUpdate< ProofRef >
 
using BlockVoteMap = std::map< const CBlockIndex *, VoteRecord, CBlockIndexWorkComparator >
 
using ProofVoteMap = std::map< const ProofRef, VoteRecord, ProofComparator >
 
using StakeId = uint256
 
using ProofRef = std::shared_ptr< const Proof >
 

Enumerations

enum  VoteStatus : uint8_t { VoteStatus::Invalid, VoteStatus::Rejected, VoteStatus::Accepted, VoteStatus::Finalized }
 
enum  ProofValidationResult {
  ProofValidationResult::NONE = 0, ProofValidationResult::NO_STAKE, ProofValidationResult::DUST_THRESOLD, ProofValidationResult::DUPLICATE_STAKE,
  ProofValidationResult::WRONG_STAKE_ORDERING, ProofValidationResult::INVALID_STAKE_SIGNATURE, ProofValidationResult::TOO_MANY_UTXOS, ProofValidationResult::INVALID_PAYOUT_SCRIPT,
  ProofValidationResult::INVALID_PROOF_SIGNATURE, ProofValidationResult::MISSING_UTXO, ProofValidationResult::COINBASE_MISMATCH, ProofValidationResult::HEIGHT_MISMATCH,
  ProofValidationResult::AMOUNT_MISMATCH, ProofValidationResult::NON_STANDARD_DESTINATION, ProofValidationResult::DESTINATION_NOT_SUPPORTED, ProofValidationResult::DESTINATION_MISMATCH
}
 
enum  DelegationResult { DelegationResult::NONE = 0, DelegationResult::INVALID_SIGNATURE }
 

Functions

template<typename L , typename F >
static bool reduceLevels (uint256 &hash, const std::vector< L > &levels, F f)
 
template<typename L >
static bool reduceLevels (uint256 &hash, const std::vector< L > &levels)
 
static bool isOrphanState (const ProofValidationState &state)
 
PeerId selectPeerImpl (const std::vector< Slot > &slots, const uint64_t slot, const uint64_t max)
 Internal methods that are exposed for testing purposes. More...
 
static bool IsWorthPolling (const CBlockIndex *pindex) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
 
static bool VerifyProof (const Proof &proof, bilingual_str &error)
 
static bool VerifyDelegation (const Delegation &dg, const CPubKey &expectedPubKey, bilingual_str &error)
 
ProofRef buildRandomProof (uint32_t score, const CKey &masterKey)
 
bool hasDustStake (const ProofRef &proof)
 

Variables

static constexpr Amount PROOF_DUST_THRESHOLD = 1 * COIN
 Minimum amount per utxo. More...
 
constexpr uint32_t MIN_VALID_PROOF_SCORE = 100 * PROOF_DUST_THRESHOLD / COIN
 

Typedef Documentation

◆ BlockUpdate

Definition at line 78 of file processor.h.

◆ BlockVoteMap

Definition at line 82 of file processor.h.

◆ ProofRef

using avalanche::ProofRef = typedef std::shared_ptr<const Proof>

Definition at line 163 of file proof.h.

◆ ProofUpdate

Definition at line 79 of file processor.h.

◆ ProofVoteMap

using avalanche::ProofVoteMap = typedef std::map<const ProofRef, VoteRecord, ProofComparator>

Definition at line 83 of file processor.h.

◆ StakeId

using avalanche::StakeId = typedef uint256

Definition at line 41 of file proof.h.

Enumeration Type Documentation

◆ DelegationResult

Enumerator
NONE 
INVALID_SIGNATURE 

Definition at line 35 of file validation.h.

◆ ProofValidationResult

Enumerator
NONE 
NO_STAKE 
DUST_THRESOLD 
DUPLICATE_STAKE 
WRONG_STAKE_ORDERING 
INVALID_STAKE_SIGNATURE 
TOO_MANY_UTXOS 
INVALID_PAYOUT_SCRIPT 
INVALID_PROOF_SIGNATURE 
MISSING_UTXO 
COINBASE_MISMATCH 
HEIGHT_MISMATCH 
AMOUNT_MISMATCH 
NON_STANDARD_DESTINATION 
DESTINATION_NOT_SUPPORTED 
DESTINATION_MISMATCH 

Definition at line 12 of file validation.h.

◆ VoteStatus

enum avalanche::VoteStatus : uint8_t
strong
Enumerator
Invalid 
Rejected 
Accepted 
Finalized 

Definition at line 57 of file processor.h.

Function Documentation

◆ buildRandomProof()

ProofRef avalanche::buildRandomProof ( uint32_t  score,
const CKey masterKey 
)

Definition at line 20 of file util.cpp.

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

◆ hasDustStake()

bool avalanche::hasDustStake ( const ProofRef proof)

Definition at line 41 of file util.cpp.

Here is the caller graph for this function:

◆ isOrphanState()

static bool avalanche::isOrphanState ( const ProofValidationState state)
static

Definition at line 145 of file peermanager.cpp.

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

◆ IsWorthPolling()

static bool avalanche::IsWorthPolling ( const CBlockIndex pindex)
static

Definition at line 34 of file processor.cpp.

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

◆ reduceLevels() [1/2]

template<typename L >
static bool avalanche::reduceLevels ( uint256 hash,
const std::vector< L > &  levels 
)
static

Definition at line 52 of file delegation.cpp.

Here is the call graph for this function:

◆ reduceLevels() [2/2]

template<typename L , typename F >
static bool avalanche::reduceLevels ( uint256 hash,
const std::vector< L > &  levels,
f 
)
static

Definition at line 36 of file delegation.cpp.

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

◆ selectPeerImpl()

PeerId avalanche::selectPeerImpl ( const std::vector< Slot > &  slots,
const uint64_t  slot,
const uint64_t  max 
)

Internal methods that are exposed for testing purposes.

Definition at line 547 of file peermanager.cpp.

Here is the caller graph for this function:

◆ VerifyDelegation()

static bool avalanche::VerifyDelegation ( const Delegation dg,
const CPubKey expectedPubKey,
bilingual_str error 
)
static

Definition at line 82 of file processor.cpp.

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

◆ VerifyProof()

static bool avalanche::VerifyProof ( const Proof proof,
bilingual_str error 
)
static

Definition at line 51 of file processor.cpp.

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

Variable Documentation

◆ MIN_VALID_PROOF_SCORE

constexpr uint32_t avalanche::MIN_VALID_PROOF_SCORE = 100 * PROOF_DUST_THRESHOLD / COIN
constexpr

Definition at line 16 of file util.h.

◆ PROOF_DUST_THRESHOLD

constexpr Amount avalanche::PROOF_DUST_THRESHOLD = 1 * COIN
staticconstexpr

Minimum amount per utxo.

Definition at line 37 of file proof.h.