Struct Config

Source
#[non_exhaustive]
pub struct Config {
Show 40 fields pub runtime: RuntimeConfig, pub eip2_no_empty_contract: bool, pub eip2_create_transaction_increase: bool, pub eip1884_trie_repricing: bool, pub eip2200_sstore_gas_metering: bool, pub eip2200_sstore_revert_under_stipend: bool, pub eip2929_increase_state_access_gas: bool, pub eip3529_decrease_clears_refund: bool, pub eip3541_disallow_executable_format: bool, pub eip150_gas_increase: bool, pub eip150_no_err_on_call_with_more_gas: bool, pub eip150_call_l64_after_gas: bool, pub eip161_create_increase_nonce: bool, pub eip170_create_contract_limit: bool, pub eip3860_max_initcode_size: bool, pub eip7_delegate_call: bool, pub eip1014_create2: bool, pub eip140_revert: bool, pub eip160_exp_increase: bool, pub eip211_return_data: bool, pub eip214_static_call: bool, pub eip145_bitwise_shifting: bool, pub eip1344_chain_id: bool, pub eip1884_self_balance: bool, pub eip1052_ext_code_hash: bool, pub eip3198_base_fee: bool, pub eip3855_push0: bool, pub eip1153_transient_storage: bool, pub eip5656_mcopy: bool, pub eip1559_fee_market: bool, pub eip2028_transaction_calldata_decrease: bool, pub eip198_modexp_precompile: bool, pub eip196_ec_add_mul_precompile: bool, pub eip197_ec_pairing_precompile: bool, pub eip152_blake_2f_precompile: bool, pub eip1108_ec_add_mul_pairing_decrease: bool, pub eip2565_lower_modexp: bool, pub eip2930_access_list: bool, pub eip4844_shard_blob: bool, pub eip7516_blob_base_fee: bool,
}
Expand description

Runtime configuration.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§runtime: RuntimeConfig

Runtime config.

§eip2_no_empty_contract: bool

Disallow empty contract creation.

§eip2_create_transaction_increase: bool

Increase contract creation transaction cost.

§eip1884_trie_repricing: bool

EIP-1884: trie repricing.

§eip2200_sstore_gas_metering: bool

EIP-1283.

§eip2200_sstore_revert_under_stipend: bool

EIP-1706.

§eip2929_increase_state_access_gas: bool

EIP-2929

§eip3529_decrease_clears_refund: bool

EIP-3529

§eip3541_disallow_executable_format: bool

EIP-3541

§eip150_gas_increase: bool

Gas increases of EIP150.

§eip150_no_err_on_call_with_more_gas: bool

Whether to throw out of gas error when CALL/CALLCODE/DELEGATECALL requires more than maximum amount of gas.

§eip150_call_l64_after_gas: bool

Take l64 for callcreate after gas.

§eip161_create_increase_nonce: bool

Whether create transactions and create opcode increases nonce by one.

§eip170_create_contract_limit: bool

EIP170.

§eip3860_max_initcode_size: bool

EIP-3860, maximum size limit of init_code.

§eip7_delegate_call: bool

Has delegate call.

§eip1014_create2: bool

Has create2.

§eip140_revert: bool

Has revert.

§eip160_exp_increase: bool

EIP160.

§eip211_return_data: bool

Has return data.

§eip214_static_call: bool

Static call.

§eip145_bitwise_shifting: bool

Has bitwise shifting.

§eip1344_chain_id: bool

Has chain ID.

§eip1884_self_balance: bool

Has self balance.

§eip1052_ext_code_hash: bool

Has ext code hash.

§eip3198_base_fee: bool

Has ext block fee. See EIP-3198

§eip3855_push0: bool

Has PUSH0 opcode. See EIP-3855

§eip1153_transient_storage: bool

Enables transient storage. See EIP-1153

§eip5656_mcopy: bool

Enables MCOPY instruction. See EIP-5656

§eip1559_fee_market: bool

Uses EIP-1559 (Base fee is burned when this flag is enabled) EIP-1559

§eip2028_transaction_calldata_decrease: bool

Call data gas cost reduction.

§eip198_modexp_precompile: bool

EIP-198: Modexp precompile.

§eip196_ec_add_mul_precompile: bool

EIP-196: EC ADD/MUL precompile.

§eip197_ec_pairing_precompile: bool

EIP-197: EC Pairing precompile.

§eip152_blake_2f_precompile: bool

EIP-152: Blake2F precompile.

§eip1108_ec_add_mul_pairing_decrease: bool

EIP-1108: Reduce EC ADD/MUL/Pairing costs.

§eip2565_lower_modexp: bool

EIP-2565.

§eip2930_access_list: bool

EIP-2930: Optional access list.

§eip4844_shard_blob: bool

EIP-4844: Shard blob.

§eip7516_blob_base_fee: bool

EIP-7516: Blob base fee per gas.

Implementations§

Source§

impl Config

Source

pub const fn frontier() -> Config

Frontier hard fork configuration.

Source

pub const fn homestead() -> Config

Homestead

Source

pub const fn tangerine_whistle() -> Config

Tangerine whistle

Source

pub const fn spurious_dragon() -> Config

Spurious dragon

Source

pub const fn byzantium() -> Config

Byzantium

Source

pub const fn petersburg() -> Config

Petersburg

Source

pub const fn istanbul() -> Config

Istanbul hard fork configuration.

Source

pub const fn berlin() -> Config

Berlin

Source

pub const fn london() -> Config

London

Source

pub const fn shanghai() -> Config

Shanghai

Source

pub const fn cancun() -> Config

Cancun

Source

pub fn gas_ext_code(&self) -> u64

Gas paid for extcode.

Source

pub fn gas_ext_code_hash(&self) -> u64

Gas paid for extcodehash.

Source

pub fn gas_sstore_set(&self) -> u64

Gas paid for sstore set.

Source

pub fn gas_sstore_reset(&self) -> u64

Gas paid for sstore reset.

Source

pub fn refund_sstore_clears(&self) -> i64

Gas paid for sstore refund.

Source

pub fn max_refund_quotient(&self) -> u64

EIP-3529

Source

pub fn gas_balance(&self) -> u64

Gas paid for BALANCE opcode.

Source

pub fn gas_sload(&self) -> u64

Gas paid for SLOAD opcode.

Source

pub fn gas_sload_cold(&self) -> u64

Gas paid for cold SLOAD opcode.

Source

pub fn gas_suicide(&self) -> u64

Gas paid for SUICIDE opcode.

Source

pub fn gas_suicide_new_account(&self) -> u64

Gas paid for SUICIDE opcode when it hits a new account.

Source

pub fn gas_call(&self) -> u64

Gas paid for CALL opcode.

Source

pub fn gas_expbyte(&self) -> u64

Gas paid for EXP opcode for every byte.

Source

pub fn gas_transaction_create(&self) -> u64

Gas paid for a contract creation transaction.

Source

pub fn gas_transaction_call(&self) -> u64

Gas paid for a message call transaction.

Source

pub fn gas_transaction_zero_data(&self) -> u64

Gas paid for zero data in a transaction.

Source

pub fn gas_transaction_non_zero_data(&self) -> u64

Gas paid for non-zero data in a transaction.

Source

pub fn gas_access_list_address(&self) -> u64

Gas paid per address in transaction access list (see EIP-2930).

Source

pub fn gas_access_list_storage_key(&self) -> u64

Gas paid per storage key in transaction access list (see EIP-2930).

Source

pub fn gas_account_access_cold(&self) -> u64

Gas paid for accessing cold account.

Source

pub fn gas_storage_read_warm(&self) -> u64

Gas paid for accessing ready storage.

Source

pub fn stack_limit(&self) -> usize

Stack limit.

Source

pub fn memory_limit(&self) -> usize

Memory limit.

Source

pub fn call_stack_limit(&self) -> usize

Call stack limit.

Source

pub fn call_stipend(&self) -> u64

Call stipend.

Source

pub fn max_initcode_size(&self) -> Option<usize>

Maximum size limit of init code.

Source

pub fn create_contract_limit(&self) -> Option<usize>

Create contract limit.

Trait Implementations§

Source§

impl<'config> AsRef<Config> for State<'config>

Source§

fn as_ref(&self) -> &Config

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Clone for Config

Source§

fn clone(&self) -> Config

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Config

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Config

§

impl RefUnwindSafe for Config

§

impl Send for Config

§

impl Sync for Config

§

impl Unpin for Config

§

impl UnwindSafe for Config

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> TrapConsume<T> for T

Source§

type Rest = Infallible

Rest type.
Source§

fn consume(self) -> Result<T, Infallible>

Consume T to get Rest.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V