diff --git a/code/crates/actors/src/consensus.rs b/code/crates/actors/src/consensus.rs index 430cd96ae..dd0994f27 100644 --- a/code/crates/actors/src/consensus.rs +++ b/code/crates/actors/src/consensus.rs @@ -75,9 +75,6 @@ pub enum Msg { // The proposal builder has build a new block part, needs to be signed and gossiped by consensus GossipBlockPart(Ctx::BlockPart), BlockReceived(ReceivedProposedValue), - - // FIXME: Remove - DoNothing, } impl From for Msg { @@ -335,18 +332,12 @@ where // TODO: Verify that the proposal was signed by the proposer for the height and round, drop otherwise. self.host.call_and_forward( - |reply_to| HostMsg::::ReceivedBlockPart { + |reply_to| HostMsg::ReceivedBlockPart { block_part: signed_block_part.block_part, reply_to, }, &myself, - |maybe_value| { - if let Some(value) = maybe_value { - Msg::::BlockReceived(value) - } else { - Msg::::DoNothing // FIXME - } - }, + |value| Msg::BlockReceived(value), None, )?; } @@ -674,8 +665,6 @@ where state: &mut State, ) -> Result<(), ractor::ActorProcessingErr> { match msg { - Msg::DoNothing => (), - Msg::StartHeight(height) => { self.metrics.block_start(); diff --git a/code/crates/actors/src/host.rs b/code/crates/actors/src/host.rs index 4a29695d1..c526c6058 100644 --- a/code/crates/actors/src/host.rs +++ b/code/crates/actors/src/host.rs @@ -52,7 +52,7 @@ pub enum HostMsg { /// BlockPart received <-- consensus <-- gossip ReceivedBlockPart { block_part: Ctx::BlockPart, - reply_to: RpcReplyPort>>, + reply_to: RpcReplyPort>, }, /// Retrieve a block/value for which all parts have been received diff --git a/code/crates/starknet-host/src/actor.rs b/code/crates/starknet-host/src/actor.rs index f303d8f73..13fd4dcc6 100644 --- a/code/crates/starknet-host/src/actor.rs +++ b/code/crates/starknet-host/src/actor.rs @@ -213,8 +213,9 @@ impl Actor for StarknetHost { block_part, reply_to, } => { - let value = self.build_value_from_block_part(state, block_part).await; - reply_to.send(value)?; + if let Some(value) = self.build_value_from_block_part(state, block_part).await { + reply_to.send(value)?; + } Ok(()) } diff --git a/code/crates/test-app/src/host.rs b/code/crates/test-app/src/host.rs index 533007480..06be079c9 100644 --- a/code/crates/test-app/src/host.rs +++ b/code/crates/test-app/src/host.rs @@ -134,12 +134,13 @@ impl Actor for Host { block_part, reply_to, } => { - let maybe_block = self + if let Some(value) = self .build_value(block_part, state.value_builder.as_mut()) - .await?; - - // Send the proposed value (from blockparts) to consensus/ Driver - reply_to.send(maybe_block)?; + .await? + { + // Send the proposed value (from blockparts) to consensus/ Driver + reply_to.send(value)?; + } } HostMsg::GetReceivedValue {