CatapultServer
v0.5.0.1 (Elephant)
|
Go to the documentation of this file.
24 #include <boost/multiprecision/cpp_int.hpp>
29 namespace catapult {
namespace chain {
BlockTarget CalculateTarget(const utils::TimeSpan &timeSpan, Difficulty difficulty, Importance signerImportance, const model::BlockChainConfiguration &config)
Definition: BlockScorer.cpp:123
Predicate used to determine if a block is a hit or not.
Definition: BlockScorer.h:80
Block chain configuration settings.
Definition: BlockChainConfiguration.h:33
ImportanceLookupFunc m_importanceLookup
Definition: BlockScorer.h:98
uint32_t BlockTimeSmoothingFactor
Definition: BlockChainConfiguration.h:57
catapult::Height Height
Block height.
Definition: BlockScorer.h:76
model::BlockChainConfiguration m_config
Definition: BlockScorer.h:97
uint64_t Log2TimesPowerOfTwo(uint64_t value, uint64_t n)
Calculates log2(value^(2^n)).
Definition: IntegerMath.cpp:48
static constexpr TimeSpan FromDifference(Timestamp end, Timestamp start)
Creates a time span from the difference between start and end.
Definition: TimeSpan.h:64
uint32_t NumLeadingZeros
Definition: BlockScorer.cpp:33
catapult::GenerationHash GenerationHash
Generation hash.
Definition: BlockScorer.h:64
utils::TimeSpan ElapsedTime
Time since the last block.
Definition: BlockScorer.h:67
Represents a time duration.
Definition: TimeSpan.h:30
constexpr ValueType unwrap() const
Unwraps this value and returns the underlying raw value.
Definition: BaseValue.h:53
uint32_t Value
Definition: BlockScorer.cpp:32
BlockHitPredicate(const model::BlockChainConfiguration &config, const ImportanceLookupFunc &importanceLookup)
Definition: BlockScorer.cpp:149
catapult::Difficulty Difficulty
Block difficulty.
Definition: BlockScorer.h:73
uint64_t CalculateHit(const GenerationHash &generationHash)
Calculates the hit for a generationHash.
Definition: BlockScorer.cpp:73
constexpr uint64_t seconds() const
Returns the number of seconds.
Definition: TimeSpan.h:86
utils::TimeSpan BlockGenerationTargetTime
Targeted time between blocks.
Definition: BlockChainConfiguration.h:51
uint64_t CalculateScore(const model::Block &parentBlock, const model::Block ¤tBlock)
Calculates the score of currentBlock with parent parentBlock.
Definition: BlockScorer.cpp:99
bool operator()(const model::Block &parentBlock, const model::Block &block, const GenerationHash &generationHash) const
Determines if the block is a hit given its parent (parentBlock) and generation hash (generationHash).
Definition: BlockScorer.cpp:154
boost::multiprecision::uint256_t BlockTarget
Definition: BlockScorer.h:31
std::function< Importance(const Key &, Height)> ImportanceLookupFunc
Definition: BlockScorer.h:82
Account restriction is interpreted as blocking operation.
BlockHitContext()
Creates a block hit context.
Definition: BlockScorer.h:59
Binary layout for a block.
Definition: Block.h:69
#define BSWAP(VAL)
Definition: BlockScorer.cpp:52
Definition: AddressExtractionExtension.cpp:28
utils::ByteArray< Hash256_Size, GenerationHash_tag > GenerationHash
Definition: src/catapult/types.h:53
Base values that are constrained to a range of values.
Definition: ClampedBaseValue.h:27
constexpr T Log2(T value)
Calculates log2(value).
Definition: IntegerMath.h:46
constexpr size_t Hash256_Size
Definition: src/catapult/types.h:34
Base class for wrappers of byte array types, to provide some type-safety.
Definition: ByteArray.h:29
Key Signer
Public key of the block signer.
Definition: BlockScorer.h:70
Contextual information for calculating a block hit.
Definition: BlockScorer.h:56