From d0427171042f2256bc1ed3d61b8c74ee99995d76 Mon Sep 17 00:00:00 2001 From: Jun Kimura Date: Tue, 5 Nov 2024 10:00:29 +0900 Subject: [PATCH] remove `latest_slot` from client state proto Signed-off-by: Jun Kimura --- crates/ibc/src/client_state.rs | 5 ----- crates/ibc/src/update.rs | 3 --- .../definitions/ibc/lightclients/ethereum/v1/ethereum.proto | 5 ++--- proto/src/prost/ibc.lightclients.ethereum.v1.rs | 4 +--- 4 files changed, 3 insertions(+), 14 deletions(-) diff --git a/crates/ibc/src/client_state.rs b/crates/ibc/src/client_state.rs index acb5e60..42cb6da 100644 --- a/crates/ibc/src/client_state.rs +++ b/crates/ibc/src/client_state.rs @@ -57,7 +57,6 @@ pub struct ClientState { pub max_clock_drift: Duration, /// State - pub latest_slot: Slot, pub latest_execution_block_number: U64, pub frozen_height: Option, @@ -269,8 +268,6 @@ impl ClientState { Err(Error::UninitializedClientStateField("trust_level")) } else if self.trusting_period == Duration::default() { Err(Error::UninitializedClientStateField("trusting_period")) - } else if self.latest_slot == Slot::default() { - Err(Error::UninitializedClientStateField("latest_slot")) } else if self.latest_execution_block_number == U64::default() { Err(Error::UninitializedClientStateField( "latest_execution_block_number", @@ -749,7 +746,6 @@ impl TryFrom .ok_or(Error::NegativeMaxClockDrift)? .try_into() .map_err(|_| Error::NegativeMaxClockDrift)?, - latest_slot: value.latest_slot.into(), latest_execution_block_number: value.latest_execution_block_number.into(), frozen_height, consensus_verifier: Default::default(), @@ -810,7 +806,6 @@ impl From> fo }), trusting_period: Some(value.trusting_period.into()), max_clock_drift: Some(value.max_clock_drift.into()), - latest_slot: value.latest_slot.into(), latest_execution_block_number: value.latest_execution_block_number.into(), frozen_height: value.frozen_height.map(|h| ProtoHeight { revision_number: h.revision_number(), diff --git a/crates/ibc/src/update.rs b/crates/ibc/src/update.rs index d2e80e9..9744209 100644 --- a/crates/ibc/src/update.rs +++ b/crates/ibc/src/update.rs @@ -69,9 +69,6 @@ pub fn apply_updates( }; let mut new_client_state = client_state.clone(); - if client_state.latest_slot < update_slot { - new_client_state.latest_slot = update_slot; - } if client_state.latest_execution_block_number < block_number { new_client_state.latest_execution_block_number = block_number; } diff --git a/proto/definitions/ibc/lightclients/ethereum/v1/ethereum.proto b/proto/definitions/ibc/lightclients/ethereum/v1/ethereum.proto index af160a9..e9f14f1 100644 --- a/proto/definitions/ibc/lightclients/ethereum/v1/ethereum.proto +++ b/proto/definitions/ibc/lightclients/ethereum/v1/ethereum.proto @@ -22,9 +22,8 @@ message ClientState { google.protobuf.Duration trusting_period = 11; google.protobuf.Duration max_clock_drift = 12; - uint64 latest_slot = 13; - uint64 latest_execution_block_number = 14; - ibc.core.client.v1.Height frozen_height = 15; + uint64 latest_execution_block_number = 13; + ibc.core.client.v1.Height frozen_height = 14; } message ConsensusState { diff --git a/proto/src/prost/ibc.lightclients.ethereum.v1.rs b/proto/src/prost/ibc.lightclients.ethereum.v1.rs index 2579146..86669d5 100644 --- a/proto/src/prost/ibc.lightclients.ethereum.v1.rs +++ b/proto/src/prost/ibc.lightclients.ethereum.v1.rs @@ -30,10 +30,8 @@ pub struct ClientState { super::super::super::super::google::protobuf::Duration, >, #[prost(uint64, tag = "13")] - pub latest_slot: u64, - #[prost(uint64, tag = "14")] pub latest_execution_block_number: u64, - #[prost(message, optional, tag = "15")] + #[prost(message, optional, tag = "14")] pub frozen_height: ::core::option::Option< super::super::super::core::client::v1::Height, >,