Skip to main content

ChainWorkerConfig

Struct ChainWorkerConfig 

Source
pub struct ChainWorkerConfig {
Show 17 fields pub nickname: String, pub key_pair: Option<Arc<ValidatorSecretKey>>, pub allow_inactive_chains: bool, pub allow_messages_from_deprecated_epochs: bool, pub long_lived_services: bool, pub block_time_grace_period: Duration, pub ttl: Option<Duration>, pub sender_chain_ttl: Option<Duration>, pub chain_info_max_received_log_entries: usize, pub block_cache_size: usize, pub execution_state_cache_size: usize, pub priority_bundle_origins: HashSet<ChainId>, pub ignored_bundle_origins: HashSet<ChainId>, pub cross_chain_message_chunk_limit: usize, pub allow_revert_confirm: bool, pub reset_on_corrupted_chain_state: Option<Duration>, pub recovery_whitelist: Option<HashSet<ChainId>>,
}
Expand description

Configuration parameters for the chain worker and its owning WorkerState.

Fields§

§nickname: String

A name used for logging.

§key_pair: Option<Arc<ValidatorSecretKey>>

The signature key pair of the validator. The key may be missing for replicas without voting rights (possibly with a partial view of chains).

§allow_inactive_chains: bool

Whether inactive chains are allowed in storage.

§allow_messages_from_deprecated_epochs: bool

Whether new messages from deprecated epochs are allowed.

§long_lived_services: bool

Whether the user application services should be long-lived.

§block_time_grace_period: Duration

Blocks with a timestamp this far in the future will still be accepted, but the validator will wait until that timestamp before voting.

§ttl: Option<Duration>

Idle chain workers free their memory after this duration without requests. None means no expiry (handle lives forever).

§sender_chain_ttl: Option<Duration>

TTL for sender chains. None means no expiry.

§chain_info_max_received_log_entries: usize

The size to truncate receive log entries in chain info responses.

§block_cache_size: usize

Maximum number of entries in the block cache.

§execution_state_cache_size: usize

Maximum number of entries in the execution state cache.

§priority_bundle_origins: HashSet<ChainId>

Chain IDs whose incoming bundles should be processed first.

§ignored_bundle_origins: HashSet<ChainId>

Chain IDs whose incoming bundles should be ignored.

§cross_chain_message_chunk_limit: usize

Maximum estimated serialized size of bundles in a single UpdateRecipient cross-chain message. When exceeded, the bundles are split into multiple requests. Defaults to usize::MAX (no chunking).

§allow_revert_confirm: bool

Whether to attempt recovery via RevertConfirm when an inbox gap is detected.

§reset_on_corrupted_chain_state: Option<Duration>

If set, reset the chain state and re-execute all blocks when the chain state is detected to be corrupted — but only if the given duration has elapsed since block 0 was last executed (to prevent reset loops).

§recovery_whitelist: Option<HashSet<ChainId>>

Optional whitelist restricting which chains are eligible for the allow_revert_confirm and reset_on_corrupted_chain_state recovery mechanisms. If None, every chain is eligible (subject to the respective feature flag). If Some, only chains in the set are.

Implementations§

Source§

impl ChainWorkerConfig

Source

pub fn with_key_pair(self, key_pair: Option<ValidatorSecretKey>) -> Self

Configures the key_pair in this ChainWorkerConfig.

Source

pub fn key_pair(&self) -> Option<&ValidatorSecretKey>

Gets a reference to the ValidatorSecretKey, if available.

Trait Implementations§

Source§

impl Clone for ChainWorkerConfig

Source§

fn clone(&self) -> ChainWorkerConfig

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 Default for ChainWorkerConfig

Source§

fn default() -> Self

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

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<Choices> CoproductSubsetter<CNil, HNil> for Choices

Source§

type Remainder = Choices

Source§

fn subset( self, ) -> Result<CNil, <Choices as CoproductSubsetter<CNil, HNil>>::Remainder>

Extract a subset of the possible types in a coproduct (or get the remaining possibilities) Read more
Source§

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

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<To, From> DynInto<To> for From
where From: Into<To>,

Source§

fn into_box(self: Box<From>) -> To

Converts a boxed object into the target type.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FutureExt for T

Source§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
Source§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
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> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<L> LayerExt<L> for L

Source§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in Layered.
Source§

impl<T, U, I> LiftInto<U, I> for T
where U: LiftFrom<T, I>,

Source§

fn lift_into(self) -> U

Performs the indexed conversion.
Source§

impl<M, I> RuntimeMemory<&mut I> for M
where M: RuntimeMemory<I>,

Source§

fn read<'instance>( &self, instance: &'instance &mut I, location: GuestPointer, length: u32, ) -> Result<Cow<'instance, [u8]>, RuntimeError>

Reads length bytes from memory from the provided location.

Source§

fn write( &mut self, instance: &mut &mut I, location: GuestPointer, bytes: &[u8], ) -> Result<(), RuntimeError>

Writes the bytes to memory at the provided location.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<Source> Sculptor<HNil, HNil> for Source

Source§

type Remainder = Source

Source§

fn sculpt(self) -> (HNil, <Source as Sculptor<HNil, HNil>>::Remainder)

Consumes the current HList and returns an HList with the requested shape. Read more
Source§

impl<AnyTail> Split<HNil> for AnyTail

Source§

type Remainder = AnyTail

The tail of remaining elements after splitting up the list.
Source§

fn split(self) -> (HNil, <AnyTail as Split<HNil>>::Remainder)

Splits the current heterogeneous list in two.
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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

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<_INNER> AutoTraits for _INNER
where _INNER: Send + Sync + 'static,

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSend for T
where T: Send,

Source§

impl<T> Post for T
where T: Send + 'static,