revm_context_interface/
cfg.rs

1use auto_impl::auto_impl;
2use core::fmt::Debug;
3use core::hash::Hash;
4use primitives::{TxKind, U256};
5use specification::hardfork::SpecId;
6
7#[auto_impl(&, &mut, Box, Arc)]
8pub trait Cfg {
9    type Spec: Into<SpecId> + Clone;
10
11    fn chain_id(&self) -> u64;
12
13    // Specification id that is set.
14    fn spec(&self) -> Self::Spec;
15
16    /// Returns the blob target and max count for the given spec id.
17    ///
18    /// EIP-7840: Add blob schedule to execution client configuration files
19    fn blob_max_count(&self, spec_id: SpecId) -> u8;
20
21    fn max_code_size(&self) -> usize;
22
23    fn is_eip3607_disabled(&self) -> bool;
24
25    fn is_balance_check_disabled(&self) -> bool;
26
27    fn is_gas_refund_disabled(&self) -> bool;
28
29    fn is_block_gas_limit_disabled(&self) -> bool;
30
31    fn is_nonce_check_disabled(&self) -> bool;
32
33    fn is_base_fee_check_disabled(&self) -> bool;
34}
35
36/// What bytecode analysis to perform
37#[derive(Clone, Default, Debug, Eq, PartialEq, Hash)]
38#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
39pub enum AnalysisKind {
40    /// Do not perform bytecode analysis
41    Raw,
42    /// Perform bytecode analysis
43    #[default]
44    Analyse,
45}
46
47/// Transaction destination
48pub type TransactTo = TxKind;
49
50/// Create scheme
51#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
52#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
53pub enum CreateScheme {
54    /// Legacy create scheme of `CREATE`
55    Create,
56    /// Create scheme of `CREATE2`
57    Create2 {
58        /// Salt
59        salt: U256,
60    },
61}