Skip to content

Commit db790f4

Browse files
authored
Merge branch 'develop' into feat/forward-txs-to-sequencer
2 parents d23b71f + 1043f66 commit db790f4

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

core/vm/instructions.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,13 @@ func opBlockhashPostFeynman(pc *uint64, interpreter *EVMInterpreter, scope *Scop
490490
witness.AddBlockHash(num64)
491491
}
492492
num.SetBytes(res[:])
493+
494+
// for provability, revm loads block hash from the history storage system contract,
495+
// so we need to ensure that the corresponding slot is present in the execution witness.
496+
ringIndex := num64 % params.HistoryServeWindow
497+
var key common.Hash
498+
binary.BigEndian.PutUint64(key[24:], ringIndex)
499+
interpreter.evm.StateDB.GetState(params.HistoryStorageAddress, key)
493500
} else {
494501
num.Clear()
495502
}

params/protocol_params.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,6 @@ const (
174174
BlobTxBlobGaspriceUpdateFraction = 5007716 // Controls the maximum rate of change for blob gas price, using Prague parameters
175175

176176
BlobTxTargetBlobGasPerBlock = 6 * BlobTxBlobGasPerBlob // Target consumable blob gas for data blobs per block (for 1559-like pricing), using Prague parameters
177-
178-
HistoryServeWindow = 8192 // Number of blocks to serve historical block hashes for, EIP-2935.
179177
)
180178

181179
// Gas discount table for BLS12-381 G1 and G2 multi exponentiation operations
@@ -197,4 +195,5 @@ var (
197195
// EIP-2935 - Serve historical block hashes from state
198196
HistoryStorageAddress = common.HexToAddress("0x0000F90827F1C53a10cb7A02335B175320002935")
199197
HistoryStorageCode = common.FromHex("3373fffffffffffffffffffffffffffffffffffffffe14604657602036036042575f35600143038111604257611fff81430311604257611fff9006545f5260205ff35b5f5ffd5b5f35611fff60014303065500")
198+
HistoryServeWindow = uint64(8191)
200199
)

0 commit comments

Comments
 (0)