Skip to content

Commit

Permalink
Rename GetEarliestBlockHeight to GetHistoryMinHeight
Browse files Browse the repository at this point in the history
  • Loading branch information
romac committed Dec 17, 2024
1 parent 30de7ea commit e7e4b20
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 12 deletions.
2 changes: 1 addition & 1 deletion code/crates/app-channel/src/channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ pub enum AppMsg<Ctx: Context> {
},

/// Request the earliest block height in the block store
GetEarliestBlockHeight { reply: Reply<Ctx::Height> },
GetHistoryMinHeight { reply: Reply<Ctx::Height> },

/// ProposalPart received <-- consensus <-- gossip
ReceivedProposalPart {
Expand Down
4 changes: 2 additions & 2 deletions code/crates/app-channel/src/connector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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?)?;
Expand Down
2 changes: 1 addition & 1 deletion code/crates/engine/src/consensus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,7 @@ where
}

async fn get_history_min_height(&self) -> Result<Ctx::Height, ActorProcessingErr> {
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())
Expand Down
2 changes: 1 addition & 1 deletion code/crates/engine/src/host.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ pub enum HostMsg<Ctx: Context> {
},

/// Request the earliest block height in the block store
GetEarliestBlockHeight { reply_to: RpcReplyPort<Ctx::Height> },
GetHistoryMinHeight { reply_to: RpcReplyPort<Ctx::Height> },

/// ProposalPart received <-- consensus <-- gossip
ReceivedProposalPart {
Expand Down
4 changes: 2 additions & 2 deletions code/crates/engine/src/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,10 @@ where
}

async fn get_history_min_height(&self) -> Result<Ctx::Height, ActorProcessingErr> {
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(
Expand Down
4 changes: 1 addition & 3 deletions code/crates/starknet/host/src/actor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions code/examples/channel/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
}

Expand Down

0 comments on commit e7e4b20

Please sign in to comment.