cometbft_light_client_verifier/
options.rs

1//! Light client implementation as per the [Core Verification specification][1].
2//!
3//! [1]: https://github.com/cometbft/cometbft-rs/blob/main/docs/spec/lightclient/verification/verification.md
4
5use core::time::Duration;
6
7use derive_more::Display;
8use serde::{Deserialize, Serialize};
9
10use crate::types::TrustThreshold;
11
12/// Verification parameters
13#[derive(Copy, Clone, Debug, PartialEq, Eq, Display, Serialize, Deserialize)]
14#[display(fmt = "{self:?}")]
15pub struct Options {
16    /// Defines what fraction of the total voting power of a known
17    /// and trusted validator set is sufficient for a commit to be
18    /// accepted going forward.
19    pub trust_threshold: TrustThreshold,
20
21    /// How long a validator set is trusted for (must be shorter than the chain's
22    /// unbonding period)
23    pub trusting_period: Duration,
24
25    /// Correction parameter dealing with only approximately synchronized clocks.
26    /// The local clock should always be ahead of timestamps from the blockchain; this
27    /// is the maximum amount that the local clock may drift behind a timestamp from the
28    /// blockchain.
29    pub clock_drift: Duration,
30}