Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion light-client-detector/src/evidence.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ pub fn make_evidence(
fn conflicting_header_is_invalid(conflicted: &Header, trusted: &Header) -> bool {
trusted.validators_hash != conflicted.validators_hash
|| trusted.next_validators_hash != conflicted.next_validators_hash
|| trusted.implicit_hash != conflicted.implicit_hash
|| trusted.consensus_hash != conflicted.consensus_hash
|| trusted.app_hash != conflicted.app_hash
|| trusted.last_results_hash != conflicted.last_results_hash
Expand Down
2 changes: 0 additions & 2 deletions light-client-js/tests/web.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ const UNTRUSTED_BLOCK: &str = r#"{
"data_hash": null,
"validators_hash": "75E6DD63C2DC2B58FE0ED82792EAB369C4308C7EC16B69446382CC4B41D46068",
"next_validators_hash": "C8CFFADA9808F685C4111693E1ADFDDBBEE9B9493493BEF805419F143C5B0D0A",
"implicit_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855",
"consensus_hash": "75E6DD63C2DC2B58FE0ED82792EAB369C4308C7EC16B69446382CC4B41D46068",
"app_hash": "",
"last_results_hash": null,
Expand Down Expand Up @@ -99,7 +98,6 @@ const TRUSTED_BLOCK: &str = r#"{
"data_hash": null,
"validators_hash": "75E6DD63C2DC2B58FE0ED82792EAB369C4308C7EC16B69446382CC4B41D46068",
"next_validators_hash": "75E6DD63C2DC2B58FE0ED82792EAB369C4308C7EC16B69446382CC4B41D46068",
"implicit_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855",
"consensus_hash": "75E6DD63C2DC2B58FE0ED82792EAB369C4308C7EC16B69446382CC4B41D46068",
"app_hash": "",
"last_results_hash": null,
Expand Down
10 changes: 0 additions & 10 deletions light-client-verifier/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,16 +93,6 @@ define_error! {
e.header_next_validators_hash, e.next_validators_hash)
},

InvalidImplicitHash
{
header_implicit_hash: Option<Hash>,
implicit_hash: Option<Hash>,
}
| e | {
format_args!("invalid implicit hash: header_implicit_hash={:?} implicit_hash={:?}",
e.header_implicit_hash, e.implicit_hash)
},

InvalidValidatorSet
{
header_validators_hash: Hash,
Expand Down
15 changes: 0 additions & 15 deletions light-client-verifier/src/predicates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,21 +69,6 @@ pub trait VerificationPredicates: Send + Sync {
}
}

fn implicit_hash_match(
&self,
implicit_hash: Option<Hash>,
header_implicit_hash: Option<Hash>,
) -> Result<(), VerificationError> {
if header_implicit_hash == implicit_hash {
Ok(())
} else {
Err(VerificationError::invalid_implicit_hash(
header_implicit_hash,
implicit_hash,
))
}
}

/// Check that the hash of the header in the commit matches the actual one.
fn header_matches_commit(
&self,
Expand Down
4 changes: 0 additions & 4 deletions light-client-verifier/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,13 @@ pub struct TrustedBlockState<'a> {
pub height: Height,
pub next_validators: &'a ValidatorSet,
pub next_validators_hash: Hash,
pub implicit_hash: Option<Hash>,
}

/// Untrusted block parameters needed for light client verification.
pub struct UntrustedBlockState<'a> {
pub signed_header: &'a SignedHeader,
pub validators: &'a ValidatorSet,
pub next_validators: Option<&'a ValidatorSet>,
pub implicit_hash: Option<Hash>,
}

impl<'a> UntrustedBlockState<'a> {
Expand Down Expand Up @@ -160,7 +158,6 @@ impl LightBlock {
height: self.signed_header.header.height,
next_validators: &self.next_validators,
next_validators_hash: self.signed_header.header.next_validators_hash,
implicit_hash: self.signed_header.header.implicit_hash,
}
}

Expand All @@ -171,7 +168,6 @@ impl LightBlock {
signed_header: &self.signed_header,
validators: &self.validators,
next_validators: Some(&self.next_validators),
implicit_hash: self.signed_header.header.implicit_hash,
}
}
}
Expand Down
11 changes: 0 additions & 11 deletions light-client-verifier/src/verifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,15 +147,6 @@ where
Verdict::Success
}

pub fn verify_implicit(&self, untrusted: &UntrustedBlockState<'_>) -> Verdict {
verdict!(self.predicates.implicit_hash_match(
untrusted.implicit_hash,
untrusted.signed_header.header.implicit_hash,
));

Verdict::Success
}

/// Validate an `UntrustedBlockState` coming from a client update,
/// based on the given `TrustedBlockState`, `Options` and current time.
pub fn validate_against_trusted(
Expand Down Expand Up @@ -309,7 +300,6 @@ where
now: Time,
) -> Verdict {
ensure_verdict_success!(self.verify_validator_sets(&untrusted));
ensure_verdict_success!(self.verify_implicit(&untrusted));
ensure_verdict_success!(self.validate_against_trusted(&untrusted, &trusted, options, now));
ensure_verdict_success!(self.check_header_is_from_past(&untrusted, options, now));
ensure_verdict_success!(self.verify_commit_against_trusted(&untrusted, &trusted, options));
Expand All @@ -328,7 +318,6 @@ where
now: Time,
) -> Verdict {
ensure_verdict_success!(self.verify_validator_sets(&untrusted));
ensure_verdict_success!(self.verify_implicit(&untrusted));
ensure_verdict_success!(self.validate_against_trusted(&untrusted, &trusted, options, now));
ensure_verdict_success!(self.verify_commit_against_trusted(&untrusted, &trusted, options));
Verdict::Success
Expand Down
7 changes: 1 addition & 6 deletions light-client/src/builder/light_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,12 +201,7 @@ where
light_block.signed_header.header.next_validators_hash,
)
.map_err(Error::invalid_light_block)?;
// self.predicates
// .implicit_hash_match(
// &light_block,
// light_block.signed_header.header.implicit_hash,
// )
// .map_err(Error::invalid_light_block)?;

Ok(())
}
}
Expand Down
Loading
Loading