From e7e4b20844736debac3cf2063afcc084438efb84 Mon Sep 17 00:00:00 2001 From: Romain Ruetschi Date: Tue, 17 Dec 2024 12:59:02 +0100 Subject: [PATCH] Rename `GetEarliestBlockHeight` to `GetHistoryMinHeight` --- code/crates/app-channel/src/channel.rs | 2 +- code/crates/app-channel/src/connector.rs | 4 ++-- code/crates/engine/src/consensus.rs | 2 +- code/crates/engine/src/host.rs | 2 +- code/crates/engine/src/sync.rs | 4 ++-- code/crates/starknet/host/src/actor.rs | 4 +--- code/examples/channel/src/app.rs | 4 ++-- 7 files changed, 10 insertions(+), 12 deletions(-) diff --git a/code/crates/app-channel/src/channel.rs b/code/crates/app-channel/src/channel.rs index a73767fe7..7c1cab637 100644 --- a/code/crates/app-channel/src/channel.rs +++ b/code/crates/app-channel/src/channel.rs @@ -52,7 +52,7 @@ pub enum AppMsg { }, /// Request the earliest block height in the block store - GetEarliestBlockHeight { reply: Reply }, + GetHistoryMinHeight { reply: Reply }, /// ProposalPart received <-- consensus <-- gossip ReceivedProposalPart { diff --git a/code/crates/app-channel/src/connector.rs b/code/crates/app-channel/src/connector.rs index 264767912..62a6b9eb9 100644 --- a/code/crates/app-channel/src/connector.rs +++ b/code/crates/app-channel/src/connector.rs @@ -112,11 +112,11 @@ where .await? } - HostMsg::GetEarliestBlockHeight { reply_to } => { + HostMsg::GetHistoryMinHeight { reply_to } => { let (reply, rx) = oneshot::channel(); self.sender - .send(AppMsg::GetEarliestBlockHeight { reply }) + .send(AppMsg::GetHistoryMinHeight { reply }) .await?; reply_to.send(rx.await?)?; diff --git a/code/crates/engine/src/consensus.rs b/code/crates/engine/src/consensus.rs index 2a2707957..8bd63e3bd 100644 --- a/code/crates/engine/src/consensus.rs +++ b/code/crates/engine/src/consensus.rs @@ -708,7 +708,7 @@ where } async fn get_history_min_height(&self) -> Result { - ractor::call!(self.host, |reply_to| HostMsg::GetEarliestBlockHeight { + ractor::call!(self.host, |reply_to| HostMsg::GetHistoryMinHeight { reply_to }) .map_err(|e| eyre!("Failed to get earliest block height: {e:?}").into()) diff --git a/code/crates/engine/src/host.rs b/code/crates/engine/src/host.rs index 1a3173b1d..c8e5569fc 100644 --- a/code/crates/engine/src/host.rs +++ b/code/crates/engine/src/host.rs @@ -75,7 +75,7 @@ pub enum HostMsg { }, /// Request the earliest block height in the block store - GetEarliestBlockHeight { reply_to: RpcReplyPort }, + GetHistoryMinHeight { reply_to: RpcReplyPort }, /// ProposalPart received <-- consensus <-- gossip ReceivedProposalPart { diff --git a/code/crates/engine/src/sync.rs b/code/crates/engine/src/sync.rs index 1577b9a84..fe594d84b 100644 --- a/code/crates/engine/src/sync.rs +++ b/code/crates/engine/src/sync.rs @@ -204,10 +204,10 @@ where } async fn get_history_min_height(&self) -> Result { - ractor::call!(self.host, |reply_to| HostMsg::GetEarliestBlockHeight { + ractor::call!(self.host, |reply_to| HostMsg::GetHistoryMinHeight { reply_to }) - .map_err(|e| eyre!("Failed to get earliest block height: {e:?}").into()) + .map_err(|e| eyre!("Failed to get earliest history height: {e:?}").into()) } async fn handle_effect( diff --git a/code/crates/starknet/host/src/actor.rs b/code/crates/starknet/host/src/actor.rs index c25ac25ff..f60f5ec88 100644 --- a/code/crates/starknet/host/src/actor.rs +++ b/code/crates/starknet/host/src/actor.rs @@ -126,9 +126,7 @@ impl Host { proposer, } => on_started_round(state, height, round, proposer).await, - HostMsg::GetEarliestBlockHeight { reply_to } => { - on_get_history_min_height(state, reply_to) - } + HostMsg::GetHistoryMinHeight { reply_to } => on_get_history_min_height(state, reply_to), HostMsg::GetValue { height, diff --git a/code/examples/channel/src/app.rs b/code/examples/channel/src/app.rs index eb302109a..3800a4965 100644 --- a/code/examples/channel/src/app.rs +++ b/code/examples/channel/src/app.rs @@ -73,9 +73,9 @@ pub async fn run( .await?; } - AppMsg::GetEarliestBlockHeight { reply } => { + AppMsg::GetHistoryMinHeight { reply } => { if reply.send(state.get_earliest_height()).is_err() { - error!("Failed to send GetEarliestBlockHeight reply"); + error!("Failed to send GetHistoryMinHeight reply"); } }