MockCosmosChain {
pub fn setup_client(&mut self, client_chain_id: &ChainId) -> ClientId {
let client_counter = self.ibc_ctx().client_counter().unwrap();
- let client_id = sov_client_type().build_client_id(client_counter);
+ let client_id = sov_celestia_client_type().build_client_id(client_counter);
let current_height = self.ibc_ctx().host_height().unwrap();
diff --git a/mocks/src/relayer/builder.rs b/mocks/src/relayer/builder.rs
index e9564b00..11058f70 100644
--- a/mocks/src/relayer/builder.rs
+++ b/mocks/src/relayer/builder.rs
@@ -1,7 +1,7 @@
use ibc_client_tendermint::types::client_type as tm_client_type;
use ibc_core::host::types::identifiers::Sequence;
use ibc_core::host::ValidationContext;
-use sov_celestia_client::types::client_state::sov_client_type;
+use sov_celestia_client::types::client_state::sov_celestia_client_type;
#[cfg(all(feature = "celestia-da", not(feature = "mock-da")))]
use sov_consensus_state_tracker::CelestiaService;
use sov_consensus_state_tracker::HasConsensusState;
@@ -101,17 +101,14 @@ where
self.setup_cfg.da_service.clone(),
);
- rollup.init(
- &self.setup_cfg.kernel_genesis_config(),
- &self.setup_cfg.runtime_genesis_config(),
- );
+ rollup.init(&self.setup_cfg);
let sov_client_counter = match rollup.query(QueryReq::ClientCounter).await {
QueryResp::ClientCounter(counter) => counter,
_ => panic!("Unexpected response"),
};
- let sov_client_id = sov_client_type().build_client_id(sov_client_counter);
+ let sov_client_id = sov_celestia_client_type().build_client_id(sov_client_counter);
let mut cos_chain = CosmosBuilder::default().build();
diff --git a/mocks/src/sovereign/rollup.rs b/mocks/src/sovereign/rollup.rs
index bf202612..33c3d35a 100644
--- a/mocks/src/sovereign/rollup.rs
+++ b/mocks/src/sovereign/rollup.rs
@@ -116,32 +116,31 @@ where
pub fn obtain_ibc_header(&self, target_height: Height, trusted_height: Height) -> SovTmHeader {
let blocks = self.da_core.blocks();
- let revision_height = target_height.revision_height();
+ let target_revision_height = target_height.revision_height();
- if revision_height as usize > blocks.len() {
+ let height_offset = self.da_core.height() - target_revision_height;
+
+ let da_height = target_revision_height + height_offset;
+
+ if da_height as usize > blocks.len() {
panic!("block index out of bounds");
}
- let target_block = blocks[revision_height as usize - 1].clone();
+ let target_block = blocks[da_height as usize - 1].clone();
let header = Header {
signed_header: target_block.signed_header,
validator_set: target_block.validators,
- trusted_height,
+ trusted_height: trusted_height.add(height_offset),
trusted_next_validator_set: target_block.next_validators,
};
- let target_state_root = match self.state_root(revision_height - 1) {
+ let target_state_root = match self.state_root(target_revision_height - 1) {
Some(root) => root.user_hash(),
None => panic!("state root not found"),
};
- dummy_sov_header(
- header,
- Height::new(0, 1).unwrap(),
- Height::new(0, revision_height).unwrap(),
- target_state_root.into(),
- )
+ dummy_sov_header(header, 1, target_revision_height, target_state_root.into())
}
/// Returns the balance of a user for a given token
diff --git a/mocks/src/sovereign/runner.rs b/mocks/src/sovereign/runner.rs
index d26cde6a..0bf6c123 100644
--- a/mocks/src/sovereign/runner.rs
+++ b/mocks/src/sovereign/runner.rs
@@ -2,7 +2,6 @@
use std::time::Duration;
use sov_consensus_state_tracker::HasConsensusState;
-use sov_kernels::basic::BasicKernelGenesisConfig;
use sov_modules_api::runtime::capabilities::{Kernel, KernelSlotHooks};
use sov_modules_api::{
CallResponse, DispatchCall, Gas, GasMeter, Genesis, KernelWorkingSet, SlotData, Spec,
@@ -15,7 +14,8 @@ use sov_state::{MerkleProofSpec, ProverStorage, Storage};
use tokio::task::JoinHandle;
use tracing::{debug, info};
-use super::{GenesisConfig, MockRollup};
+use super::MockRollup;
+use crate::configs::TestSetupConfig;
use crate::utils::{wait_for_block, MutexUtil};
impl MockRollup
@@ -27,23 +27,22 @@ where
::Hasher: Send,
{
/// Initializes the chain with the genesis configuration
- pub fn init(
- &mut self,
- kernel_genesis_config: &BasicKernelGenesisConfig,
- runtime_genesis_config: &GenesisConfig,
- ) {
+ pub fn init(&mut self, setup_cfg: &TestSetupConfig) {
+ self.da_core
+ .advance_da_block_up_to(setup_cfg.genesis_da_height);
+
let mut checkpoint = StateCheckpoint::new(self.prover_storage());
let mut kernel_working_set = KernelWorkingSet::uninitialized(&mut checkpoint);
self.kernel()
- .genesis(kernel_genesis_config, &mut kernel_working_set)
+ .genesis(&setup_cfg.kernel_genesis_config(), &mut kernel_working_set)
.unwrap();
let mut working_set = checkpoint.to_revertable(Default::default());
self.runtime()
- .genesis(runtime_genesis_config, &mut working_set)
+ .genesis(&setup_cfg.runtime_genesis_config(), &mut working_set)
.unwrap();
self.commit(working_set.checkpoint().0);
diff --git a/modules/sov-consensus-state-tracker/src/celestia_da.rs b/modules/sov-consensus-state-tracker/src/celestia_da.rs
index 760e559c..895ee11c 100644
--- a/modules/sov-consensus-state-tracker/src/celestia_da.rs
+++ b/modules/sov-consensus-state-tracker/src/celestia_da.rs
@@ -12,18 +12,21 @@ use crate::HasConsensusState;
impl HasConsensusState for CelestiaSpec {
fn consensus_state(header: &CelestiaHeader) -> HostConsensusState {
- let timestamp = tendermint::Time::from_unix_timestamp(
- header.time().secs(),
- header.time().subsec_nanos(),
- )
- .expect("Could not obtain timestamp from header");
+ let sovereign_params = CommitmentRoot::from_bytes(header.hash().as_ref()).into();
- let next_validator_hash = tendermint::Hash::decode_vec(&header.header.next_validators_hash)
- .expect("Could not decode next validator hash from header");
+ let da_params = TmConsensusParams::new(
+ tendermint::Time::from_unix_timestamp(
+ header.time().secs(),
+ header.time().subsec_nanos(),
+ )
+ .expect("Could not obtain timestamp from header"),
+ tendermint::Hash::decode_vec(&header.header.next_validators_hash)
+ .expect("Could not decode next validator hash from header"),
+ );
SovConsensusState {
- root: CommitmentRoot::from_bytes(header.hash().as_ref()),
- da_params: TmConsensusParams::new(timestamp, next_validator_hash),
+ sovereign_params,
+ da_params,
}
.into()
}
diff --git a/modules/sov-consensus-state-tracker/src/mock_da.rs b/modules/sov-consensus-state-tracker/src/mock_da.rs
index 8e7113c5..61af1b5f 100644
--- a/modules/sov-consensus-state-tracker/src/mock_da.rs
+++ b/modules/sov-consensus-state-tracker/src/mock_da.rs
@@ -12,19 +12,23 @@ use crate::HasConsensusState;
impl HasConsensusState for MockDaSpec {
fn consensus_state(header: &Self::BlockHeader) -> HostConsensusState {
+ let sovereign_params = CommitmentRoot::from_bytes(header.hash().as_ref()).into();
+
+ let da_params = TmConsensusParams::new(
+ tendermint::Time::from_unix_timestamp(
+ header.time().secs(),
+ header.time().subsec_nanos(),
+ )
+ .expect("time is valid"),
+ tendermint::Hash::from_str(
+ "D6B93922C33AAEBEC9043566CB4B1B48365B1358B67C7DEF986D9EE1861BC143",
+ )
+ .expect("Never fails"),
+ );
+
SovConsensusState {
- root: CommitmentRoot::from_bytes(header.hash().as_ref()),
- da_params: TmConsensusParams::new(
- tendermint::Time::from_unix_timestamp(
- header.time().secs(),
- header.time().subsec_nanos(),
- )
- .expect("time is valid"),
- tendermint::Hash::from_str(
- "D6B93922C33AAEBEC9043566CB4B1B48365B1358B67C7DEF986D9EE1861BC143",
- )
- .expect("Never fails"),
- ),
+ sovereign_params,
+ da_params,
}
.into()
}
diff --git a/proto/definitions/ibc/lightclients/sovereign/tendermint/v1/sov_tendermint.proto b/proto/definitions/ibc/lightclients/sovereign/tendermint/v1/tendermint.proto
similarity index 58%
rename from proto/definitions/ibc/lightclients/sovereign/tendermint/v1/sov_tendermint.proto
rename to proto/definitions/ibc/lightclients/sovereign/tendermint/v1/tendermint.proto
index eed36ebe..2adc5e7f 100644
--- a/proto/definitions/ibc/lightclients/sovereign/tendermint/v1/sov_tendermint.proto
+++ b/proto/definitions/ibc/lightclients/sovereign/tendermint/v1/tendermint.proto
@@ -5,8 +5,7 @@ package ibc.lightclients.sovereign.tendermint.v1;
import "gogoproto/gogo.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/timestamp.proto";
-import "ibc/core/client/v1/client.proto";
-import "ibc/core/commitment/v1/commitment.proto";
+import "ibc/lightclients/sovereign/v1/sovereign.proto";
import "ibc/lightclients/tendermint/v1/tendermint.proto";
import "sovereign/types/v1/types.proto";
@@ -15,37 +14,20 @@ import "sovereign/types/v1/types.proto";
message ClientState {
option (gogoproto.goproto_getters) = false;
- // the genesis state root of the rollup
- bytes genesis_state_root = 1 [(gogoproto.moretags) = "yaml:\"genesis_state_root\""];
- // the code commitment of the aggregated proof circuit
- .sovereign.types.v1.CodeCommitment code_commitment = 2 [
+ // the Sovereign-specific client state parameters
+ .ibc.lightclients.sovereign.v1.SovereignClientParams sovereign_params = 1 [
(gogoproto.nullable) = false,
- (gogoproto.moretags) = "yaml:\"code_commitment\""
+ (gogoproto.moretags) = "yaml:\"sovereign_params\""
];
- // the latest height the client was updated to
- ibc.core.client.v1.Height latest_height = 3 [
- (gogoproto.nullable) = false,
- (gogoproto.moretags) = "yaml:\"latest_height\""
- ];
- // the height when the client was frozen due to a misbehaviour
- ibc.core.client.v1.Height frozen_height = 4 [
- (gogoproto.nullable) = false,
- (gogoproto.moretags) = "yaml:\"frozen_height\""
- ];
- // the path at which next upgraded client will be committed. Each element
- // corresponds to the key for a single CommitmentProof in the chained proof.
- // NOTE: ClientState must stored under
- // `{upgradePath}/{upgradeHeight}/clientState` ConsensusState must be stored
- // under `{upgradepath}/{upgradeHeight}/consensusState`
- string upgrade_path = 5 [(gogoproto.moretags) = "yaml:\"upgrade_path\""];
// the tendermint-specific client state parameters
- TendermintClientParams tendermint_params = 6 [
+ TendermintClientParams tendermint_params = 2 [
(gogoproto.nullable) = false,
(gogoproto.moretags) = "yaml:\"tendermint_params\""
];
}
-// TendermintClientParams contains the data necessary to verify Tendermint headers
+// TendermintClientParams contains the data necessary to verify Tendermint
+// headers
message TendermintClientParams {
// the identifier of the chain hosting the Tendermint consensus
string chain_id = 1;
@@ -54,21 +36,14 @@ message TendermintClientParams {
(gogoproto.nullable) = false,
(gogoproto.moretags) = "yaml:\"trust_level\""
];
- // the duration of the period since the LastestTimestamp during which the
- // submitted headers are valid for upgrade
- google.protobuf.Duration trusting_period = 3 [
- (gogoproto.nullable) = false,
- (gogoproto.stdduration) = true,
- (gogoproto.moretags) = "yaml:\"trusting_period\""
- ];
// the duration of the staking unbonding period
- google.protobuf.Duration unbonding_period = 4 [
+ google.protobuf.Duration unbonding_period = 3 [
(gogoproto.nullable) = false,
(gogoproto.stdduration) = true,
(gogoproto.moretags) = "yaml:\"unbonding_period\""
];
// the duration of new (untrusted) header's Time can drift into the future.
- google.protobuf.Duration max_clock_drift = 5 [
+ google.protobuf.Duration max_clock_drift = 4 [
(gogoproto.nullable) = false,
(gogoproto.stdduration) = true,
(gogoproto.moretags) = "yaml:\"max_clock_drift\""
@@ -80,8 +55,11 @@ message TendermintClientParams {
message ConsensusState {
option (gogoproto.goproto_getters) = false;
- // the state root of rollup at the ConsensusState height
- ibc.core.commitment.v1.MerkleRoot root = 1 [(gogoproto.nullable) = false];
+ // the Sovereign-specific consensus state parameters
+ .ibc.lightclients.sovereign.v1.SovereignConsensusParams sovereign_params = 1 [
+ (gogoproto.nullable) = false,
+ (gogoproto.moretags) = "yaml:\"sovereign_params\""
+ ];
// the tendermint-specific consensus state parameters
TendermintConsensusParams tendermint_params = 2 [
(gogoproto.nullable) = false,
@@ -106,30 +84,31 @@ message TendermintConsensusParams {
}
// Header defines the structure of the header for the Sovereign SDK light
-// clients operating on a Tendermint-based Data Availability layer.
-// It encapsulates all the information necessary to update client from a trusted
+// clients operating on the Tendermint-based Data Availability layer. It
+// encapsulates all the information necessary to update client from a trusted
// rollup ConsensusState.
-// The TrustedHeight is the height of a stored ConsensusState on the client that
-// will be used to verify the new untrusted header. The Trusted ConsensusState
-// must be within the unbonding period of current time in order to correctly
-// verify, and the TrustedValidators must hash to
-// TrustedConsensusState.NextValidatorsHash since that is the last trusted
-// validator set at the TrustedHeight.
+
+// The `trusted_height` under the `tendermint_header` is the height of a stored
+// `ConsensusState` on the client that will be used to verify the new untrusted
+// header. The trusted `ConsensusState` must be within the unbonding period of
+// current time in order to correctly verify, and the `trusted_validators` must
+// hash to the `next_validators_hash` of trusted `ConsensusState` since that is
+// the last trusted validator set at the `trusted_height`.
message Header {
// the Tendermint header
ibc.lightclients.tendermint.v1.Header tendermint_header = 1 [
(gogoproto.nullable) = false,
(gogoproto.moretags) = "yaml:\"tendermint_header\""
];
- // the rollup aggregated proof data
+ // the Sovereign SDK rollup aggregated proof data
.sovereign.types.v1.AggregatedProof aggregated_proof = 2 [
(gogoproto.nullable) = false,
(gogoproto.moretags) = "yaml:\"aggregated_proof\""
];
}
-// Misbehaviour defines the misbehaviour for the Sovereign SDK
-// rollups with Tendermint-based Data Availability layer.
+// Misbehaviour defines the misbehaviour for the Sovereign SDK rollups operating
+// on the Tendermint-based Data Availability layer.
message Misbehaviour {
option (gogoproto.goproto_getters) = false;
diff --git a/proto/definitions/ibc/lightclients/sovereign/v1/sovereign.proto b/proto/definitions/ibc/lightclients/sovereign/v1/sovereign.proto
new file mode 100644
index 00000000..74ba5d71
--- /dev/null
+++ b/proto/definitions/ibc/lightclients/sovereign/v1/sovereign.proto
@@ -0,0 +1,61 @@
+syntax = "proto3";
+
+package ibc.lightclients.sovereign.v1;
+
+import "gogoproto/gogo.proto";
+import "google/protobuf/duration.proto";
+import "ibc/core/client/v1/client.proto";
+import "ibc/core/commitment/v1/commitment.proto";
+import "sovereign/types/v1/types.proto";
+
+// SovereignClientParams structure encompasses the essential parameters shared
+// among all Sovereign light clients, regardless of the underlying Data
+// Availability (DA) layer, to track the client state of the rollup.
+message SovereignClientParams {
+ option (gogoproto.goproto_getters) = false;
+
+ // the genesis state root of the rollup
+ bytes genesis_state_root = 1 [(gogoproto.moretags) = "yaml:\"genesis_state_root\""];
+ // the genesis DA height from which the rollup started
+ ibc.core.client.v1.Height genesis_da_height = 2 [
+ (gogoproto.nullable) = false,
+ (gogoproto.moretags) = "yaml:\"genesis_da_height\""
+ ];
+ // the code commitment of the aggregated proof circuit
+ .sovereign.types.v1.CodeCommitment code_commitment = 3 [
+ (gogoproto.nullable) = false,
+ (gogoproto.moretags) = "yaml:\"code_commitment\""
+ ];
+ // the duration of the period since the latest DA Timestamp during which the
+ // submitted headers are valid for upgrade
+ google.protobuf.Duration trusting_period = 4 [
+ (gogoproto.nullable) = false,
+ (gogoproto.stdduration) = true,
+ (gogoproto.moretags) = "yaml:\"trusting_period\""
+ ];
+ // the frozen height when the client was frozen due to the misbehaviour
+ ibc.core.client.v1.Height frozen_height = 6 [
+ (gogoproto.nullable) = false,
+ (gogoproto.moretags) = "yaml:\"frozen_height\""
+ ];
+ // the latest height (slot number) the client was updated to
+ ibc.core.client.v1.Height latest_height = 5 [
+ (gogoproto.nullable) = false,
+ (gogoproto.moretags) = "yaml:\"latest_height\""
+ ];
+ // the path at which next upgraded client will be committed. Each element
+ // corresponds to the key for a single CommitmentProof in the chained proof.
+ // NOTE: ClientState must stored under
+ // `{upgradePath}/{upgradeHeight}/clientState` ConsensusState must be stored
+ // under `{upgradepath}/{upgradeHeight}/consensusState`
+ string upgrade_path = 7 [(gogoproto.moretags) = "yaml:\"upgrade_path\""];
+}
+
+// SovereignConsensusParams structure encompasses the essential parameters
+// shared among all Sovereign light clients, regardless of the underlying Data
+// Availability (DA) layer, to track the consensus state of the rollup.
+message SovereignConsensusParams {
+ option (gogoproto.goproto_getters) = false;
+ // the state root of rollup at the ConsensusState height
+ ibc.core.commitment.v1.MerkleRoot root = 1 [(gogoproto.nullable) = false];
+}
diff --git a/proto/definitions/sovereign/types/v1/types.proto b/proto/definitions/sovereign/types/v1/types.proto
index 25b6c26b..9c57bedf 100644
--- a/proto/definitions/sovereign/types/v1/types.proto
+++ b/proto/definitions/sovereign/types/v1/types.proto
@@ -24,10 +24,16 @@ message AggregatedProofPublicData {
];
// the initial slot number of the rollup from which the proof captures the
// rollup's transition from the initial state root.
- uint64 initial_slot_number = 2;
+ SlotNumber initial_slot_number = 2 [
+ (gogoproto.nullable) = false,
+ (gogoproto.moretags) = "yaml:\"initial_slot_number\""
+ ];
// the final slot number of the rollup, up to which the proof captures the
// rollup's transition to the final state root.
- uint64 final_slot_number = 3;
+ SlotNumber final_slot_number = 3 [
+ (gogoproto.nullable) = false,
+ (gogoproto.moretags) = "yaml:\"final_slot_number\""
+ ];
// the genesis state root
bytes genesis_state_root = 4;
// the initial state root
@@ -59,6 +65,13 @@ message SerializedValidityCondition {
bytes validity_condition = 1;
}
+// SlotNumber defines the slot number of rollups which is the height in the
+// Sovereign SDK system
+message SlotNumber {
+ // the slot number (rollup height)
+ uint64 slot_number = 1;
+}
+
// CodeCommitment defines the code commitment of the aggregated proof circuit
message CodeCommitment {
// the code commitment
diff --git a/proto/src/lib.rs b/proto/src/lib.rs
index bb78b60f..7234dd1e 100644
--- a/proto/src/lib.rs
+++ b/proto/src/lib.rs
@@ -21,6 +21,11 @@ macro_rules! include_proto {
pub mod ibc {
pub mod lightclients {
pub mod sovereign {
+ pub mod v1 {
+ include_proto!("ibc.lightclients.sovereign.v1.rs");
+ #[cfg(feature = "serde")]
+ include_proto!("ibc.lightclients.sovereign.v1.serde.rs");
+ }
pub mod tendermint {
pub mod v1 {
include_proto!("ibc.lightclients.sovereign.tendermint.v1.rs");
diff --git a/proto/src/prost/ibc.lightclients.sovereign.tendermint.v1.rs b/proto/src/prost/ibc.lightclients.sovereign.tendermint.v1.rs
index 12e2e6ee..825cd122 100644
--- a/proto/src/prost/ibc.lightclients.sovereign.tendermint.v1.rs
+++ b/proto/src/prost/ibc.lightclients.sovereign.tendermint.v1.rs
@@ -1,47 +1,30 @@
+// This file is @generated by prost-build.
/// ClientState defines the client state for the Sovereign SDK rollups operating
/// on a Tendermint-based Data Availability layer.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ClientState {
- /// the genesis state root of the rollup
- #[prost(bytes = "vec", tag = "1")]
- pub genesis_state_root: ::prost::alloc::vec::Vec,
- /// the code commitment of the aggregated proof circuit
- #[prost(message, optional, tag = "2")]
- pub code_commitment: ::core::option::Option<
- super::super::super::super::super::sovereign::types::v1::CodeCommitment,
- >,
- /// the latest height the client was updated to
- #[prost(message, optional, tag = "3")]
- pub latest_height: ::core::option::Option<
- ::ibc_proto::ibc::core::client::v1::Height,
- >,
- /// the height when the client was frozen due to a misbehaviour
- #[prost(message, optional, tag = "4")]
- pub frozen_height: ::core::option::Option<
- ::ibc_proto::ibc::core::client::v1::Height,
+ /// the Sovereign-specific client state parameters
+ #[prost(message, optional, tag = "1")]
+ pub sovereign_params: ::core::option::Option<
+ super::super::v1::SovereignClientParams,
>,
- /// the path at which next upgraded client will be committed. Each element
- /// corresponds to the key for a single CommitmentProof in the chained proof.
- /// NOTE: ClientState must stored under
- /// `{upgradePath}/{upgradeHeight}/clientState` ConsensusState must be stored
- /// under `{upgradepath}/{upgradeHeight}/consensusState`
- #[prost(string, tag = "5")]
- pub upgrade_path: ::prost::alloc::string::String,
/// the tendermint-specific client state parameters
- #[prost(message, optional, tag = "6")]
+ #[prost(message, optional, tag = "2")]
pub tendermint_params: ::core::option::Option,
}
impl ::prost::Name for ClientState {
const NAME: &'static str = "ClientState";
const PACKAGE: &'static str = "ibc.lightclients.sovereign.tendermint.v1";
fn full_name() -> ::prost::alloc::string::String {
- ::prost::alloc::format!(
- "ibc.lightclients.sovereign.tendermint.v1.{}", Self::NAME
- )
+ "ibc.lightclients.sovereign.tendermint.v1.ClientState".into()
+ }
+ fn type_url() -> ::prost::alloc::string::String {
+ "/ibc.lightclients.sovereign.tendermint.v1.ClientState".into()
}
}
-/// TendermintClientParams contains the data necessary to verify Tendermint headers
+/// TendermintClientParams contains the data necessary to verify Tendermint
+/// headers
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TendermintClientParams {
@@ -53,26 +36,23 @@ pub struct TendermintClientParams {
pub trust_level: ::core::option::Option<
::ibc_proto::ibc::lightclients::tendermint::v1::Fraction,
>,
- /// the duration of the period since the LastestTimestamp during which the
- /// submitted headers are valid for upgrade
- #[prost(message, optional, tag = "3")]
- pub trusting_period: ::core::option::Option<::ibc_proto::google::protobuf::Duration>,
/// the duration of the staking unbonding period
- #[prost(message, optional, tag = "4")]
+ #[prost(message, optional, tag = "3")]
pub unbonding_period: ::core::option::Option<
::ibc_proto::google::protobuf::Duration,
>,
/// the duration of new (untrusted) header's Time can drift into the future.
- #[prost(message, optional, tag = "5")]
+ #[prost(message, optional, tag = "4")]
pub max_clock_drift: ::core::option::Option<::ibc_proto::google::protobuf::Duration>,
}
impl ::prost::Name for TendermintClientParams {
const NAME: &'static str = "TendermintClientParams";
const PACKAGE: &'static str = "ibc.lightclients.sovereign.tendermint.v1";
fn full_name() -> ::prost::alloc::string::String {
- ::prost::alloc::format!(
- "ibc.lightclients.sovereign.tendermint.v1.{}", Self::NAME
- )
+ "ibc.lightclients.sovereign.tendermint.v1.TendermintClientParams".into()
+ }
+ fn type_url() -> ::prost::alloc::string::String {
+ "/ibc.lightclients.sovereign.tendermint.v1.TendermintClientParams".into()
}
}
/// ConsensusState defines the consensus state for the Sovereign SDK rollups
@@ -80,9 +60,11 @@ impl ::prost::Name for TendermintClientParams {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ConsensusState {
- /// the state root of rollup at the ConsensusState height
+ /// the Sovereign-specific consensus state parameters
#[prost(message, optional, tag = "1")]
- pub root: ::core::option::Option<::ibc_proto::ibc::core::commitment::v1::MerkleRoot>,
+ pub sovereign_params: ::core::option::Option<
+ super::super::v1::SovereignConsensusParams,
+ >,
/// the tendermint-specific consensus state parameters
#[prost(message, optional, tag = "2")]
pub tendermint_params: ::core::option::Option,
@@ -91,9 +73,10 @@ impl ::prost::Name for ConsensusState {
const NAME: &'static str = "ConsensusState";
const PACKAGE: &'static str = "ibc.lightclients.sovereign.tendermint.v1";
fn full_name() -> ::prost::alloc::string::String {
- ::prost::alloc::format!(
- "ibc.lightclients.sovereign.tendermint.v1.{}", Self::NAME
- )
+ "ibc.lightclients.sovereign.tendermint.v1.ConsensusState".into()
+ }
+ fn type_url() -> ::prost::alloc::string::String {
+ "/ibc.lightclients.sovereign.tendermint.v1.ConsensusState".into()
}
}
/// TendermintConsensusParams contains the necessary consensus state parameters
@@ -113,21 +96,18 @@ impl ::prost::Name for TendermintConsensusParams {
const NAME: &'static str = "TendermintConsensusParams";
const PACKAGE: &'static str = "ibc.lightclients.sovereign.tendermint.v1";
fn full_name() -> ::prost::alloc::string::String {
- ::prost::alloc::format!(
- "ibc.lightclients.sovereign.tendermint.v1.{}", Self::NAME
- )
+ "ibc.lightclients.sovereign.tendermint.v1.TendermintConsensusParams".into()
+ }
+ fn type_url() -> ::prost::alloc::string::String {
+ "/ibc.lightclients.sovereign.tendermint.v1.TendermintConsensusParams".into()
}
}
-/// Header defines the structure of the header for the Sovereign SDK light
-/// clients operating on a Tendermint-based Data Availability layer.
-/// It encapsulates all the information necessary to update client from a trusted
-/// rollup ConsensusState.
-/// The TrustedHeight is the height of a stored ConsensusState on the client that
-/// will be used to verify the new untrusted header. The Trusted ConsensusState
-/// must be within the unbonding period of current time in order to correctly
-/// verify, and the TrustedValidators must hash to
-/// TrustedConsensusState.NextValidatorsHash since that is the last trusted
-/// validator set at the TrustedHeight.
+/// The `trusted_height` under the `tendermint_header` is the height of a stored
+/// `ConsensusState` on the client that will be used to verify the new untrusted
+/// header. The trusted `ConsensusState` must be within the unbonding period of
+/// current time in order to correctly verify, and the `trusted_validators` must
+/// hash to the `next_validators_hash` of trusted `ConsensusState` since that is
+/// the last trusted validator set at the `trusted_height`.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Header {
@@ -136,7 +116,7 @@ pub struct Header {
pub tendermint_header: ::core::option::Option<
::ibc_proto::ibc::lightclients::tendermint::v1::Header,
>,
- /// the rollup aggregated proof data
+ /// the Sovereign SDK rollup aggregated proof data
#[prost(message, optional, tag = "2")]
pub aggregated_proof: ::core::option::Option<
super::super::super::super::super::sovereign::types::v1::AggregatedProof,
@@ -146,13 +126,14 @@ impl ::prost::Name for Header {
const NAME: &'static str = "Header";
const PACKAGE: &'static str = "ibc.lightclients.sovereign.tendermint.v1";
fn full_name() -> ::prost::alloc::string::String {
- ::prost::alloc::format!(
- "ibc.lightclients.sovereign.tendermint.v1.{}", Self::NAME
- )
+ "ibc.lightclients.sovereign.tendermint.v1.Header".into()
+ }
+ fn type_url() -> ::prost::alloc::string::String {
+ "/ibc.lightclients.sovereign.tendermint.v1.Header".into()
}
}
-/// Misbehaviour defines the misbehaviour for the Sovereign SDK
-/// rollups with Tendermint-based Data Availability layer.
+/// Misbehaviour defines the misbehaviour for the Sovereign SDK rollups operating
+/// on the Tendermint-based Data Availability layer.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Misbehaviour {
@@ -170,8 +151,9 @@ impl ::prost::Name for Misbehaviour {
const NAME: &'static str = "Misbehaviour";
const PACKAGE: &'static str = "ibc.lightclients.sovereign.tendermint.v1";
fn full_name() -> ::prost::alloc::string::String {
- ::prost::alloc::format!(
- "ibc.lightclients.sovereign.tendermint.v1.{}", Self::NAME
- )
+ "ibc.lightclients.sovereign.tendermint.v1.Misbehaviour".into()
+ }
+ fn type_url() -> ::prost::alloc::string::String {
+ "/ibc.lightclients.sovereign.tendermint.v1.Misbehaviour".into()
}
}
diff --git a/proto/src/prost/ibc.lightclients.sovereign.tendermint.v1.serde.rs b/proto/src/prost/ibc.lightclients.sovereign.tendermint.v1.serde.rs
index ccebe7fa..779b6e97 100644
--- a/proto/src/prost/ibc.lightclients.sovereign.tendermint.v1.serde.rs
+++ b/proto/src/prost/ibc.lightclients.sovereign.tendermint.v1.serde.rs
@@ -12,34 +12,9 @@ impl serde::Serialize for ClientState {
if true {
len += 1;
}
- if true {
- len += 1;
- }
- if true {
- len += 1;
- }
- if true {
- len += 1;
- }
- if true {
- len += 1;
- }
let mut struct_ser = serializer.serialize_struct("ibc.lightclients.sovereign.tendermint.v1.ClientState", len)?;
- if true {
- #[allow(clippy::needless_borrow)]
- struct_ser.serialize_field("genesisStateRoot", pbjson::private::base64::encode(&self.genesis_state_root).as_str())?;
- }
- if let Some(v) = self.code_commitment.as_ref() {
- struct_ser.serialize_field("codeCommitment", v)?;
- }
- if let Some(v) = self.latest_height.as_ref() {
- struct_ser.serialize_field("latestHeight", v)?;
- }
- if let Some(v) = self.frozen_height.as_ref() {
- struct_ser.serialize_field("frozenHeight", v)?;
- }
- if true {
- struct_ser.serialize_field("upgradePath", &self.upgrade_path)?;
+ if let Some(v) = self.sovereign_params.as_ref() {
+ struct_ser.serialize_field("sovereignParams", v)?;
}
if let Some(v) = self.tendermint_params.as_ref() {
struct_ser.serialize_field("tendermintParams", v)?;
@@ -54,27 +29,15 @@ impl<'de> serde::Deserialize<'de> for ClientState {
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
- "genesis_state_root",
- "genesisStateRoot",
- "code_commitment",
- "codeCommitment",
- "latest_height",
- "latestHeight",
- "frozen_height",
- "frozenHeight",
- "upgrade_path",
- "upgradePath",
+ "sovereign_params",
+ "sovereignParams",
"tendermint_params",
"tendermintParams",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
- GenesisStateRoot,
- CodeCommitment,
- LatestHeight,
- FrozenHeight,
- UpgradePath,
+ SovereignParams,
TendermintParams,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
@@ -97,11 +60,7 @@ impl<'de> serde::Deserialize<'de> for ClientState {
E: serde::de::Error,
{
match value {
- "genesisStateRoot" | "genesis_state_root" => Ok(GeneratedField::GenesisStateRoot),
- "codeCommitment" | "code_commitment" => Ok(GeneratedField::CodeCommitment),
- "latestHeight" | "latest_height" => Ok(GeneratedField::LatestHeight),
- "frozenHeight" | "frozen_height" => Ok(GeneratedField::FrozenHeight),
- "upgradePath" | "upgrade_path" => Ok(GeneratedField::UpgradePath),
+ "sovereignParams" | "sovereign_params" => Ok(GeneratedField::SovereignParams),
"tendermintParams" | "tendermint_params" => Ok(GeneratedField::TendermintParams),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
@@ -122,45 +81,15 @@ impl<'de> serde::Deserialize<'de> for ClientState {
where
V: serde::de::MapAccess<'de>,
{
- let mut genesis_state_root__ = None;
- let mut code_commitment__ = None;
- let mut latest_height__ = None;
- let mut frozen_height__ = None;
- let mut upgrade_path__ = None;
+ let mut sovereign_params__ = None;
let mut tendermint_params__ = None;
while let Some(k) = map_.next_key()? {
match k {
- GeneratedField::GenesisStateRoot => {
- if genesis_state_root__.is_some() {
- return Err(serde::de::Error::duplicate_field("genesisStateRoot"));
- }
- genesis_state_root__ =
- Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0)
- ;
- }
- GeneratedField::CodeCommitment => {
- if code_commitment__.is_some() {
- return Err(serde::de::Error::duplicate_field("codeCommitment"));
- }
- code_commitment__ = map_.next_value()?;
- }
- GeneratedField::LatestHeight => {
- if latest_height__.is_some() {
- return Err(serde::de::Error::duplicate_field("latestHeight"));
- }
- latest_height__ = map_.next_value()?;
- }
- GeneratedField::FrozenHeight => {
- if frozen_height__.is_some() {
- return Err(serde::de::Error::duplicate_field("frozenHeight"));
+ GeneratedField::SovereignParams => {
+ if sovereign_params__.is_some() {
+ return Err(serde::de::Error::duplicate_field("sovereignParams"));
}
- frozen_height__ = map_.next_value()?;
- }
- GeneratedField::UpgradePath => {
- if upgrade_path__.is_some() {
- return Err(serde::de::Error::duplicate_field("upgradePath"));
- }
- upgrade_path__ = Some(map_.next_value()?);
+ sovereign_params__ = map_.next_value()?;
}
GeneratedField::TendermintParams => {
if tendermint_params__.is_some() {
@@ -171,11 +100,7 @@ impl<'de> serde::Deserialize<'de> for ClientState {
}
}
Ok(ClientState {
- genesis_state_root: genesis_state_root__.unwrap_or_default(),
- code_commitment: code_commitment__,
- latest_height: latest_height__,
- frozen_height: frozen_height__,
- upgrade_path: upgrade_path__.unwrap_or_default(),
+ sovereign_params: sovereign_params__,
tendermint_params: tendermint_params__,
})
}
@@ -198,8 +123,8 @@ impl serde::Serialize for ConsensusState {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("ibc.lightclients.sovereign.tendermint.v1.ConsensusState", len)?;
- if let Some(v) = self.root.as_ref() {
- struct_ser.serialize_field("root", v)?;
+ if let Some(v) = self.sovereign_params.as_ref() {
+ struct_ser.serialize_field("sovereignParams", v)?;
}
if let Some(v) = self.tendermint_params.as_ref() {
struct_ser.serialize_field("tendermintParams", v)?;
@@ -214,14 +139,15 @@ impl<'de> serde::Deserialize<'de> for ConsensusState {
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
- "root",
+ "sovereign_params",
+ "sovereignParams",
"tendermint_params",
"tendermintParams",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
- Root,
+ SovereignParams,
TendermintParams,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
@@ -244,7 +170,7 @@ impl<'de> serde::Deserialize<'de> for ConsensusState {
E: serde::de::Error,
{
match value {
- "root" => Ok(GeneratedField::Root),
+ "sovereignParams" | "sovereign_params" => Ok(GeneratedField::SovereignParams),
"tendermintParams" | "tendermint_params" => Ok(GeneratedField::TendermintParams),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
@@ -265,15 +191,15 @@ impl<'de> serde::Deserialize<'de> for ConsensusState {
where
V: serde::de::MapAccess<'de>,
{
- let mut root__ = None;
+ let mut sovereign_params__ = None;
let mut tendermint_params__ = None;
while let Some(k) = map_.next_key()? {
match k {
- GeneratedField::Root => {
- if root__.is_some() {
- return Err(serde::de::Error::duplicate_field("root"));
+ GeneratedField::SovereignParams => {
+ if sovereign_params__.is_some() {
+ return Err(serde::de::Error::duplicate_field("sovereignParams"));
}
- root__ = map_.next_value()?;
+ sovereign_params__ = map_.next_value()?;
}
GeneratedField::TendermintParams => {
if tendermint_params__.is_some() {
@@ -284,7 +210,7 @@ impl<'de> serde::Deserialize<'de> for ConsensusState {
}
}
Ok(ConsensusState {
- root: root__,
+ sovereign_params: sovereign_params__,
tendermint_params: tendermint_params__,
})
}
@@ -550,9 +476,6 @@ impl serde::Serialize for TendermintClientParams {
if true {
len += 1;
}
- if true {
- len += 1;
- }
let mut struct_ser = serializer.serialize_struct("ibc.lightclients.sovereign.tendermint.v1.TendermintClientParams", len)?;
if true {
struct_ser.serialize_field("chainId", &self.chain_id)?;
@@ -560,9 +483,6 @@ impl serde::Serialize for TendermintClientParams {
if let Some(v) = self.trust_level.as_ref() {
struct_ser.serialize_field("trustLevel", v)?;
}
- if let Some(v) = self.trusting_period.as_ref() {
- struct_ser.serialize_field("trustingPeriod", v)?;
- }
if let Some(v) = self.unbonding_period.as_ref() {
struct_ser.serialize_field("unbondingPeriod", v)?;
}
@@ -583,8 +503,6 @@ impl<'de> serde::Deserialize<'de> for TendermintClientParams {
"chainId",
"trust_level",
"trustLevel",
- "trusting_period",
- "trustingPeriod",
"unbonding_period",
"unbondingPeriod",
"max_clock_drift",
@@ -595,7 +513,6 @@ impl<'de> serde::Deserialize<'de> for TendermintClientParams {
enum GeneratedField {
ChainId,
TrustLevel,
- TrustingPeriod,
UnbondingPeriod,
MaxClockDrift,
}
@@ -621,7 +538,6 @@ impl<'de> serde::Deserialize<'de> for TendermintClientParams {
match value {
"chainId" | "chain_id" => Ok(GeneratedField::ChainId),
"trustLevel" | "trust_level" => Ok(GeneratedField::TrustLevel),
- "trustingPeriod" | "trusting_period" => Ok(GeneratedField::TrustingPeriod),
"unbondingPeriod" | "unbonding_period" => Ok(GeneratedField::UnbondingPeriod),
"maxClockDrift" | "max_clock_drift" => Ok(GeneratedField::MaxClockDrift),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
@@ -645,7 +561,6 @@ impl<'de> serde::Deserialize<'de> for TendermintClientParams {
{
let mut chain_id__ = None;
let mut trust_level__ = None;
- let mut trusting_period__ = None;
let mut unbonding_period__ = None;
let mut max_clock_drift__ = None;
while let Some(k) = map_.next_key()? {
@@ -662,12 +577,6 @@ impl<'de> serde::Deserialize<'de> for TendermintClientParams {
}
trust_level__ = map_.next_value()?;
}
- GeneratedField::TrustingPeriod => {
- if trusting_period__.is_some() {
- return Err(serde::de::Error::duplicate_field("trustingPeriod"));
- }
- trusting_period__ = map_.next_value()?;
- }
GeneratedField::UnbondingPeriod => {
if unbonding_period__.is_some() {
return Err(serde::de::Error::duplicate_field("unbondingPeriod"));
@@ -685,7 +594,6 @@ impl<'de> serde::Deserialize<'de> for TendermintClientParams {
Ok(TendermintClientParams {
chain_id: chain_id__.unwrap_or_default(),
trust_level: trust_level__,
- trusting_period: trusting_period__,
unbonding_period: unbonding_period__,
max_clock_drift: max_clock_drift__,
})
diff --git a/proto/src/prost/ibc.lightclients.sovereign.v1.rs b/proto/src/prost/ibc.lightclients.sovereign.v1.rs
new file mode 100644
index 00000000..922d5bfe
--- /dev/null
+++ b/proto/src/prost/ibc.lightclients.sovereign.v1.rs
@@ -0,0 +1,72 @@
+// This file is @generated by prost-build.
+/// SovereignClientParams structure encompasses the essential parameters shared
+/// among all Sovereign light clients, regardless of the underlying Data
+/// Availability (DA) layer, to track the client state of the rollup.
+#[allow(clippy::derive_partial_eq_without_eq)]
+#[derive(Clone, PartialEq, ::prost::Message)]
+pub struct SovereignClientParams {
+ /// the genesis state root of the rollup
+ #[prost(bytes = "vec", tag = "1")]
+ pub genesis_state_root: ::prost::alloc::vec::Vec,
+ /// the genesis DA height from which the rollup started
+ #[prost(message, optional, tag = "2")]
+ pub genesis_da_height: ::core::option::Option<
+ ::ibc_proto::ibc::core::client::v1::Height,
+ >,
+ /// the code commitment of the aggregated proof circuit
+ #[prost(message, optional, tag = "3")]
+ pub code_commitment: ::core::option::Option<
+ super::super::super::super::sovereign::types::v1::CodeCommitment,
+ >,
+ /// the duration of the period since the latest DA Timestamp during which the
+ /// submitted headers are valid for upgrade
+ #[prost(message, optional, tag = "4")]
+ pub trusting_period: ::core::option::Option<::ibc_proto::google::protobuf::Duration>,
+ /// the frozen height when the client was frozen due to the misbehaviour
+ #[prost(message, optional, tag = "6")]
+ pub frozen_height: ::core::option::Option<
+ ::ibc_proto::ibc::core::client::v1::Height,
+ >,
+ /// the latest height (slot number) the client was updated to
+ #[prost(message, optional, tag = "5")]
+ pub latest_height: ::core::option::Option<
+ ::ibc_proto::ibc::core::client::v1::Height,
+ >,
+ /// the path at which next upgraded client will be committed. Each element
+ /// corresponds to the key for a single CommitmentProof in the chained proof.
+ /// NOTE: ClientState must stored under
+ /// `{upgradePath}/{upgradeHeight}/clientState` ConsensusState must be stored
+ /// under `{upgradepath}/{upgradeHeight}/consensusState`
+ #[prost(string, tag = "7")]
+ pub upgrade_path: ::prost::alloc::string::String,
+}
+impl ::prost::Name for SovereignClientParams {
+ const NAME: &'static str = "SovereignClientParams";
+ const PACKAGE: &'static str = "ibc.lightclients.sovereign.v1";
+ fn full_name() -> ::prost::alloc::string::String {
+ "ibc.lightclients.sovereign.v1.SovereignClientParams".into()
+ }
+ fn type_url() -> ::prost::alloc::string::String {
+ "/ibc.lightclients.sovereign.v1.SovereignClientParams".into()
+ }
+}
+/// SovereignConsensusParams structure encompasses the essential parameters
+/// shared among all Sovereign light clients, regardless of the underlying Data
+/// Availability (DA) layer, to track the consensus state of the rollup.
+#[allow(clippy::derive_partial_eq_without_eq)]
+#[derive(Clone, PartialEq, ::prost::Message)]
+pub struct SovereignConsensusParams {
+ /// the state root of rollup at the ConsensusState height
+ #[prost(message, optional, tag = "1")]
+ pub root: ::core::option::Option<::ibc_proto::ibc::core::commitment::v1::MerkleRoot>,
+}
+impl ::prost::Name for SovereignConsensusParams {
+ const NAME: &'static str = "SovereignConsensusParams";
+ const PACKAGE: &'static str = "ibc.lightclients.sovereign.v1";
+ fn full_name() -> ::prost::alloc::string::String {
+ "ibc.lightclients.sovereign.v1.SovereignConsensusParams".into()
+ }
+ fn type_url() -> ::prost::alloc::string::String {
+ "/ibc.lightclients.sovereign.v1.SovereignConsensusParams".into()
+ }
+}
diff --git a/proto/src/prost/ibc.lightclients.sovereign.v1.serde.rs b/proto/src/prost/ibc.lightclients.sovereign.v1.serde.rs
new file mode 100644
index 00000000..de3a9cdc
--- /dev/null
+++ b/proto/src/prost/ibc.lightclients.sovereign.v1.serde.rs
@@ -0,0 +1,294 @@
+impl serde::Serialize for SovereignClientParams {
+ #[allow(deprecated)]
+ fn serialize(&self, serializer: S) -> core::result::Result
+ where
+ S: serde::Serializer,
+ {
+ use serde::ser::SerializeStruct;
+ let mut len = 0;
+ if true {
+ len += 1;
+ }
+ if true {
+ len += 1;
+ }
+ if true {
+ len += 1;
+ }
+ if true {
+ len += 1;
+ }
+ if true {
+ len += 1;
+ }
+ if true {
+ len += 1;
+ }
+ if true {
+ len += 1;
+ }
+ let mut struct_ser = serializer.serialize_struct("ibc.lightclients.sovereign.v1.SovereignClientParams", len)?;
+ if true {
+ #[allow(clippy::needless_borrow)]
+ struct_ser.serialize_field("genesisStateRoot", pbjson::private::base64::encode(&self.genesis_state_root).as_str())?;
+ }
+ if let Some(v) = self.genesis_da_height.as_ref() {
+ struct_ser.serialize_field("genesisDaHeight", v)?;
+ }
+ if let Some(v) = self.code_commitment.as_ref() {
+ struct_ser.serialize_field("codeCommitment", v)?;
+ }
+ if let Some(v) = self.trusting_period.as_ref() {
+ struct_ser.serialize_field("trustingPeriod", v)?;
+ }
+ if let Some(v) = self.frozen_height.as_ref() {
+ struct_ser.serialize_field("frozenHeight", v)?;
+ }
+ if let Some(v) = self.latest_height.as_ref() {
+ struct_ser.serialize_field("latestHeight", v)?;
+ }
+ if true {
+ struct_ser.serialize_field("upgradePath", &self.upgrade_path)?;
+ }
+ struct_ser.end()
+ }
+}
+impl<'de> serde::Deserialize<'de> for SovereignClientParams {
+ #[allow(deprecated)]
+ fn deserialize(deserializer: D) -> core::result::Result
+ where
+ D: serde::Deserializer<'de>,
+ {
+ const FIELDS: &[&str] = &[
+ "genesis_state_root",
+ "genesisStateRoot",
+ "genesis_da_height",
+ "genesisDaHeight",
+ "code_commitment",
+ "codeCommitment",
+ "trusting_period",
+ "trustingPeriod",
+ "frozen_height",
+ "frozenHeight",
+ "latest_height",
+ "latestHeight",
+ "upgrade_path",
+ "upgradePath",
+ ];
+
+ #[allow(clippy::enum_variant_names)]
+ enum GeneratedField {
+ GenesisStateRoot,
+ GenesisDaHeight,
+ CodeCommitment,
+ TrustingPeriod,
+ FrozenHeight,
+ LatestHeight,
+ UpgradePath,
+ }
+ impl<'de> serde::Deserialize<'de> for GeneratedField {
+ fn deserialize(deserializer: D) -> core::result::Result
+ where
+ D: serde::Deserializer<'de>,
+ {
+ struct GeneratedVisitor;
+
+ impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
+ type Value = GeneratedField;
+
+ fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
+ write!(formatter, "expected one of: {:?}", &FIELDS)
+ }
+
+ #[allow(unused_variables)]
+ fn visit_str(self, value: &str) -> core::result::Result
+ where
+ E: serde::de::Error,
+ {
+ match value {
+ "genesisStateRoot" | "genesis_state_root" => Ok(GeneratedField::GenesisStateRoot),
+ "genesisDaHeight" | "genesis_da_height" => Ok(GeneratedField::GenesisDaHeight),
+ "codeCommitment" | "code_commitment" => Ok(GeneratedField::CodeCommitment),
+ "trustingPeriod" | "trusting_period" => Ok(GeneratedField::TrustingPeriod),
+ "frozenHeight" | "frozen_height" => Ok(GeneratedField::FrozenHeight),
+ "latestHeight" | "latest_height" => Ok(GeneratedField::LatestHeight),
+ "upgradePath" | "upgrade_path" => Ok(GeneratedField::UpgradePath),
+ _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
+ }
+ }
+ }
+ deserializer.deserialize_identifier(GeneratedVisitor)
+ }
+ }
+ struct GeneratedVisitor;
+ impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
+ type Value = SovereignClientParams;
+
+ fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
+ formatter.write_str("struct ibc.lightclients.sovereign.v1.SovereignClientParams")
+ }
+
+ fn visit_map(self, mut map_: V) -> core::result::Result
+ where
+ V: serde::de::MapAccess<'de>,
+ {
+ let mut genesis_state_root__ = None;
+ let mut genesis_da_height__ = None;
+ let mut code_commitment__ = None;
+ let mut trusting_period__ = None;
+ let mut frozen_height__ = None;
+ let mut latest_height__ = None;
+ let mut upgrade_path__ = None;
+ while let Some(k) = map_.next_key()? {
+ match k {
+ GeneratedField::GenesisStateRoot => {
+ if genesis_state_root__.is_some() {
+ return Err(serde::de::Error::duplicate_field("genesisStateRoot"));
+ }
+ genesis_state_root__ =
+ Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0)
+ ;
+ }
+ GeneratedField::GenesisDaHeight => {
+ if genesis_da_height__.is_some() {
+ return Err(serde::de::Error::duplicate_field("genesisDaHeight"));
+ }
+ genesis_da_height__ = map_.next_value()?;
+ }
+ GeneratedField::CodeCommitment => {
+ if code_commitment__.is_some() {
+ return Err(serde::de::Error::duplicate_field("codeCommitment"));
+ }
+ code_commitment__ = map_.next_value()?;
+ }
+ GeneratedField::TrustingPeriod => {
+ if trusting_period__.is_some() {
+ return Err(serde::de::Error::duplicate_field("trustingPeriod"));
+ }
+ trusting_period__ = map_.next_value()?;
+ }
+ GeneratedField::FrozenHeight => {
+ if frozen_height__.is_some() {
+ return Err(serde::de::Error::duplicate_field("frozenHeight"));
+ }
+ frozen_height__ = map_.next_value()?;
+ }
+ GeneratedField::LatestHeight => {
+ if latest_height__.is_some() {
+ return Err(serde::de::Error::duplicate_field("latestHeight"));
+ }
+ latest_height__ = map_.next_value()?;
+ }
+ GeneratedField::UpgradePath => {
+ if upgrade_path__.is_some() {
+ return Err(serde::de::Error::duplicate_field("upgradePath"));
+ }
+ upgrade_path__ = Some(map_.next_value()?);
+ }
+ }
+ }
+ Ok(SovereignClientParams {
+ genesis_state_root: genesis_state_root__.unwrap_or_default(),
+ genesis_da_height: genesis_da_height__,
+ code_commitment: code_commitment__,
+ trusting_period: trusting_period__,
+ frozen_height: frozen_height__,
+ latest_height: latest_height__,
+ upgrade_path: upgrade_path__.unwrap_or_default(),
+ })
+ }
+ }
+ deserializer.deserialize_struct("ibc.lightclients.sovereign.v1.SovereignClientParams", FIELDS, GeneratedVisitor)
+ }
+}
+impl serde::Serialize for SovereignConsensusParams {
+ #[allow(deprecated)]
+ fn serialize(&self, serializer: S) -> core::result::Result
+ where
+ S: serde::Serializer,
+ {
+ use serde::ser::SerializeStruct;
+ let mut len = 0;
+ if true {
+ len += 1;
+ }
+ let mut struct_ser = serializer.serialize_struct("ibc.lightclients.sovereign.v1.SovereignConsensusParams", len)?;
+ if let Some(v) = self.root.as_ref() {
+ struct_ser.serialize_field("root", v)?;
+ }
+ struct_ser.end()
+ }
+}
+impl<'de> serde::Deserialize<'de> for SovereignConsensusParams {
+ #[allow(deprecated)]
+ fn deserialize(deserializer: D) -> core::result::Result
+ where
+ D: serde::Deserializer<'de>,
+ {
+ const FIELDS: &[&str] = &[
+ "root",
+ ];
+
+ #[allow(clippy::enum_variant_names)]
+ enum GeneratedField {
+ Root,
+ }
+ impl<'de> serde::Deserialize<'de> for GeneratedField {
+ fn deserialize(deserializer: D) -> core::result::Result
+ where
+ D: serde::Deserializer<'de>,
+ {
+ struct GeneratedVisitor;
+
+ impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
+ type Value = GeneratedField;
+
+ fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
+ write!(formatter, "expected one of: {:?}", &FIELDS)
+ }
+
+ #[allow(unused_variables)]
+ fn visit_str(self, value: &str) -> core::result::Result
+ where
+ E: serde::de::Error,
+ {
+ match value {
+ "root" => Ok(GeneratedField::Root),
+ _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
+ }
+ }
+ }
+ deserializer.deserialize_identifier(GeneratedVisitor)
+ }
+ }
+ struct GeneratedVisitor;
+ impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
+ type Value = SovereignConsensusParams;
+
+ fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
+ formatter.write_str("struct ibc.lightclients.sovereign.v1.SovereignConsensusParams")
+ }
+
+ fn visit_map(self, mut map_: V) -> core::result::Result
+ where
+ V: serde::de::MapAccess<'de>,
+ {
+ let mut root__ = None;
+ while let Some(k) = map_.next_key()? {
+ match k {
+ GeneratedField::Root => {
+ if root__.is_some() {
+ return Err(serde::de::Error::duplicate_field("root"));
+ }
+ root__ = map_.next_value()?;
+ }
+ }
+ }
+ Ok(SovereignConsensusParams {
+ root: root__,
+ })
+ }
+ }
+ deserializer.deserialize_struct("ibc.lightclients.sovereign.v1.SovereignConsensusParams", FIELDS, GeneratedVisitor)
+ }
+}
diff --git a/proto/src/prost/proto_descriptor.bin b/proto/src/prost/proto_descriptor.bin
index 77e9b555..e7b84f35 100644
Binary files a/proto/src/prost/proto_descriptor.bin and b/proto/src/prost/proto_descriptor.bin differ
diff --git a/proto/src/prost/sovereign.types.v1.rs b/proto/src/prost/sovereign.types.v1.rs
index dc905da1..c5f7ff5c 100644
--- a/proto/src/prost/sovereign.types.v1.rs
+++ b/proto/src/prost/sovereign.types.v1.rs
@@ -1,3 +1,4 @@
+// This file is @generated by prost-build.
/// AggregatedProof is the overarching structure, encompassing public data, proof
/// data information, and aggregated proof bytes.
#[allow(clippy::derive_partial_eq_without_eq)]
@@ -14,7 +15,10 @@ impl ::prost::Name for AggregatedProof {
const NAME: &'static str = "AggregatedProof";
const PACKAGE: &'static str = "sovereign.types.v1";
fn full_name() -> ::prost::alloc::string::String {
- ::prost::alloc::format!("sovereign.types.v1.{}", Self::NAME)
+ "sovereign.types.v1.AggregatedProof".into()
+ }
+ fn type_url() -> ::prost::alloc::string::String {
+ "/sovereign.types.v1.AggregatedProof".into()
}
}
/// AggregatedProofPublicData defines the public properties of the
@@ -28,12 +32,12 @@ pub struct AggregatedProofPublicData {
pub validity_conditions: ::prost::alloc::vec::Vec,
/// the initial slot number of the rollup from which the proof captures the
/// rollup's transition from the initial state root.
- #[prost(uint64, tag = "2")]
- pub initial_slot_number: u64,
+ #[prost(message, optional, tag = "2")]
+ pub initial_slot_number: ::core::option::Option,
/// the final slot number of the rollup, up to which the proof captures the
/// rollup's transition to the final state root.
- #[prost(uint64, tag = "3")]
- pub final_slot_number: u64,
+ #[prost(message, optional, tag = "3")]
+ pub final_slot_number: ::core::option::Option,
/// the genesis state root
#[prost(bytes = "vec", tag = "4")]
pub genesis_state_root: ::prost::alloc::vec::Vec,
@@ -57,7 +61,10 @@ impl ::prost::Name for AggregatedProofPublicData {
const NAME: &'static str = "AggregatedProofPublicData";
const PACKAGE: &'static str = "sovereign.types.v1";
fn full_name() -> ::prost::alloc::string::String {
- ::prost::alloc::format!("sovereign.types.v1.{}", Self::NAME)
+ "sovereign.types.v1.AggregatedProofPublicData".into()
+ }
+ fn type_url() -> ::prost::alloc::string::String {
+ "/sovereign.types.v1.AggregatedProofPublicData".into()
}
}
/// SerializedAggregatedProof defines the raw aggregated proof structure for the
@@ -73,7 +80,10 @@ impl ::prost::Name for SerializedAggregatedProof {
const NAME: &'static str = "SerializedAggregatedProof";
const PACKAGE: &'static str = "sovereign.types.v1";
fn full_name() -> ::prost::alloc::string::String {
- ::prost::alloc::format!("sovereign.types.v1.{}", Self::NAME)
+ "sovereign.types.v1.SerializedAggregatedProof".into()
+ }
+ fn type_url() -> ::prost::alloc::string::String {
+ "/sovereign.types.v1.SerializedAggregatedProof".into()
}
}
/// SerializedValidityCondition defines the serialized validity condition for
@@ -89,7 +99,29 @@ impl ::prost::Name for SerializedValidityCondition {
const NAME: &'static str = "SerializedValidityCondition";
const PACKAGE: &'static str = "sovereign.types.v1";
fn full_name() -> ::prost::alloc::string::String {
- ::prost::alloc::format!("sovereign.types.v1.{}", Self::NAME)
+ "sovereign.types.v1.SerializedValidityCondition".into()
+ }
+ fn type_url() -> ::prost::alloc::string::String {
+ "/sovereign.types.v1.SerializedValidityCondition".into()
+ }
+}
+/// SlotNumber defines the slot number of rollups which is the height in the
+/// Sovereign SDK system
+#[allow(clippy::derive_partial_eq_without_eq)]
+#[derive(Clone, PartialEq, ::prost::Message)]
+pub struct SlotNumber {
+ /// the slot number (rollup height)
+ #[prost(uint64, tag = "1")]
+ pub slot_number: u64,
+}
+impl ::prost::Name for SlotNumber {
+ const NAME: &'static str = "SlotNumber";
+ const PACKAGE: &'static str = "sovereign.types.v1";
+ fn full_name() -> ::prost::alloc::string::String {
+ "sovereign.types.v1.SlotNumber".into()
+ }
+ fn type_url() -> ::prost::alloc::string::String {
+ "/sovereign.types.v1.SlotNumber".into()
}
}
/// CodeCommitment defines the code commitment of the aggregated proof circuit
@@ -104,6 +136,9 @@ impl ::prost::Name for CodeCommitment {
const NAME: &'static str = "CodeCommitment";
const PACKAGE: &'static str = "sovereign.types.v1";
fn full_name() -> ::prost::alloc::string::String {
- ::prost::alloc::format!("sovereign.types.v1.{}", Self::NAME)
+ "sovereign.types.v1.CodeCommitment".into()
+ }
+ fn type_url() -> ::prost::alloc::string::String {
+ "/sovereign.types.v1.CodeCommitment".into()
}
}
diff --git a/proto/src/prost/sovereign.types.v1.serde.rs b/proto/src/prost/sovereign.types.v1.serde.rs
index 291ce199..7a1a37c1 100644
--- a/proto/src/prost/sovereign.types.v1.serde.rs
+++ b/proto/src/prost/sovereign.types.v1.serde.rs
@@ -147,13 +147,11 @@ impl serde::Serialize for AggregatedProofPublicData {
if true {
struct_ser.serialize_field("validityConditions", &self.validity_conditions)?;
}
- if true {
- #[allow(clippy::needless_borrow)]
- struct_ser.serialize_field("initialSlotNumber", ::alloc::string::ToString::to_string(&self.initial_slot_number).as_str())?;
+ if let Some(v) = self.initial_slot_number.as_ref() {
+ struct_ser.serialize_field("initialSlotNumber", v)?;
}
- if true {
- #[allow(clippy::needless_borrow)]
- struct_ser.serialize_field("finalSlotNumber", ::alloc::string::ToString::to_string(&self.final_slot_number).as_str())?;
+ if let Some(v) = self.final_slot_number.as_ref() {
+ struct_ser.serialize_field("finalSlotNumber", v)?;
}
if true {
#[allow(clippy::needless_borrow)]
@@ -289,17 +287,13 @@ impl<'de> serde::Deserialize<'de> for AggregatedProofPublicData {
if initial_slot_number__.is_some() {
return Err(serde::de::Error::duplicate_field("initialSlotNumber"));
}
- initial_slot_number__ =
- Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
- ;
+ initial_slot_number__ = map_.next_value()?;
}
GeneratedField::FinalSlotNumber => {
if final_slot_number__.is_some() {
return Err(serde::de::Error::duplicate_field("finalSlotNumber"));
}
- final_slot_number__ =
- Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
- ;
+ final_slot_number__ = map_.next_value()?;
}
GeneratedField::GenesisStateRoot => {
if genesis_state_root__.is_some() {
@@ -351,8 +345,8 @@ impl<'de> serde::Deserialize<'de> for AggregatedProofPublicData {
}
Ok(AggregatedProofPublicData {
validity_conditions: validity_conditions__.unwrap_or_default(),
- initial_slot_number: initial_slot_number__.unwrap_or_default(),
- final_slot_number: final_slot_number__.unwrap_or_default(),
+ initial_slot_number: initial_slot_number__,
+ final_slot_number: final_slot_number__,
genesis_state_root: genesis_state_root__.unwrap_or_default(),
initial_state_root: initial_state_root__.unwrap_or_default(),
final_state_root: final_state_root__.unwrap_or_default(),
@@ -650,3 +644,98 @@ impl<'de> serde::Deserialize<'de> for SerializedValidityCondition {
deserializer.deserialize_struct("sovereign.types.v1.SerializedValidityCondition", FIELDS, GeneratedVisitor)
}
}
+impl serde::Serialize for SlotNumber {
+ #[allow(deprecated)]
+ fn serialize(&self, serializer: S) -> core::result::Result
+ where
+ S: serde::Serializer,
+ {
+ use serde::ser::SerializeStruct;
+ let mut len = 0;
+ if true {
+ len += 1;
+ }
+ let mut struct_ser = serializer.serialize_struct("sovereign.types.v1.SlotNumber", len)?;
+ if true {
+ #[allow(clippy::needless_borrow)]
+ struct_ser.serialize_field("slotNumber", ::alloc::string::ToString::to_string(&self.slot_number).as_str())?;
+ }
+ struct_ser.end()
+ }
+}
+impl<'de> serde::Deserialize<'de> for SlotNumber {
+ #[allow(deprecated)]
+ fn deserialize(deserializer: D) -> core::result::Result
+ where
+ D: serde::Deserializer<'de>,
+ {
+ const FIELDS: &[&str] = &[
+ "slot_number",
+ "slotNumber",
+ ];
+
+ #[allow(clippy::enum_variant_names)]
+ enum GeneratedField {
+ SlotNumber,
+ }
+ impl<'de> serde::Deserialize<'de> for GeneratedField {
+ fn deserialize(deserializer: D) -> core::result::Result
+ where
+ D: serde::Deserializer<'de>,
+ {
+ struct GeneratedVisitor;
+
+ impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
+ type Value = GeneratedField;
+
+ fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
+ write!(formatter, "expected one of: {:?}", &FIELDS)
+ }
+
+ #[allow(unused_variables)]
+ fn visit_str(self, value: &str) -> core::result::Result
+ where
+ E: serde::de::Error,
+ {
+ match value {
+ "slotNumber" | "slot_number" => Ok(GeneratedField::SlotNumber),
+ _ => Err(serde::de::Error::unknown_field(value, FIELDS)),
+ }
+ }
+ }
+ deserializer.deserialize_identifier(GeneratedVisitor)
+ }
+ }
+ struct GeneratedVisitor;
+ impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
+ type Value = SlotNumber;
+
+ fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
+ formatter.write_str("struct sovereign.types.v1.SlotNumber")
+ }
+
+ fn visit_map(self, mut map_: V) -> core::result::Result
+ where
+ V: serde::de::MapAccess<'de>,
+ {
+ let mut slot_number__ = None;
+ while let Some(k) = map_.next_key()? {
+ match k {
+ GeneratedField::SlotNumber => {
+ if slot_number__.is_some() {
+ return Err(serde::de::Error::duplicate_field("slotNumber"));
+ }
+ slot_number__ =
+ Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
+ ;
+ }
+ }
+ }
+ Ok(SlotNumber {
+ slot_number: slot_number__.unwrap_or_default(),
+ })
+ }
+ }
+ deserializer.deserialize_struct("sovereign.types.v1.SlotNumber", FIELDS, GeneratedVisitor)
+ }
+}