op_alloy_genesis::chain

Struct ChainConfig

Source
pub struct ChainConfig {
Show 22 fields pub name: String, pub chain_id: u64, pub l1_chain_id: u64, pub public_rpc: String, pub sequencer_rpc: String, pub explorer: String, pub superchain_level: SuperchainLevel, pub standard_chain_candidate: bool, pub superchain_time: Option<u64>, pub batch_inbox_addr: Address, pub superchain: String, pub chain: String, pub hardfork_configuration: HardForkConfiguration, pub block_time: u64, pub seq_window_size: u64, pub max_sequencer_drift: u64, pub data_availability_type: String, pub optimism: Option<OpBaseFeeParams>, pub alt_da: Option<AltDAConfig>, pub genesis: ChainGenesis, pub addresses: Option<AddressList>, pub gas_paying_token: Option<Address>,
}
Expand description

Defines core blockchain settings per block.

Tailors unique settings for each network based on its genesis block and superchain configuration.

This struct bridges the interface between the ChainConfig defined in the superchain-registry and the ChainConfig defined in op-geth.

Fields§

§name: String

Chain name (e.g. “Base”)

§chain_id: u64

Chain ID

§l1_chain_id: u64

L1 chain ID

§public_rpc: String

Chain public RPC endpoint

§sequencer_rpc: String

Chain sequencer RPC endpoint

§explorer: String

Chain explorer HTTP endpoint

§superchain_level: SuperchainLevel

Level of integration with the superchain.

§standard_chain_candidate: bool

Toggles standard chain validation checks on for this chain, even if it is a frontier chain.

§superchain_time: Option<u64>

Time of when a given chain is opted in to the Superchain. If set, hardforks times after the superchain time will be inherited from the superchain-wide config.

§batch_inbox_addr: Address

Chain-specific batch inbox address

§superchain: String

Superchain is a simple string to identify the superchain. This is implied by directory structure, and not encoded in the config file itself.

§chain: String

Chain is a simple string to identify the chain, within its superchain context. This matches the resource filename, it is not encoded in the config file itself.

§hardfork_configuration: HardForkConfiguration

Hardfork Configuration. These values may override the superchain-wide defaults.

§block_time: u64

The block time in seconds.

§seq_window_size: u64

The sequencer window size in seconds.

§max_sequencer_drift: u64

The maximum sequencer drift in seconds.

§data_availability_type: String

Data availability type.

§optimism: Option<OpBaseFeeParams>

Optimism configuration

§alt_da: Option<AltDAConfig>

Alternative DA configuration

§genesis: ChainGenesis

Chain-specific genesis information

§addresses: Option<AddressList>

Addresses

§gas_paying_token: Option<Address>

Gas paying token metadata. Not consumed by downstream OPStack components.

Implementations§

Source§

impl ChainConfig

Source

pub fn set_missing_fork_configs(&mut self, defaults: &HardForkConfiguration)

Set missing hardfork configurations to the defaults, if the chain has a superchain_time set. Defaults are only used if the chain’s hardfork activated after the superchain_time.

Source

pub fn load_op_stack_rollup_config(&self) -> RollupConfig

Loads the rollup config for the OP-Stack chain given the chain config and address list.

Trait Implementations§

Source§

impl Clone for ChainConfig

Source§

fn clone(&self) -> ChainConfig

Returns a copy 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 ChainConfig

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for ChainConfig

Source§

fn default() -> ChainConfig

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for ChainConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for ChainConfig

Source§

fn eq(&self, other: &ChainConfig) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for ChainConfig

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for ChainConfig

Source§

impl StructuralPartialEq for ChainConfig

Auto Trait Implementations§

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, dst: *mut T)

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

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. 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, 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<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,