Skip to content

Commit 1b11b94

Browse files
authored
Merge pull request #444 from OffchainLabs/eip_2935_fix
Do not call ProcessParentBlockHash during process
2 parents e6c8bea + 6c0a409 commit 1b11b94

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

core/state_processor.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,9 @@ func (p *StateProcessor) Process(block *types.Block, statedb *state.StateDB, cfg
8585
if beaconRoot := block.BeaconRoot(); beaconRoot != nil {
8686
ProcessBeaconBlockRoot(*beaconRoot, evm)
8787
}
88-
if p.config.IsPrague(block.Number(), block.Time(), context.ArbOSVersion) || p.config.IsVerkle(block.Number(), block.Time()) {
88+
// We do not need to process the parent block hash if we are on Arbitrum.
89+
// This is taken care of in the while we process the arbitrum internal transaction.
90+
if !p.config.IsArbitrum() && (p.config.IsPrague(block.Number(), block.Time(), context.ArbOSVersion) || p.config.IsVerkle(block.Number(), block.Time())) {
8991
ProcessParentBlockHash(block.ParentHash(), evm)
9092
}
9193

params/protocol_params.go

+6-1
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,12 @@ var (
204204

205205
// EIP-2935 - Serve historical block hashes from state
206206
HistoryStorageAddress = common.HexToAddress("0x0000F90827F1C53a10cb7A02335B175320002935")
207-
HistoryStorageCode = common.FromHex("3373fffffffffffffffffffffffffffffffffffffffe14604857602036036044575f356001430381116044576205ffd0814303116044576205ffd09006545f5260205ff35b5f5ffd5b5f356205ffd060014303065500")
207+
HistoryStorageCode = common.FromHex("3373fffffffffffffffffffffffffffffffffffffffe14604657602036036042575f35600143038111604257611fff81430311604257611fff9006545f5260205ff35b5f5ffd5b5f35611fff60014303065500")
208+
// EIP-2935 - Serve historical block hashes from state (Arbitrum), majorly differ from the original in two aspects:
209+
// 1. The buffer size is 393168 blocks instead of 8191.
210+
// 2. Instead of using number (L1 block number), it uses arb_block_num (L2 block number).
211+
// https://github.com/OffchainLabs/sys-asm/blob/main/src/execution_hash/main.eas
212+
HistoryStorageCodeArbitrum = common.FromHex("3373fffffffffffffffffffffffffffffffffffffffe14607657602036036072575f35600163a3b1b31d5f5260205f6004601c60645afa156072575f510381116072576205ffd08163a3b1b31d5f5260205f6004601c60645afa156072575f5103116072576205ffd09006545f5260205ff35b5f5ffd5b5f356205ffd0600163a3b1b31d5f5260205f6004601c60645afa156072575f5103065500")
208213

209214
// EIP-7002 - Execution layer triggerable withdrawals
210215
WithdrawalQueueAddress = common.HexToAddress("0x00000961Ef480Eb55e80D19ad83579A64c007002")

0 commit comments

Comments
 (0)