CatapultServer
v0.5.0.1 (Elephant)
|
Go to the documentation of this file.
32 class UtCacheModifierProxy;
36 namespace catapult {
namespace chain {
91 void update(
const std::vector<model::TransactionInfo>& utInfos);
TimeSupplier m_timeSupplier
Definition: UtUpdater.cpp:201
void update(const std::vector< model::TransactionInfo > &utInfos)
Updates this cache by applying new transaction infos in utInfos.
Definition: UtUpdater.cpp:226
#define CATAPULT_LOG(SEV)
Writes a log entry to the default logger with SEV severity.
Definition: Logging.h:340
UtUpdater(cache::UtCache &transactionsCache, const cache::CatapultCache &confirmedCatapultCache, BlockFeeMultiplier minFeeMultiplier, const ExecutionConfiguration &executionConfig, const TimeSupplier &timeSupplier, const FailedTransactionSink &failedTransactionSink, const Throttle &throttle)
Definition: UtUpdater.cpp:206
void apply(const ApplyState &applyState, const std::vector< model::TransactionInfo > &utInfos, TransactionSource transactionSource)
Definition: UtUpdater.cpp:106
std::unique_ptr< CatapultCacheDelta > rebaseAndLock()
Rebases and locks the (detached) catapult cache delta.
Definition: RelockableDetachedCatapultCache.cpp:88
A previously committed transaction that was reverted.
def debug(*args)
Definition: Parser.py:46
constexpr bool IsValidationResultSuccess(ValidationResult result)
Returns a value indicating whether the validation result is a success.
Definition: ValidationResult.h:90
Provides batch updating of an unconfirmed transactions cache.
Definition: UtUpdater.h:39
virtual TTransactionsCacheModifierProxy modifier()=0
Gets a write only view of the cache.
Context passed to all the observers.
Definition: ObserverContext.h:78
std::function< bool(TArgs...)> predicate
A predicate function.
Definition: functions.h:31
BlockFeeMultiplier m_minFeeMultiplier
Definition: UtUpdater.cpp:199
def warning(*args)
Definition: colorPrint.py:10
utils::BaseValue< uint64_t, Height_tag > Height
Definition: src/catapult/types.h:85
std::vector< model::TransactionInfo > removeAll()
Removes all transactions from the cache.
Definition: UtCache.h:50
UtUpdater::Throttle m_throttle
Definition: UtUpdater.cpp:203
model::NetworkInfo Network
Network info.
Definition: ExecutionConfiguration.h:39
consumer< const model::Transaction &, const Hash256 &, validators::ValidationResult > FailedTransactionSink
Indicates a transaction with the specified hash failed validation.
Definition: ChainFunctions.h:33
void enableUndo()
Enables subsequent notifications to be undone.
Definition: ProcessingNotificationSubscriber.cpp:44
A notification subscriber that processes notifications.
Definition: ProcessingNotificationSubscriber.h:29
bool add(const TTransactionInfo &transactionInfo)
Definition: BasicTransactionsCache.h:65
A transaction and its associated metadata.
Definition: EntityInfo.h:104
ObserverPointer pObserver
Observer.
Definition: ExecutionConfiguration.h:42
~UtUpdater()
Destroys the updater.
predicate< const model::TransactionInfo &, const ThrottleContext & > Throttle
Function signature for throttling cache additions.
Definition: UtUpdater.h:69
void update(const std::vector< model::TransactionInfo > &utInfos)
Definition: UtUpdater.cpp:65
Contextual information passed to stateful validators.
Definition: ValidatorContext.h:32
void addAll(cache::UtCacheModifierProxy &modifier, const std::vector< model::TransactionInfo > &utInfos)
Definition: UtUpdater.cpp:191
Configuration for executing entities.
Definition: ExecutionConfiguration.h:30
UtUpdater::TransactionSource TransactionSource
Transaction source.
Definition: UtUpdater.h:56
An interface for caching unconfirmed transactions.
Definition: UtCache.h:56
FailedTransactionSink m_failedTransactionSink
Definition: UtUpdater.cpp:202
void undo()
Undoes all executions since enableUndo was first called.
Definition: ProcessingNotificationSubscriber.cpp:48
def info(*args)
Definition: forwardsValidation.py:12
ExecutionConfiguration m_executionConfig
Definition: UtUpdater.cpp:200
Central cache holding all sub caches.
Definition: CatapultCache.h:40
Stateful catapult information.
Definition: CatapultState.h:27
Contextual information passed to throttle.
Definition: UtUpdater.h:54
Definition: UtUpdater.cpp:45
#define CATAPULT_LOG_LEVEL(LEVEL)
Writes a log entry to the default logger with LEVEL severity.
Definition: Logging.h:336
bool throttle(const model::TransactionInfo &utInfo, TransactionSource transactionSource, const ApplyState &applyState, cache::ReadOnlyCatapultCache &cache) const
Definition: UtUpdater.cpp:183
WeakEntityInfoT< VerifiableEntity > WeakEntityInfo
Definition: WeakEntityInfo.h:128
An existing transaction that is reapplied.
cache::UtCache & m_transactionsCache
Definition: UtUpdater.cpp:197
Height height() const
Gets the current cache height.
Definition: RelockableDetachedCatapultCache.cpp:80
std::unique_ptr< CatapultCacheDelta > getAndTryLock()
Definition: RelockableDetachedCatapultCache.cpp:84
cache::RelockableDetachedCatapultCache m_detachedCatapultCache
Definition: UtUpdater.cpp:198
validators::ValidationResult result() const
Gets the aggregate result of processed notifications.
Definition: ProcessingNotificationSubscriber.cpp:40
ResolverContextFactoryFunc ResolverContextFactory
Resolver context factory.
Definition: ExecutionConfiguration.h:51
supplier< Timestamp > TimeSupplier
Supplies a timestamp.
Definition: ChainFunctions.h:39
void update(const utils::HashPointerSet &confirmedTransactionHashes, const std::vector< model::TransactionInfo > &utInfos)
Definition: UtUpdater.cpp:80
PublisherPointer pNotificationPublisher
Notification publisher.
Definition: ExecutionConfiguration.h:48
void apply(const ApplyState &applyState, const std::vector< model::TransactionInfo > &utInfos, TransactionSource transactionSource, const predicate< const model::TransactionInfo & > &filter)
Definition: UtUpdater.cpp:110
TransactionSource
Sources of transactions that can be updated.
Definition: UtUpdater.h:42
Definition: AddressExtractionExtension.cpp:28
constexpr bool IsValidationResultFailure(ValidationResult result)
Returns a value indicating whether the validation result is a failure.
Definition: ValidationResult.h:95
cache::CatapultCacheDelta & UnconfirmedCatapultCache
Definition: UtUpdater.cpp:41
A relockable detached catapult cache.
Definition: RelockableDetachedCatapultCache.h:30
Impl(cache::UtCache &transactionsCache, const cache::CatapultCache &confirmedCatapultCache, BlockFeeMultiplier minFeeMultiplier, const ExecutionConfiguration &executionConfig, const TimeSupplier &timeSupplier, const FailedTransactionSink &failedTransactionSink, const Throttle &throttle)
Definition: UtUpdater.cpp:47
constexpr utils::LogLevel MapToLogLevel(ValidationResult result)
Maps validation result to an appropriate logging level.
Definition: ValidationResult.h:100
Amount CalculateTransactionFee(BlockFeeMultiplier feeMultiplier, const Transaction &transaction)
Calculates the fee for transaction contained in block with feeMultiplier.
Definition: FeeUtils.cpp:26
ArrayPointerSet< Hash256 > HashPointerSet
A hash pointer set.
Definition: ArraySet.h:70
const cache::UtCacheModifierProxy & TransactionsCache
Unconfirmed transactions cache.
Definition: UtUpdater.h:65
std::unique_ptr< Impl > m_pImpl
Definition: UtUpdater.h:98
cache::UtCacheModifierProxy & Modifier
Definition: UtUpdater.cpp:40
ValidatorPointer pValidator
Stateful validator.
Definition: ExecutionConfiguration.h:45
A read-only overlay on top of a catapult cache.
Definition: ReadOnlyCatapultCache.h:27
Height CacheHeight
Cache height.
Definition: UtUpdater.h:59
const cache::ReadOnlyCatapultCache & UnconfirmedCatapultCache
Unconfirmed catapult cache.
Definition: UtUpdater.h:62
A new transaction that is added for the first time.