diff --git a/code/actors/src/consensus.rs b/code/actors/src/consensus.rs index 4016d0692..8e33c8333 100644 --- a/code/actors/src/consensus.rs +++ b/code/actors/src/consensus.rs @@ -215,9 +215,7 @@ where return Ok(()); }; - // TODO - proposals with invalid signatures should be dropped. - // For well signed we should validate the proposal against the block parts (if all received). - // Add `valid()` to Context. + // TODO - verify that the proposal was signed by the proposer for the height and round, drop otherwise. let proposal = &signed_proposal.proposal; let proposal_height = proposal.height(); let proposal_round = proposal.round(); @@ -231,7 +229,8 @@ where proposal_height, proposal_round, proposal.value() - ) + ); + return Ok(()); } assert!(proposal_height == state.driver.height()); @@ -277,6 +276,7 @@ where return Ok(()); } + // TODO - verify that the proposal was signed by the proposer for the height and round, drop otherwise. self.proposal_builder.cast(ProposalBuilderMsg::BlockPart { block_part: signed_block_part.block_part, reply_to: myself.clone(), diff --git a/code/actors/src/util/value_builder.rs b/code/actors/src/util/value_builder.rs index 97de47574..ef572ca8b 100644 --- a/code/actors/src/util/value_builder.rs +++ b/code/actors/src/util/value_builder.rs @@ -252,6 +252,12 @@ pub mod test { } } + // This is a temporary store implementation for block parts + // TODO-s: + // - make it context generic + // - add Address to key + // - not sure if this is required as consensus should verify that only the parts signed by the proposer for + // the height and round should be forwarded here (see the TODOs in consensus) #[derive(Clone, Debug, PartialEq, Eq)] pub struct PartStore { pub map: BTreeMap<(Height, Round, u64), BlockPart>,