Skip to content

Commit

Permalink
issue warning if calculated blockhash mismatched the datastream one (0…
Browse files Browse the repository at this point in the history
  • Loading branch information
V-Staykov authored Jun 6, 2024
1 parent 44e595b commit 55846ff
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion eth/stagedsync/stage_execute_zkevm.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,16 @@ Loop:

// exec loop variables
header := block.HeaderNoCopy()
preChangeBlockHash := header.Hash()
header.GasUsed = uint64(execRs.GasUsed)
header.ReceiptHash = types.DeriveSha(execRs.Receipts)
header.Bloom = execRs.Bloom
newBlockHash := block.Hash()
if cfg.chainConfig.IsForkId9Elderberry2(blockNum) && preChangeBlockHash != newBlockHash {
log.Warn(fmt.Sprintf("[%s] Blockhash mismatch", s.LogPrefix()), "datastreamBlockHash", preChangeBlockHash, "calculatedBlockHash", newBlockHash)
}
// don't move above header values setting - wrong hash will be calculated
prevBlockHash = header.Hash()
prevBlockHash = newBlockHash
prevBlockRoot = header.Root
stageProgress = blockNum
currentStateGas = currentStateGas + header.GasUsed
Expand Down

0 comments on commit 55846ff

Please sign in to comment.