@@ -61,6 +61,7 @@ func handleStateForNewBlockStarting(
6161 l1BlockHash := ibs .ReadGerManagerL1BlockHash (l1info .GER )
6262 if l1BlockHash == (common.Hash {}) {
6363 // not in the contract so let's write it!
64+ log .Info (fmt .Sprintf ("[%s] Writing GER manager L1 block hash to Intra Block State" , batchContext .s .LogPrefix ()), "ger" , l1info .GER .String (), "l1BlockHash" , l1info .ParentHash .String ())
6465 ibs .WriteGerManagerL1BlockHash (l1info .GER , l1info .ParentHash )
6566 if err := hermezDb .WriteLatestUsedGer (blockNumber , l1info .GER ); err != nil {
6667 return err
@@ -200,16 +201,21 @@ func finaliseBlock(
200201 var commitmentToLog string
201202 if batchContext .cfg .chainConfig .IsPmtEnabled (newHeader .Number .Uint64 ()) {
202203 commitmentToLog = "pmt"
203- if err = stagedsync .HashStateFromTo (batchContext .s .LogPrefix (), batchContext .sdb .tx , batchContext .cfg .hashStateCfg , newHeader .Number .Uint64 ()- 1 , newHeader .Number .Uint64 (), batchContext .ctx , log .Root ()); err != nil {
204+ logger := log .New ()
205+ log .Info (fmt .Sprintf ("[%s] [SR-DEBUG] Hashing State for the PMT" , batchContext .s .LogPrefix ()), "startingBlock" , newHeader .Number .Uint64 ()- 1 , "endingBlock" , newHeader .Number .Uint64 ())
206+ if err = stagedsync .HashStateFromTo (batchContext .s .LogPrefix (), batchContext .sdb .tx , batchContext .cfg .hashStateCfg , newHeader .Number .Uint64 ()- 1 , newHeader .Number .Uint64 (), batchContext .ctx , logger ); err != nil {
204207 return nil , err
205208 }
206209
207- newRoot , err = stagedsync .IncrementIntermediateHashes (batchContext .s .LogPrefix (), batchContext .s , batchContext .sdb .tx , thisBlockNumber , trieConfigSequencer (batchContext .cfg .intersCfg ), common.Hash {}, quit , log .Root ())
210+ log .Info (fmt .Sprintf ("[%s] [SR-DEBUG] IncrementIntermediateHashes for the PMT" , batchContext .s .LogPrefix ()), "startingBlock" , batchContext .s .BlockNumber , "endingBlock" , thisBlockNumber )
211+ newRoot , err = stagedsync .IncrementIntermediateHashes (batchContext .s .LogPrefix (), batchContext .s , batchContext .sdb .tx , thisBlockNumber , trieConfigSequencer (batchContext .cfg .intersCfg ), common.Hash {}, quit , logger )
208212 } else {
213+ log .Info (fmt .Sprintf ("[%s] [SR-DEBUG] IncrementIntermediateHashes for the SMT" , batchContext .s .LogPrefix ()), "startingBlock" , newHeader .Number .Uint64 ()- 1 , "endingBlock" , newHeader .Number .Uint64 ())
209214 commitmentToLog = "smt"
210215 newRoot , err = zkIncrementIntermediateHashes_v2_Forwards (batchContext .ctx , batchContext .cfg .dirs .Tmp , batchContext .s .LogPrefix (), batchContext .s , batchContext .sdb .tx , newHeader .Number .Uint64 ()- 1 , newHeader .Number .Uint64 ())
211216 }
212217 if err != nil {
218+ log .Error (fmt .Sprintf ("[%s] [SR-DEBUG] IncrementIntermediateHashes failed" , batchContext .s .LogPrefix ()), "err" , err )
213219 batchContext .sdb .eridb .RollbackBatch ()
214220 return nil , err
215221 }
0 commit comments