Skip to content

Commit

Permalink
removed debug prints and restored logic on header vs validator set ve…
Browse files Browse the repository at this point in the history
…rification.
  • Loading branch information
vlad committed Oct 7, 2024
1 parent aaeed97 commit fff69b5
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions cosmwasm/enclaves/shared/block-verifier/src/verify/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,6 @@ pub fn validate_block_header(
height: u64,
commit: Commit,
) -> Result<SignedHeader, sgx_status_t> {
println!(
"my validator set h={}, validators={}",
height,
validator_set.validators().len()
);

let header = <Header as Protobuf<RawHeader>>::decode(block_header_slice).map_err(|e| {
error!("Error parsing header from proto: {:?}", e);
sgx_status_t::SGX_ERROR_INVALID_PARAMETER
Expand All @@ -31,16 +25,11 @@ pub fn validate_block_header(
sgx_status_t::SGX_ERROR_INVALID_PARAMETER
})?;

println!(
"proposed block height={}",
signed_header.header.height.value()
);

// validate that we have the validator set for the current height
if signed_header.header.height.value() != height {
error!("Validator set height does not match stored validator set. Ignoring");
// we use this error code to signal that the validator set is not synced with the current block
//return Err(sgx_status_t::SGX_ERROR_FILE_RECOVERY_NEEDED);
return Err(sgx_status_t::SGX_ERROR_FILE_RECOVERY_NEEDED);
}

let untrusted_block = UntrustedBlockState {
Expand Down

0 comments on commit fff69b5

Please sign in to comment.