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: StringA 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: boolWhether inactive chains are allowed in storage.
allow_messages_from_deprecated_epochs: boolWhether new messages from deprecated epochs are allowed.
long_lived_services: boolWhether the user application services should be long-lived.
block_time_grace_period: DurationBlocks 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: usizeThe size to truncate receive log entries in chain info responses.
block_cache_size: usizeMaximum number of entries in the block cache.
execution_state_cache_size: usizeMaximum 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: usizeMaximum 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: boolWhether 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
impl ChainWorkerConfig
Sourcepub fn with_key_pair(self, key_pair: Option<ValidatorSecretKey>) -> Self
pub fn with_key_pair(self, key_pair: Option<ValidatorSecretKey>) -> Self
Configures the key_pair in this ChainWorkerConfig.
Sourcepub fn key_pair(&self) -> Option<&ValidatorSecretKey>
pub fn key_pair(&self) -> Option<&ValidatorSecretKey>
Gets a reference to the ValidatorSecretKey, if available.
Trait Implementations§
Source§impl Clone for ChainWorkerConfig
impl Clone for ChainWorkerConfig
Source§fn clone(&self) -> ChainWorkerConfig
fn clone(&self) -> ChainWorkerConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for ChainWorkerConfig
impl RefUnwindSafe for ChainWorkerConfig
impl Send for ChainWorkerConfig
impl Sync for ChainWorkerConfig
impl Unpin for ChainWorkerConfig
impl UnsafeUnpin for ChainWorkerConfig
impl UnwindSafe for ChainWorkerConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Choices> CoproductSubsetter<CNil, HNil> for Choices
impl<Choices> CoproductSubsetter<CNil, HNil> for Choices
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::RequestSource§impl<M, I> RuntimeMemory<&mut I> for Mwhere
M: RuntimeMemory<I>,
impl<M, I> RuntimeMemory<&mut I> for Mwhere
M: RuntimeMemory<I>,
Source§fn read<'instance>(
&self,
instance: &'instance &mut I,
location: GuestPointer,
length: u32,
) -> Result<Cow<'instance, [u8]>, RuntimeError>
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>
fn write( &mut self, instance: &mut &mut I, location: GuestPointer, bytes: &[u8], ) -> Result<(), RuntimeError>
Writes the bytes to memory at the provided location.