Fabcoin Core  0.16.2
P2P Digital Currency
Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
dev::eth::Ethash Class Reference

#include <Ethash.h>

Inheritance diagram for dev::eth::Ethash:
[legend]
Collaboration diagram for dev::eth::Ethash:
[legend]

Public Types

enum  { MixHashField = 0, NonceField = 1 }
 

Public Member Functions

 Ethash ()
 
std::string name () const override
 
unsigned revision () const override
 
unsigned sealFields () const override
 
bytes sealRLP () const override
 
StringHashMap jsInfo (BlockHeader const &_bi) const override
 
void verify (Strictness _s, BlockHeader const &_bi, BlockHeader const &_parent, bytesConstRef _block) const override
 Don't forget to call Super::verify when subclassing & overriding. More...
 
void verifyTransaction (ImportRequirements::value _ir, TransactionBase const &_t, BlockHeader const &_bi) const override
 Additional verification for transactions in blocks. More...
 
void populateFromParent (BlockHeader &_bi, BlockHeader const &_parent) const override
 Don't forget to call Super::populateFromParent when subclassing & overriding. More...
 
strings sealers () const override
 
std::string sealer () const override
 
void setSealer (std::string const &_sealer) override
 
void cancelGeneration () override
 
void generateSeal (BlockHeader const &_bi) override
 
bool shouldSeal (Interface *_i) override
 
eth::GenericFarm< EthashProofOfWork > & farm ()
 
u256 calculateDifficulty (BlockHeader const &_bi, BlockHeader const &_parent) const
 
u256 childGasLimit (BlockHeader const &_bi, u256 const &_gasFloorTarget=Invalid256) const
 
void manuallySetWork (BlockHeader const &_work)
 
void manuallySubmitWork (h256 const &_mixHash, Nonce _nonce)
 
- Public Member Functions inherited from dev::eth::SealEngineBase
void generateSeal (BlockHeader const &_bi) override
 
void onSealGenerated (std::function< void(bytes const &)> const &_f) override
 
EVMSchedule const & evmSchedule (EnvInfo const &) const override
 
- Public Member Functions inherited from dev::eth::SealEngineFace
virtual ~SealEngineFace ()
 
bytes option (std::string const &_name) const
 
bool setOption (std::string const &_name, bytes const &_value)
 
virtual void onSealGenerated (std::function< void(bytes const &s)> const &_f)=0
 
ChainOperationParams const & chainParams () const
 
void setChainParams (ChainOperationParams const &_params)
 
SealEngineFacewithChainParams (ChainOperationParams const &_params)
 
virtual bool isPrecompiled (Address const &_a, u256 const &_blockNumber) const
 
virtual bigint costOfPrecompiled (Address const &_a, bytesConstRef _in, u256 const &) const
 
virtual std::pair< bool, bytesexecutePrecompiled (Address const &_a, bytesConstRef _in, u256 const &) const
 
void setFascSchedule (EVMSchedule _fascSchedule) const
 
EVMSchedulegetFascSchedule () const
 

Static Public Member Functions

static h256 seedHash (BlockHeader const &_bi)
 
static Nonce nonce (BlockHeader const &_bi)
 
static h256 mixHash (BlockHeader const &_bi)
 
static h256 boundary (BlockHeader const &_bi)
 
static BlockHeadersetNonce (BlockHeader &_bi, Nonce _v)
 
static BlockHeadersetMixHash (BlockHeader &_bi, h256 const &_v)
 
static void ensurePrecomputed (unsigned _number)
 
static void init ()
 

Private Member Functions

bool verifySeal (BlockHeader const &_bi) const
 
bool quickVerifySeal (BlockHeader const &_bi) const
 

Private Attributes

eth::GenericFarm< EthashProofOfWorkm_farm
 
std::string m_sealer = "cpu"
 
BlockHeader m_sealing
 

Additional Inherited Members

- Public Attributes inherited from dev::eth::SealEngineFace
std::set< AddressdeleteAddresses
 
- Protected Member Functions inherited from dev::eth::SealEngineFace
virtual bool onOptionChanging (std::string const &, bytes const &)
 
- Protected Attributes inherited from dev::eth::SealEngineBase
std::function< void(bytes const &s)> m_onSealGenerated
 

Detailed Description

Definition at line 36 of file Ethash.h.

Member Enumeration Documentation

anonymous enum
Enumerator
MixHashField 
NonceField 

Definition at line 60 of file Ethash.h.

Constructor & Destructor Documentation

Ethash::Ethash ( )

Definition at line 38 of file Ethash.cpp.

Here is the call graph for this function:

Member Function Documentation

static h256 dev::eth::Ethash::boundary ( BlockHeader const &  _bi)
inlinestatic

Definition at line 64 of file Ethash.h.

Here is the call graph for this function:

Here is the caller graph for this function:

u256 Ethash::calculateDifficulty ( BlockHeader const &  _bi,
BlockHeader const &  _parent 
) const

Definition at line 182 of file Ethash.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void dev::eth::Ethash::cancelGeneration ( )
inlineoverridevirtual

Reimplemented from dev::eth::SealEngineFace.

Definition at line 54 of file Ethash.h.

Here is the call graph for this function:

u256 Ethash::childGasLimit ( BlockHeader const &  _bi,
u256 const &  _gasFloorTarget = Invalid256 
) const

Definition at line 166 of file Ethash.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void Ethash::ensurePrecomputed ( unsigned  _number)
static

Definition at line 280 of file Ethash.cpp.

Here is the caller graph for this function:

eth::GenericFarm<EthashProofOfWork>& dev::eth::Ethash::farm ( )
inline

Definition at line 58 of file Ethash.h.

Here is the caller graph for this function:

void Ethash::generateSeal ( BlockHeader const &  _bi)
overridevirtual

Implements dev::eth::SealEngineFace.

Definition at line 264 of file Ethash.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void Ethash::init ( )
static

Definition at line 33 of file Ethash.cpp.

Here is the caller graph for this function:

StringHashMap Ethash::jsInfo ( BlockHeader const &  _bi) const
overridevirtual

Reimplemented from dev::eth::SealEngineFace.

Definition at line 71 of file Ethash.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void dev::eth::Ethash::manuallySetWork ( BlockHeader const &  _work)
inline

Definition at line 71 of file Ethash.h.

Here is the call graph for this function:

Here is the caller graph for this function:

void Ethash::manuallySubmitWork ( h256 const &  _mixHash,
Nonce  _nonce 
)

Definition at line 177 of file Ethash.cpp.

Here is the caller graph for this function:

static h256 dev::eth::Ethash::mixHash ( BlockHeader const &  _bi)
inlinestatic

Definition at line 63 of file Ethash.h.

Here is the call graph for this function:

std::string dev::eth::Ethash::name ( ) const
inlineoverridevirtual

Implements dev::eth::SealEngineFace.

Definition at line 41 of file Ethash.h.

static Nonce dev::eth::Ethash::nonce ( BlockHeader const &  _bi)
inlinestatic

Definition at line 62 of file Ethash.h.

Here is the call graph for this function:

void Ethash::populateFromParent ( BlockHeader _bi,
BlockHeader const &  _parent 
) const
overridevirtual

Don't forget to call Super::populateFromParent when subclassing & overriding.

Reimplemented from dev::eth::SealEngineFace.

Definition at line 209 of file Ethash.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool Ethash::quickVerifySeal ( BlockHeader const &  _bi) const
private

Definition at line 216 of file Ethash.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned dev::eth::Ethash::revision ( ) const
inlineoverridevirtual

Reimplemented from dev::eth::SealEngineFace.

Definition at line 42 of file Ethash.h.

std::string dev::eth::Ethash::sealer ( ) const
inlineoverridevirtual

Reimplemented from dev::eth::SealEngineFace.

Definition at line 52 of file Ethash.h.

strings Ethash::sealers ( ) const
overridevirtual

Reimplemented from dev::eth::SealEngineFace.

Definition at line 61 of file Ethash.cpp.

Here is the caller graph for this function:

unsigned dev::eth::Ethash::sealFields ( ) const
inlineoverridevirtual

Reimplemented from dev::eth::SealEngineFace.

Definition at line 43 of file Ethash.h.

bytes dev::eth::Ethash::sealRLP ( ) const
inlineoverridevirtual

Reimplemented from dev::eth::SealEngineFace.

Definition at line 44 of file Ethash.h.

Here is the call graph for this function:

h256 Ethash::seedHash ( BlockHeader const &  _bi)
static

Definition at line 66 of file Ethash.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

static BlockHeader& dev::eth::Ethash::setMixHash ( BlockHeader _bi,
h256 const &  _v 
)
inlinestatic

Definition at line 66 of file Ethash.h.

Here is the call graph for this function:

static BlockHeader& dev::eth::Ethash::setNonce ( BlockHeader _bi,
Nonce  _v 
)
inlinestatic

Definition at line 65 of file Ethash.h.

Here is the call graph for this function:

void dev::eth::Ethash::setSealer ( std::string const &  _sealer)
inlineoverridevirtual

Reimplemented from dev::eth::SealEngineFace.

Definition at line 53 of file Ethash.h.

bool Ethash::shouldSeal ( Interface _i)
overridevirtual

Reimplemented from dev::eth::SealEngineFace.

Definition at line 275 of file Ethash.cpp.

Here is the caller graph for this function:

void Ethash::verify ( Strictness  _s,
BlockHeader const &  _bi,
BlockHeader const &  _parent,
bytesConstRef  _block 
) const
overridevirtual

Don't forget to call Super::verify when subclassing & overriding.

Reimplemented from dev::eth::SealEngineFace.

Definition at line 76 of file Ethash.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool Ethash::verifySeal ( BlockHeader const &  _bi) const
private

Definition at line 233 of file Ethash.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void Ethash::verifyTransaction ( ImportRequirements::value  _ir,
TransactionBase const &  _t,
BlockHeader const &  _bi 
) const
overridevirtual

Additional verification for transactions in blocks.

Reimplemented from dev::eth::SealEngineFace.

Definition at line 147 of file Ethash.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

eth::GenericFarm<EthashProofOfWork> dev::eth::Ethash::m_farm
private

Definition at line 81 of file Ethash.h.

std::string dev::eth::Ethash::m_sealer = "cpu"
private

Definition at line 82 of file Ethash.h.

BlockHeader dev::eth::Ethash::m_sealing
private

Definition at line 83 of file Ethash.h.


The documentation for this class was generated from the following files: