diff --git a/core/vm/instructions.go b/core/vm/instructions.go index 8027afae76..6bb58fb5ee 100644 --- a/core/vm/instructions.go +++ b/core/vm/instructions.go @@ -490,6 +490,13 @@ func opBlockhashPostFeynman(pc *uint64, interpreter *EVMInterpreter, scope *Scop witness.AddBlockHash(num64) } num.SetBytes(res[:]) + + // for provability, revm loads block hash from the history storage system contract, + // so we need to ensure that the corresponding slot is present in the execution witness. + ringIndex := num64 % params.HistoryServeWindow + var key common.Hash + binary.BigEndian.PutUint64(key[24:], ringIndex) + interpreter.evm.StateDB.GetState(params.HistoryStorageAddress, key) } else { num.Clear() } diff --git a/params/protocol_params.go b/params/protocol_params.go index d3250d0dab..7f3893ddb9 100644 --- a/params/protocol_params.go +++ b/params/protocol_params.go @@ -174,8 +174,6 @@ const ( BlobTxBlobGaspriceUpdateFraction = 5007716 // Controls the maximum rate of change for blob gas price, using Prague parameters BlobTxTargetBlobGasPerBlock = 6 * BlobTxBlobGasPerBlob // Target consumable blob gas for data blobs per block (for 1559-like pricing), using Prague parameters - - HistoryServeWindow = 8192 // Number of blocks to serve historical block hashes for, EIP-2935. ) // Gas discount table for BLS12-381 G1 and G2 multi exponentiation operations @@ -197,4 +195,5 @@ var ( // EIP-2935 - Serve historical block hashes from state HistoryStorageAddress = common.HexToAddress("0x0000F90827F1C53a10cb7A02335B175320002935") HistoryStorageCode = common.FromHex("3373fffffffffffffffffffffffffffffffffffffffe14604657602036036042575f35600143038111604257611fff81430311604257611fff9006545f5260205ff35b5f5ffd5b5f35611fff60014303065500") + HistoryServeWindow = uint64(8191) ) diff --git a/params/version.go b/params/version.go index 9a15803210..d6b46fa231 100644 --- a/params/version.go +++ b/params/version.go @@ -24,7 +24,7 @@ import ( const ( VersionMajor = 5 // Major version component of the current release VersionMinor = 8 // Minor version component of the current release - VersionPatch = 63 // Patch version component of the current release + VersionPatch = 64 // Patch version component of the current release VersionMeta = "mainnet" // Version metadata to append to the version string )