pub struct EthereumMachine { /* private fields */ }
Expand description

An ethereum-like state machine.

Implementations

Regular ethereum machine.

Ethereum machine with ethash extensions.

Attach special rules to the creation of schedule.

Get a reference to the ethash-specific extensions.

Execute a call as the system address. Block environment information passed to the VM is modified to have its gas limit bounded at the upper limit of possible used gases including this system call, capped at the maximum value able to be represented by U256. This system call modifies the block state, but discards other information. If suicides, logs or refunds happen within the system call, they will not be executed or recorded. Gas used by this system call will not be counted on the block.

Same as execute_as_system, but execute code directly. If contract address is None, use the null sender address. If code is None, then this function has no effect. The call is executed without finalization, and does not form a transaction.

fork, for ethash.

Populate a header’s fields based on its parent’s header. Usually implements the chain scoring rule based on weight. The gas floor target must not be lower than the engine’s minimum gas limit.

Get the general parameters of the chain.

Get the EVM schedule for the given block number.

Builtin-contracts for the chain..

Attempt to get a handle to a built-in contract. Only returns references to activated built-ins.

Some intrinsic operation parameters; by default they take their value from the spec()’s engine_params.

The nonce with which accounts begin at given block.

The network ID that transactions should be signed with.

Returns new contract address generation scheme at given block number.

Verify a particular transaction is valid, regardless of order.

Does basic verification of the transaction.

Does verification of the transaction against the parent state.

Additional params.

Performs pre-validation of RLP decoded transaction before other processing

Calculates base fee for the block that should be mined next. Base fee is calculated based on the parent header (last block in blockchain / best block).

Introduced by EIP1559 to support new market fee mechanism.

Modified for xDai chain to have an ability to set min base fee through eip1559BaseFeeMinValue spec option. The modification made in v3.3.0-rc.14

Trait Implementations

Three fields - consensus step and the corresponding proposer signature, and a list of empty step messages (which should be empty if no steps are skipped)

Additional engine-specific information for the user/developer concerning header.

Attempt to seal the block internally.

This operation is synchronous and may (quite reasonably) not be available, in which case Seal::None will be returned.

Apply operations on new epoch. Apply rewrite bytecode transitions if available.

Apply the block reward on finalisation of the block.

Check the number of seal fields.

Do the step and gas limit validation.

The name of this engine.

Get access to the underlying state machine.

Trigger next step of the consensus engine.

Maximum number of uncles a block is allowed to declare.

Populate a header’s fields based on its parent’s header. Usually implements the chain scoring rule based on weight. Read more

Returns whether the current node is a validator and actually may seal a block if AuRa engine is used. Read more

Returns the engine’s current sealing state.

Handle any potential consensus messages; updating consensus state and potentially issuing a new one. Read more

Verify a locally-generated seal of a header. Read more

Returns a list of transactions for a new block if we are the author. Read more

Phase 4 verification. Verify block header against potentially external data. Should only be called when register_client has been called previously. Read more

Genesis epoch data.

Whether an epoch change is signalled at the given header but will require finality. If a change can be enacted immediately then return No from this function but Yes from is_epoch_end. Read more

Whether a block is the end of an epoch. Read more

Create an epoch verifier from validation proof and a flag indicating whether finality is required. Read more

Add Client which can be used for sealing, potentially querying the state and sending messages.

Register a component which signs consensus messages.

Sign using the EngineSigner, to be used for consensus tx signing.

Create a factory for building snapshot chunks and restoring from them. Returning None indicates that this engine doesn’t support snapshot creation. Read more

Check whether the given new block is the best block, after finalization check.

the ancestry exists.

Overrides the block gas limit. Whenever this returns Some for a header, the next block’s gas limit must be exactly that value. used by AuRa engine. Read more

Optional maximum gas limit.

Allow mutating the header during seal generation. Currently only used by Clique.

Called in miner.chain_new_blocks if the engine wishes to update_sealing after a block was recently sealed. Read more

Phase 2 verification. Perform costly checks such as transaction signatures. Returns either a null Ok or a general error detailing the problem with import. The verification module can optionally avoid checking the seal (check_seal), if seal verification is disabled this method won’t be called. Read more

Whether this engine supports warp sync.

Return a new open block header timestamp based on the parent timestamp.

Check whether the parent timestamp is valid.

Returns author should used when executing tx’s for this block.

Attempt to seal the block internally.

The name of this engine.

Get access to the underlying state machine.

The number of additional header fields required for this engine.

Returns the engine’s current sealing state.

Verify a locally-generated seal of a header. Read more

Phase 4 verification. Verify block header against potentially external data. Should only be called when register_client has been called previously. Read more

Genesis epoch data.

Whether an epoch change is signalled at the given header but will require finality. If a change can be enacted immediately then return No from this function but Yes from is_epoch_end. Read more

Whether a block is the end of an epoch. Read more

Create an epoch verifier from validation proof and a flag indicating whether finality is required. Read more

Add Client which can be used for sealing, potentially querying the state and sending messages.

Register a component which signs consensus messages.

Sign using the EngineSigner, to be used for consensus tx signing.

Create a factory for building snapshot chunks and restoring from them. Returning None indicates that this engine doesn’t support snapshot creation. Read more

Check whether the given new block is the best block, after finalization check.

Additional engine-specific information for the user/developer concerning header.

Maximum number of uncles a block is allowed to declare.

Optional maximum gas limit.

Block transformation functions, before the transactions. epoch_begin set to true if this block kicks off an epoch. Read more

Block transformation functions, after the transactions.

Allow mutating the header during seal generation. Currently only used by Clique.

Called in miner.chain_new_blocks if the engine wishes to update_sealing after a block was recently sealed. Read more

Phase 1 quick block verification. Only does checks that are cheap. Returns either a null Ok or a general error detailing the problem with import. The verification module can optionally avoid checking the seal (check_seal), if seal verification is disabled this method won’t be called. Read more

Phase 2 verification. Perform costly checks such as transaction signatures. Returns either a null Ok or a general error detailing the problem with import. The verification module can optionally avoid checking the seal (check_seal), if seal verification is disabled this method won’t be called. Read more

Phase 3 verification. Check block information against parent. Returns either a null Ok or a general error detailing the problem with import.

Populate a header’s fields based on its parent’s header. Usually implements the chain scoring rule based on weight. Read more

Handle any potential consensus messages; updating consensus state and potentially issuing a new one. Read more

Returns whether the current node is a validator and actually may seal a block if AuRa engine is used. Read more

Trigger next step of the consensus engine.

Whether this engine supports warp sync.

Return a new open block header timestamp based on the parent timestamp.

Check whether the parent timestamp is valid.

the ancestry exists.

Returns author should used when executing tx’s for this block.

Returns a list of transactions for a new block if we are the author. Read more

Overrides the block gas limit. Whenever this returns Some for a header, the next block’s gas limit must be exactly that value. used by AuRa engine. Read more

Clique doesn’t require external work to seal, so we always return true here.

Returns if we are ready to seal, the real sealing (signing extra_data) is actually done in on_seal_block().

Verify block family by looking up parent state (backfill if needed), then try to apply current header. see https://github.com/ethereum/go-ethereum/blob/master/consensus/clique/clique.go#L338

Clique timestamp is set to parent + period , or current time which ever is higher.

The name of this engine.

Get access to the underlying state machine.

The number of additional header fields required for this engine.

Maximum number of uncles a block is allowed to declare.

Block transformation functions, before the transactions. epoch_begin set to true if this block kicks off an epoch. Read more

Block transformation functions, after the transactions.

Allow mutating the header during seal generation. Currently only used by Clique.

Verify a locally-generated seal of a header. Read more

Phase 1 quick block verification. Only does checks that are cheap. Returns either a null Ok or a general error detailing the problem with import. The verification module can optionally avoid checking the seal (check_seal), if seal verification is disabled this method won’t be called. Read more

Phase 2 verification. Perform costly checks such as transaction signatures. Returns either a null Ok or a general error detailing the problem with import. The verification module can optionally avoid checking the seal (check_seal), if seal verification is disabled this method won’t be called. Read more

Genesis epoch data.

Populate a header’s fields based on its parent’s header. Usually implements the chain scoring rule based on weight. Read more

Register a component which signs consensus messages.

Add Client which can be used for sealing, potentially querying the state and sending messages.

Trigger next step of the consensus engine.

Check whether the parent timestamp is valid.

Check whether the given new block is the best block, after finalization check.

Returns author should used when executing tx’s for this block.

Additional engine-specific information for the user/developer concerning header.

Optional maximum gas limit.

Called in miner.chain_new_blocks if the engine wishes to update_sealing after a block was recently sealed. Read more

Phase 4 verification. Verify block header against potentially external data. Should only be called when register_client has been called previously. Read more

Whether an epoch change is signalled at the given header but will require finality. If a change can be enacted immediately then return No from this function but Yes from is_epoch_end. Read more

Whether a block is the end of an epoch. Read more

Create an epoch verifier from validation proof and a flag indicating whether finality is required. Read more

Handle any potential consensus messages; updating consensus state and potentially issuing a new one. Read more

Returns whether the current node is a validator and actually may seal a block if AuRa engine is used. Read more

Sign using the EngineSigner, to be used for consensus tx signing.

Create a factory for building snapshot chunks and restoring from them. Returning None indicates that this engine doesn’t support snapshot creation. Read more

Whether this engine supports warp sync.

the ancestry exists.

Returns a list of transactions for a new block if we are the author. Read more

Overrides the block gas limit. Whenever this returns Some for a header, the next block’s gas limit must be exactly that value. used by AuRa engine. Read more

Additional engine-specific information for the user/developer concerning header.

Apply the block reward on finalisation of the block. This assumes that all uncles are valid uncles (i.e. of at least one generation before the current).

The name of this engine.

Get access to the underlying state machine.

The number of additional header fields required for this engine.

Maximum number of uncles a block is allowed to declare.

Optional maximum gas limit.

Populate a header’s fields based on its parent’s header. Usually implements the chain scoring rule based on weight. Read more

Verify a locally-generated seal of a header. Read more

Phase 1 quick block verification. Only does checks that are cheap. Returns either a null Ok or a general error detailing the problem with import. The verification module can optionally avoid checking the seal (check_seal), if seal verification is disabled this method won’t be called. Read more

Phase 2 verification. Perform costly checks such as transaction signatures. Returns either a null Ok or a general error detailing the problem with import. The verification module can optionally avoid checking the seal (check_seal), if seal verification is disabled this method won’t be called. Read more

Phase 3 verification. Check block information against parent. Returns either a null Ok or a general error detailing the problem with import.

Create an epoch verifier from validation proof and a flag indicating whether finality is required. Read more

Create a factory for building snapshot chunks and restoring from them. Returning None indicates that this engine doesn’t support snapshot creation. Read more

Check whether the given new block is the best block, after finalization check.

Block transformation functions, before the transactions. epoch_begin set to true if this block kicks off an epoch. Read more

Allow mutating the header during seal generation. Currently only used by Clique.

Returns the engine’s current sealing state.

Called in miner.chain_new_blocks if the engine wishes to update_sealing after a block was recently sealed. Read more

Attempt to seal the block internally. Read more

Phase 4 verification. Verify block header against potentially external data. Should only be called when register_client has been called previously. Read more

Genesis epoch data.

Whether an epoch change is signalled at the given header but will require finality. If a change can be enacted immediately then return No from this function but Yes from is_epoch_end. Read more

Whether a block is the end of an epoch. Read more

Handle any potential consensus messages; updating consensus state and potentially issuing a new one. Read more

Register a component which signs consensus messages.

Returns whether the current node is a validator and actually may seal a block if AuRa engine is used. Read more

Sign using the EngineSigner, to be used for consensus tx signing.

Add Client which can be used for sealing, potentially querying the state and sending messages.

Trigger next step of the consensus engine.

Whether this engine supports warp sync.

Return a new open block header timestamp based on the parent timestamp.

Check whether the parent timestamp is valid.

the ancestry exists.

Returns author should used when executing tx’s for this block.

Returns a list of transactions for a new block if we are the author. Read more

Overrides the block gas limit. Whenever this returns Some for a header, the next block’s gas limit must be exactly that value. used by AuRa engine. Read more

Lightly verify the next block header. This may not be a header belonging to a different epoch. Read more

Perform potentially heavier checks on the next block header.

Check a finality proof against this epoch verifier. Returns Some(hashes) if the proof proves finality of these hashes. Returns None if the proof doesn’t prove anything. Read more

A handle to a blockchain client for this machine.

Errors which can occur when querying or interacting with the machine.

Get the balance, in base units, associated with an account. Extracts data from the live block. Read more

Increment the balance of an account in the state of the live block.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.