1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
use core::time::Duration;
use ibc_relayer_types::core::ics24_host::identifier::ChainId;
use penumbra_sdk_custody::soft_kms;
use serde_derive::{Deserialize, Serialize};
use tendermint_rpc::Url;
use crate::config::{
compat_mode::CompatMode, default, types::TrustThreshold, EventSourceMode, GenesisRestart,
PacketFilter, RefreshRate,
};
#[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
#[serde(deny_unknown_fields)]
pub struct PenumbraConfig {
/// A fake key name, not used except to satisfy external interfaces.
///
/// The Config::key_name() method returns &String, forcing configs to own a String.
/// We don't want to just change the method, because we want our fork to apply cleanly
/// onto upstream, so we need to
/// 1. use a stub field (here)
/// 2. create a separate PR to change the method signature
/// 3. rebase our change stack once it's merged and remove the stub field.
#[serde(default)]
pub stub_key_name: String,
pub id: ChainId,
/// The URL of the app's gRPC endpoint.
pub grpc_addr: Url,
/// The URL of the cometbft RPC endpoint.
///
/// TODO: in the long term, it would be desirable to eliminate this entirely.
pub rpc_addr: Url,
/// The type of event source and associated settings
pub event_source: EventSourceMode,
/// Timeout used when issuing RPC queries
#[serde(default = "default::rpc_timeout", with = "humantime_serde")]
pub rpc_timeout: Duration,
/// Controls which packets will be relayed.
#[serde(default)]
pub packet_filter: PacketFilter,
pub clear_interval: Option<u64>,
/// How many packets to fetch at once from the chain when clearing packets
#[serde(default = "default::query_packets_chunk_size")]
pub query_packets_chunk_size: usize,
#[serde(default = "default::max_block_time", with = "humantime_serde")]
pub max_block_time: Duration,
// This field is only meant to be set via the `update client` command,
// for when we need to upgrade a client across a genesis restart and
// therefore need and archive node to fetch blocks from.
pub genesis_restart: Option<GenesisRestart>,
/// A correction parameter that helps deal with clocks that are only approximately synchronized
/// between the source and destination chains for a client.
/// This parameter is used when deciding to accept or reject a new header
/// (originating from the source chain) for any client with the destination chain
/// that uses this configuration, unless it is overridden by the client-specific
/// clock drift option.
#[serde(default = "default::clock_drift", with = "humantime_serde")]
pub clock_drift: Duration,
/// The rate at which to refresh the client referencing this chain,
/// expressed as a fraction of the trusting period.
#[serde(default = "default::client_refresh_rate")]
pub client_refresh_rate: RefreshRate,
/// The trust threshold defines what fraction of the total voting power of a known
/// and trusted validator set is sufficient for a commit to be accepted going forward.
#[serde(default)]
pub trust_threshold: TrustThreshold,
pub compat_mode: Option<CompatMode>,
/// The storage location for the penumbra view service, which tracks private state of the
/// relayer's penumbra account.
pub view_service_storage_dir: Option<String>,
// These last few need to be last otherwise we run into `ValueAfterTable` error when serializing to TOML
/// Key configuration
///
/// This is used instead of the Hermes keyring, which doesn't yet handle
/// Penumbra-specific key concerns. In the future, we may want to merge
/// this with the Hermes keyring, but it's a low-priority item.
pub kms_config: soft_kms::Config,
}