diff --git a/node/src/chain/header_validation.rs b/node/src/chain/header_validation.rs index 089001e281..6b7b4a9be1 100644 --- a/node/src/chain/header_validation.rs +++ b/node/src/chain/header_validation.rs @@ -16,7 +16,7 @@ use dusk_consensus::user::committee::{Committee, CommitteeSet}; use dusk_consensus::user::provisioners::{ContextProvisioners, Provisioners}; use execution_core::stake::EPOCH; use node_data::ledger::{to_str, Fault, InvalidFault, Seed, Signature}; -use node_data::message::payload::RatificationResult; +use node_data::message::payload::{RatificationResult, Vote}; use node_data::message::ConsensusHeader; use node_data::{ledger, StepName}; use std::sync::Arc; @@ -173,6 +173,17 @@ impl<'a, DB: database::DB> Validator<'a, DB> { .map(|h| h.seed) })?; + let cert_result = candidate_block.prev_block_cert.result; + let prev_block_hash = candidate_block.prev_block_hash; + + match candidate_block.prev_block_cert.result { + RatificationResult::Success(Vote::Valid(hash)) + if hash == prev_block_hash => {} + _ => anyhow::bail!( + "Invalid result for previous block hash: {cert_result:?}" + ), + } + let (_, _, voters) = verify_block_att( self.prev_header.prev_block_hash, prev_block_seed,