Struct ethcore::machine::EthereumMachine
[−]
[src]
pub struct EthereumMachine { /* fields omitted */ }
An ethereum-like state machine.
Methods
impl EthereumMachine
[src]
impl EthereumMachine
pub fn regular(
params: CommonParams,
builtins: BTreeMap<Address, Builtin>
) -> EthereumMachine
[src]
pub fn regular(
params: CommonParams,
builtins: BTreeMap<Address, Builtin>
) -> EthereumMachine
Regular ethereum machine.
pub fn with_ethash_extensions(
params: CommonParams,
builtins: BTreeMap<Address, Builtin>,
extensions: EthashExtensions
) -> EthereumMachine
[src]
pub fn with_ethash_extensions(
params: CommonParams,
builtins: BTreeMap<Address, Builtin>,
extensions: EthashExtensions
) -> EthereumMachine
Ethereum machine with ethash extensions.
pub fn set_schedule_creation_rules(&mut self, rules: Box<ScheduleCreationRules>)
[src]
pub fn set_schedule_creation_rules(&mut self, rules: Box<ScheduleCreationRules>)
Attach special rules to the creation of schedule.
pub fn ethash_extensions(&self) -> Option<&EthashExtensions>
[src]
pub fn ethash_extensions(&self) -> Option<&EthashExtensions>
Get a reference to the ethash-specific extensions.
impl EthereumMachine
[src]
impl EthereumMachine
pub fn execute_as_system(
&self,
block: &mut ExecutedBlock,
contract_address: Address,
gas: U256,
data: Option<Vec<u8>>
) -> Result<Vec<u8>, Error>
[src]
pub fn execute_as_system(
&self,
block: &mut ExecutedBlock,
contract_address: Address,
gas: U256,
data: Option<Vec<u8>>
) -> Result<Vec<u8>, Error>
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.
pub fn on_new_block(&self, block: &mut ExecutedBlock) -> Result<(), Error>
[src]
pub fn on_new_block(&self, block: &mut ExecutedBlock) -> Result<(), Error>
Logic to perform on a new block: updating last hashes and the DAO fork, for ethash.
pub fn populate_from_parent(
&self,
header: &mut Header,
parent: &Header,
gas_floor_target: U256,
gas_ceil_target: U256
)
[src]
pub fn populate_from_parent(
&self,
header: &mut Header,
parent: &Header,
gas_floor_target: U256,
gas_ceil_target: U256
)
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.
pub fn params(&self) -> &CommonParams
[src]
pub fn params(&self) -> &CommonParams
Get the general parameters of the chain.
pub fn schedule(&self, block_number: BlockNumber) -> Schedule
[src]
pub fn schedule(&self, block_number: BlockNumber) -> Schedule
Get the EVM schedule for the given block number.
pub fn builtins(&self) -> &BTreeMap<Address, Builtin>
[src]
pub fn builtins(&self) -> &BTreeMap<Address, Builtin>
Builtin-contracts for the chain..
pub fn builtin(
&self,
a: &Address,
block_number: BlockNumber
) -> Option<&Builtin>
[src]
pub fn builtin(
&self,
a: &Address,
block_number: BlockNumber
) -> Option<&Builtin>
Attempt to get a handle to a built-in contract. Only returns references to activated built-ins.
pub fn maximum_extra_data_size(&self) -> usize
[src]
pub fn maximum_extra_data_size(&self) -> usize
Some intrinsic operation parameters; by default they take their value from the spec()
's engine_params
.
pub fn account_start_nonce(&self, block: u64) -> U256
[src]
pub fn account_start_nonce(&self, block: u64) -> U256
The nonce with which accounts begin at given block.
pub fn signing_chain_id(&self, env_info: &EnvInfo) -> Option<u64>
[src]
pub fn signing_chain_id(&self, env_info: &EnvInfo) -> Option<u64>
The network ID that transactions should be signed with.
pub fn create_address_scheme(
&self,
number: BlockNumber
) -> CreateContractAddress
[src]
pub fn create_address_scheme(
&self,
number: BlockNumber
) -> CreateContractAddress
Returns new contract address generation scheme at given block number.
pub fn verify_transaction_unordered(
&self,
t: UnverifiedTransaction,
_header: &Header
) -> Result<SignedTransaction, Error>
[src]
pub fn verify_transaction_unordered(
&self,
t: UnverifiedTransaction,
_header: &Header
) -> Result<SignedTransaction, Error>
Verify a particular transaction is valid, regardless of order.
pub fn verify_transaction_basic(
&self,
t: &UnverifiedTransaction,
header: &Header
) -> Result<(), Error>
[src]
pub fn verify_transaction_basic(
&self,
t: &UnverifiedTransaction,
header: &Header
) -> Result<(), Error>
Does basic verification of the transaction.
pub fn verify_transaction<C: BlockInfo + CallContract>(
&self,
t: &SignedTransaction,
header: &Header,
client: &C
) -> Result<(), Error>
[src]
pub fn verify_transaction<C: BlockInfo + CallContract>(
&self,
t: &SignedTransaction,
header: &Header,
client: &C
) -> Result<(), Error>
Does verification of the transaction against the parent state.
pub fn additional_params(&self) -> HashMap<String, String>
[src]
pub fn additional_params(&self) -> HashMap<String, String>
Additional params.
pub fn decode_transaction(
&self,
transaction: &[u8]
) -> Result<UnverifiedTransaction, Error>
[src]
pub fn decode_transaction(
&self,
transaction: &[u8]
) -> Result<UnverifiedTransaction, Error>
Performs pre-validation of RLP decoded transaction before other processing
Trait Implementations
impl Engine<EthereumMachine> for AuthorityRound
[src]
impl Engine<EthereumMachine> for AuthorityRound
fn name(&self) -> &str
[src]
fn name(&self) -> &str
The name of this engine.
fn machine(&self) -> &EthereumMachine
[src]
fn machine(&self) -> &EthereumMachine
Get access to the underlying state machine.
fn seal_fields(&self, header: &Header) -> usize
[src]
fn seal_fields(&self, header: &Header) -> usize
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)
fn step(&self)
[src]
fn step(&self)
Trigger next step of the consensus engine.
fn extra_info(&self, header: &Header) -> BTreeMap<String, String>
[src]
fn extra_info(&self, header: &Header) -> BTreeMap<String, String>
Additional engine-specific information for the user/developer concerning header
.
fn maximum_uncle_count(&self, block: BlockNumber) -> usize
[src]
fn maximum_uncle_count(&self, block: BlockNumber) -> usize
Maximum number of uncles a block is allowed to declare.
fn populate_from_parent(&self, header: &mut Header, parent: &Header)
[src]
fn populate_from_parent(&self, header: &mut Header, parent: &Header)
Populate a header's fields based on its parent's header. Usually implements the chain scoring rule based on weight. Read more
fn seals_internally(&self) -> Option<bool>
[src]
fn seals_internally(&self) -> Option<bool>
None means that it requires external input (e.g. PoW) to seal a block. Some(true) means the engine is currently prime for seal generation (i.e. node is the current validator). Some(false) means that the node might seal internally but is not qualified now. Read more
fn handle_message(&self, rlp: &[u8]) -> Result<(), EngineError>
[src]
fn handle_message(&self, rlp: &[u8]) -> Result<(), EngineError>
Handle any potential consensus messages; updating consensus state and potentially issuing a new one. Read more
fn generate_seal(&self, block: &ExecutedBlock, parent: &Header) -> Seal
[src]
fn generate_seal(&self, block: &ExecutedBlock, parent: &Header) -> Seal
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.
fn verify_local_seal(&self, _header: &Header) -> Result<(), Error>
[src]
fn verify_local_seal(&self, _header: &Header) -> Result<(), Error>
Verify a locally-generated seal of a header. Read more
fn on_new_block(
&self,
block: &mut ExecutedBlock,
epoch_begin: bool,
_ancestry: &mut Iterator<Item = ExtendedHeader>
) -> Result<(), Error>
[src]
fn on_new_block(
&self,
block: &mut ExecutedBlock,
epoch_begin: bool,
_ancestry: &mut Iterator<Item = ExtendedHeader>
) -> Result<(), Error>
Block transformation functions, before the transactions. epoch_begin
set to true if this block kicks off an epoch. Read more
fn on_close_block(&self, block: &mut ExecutedBlock) -> Result<(), Error>
[src]
fn on_close_block(&self, block: &mut ExecutedBlock) -> Result<(), Error>
Apply the block reward on finalisation of the block.
fn verify_block_basic(&self, header: &Header) -> Result<(), Error>
[src]
fn verify_block_basic(&self, header: &Header) -> Result<(), Error>
Check the number of seal fields.
fn verify_block_family(
&self,
header: &Header,
parent: &Header
) -> Result<(), Error>
[src]
fn verify_block_family(
&self,
header: &Header,
parent: &Header
) -> Result<(), Error>
Do the step and gas limit validation.
fn verify_block_external(&self, header: &Header) -> Result<(), Error>
[src]
fn verify_block_external(&self, header: &Header) -> Result<(), Error>
Phase 4 verification. Verify block header against potentially external data. Should only be called when register_client
has been called previously. Read more
fn genesis_epoch_data(
&self,
header: &Header,
call: &Call
) -> Result<Vec<u8>, String>
[src]
fn genesis_epoch_data(
&self,
header: &Header,
call: &Call
) -> Result<Vec<u8>, String>
Genesis epoch data.
fn signals_epoch_end(
&self,
header: &Header,
aux: AuxiliaryData
) -> EpochChange<EthereumMachine>
[src]
fn signals_epoch_end(
&self,
header: &Header,
aux: AuxiliaryData
) -> EpochChange<EthereumMachine>
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
fn is_epoch_end(
&self,
chain_head: &Header,
chain: &Headers<Header>,
transition_store: &PendingTransitionStore
) -> Option<Vec<u8>>
[src]
fn is_epoch_end(
&self,
chain_head: &Header,
chain: &Headers<Header>,
transition_store: &PendingTransitionStore
) -> Option<Vec<u8>>
Whether a block is the end of an epoch. Read more
fn epoch_verifier<'a>(
&self,
_header: &Header,
proof: &'a [u8]
) -> ConstructedVerifier<'a, EthereumMachine>
[src]
fn epoch_verifier<'a>(
&self,
_header: &Header,
proof: &'a [u8]
) -> ConstructedVerifier<'a, EthereumMachine>
Create an epoch verifier from validation proof and a flag indicating whether finality is required. Read more
fn register_client(&self, client: Weak<EngineClient>)
[src]
fn register_client(&self, client: Weak<EngineClient>)
Add Client which can be used for sealing, potentially querying the state and sending messages.
fn set_signer(
&self,
ap: Arc<AccountProvider>,
address: Address,
password: String
)
[src]
fn set_signer(
&self,
ap: Arc<AccountProvider>,
address: Address,
password: String
)
Register an account which signs consensus messages.
fn sign(&self, hash: H256) -> Result<Signature, Error>
[src]
fn sign(&self, hash: H256) -> Result<Signature, Error>
Sign using the EngineSigner, to be used for consensus tx signing.
fn snapshot_components(&self) -> Option<Box<SnapshotComponents>>
[src]
fn snapshot_components(&self) -> Option<Box<SnapshotComponents>>
Create a factory for building snapshot chunks and restoring from them. Returning None
indicates that this engine doesn't support snapshot creation. Read more
fn fork_choice(
&self,
new: &ExtendedHeader,
current: &ExtendedHeader
) -> ForkChoice
[src]
fn fork_choice(
&self,
new: &ExtendedHeader,
current: &ExtendedHeader
) -> ForkChoice
Check whether the given new block is the best block, after finalization check.
fn maximum_uncle_age(&self) -> usize
[src]
fn maximum_uncle_age(&self) -> usize
The number of generations back that uncles can be.
fn verify_block_unordered(&self, _header: &M::Header) -> Result<(), M::Error>
[src]
fn verify_block_unordered(&self, _header: &M::Header) -> Result<(), M::Error>
Phase 2 verification. Perform costly checks such as transaction signatures. Returns either a null Ok
or a general error detailing the problem with import.
fn is_proposal(&self, _verified_header: &M::Header) -> bool
[src]
fn is_proposal(&self, _verified_header: &M::Header) -> bool
Find out if the block is a proposal block and should not be inserted into the DB. Takes a header of a fully verified block. Read more
fn stop(&self)
[src]
fn stop(&self)
Stops any services that the may hold the Engine and makes it safe to drop.
fn supports_warp(&self) -> bool
[src]
fn supports_warp(&self) -> bool
Whether this engine supports warp sync.
fn open_block_header_timestamp(&self, parent_timestamp: u64) -> u64
[src]
fn open_block_header_timestamp(&self, parent_timestamp: u64) -> u64
Return a new open block header timestamp based on the parent timestamp.
fn is_timestamp_valid(
&self,
header_timestamp: u64,
parent_timestamp: u64
) -> bool
[src]
fn is_timestamp_valid(
&self,
header_timestamp: u64,
parent_timestamp: u64
) -> bool
Check whether the parent timestamp is valid.
fn ancestry_actions(
&self,
_block: &M::LiveBlock,
_ancestry: &mut Iterator<Item = M::ExtendedHeader>
) -> Vec<AncestryAction>
[src]
fn ancestry_actions(
&self,
_block: &M::LiveBlock,
_ancestry: &mut Iterator<Item = M::ExtendedHeader>
) -> Vec<AncestryAction>
Gather all ancestry actions. Called at the last stage when a block is committed. The Engine must guarantee that the ancestry exists. Read more
impl Engine<EthereumMachine> for BasicAuthority
[src]
impl Engine<EthereumMachine> for BasicAuthority
fn name(&self) -> &str
[src]
fn name(&self) -> &str
The name of this engine.
fn machine(&self) -> &EthereumMachine
[src]
fn machine(&self) -> &EthereumMachine
Get access to the underlying state machine.
fn seal_fields(&self, _header: &Header) -> usize
[src]
fn seal_fields(&self, _header: &Header) -> usize
The number of additional header fields required for this engine.
fn seals_internally(&self) -> Option<bool>
[src]
fn seals_internally(&self) -> Option<bool>
None means that it requires external input (e.g. PoW) to seal a block. Some(true) means the engine is currently prime for seal generation (i.e. node is the current validator). Some(false) means that the node might seal internally but is not qualified now. Read more
fn generate_seal(&self, block: &ExecutedBlock, _parent: &Header) -> Seal
[src]
fn generate_seal(&self, block: &ExecutedBlock, _parent: &Header) -> Seal
Attempt to seal the block internally.
fn verify_local_seal(&self, _header: &Header) -> Result<(), Error>
[src]
fn verify_local_seal(&self, _header: &Header) -> Result<(), Error>
Verify a locally-generated seal of a header. Read more
fn verify_block_external(&self, header: &Header) -> Result<(), Error>
[src]
fn verify_block_external(&self, header: &Header) -> Result<(), Error>
Phase 4 verification. Verify block header against potentially external data. Should only be called when register_client
has been called previously. Read more
fn genesis_epoch_data(
&self,
header: &Header,
call: &Call
) -> Result<Vec<u8>, String>
[src]
fn genesis_epoch_data(
&self,
header: &Header,
call: &Call
) -> Result<Vec<u8>, String>
Genesis epoch data.
fn signals_epoch_end(
&self,
_header: &Header,
_auxiliary: AuxiliaryData
) -> EpochChange<EthereumMachine>
[src]
fn signals_epoch_end(
&self,
_header: &Header,
_auxiliary: AuxiliaryData
) -> EpochChange<EthereumMachine>
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
fn is_epoch_end(
&self,
chain_head: &Header,
_chain: &Headers<Header>,
_transition_store: &PendingTransitionStore
) -> Option<Vec<u8>>
[src]
fn is_epoch_end(
&self,
chain_head: &Header,
_chain: &Headers<Header>,
_transition_store: &PendingTransitionStore
) -> Option<Vec<u8>>
Whether a block is the end of an epoch. Read more
fn epoch_verifier<'a>(
&self,
header: &Header,
proof: &'a [u8]
) -> ConstructedVerifier<'a, EthereumMachine>
[src]
fn epoch_verifier<'a>(
&self,
header: &Header,
proof: &'a [u8]
) -> ConstructedVerifier<'a, EthereumMachine>
Create an epoch verifier from validation proof and a flag indicating whether finality is required. Read more
fn register_client(&self, client: Weak<EngineClient>)
[src]
fn register_client(&self, client: Weak<EngineClient>)
Add Client which can be used for sealing, potentially querying the state and sending messages.
fn set_signer(
&self,
ap: Arc<AccountProvider>,
address: Address,
password: String
)
[src]
fn set_signer(
&self,
ap: Arc<AccountProvider>,
address: Address,
password: String
)
Register an account which signs consensus messages.
fn sign(&self, hash: H256) -> Result<Signature, Error>
[src]
fn sign(&self, hash: H256) -> Result<Signature, Error>
Sign using the EngineSigner, to be used for consensus tx signing.
fn snapshot_components(&self) -> Option<Box<SnapshotComponents>>
[src]
fn snapshot_components(&self) -> Option<Box<SnapshotComponents>>
Create a factory for building snapshot chunks and restoring from them. Returning None
indicates that this engine doesn't support snapshot creation. Read more
fn fork_choice(
&self,
new: &ExtendedHeader,
current: &ExtendedHeader
) -> ForkChoice
[src]
fn fork_choice(
&self,
new: &ExtendedHeader,
current: &ExtendedHeader
) -> ForkChoice
Check whether the given new block is the best block, after finalization check.
fn extra_info(&self, _header: &M::Header) -> BTreeMap<String, String>
[src]
fn extra_info(&self, _header: &M::Header) -> BTreeMap<String, String>
Additional engine-specific information for the user/developer concerning header
.
fn maximum_uncle_count(&self, _block: BlockNumber) -> usize
[src]
fn maximum_uncle_count(&self, _block: BlockNumber) -> usize
Maximum number of uncles a block is allowed to declare.
fn maximum_uncle_age(&self) -> usize
[src]
fn maximum_uncle_age(&self) -> usize
The number of generations back that uncles can be.
fn on_new_block(
&self,
_block: &mut M::LiveBlock,
_epoch_begin: bool,
_ancestry: &mut Iterator<Item = M::ExtendedHeader>
) -> Result<(), M::Error>
[src]
fn on_new_block(
&self,
_block: &mut M::LiveBlock,
_epoch_begin: bool,
_ancestry: &mut Iterator<Item = M::ExtendedHeader>
) -> Result<(), M::Error>
Block transformation functions, before the transactions. epoch_begin
set to true if this block kicks off an epoch. Read more
fn on_close_block(&self, _block: &mut M::LiveBlock) -> Result<(), M::Error>
[src]
fn on_close_block(&self, _block: &mut M::LiveBlock) -> Result<(), M::Error>
Block transformation functions, after the transactions.
fn verify_block_basic(&self, _header: &M::Header) -> Result<(), M::Error>
[src]
fn verify_block_basic(&self, _header: &M::Header) -> Result<(), M::Error>
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.
fn verify_block_unordered(&self, _header: &M::Header) -> Result<(), M::Error>
[src]
fn verify_block_unordered(&self, _header: &M::Header) -> Result<(), M::Error>
Phase 2 verification. Perform costly checks such as transaction signatures. Returns either a null Ok
or a general error detailing the problem with import.
fn verify_block_family(
&self,
_header: &M::Header,
_parent: &M::Header
) -> Result<(), M::Error>
[src]
fn verify_block_family(
&self,
_header: &M::Header,
_parent: &M::Header
) -> Result<(), M::Error>
Phase 3 verification. Check block information against parent. Returns either a null Ok
or a general error detailing the problem with import.
fn populate_from_parent(&self, _header: &mut M::Header, _parent: &M::Header)
[src]
fn populate_from_parent(&self, _header: &mut M::Header, _parent: &M::Header)
Populate a header's fields based on its parent's header. Usually implements the chain scoring rule based on weight. Read more
fn handle_message(&self, _message: &[u8]) -> Result<(), EngineError>
[src]
fn handle_message(&self, _message: &[u8]) -> Result<(), EngineError>
Handle any potential consensus messages; updating consensus state and potentially issuing a new one. Read more
fn is_proposal(&self, _verified_header: &M::Header) -> bool
[src]
fn is_proposal(&self, _verified_header: &M::Header) -> bool
Find out if the block is a proposal block and should not be inserted into the DB. Takes a header of a fully verified block. Read more
fn step(&self)
[src]
fn step(&self)
Trigger next step of the consensus engine.
fn stop(&self)
[src]
fn stop(&self)
Stops any services that the may hold the Engine and makes it safe to drop.
fn supports_warp(&self) -> bool
[src]
fn supports_warp(&self) -> bool
Whether this engine supports warp sync.
fn open_block_header_timestamp(&self, parent_timestamp: u64) -> u64
[src]
fn open_block_header_timestamp(&self, parent_timestamp: u64) -> u64
Return a new open block header timestamp based on the parent timestamp.
fn is_timestamp_valid(
&self,
header_timestamp: u64,
parent_timestamp: u64
) -> bool
[src]
fn is_timestamp_valid(
&self,
header_timestamp: u64,
parent_timestamp: u64
) -> bool
Check whether the parent timestamp is valid.
fn ancestry_actions(
&self,
_block: &M::LiveBlock,
_ancestry: &mut Iterator<Item = M::ExtendedHeader>
) -> Vec<AncestryAction>
[src]
fn ancestry_actions(
&self,
_block: &M::LiveBlock,
_ancestry: &mut Iterator<Item = M::ExtendedHeader>
) -> Vec<AncestryAction>
Gather all ancestry actions. Called at the last stage when a block is committed. The Engine must guarantee that the ancestry exists. Read more
impl Engine<EthereumMachine> for Tendermint
[src]
impl Engine<EthereumMachine> for Tendermint
fn name(&self) -> &str
[src]
fn name(&self) -> &str
The name of this engine.
fn seal_fields(&self, _header: &Header) -> usize
[src]
fn seal_fields(&self, _header: &Header) -> usize
(consensus view, proposal signature, authority signatures)
fn machine(&self) -> &EthereumMachine
[src]
fn machine(&self) -> &EthereumMachine
Get access to the underlying state machine.
fn maximum_uncle_count(&self, _block: BlockNumber) -> usize
[src]
fn maximum_uncle_count(&self, _block: BlockNumber) -> usize
Maximum number of uncles a block is allowed to declare.
fn maximum_uncle_age(&self) -> usize
[src]
fn maximum_uncle_age(&self) -> usize
The number of generations back that uncles can be.
fn populate_from_parent(&self, header: &mut Header, parent: &Header)
[src]
fn populate_from_parent(&self, header: &mut Header, parent: &Header)
Populate a header's fields based on its parent's header. Usually implements the chain scoring rule based on weight. Read more
fn seals_internally(&self) -> Option<bool>
[src]
fn seals_internally(&self) -> Option<bool>
Should this node participate.
fn generate_seal(&self, block: &ExecutedBlock, _parent: &Header) -> Seal
[src]
fn generate_seal(&self, block: &ExecutedBlock, _parent: &Header) -> Seal
Attempt to seal generate a proposal seal.
This operation is synchronous and may (quite reasonably) not be available, in which case
Seal::None
will be returned.
fn handle_message(&self, rlp: &[u8]) -> Result<(), EngineError>
[src]
fn handle_message(&self, rlp: &[u8]) -> Result<(), EngineError>
Handle any potential consensus messages; updating consensus state and potentially issuing a new one. Read more
fn on_new_block(
&self,
block: &mut ExecutedBlock,
epoch_begin: bool,
_ancestry: &mut Iterator<Item = ExtendedHeader>
) -> Result<(), Error>
[src]
fn on_new_block(
&self,
block: &mut ExecutedBlock,
epoch_begin: bool,
_ancestry: &mut Iterator<Item = ExtendedHeader>
) -> Result<(), Error>
Block transformation functions, before the transactions. epoch_begin
set to true if this block kicks off an epoch. Read more
fn on_close_block(&self, block: &mut ExecutedBlock) -> Result<(), Error>
[src]
fn on_close_block(&self, block: &mut ExecutedBlock) -> Result<(), Error>
Apply the block reward on finalisation of the block.
fn verify_local_seal(&self, _header: &Header) -> Result<(), Error>
[src]
fn verify_local_seal(&self, _header: &Header) -> Result<(), Error>
Verify a locally-generated seal of a header. Read more
fn verify_block_basic(&self, header: &Header) -> Result<(), Error>
[src]
fn verify_block_basic(&self, header: &Header) -> Result<(), Error>
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.
fn verify_block_external(&self, header: &Header) -> Result<(), Error>
[src]
fn verify_block_external(&self, header: &Header) -> Result<(), Error>
Phase 4 verification. Verify block header against potentially external data. Should only be called when register_client
has been called previously. Read more
fn signals_epoch_end(
&self,
header: &Header,
aux: AuxiliaryData
) -> EpochChange<EthereumMachine>
[src]
fn signals_epoch_end(
&self,
header: &Header,
aux: AuxiliaryData
) -> EpochChange<EthereumMachine>
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
fn is_epoch_end(
&self,
chain_head: &Header,
_chain: &Headers<Header>,
transition_store: &PendingTransitionStore
) -> Option<Vec<u8>>
[src]
fn is_epoch_end(
&self,
chain_head: &Header,
_chain: &Headers<Header>,
transition_store: &PendingTransitionStore
) -> Option<Vec<u8>>
Whether a block is the end of an epoch. Read more
fn epoch_verifier<'a>(
&self,
_header: &Header,
proof: &'a [u8]
) -> ConstructedVerifier<'a, EthereumMachine>
[src]
fn epoch_verifier<'a>(
&self,
_header: &Header,
proof: &'a [u8]
) -> ConstructedVerifier<'a, EthereumMachine>
Create an epoch verifier from validation proof and a flag indicating whether finality is required. Read more
fn set_signer(
&self,
ap: Arc<AccountProvider>,
address: Address,
password: String
)
[src]
fn set_signer(
&self,
ap: Arc<AccountProvider>,
address: Address,
password: String
)
Register an account which signs consensus messages.
fn sign(&self, hash: H256) -> Result<Signature, Error>
[src]
fn sign(&self, hash: H256) -> Result<Signature, Error>
Sign using the EngineSigner, to be used for consensus tx signing.
fn snapshot_components(&self) -> Option<Box<SnapshotComponents>>
[src]
fn snapshot_components(&self) -> Option<Box<SnapshotComponents>>
Create a factory for building snapshot chunks and restoring from them. Returning None
indicates that this engine doesn't support snapshot creation. Read more
fn stop(&self)
[src]
fn stop(&self)
Stops any services that the may hold the Engine and makes it safe to drop.
fn is_proposal(&self, header: &Header) -> bool
[src]
fn is_proposal(&self, header: &Header) -> bool
Find out if the block is a proposal block and should not be inserted into the DB. Takes a header of a fully verified block. Read more
fn step(&self)
[src]
fn step(&self)
Equivalent to a timeout: to be used for tests.
fn register_client(&self, client: Weak<EngineClient>)
[src]
fn register_client(&self, client: Weak<EngineClient>)
Add Client which can be used for sealing, potentially querying the state and sending messages.
fn fork_choice(
&self,
new: &ExtendedHeader,
current: &ExtendedHeader
) -> ForkChoice
[src]
fn fork_choice(
&self,
new: &ExtendedHeader,
current: &ExtendedHeader
) -> ForkChoice
Check whether the given new block is the best block, after finalization check.
fn extra_info(&self, _header: &M::Header) -> BTreeMap<String, String>
[src]
fn extra_info(&self, _header: &M::Header) -> BTreeMap<String, String>
Additional engine-specific information for the user/developer concerning header
.
fn verify_block_unordered(&self, _header: &M::Header) -> Result<(), M::Error>
[src]
fn verify_block_unordered(&self, _header: &M::Header) -> Result<(), M::Error>
Phase 2 verification. Perform costly checks such as transaction signatures. Returns either a null Ok
or a general error detailing the problem with import.
fn verify_block_family(
&self,
_header: &M::Header,
_parent: &M::Header
) -> Result<(), M::Error>
[src]
fn verify_block_family(
&self,
_header: &M::Header,
_parent: &M::Header
) -> Result<(), M::Error>
Phase 3 verification. Check block information against parent. Returns either a null Ok
or a general error detailing the problem with import.
fn genesis_epoch_data<'a>(
&self,
_header: &M::Header,
_state: &<M as Localized<'a>>::StateContext
) -> Result<Vec<u8>, String>
[src]
fn genesis_epoch_data<'a>(
&self,
_header: &M::Header,
_state: &<M as Localized<'a>>::StateContext
) -> Result<Vec<u8>, String>
Genesis epoch data.
fn supports_warp(&self) -> bool
[src]
fn supports_warp(&self) -> bool
Whether this engine supports warp sync.
fn open_block_header_timestamp(&self, parent_timestamp: u64) -> u64
[src]
fn open_block_header_timestamp(&self, parent_timestamp: u64) -> u64
Return a new open block header timestamp based on the parent timestamp.
fn is_timestamp_valid(
&self,
header_timestamp: u64,
parent_timestamp: u64
) -> bool
[src]
fn is_timestamp_valid(
&self,
header_timestamp: u64,
parent_timestamp: u64
) -> bool
Check whether the parent timestamp is valid.
fn ancestry_actions(
&self,
_block: &M::LiveBlock,
_ancestry: &mut Iterator<Item = M::ExtendedHeader>
) -> Vec<AncestryAction>
[src]
fn ancestry_actions(
&self,
_block: &M::LiveBlock,
_ancestry: &mut Iterator<Item = M::ExtendedHeader>
) -> Vec<AncestryAction>
Gather all ancestry actions. Called at the last stage when a block is committed. The Engine must guarantee that the ancestry exists. Read more
impl EpochVerifier<EthereumMachine> for Arc<Ethash>
[src]
impl EpochVerifier<EthereumMachine> for Arc<Ethash>
fn verify_light(&self, _header: &Header) -> Result<(), Error>
[src]
fn verify_light(&self, _header: &Header) -> Result<(), Error>
Lightly verify the next block header. This may not be a header belonging to a different epoch. Read more
fn verify_heavy(&self, header: &Header) -> Result<(), Error>
[src]
fn verify_heavy(&self, header: &Header) -> Result<(), Error>
Perform potentially heavier checks on the next block header.
fn check_finality_proof(&self, _proof: &[u8]) -> Option<Vec<H256>>
[src]
fn check_finality_proof(&self, _proof: &[u8]) -> Option<Vec<H256>>
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
impl Engine<EthereumMachine> for Arc<Ethash>
[src]
impl Engine<EthereumMachine> for Arc<Ethash>
fn name(&self) -> &str
[src]
fn name(&self) -> &str
The name of this engine.
fn machine(&self) -> &EthereumMachine
[src]
fn machine(&self) -> &EthereumMachine
Get access to the underlying state machine.
fn seal_fields(&self, _header: &Header) -> usize
[src]
fn seal_fields(&self, _header: &Header) -> usize
The number of additional header fields required for this engine.
fn extra_info(&self, header: &Header) -> BTreeMap<String, String>
[src]
fn extra_info(&self, header: &Header) -> BTreeMap<String, String>
Additional engine-specific information for the user/developer concerning header
.
fn maximum_uncle_count(&self, _block: BlockNumber) -> usize
[src]
fn maximum_uncle_count(&self, _block: BlockNumber) -> usize
Maximum number of uncles a block is allowed to declare.
fn populate_from_parent(&self, header: &mut Header, parent: &Header)
[src]
fn populate_from_parent(&self, header: &mut Header, parent: &Header)
Populate a header's fields based on its parent's header. Usually implements the chain scoring rule based on weight. Read more
fn on_close_block(&self, block: &mut ExecutedBlock) -> Result<(), Error>
[src]
fn on_close_block(&self, block: &mut ExecutedBlock) -> Result<(), Error>
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).
fn verify_local_seal(&self, header: &Header) -> Result<(), Error>
[src]
fn verify_local_seal(&self, header: &Header) -> Result<(), Error>
Verify a locally-generated seal of a header. Read more
fn verify_block_basic(&self, header: &Header) -> Result<(), Error>
[src]
fn verify_block_basic(&self, header: &Header) -> Result<(), Error>
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.
fn verify_block_unordered(&self, header: &Header) -> Result<(), Error>
[src]
fn verify_block_unordered(&self, header: &Header) -> Result<(), Error>
Phase 2 verification. Perform costly checks such as transaction signatures. Returns either a null Ok
or a general error detailing the problem with import.
fn verify_block_family(
&self,
header: &Header,
parent: &Header
) -> Result<(), Error>
[src]
fn verify_block_family(
&self,
header: &Header,
parent: &Header
) -> Result<(), Error>
Phase 3 verification. Check block information against parent. Returns either a null Ok
or a general error detailing the problem with import.
fn epoch_verifier<'a>(
&self,
_header: &Header,
_proof: &'a [u8]
) -> ConstructedVerifier<'a, EthereumMachine>
[src]
fn epoch_verifier<'a>(
&self,
_header: &Header,
_proof: &'a [u8]
) -> ConstructedVerifier<'a, EthereumMachine>
Create an epoch verifier from validation proof and a flag indicating whether finality is required. Read more
fn snapshot_components(&self) -> Option<Box<SnapshotComponents>>
[src]
fn snapshot_components(&self) -> Option<Box<SnapshotComponents>>
Create a factory for building snapshot chunks and restoring from them. Returning None
indicates that this engine doesn't support snapshot creation. Read more
fn fork_choice(
&self,
new: &ExtendedHeader,
current: &ExtendedHeader
) -> ForkChoice
[src]
fn fork_choice(
&self,
new: &ExtendedHeader,
current: &ExtendedHeader
) -> ForkChoice
Check whether the given new block is the best block, after finalization check.
fn maximum_uncle_age(&self) -> usize
[src]
fn maximum_uncle_age(&self) -> usize
The number of generations back that uncles can be.
fn on_new_block(
&self,
_block: &mut M::LiveBlock,
_epoch_begin: bool,
_ancestry: &mut Iterator<Item = M::ExtendedHeader>
) -> Result<(), M::Error>
[src]
fn on_new_block(
&self,
_block: &mut M::LiveBlock,
_epoch_begin: bool,
_ancestry: &mut Iterator<Item = M::ExtendedHeader>
) -> Result<(), M::Error>
Block transformation functions, before the transactions. epoch_begin
set to true if this block kicks off an epoch. Read more
fn seals_internally(&self) -> Option<bool>
[src]
fn seals_internally(&self) -> Option<bool>
None means that it requires external input (e.g. PoW) to seal a block. Some(true) means the engine is currently prime for seal generation (i.e. node is the current validator). Some(false) means that the node might seal internally but is not qualified now. Read more
fn generate_seal(&self, _block: &M::LiveBlock, _parent: &M::Header) -> Seal
[src]
fn generate_seal(&self, _block: &M::LiveBlock, _parent: &M::Header) -> Seal
Attempt to seal the block internally. Read more
fn verify_block_external(&self, _header: &M::Header) -> Result<(), M::Error>
[src]
fn verify_block_external(&self, _header: &M::Header) -> Result<(), M::Error>
Phase 4 verification. Verify block header against potentially external data. Should only be called when register_client
has been called previously. Read more
fn genesis_epoch_data<'a>(
&self,
_header: &M::Header,
_state: &<M as Localized<'a>>::StateContext
) -> Result<Vec<u8>, String>
[src]
fn genesis_epoch_data<'a>(
&self,
_header: &M::Header,
_state: &<M as Localized<'a>>::StateContext
) -> Result<Vec<u8>, String>
Genesis epoch data.
fn signals_epoch_end<'a>(
&self,
_header: &M::Header,
_aux: <M as Localized<'a>>::AuxiliaryData
) -> EpochChange<M>
[src]
fn signals_epoch_end<'a>(
&self,
_header: &M::Header,
_aux: <M as Localized<'a>>::AuxiliaryData
) -> EpochChange<M>
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
fn is_epoch_end(
&self,
_chain_head: &M::Header,
_chain: &Headers<M::Header>,
_transition_store: &PendingTransitionStore
) -> Option<Vec<u8>>
[src]
fn is_epoch_end(
&self,
_chain_head: &M::Header,
_chain: &Headers<M::Header>,
_transition_store: &PendingTransitionStore
) -> Option<Vec<u8>>
Whether a block is the end of an epoch. Read more
fn handle_message(&self, _message: &[u8]) -> Result<(), EngineError>
[src]
fn handle_message(&self, _message: &[u8]) -> Result<(), EngineError>
Handle any potential consensus messages; updating consensus state and potentially issuing a new one. Read more
fn is_proposal(&self, _verified_header: &M::Header) -> bool
[src]
fn is_proposal(&self, _verified_header: &M::Header) -> bool
Find out if the block is a proposal block and should not be inserted into the DB. Takes a header of a fully verified block. Read more
fn set_signer(
&self,
_account_provider: Arc<AccountProvider>,
_address: Address,
_password: String
)
[src]
fn set_signer(
&self,
_account_provider: Arc<AccountProvider>,
_address: Address,
_password: String
)
Register an account which signs consensus messages.
fn sign(&self, _hash: H256) -> Result<Signature, M::Error>
[src]
fn sign(&self, _hash: H256) -> Result<Signature, M::Error>
Sign using the EngineSigner, to be used for consensus tx signing.
fn register_client(&self, _client: Weak<M::EngineClient>)
[src]
fn register_client(&self, _client: Weak<M::EngineClient>)
Add Client which can be used for sealing, potentially querying the state and sending messages.
fn step(&self)
[src]
fn step(&self)
Trigger next step of the consensus engine.
fn stop(&self)
[src]
fn stop(&self)
Stops any services that the may hold the Engine and makes it safe to drop.
fn supports_warp(&self) -> bool
[src]
fn supports_warp(&self) -> bool
Whether this engine supports warp sync.
fn open_block_header_timestamp(&self, parent_timestamp: u64) -> u64
[src]
fn open_block_header_timestamp(&self, parent_timestamp: u64) -> u64
Return a new open block header timestamp based on the parent timestamp.
fn is_timestamp_valid(
&self,
header_timestamp: u64,
parent_timestamp: u64
) -> bool
[src]
fn is_timestamp_valid(
&self,
header_timestamp: u64,
parent_timestamp: u64
) -> bool
Check whether the parent timestamp is valid.
fn ancestry_actions(
&self,
_block: &M::LiveBlock,
_ancestry: &mut Iterator<Item = M::ExtendedHeader>
) -> Vec<AncestryAction>
[src]
fn ancestry_actions(
&self,
_block: &M::LiveBlock,
_ancestry: &mut Iterator<Item = M::ExtendedHeader>
) -> Vec<AncestryAction>
Gather all ancestry actions. Called at the last stage when a block is committed. The Engine must guarantee that the ancestry exists. Read more
impl Machine for EthereumMachine
[src]
impl Machine for EthereumMachine
type Header = Header
The block header type.
type ExtendedHeader = ExtendedHeader
Block header with metadata information.
type LiveBlock = ExecutedBlock
The live block type.
type EngineClient = EngineClient
A handle to a blockchain client for this machine.
type AuxiliaryRequest = AuxiliaryRequest
A description of needed auxiliary data.
type AncestryAction = AncestryAction
Actions taken on ancestry blocks when commiting a new block.
type Error = Error
Errors which can occur when querying or interacting with the machine.
impl<'a> LocalizedMachine<'a> for EthereumMachine
[src]
impl<'a> LocalizedMachine<'a> for EthereumMachine
type StateContext = Call<'a>
A context providing access to the state in a controlled capacity. Generally also provides verifiable proofs. Read more
type AuxiliaryData = AuxiliaryData<'a>
Definition of auxiliary data associated to a specific block.
impl WithBalances for EthereumMachine
[src]
impl WithBalances for EthereumMachine
fn balance(
&self,
live: &ExecutedBlock,
address: &Address
) -> Result<U256, Error>
[src]
fn balance(
&self,
live: &ExecutedBlock,
address: &Address
) -> Result<U256, Error>
Get the balance, in base units, associated with an account. Extracts data from the live block. Read more
fn add_balance(
&self,
live: &mut ExecutedBlock,
address: &Address,
amount: &U256
) -> Result<(), Error>
[src]
fn add_balance(
&self,
live: &mut ExecutedBlock,
address: &Address,
amount: &U256
) -> Result<(), Error>
Increment the balance of an account in the state of the live block.
impl WithRewards for EthereumMachine
[src]
impl WithRewards for EthereumMachine
fn note_rewards(
&self,
live: &mut Self::LiveBlock,
rewards: &[(Address, RewardType, U256)]
) -> Result<(), Self::Error>
[src]
fn note_rewards(
&self,
live: &mut Self::LiveBlock,
rewards: &[(Address, RewardType, U256)]
) -> Result<(), Self::Error>
Note block rewards, traces each reward storing information about benefactor, amount and type of reward. Read more
Auto Trait Implementations
impl Send for EthereumMachine
impl Send for EthereumMachine
impl Sync for EthereumMachine
impl Sync for EthereumMachine