Skip to content

Commit

Permalink
fix block hash check
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangchiqing committed Nov 23, 2024
1 parent b3d0864 commit 57a4a37
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion fvm/evm/offchain/blocks/block_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,11 @@ func UseBlockHashCorrection(chainID flow.ChainID, evmHeightOfCurrentBlock uint64
// array of hashes.
if chainID == flow.Mainnet && evmHeightOfCurrentBlock < blockHashListFixHCUEVMHeightMainnet {
return fixedHashes[flow.Mainnet][queriedEVMHeight%256], true
} else if chainID == flow.Testnet && blockHashListBugIntroducedHCUEVMHeightTestnet <= evmHeightOfCurrentBlock && evmHeightOfCurrentBlock < blockHashListFixHCUEVMHeightTestnet {
// TODO: look into why adding this check blockHashListBugIntroducedHCUEVMHeightTestnet <= evmHeightOfCurrentBlock would cause
// the regression of https://github.com/onflow/flow-go/issues/6552#issuecomment-2436319989
// gas consumption mismatch 3772744 != 3792644 at cadence block 217735938: EVM height: 6559268
// } else if chainID == flow.Testnet && blockHashListBugIntroducedHCUEVMHeightTestnet <= evmHeightOfCurrentBlock && evmHeightOfCurrentBlock < blockHashListFixHCUEVMHeightTestnet {
} else if chainID == flow.Testnet && evmHeightOfCurrentBlock < blockHashListFixHCUEVMHeightTestnet {
return fixedHashes[flow.Testnet][queriedEVMHeight%256], true
}
return gethCommon.Hash{}, false
Expand Down

0 comments on commit 57a4a37

Please sign in to comment.