Main entrypoint into the veriblock-pop library.
More...
Definition at line 27 of file pop_context.hpp.
#include <pop_context.hpp>
|
| PopContext (const PopContext &)=delete |
|
PopContext & | operator= (const PopContext &)=delete |
|
| PopContext (PopContext &&)=default |
|
PopContext & | operator= (PopContext &&)=default |
|
VBK_CHECK_RETURN bool | check (const ATV &payload, ValidationState &state) |
| Checks ATV (stateless check). More...
|
|
VBK_CHECK_RETURN bool | check (const VTB &payload, ValidationState &state) |
| Checks VTB (stateless check). More...
|
|
VBK_CHECK_RETURN bool | check (const VbkBlock &payload, ValidationState &state) |
| Checks VbkBlock (stateless check). More...
|
|
VBK_CHECK_RETURN bool | check (const PopData &payload, ValidationState &state) |
| Checks PopData (stateless check). More...
|
|
void | saveAllTrees (BlockBatch &batch) const |
| Save ALT/VBK/BTC trees on disk via adapter BlockBatch. More...
|
|
VBK_CHECK_RETURN bool | loadAllTrees (bool fast_load, ValidationState &state) |
| Load ALT/VBK/BTC trees from disk via adapter BlockReader. More...
|
|
VBK_CHECK_RETURN bool | getPopPayout (const AltBlockTree::hash_t &prev, PopPayouts &rewards, ValidationState &state) |
| Calculates POP rewards that should be paid in the next block after prev . More...
|
|
VBK_CHECK_RETURN PopData | generatePopData () |
| Generate PopData for the block next to the current tip. More...
|
|
VBK_CHECK_RETURN bool | generatePublicationData (PublicationData &output, const std::vector< uint8_t > &endorsedBlockHeader, const std::vector< uint8_t > &txMerkleRoot, const PopData &popData, const std::vector< uint8_t > &payoutInfo) |
| Create PublicationData given required input parameters. More...
|
|
VBK_CHECK_RETURN const Config & | getConfig () const |
|
VBK_CHECK_RETURN MemPool & | getMemPool () |
|
VBK_CHECK_RETURN AltBlockTree & | getAltBlockTree () |
|
VBK_CHECK_RETURN const AltBlockTree & | getAltBlockTree () const |
|
VBK_CHECK_RETURN const VbkBlockTree & | getVbkBlockTree () const |
|
VBK_CHECK_RETURN const BtcBlockTree & | getBtcBlockTree () const |
|
void | shutdown () |
| stops PopContext internal thread pool used for stateless validation.
|
|
◆ check() [1/4]
VBK_CHECK_RETURN bool altintegration::PopContext::check |
( |
const ATV & |
payload, |
|
|
ValidationState & |
state |
|
) |
| |
- Parameters
-
[in] | payload | ATV to be checked |
[out] | state | |
- Returns
- true if ATV is statelessly valid, false otherwise
◆ check() [2/4]
- Parameters
-
[in] | payload | PopData to be checked |
[out] | state | |
- Returns
- true if PopData is statelessly valid, false otherwise
◆ check() [3/4]
- Parameters
-
[in] | payload | VbkBlock to be checked |
[out] | state | |
- Returns
- true if VbkBlock is statelessly valid, false otherwise
◆ check() [4/4]
VBK_CHECK_RETURN bool altintegration::PopContext::check |
( |
const VTB & |
payload, |
|
|
ValidationState & |
state |
|
) |
| |
- Parameters
-
[in] | payload | VTB to be checked |
[out] | state | |
- Returns
- true if VTB is statelessly valid, false otherwise
◆ create()
- Parameters
-
[in] | config | |
[in] | payloadsProvider | |
[in] | blockProvider | |
[in] | ethashCache | |
[in] | progpowHeaderCache | |
[in] | validatorWorkers | |
- Returns
◆ generatePopData()
VBK_CHECK_RETURN PopData altintegration::PopContext::generatePopData |
( |
| ) |
|
- Returns
- empty or non-empty PopData instance that must be inserted into next block body.
◆ generatePublicationData()
VBK_CHECK_RETURN bool altintegration::PopContext::generatePublicationData |
( |
PublicationData & |
output, |
|
|
const std::vector< uint8_t > & |
endorsedBlockHeader, |
|
|
const std::vector< uint8_t > & |
txMerkleRoot, |
|
|
const PopData & |
popData, |
|
|
const std::vector< uint8_t > & |
payoutInfo |
|
) |
| |
- Parameters
-
[out] | output | generated publication data output. Valid only if this func returned true. |
[in] | endorsedBlockHeader | serialized altchain header of endorsed block (for BTC it is 80 bytes). |
[in] | txMerkleRoot | transaction merkle root (used original merkle root value from the block header). |
[in] | popData | popData that is stored in endorsed block. |
[in] | payoutInfo | bytes that will then be interpreted by altchain as payout information (for BTC can be a script...). |
- Returns
- true if endorsed block exists, false otherwise.
◆ getPopPayout()
VBK_CHECK_RETURN bool altintegration::PopContext::getPopPayout |
( |
const AltBlockTree::hash_t & |
prev, |
|
|
PopPayouts & |
rewards, |
|
|
ValidationState & |
state |
|
) |
| |
- Parameters
-
[in] | prev | Altchain has to supply prev block of a block that will contain POP reward. |
[out] | rewards | a map where key=payoutInfo from PublicationData, value=amount to be paid. |
[out] | state | validation state. |
- Returns
- true if rewards are obtained; false otherwise.
◆ loadAllTrees()
VBK_CHECK_RETURN bool altintegration::PopContext::loadAllTrees |
( |
bool |
fast_load, |
|
|
ValidationState & |
state |
|
) |
| |
- Parameters
-
[in] | fast_load | flag |
[out] | state | validation state |
◆ saveAllTrees()
void altintegration::PopContext::saveAllTrees |
( |
BlockBatch & |
batch | ) |
const |
- Parameters
-
[out] | batch | adaptor for writing blocks on disk. |
The documentation for this struct was generated from the following file: