mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-23 21:26:42 +00:00
feay(feynman): include history storage in witness for blockhash opcode (#1218)
* feat(feynman): include history storage in witness for blockhash * update param
This commit is contained in:
parent
3661d1841d
commit
1043f668fa
3 changed files with 9 additions and 3 deletions
|
|
@ -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()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue