![]() |
Bitcoin ABC
0.27.2
P2P Digital Currency
|
Typedefs | |
using | ProofShortIdProcessor = ShortIdProcessor< PrefilledProof, ShortIdProcessorPrefilledProofAdapter, ProofRefCompare > |
using | AnyVoteItem = std::variant< const ProofRef, const CBlockIndex *, const CTransactionRef > |
using | VoteMap = std::map< AnyVoteItem, VoteRecord, VoteMapComparator > |
using | StakeId = uint256 |
using | ProofRef = RCUPtr< const Proof > |
using | ProofIdSet = std::unordered_set< ProofId, SaltedProofIdHasher > |
Enumerations | |
enum class | ProofRegistrationResult { NONE = 0 , ALREADY_REGISTERED , IMMATURE , INVALID , CONFLICTING , REJECTED , COOLDOWN_NOT_ELAPSED , DANGLING , MISSING_UTXO } |
enum class | VoteStatus : uint8_t { Invalid , Rejected , Accepted , Finalized , Stale } |
enum class | ProofValidationResult { NONE = 0 , NO_STAKE , DUST_THRESHOLD , DUPLICATE_STAKE , WRONG_STAKE_ORDERING , INVALID_STAKE_SIGNATURE , TOO_MANY_UTXOS , INVALID_PAYOUT_SCRIPT , INVALID_PROOF_SIGNATURE , EXPIRED , MISSING_UTXO , COINBASE_MISMATCH , HEIGHT_MISMATCH , AMOUNT_MISMATCH , NON_STANDARD_DESTINATION , DESTINATION_NOT_SUPPORTED , DESTINATION_MISMATCH , IMMATURE_UTXO } |
enum class | DelegationResult { NONE = 0 , INVALID_SIGNATURE , TOO_MANY_LEVELS } |
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 | isImmatureState (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 const uint256 | GetVoteItemId (const AnyVoteItem &item) |
static bool | VerifyProof (const Amount &stakeUtxoDustThreshold, const Proof &proof, bilingual_str &error) |
static bool | VerifyDelegation (const Delegation &dg, const CPubKey &expectedPubKey, bilingual_str &error) |
static bool | isNull (const AnyVoteItem &item) |
ProofRef | buildRandomProof (Chainstate &active_chainstate, uint32_t score, int height, const CKey &masterKey) |
bool | hasDustStake (const ProofRef &proof) |
Variables | |
constexpr size_t | MAX_DELEGATION_LEVELS {20} |
The maximum number of delegation levels we are willing to verify. More... | |
static constexpr uint32_t | AVALANCHE_MAX_IMMATURE_PROOFS = 4000 |
Maximum number of immature proofs the peer manager will accept from the network. More... | |
static constexpr Amount | PROOF_DUST_THRESHOLD = 100 * COIN |
Minimum amount per utxo. More... | |
constexpr uint32_t | MIN_VALID_PROOF_SCORE = 100 * PROOF_DUST_THRESHOLD / COIN |
const CScript | UNSPENDABLE_ECREG_PAYOUT_SCRIPT |
using avalanche::AnyVoteItem = typedef std::variant<const ProofRef, const CBlockIndex *, const CTransactionRef> |
Definition at line 84 of file processor.h.
using avalanche::ProofIdSet = typedef std::unordered_set<ProofId, SaltedProofIdHasher> |
Definition at line 52 of file proofpool.h.
using avalanche::ProofRef = typedef RCUPtr<const Proof> |
using avalanche::ProofShortIdProcessor = typedef ShortIdProcessor<PrefilledProof, ShortIdProcessorPrefilledProofAdapter, ProofRefCompare> |
Definition at line 50 of file compactproofs.h.
using avalanche::StakeId = typedef uint256 |
using avalanche::VoteMap = typedef std::map<AnyVoteItem, VoteRecord, VoteMapComparator> |
Definition at line 136 of file processor.h.
|
strong |
Enumerator | |
---|---|
NONE | |
INVALID_SIGNATURE | |
TOO_MANY_LEVELS |
Definition at line 37 of file validation.h.
|
strong |
Enumerator | |
---|---|
NONE | |
ALREADY_REGISTERED | |
IMMATURE | |
INVALID | |
CONFLICTING | |
REJECTED | |
COOLDOWN_NOT_ELAPSED | |
DANGLING | |
MISSING_UTXO |
Definition at line 138 of file peermanager.h.
|
strong |
Definition at line 12 of file validation.h.
|
strong |
Enumerator | |
---|---|
Invalid | |
Rejected | |
Accepted | |
Finalized | |
Stale |
Definition at line 76 of file processor.h.
ProofRef avalanche::buildRandomProof | ( | Chainstate & | active_chainstate, |
uint32_t | score, | ||
int | height, | ||
const CKey & | masterKey | ||
) |
|
static |
bool avalanche::hasDustStake | ( | const ProofRef & | proof | ) |
|
static |
Definition at line 166 of file peermanager.cpp.
|
static |
|
static |
|
static |
Definition at line 36 of file delegation.cpp.
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 769 of file peermanager.cpp.
|
static |
Definition at line 87 of file processor.cpp.
|
static |
Definition at line 55 of file processor.cpp.
|
staticconstexpr |
Maximum number of immature proofs the peer manager will accept from the network.
Note that reorgs can cause the immature pool to temporarily exceed this limit, but a change in chaintip cause previously reorged proofs to be trimmed.
Definition at line 44 of file peermanager.h.
|
constexpr |
The maximum number of delegation levels we are willing to verify.
A Schnorr signature verification takes about 35us on a 2022 average machine, so 20 levels will roughly take under 1ms (accounting some overhead) while being more than enough to cover all the real world usage.
Definition at line 26 of file delegation.h.
|
constexpr |
const CScript avalanche::UNSPENDABLE_ECREG_PAYOUT_SCRIPT |