From 95d6e41ff445b4bd82d7c3caa6a34f32cae8a657 Mon Sep 17 00:00:00 2001 From: Philippe Laferriere Date: Thu, 30 Mar 2023 14:11:02 -0400 Subject: [PATCH 1/2] add clarifying comment --- light-client-verifier/src/verifier.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/light-client-verifier/src/verifier.rs b/light-client-verifier/src/verifier.rs index 748821060..8659f2e0a 100644 --- a/light-client-verifier/src/verifier.rs +++ b/light-client-verifier/src/verifier.rs @@ -252,6 +252,11 @@ where /// **NOTE**: If the untrusted state's `next_validators` field is `None`, /// this will not (and will not be able to) check whether the untrusted /// state's `next_validators_hash` field is valid. + /// + /// **NOTE**: It is the caller's responsibility to ensure that + /// `trusted.next_validators.hash() == trusted.next_validators_hash`, + /// as typically the `trusted.next_validators` validator set comes from the relayer, + /// and `trusted.next_validators_hash` is the hash stored on chain. fn verify( &self, untrusted: UntrustedBlockState<'_>, From 35aedd2124a1d255cd91459cb3d43985b74bc73f Mon Sep 17 00:00:00 2001 From: Philippe Laferriere Date: Thu, 30 Mar 2023 15:57:58 -0400 Subject: [PATCH 2/2] fmt --- light-client-verifier/src/verifier.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/light-client-verifier/src/verifier.rs b/light-client-verifier/src/verifier.rs index 8659f2e0a..efd653bd0 100644 --- a/light-client-verifier/src/verifier.rs +++ b/light-client-verifier/src/verifier.rs @@ -252,7 +252,7 @@ where /// **NOTE**: If the untrusted state's `next_validators` field is `None`, /// this will not (and will not be able to) check whether the untrusted /// state's `next_validators_hash` field is valid. - /// + /// /// **NOTE**: It is the caller's responsibility to ensure that /// `trusted.next_validators.hash() == trusted.next_validators_hash`, /// as typically the `trusted.next_validators` validator set comes from the relayer,