|
veriblock-pop-cpp
C++11 Libraries for leveraging VeriBlock Proof-Of-Proof blockchain technology.
|
Defines logging helpers. More...
Namespaces | |
| namespace | json |
| Package that contains adaptors to simplify serialization of entities to JSON. | |
Classes | |
| class | Address |
| Represents address on VBK chain. More... | |
| class | AltBlock |
| Represents a view on Altchain block - i.e. More... | |
| struct | AltBlockTree |
| Represents simplified view on Altchain's block tree, maintains VBK tree and BTC tree. More... | |
| struct | AltChainParams |
| Base class for all Altchain-related configs. More... | |
| struct | AltChainParamsRegTest |
| struct | AltCommandGroupStore |
| A wrapper for the payload store that constructs command objects. More... | |
| class | ArithUint256 |
| 256-bit unsigned big integer. More... | |
| class | ATV |
| Atlchain endorsement. More... | |
| struct | AuthenticatedContextInfoContainer |
| Contains ContextInfoContainer and merkle path which authenticates hash of ContextInfoContainer to a block header. More... | |
| struct | BaseBlockTree |
| Base block tree that stores all blocks, maintains tree tips, maintains active chain. More... | |
| struct | Blob |
| Contiguous byte array of fixed size. More... | |
| struct | BlockBatch |
| An interface which represents single write batch of a group of blocks. More... | |
| struct | BlockIndex |
| A node in a block tree. More... | |
| struct | BlockIterator |
| An abstraction over on-disk storage block iterator. More... | |
| struct | BlockReader |
| An abstraction over on-disk storage iterator. More... | |
| struct | BlockTree |
| BlockTree is a tree of blocks with single "bootstrap" block as root. More... | |
| struct | BtcBlock |
| Bitcoin block. More... | |
| struct | BtcChainParams |
| base class for BTC params More... | |
| struct | BtcChainParamsMain |
| mainnet network params in Bitcoin chain. More... | |
| struct | BtcChainParamsRegTest |
| regtest network params in Bitcoin chain. More... | |
| struct | BtcChainParamsTest |
| testnet3 network params in Bitcoin chain. More... | |
| struct | BtcTx |
| Bitcoin transaction representation. More... | |
| struct | CacheEntry |
| struct | Chain |
| Fully in-memory chain representation. More... | |
| struct | ChainSlice |
| Non-owning partial chain view similar to std::span. More... | |
| struct | CheckPublicationData |
| A command which performs stateful check of PublicationData stored in ATV. More... | |
| struct | Coin |
| represents VBK atomic units More... | |
| struct | Config |
| A container for Bitcoin and Veriblock configuration data. More... | |
| struct | ContextInfoContainer |
| Container of context info for endorsed block. More... | |
| struct | DefaultPopRewardsCalculator |
| struct | Endorsement |
| struct | EthashCache |
| struct | EthashCacheI |
| struct | FinalizedPayloadsIndex |
| Stores a mapping "payload id -> containing block" hash of payloads that are stored in finalized blocks. More... | |
| struct | Finalizer |
| Finalizer holds a function that is executed on Finalizer destruction. More... | |
| struct | IsPopPayload |
| type trait which returns true on types that are "POP Payloads" More... | |
| struct | KeystoneContainer |
| A container for two previous keystones of endorsed block. More... | |
| struct | Logger |
| An interface for logger. More... | |
| struct | MemPool |
| Data structure, that stores in memory all valid payloads (ATV, VTB, VbkBlock) submitted by other peers through p2p or by users through rpc. More... | |
| struct | MempoolResult |
| An entity which is returned from MemPool on call to submitAll. More... | |
| struct | MerklePath |
Path in Merkle tree which proves that subject is inside this tree. More... | |
| struct | NetworkBytePair |
| Stores pair of TxType and VBK network byte. More... | |
| struct | Output |
| Single spending output. More... | |
| struct | PayloadsIndex |
| Payloads index that stores mapping "payload id -> set of containing blocks" from all NON-FINALIZED blocks. More... | |
| struct | PayloadsStorage |
| Accessor for ATV/VTB/VbkBlock bodies given hash. More... | |
| struct | PopContext |
| Main entrypoint into the veriblock-pop library. More... | |
| struct | PopData |
| Represents ALT block body of POP-related info. More... | |
| struct | PopPayouts |
| A container for Pop payouts information. More... | |
| struct | PopPayoutsParams |
| Defines config for POP payouts. More... | |
| struct | PopRewardsCalculator |
| struct | PopRewardsCurveParams |
| A container for curve params. More... | |
| struct | PopRewardsParams |
| A container for PoP rewards params. More... | |
| struct | ProgpowHeaderCache |
| struct | ProgpowHeaderCacheI |
| struct | PublicationData |
| Publication data about ALT block inside VBK blockchain. More... | |
| struct | ReadStream |
| Binary reading stream, that is useful during binary deserialization. More... | |
| class | reverse_range |
| translates a pair of forward iterators to a range whose regular iteration order is "backward" More... | |
| struct | Slice |
| Non-owning contiguous array. More... | |
| struct | StateCorruptedException |
| Is thrown only when this library detects POP-related state corruption, and can't recover. More... | |
| struct | StorageIOException |
| exception which is thrown on any IO errors. More... | |
| struct | StoredBlockIndex |
| class | ValidationState |
| Class that is used for storing validation state. More... | |
| struct | VbkBlock |
| Veriblock block. More... | |
| class | VbkBlockTree |
| Veriblock block tree. More... | |
| struct | VbkChainParams |
| VeriBlock chain parameters. More... | |
| struct | VbkChainParamsMain |
| MainNet VBK parameters. More... | |
| struct | VbkChainParamsRegTest |
| RegTest VBK config. More... | |
| struct | VbkChainParamsTest |
| TestNet VBK config. More... | |
| struct | VbkCommandGroupStore |
| A wrapper for the payload store that constructs command objects. More... | |
| struct | VbkMerklePath |
Path in Merkle tree, which proves that subject exists in the tree. More... | |
| struct | VbkNetworkType |
| works as optional<uint8_t> More... | |
| struct | VbkPopTx |
| Veriblock POP transaction, which endorses VBK block in BTC blockchain. More... | |
| struct | VbkTx |
| Veriblock transaction, which endorses ALT block in VBK blockchain. More... | |
| struct | vblake_ctx |
| vBlake hash state context. More... | |
| struct | VTB |
| Veriblock to Bitcoin publication, committed to Veriblock blockchain in containingBlock. More... | |
| class | WriteStream |
| Binary writer that is useful for binary serialization. More... | |
Typedefs | |
| using | BtcBlockTree = BlockTree< BtcBlock, BtcChainParams > |
| Bitcoin tree. More... | |
| using | uint128 = Blob< VBK_MERKLE_ROOT_HASH_SIZE > |
| Fixed-size array. More... | |
| using | uint256 = Blob< SHA256_HASH_SIZE > |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
| using | uint72 = Blob< VBK_PREVIOUS_KEYSTONE_HASH_SIZE > |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
| using | uint96 = Blob< VBK_PREVIOUS_BLOCK_HASH_SIZE > |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
| using | uint192 = Blob< VBK_BLOCK_HASH_SIZE > |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
Enumerations | |
| enum | BlockStateStatus : uint32_t { BLOCK_VALID_TREE = 1 , BLOCK_CONNECTED = 2 , BLOCK_CAN_BE_APPLIED_MAYBE_WITH_OTHER_CHAIN = 3 , BLOCK_CAN_BE_APPLIED = 4 , BLOCK_VALID_MASK } |
| Flags that describe block status. More... | |
| enum | BlockValidityStatus : uint32_t { BLOCK_VALID_UNKNOWN = 0 , BLOCK_BOOTSTRAP = 1 << 4 , BLOCK_FAILED_BLOCK = 1 << 5 , BLOCK_FAILED_POP = 1 << 6 , BLOCK_FAILED_CHILD = 1 << 7 , BLOCK_FAILED_MASK , BLOCK_HAS_PAYLOADS = 1 << 8 , BLOCK_ACTIVE = 1 << 9 , BLOCK_DELETED = 1 << 10 } |
| Flags that describe block status. More... | |
| enum class | PopFrOutcome { UNKNOWN , CANDIDATE_IS_TIP , CANDIDATE_INVALID_CHAIN , CANDIDATE_INVALID_PAYLOADS , CANDIDATE_PART_OF_ACTIVE_CHAIN , CANDIDATE_IS_TIP_SUCCESSOR , TIP_IS_FINAL , BOTH_DONT_CROSS_KEYSTONE_BOUNDARY , CANDIDATE_INVALID_INDEPENDENTLY , HIGHER_POP_SCORE } |
| enum class | TxType { VBK_TX = 0x01 , VBK_POP_TX = 0x02 } |
| Veriblock transaction type. More... | |
| enum class | AddressType { STANDARD = 1 , MULTISIG = 3 } |
| VBK Address type (modelled after transaction type). More... | |
| enum class | LogLevel { debug , info , warn , error , critical , off } |
| Log level. More... | |
Functions | |
| template<typename T , typename Container > | |
| const T | min_or_default (Container &c, const T default_) |
| returns min value in a container (vector, array...), or "default" value if container is empty More... | |
| template<typename BlockTreeT > | |
| std::vector< typename BlockTreeT::block_t > | getContext (const BlockTreeT &tree, typename BlockTreeT::hash_t tip, size_t size=std::numeric_limits< size_t >::max()) |
Build a context (blocks necessary to connect) in a tree from tip backwards size elements. More... | |
| template<typename BlockTree > | |
| std::vector< std::vector< uint8_t > > | getLastKnownBlocks (const BlockTree &tree, size_t size) |
| helper to get last N known block hashes More... | |
| template<typename Block , typename ChainParams > | |
| bool | addBlocks (BlockTree< Block, ChainParams > &tree, const std::vector< std::vector< uint8_t > > &blocks, ValidationState &state) |
| helper to accept multiple blocks More... | |
| bool | GeneratePublicationData (const std::vector< uint8_t > &endorsedBlockHeader, const std::vector< uint8_t > &txMerkleRoot, const PopData &popData, const std::vector< uint8_t > &payoutInfo, const AltBlockTree &tree, PublicationData &out) |
| Creates a PublicationData - an entity, which stores information about Altchain block endorsement. More... | |
| PublicationData | GeneratePublicationData (const std::vector< uint8_t > &endorsedBlockHeader, const BlockIndex< AltBlock > &endorsedBlock, const std::vector< uint8_t > &txMerkleRoot, const PopData &popData, const std::vector< uint8_t > &payoutInfo, const AltChainParams ¶ms) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| PublicationData | GeneratePublicationData (const std::vector< uint8_t > &endorsedBlockHeader, const BlockIndex< AltBlock > &endorsedBlock, const std::vector< uint8_t > &txMerkleRoot, uint32_t version, const std::vector< ATV::id_t > &atv_ids, const std::vector< VTB::id_t > &vtb_ids, const std::vector< VbkBlock::id_t > &vbk_ids, const std::vector< uint8_t > &payoutInfo, const AltChainParams ¶ms) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| uint256 | CalculateTopLevelMerkleRoot (const std::vector< uint8_t > &txMerkleRoot, const uint256 &popDataMerkleRoot, const ContextInfoContainer &ctx) |
| calculates top level merkle root that cryptographically authenticates block content (transactions, PopData, context info) to a block | |
| uint256 | CalculateTopLevelMerkleRoot (const AuthenticatedContextInfoContainer &ctx) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| uint256 | CalculateTopLevelMerkleRoot (const std::vector< uint8_t > &txMerkleRoot, const PopData &popData, const BlockIndex< AltBlock > *prevBlock, const AltChainParams ¶ms) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| int | getMaxAtvsInVbkBlock (uint64_t altchainId) |
| The second to the last byte is used to determine the max number of occurrences The first 7 bits determine the base (1 is added to the first 7 bits interpreted as a number), and the last bit determines the exponent (0 = exponent of 1, 1 = exponent of 2) For example: 00000000 has a base of 1 (0+1) and an exponent of 1 for a maximum of 1 publication 00000110 has a base of 4 (3+1) and an exponent of 1 for a maximum of 4 publications 00000101 has a base of 3 (2+1) and an exponent of 2 for a maximum of 9 publications. | |
| void | PrintTo (const ArithUint256 &uint, ::std::ostream *os) |
| custom gtest printer, which prints Blob of any size as hexstring @ private More... | |
| std::string | EncodeBase58 (const unsigned char *pbegin, const unsigned char *pend) |
| Encodes input bytes to Base58. | |
| template<typename T , typename = typename std::enable_if<sizeof(typename T::value_type) == 1>::type> | |
| std::string | EncodeBase58 (const T &container) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
| bool | DecodeBase58 (const std::string &str, std::vector< unsigned char > &out, ValidationState &state) |
| Decodes base58 into bytes. | |
| std::string | EncodeBase59 (const unsigned char *pbegin, const unsigned char *pend) |
| Encode input bytes to base59. | |
| std::string | EncodeBase59 (const uint8_t *buf, size_t size) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| template<typename T , typename = typename std::enable_if<sizeof(typename T::value_type) == 1>::type> | |
| std::string | EncodeBase59 (const T &container) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
| bool | DecodeBase59 (const std::string &input, std::vector< uint8_t > &out, ValidationState &state) |
| Decode base59 string into bytes. | |
| template<typename Value , size_t N> | |
| Value | ToJSON (const Blob< N > &blob) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
| bool | DeserializeFromVbkEncoding (ReadStream &stream, AltBlockAddon &out, ValidationState &state) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| template<typename JsonValue > | |
| JsonValue | ToJSON (const PopPayoutsParams &p) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
| template<typename JsonValue > | |
| JsonValue | ToJSON (const AltChainParams &p, bool reverseAltHashes=true) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
| template<typename Block > | |
| const BlockIndex< Block > * | getForkBlock (const BlockIndex< Block > &a, const BlockIndex< Block > &b) |
| getForkBlock assumes that: the block tree is not malformed the fork block(worst case: genesis/bootstrap block) is in memory the complexity is O(n) More... | |
| template<typename Block > | |
| bool | isBlockOutdated (const BlockIndex< Block > &finalBlock, const BlockIndex< Block > &candidate) |
a candidate is considered outdated if it is behind finalBlock, or on same height and not equal to finalBlock, or its fork block is outdated More... | |
| constexpr bool | isValidInvalidationReason (const BlockValidityStatus &reason) |
Check if the reason value can be used as the reason for invalidateSubtree and revalidateSubtree. More... | |
| bool | DeserializeFromVbkEncoding (ReadStream &stream, BtcBlockAddon &out, ValidationState &state) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| template<typename C > | |
| C::index_t * | findFork (const C &chain, const typename C::index_t *pindex) |
Find fork between chain and pindex. More... | |
| std::string | popFrOutcomeToString (PopFrOutcome value, const ValidationState &state) |
| template<typename T > | |
| bool | DeserializeFromVbkEncoding (ReadStream &stream, PopState< T > &out, ValidationState &state) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
| template<typename JsonValue > | |
| JsonValue | ToJSON (const BlockIndex< VbkBlock > &i) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
| template<typename JsonValue > | |
| JsonValue | ToJSON (const BlockIndex< BtcBlock > &i) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
| template<typename Block > | |
| void | forEachNodePostorder (BlockIndex< Block > &index, const std::function< void(BlockIndex< Block > &)> &visit, const std::function< bool(BlockIndex< Block > &)> &shouldVisit) |
| Postorder tree traversal algorithm. More... | |
| template<typename Block > | |
| void | forEachNodePreorder (BlockIndex< Block > &index, const std::function< bool(BlockIndex< Block > &)> &visit) |
| iterate across all subtrees starting (and including) given 'index' More... | |
| template<typename Block > | |
| void | forEachNextNodePreorder (BlockIndex< Block > &index, const std::function< bool(BlockIndex< Block > &)> &shouldContinue) |
| iterate across all subtrees starting (and excluding) given 'index' More... | |
| template<typename Block > | |
| std::vector< BlockIndex< Block > * > | findValidTips (BlockIndex< Block > &index) |
| Find all tips after given block, including given block. More... | |
| template<typename Block > | |
| std::vector< BlockIndex< Block > * > | findValidTips (const std::unordered_set< BlockIndex< Block > * > &tips, BlockIndex< Block > &index) |
| Find all tips after given block, including given block. More... | |
| bool | DeserializeFromVbkEncoding (ReadStream &stream, VbkBlockAddon &out, ValidationState &state) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| VbkBlock | GetRegTestVbkBlock () |
Getter for regtest_progpow VBK network genesis block. | |
| BtcBlock | GetRegTestBtcBlock () |
Getter for regtest BTC network genesis block. | |
| void | setEthashCache (std::unique_ptr< EthashCacheI > cache) |
| void | setProgpowHeaderCache (std::unique_ptr< ProgpowHeaderCacheI > cache) |
| uint192 | progPowHash (Slice< const uint8_t > header) |
| Calculate vPROGPOW hash of given VbkBlock header (65 bytes) More... | |
| uint192 | progPowHash (Slice< const uint8_t > header, progpow::ethash_cache *light) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| bool | DeserializeFromVbkEncoding (ReadStream &stream, CacheEntry &out, ValidationState &state) |
| uint32_t | kiss99 (kiss99_t &st) |
| Calculate KISS99. More... | |
| void | vblake_init (vblake_ctx *ctx) |
| Initialize the hashing context. More... | |
| int | vblake_update (vblake_ctx *ctx, const void *in, size_t inlen) |
| Add "inlen" bytes from "in" into the hash. More... | |
| void | vblake_final (vblake_ctx *ctx, void *out) |
| Generate the message digest. More... | |
| int | vblake (void *out, const void *in, size_t inlen) |
| Convenience function for all-in-one computation. More... | |
| template<typename Value > | |
| Value | ToJSON (const Address &addr) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
| bool | DeserializeFromVbkEncoding (ReadStream &stream, Address &out, ValidationState &state) |
| Read data from the stream and convert it to VBK address. More... | |
| template<typename JsonValue > | |
| JsonValue | ToJSON (const AltBlock &alt, bool reverseHashes=true) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
| bool | DeserializeFromRaw (ReadStream &stream, AltBlock &out, ValidationState &state, const AltBlock::hash_t &=AltBlock::hash_t{}) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| bool | DeserializeFromVbkEncoding (ReadStream &stream, AltBlock &out, ValidationState &state, const AltBlock::hash_t &=AltBlock::hash_t{}) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| template<typename JsonValue > | |
| JsonValue | ToJSON (const ATV &atv) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
| bool | DeserializeFromVbkEncoding (ReadStream &stream, ATV &out, ValidationState &state) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| template<typename JsonValue > | |
| JsonValue | ToJSON (const BtcBlock &b) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
| bool | DeserializeFromRaw (ReadStream &stream, BtcBlock &out, ValidationState &state, const BtcBlock::hash_t &precalculatedHash=BtcBlock::hash_t{}) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| bool | DeserializeFromVbkEncoding (ReadStream &stream, BtcBlock &out, ValidationState &state, const BtcBlock::hash_t &precalculatedHash=BtcBlock::hash_t{}) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| bool | DeserializeFromVbkEncoding (ReadStream &stream, BtcTx &out, ValidationState &state) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| bool | DeserializeFromVbkEncoding (ReadStream &stream, Coin &out, ValidationState &state) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| bool | DeserializeFromVbkEncoding (ReadStream &stream, ContextInfoContainer &ctx, ValidationState &state) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| bool | DeserializeFromVbkEncoding (ReadStream &stream, AuthenticatedContextInfoContainer &ctx, ValidationState &state) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| template<typename JsonValue > | |
| JsonValue | ToJSON (const ContextInfoContainer &a) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
| template<typename JsonValue > | |
| JsonValue | ToJSON (const AuthenticatedContextInfoContainer &a) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
| template<typename Value , class A , class B , class C > | |
| Value | ToJSON (const Endorsement< A, B, C > &e) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
| bool | DeserializeFromVbkEncoding (ReadStream &stream, KeystoneContainer &container, ValidationState &state) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| template<typename JsonValue > | |
| JsonValue | ToJSON (const KeystoneContainer &c) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
| template<typename JsonValue > | |
| JsonValue | ToJSON (const MerklePath &m) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
| bool | DeserializeFromRaw (ReadStream &stream, const uint256 &subject, MerklePath &out, ValidationState &state) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| bool | DeserializeFromVbkEncoding (ReadStream &stream, const uint256 &subject, MerklePath &out, ValidationState &state) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| uint32_t | estimateNumberOfPopTxs (const std::vector< VbkMerklePath > &paths) |
| bool | isPopSubTreeFull (const std::vector< VbkMerklePath > &paths) |
| template<typename JsonValue > | |
| JsonValue | ToJSON (const Output &o) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
| bool | DeserializeFromVbkEncoding (ReadStream &stream, Output &out, ValidationState &state) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| template<typename JsonValue > | |
| JsonValue | ToJSON (const PopData &p, bool verbose=false) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
| bool | DeserializeFromVbkEncoding (ReadStream &stream, PopData &out, ValidationState &state) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| template<typename JsonValue > | |
| JsonValue | ToJSON (const PublicationData &p) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
| bool | DeserializeFromVbkEncoding (ReadStream &stream, PublicationData &out, ValidationState &state) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| template<typename JsonValue > | |
| JsonValue | ToJSON (const VbkMerklePath &mp) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
| bool | DeserializeFromVbkEncoding (ReadStream &stream, VbkMerklePath &out, ValidationState &state) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| template<typename JsonValue > | |
| JsonValue | ToJSON (const VbkBlock &b) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
| bool | DeserializeFromRaw (ReadStream &stream, VbkBlock &out, ValidationState &state, const VbkBlock::hash_t &hash=VbkBlock::hash_t{}) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| bool | DeserializeFromVbkEncoding (ReadStream &stream, VbkBlock &out, ValidationState &state, const VbkBlock::hash_t &hash=VbkBlock::hash_t{}) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| template<typename JsonValue > | |
| JsonValue | ToJSON (const VbkPopTx &tx) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
| bool | DeserializeFromRaw (ReadStream &stream, Slice< const uint8_t > signature, Slice< const uint8_t > publicKey, VbkPopTx &out, ValidationState &state) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| bool | DeserializeFromVbkEncoding (ReadStream &stream, VbkPopTx &out, ValidationState &state) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| template<typename JsonValue > | |
| JsonValue | ToJSON (const VbkTx &tx) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
| bool | DeserializeFromRaw (ReadStream &stream, Slice< const uint8_t > signature, Slice< const uint8_t > publicKey, VbkTx &out, ValidationState &state) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| bool | DeserializeFromVbkEncoding (ReadStream &stream, VbkTx &out, ValidationState &state) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| template<typename JsonValue > | |
| JsonValue | ToJSON (const VTB &v) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
| bool | DeserializeFromVbkEncoding (ReadStream &stream, VTB &out, ValidationState &state) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| uint256 | sha256 (Slice< const uint8_t > data) |
| Calculates SHA256 of the input data. More... | |
| uint256 | sha256 (Slice< const uint8_t > a, Slice< const uint8_t > b) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| uint256 | sha256twice (Slice< const uint8_t > data) |
| Calculates SHA256 of the input data twice. More... | |
| uint256 | sha256twice (Slice< const uint8_t > a, Slice< const uint8_t > b) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| uint192 | vblake (Slice< const uint8_t > data) |
| Calculates VBlake of the input data. More... | |
| template<typename Value , typename T > | |
| Value | ToJSON (const T &) |
| Encode given entity into JSON. More... | |
| bool | isKeystone (int32_t blockNumber, uint32_t keystoneInterval) |
Calculates if block with height = blockNumber is keystone. More... | |
| Logger & | GetLogger () |
| getter for global logger instance More... | |
| void | SetLogger (std::unique_ptr< Logger > lgr, LogLevel log_lvl=LogLevel::info) |
| setter for global logger instance | |
| template<typename L > | |
| void | SetLogger (LogLevel log_lvl=LogLevel::info) |
| setter for global logger instance More... | |
| std::string | LevelToString (LogLevel l) |
| convert loglevel to string | |
| LogLevel | StringToLevel (const std::string &) |
| convert string to loglevel More... | |
| template<typename S , typename... Args> | |
| std::string | format (const S &format_str, Args &&... args) |
| template<typename JsonValue > | |
| JsonValue | ToJSON (const MempoolResult &r) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
| template<typename T > | |
| reverse_range< T > | reverse_iterate (T &x) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
| bool | checkRange (uint64_t num, uint64_t min, uint64_t max, ValidationState &state) |
| Checks if expression 'min' <= 'num' <= 'max' is true. More... | |
| std::vector< uint8_t > | trimmedArray (int64_t input) |
| Converts the input to the byte array and trims it's size to the lowest possible value. More... | |
| template<typename T , typename = typename std::enable_if<std::is_integral<T>::value>::type> | |
| std::vector< uint8_t > | fixedArray (T input) |
| Converts the input to the byte array. More... | |
| bool | readVarLenValue (ReadStream &stream, Slice< const uint8_t > &out, ValidationState &state, uint64_t minLen, uint64_t maxLen) |
Read variable length value, which consists of [N=(4 bytes = size of slice) | N bytes slice] Size of slice should be within range [minLen; maxLen]. More... | |
| bool | readSingleByteLenValue (ReadStream &stream, Slice< const uint8_t > &out, ValidationState &state, uint64_t minLen, uint64_t maxLen) |
Read variable length value, which consists of [N=(1 byte = size of slice) | N bytes slice] Size of slice should be within range [minLen; maxLen]. More... | |
| template<typename Container , typename = typename std::enable_if< sizeof(typename Container::value_type) == 1>::type> | |
| bool | readSingleByteLenValue (ReadStream &stream, Container &out, ValidationState &state, uint64_t minLen, uint64_t maxLen) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
| template<typename T , typename = typename std::enable_if<std::is_integral<T>::value>::type> | |
| bool | readSingleBEValue (ReadStream &stream, T &out, ValidationState &state) |
| Read single Big-Endian value from a stream. More... | |
| void | writeSingleByteLenValue (WriteStream &stream, Slice< const uint8_t > value) |
Write single byte length value, which consists of N bytes vector Appends 1 byte data length to the stream. More... | |
| void | writeSingleBEValue (WriteStream &stream, int64_t value) |
| Write single Big-Endian value to the stream. More... | |
| template<typename T , typename = typename std::enable_if<std::is_integral<T>::value>::type> | |
| void | writeSingleFixedBEValue (WriteStream &stream, T value) |
| Write single Big-Endian value to the stream. More... | |
| void | writeVarLenValue (WriteStream &stream, Slice< const uint8_t > value) |
Write variable length value, which consists of N bytes vector Appends up to 8 bytes data length to the stream and 1 byte data length size. More... | |
| NetworkBytePair | readNetworkByte (ReadStream &stream, TxType type) |
| Read optional network byte from the stream. More... | |
| bool | readNetworkByte (ReadStream &stream, TxType type, NetworkBytePair &out, ValidationState &state) |
| Read optional network byte from the stream. More... | |
| void | writeNetworkByte (WriteStream &stream, NetworkBytePair networkOrType) |
| Write optional network byte to the stream. More... | |
| template<typename Container > | |
| bool | readSetOf (ReadStream &stream, Container &out, ValidationState &state, size_t min, size_t max, std::function< bool(ReadStream &, typename Container::value_type &, ValidationState &)> readFunc) |
| Reads set of entities of. More... | |
| template<typename Container > | |
| bool | readSetOf (ReadStream &stream, Container &out, ValidationState &state, std::function< bool(Container &, ReadStream &, typename Container::value_type &, ValidationState &)> readFunc) |
| Reads container of entities. More... | |
| template<typename T > | |
| bool | readArrayOf (ReadStream &stream, std::vector< T > &out, ValidationState &state, size_t min, size_t max, std::function< bool(ReadStream &, T &, ValidationState &)> readFunc) |
| Reads array of entities of type T. More... | |
| template<typename T > | |
| bool | readArrayOf (ReadStream &stream, std::vector< T > &out, ValidationState &state, std::function< bool(ReadStream &, T &, ValidationState &)> readFunc) |
| Reads array of entities of type T. More... | |
| template<typename T > | |
| size_t | estimateArraySizeOf (const std::vector< T > &t, std::function< size_t(const T &t)> f) |
| Estimate size of array in bytes. More... | |
| template<typename T > | |
| bool | DeserializeFromVbkEncoding (Slice< const uint8_t > data, T &out, ValidationState &state) |
| Deserialize from VBK encoding. More... | |
| template<typename T > | |
| bool | DeserializeFromRaw (Slice< const uint8_t > data, T &out, ValidationState &state) |
| Deserialize from RAW encoding. More... | |
| template<typename T > | |
| bool | DeserializeFromHex (const std::string &hex, T &out, ValidationState &state) |
| Deserialize from HEX VBK encoding. More... | |
| template<typename T > | |
| bool | DeserializeFromRawHex (const std::string &hex, T &out, ValidationState &state) |
| Deserialize from HEX RAW encoding. More... | |
| template<typename T > | |
| std::vector< uint8_t > | SerializeToVbkEncoding (const T &obj) |
| Serialize to VBK encoding. More... | |
| template<typename T > | |
| std::vector< uint8_t > | SerializeToRaw (const T &obj) |
| Serialize to RAW encoding. More... | |
| template<typename T > | |
| std::string | SerializeToHex (const T &obj) |
| Serialize to HEX VBK encoding. More... | |
| template<typename T > | |
| std::string | SerializeToRawHex (const T &obj) |
| Serialize to HEX RAW encoding. More... | |
| template<typename T > | |
| T | AssertDeserializeFromRaw (std::vector< uint8_t > raw) |
| Deserialize from RAW encoding. More... | |
| template<typename T > | |
| T | AssertDeserializeFromVbkEncoding (Slice< const uint8_t > raw) |
| Deserialize from VBK encoding. More... | |
| template<typename T > | |
| T | AssertDeserializeFromHex (std::string hex) |
| Deserialize from HEX VBK encoding. More... | |
| template<typename T > | |
| T | AssertDeserializeFromRawHex (std::string hex) |
| Deserialize from HEX RAW encoding. More... | |
| template<typename MerklePathType , typename HashType1 , typename HashType2 > | |
| bool | checkMerklePath (const MerklePathType &merklePath, const HashType1 &transactionHash, const HashType2 &merkleRoot, ValidationState &state) |
| Verify merkle path. More... | |
| bool | checkSignature (const VbkTx &tx, ValidationState &state) |
| Verify signature of a transaction. | |
| bool | checkSignature (const VbkPopTx &tx, ValidationState &state) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| bool | checkBtcBlocks (const std::vector< BtcBlock > &btcBlocks, ValidationState &state, const BtcChainParams ¶m) |
| Stateless validation for a chain of Blocks. | |
| bool | checkVbkBlocks (const std::vector< VbkBlock > &vbkBlocks, ValidationState &state, const VbkChainParams ¶m) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| bool | checkBitcoinTransactionForPoPData (const VbkPopTx &tx, ValidationState &state) |
| Search BtcTx for POP data. | |
| bool | checkProofOfWork (const BtcBlock &block, const BtcChainParams ¶m) |
| Stateless validation for a Block. | |
| bool | checkProofOfWork (const VbkBlock &block, const VbkChainParams ¶m) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| bool | checkVbkPopTx (const VbkPopTx &tx, ValidationState &state, const BtcChainParams ¶m, const VbkChainParams &vbk) |
| Stateless validation for VbkPopTx. | |
| bool | checkVbkTx (const VbkTx &tx, const AltChainParams ¶ms, const VbkChainParams &vbkparams, ValidationState &state) |
| Stateless validation for VbkTx. | |
| bool | checkPublicationData (const PublicationData &pub, const AltChainParams ¶ms, ValidationState &state) |
| Stateless validation for PublicationData. | |
| bool | checkBlock (const BtcBlock &block, ValidationState &state, const BtcChainParams ¶ms) |
| Stateless validation for a single block. | |
| bool | checkVbkBlockPlausibility (const VbkBlock &block, ValidationState &state, const VbkChainParams ¶ms) |
| Optimization: VBK block is not plausible if its combination of height+time do not correspond to potential VBK network. | |
| bool | checkBlock (const VbkBlock &block, ValidationState &state, const VbkChainParams ¶ms) |
| Stateless validation for VbkBlock. | |
| bool | checkATV (const ATV &atv, ValidationState &state, const AltChainParams &alt, const VbkChainParams &vbkp) |
| Stateless validation for ATV. | |
| bool | checkVTB (const VTB &vtb, ValidationState &state, const BtcChainParams &btc, const VbkChainParams &vbk) |
| Stateless validation for VTB. | |
| bool | checkPopData (PopValidator &validator, const PopData &popData, ValidationState &state) |
| Stateless validation for PopData and all internal PoP payloads. | |
| bool | DeserializeFromVbkEncoding (ReadStream &stream, StoredAltBlockAddon &out, ValidationState &state) |
| template<typename Block > | |
| bool | DeserializeFromVbkEncoding (ReadStream &stream, StoredBlockIndex< Block > &out, ValidationState &state, typename Block::hash_t precalculatedHash=typename Block::hash_t()) |
| bool | DeserializeFromVbkEncoding (ReadStream &stream, StoredBtcBlockAddon &out, ValidationState &state) |
| bool | DeserializeFromVbkEncoding (ReadStream &stream, StoredVbkBlockAddon &out, ValidationState &state) |
| template<typename BlockTreeT > | |
| bool | loadTree (BlockTreeT &tree, const typename BlockTreeT::hash_t &tiphash, std::vector< typename BlockTreeT::stored_index_t > &blocks, bool fast_load, ValidationState &state) |
efficiently loads blocks into tree (they must be sorted by height) and does validation of these blocks. More... | |
| void | saveTrees (const AltBlockTree &tree, BlockBatch &batch) |
| Save all (BTC/VBK/ALT) trees on disk in a single Batch. | |
| bool | loadTrees (AltBlockTree &tree, bool fast_load, ValidationState &state) |
| Load all (ALT/VBK/BTC) trees from disk into memory. | |
| std::vector< uint8_t > | ParseHex (const char *psz) |
| Parse bytes from hex. | |
| std::vector< uint8_t > | ParseHex (const std::string &hex) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| constexpr bool | IsSpace (char c) noexcept |
| Tests if the given character is a whitespace character. More... | |
| template<typename T > | |
| std::string | HexStr (const T itbegin, const T itend) |
| Convert bytes to hex. More... | |
| template<typename T > | |
| std::string | HexStr (const T &vch, bool reverseHex=false) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
| void | setMockTime (uint32_t mocktime) |
| Set mock time for usage in unit tests. More... | |
| uint32_t | getMockTime () |
| Get current mock time. | |
| uint32_t | currentTimestamp4 () |
| Get current time as 4 bytes. If mock time is set, returns mock time. | |
| template<typename JsonValue > | |
| JsonValue | ToJSON (const ValidationState &s, bool *acceptedToMempool=nullptr) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
Variables | |
| constexpr const auto | ADDRESS_POP_DATA_SIZE_PROGPOW = 15 |
| VTB contains BtcTx, which contains POP-miner's address and endorsed VBK header. More... | |
| constexpr const auto | SHA256_HASH_SIZE = 32 |
| sha256 hash size More... | |
| constexpr const auto | BTC_TX_MAX_RAW_SIZE = 4 * 1000 * 1000 |
| maximum possible BTC TX serialized size. More... | |
| constexpr const uint32_t | BTC_HEADER_SIZE = 80 |
| Bitcoin header size. More... | |
| constexpr const auto | MAX_BTC_BLOCKS_IN_VBKPOPTX = 65535 |
| maximum total BTC blocks in VTB blockOfProofContext More... | |
| constexpr const auto | BTC_BLOCK_HASH_SIZE = 32 |
| size of BTC block hash More... | |
| constexpr const auto | VBK_BLOCK_HASH_SIZE = 24 |
| size of VBK block hash More... | |
| constexpr const auto | VBK_MERKLE_ROOT_HASH_SIZE = 16 |
| size of VBK merkle root More... | |
| constexpr const auto | VBK_PREVIOUS_BLOCK_HASH_SIZE = 12 |
| size of VBK previous block hash size More... | |
| constexpr const auto | VBK_PREVIOUS_KEYSTONE_HASH_SIZE = 9 |
| size of VBK previous keystone hash size More... | |
| constexpr const auto | MAX_PAYOUT_INFO_SIZE = 10000 |
| max payout info size. More... | |
| constexpr const auto | MAX_HEADER_SIZE_PUBLICATION_DATA = 1024 |
| maximum header size in PublicationData More... | |
| constexpr const auto | MAX_CONTEXT_SIZE_PUBLICATION_DATA = 10000 |
| maximum context size in PublicationData More... | |
| constexpr const auto | MAX_PUBLICATIONDATA_SIZE |
| absolute maximum size for PublicationData More... | |
| constexpr const auto | MAX_POPDATA_SIZE = 5500000 |
| maximum size of single PopData in a single ALT block, in bytes. More... | |
| constexpr const auto | MAX_POPDATA_VBK = 50000 |
| absolute maximum number of VBK blocks per ALT block More... | |
| constexpr const auto | MAX_POPDATA_VTB = 50000 |
| absolute maximum number of VTB blocks per ALT block More... | |
| constexpr const auto | MAX_POPDATA_ATV = 50000 |
| absolute maximum number of ATV blocks per ALT block More... | |
| constexpr const auto | MAX_PAYOUT = 50000 |
| absolute maximum number of pauouts per ALT block More... | |
| constexpr const auto | MIN_ALT_HASH_SIZE = 0 |
| minimum allowed size of altchain hash More... | |
| constexpr const auto | MAX_ALT_HASH_SIZE = 1024 |
| absolute maximum allowed size for altchain hash More... | |
| constexpr const auto | MAX_BTCADDON_REFS = 65536 |
| absolute maximum of 'refs' for BTC addon More... | |
| constexpr const auto | MAX_VBKPOPTX_PER_VBK_BLOCK = 1024 |
| absolute maximum number of PopTxes (VTBs) per VBK block More... | |
| constexpr const auto | VTB_ID_SIZE = 32 |
| size of VTB id More... | |
| constexpr const auto | ATV_ID_SIZE = 32 |
| size of ATV id More... | |
| constexpr const auto | VBK_ID_SIZE = 12 |
| size of VbkBlock id More... | |
| constexpr const auto | VBK_PUBLICATIONDATA_SIZE = 80 |
| 65 VBK header + 15 POP bytes of Address More... | |
| constexpr const uint32_t | VBK_HEADER_SIZE_VBLAKE = 64 |
| pre-progpow VBK header size More... | |
| constexpr const uint32_t | VBK_HEADER_SIZE_PROGPOW = 65 |
| post-progpow VBK header size More... | |
| constexpr const auto | MAX_LAYER_COUNT_MERKLE = 40 |
| max total layers in merkle paths More... | |
| constexpr const auto | MAX_OUTPUTS_COUNT = 255 |
| NodeCore is using byte value when serializing outputs so we limit to 255. More... | |
| constexpr const auto | MAX_SIGNATURE_SIZE = 72 |
| ASN.1/DER ECDSA encoding max value. More... | |
| constexpr const auto | MAX_PUBLIC_KEY_SIZE = 88 |
| X509 encoding. Max value is based on experimental data. More... | |
| constexpr const auto | VBK_ADDRESS_SIZE = 30 |
| VBK address size in bytes. More... | |
| constexpr const auto | VBK_MAX_CALCULATED_EPOCHS_SIZE = 4096U |
| maximum number of Ethash cache sizes stored in this library. More... | |
| constexpr const auto | VBK_ETHASH_EPOCH_LENGTH = 8000U |
| size of 1 ethash epoch in progpow More... | |
| constexpr const auto | VBK_ETHASH_EPOCH_OFFSET = 323U |
| we start at this epoch More... | |
| static const int32_t | ALT_MAX_REORG_BLOCKS_MIN_VALUE = 10000 |
| minimum number of blocks in ALT tree More... | |
| static const int32_t | VBK_MAX_REORG_BLOCKS_MIN_VALUE = 20000 |
| minimum number of blocks in VBK tree More... | |
| static const int32_t | BTC_MAX_REORG_BLOCKS_MIN_VALUE = 10000 |
| minimum number of blocks in BTC tree More... | |
| template<> | |
| __pad0__ | |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
| template<> | |
| __pad1__ | |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
| template<> | |
| __pad2__ | |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
a facade for Signals
Contains veriblock-specific serialization and deserialziation primitives.
By default, logger is disabled (no-op logger is used). Users can derive from Logger class, and specify their logger instance.
Used log levels:
| struct altintegration::MempoolResult |
Definition at line 19 of file mempool_result.hpp.
Collaboration diagram for altintegration::MempoolResult:| Class Members | ||
|---|---|---|
| vector< pair< id_t, ValidationState > > | atvs | |
| vector< pair< id_t, ValidationState > > | context | |
| vector< pair< id_t, ValidationState > > | vtbs | |
| struct altintegration::NetworkBytePair |
Definition at line 53 of file network_byte_pair.hpp.
Collaboration diagram for altintegration::NetworkBytePair:| Class Members | ||
|---|---|---|
| VbkNetworkType | networkType | < works as std::optional. if hasNetworkByte is true, networkByte is set |
| uint8_t | typeId | |
| struct altintegration::vblake_ctx |
Definition at line 18 of file vblake.hpp.
Collaboration diagram for altintegration::vblake_ctx:| Class Members | ||
|---|---|---|
| uint8_t | b[64] | input buffer |
| uint64_t | h[8] | chained state |
| using altintegration::BtcBlockTree = typedef BlockTree<BtcBlock, BtcChainParams> |
Definition at line 39 of file vbk_block_tree.hpp.
| using altintegration::uint128 = typedef Blob<VBK_MERKLE_ROOT_HASH_SIZE> |
| using altintegration::uint192 = typedef Blob<VBK_BLOCK_HASH_SIZE> |
| using altintegration::uint256 = typedef Blob<SHA256_HASH_SIZE> |
| using altintegration::uint72 = typedef Blob<VBK_PREVIOUS_KEYSTONE_HASH_SIZE> |
| using altintegration::uint96 = typedef Blob<VBK_PREVIOUS_BLOCK_HASH_SIZE> |
|
strong |
Definition at line 18 of file address.hpp.
| enum altintegration::BlockStateStatus : uint32_t |
Definition at line 14 of file block_status.hpp.
| enum altintegration::BlockValidityStatus : uint32_t |
Definition at line 40 of file block_status.hpp.
|
strong |
Definition at line 31 of file logger.hpp.
|
strong |
Definition at line 457 of file fork_resolution.hpp.
|
strong |
| Enumerator | |
|---|---|
| VBK_TX | regular transaction |
| VBK_POP_TX | pop transaction |
Definition at line 26 of file consts.hpp.
| bool altintegration::addBlocks | ( | BlockTree< Block, ChainParams > & | tree, |
| const std::vector< std::vector< uint8_t > > & | blocks, | ||
| ValidationState & | state | ||
| ) |
Definition at line 77 of file alt-util.hpp.
| T altintegration::AssertDeserializeFromHex | ( | std::string | hex | ) |
Definition at line 491 of file serde.hpp.
| T altintegration::AssertDeserializeFromRaw | ( | std::vector< uint8_t > | raw | ) |
Definition at line 469 of file serde.hpp.
| T altintegration::AssertDeserializeFromRawHex | ( | std::string | hex | ) |
Definition at line 502 of file serde.hpp.
| T altintegration::AssertDeserializeFromVbkEncoding | ( | Slice< const uint8_t > | raw | ) |
Definition at line 480 of file serde.hpp.
| bool altintegration::checkMerklePath | ( | const MerklePathType & | merklePath, |
| const HashType1 & | transactionHash, | ||
| const HashType2 & | merkleRoot, | ||
| ValidationState & | state | ||
| ) |
Definition at line 31 of file stateless_validation.hpp.
| bool altintegration::checkRange | ( | uint64_t | num, |
| uint64_t | min, | ||
| uint64_t | max, | ||
| ValidationState & | state | ||
| ) |
If false, returns invalid state with error description.
| num | number to check |
| min | min value |
| max | max value |
| state | will return error description here |
| bool altintegration::DeserializeFromHex | ( | const std::string & | hex, |
| T & | out, | ||
| ValidationState & | state | ||
| ) |
Definition at line 420 of file serde.hpp.
| bool altintegration::DeserializeFromRaw | ( | Slice< const uint8_t > | data, |
| T & | out, | ||
| ValidationState & | state | ||
| ) |
| bool altintegration::DeserializeFromRawHex | ( | const std::string & | hex, |
| T & | out, | ||
| ValidationState & | state | ||
| ) |
| bool altintegration::DeserializeFromVbkEncoding | ( | ReadStream & | stream, |
| Address & | out, | ||
| ValidationState & | state | ||
| ) |
| stream | data stream to read from | |
| [out] | out | output address |
| [out] | state |
| bool altintegration::DeserializeFromVbkEncoding | ( | ReadStream & | stream, |
| PopState< T > & | out, | ||
| ValidationState & | state | ||
| ) |
Definition at line 104 of file pop_state.hpp.
| bool altintegration::DeserializeFromVbkEncoding | ( | ReadStream & | stream, |
| StoredBlockIndex< Block > & | out, | ||
| ValidationState & | state, | ||
| typename Block::hash_t | precalculatedHash = typename Block::hash_t() |
||
| ) |
Definition at line 66 of file stored_block_index.hpp.
| bool altintegration::DeserializeFromVbkEncoding | ( | Slice< const uint8_t > | data, |
| T & | out, | ||
| ValidationState & | state | ||
| ) |
| std::string altintegration::EncodeBase58 | ( | const T & | container | ) |
Definition at line 23 of file base58.hpp.
| std::string altintegration::EncodeBase59 | ( | const T & | container | ) |
Definition at line 26 of file base59.hpp.
| size_t altintegration::estimateArraySizeOf | ( | const std::vector< T > & | t, |
| std::function< size_t(const T &t)> | f | ||
| ) |
|
inline |
Definition at line 237 of file merkle_tree.hpp.
| C::index_t * altintegration::findFork | ( | const C & | chain, |
| const typename C::index_t * | pindex | ||
| ) |
Definition at line 144 of file chain.hpp.
| std::vector< BlockIndex< Block > * > altintegration::findValidTips | ( | BlockIndex< Block > & | index | ) |
| Block |
Definition at line 79 of file tree_algo.hpp.
| std::vector< BlockIndex< Block > * > altintegration::findValidTips | ( | const std::unordered_set< BlockIndex< Block > * > & | tips, |
| BlockIndex< Block > & | index | ||
| ) |
| Block |
Definition at line 106 of file tree_algo.hpp.
| std::vector< uint8_t > altintegration::fixedArray | ( | T | input | ) |
| input | value to convert |
Definition at line 58 of file serde.hpp.
| void altintegration::forEachNextNodePreorder | ( | BlockIndex< Block > & | index, |
| const std::function< bool(BlockIndex< Block > &)> & | shouldContinue | ||
| ) |
Definition at line 63 of file tree_algo.hpp.
| void altintegration::forEachNodePostorder | ( | BlockIndex< Block > & | index, |
| const std::function< void(BlockIndex< Block > &)> & | visit, | ||
| const std::function< bool(BlockIndex< Block > &)> & | shouldVisit | ||
| ) |
Definition at line 19 of file tree_algo.hpp.
| void altintegration::forEachNodePreorder | ( | BlockIndex< Block > & | index, |
| const std::function< bool(BlockIndex< Block > &)> & | visit | ||
| ) |
Definition at line 45 of file tree_algo.hpp.
|
inline |
Definition at line 128 of file logger.hpp.
| bool altintegration::GeneratePublicationData | ( | const std::vector< uint8_t > & | endorsedBlockHeader, |
| const std::vector< uint8_t > & | txMerkleRoot, | ||
| const PopData & | popData, | ||
| const std::vector< uint8_t > & | payoutInfo, | ||
| const AltBlockTree & | tree, | ||
| PublicationData & | out | ||
| ) |
| [in] | endorsedBlockHeader | endorsed block header |
| [in] | txMerkleRoot | original merkle root from altchain |
| [in] | popData | PopData from endorsed block |
| [in] | payoutInfo | payout info bytes. |
| [in] | tree | AltBlockTree instance |
| [out] | out | output instance |
| std::vector< typename BlockTreeT::block_t > altintegration::getContext | ( | const BlockTreeT & | tree, |
| typename BlockTreeT::hash_t | tip, | ||
| size_t | size = std::numeric_limits<size_t>::max() |
||
| ) |
Definition at line 43 of file alt-util.hpp.
| const BlockIndex< Block > * altintegration::getForkBlock | ( | const BlockIndex< Block > & | a, |
| const BlockIndex< Block > & | b | ||
| ) |
Definition at line 428 of file block_index.hpp.
| std::vector< std::vector< uint8_t > > altintegration::getLastKnownBlocks | ( | const BlockTree & | tree, |
| size_t | size | ||
| ) |
Definition at line 59 of file alt-util.hpp.
| Logger & altintegration::GetLogger | ( | ) |
|
inline |
Definition at line 60 of file strutil.hpp.
| std::string altintegration::HexStr | ( | const T | itbegin, |
| const T | itend | ||
| ) |
Definition at line 44 of file strutil.hpp.
| bool altintegration::isBlockOutdated | ( | const BlockIndex< Block > & | finalBlock, |
| const BlockIndex< Block > & | candidate | ||
| ) |
Definition at line 448 of file block_index.hpp.
| bool altintegration::isKeystone | ( | int32_t | blockNumber, |
| uint32_t | keystoneInterval | ||
| ) |
| blockNumber | blopck height |
| keystoneInterval | keystone interval |
|
inline |
Definition at line 278 of file merkle_tree.hpp.
|
inlineconstexprnoexcept |
The whitespace characters are: space, form-feed ('\f'), newline ('\n'), carriage return ('\r'), horizontal tab ('\t'), and vertical tab ('\v').
This function is locale independent. Under the C locale this function gives the same result as std::isspace.
| [in] | c | character to test |
Definition at line 37 of file strutil.hpp.
|
constexpr |
Definition at line 71 of file block_status.hpp.
| uint32_t altintegration::kiss99 | ( | kiss99_t & | st | ) |
https://en.wikipedia.org/wiki/KISS_(algorithm) http://www.cse.yorku.ca/~oz/marsaglia-rng.html
| st |
| bool altintegration::loadTree | ( | BlockTreeT & | tree, |
| const typename BlockTreeT::hash_t & | tiphash, | ||
| std::vector< typename BlockTreeT::stored_index_t > & | blocks, | ||
| bool | fast_load, | ||
| ValidationState & | state | ||
| ) |
Sets tip after loading.
Definition at line 23 of file util.hpp.
| const T altintegration::min_or_default | ( | Container & | c, |
| const T | default_ | ||
| ) |
Definition at line 152 of file algorithm.hpp.
|
inline |
Definition at line 297 of file arith_uint256.hpp.
| header | 65-bytes header |
| bool altintegration::readArrayOf | ( | ReadStream & | stream, |
| std::vector< T > & | out, | ||
| ValidationState & | state, | ||
| size_t | min, | ||
| size_t | max, | ||
| std::function< bool(ReadStream &, T &, ValidationState &)> | readFunc | ||
| ) |
| T | type of entity to read |
| stream | read data from this stream |
| out | out output array of T |
| state | will return error description here |
| min | min size of array |
| max | max size of array |
| readFunc | function that is called to read single value of type T |
Definition at line 319 of file serde.hpp.
| bool altintegration::readArrayOf | ( | ReadStream & | stream, |
| std::vector< T > & | out, | ||
| ValidationState & | state, | ||
| std::function< bool(ReadStream &, T &, ValidationState &)> | readFunc | ||
| ) |
| T | type of entity to read |
| [in] | stream | read data from this stream |
| [out] | out | output array of T |
| [in] | readFunc | function that is called to read single value of type T |
| [out] | state | validation state. |
| std::out_of_range | if stream is out of data |
Definition at line 358 of file serde.hpp.
| NetworkBytePair altintegration::readNetworkByte | ( | ReadStream & | stream, |
| TxType | type | ||
| ) |
| stream | read data from this stream |
| type | use this value to detect if we are reading network byte or type byte |
| std::out_of_range | if stream is out of data |
| bool altintegration::readNetworkByte | ( | ReadStream & | stream, |
| TxType | type, | ||
| NetworkBytePair & | out, | ||
| ValidationState & | state | ||
| ) |
| stream | read data from this stream |
| type | use this value to detect if we are reading network byte or type byte |
| out | NetworkBytePair structure |
| state | will return error description here |
| bool altintegration::readSetOf | ( | ReadStream & | stream, |
| Container & | out, | ||
| ValidationState & | state, | ||
| size_t | min, | ||
| size_t | max, | ||
| std::function< bool(ReadStream &, typename Container::value_type &, ValidationState &)> | readFunc | ||
| ) |
| T | type of entity to read |
| stream | read data from this stream |
| out | output set |
| state | will return error description here |
| min | min size of array |
| max | max size of array |
| readFunc | function that is called to read single value |
Definition at line 256 of file serde.hpp.
| bool altintegration::readSetOf | ( | ReadStream & | stream, |
| Container & | out, | ||
| ValidationState & | state, | ||
| std::function< bool(Container &, ReadStream &, typename Container::value_type &, ValidationState &)> | readFunc | ||
| ) |
| T | type of entity to read |
| [in] | stream | read data from this stream |
| [out] | out | output container |
| [in] | readFunc | function that is called to read single value |
| [out] | state | validation state |
| std::out_of_range | if stream is out of data |
Definition at line 296 of file serde.hpp.
| bool altintegration::readSingleBEValue | ( | ReadStream & | stream, |
| T & | out, | ||
| ValidationState & | state | ||
| ) |
This function interprets sizeof(T) bytes as Big-Endian number and returns it.
| T | number type - uint64_t, etc. |
| stream | read data from this stream |
| out | read number |
| state | will return error description here |
Definition at line 130 of file serde.hpp.
| bool altintegration::readSingleByteLenValue | ( | ReadStream & | stream, |
| Container & | out, | ||
| ValidationState & | state, | ||
| uint64_t | minLen, | ||
| uint64_t | maxLen | ||
| ) |
Definition at line 102 of file serde.hpp.
| bool altintegration::readSingleByteLenValue | ( | ReadStream & | stream, |
| Slice< const uint8_t > & | out, | ||
| ValidationState & | state, | ||
| uint64_t | minLen, | ||
| uint64_t | maxLen | ||
| ) |
| stream | read data from this stream |
| out | slice with data |
| state | will return error description here |
| minLen | minimum possible value of slice size |
| maxLen | maximum possible value of slice size |
| bool altintegration::readVarLenValue | ( | ReadStream & | stream, |
| Slice< const uint8_t > & | out, | ||
| ValidationState & | state, | ||
| uint64_t | minLen, | ||
| uint64_t | maxLen | ||
| ) |
| stream | read data from this stream |
| out | slice with data |
| state | will return error description here |
| minLen | minimum possible value of slice size |
| maxLen | maximum possible value of slice size |
| reverse_range< T > altintegration::reverse_iterate | ( | T & | x | ) |
Definition at line 29 of file reversed_range.hpp.
| std::string altintegration::SerializeToHex | ( | const T & | obj | ) |
| std::vector< uint8_t > altintegration::SerializeToRaw | ( | const T & | obj | ) |
| std::string altintegration::SerializeToRawHex | ( | const T & | obj | ) |
| std::vector< uint8_t > altintegration::SerializeToVbkEncoding | ( | const T & | obj | ) |
| void altintegration::SetLogger | ( | LogLevel | log_lvl = LogLevel::info | ) |
Definition at line 64 of file logger.hpp.
| void altintegration::setMockTime | ( | uint32_t | mocktime | ) |
0 disables mock time.
| mocktime |
| data | read data from this array |
| data | read data from this array |
| LogLevel altintegration::StringToLevel | ( | const std::string & | ) |
| std::invalid_argument |
|
inline |
Definition at line 100 of file address.hpp.
| JsonValue altintegration::ToJSON | ( | const AltBlock & | alt, |
| bool | reverseHashes = true |
||
| ) |
Definition at line 90 of file altblock.hpp.
| JsonValue altintegration::ToJSON | ( | const AltChainParams & | p, |
| bool | reverseAltHashes = true |
||
| ) |
Definition at line 312 of file alt_chain_params.hpp.
| JsonValue altintegration::ToJSON | ( | const ATV & | atv | ) |
Definition at line 103 of file atv.hpp.
| JsonValue altintegration::ToJSON | ( | const AuthenticatedContextInfoContainer & | a | ) |
Definition at line 117 of file context_info_container.hpp.
|
inline |
| JsonValue altintegration::ToJSON | ( | const BlockIndex< BtcBlock > & | i | ) |
Definition at line 272 of file vbk_block_tree.hpp.
| JsonValue altintegration::ToJSON | ( | const BlockIndex< VbkBlock > & | i | ) |
Definition at line 234 of file vbk_block_tree.hpp.
| JsonValue altintegration::ToJSON | ( | const BtcBlock & | b | ) |
Definition at line 141 of file btcblock.hpp.
| JsonValue altintegration::ToJSON | ( | const ContextInfoContainer & | a | ) |
Definition at line 105 of file context_info_container.hpp.
| Value altintegration::ToJSON | ( | const Endorsement< A, B, C > & | e | ) |
Definition at line 115 of file endorsement.hpp.
| JsonValue altintegration::ToJSON | ( | const KeystoneContainer & | c | ) |
Definition at line 56 of file keystone_container.hpp.
| JsonValue altintegration::ToJSON | ( | const MempoolResult & | r | ) |
Definition at line 51 of file mempool_result.hpp.
| JsonValue altintegration::ToJSON | ( | const MerklePath & | m | ) |
Definition at line 59 of file merkle_path.hpp.
| JsonValue altintegration::ToJSON | ( | const Output & | o | ) |
Definition at line 56 of file output.hpp.
| JsonValue altintegration::ToJSON | ( | const PopData & | p, |
| bool | verbose = false |
||
| ) |
Definition at line 112 of file popdata.hpp.
| JsonValue altintegration::ToJSON | ( | const PopPayoutsParams & | p | ) |
Definition at line 110 of file alt_chain_params.hpp.
| JsonValue altintegration::ToJSON | ( | const PublicationData & | p | ) |
Definition at line 54 of file publication_data.hpp.
| Value altintegration::ToJSON | ( | const T & | ) |
| JsonValue altintegration::ToJSON | ( | const ValidationState & | s, |
| bool * | acceptedToMempool = nullptr |
||
| ) |
Definition at line 82 of file validation_state.hpp.
| JsonValue altintegration::ToJSON | ( | const VbkBlock & | b | ) |
Definition at line 170 of file vbkblock.hpp.
| JsonValue altintegration::ToJSON | ( | const VbkMerklePath & | mp | ) |
Definition at line 62 of file vbk_merkle_path.hpp.
| JsonValue altintegration::ToJSON | ( | const VbkPopTx & | tx | ) |
Definition at line 90 of file vbkpoptx.hpp.
| JsonValue altintegration::ToJSON | ( | const VbkTx & | tx | ) |
Definition at line 95 of file vbktx.hpp.
| JsonValue altintegration::ToJSON | ( | const VTB & | v | ) |
Definition at line 96 of file vtb.hpp.
| std::vector< uint8_t > altintegration::trimmedArray | ( | int64_t | input | ) |
| input | value to convert |
| data | read data from this array |
| int altintegration::vblake | ( | void * | out, |
| const void * | in, | ||
| size_t | inlen | ||
| ) |
| [out] | out | output hash - 24 bytes |
| [in] | in | input data |
| [in] | inlen | length of input data, not more than 64 bytes |
| void altintegration::vblake_final | ( | vblake_ctx * | ctx, |
| void * | out | ||
| ) |
| ctx | initialized context. |
| out | resulting hash is written here. Should be 24 bytes. |
| void altintegration::vblake_init | ( | vblake_ctx * | ctx | ) |
| ctx | context to initialize. |
| int altintegration::vblake_update | ( | vblake_ctx * | ctx, |
| const void * | in, | ||
| size_t | inlen | ||
| ) |
| ctx | initialized context. |
| in | input buffer. |
| inlen | size of input buffer. At most 64 bytes. |
| void altintegration::writeNetworkByte | ( | WriteStream & | stream, |
| NetworkBytePair | networkOrType | ||
| ) |
| stream | write data to this stream |
| networkOrType | write network byte if available, write type byte after |
| void altintegration::writeSingleBEValue | ( | WriteStream & | stream, |
| int64_t | value | ||
| ) |
This function converts number to the bytes array in Big-Endian order, trims it and writes to the stream
| stream | write data to this stream |
| value | value to be written |
| std::out_of_range | if stream is out of data |
| void altintegration::writeSingleByteLenValue | ( | WriteStream & | stream, |
| Slice< const uint8_t > | value | ||
| ) |
| stream | write data to this stream |
| value | data that should be written |
| std::out_of_range | if value size is too high |
| void altintegration::writeSingleFixedBEValue | ( | WriteStream & | stream, |
| T | value | ||
| ) |
This function converts number to the bytes array in Big-Endian order and writes to the stream
| stream | write data to this stream |
| value | value to be written |
| std::out_of_range | if stream is out of data |
Definition at line 169 of file serde.hpp.
| void altintegration::writeVarLenValue | ( | WriteStream & | stream, |
| Slice< const uint8_t > | value | ||
| ) |
| stream | write data to this stream |
| value | data that should be written |
| altintegration::__pad0__ |
Definition at line 452 of file mempool.hpp.
| altintegration::__pad1__ |
Definition at line 452 of file mempool.hpp.
| altintegration::__pad2__ |
Definition at line 452 of file mempool.hpp.
|
constexpr |
Total size of this container is 80 bytes. 65 of which are VbkBlock (post-progpow), and 15 are address.
Definition at line 36 of file consts.hpp.
|
static |
Definition at line 128 of file consts.hpp.
|
constexpr |
Definition at line 96 of file consts.hpp.
|
constexpr |
Definition at line 53 of file consts.hpp.
|
constexpr |
Definition at line 45 of file consts.hpp.
|
static |
Definition at line 132 of file consts.hpp.
|
constexpr |
Definition at line 42 of file consts.hpp.
|
constexpr |
Definition at line 88 of file consts.hpp.
|
constexpr |
Definition at line 51 of file consts.hpp.
|
constexpr |
Definition at line 90 of file consts.hpp.
|
constexpr |
Definition at line 69 of file consts.hpp.
|
constexpr |
Definition at line 67 of file consts.hpp.
|
constexpr |
Definition at line 106 of file consts.hpp.
|
constexpr |
Definition at line 108 of file consts.hpp.
|
constexpr |
Definition at line 84 of file consts.hpp.
|
constexpr |
Definition at line 65 of file consts.hpp.
|
constexpr |
Definition at line 82 of file consts.hpp.
|
constexpr |
VTB can have a size up to 5.3 MB, so this number must be at least 5.3MB
Definition at line 76 of file consts.hpp.
|
constexpr |
Definition at line 78 of file consts.hpp.
|
constexpr |
Definition at line 80 of file consts.hpp.
|
constexpr |
Definition at line 112 of file consts.hpp.
|
constexpr |
Definition at line 71 of file consts.hpp.
|
constexpr |
Definition at line 110 of file consts.hpp.
|
constexpr |
Definition at line 92 of file consts.hpp.
|
constexpr |
Definition at line 86 of file consts.hpp.
|
constexpr |
Definition at line 39 of file consts.hpp.
|
constexpr |
Definition at line 114 of file consts.hpp.
|
constexpr |
Definition at line 55 of file consts.hpp.
|
constexpr |
Definition at line 119 of file consts.hpp.
|
constexpr |
Definition at line 121 of file consts.hpp.
|
constexpr |
Definition at line 104 of file consts.hpp.
|
constexpr |
Definition at line 102 of file consts.hpp.
|
constexpr |
Definition at line 98 of file consts.hpp.
|
constexpr |
Definition at line 117 of file consts.hpp.
|
static |
Definition at line 130 of file consts.hpp.
|
constexpr |
Definition at line 57 of file consts.hpp.
|
constexpr |
Definition at line 59 of file consts.hpp.
|
constexpr |
Definition at line 61 of file consts.hpp.
|
constexpr |
Definition at line 100 of file consts.hpp.
|
constexpr |
Definition at line 94 of file consts.hpp.