Skip to content

Commit 5657139

Browse files
authored
Merge pull request #434 from OffchainLabs/up-dev-arbos40
Add detection of Arbos Version to the evaluation of IsPrauge
2 parents 9f4bc5c + bc0dc5b commit 5657139

File tree

26 files changed

+104
-73
lines changed

26 files changed

+104
-73
lines changed

arbitrum/conditionaltx.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ func SubmitConditionalTransaction(ctx context.Context, b *APIBackend, tx *types.
4444
return common.Hash{}, err
4545
}
4646
// Print a log with full tx details for manual investigations and interventions
47-
signer := types.MakeSigner(b.ChainConfig(), b.CurrentBlock().Number, b.CurrentBlock().Time)
47+
arbosVersion := types.DeserializeHeaderExtraInformation(b.CurrentBlock()).ArbOSFormatVersion
48+
signer := types.MakeSigner(b.ChainConfig(), b.CurrentBlock().Number, b.CurrentBlock().Time, arbosVersion)
4849
from, err := types.Sender(signer, tx)
4950
if err != nil {
5051
return common.Hash{}, err

cmd/evm/internal/t8ntool/execution.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ func (pre *Prestate) Apply(vmConfig vm.Config, chainConfig *params.ChainConfig,
147147
}
148148
var (
149149
statedb = MakePreState(rawdb.NewMemoryDatabase(), pre.Pre)
150-
signer = types.MakeSigner(chainConfig, new(big.Int).SetUint64(pre.Env.Number), pre.Env.Timestamp)
150+
signer = types.MakeSigner(chainConfig, new(big.Int).SetUint64(pre.Env.Number), pre.Env.Timestamp, params.MaxArbosVersionSupported)
151151
gaspool = new(core.GasPool)
152152
blockHash = common.Hash{0x13, 0x37}
153153
rejectedTxs []*rejectedTx
@@ -216,7 +216,7 @@ func (pre *Prestate) Apply(vmConfig vm.Config, chainConfig *params.ChainConfig,
216216
if beaconRoot := pre.Env.ParentBeaconBlockRoot; beaconRoot != nil {
217217
core.ProcessBeaconBlockRoot(*beaconRoot, evm)
218218
}
219-
if pre.Env.BlockHashes != nil && chainConfig.IsPrague(new(big.Int).SetUint64(pre.Env.Number), pre.Env.Timestamp) {
219+
if pre.Env.BlockHashes != nil && chainConfig.IsPrague(new(big.Int).SetUint64(pre.Env.Number), pre.Env.Timestamp, vmContext.ArbOSVersion) {
220220
var (
221221
prevNumber = pre.Env.Number - 1
222222
prevHash = pre.Env.BlockHashes[math.HexOrDecimal64(prevNumber)]
@@ -355,7 +355,8 @@ func (pre *Prestate) Apply(vmConfig vm.Config, chainConfig *params.ChainConfig,
355355

356356
// Gather the execution-layer triggered requests.
357357
var requests [][]byte
358-
if chainConfig.IsPrague(vmContext.BlockNumber, vmContext.Time) {
358+
// Arbitrum doesn't support Deposit/Withdrawal/Consolidation requests.
359+
if !chainConfig.IsArbitrum() && chainConfig.IsPrague(vmContext.BlockNumber, vmContext.Time, vmContext.ArbOSVersion) {
359360
requests = [][]byte{}
360361
// EIP-6110
361362
var allLogs []*types.Log

cmd/evm/internal/t8ntool/transaction.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ func Transaction(ctx *cli.Context) error {
105105
return NewError(ErrorIO, errors.New("only rlp supported"))
106106
}
107107
}
108-
signer := types.MakeSigner(chainConfig, new(big.Int), 0)
108+
signer := types.MakeSigner(chainConfig, new(big.Int), 0, params.MaxArbosVersionSupported)
109109

110110
// We now have the transactions in 'body', which is supposed to be an
111111
// rlp list of transactions

consensus/misc/eip4844/eip4844.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,8 @@ func MaxBlobsPerBlock(cfg *params.ChainConfig, time uint64) int {
107107
switch {
108108
case cfg.IsOsaka(london, time) && s.Osaka != nil:
109109
return s.Osaka.Max
110-
case cfg.IsPrague(london, time) && s.Prague != nil:
110+
// we can use 0 here because arbitrum doesn't support Blob transactions.
111+
case cfg.IsPrague(london, time, 0) && s.Prague != nil:
111112
return s.Prague.Max
112113
// we can use 0 here because arbitrum doesn't support Blob transactions.
113114
case cfg.IsCancun(london, time, 0) && s.Cancun != nil:
@@ -153,7 +154,8 @@ func targetBlobsPerBlock(cfg *params.ChainConfig, time uint64) int {
153154
switch {
154155
case cfg.IsOsaka(london, time) && s.Osaka != nil:
155156
return s.Osaka.Target
156-
case cfg.IsPrague(london, time) && s.Prague != nil:
157+
// we can use 0 here because arbitrum doesn't support Blob transactions.
158+
case cfg.IsPrague(london, time, 0) && s.Prague != nil:
157159
return s.Prague.Target
158160
// we can use 0 here because arbitrum doesn't support Blob transactions.
159161
case cfg.IsCancun(london, time, 0) && s.Cancun != nil:

core/blockchain.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1743,7 +1743,8 @@ func (bc *BlockChain) insertChain(chain types.Blocks, setHead bool, makeWitness
17431743
return nil, 0, nil
17441744
}
17451745
// Start a parallel signature recovery (signer will fluke on fork transition, minimal perf loss)
1746-
SenderCacher().RecoverFromBlocks(types.MakeSigner(bc.chainConfig, chain[0].Number(), chain[0].Time()), chain)
1746+
arbosVersion := types.DeserializeHeaderExtraInformation(chain[0].Header()).ArbOSFormatVersion
1747+
SenderCacher().RecoverFromBlocks(types.MakeSigner(bc.chainConfig, chain[0].Number(), chain[0].Time(), arbosVersion), chain)
17471748

17481749
var (
17491750
stats = insertStats{startTime: mclock.Now()}

core/chain_makers.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,8 @@ func (b *BlockGen) Gas() uint64 {
201201

202202
// Signer returns a valid signer instance for the current block.
203203
func (b *BlockGen) Signer() types.Signer {
204-
return types.MakeSigner(b.cm.config, b.header.Number, b.header.Time)
204+
arbosVersion := types.DeserializeHeaderExtraInformation(b.header).ArbOSFormatVersion
205+
return types.MakeSigner(b.cm.config, b.header.Number, b.header.Time, arbosVersion)
205206
}
206207

207208
// AddUncheckedReceipt forcefully adds a receipts to the block without a
@@ -314,7 +315,9 @@ func (b *BlockGen) collectRequests(readonly bool) (requests [][]byte) {
314315
statedb = statedb.Copy()
315316
}
316317

317-
if b.cm.config.IsPrague(b.header.Number, b.header.Time) {
318+
arbosVersion := types.DeserializeHeaderExtraInformation(b.header).ArbOSFormatVersion
319+
// Arbitrum doesn't support Deposit, Withdrawal, or Consolidation requests.
320+
if !b.cm.config.IsArbitrum() && b.cm.config.IsPrague(b.header.Number, b.header.Time, arbosVersion) {
318321
requests = [][]byte{}
319322
// EIP-6110 deposits
320323
var blockLogs []*types.Log
@@ -386,9 +389,9 @@ func GenerateChain(config *params.ChainConfig, parent *types.Block, engine conse
386389
misc.ApplyDAOHardFork(statedb)
387390
}
388391

389-
if config.IsPrague(b.header.Number, b.header.Time) || config.IsVerkle(b.header.Number, b.header.Time) {
392+
blockContext := NewEVMBlockContext(b.header, cm, &b.header.Coinbase)
393+
if config.IsPrague(b.header.Number, b.header.Time, blockContext.ArbOSVersion) || config.IsVerkle(b.header.Number, b.header.Time) {
390394
// EIP-2935
391-
blockContext := NewEVMBlockContext(b.header, cm, &b.header.Coinbase)
392395
blockContext.Random = &common.Hash{} // enable post-merge instruction set
393396
evm := vm.NewEVM(blockContext, statedb, cm.config, vm.Config{})
394397
ProcessParentBlockHash(b.header.ParentHash, evm)

core/genesis.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ func (g *Genesis) toBlockWithRoot(root common.Hash) *types.Block {
508508
head.BlobGasUsed = new(uint64)
509509
}
510510
}
511-
if conf.IsPrague(num, g.Timestamp) {
511+
if conf.IsPrague(num, g.Timestamp, arbosVersion) {
512512
head.RequestsHash = &types.EmptyRequestsHash
513513
}
514514
}

core/state_prefetcher.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ func (p *statePrefetcher) Prefetch(block *types.Block, statedb *state.StateDB, c
5050
gaspool = new(GasPool).AddGas(block.GasLimit())
5151
blockContext = NewEVMBlockContext(header, p.chain, nil)
5252
evm = vm.NewEVM(blockContext, statedb, p.config, cfg)
53-
signer = types.MakeSigner(p.config, header.Number, header.Time)
53+
signer = types.MakeSigner(p.config, header.Number, header.Time, blockContext.ArbOSVersion)
5454
)
5555
// Iterate over and process the individual transactions
5656
byzantium := p.config.IsByzantium(block.Number())

core/state_processor.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ func (p *StateProcessor) Process(block *types.Block, statedb *state.StateDB, cfg
7070
}
7171
var (
7272
context vm.BlockContext
73-
signer = types.MakeSigner(p.config, header.Number, header.Time)
7473
)
7574

7675
// Apply pre-execution system calls.
@@ -81,10 +80,12 @@ func (p *StateProcessor) Process(block *types.Block, statedb *state.StateDB, cfg
8180
context = NewEVMBlockContext(header, p.chain, nil)
8281
evm := vm.NewEVM(context, tracingStateDB, p.config, cfg)
8382

83+
signer := types.MakeSigner(p.config, header.Number, header.Time, context.ArbOSVersion)
84+
8485
if beaconRoot := block.BeaconRoot(); beaconRoot != nil {
8586
ProcessBeaconBlockRoot(*beaconRoot, evm)
8687
}
87-
if p.config.IsPrague(block.Number(), block.Time()) || p.config.IsVerkle(block.Number(), block.Time()) {
88+
if p.config.IsPrague(block.Number(), block.Time(), context.ArbOSVersion) || p.config.IsVerkle(block.Number(), block.Time()) {
8889
ProcessParentBlockHash(block.ParentHash(), evm)
8990
}
9091

@@ -106,7 +107,8 @@ func (p *StateProcessor) Process(block *types.Block, statedb *state.StateDB, cfg
106107

107108
// Read requests if Prague is enabled.
108109
var requests [][]byte
109-
if p.config.IsPrague(block.Number(), block.Time()) {
110+
// Arbitrum has no Deposit, Witdrawal, or Consolidation requests.
111+
if !p.config.IsArbitrum() && p.config.IsPrague(block.Number(), block.Time(), context.ArbOSVersion) {
110112
requests = [][]byte{}
111113
// EIP-6110
112114
if err := ParseDepositLogs(&requests, allLogs, p.config); err != nil {
@@ -213,7 +215,7 @@ func ApplyTransaction(evm *vm.EVM, gp *GasPool, statedb *state.StateDB, header *
213215
}
214216

215217
func ApplyTransactionWithResultFilter(evm *vm.EVM, gp *GasPool, statedb *state.StateDB, header *types.Header, tx *types.Transaction, usedGas *uint64, runMode MessageRunMode, resultFilter func(*ExecutionResult) error) (*types.Receipt, *ExecutionResult, error) {
216-
msg, err := TransactionToMessage(tx, types.MakeSigner(evm.ChainConfig(), header.Number, header.Time), header.BaseFee, runMode)
218+
msg, err := TransactionToMessage(tx, types.MakeSigner(evm.ChainConfig(), header.Number, header.Time, evm.Context.ArbOSVersion), header.BaseFee, runMode)
217219
if err != nil {
218220
return nil, nil, err
219221
}

core/txpool/validation.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ func ValidateTransaction(tx *types.Transaction, head *types.Header, signer types
121121
return fmt.Errorf("%w: gas %v, minimum needed %v", core.ErrIntrinsicGas, tx.Gas(), intrGas)
122122
}
123123
// Ensure the transaction can cover floor data gas.
124-
if opts.Config.IsPrague(head.Number, head.Time) {
124+
if opts.Config.IsPrague(head.Number, head.Time, arbosVersion) {
125125
floorDataGas, err := core.FloorDataGas(tx.Data())
126126
if err != nil {
127127
return err

core/types/receipt.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ func (rs Receipts) EncodeIndex(i int, w *bytes.Buffer) {
400400
// DeriveFields fills the receipts with their computed fields based on consensus
401401
// data and contextual infos like containing block and transactions.
402402
func (rs Receipts) DeriveFields(config *params.ChainConfig, hash common.Hash, number uint64, time uint64, baseFee *big.Int, blobGasPrice *big.Int, txs []*Transaction) error {
403-
signer := MakeSigner(config, new(big.Int).SetUint64(number), time)
403+
signer := MakeSigner(config, new(big.Int).SetUint64(number), time, params.MaxArbosVersionSupported)
404404

405405
logIndex := uint(0)
406406
if len(txs) != len(rs) {

core/types/transaction_signing.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,15 @@ type sigCache struct {
3737
}
3838

3939
// MakeSigner returns a Signer based on the given chain config and block number.
40-
func MakeSigner(config *params.ChainConfig, blockNumber *big.Int, blockTime uint64) Signer {
40+
//
41+
// Arbitrum: If the signer is being used in any state-transition affecting code,
42+
// then the active arbos version must be passed in. In places which don't affect
43+
// the state transition function, it is okay to pass in
44+
// params.MaxArbosVersionSupported.
45+
func MakeSigner(config *params.ChainConfig, blockNumber *big.Int, blockTime uint64, arbosVersion uint64) Signer {
4146
var signer Signer
4247
switch {
43-
case config.IsPrague(blockNumber, blockTime):
48+
case config.IsPrague(blockNumber, blockTime, arbosVersion):
4449
signer = NewPragueSigner(config.ChainID)
4550
// we can use 0 here because arbitrum doesn't support Blob transactions.
4651
case config.IsCancun(blockNumber, blockTime, 0):

eth/downloader/queue_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ func makeChain(n int, seed byte, parent *types.Block, empty bool) ([]*types.Bloc
4444
block.SetCoinbase(common.Address{seed})
4545
// Add one tx to every secondblock
4646
if !empty && i%2 == 0 {
47-
signer := types.MakeSigner(params.TestChainConfig, block.Number(), block.Timestamp())
47+
signer := types.MakeSigner(params.TestChainConfig, block.Number(), block.Timestamp(), params.MaxArbosVersionSupported)
4848
tx, err := types.SignTx(types.NewTransaction(block.TxNonce(testAddress), common.Address{seed}, big.NewInt(1000), params.TxGas, block.BaseFee(), nil), signer, testKey)
4949
if err != nil {
5050
panic(err)

eth/downloader/testchain_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ func (tc *testChain) generate(n int, seed byte, parent *types.Block, heavy bool)
168168
}
169169
// Include transactions to the miner to make blocks more interesting.
170170
if parent == tc.blocks[0] && i%22 == 0 {
171-
signer := types.MakeSigner(params.TestChainConfig, block.Number(), block.Timestamp())
171+
signer := types.MakeSigner(params.TestChainConfig, block.Number(), block.Timestamp(), params.MaxArbosVersionSupported)
172172
tx, err := types.SignTx(types.NewTransaction(block.TxNonce(testAddress), common.Address{seed}, big.NewInt(1000), params.TxGas, block.BaseFee(), nil), signer, testKey)
173173
if err != nil {
174174
panic(err)

eth/gasprice/gasprice.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,8 @@ func (oracle *Oracle) getBlockValues(ctx context.Context, blockNum uint64, limit
250250
}
251251
return
252252
}
253-
signer := types.MakeSigner(oracle.backend.ChainConfig(), block.Number(), block.Time())
253+
arbosVersion := types.DeserializeHeaderExtraInformation(block.Header()).ArbOSFormatVersion
254+
signer := types.MakeSigner(oracle.backend.ChainConfig(), block.Number(), block.Time(), arbosVersion)
254255

255256
// Sort the transaction by effective tip in ascending sort.
256257
txs := block.Transactions()

eth/state_accessor.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,14 +261,14 @@ func (eth *Ethereum) stateAtTransaction(ctx context.Context, block *types.Block,
261261
core.ProcessBeaconBlockRoot(*beaconRoot, evm)
262262
}
263263
// If prague hardfork, insert parent block hash in the state as per EIP-2935.
264-
if eth.blockchain.Config().IsPrague(block.Number(), block.Time()) {
264+
if eth.blockchain.Config().IsPrague(block.Number(), block.Time(), context.ArbOSVersion) {
265265
core.ProcessParentBlockHash(block.ParentHash(), evm)
266266
}
267267
if txIndex == 0 && len(block.Transactions()) == 0 {
268268
return nil, vm.BlockContext{}, statedb, release, nil
269269
}
270270
// Recompute transactions up to the target index.
271-
signer := types.MakeSigner(eth.blockchain.Config(), block.Number(), block.Time())
271+
signer := types.MakeSigner(eth.blockchain.Config(), block.Number(), block.Time(), evm.Context.ArbOSVersion)
272272
for idx, tx := range block.Transactions() {
273273
if idx == txIndex {
274274
return tx, context, statedb, release, nil

eth/tracers/api.go

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -271,8 +271,8 @@ func (api *API) traceChain(start, end *types.Block, config *TraceConfig, closed
271271
// Fetch and execute the block trace taskCh
272272
for task := range taskCh {
273273
var (
274-
signer = types.MakeSigner(api.backend.ChainConfig(), task.block.Number(), task.block.Time())
275274
blockCtx = core.NewEVMBlockContext(task.block.Header(), api.chainContext(ctx), nil)
275+
signer = types.MakeSigner(api.backend.ChainConfig(), task.block.Number(), task.block.Time(), blockCtx.ArbOSVersion)
276276
)
277277
// Trace all the transactions contained within
278278
for i, tx := range task.block.Transactions() {
@@ -389,7 +389,7 @@ func (api *API) traceChain(start, end *types.Block, config *TraceConfig, closed
389389
core.ProcessBeaconBlockRoot(*beaconRoot, evm)
390390
}
391391
// Insert parent hash in history contract.
392-
if api.backend.ChainConfig().IsPrague(next.Number(), next.Time()) {
392+
if api.backend.ChainConfig().IsPrague(next.Number(), next.Time(), context.ArbOSVersion) {
393393
core.ProcessParentBlockHash(next.ParentHash(), evm)
394394
}
395395
// Clean out any pending release functions of trace state. Note this
@@ -535,16 +535,16 @@ func (api *API) IntermediateRoots(ctx context.Context, hash common.Hash, config
535535
defer release()
536536
var (
537537
roots []common.Hash
538-
signer = types.MakeSigner(api.backend.ChainConfig(), block.Number(), block.Time())
539-
chainConfig = api.backend.ChainConfig()
540538
vmctx = core.NewEVMBlockContext(block.Header(), api.chainContext(ctx), nil)
539+
signer = types.MakeSigner(api.backend.ChainConfig(), block.Number(), block.Time(), vmctx.ArbOSVersion)
540+
chainConfig = api.backend.ChainConfig()
541541
deleteEmptyObjects = chainConfig.IsEIP158(block.Number())
542542
)
543543
evm := vm.NewEVM(vmctx, statedb, chainConfig, vm.Config{})
544544
if beaconRoot := block.BeaconRoot(); beaconRoot != nil {
545545
core.ProcessBeaconBlockRoot(*beaconRoot, evm)
546546
}
547-
if chainConfig.IsPrague(block.Number(), block.Time()) {
547+
if chainConfig.IsPrague(block.Number(), block.Time(), vmctx.ArbOSVersion) {
548548
core.ProcessParentBlockHash(block.ParentHash(), evm)
549549
}
550550
for i, tx := range block.Transactions() {
@@ -608,7 +608,7 @@ func (api *API) traceBlock(ctx context.Context, block *types.Block, config *Trac
608608
if beaconRoot := block.BeaconRoot(); beaconRoot != nil {
609609
core.ProcessBeaconBlockRoot(*beaconRoot, evm)
610610
}
611-
if api.backend.ChainConfig().IsPrague(block.Number(), block.Time()) {
611+
if api.backend.ChainConfig().IsPrague(block.Number(), block.Time(), blockCtx.ArbOSVersion) {
612612
core.ProcessParentBlockHash(block.ParentHash(), evm)
613613
}
614614

@@ -622,10 +622,11 @@ func (api *API) traceBlock(ctx context.Context, block *types.Block, config *Trac
622622
}
623623
// Native tracers have low overhead
624624
var (
625-
txs = block.Transactions()
626-
blockHash = block.Hash()
627-
signer = types.MakeSigner(api.backend.ChainConfig(), block.Number(), block.Time())
628-
results = make([]*txTraceResult, len(txs))
625+
txs = block.Transactions()
626+
blockHash = block.Hash()
627+
arbosVersion = types.DeserializeHeaderExtraInformation(block.Header()).ArbOSFormatVersion
628+
signer = types.MakeSigner(api.backend.ChainConfig(), block.Number(), block.Time(), arbosVersion)
629+
results = make([]*txTraceResult, len(txs))
629630
)
630631
for i, tx := range txs {
631632
// Generate the next state snapshot fast without tracing
@@ -651,11 +652,12 @@ func (api *API) traceBlock(ctx context.Context, block *types.Block, config *Trac
651652
func (api *API) traceBlockParallel(ctx context.Context, block *types.Block, statedb *state.StateDB, config *TraceConfig) ([]*txTraceResult, error) {
652653
// Execute all the transaction contained within the block concurrently
653654
var (
654-
txs = block.Transactions()
655-
blockHash = block.Hash()
656-
signer = types.MakeSigner(api.backend.ChainConfig(), block.Number(), block.Time())
657-
results = make([]*txTraceResult, len(txs))
658-
pend sync.WaitGroup
655+
txs = block.Transactions()
656+
blockHash = block.Hash()
657+
arbosVersion = types.DeserializeHeaderExtraInformation(block.Header()).ArbOSFormatVersion
658+
signer = types.MakeSigner(api.backend.ChainConfig(), block.Number(), block.Time(), arbosVersion)
659+
results = make([]*txTraceResult, len(txs))
660+
pend sync.WaitGroup
659661
)
660662
threads := runtime.NumCPU()
661663
if threads > len(txs) {
@@ -767,9 +769,9 @@ func (api *API) standardTraceBlockToFile(ctx context.Context, block *types.Block
767769
// Execute transaction, either tracing all or just the requested one
768770
var (
769771
dumps []string
770-
signer = types.MakeSigner(api.backend.ChainConfig(), block.Number(), block.Time())
771-
chainConfig = api.backend.ChainConfig()
772772
vmctx = core.NewEVMBlockContext(block.Header(), api.chainContext(ctx), nil)
773+
signer = types.MakeSigner(api.backend.ChainConfig(), block.Number(), block.Time(), vmctx.ArbOSVersion)
774+
chainConfig = api.backend.ChainConfig()
773775
canon = true
774776
)
775777
// Check if there are any overrides: the caller may wish to enable a future
@@ -785,7 +787,7 @@ func (api *API) standardTraceBlockToFile(ctx context.Context, block *types.Block
785787
if beaconRoot := block.BeaconRoot(); beaconRoot != nil {
786788
core.ProcessBeaconBlockRoot(*beaconRoot, evm)
787789
}
788-
if chainConfig.IsPrague(block.Number(), block.Time()) {
790+
if chainConfig.IsPrague(block.Number(), block.Time(), vmctx.ArbOSVersion) {
789791
core.ProcessParentBlockHash(block.ParentHash(), evm)
790792
}
791793
for i, tx := range block.Transactions() {
@@ -887,7 +889,7 @@ func (api *API) TraceTransaction(ctx context.Context, hash common.Hash, config *
887889
return nil, err
888890
}
889891
defer release()
890-
msg, err := core.TransactionToMessage(tx, types.MakeSigner(api.backend.ChainConfig(), block.Number(), block.Time()), block.BaseFee(), core.MessageReplayMode)
892+
msg, err := core.TransactionToMessage(tx, types.MakeSigner(api.backend.ChainConfig(), block.Number(), block.Time(), vmctx.ArbOSVersion), block.BaseFee(), core.MessageReplayMode)
891893
if err != nil {
892894
return nil, err
893895
}

eth/tracers/api_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,8 @@ func (b *testBackend) StateAtTransaction(ctx context.Context, block *types.Block
176176
return nil, vm.BlockContext{}, statedb, release, nil
177177
}
178178
// Recompute transactions up to the target index.
179-
signer := types.MakeSigner(b.chainConfig, block.Number(), block.Time())
180179
context := core.NewEVMBlockContext(block.Header(), b.chain, nil)
180+
signer := types.MakeSigner(b.chainConfig, block.Number(), block.Time(), context.ArbOSVersion)
181181
evm := vm.NewEVM(context, statedb, b.chainConfig, vm.Config{})
182182
for idx, tx := range block.Transactions() {
183183
if idx == txIndex {

0 commit comments

Comments
 (0)