CatapultServer
v0.5.0.1 (Elephant)
|
Go to the documentation of this file.
27 namespace cache {
class CatapultCache; }
28 namespace chain {
struct ObserverState; }
31 namespace catapult {
namespace consumers {
39 const std::vector<model::TransactionInfo>& revertedTransactionInfos)
BlockChainSyncHandlers m_handlers
Definition: BlockChainSyncConsumer.cpp:292
#define CATAPULT_LOG(SEV)
Writes a log entry to the default logger with SEV severity.
Definition: Logging.h:340
std::shared_ptr< const model::BlockElement > m_pCommonBlockElement
Definition: BlockChainSyncConsumer.cpp:114
constexpr bool IsValidationResultSuccess(ValidationResult result)
Returns a value indicating whether the validation result is a success.
Definition: ValidationResult.h:90
DifficultyCheckerFunc DifficultyChecker
Checks all difficulties in a block chain for correctness.
Definition: BlockChainSyncHandlers.h:97
TransactionsChangeInfo(const utils::HashPointerSet &addedTransactionHashes, const std::vector< model::TransactionInfo > &revertedTransactionInfos)
Creates a new transactions change info around addedTransactionHashes and revertedTransactionInfos.
Definition: BlockChainSyncHandlers.h:37
const std::vector< model::TransactionInfo > & RevertedTransactionInfos
Infos of the transactions that were reverted (previously confirmed).
Definition: BlockChainSyncHandlers.h:49
State was written to disk.
std::function< bool(TArgs...)> predicate
A predicate function.
Definition: functions.h:31
Catapult data directory.
Definition: CatapultDataDirectory.h:61
def warning(*args)
Definition: colorPrint.py:10
utils::BaseValue< uint64_t, Height_tag > Height
Definition: src/catapult/types.h:85
InputSource
Possible consumer input sources.
Definition: InputSource.h:42
consumer< CommitOperationStep > CommitStepFunc
Prototype for commit step notification.
Definition: BlockChainSyncHandlers.h:93
BlockChainProcessor Processor
Processes (validates and executes) a block chain.
Definition: BlockChainSyncHandlers.h:100
UndoBlockType
Type of block passed to undo block handler.
Definition: BlockChainSyncHandlers.h:53
disruptor::DisruptorConsumer CreateBlockChainSyncConsumer(cache::CatapultCache &cache, state::CatapultState &state, io::BlockStorageCache &storage, uint32_t maxRollbackBlocks, const BlockChainSyncHandlers &handlers)
Definition: BlockChainSyncConsumer.cpp:296
io::BlockStorageCache & m_storage
Definition: BlockChainSyncConsumer.cpp:290
Processing of the entity was aborted by a consumer.
DisruptorConsumerT< const ConsumerInput > ConstDisruptorConsumer
A const disruptor consumer function.
Definition: DisruptorConsumer.h:35
void ExtractTransactionInfos(std::vector< TransactionInfo > &transactionInfos, const std::shared_ptr< const BlockElement > &pBlockElement)
Definition: Elements.cpp:93
cache::CatapultCache * m_pOriginalCache
Definition: BlockChainSyncConsumer.cpp:110
model::ChainScore Score
Definition: BlockChainSyncConsumer.cpp:43
utils::HashPointerSet ExtractTransactionHashes(const BlockElements &elements)
Extracts all transaction hashes from elements.
Definition: InputUtils.cpp:35
consumer< const cache::CatapultCacheDelta &, const state::CatapultState &, Height > PreStateWrittenFunc
Prototype for pre state written notification.
Definition: BlockChainSyncHandlers.h:87
state::CatapultState m_stateCopy
Definition: BlockChainSyncConsumer.cpp:113
uint64_t CalculateScore(const model::Block &parentBlock, const model::Block ¤tBlock)
Calculates the score of currentBlock with parent parentBlock.
Definition: BlockScorer.cpp:99
consumer< const model::BlockElement &, observers::ObserverState &, UndoBlockType > UndoBlockFunc
Definition: BlockChainSyncHandlers.h:81
File based queue reader where each message is represented by a file (with incrementing names) in a di...
Definition: FileQueue.h:51
std::string str() const
Gets the directory path (as string).
Definition: CatapultDataDirectory.h:38
TransactionInfos m_removedTransactionInfos
Definition: BlockChainSyncConsumer.cpp:116
void skip(uint32_t count)
Skips at most the next count messages.
Definition: FileQueue.cpp:121
Definition: BlockStorageCache.h:97
Handlers used by the block chain sync consumer.
Definition: BlockChainSyncHandlers.h:74
StateChangeFunc StateChange
Called with state change info to indicate a state change.
Definition: BlockChainSyncHandlers.h:106
Information passed to a transactions change handler.
Definition: BlockChainSyncHandlers.h:34
Central cache holding all sub caches.
Definition: CatapultCache.h:40
std::vector< model::TransactionInfo > TransactionInfos
Container for transactions infos.
Definition: InputUtils.h:48
state::CatapultState * m_pOriginalState
Definition: BlockChainSyncConsumer.cpp:111
Stateful catapult information.
Definition: CatapultState.h:27
Blocks were written to disk.
constexpr disruptor::ConsumerResult Abort(validators::ValidationResult validationResult)
Creates an aborted consumer result around validationResult.
Definition: ConsumerResultFactory.h:34
UndoBlockFunc UndoBlock
Undoes a block and updates a cache.
Definition: BlockChainSyncHandlers.h:103
state::CatapultState & m_state
Definition: BlockChainSyncConsumer.cpp:289
std::vector< model::BlockElement > BlockElements
A container of BlockElement.
Definition: DisruptorTypes.h:132
uint32_t m_maxRollbackBlocks
Definition: BlockChainSyncConsumer.cpp:291
model::ChainScore m_scoreDelta
Definition: BlockChainSyncConsumer.cpp:115
CommitStepFunc CommitStep
Called with the commit operation step.
Definition: BlockChainSyncHandlers.h:115
CatapultDirectory spoolDir(const std::string &name) const
Gets the spooling directory with name.
Definition: CatapultDataDirectory.h:79
disruptor::ConstDisruptorConsumer CreateBlockChainSyncCleanupConsumer(const std::string &dataDirectory)
Creates a consumer that cleans up temporary state produced by the block chain sync consumer given dat...
Definition: BlockChainSyncCleanupConsumer.cpp:29
const utils::HashPointerSet & AddedTransactionHashes
Hashes of the transactions that were added (newly confirmed).
Definition: BlockChainSyncHandlers.h:46
std::function< validators::ValidationResult(const WeakBlockInfo &, disruptor::BlockElements &, observers::ObserverState &)> BlockChainProcessor
Definition: BlockChainProcessor.h:62
cache::CatapultCache & m_cache
Definition: BlockChainSyncConsumer.cpp:288
model::ChainScore ChainScore
Definition: tools/health/main.cpp:43
CommitOperationStep
Steps in a commit operation.
Definition: BlockChainSyncHandlers.h:62
Definition: AddressExtractionExtension.cpp:28
model::ChainScore CalculatePartialChainScore(const model::Block &parent, const std::vector< const model::Block * > &blocks)
Calculates the partial chain score of blocks starting at parent.
Definition: ChainUtils.cpp:90
std::vector< const model::Block * > ExtractBlocks(const BlockElements &elements)
Extracts all blocks from elements.
Definition: InputUtils.cpp:25
PreStateWrittenFunc PreStateWritten
Called after state change but before state written checkpoint.
Definition: BlockChainSyncHandlers.h:109
consumer< const TransactionsChangeInfo & > TransactionsChangeFunc
Prototype for transaction change notification.
Definition: BlockChainSyncHandlers.h:90
std::unique_ptr< cache::CatapultCacheDelta > m_pCacheDelta
Definition: BlockChainSyncConsumer.cpp:112
ArrayPointerSet< Hash256 > HashPointerSet
A hash pointer set.
Definition: ArraySet.h:70
consumer< const subscribers::StateChangeInfo & > StateChangeFunc
Prototype for state change notification.
Definition: BlockChainSyncHandlers.h:84
DisruptorConsumerT< ConsumerInput > DisruptorConsumer
A disruptor consumer function.
Definition: DisruptorConsumer.h:32
TransactionInfos CollectRevertedTransactionInfos(const utils::HashPointerSet &addedTransactionHashes, TransactionInfos &&removedTransactionInfos)
Definition: InputUtils.cpp:60
std::function< void(TArgs...)> consumer
A consumer function.
Definition: functions.h:35
predicate< const std::vector< const model::Block * > &, const cache::CatapultCache & > DifficultyCheckerFunc
Prototype for checking block difficulties.
Definition: BlockChainSyncHandlers.h:77
TransactionsChangeFunc TransactionsChange
Called with the hashes of confirmed transactions and the infos of reverted transactions when transact...
Definition: BlockChainSyncHandlers.h:112
Level for logging warning events.
constexpr disruptor::ConsumerResult Continue()
Creates a continuation consumer result.
Definition: ConsumerResultFactory.h:29