@@ -20,7 +20,6 @@ use blobstream0_primitives::{
20
20
IBlobstream :: IBlobstreamInstance ,
21
21
LightBlockProveData , RangeCommitment ,
22
22
} ;
23
- use light_client_guest:: LIGHT_CLIENT_GUEST_ELF ;
24
23
use risc0_ethereum_contracts:: groth16;
25
24
use risc0_zkvm:: { default_prover, is_dev_mode, sha:: Digestible , ExecutorEnv , ProverOpts , Receipt } ;
26
25
use std:: { ops:: Range , sync:: Arc , time:: Duration } ;
@@ -34,6 +33,15 @@ use tracing::{instrument, Level};
34
33
mod range_iterator;
35
34
use range_iterator:: LightBlockRangeIterator ;
36
35
36
+ // This is configured to use the default docker build path. The reason for the feature flag is
37
+ // because we want a consistent docker image to build the program, which should not be run within
38
+ // the dockerized service container.
39
+ #[ cfg( feature = "prebuilt-docker" ) ]
40
+ const LIGHT_CLIENT_GUEST_ELF : & [ u8 ] =
41
+ include_bytes ! ( "../../target/riscv-guest/riscv32im-risc0-zkvm-elf/docker/light_client_guest/light-client-guest" ) ;
42
+ #[ cfg( not( feature = "prebuilt-docker" ) ) ]
43
+ use light_client_guest:: LIGHT_CLIENT_GUEST_ELF ;
44
+
37
45
/// Currently set to the max allowed by tendermint RPC
38
46
const HEADER_REQ_COUNT : u64 = 20 ;
39
47
@@ -144,6 +152,7 @@ pub async fn prove_block(input: LightBlockProveData) -> anyhow::Result<Receipt>
144
152
) ;
145
153
let expected_next_hash = input. untrusted_block . signed_header . header ( ) . hash ( ) ;
146
154
let expected_next_height = input. untrusted_height ( ) ;
155
+ let expected_trusted_hash = input. trusted_block . signed_header . header ( ) . hash ( ) ;
147
156
148
157
TrustedLightBlock {
149
158
signed_header : input. trusted_block . signed_header ,
@@ -183,6 +192,10 @@ pub async fn prove_block(input: LightBlockProveData) -> anyhow::Result<Receipt>
183
192
// Assert that what is proven is expected based on the inputs.
184
193
assert_eq ! ( expected_next_hash. as_bytes( ) , commitment. newHeaderHash) ;
185
194
assert_eq ! ( expected_next_height, commitment. newHeight) ;
195
+ assert_eq ! (
196
+ expected_trusted_hash. as_bytes( ) ,
197
+ commitment. trustedHeaderHash. as_slice( )
198
+ ) ;
186
199
187
200
Ok ( receipt)
188
201
}
0 commit comments