CatapultServer
v0.5.0.1 (Elephant)
|
Go to the documentation of this file.
27 namespace cache {
class MemoryPtCacheProxy; }
28 namespace chain {
class PtValidator; }
30 struct DetachedCosignature;
32 struct TransactionInfo;
37 namespace catapult {
namespace chain {
96 std::unique_ptr<const PtValidator>&& pValidator,
99 const std::shared_ptr<thread::IoThreadPool>& pPool);
TCacheModifierProxy modifier() override
Definition: MemoryCacheProxy.h:58
Cosignature is added and did not complete the owning transaction.
void handleComplete(const model::WeakCosignedTransactionInfo &transactionInfo)
Definition: PtUpdater.cpp:379
#define CATAPULT_LOG(SEV)
Writes a log entry to the default logger with SEV severity.
Definition: Logging.h:340
Cosignature is added and completed the owning transaction.
size_t NumCosignaturesAdded
Number of cosignatures added.
Definition: PtUpdater.h:59
Wrapper around a transaction and its cosignatures.
Definition: WeakCosignedTransactionInfo.h:29
auto view() const
Gets a read only view based on this cache.
Definition: MemoryCacheProxy.h:48
std::shared_ptr< thread::IoThreadPool > m_pPool
Definition: PtUpdater.cpp:393
utils::ByteArray< Hash256_Size, Hash256_tag > Hash256
Definition: src/catapult/types.h:47
CheckEligibilityResult(CosignersValidationResult validationResult)
Definition: PtUpdater.cpp:84
Provides updating of a partial transactions cache.
Definition: PtUpdater.h:86
def debug(*args)
Definition: Parser.py:46
Error occurred during processing of cosignature.
thread::future< TransactionUpdateResult > updateImpl(const TransactionUpdateContext &updateContext)
Definition: PtUpdater.cpp:180
bool isPurgeRequired() const
Definition: PtUpdater.cpp:98
Definition: PtUpdater.cpp:77
thread::future< TransactionUpdateResult > update(const model::TransactionInfo &transactionInfo)
Definition: PtUpdater.cpp:145
const Transaction & transaction() const
Gets the transaction.
Definition: WeakCosignedTransactionInfo.h:43
consumer< const model::Transaction &, const Hash256 &, validators::ValidationResult > FailedTransactionSink
Indicates a transaction with the specified hash failed validation.
Definition: ChainFunctions.h:33
Represents a thread pool that shares a single io context across multiple threads.
Definition: IoThreadPool.h:30
thread::future< TransactionUpdateResult > update(const DetachedCosignatures &cosignatures, TransactionUpdateResult::UpdateType updateType)
Definition: PtUpdater.cpp:236
consumer< std::unique_ptr< model::Transaction > && > CompletedTransactionSink
Sink that is passed completed transactions.
Definition: PtUpdater.h:89
Definition: PtUpdater.cpp:72
std::unique_ptr< const PtValidator > m_pValidator
Definition: PtUpdater.cpp:390
UpdateType Type
Type of the update.
Definition: PtUpdater.h:56
const StaleTransactionInfo & staleTransactionInfo() const
Definition: PtUpdater.cpp:106
std::shared_ptr< Impl > m_pImpl
Definition: PtUpdater.h:112
cache::MemoryPtCacheProxy & m_transactionsCache
Definition: PtUpdater.cpp:389
A delegating proxy around a MemoryPtCache.
Definition: MemoryPtCache.h:97
CosignatureUpdateResult addCosignature(const model::DetachedCosignature &cosignature)
Definition: PtUpdater.cpp:257
void setStaleTransactionInfo(StaleTransactionInfo &&staleTransactionInfo)
Definition: PtUpdater.cpp:111
Definition: PtUpdater.cpp:121
Result of a transaction update.
Definition: PtUpdater.h:42
std::shared_ptr< const model::UnresolvedAddressSet > pExtractedAddresses
Definition: PtUpdater.cpp:141
A transaction and its associated metadata.
Definition: EntityInfo.h:104
Cosignature is redundant.
future< std::vector< future< T > > > when_all(std::vector< future< T >> &&allFutures)
Returns a future that is signaled when all futures in allFutures complete.
Definition: FutureUtils.h:31
bool isValid(const model::Transaction &transaction, const Hash256 &aggregateHash) const
Definition: PtUpdater.cpp:290
TTransactionInfo remove(const Hash256 &hash)
Removes the transaction identified by hash from the cache.
Definition: BasicTransactionsCache.h:70
Wrapper around a strongly typed entity and its associated metadata.
Definition: WeakEntityInfo.h:33
CosignatureUpdateResult
Result of a cosignature update.
Definition: PtUpdater.h:63
std::unique_ptr< model::Transaction > StitchAggregate(const model::WeakCosignedTransactionInfo &transactionInfo)
Stitches a weak cosigned transaction info into a full aggregate transaction.
Definition: PtUtils.cpp:27
CosignersValidationResult m_validationResult
Definition: PtUpdater.cpp:117
CosignatureUpdateResult m_updateResult
Definition: PtUpdater.cpp:116
Impl(cache::MemoryPtCacheProxy &transactionsCache, std::unique_ptr< const PtValidator > &&pValidator, const CompletedTransactionSink &completedTransactionSink, const FailedTransactionSink &failedTransactionSink, const std::shared_ptr< thread::IoThreadPool > &pPool)
Definition: PtUpdater.cpp:123
model::DetachedTransactionInfo remove(const Hash256 &aggregateHash)
Definition: PtUpdater.cpp:383
Hash256 ParentHash
Hash of the corresponding parent.
Definition: Cosignature.h:48
std::unique_ptr< StaleTransactionInfo > m_pStaleTransactionInfo
Definition: PtUpdater.cpp:118
std::shared_ptr< const UnresolvedAddressSet > OptionalExtractedAddresses
Extracted addresses (optional).
Definition: EntityInfo.h:100
Hash256 AggregateHash
Definition: PtUpdater.cpp:73
Key Signer
Cosigner public key.
Definition: Cosignature.h:31
std::vector< model::Cosignature > EligibleCosignatures
Definition: PtUpdater.cpp:74
Provides a way to access the result of an asynchronous operation.
Definition: Future.h:29
CosignatureUpdateResult updateImpl(const model::DetachedCosignature &cosignature)
Definition: PtUpdater.cpp:212
CosignatureUpdateResult updateResult() const
Definition: PtUpdater.cpp:90
ArraySet< Key > KeySet
A key set.
Definition: ArraySet.h:64
CheckEligibilityResult(CosignatureUpdateResult updateResult)
Definition: PtUpdater.cpp:79
At least one cosigner is missing.
Hash256 AggregateHash
Definition: PtUpdater.cpp:139
CompletedTransactionSink m_completedTransactionSink
Definition: PtUpdater.cpp:391
A validation result.
Definition: PtValidator.h:61
bool isEligibile() const
Definition: PtUpdater.cpp:94
Definition: PtUpdater.cpp:137
future< T > make_ready_future(T &&value)
Produces a future that is ready immediately and holds the given value.
Definition: Future.h:126
All cosigners are eligible and sufficient.
PtValidator::Result< CosignersValidationResult > validateCosigners(const model::WeakCosignedTransactionInfo &transactionInfo, const std::vector< model::Cosignature > &cosignatures) const
Definition: PtUpdater.cpp:369
CheckEligibilityResult checkEligibility(const model::DetachedCosignature &cosignature) const
Definition: PtUpdater.cpp:302
PtUpdater(cache::MemoryPtCacheProxy &transactionsCache, std::unique_ptr< const PtValidator > &&pValidator, const CompletedTransactionSink &completedTransactionSink, const FailedTransactionSink &failedTransactionSink, const std::shared_ptr< thread::IoThreadPool > &pPool)
Definition: PtUpdater.cpp:396
CosignersValidationResult
Result of a partial transaction cosigners validation.
Definition: PtValidator.h:38
bool isComplete(const model::WeakCosignedTransactionInfo &transactionInfo) const
Definition: PtUpdater.cpp:375
CosignatureUpdateResult checkCompleteness(const Hash256 &aggregateHash)
Definition: PtUpdater.cpp:268
#define CATAPULT_THROW_INVALID_ARGUMENT(MESSAGE)
Macro used to throw a catapult invalid argument.
Definition: exceptions.h:179
UpdateType
Possible update types.
Definition: PtUpdater.h:44
std::shared_ptr< TEntity > pEntity
Entity pointer.
Definition: EntityInfo.h:45
Definition: AddressExtractionExtension.cpp:28
bool isCacheStale() const
Definition: PtUpdater.cpp:102
bool Verify(const Key &publicKey, const RawBuffer &dataBuffer, const Signature &signature)
Definition: Signer.cpp:136
FailedTransactionSink m_failedTransactionSink
Definition: PtUpdater.cpp:392
thread::future< TransactionUpdateResult > update(const model::TransactionInfo &transactionInfo)
Updates this cache by adding a new transaction info (transactionInfo).
Definition: PtUpdater.cpp:412
Cosignature is unverifiable.
Transaction failed validation and should be rejected.
model::DetachedTransactionInfo add(const Hash256 &parentHash, const Key &signer, const Signature &signature)
Adds a cosignature (composed of signer and signature) for a partial transaction with hash parentHash ...
Definition: PtCache.h:55
Hash256 EntityHash
Entity hash.
Definition: EntityInfo.h:48
A detached cosignature.
Definition: Cosignature.h:38
thread::future< CosignatureUpdateResult > update(const model::DetachedCosignature &cosignature)
Definition: PtUpdater.cpp:199
void refreshStaleCacheEntry(const StaleTransactionInfo &staleTransactionInfo)
Definition: PtUpdater.cpp:357
std::function< void(TArgs...)> consumer
A consumer function.
Definition: functions.h:35
Cosignature is ineligible.
DetachedCosignatures Cosignatures
Definition: PtUpdater.cpp:140
std::shared_ptr< const model::AggregateTransaction > pAggregateTransaction
Definition: PtUpdater.cpp:138
catapult::Signature Signature
Cosigner signature.
Definition: Cosignature.h:34
~PtUpdater()
Destroys the updater.
Definition: EntityInfo.h:77
Binary layout for a transaction.
Definition: Transaction.h:32