@@ -31,8 +31,34 @@ impl TryFromWithInterpreter<ChunkTask> for ChunkProvingTask {
3131 ) -> Result < Self > {
3232 let mut block_witnesses = Vec :: new ( ) ;
3333 for block_hash in value. block_hashes {
34- let witness =
34+ let mut witness =
3535 interpreter. try_fetch_block_witness ( block_hash, block_witnesses. last ( ) ) ?;
36+ if witness. header . number == 1 {
37+ use std:: str:: FromStr ;
38+ let hacked_state_root = match witness. chain_id {
39+ // cloak-xen-sequencer.sepolia
40+ 5343513301 => Some ( B256 :: from_str (
41+ "0x0711f02d6f85b0597c4705298e01ee27159fdd8bd8bdeda670ae8b9073091246" ,
42+ ) ?) ,
43+ // cloak-etherfi-sequencer.sepolia
44+ 5343513302 => Some ( B256 :: from_str (
45+ "0x7b44ea23770dda8810801779eb6847d56be0399e35de7c56465ccf8b7578ddf6" ,
46+ ) ?) ,
47+ // cloak-shiga-sequencer.sepolia
48+ 5343513303 => Some ( B256 :: from_str (
49+ "0x05973227854ac82c22f164ed3d4510b7df516a0eecdfd9bed5f2446efc9994b9" ,
50+ ) ?) ,
51+ // cloak-xen-sequencer.mainnet
52+ 5343523301 => Some ( B256 :: from_str (
53+ "0x8da1aaf41660ddf7870ab5ff4f6a3ab4b2e652568d341ede87ada56aad5fb097" ,
54+ ) ?) ,
55+ _ => None ,
56+ } ;
57+ if let Some ( hacked_state_root) = hacked_state_root {
58+ witness. prev_state_root = hacked_state_root;
59+ tracing:: warn!( "hack genesis state root {:?} for cloak testnet to work around a wrong gensis configuration" , witness. prev_state_root) ;
60+ }
61+ }
3662 block_witnesses. push ( witness) ;
3763 }
3864
@@ -179,7 +205,7 @@ impl ChunkProvingTask {
179205
180206 pub fn precheck_and_build_metadata ( & self ) -> Result < ChunkInfo > {
181207 let witness = self . build_guest_input ( ) ;
182- Ok ( ChunkInfo :: try_from ( witness) . map_err ( |e| eyre:: eyre!( "{e}" ) ) ? )
208+ ChunkInfo :: try_from ( witness) . map_err ( |e| eyre:: eyre!( "{e}" ) )
183209 }
184210
185211 /// this method check the validate of current task (there may be missing storage node)
0 commit comments