pub trait EthEngine: Engine<EthereumMachine> {
Show 15 methods
fn params(&self) -> &CommonParams { ... }
fn schedule(&self, block_number: BlockNumber) -> Schedule { ... }
fn builtins(&self) -> &BTreeMap<Address, Builtin> { ... }
fn builtin(
&self,
a: &Address,
block_number: BlockNumber
) -> Option<&Builtin> { ... }
fn maximum_extra_data_size(&self) -> usize { ... }
fn account_start_nonce(&self, block: BlockNumber) -> U256 { ... }
fn signing_chain_id(&self, env_info: &EnvInfo) -> Option<u64> { ... }
fn create_address_scheme(
&self,
number: BlockNumber
) -> CreateContractAddress { ... }
fn verify_transaction_unordered(
&self,
t: UnverifiedTransaction,
header: &Header
) -> Result<SignedTransaction, Error> { ... }
fn verify_transaction_basic(
&self,
t: &UnverifiedTransaction,
header: &Header
) -> Result<(), Error> { ... }
fn additional_params(&self) -> HashMap<String, String> { ... }
fn decode_transaction(
&self,
transaction: &[u8],
best_block_number: BlockNumber
) -> Result<UnverifiedTransaction, Error> { ... }
fn calculate_base_fee(&self, parent: &Header) -> Option<U256> { ... }
fn min_gas_limit(&self) -> U256 { ... }
fn allow_non_eoa_sender(&self, best_block_number: BlockNumber) -> bool { ... }
}
Expand description
Common type alias for an engine coupled with an Ethereum-like state machine.
Provided methods
fn params(&self) -> &CommonParams
fn params(&self) -> &CommonParams
Get the general parameters of the chain.
fn schedule(&self, block_number: BlockNumber) -> Schedule
fn schedule(&self, block_number: BlockNumber) -> Schedule
Get the EVM schedule for the given block number.
Attempt to get a handle to a built-in contract. Only returns references to activated built-ins.
fn maximum_extra_data_size(&self) -> usize
fn maximum_extra_data_size(&self) -> usize
Some intrinsic operation parameters; by default they take their value from the spec()
’s engine_params
.
fn account_start_nonce(&self, block: BlockNumber) -> U256
fn account_start_nonce(&self, block: BlockNumber) -> U256
The nonce with which accounts begin at given block.
fn signing_chain_id(&self, env_info: &EnvInfo) -> Option<u64>
fn signing_chain_id(&self, env_info: &EnvInfo) -> Option<u64>
The network ID that transactions should be signed with.
fn create_address_scheme(&self, number: BlockNumber) -> CreateContractAddress
fn create_address_scheme(&self, number: BlockNumber) -> CreateContractAddress
Returns new contract address generation scheme at given block number.
fn verify_transaction_unordered(
&self,
t: UnverifiedTransaction,
header: &Header
) -> Result<SignedTransaction, Error>
fn verify_transaction_unordered(
&self,
t: UnverifiedTransaction,
header: &Header
) -> Result<SignedTransaction, Error>
Unordered verification doesn’t rely on the transaction execution order, i.e. it should only verify stuff that doesn’t assume any previous transactions has already been verified and executed.
NOTE This function consumes an UnverifiedTransaction
and produces SignedTransaction
which implies that a heavy check of the signature is performed here.
fn verify_transaction_basic(
&self,
t: &UnverifiedTransaction,
header: &Header
) -> Result<(), Error>
fn verify_transaction_basic(
&self,
t: &UnverifiedTransaction,
header: &Header
) -> Result<(), Error>
Perform basic/cheap transaction verification.
This should include all cheap checks that can be done before actually checking the signature, like chain-replay protection.
NOTE This is done before the signature is recovered so avoid doing any state-touching checks that might be expensive.
TODO: Add flags for which bits of the transaction to check. TODO: consider including State in the params.
fn additional_params(&self) -> HashMap<String, String>
fn additional_params(&self) -> HashMap<String, String>
Additional information.
fn decode_transaction(
&self,
transaction: &[u8],
best_block_number: BlockNumber
) -> Result<UnverifiedTransaction, Error>
fn decode_transaction(
&self,
transaction: &[u8],
best_block_number: BlockNumber
) -> Result<UnverifiedTransaction, Error>
Performs pre-validation of RLP decoded transaction before other processing
fn calculate_base_fee(&self, parent: &Header) -> Option<U256>
fn calculate_base_fee(&self, parent: &Header) -> Option<U256>
Calculates base fee for the block that should be mined next. This base fee is calculated based on the parent header (last block in blockchain / best block).
Introduced by EIP1559 to support new market fee mechanism.
fn min_gas_limit(&self) -> U256
fn min_gas_limit(&self) -> U256
The configured minimum gas limit. Used by AuRa Engine.
fn allow_non_eoa_sender(&self, best_block_number: BlockNumber) -> bool
fn allow_non_eoa_sender(&self, best_block_number: BlockNumber) -> bool
Returns whether transactions from non externally owned accounts (EOA) are allowed in the given block number (see EIP-3607).
That is only possible if EIP-3607 is still not activated.