Struct ChainConfig

Source
pub struct ChainConfig {
Show 21 fields pub name: String, pub l1_chain_id: u64, pub public_rpc: String, pub sequencer_rpc: String, pub explorer: String, pub superchain_level: SuperchainLevel, pub governed_by_optimism: bool, pub superchain_time: Option<u64>, pub data_availability_type: String, pub chain_id: u64, pub batch_inbox_addr: Address, pub block_time: u64, pub seq_window_size: u64, pub max_sequencer_drift: u64, pub gas_paying_token: Option<Address>, pub hardfork_config: HardForkConfig, pub optimism: Option<BaseFeeConfig>, pub alt_da: Option<AltDAConfig>, pub genesis: ChainGenesis, pub roles: Option<Roles>, pub addresses: Option<AddressList>,
}
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”)

§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.

§governed_by_optimism: bool

Whether the chain is governed by optimism.

§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.

§data_availability_type: String

Data availability type.

§chain_id: u64

Chain ID

§batch_inbox_addr: Address

Chain-specific batch inbox address

§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.

§gas_paying_token: Option<Address>

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

§hardfork_config: HardForkConfig

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

§optimism: Option<BaseFeeConfig>

Optimism configuration

§alt_da: Option<AltDAConfig>

Alternative DA configuration

§genesis: ChainGenesis

Chain-specific genesis information

§roles: Option<Roles>

Roles

§addresses: Option<AddressList>

Addresses

Implementations§

Source§

impl ChainConfig

Source

pub fn base_fee_params(&self) -> BaseFeeParams

Returns the base fee params for the chain.

Source

pub fn canyon_base_fee_params(&self) -> BaseFeeParams

Returns the canyon base fee params for the chain.

Source

pub fn base_fee_config(&self) -> BaseFeeConfig

Returns the base fee config for the chain.

Source

pub fn load_op_stack_rollup_config(&self) -> RollupConfig

👎Deprecated since 0.2.1: please use as_rollup_config instead

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

Source

pub fn as_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 duplicate of the value. Read more
1.0.0 · Source§

const 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<(), Error>

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<ChainConfig, <__D as Deserializer<'de>>::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§

const 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 as Serializer>::Ok, <__S as Serializer>::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, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
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> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,