Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shanghai & Cancun forks should be based on timestamp #6238

Merged
merged 1 commit into from
Dec 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions cl/clparams/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ func configForkNames(b *BeaconChainConfig) map[[VersionLength]byte]string {
return fvn
}

var mainnetBeaconConfig BeaconChainConfig = BeaconChainConfig{
var MainnetBeaconConfig BeaconChainConfig = BeaconChainConfig{
// Constants (Non-configurable)
FarFutureEpoch: math.MaxUint64,
FarFutureSlot: math.MaxUint64,
Expand Down Expand Up @@ -622,13 +622,13 @@ var mainnetBeaconConfig BeaconChainConfig = BeaconChainConfig{
}

func mainnetConfig() BeaconChainConfig {
cfg := mainnetBeaconConfig
cfg := MainnetBeaconConfig
cfg.InitializeForkSchedule()
return cfg
}

func sepoliaConfig() BeaconChainConfig {
cfg := mainnetBeaconConfig
cfg := MainnetBeaconConfig
cfg.MinGenesisTime = 1655647200
cfg.GenesisDelay = 86400
cfg.MinGenesisActiveValidatorCount = 1300
Expand All @@ -648,7 +648,7 @@ func sepoliaConfig() BeaconChainConfig {
}

func goerliConfig() BeaconChainConfig {
cfg := mainnetBeaconConfig
cfg := MainnetBeaconConfig
cfg.MinGenesisTime = 1614588812
cfg.GenesisDelay = 1919188
cfg.ConfigName = "prater"
Expand Down
4 changes: 2 additions & 2 deletions cmd/evm/internal/t8ntool/transition.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ func Main(ctx *cli.Context) error {
return NewError(ErrorVMConfig, errors.New("can only apply RANDOM on top of London chain rules"))
}

if chainConfig.IsShanghai(prestate.Env.Number) && prestate.Env.Withdrawals == nil {
if chainConfig.IsShanghai(prestate.Env.Timestamp) && prestate.Env.Withdrawals == nil {
return NewError(ErrorVMConfig, errors.New("Shanghai config but missing 'withdrawals' in env section"))
}

Expand Down Expand Up @@ -286,7 +286,7 @@ func Main(ctx *cli.Context) error {
}
defer tx.Rollback()

reader, writer := MakePreState(chainConfig.Rules(0), tx, prestate.Pre)
reader, writer := MakePreState(chainConfig.Rules(0, 0), tx, prestate.Pre)
engine := ethash.NewFaker()

result, err := core.ExecuteBlockEphemerally(chainConfig, &vmConfig, getHash, engine, block, reader, writer, nil, nil, getTracer)
Expand Down
2 changes: 1 addition & 1 deletion cmd/evm/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ func runCmd(ctx *cli.Context) error {
if ctx.Bool(DumpFlag.Name) {
rules := &params.Rules{}
if chainConfig != nil {
rules = chainConfig.Rules(runtimeConfig.BlockNumber.Uint64())
rules = chainConfig.Rules(runtimeConfig.BlockNumber.Uint64(), runtimeConfig.Time.Uint64())
}
if err = statedb.CommitBlock(rules, state.NewNoopWriter()); err != nil {
fmt.Println("Could not commit state: ", err)
Expand Down
10 changes: 6 additions & 4 deletions cmd/rpcdaemon/commands/eth_block.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ import (
"time"

"github.com/ledgerwatch/erigon-lib/kv"
"github.com/ledgerwatch/log/v3"

"github.com/ledgerwatch/erigon/cl/clparams"
"github.com/ledgerwatch/erigon/common"
"github.com/ledgerwatch/erigon/common/hexutil"
"github.com/ledgerwatch/erigon/common/math"
Expand All @@ -20,7 +23,6 @@ import (
"github.com/ledgerwatch/erigon/turbo/adapter/ethapi"
"github.com/ledgerwatch/erigon/turbo/rpchelper"
"github.com/ledgerwatch/erigon/turbo/transactions"
"github.com/ledgerwatch/log/v3"
)

func (api *APIImpl) CallBundle(ctx context.Context, txHashes []common.Hash, stateBlockNumberOrHash rpc.BlockNumberOrHash, timeoutMilliSecondsPtr *int64) (map[string]interface{}, error) {
Expand Down Expand Up @@ -97,7 +99,7 @@ func (api *APIImpl) CallBundle(ctx context.Context, txHashes []common.Hash, stat

blockNumber := stateBlockNumber + 1

timestamp := parent.Time // Dont care about the timestamp
timestamp := parent.Time + clparams.MainnetBeaconConfig.SecondsPerSlot

coinbase := parent.Coinbase
header := &types.Header{
Expand All @@ -109,16 +111,16 @@ func (api *APIImpl) CallBundle(ctx context.Context, txHashes []common.Hash, stat
Coinbase: coinbase,
}

// Get a new instance of the EVM
signer := types.MakeSigner(chainConfig, blockNumber)
rules := chainConfig.Rules(blockNumber)
rules := chainConfig.Rules(blockNumber, timestamp)
firstMsg, err := txs[0].AsMessage(*signer, nil, rules)
if err != nil {
return nil, err
}

blockCtx := transactions.NewEVMBlockContext(engine, header, stateBlockNumberOrHash.RequireCanonical, tx, api._blockReader)
txCtx := core.NewEVMTxContext(firstMsg)
// Get a new instance of the EVM
evm := vm.NewEVM(blockCtx, txCtx, ibs, chainConfig, vm.Config{Debug: false})

timeoutMilliSeconds := int64(5000)
Expand Down
2 changes: 1 addition & 1 deletion cmd/rpcdaemon/commands/eth_call.go
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ func (api *APIImpl) CreateAccessList(ctx context.Context, args ethapi2.CallArgs,
}

// Retrieve the precompiles since they don't need to be added to the access list
precompiles := vm.ActivePrecompiles(chainConfig.Rules(blockNumber))
precompiles := vm.ActivePrecompiles(chainConfig.Rules(blockNumber, header.Time))

// Create an initial tracer
prevTracer := logger.NewAccessListTracer(nil, *args.From, to, precompiles)
Expand Down
7 changes: 3 additions & 4 deletions cmd/rpcdaemon/commands/eth_callMany.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,6 @@ func (api *APIImpl) CallMany(ctx context.Context, bundles []Bundle, simulateCont
return nil, fmt.Errorf("block %d(%x) not found", blockNum, hash)
}

// Get a new instance of the EVM
signer := types.MakeSigner(chainConfig, blockNum)
rules := chainConfig.Rules(blockNum)

getHash := func(i uint64) common.Hash {
if hash, ok := overrideBlockHash[i]; ok {
return hash
Expand Down Expand Up @@ -175,7 +171,10 @@ func (api *APIImpl) CallMany(ctx context.Context, bundles []Bundle, simulateCont
BaseFee: &baseFee,
}

// Get a new instance of the EVM
evm = vm.NewEVM(blockCtx, txCtx, st, chainConfig, vm.Config{Debug: false})
signer := types.MakeSigner(chainConfig, blockNum)
rules := chainConfig.Rules(blockNum, blockCtx.Time)

timeoutMilliSeconds := int64(5000)

Expand Down
5 changes: 3 additions & 2 deletions cmd/rpcdaemon/commands/eth_receipts.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import (
"github.com/ledgerwatch/erigon-lib/kv"
"github.com/ledgerwatch/erigon-lib/kv/bitmapdb"
libstate "github.com/ledgerwatch/erigon-lib/state"
"github.com/ledgerwatch/log/v3"

"github.com/ledgerwatch/erigon/common"
"github.com/ledgerwatch/erigon/common/dbutils"
"github.com/ledgerwatch/erigon/common/hexutil"
Expand All @@ -28,7 +30,6 @@ import (
"github.com/ledgerwatch/erigon/rpc"
"github.com/ledgerwatch/erigon/turbo/rpchelper"
"github.com/ledgerwatch/erigon/turbo/transactions"
"github.com/ledgerwatch/log/v3"
)

func (api *BaseAPI) getReceipts(ctx context.Context, tx kv.Tx, chainConfig *params.ChainConfig, block *types.Block, senders []common.Address) (types.Receipts, error) {
Expand Down Expand Up @@ -381,7 +382,7 @@ func (api *APIImpl) getLogsV3(ctx context.Context, tx kv.Tx, begin, end uint64,
lastBlockNum = blockNum
blockHash = header.Hash()
signer = types.MakeSigner(chainConfig, blockNum)
rules = chainConfig.Rules(blockNum)
rules = chainConfig.Rules(blockNum, header.Time)
vmConfig.SkipAnalysis = core.SkipAnalysis(chainConfig, blockNum)

minTxNumInBlock, err = rawdb.TxNums.Min(tx, blockNum)
Expand Down
4 changes: 2 additions & 2 deletions cmd/rpcdaemon/commands/otterscan_generic_tracer.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func (api *OtterscanAPIImpl) genericTracer(dbtx kv.Tx, ctx context.Context, bloc
engine := api.engine()

header := block.Header()
rules := chainConfig.Rules(block.NumberU64())
rules := chainConfig.Rules(block.NumberU64(), header.Time)
for idx, tx := range block.Transactions() {
ibs.Prepare(tx.Hash(), block.Hash(), idx)

Expand All @@ -61,7 +61,7 @@ func (api *OtterscanAPIImpl) genericTracer(dbtx kv.Tx, ctx context.Context, bloc
if _, err := core.ApplyMessage(vmenv, msg, new(core.GasPool).AddGas(tx.GetGas()), true /* refunds */, false /* gasBailout */); err != nil {
return err
}
_ = ibs.FinalizeTx(vmenv.ChainConfig().Rules(block.NumberU64()), cachedWriter)
_ = ibs.FinalizeTx(rules, cachedWriter)

if tracer.Found() {
tracer.SetTransaction(tx)
Expand Down
4 changes: 2 additions & 2 deletions cmd/rpcdaemon/commands/otterscan_search_trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func (api *OtterscanAPIImpl) traceBlock(dbtx kv.Tx, ctx context.Context, blockNu

blockReceipts := rawdb.ReadReceipts(dbtx, block, senders)
header := block.Header()
rules := chainConfig.Rules(block.NumberU64())
rules := chainConfig.Rules(block.NumberU64(), header.Time)
found := false
for idx, tx := range block.Transactions() {
ibs.Prepare(tx.Hash(), block.Hash(), idx)
Expand All @@ -87,7 +87,7 @@ func (api *OtterscanAPIImpl) traceBlock(dbtx kv.Tx, ctx context.Context, blockNu
if _, err := core.ApplyMessage(vmenv, msg, new(core.GasPool).AddGas(tx.GetGas()), true /* refunds */, false /* gasBailout */); err != nil {
return false, nil, err
}
_ = ibs.FinalizeTx(vmenv.ChainConfig().Rules(block.NumberU64()), cachedWriter)
_ = ibs.FinalizeTx(rules, cachedWriter)

if tracer.Found {
rpcTx := newRPCTransaction(tx, block.Hash(), blockNum, uint64(idx), block.BaseFee())
Expand Down
4 changes: 2 additions & 2 deletions cmd/rpcdaemon/commands/trace_adhoc.go
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@ func (api *TraceAPIImpl) ReplayTransaction(ctx context.Context, txHash common.Ha
}

// Returns an array of trace arrays, one trace array for each transaction
traces, err := api.callManyTransactions(ctx, tx, block.Transactions(), traceTypes, block.ParentHash(), rpc.BlockNumber(parentNr), block.Header(), int(txnIndex), types.MakeSigner(chainConfig, blockNum), chainConfig.Rules(blockNum))
traces, err := api.callManyTransactions(ctx, tx, block.Transactions(), traceTypes, block.ParentHash(), rpc.BlockNumber(parentNr), block.Header(), int(txnIndex), types.MakeSigner(chainConfig, blockNum), chainConfig.Rules(blockNum, block.Time()))
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -817,7 +817,7 @@ func (api *TraceAPIImpl) ReplayBlockTransactions(ctx context.Context, blockNrOrH
}

// Returns an array of trace arrays, one trace array for each transaction
traces, err := api.callManyTransactions(ctx, tx, block.Transactions(), traceTypes, block.ParentHash(), rpc.BlockNumber(parentNr), block.Header(), -1 /* all tx indices */, types.MakeSigner(chainConfig, blockNumber), chainConfig.Rules(blockNumber))
traces, err := api.callManyTransactions(ctx, tx, block.Transactions(), traceTypes, block.ParentHash(), rpc.BlockNumber(parentNr), block.Header(), -1 /* all tx indices */, types.MakeSigner(chainConfig, blockNumber), chainConfig.Rules(blockNumber, block.Time()))
if err != nil {
return nil, err
}
Expand Down
8 changes: 4 additions & 4 deletions cmd/rpcdaemon/commands/trace_filtering.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func (api *TraceAPIImpl) Transaction(ctx context.Context, txHash common.Hash) (P
hash := block.Hash()

// Returns an array of trace arrays, one trace array for each transaction
traces, err := api.callManyTransactions(ctx, tx, block.Transactions(), []string{TraceTypeTrace}, block.ParentHash(), rpc.BlockNumber(parentNr), block.Header(), txIndex, types.MakeSigner(chainConfig, blockNumber), chainConfig.Rules(blockNumber))
traces, err := api.callManyTransactions(ctx, tx, block.Transactions(), []string{TraceTypeTrace}, block.ParentHash(), rpc.BlockNumber(parentNr), block.Header(), txIndex, types.MakeSigner(chainConfig, blockNumber), chainConfig.Rules(blockNumber, block.Time()))
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -158,7 +158,7 @@ func (api *TraceAPIImpl) Block(ctx context.Context, blockNr rpc.BlockNumber) (Pa
if err != nil {
return nil, err
}
traces, err := api.callManyTransactions(ctx, tx, block.Transactions(), []string{TraceTypeTrace}, block.ParentHash(), rpc.BlockNumber(parentNr), block.Header(), -1 /* all tx indices */, types.MakeSigner(chainConfig, blockNum), chainConfig.Rules(blockNum))
traces, err := api.callManyTransactions(ctx, tx, block.Transactions(), []string{TraceTypeTrace}, block.ParentHash(), rpc.BlockNumber(parentNr), block.Header(), -1 /* all tx indices */, types.MakeSigner(chainConfig, blockNum), chainConfig.Rules(blockNum, block.Time()))
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -378,7 +378,7 @@ func (api *TraceAPIImpl) Filter(ctx context.Context, req TraceFilterRequest, str
isPos = header.Difficulty.Cmp(common.Big0) == 0 || header.Difficulty.Cmp(api._chainConfig.TerminalTotalDifficulty) >= 0
}
txs := block.Transactions()
t, tErr := api.callManyTransactions(ctx, dbtx, txs, []string{TraceTypeTrace}, block.ParentHash(), rpc.BlockNumber(block.NumberU64()-1), block.Header(), -1 /* all tx indices */, types.MakeSigner(chainConfig, b), chainConfig.Rules(b))
t, tErr := api.callManyTransactions(ctx, dbtx, txs, []string{TraceTypeTrace}, block.ParentHash(), rpc.BlockNumber(block.NumberU64()-1), block.Header(), -1 /* all tx indices */, types.MakeSigner(chainConfig, b), chainConfig.Rules(b, block.Time()))
if tErr != nil {
if first {
first = false
Expand Down Expand Up @@ -633,7 +633,7 @@ func (api *TraceAPIImpl) filterV3(ctx context.Context, dbtx kv.Tx, fromBlock, to
lastBlockNum = blockNum
lastBlockHash = lastHeader.Hash()
lastSigner = types.MakeSigner(chainConfig, blockNum)
lastRules = chainConfig.Rules(blockNum)
lastRules = chainConfig.Rules(blockNum, lastHeader.Time)
}
maxTxNum, err := rawdb.TxNums.Max(dbtx, blockNum)
if err != nil {
Expand Down
9 changes: 4 additions & 5 deletions cmd/rpcdaemon/commands/tracing.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func (api *PrivateDebugAPIImpl) traceBlock(ctx context.Context, blockNrOrHash rp
}

signer := types.MakeSigner(chainConfig, block.NumberU64())
rules := chainConfig.Rules(block.NumberU64())
rules := chainConfig.Rules(block.NumberU64(), block.Time())
stream.WriteArrayStart()
for idx, txn := range block.Transactions() {
select {
Expand Down Expand Up @@ -332,10 +332,6 @@ func (api *PrivateDebugAPIImpl) TraceCallMany(ctx context.Context, bundles []Bun
return fmt.Errorf("block %d(%x) not found", blockNum, hash)
}

// Get a new instance of the EVM
signer := types.MakeSigner(chainConfig, blockNum)
rules := chainConfig.Rules(blockNum)

getHash := func(i uint64) common.Hash {
if hash, ok := overrideBlockHash[i]; ok {
return hash
Expand Down Expand Up @@ -363,7 +359,10 @@ func (api *PrivateDebugAPIImpl) TraceCallMany(ctx context.Context, bundles []Bun
BaseFee: &baseFee,
}

// Get a new instance of the EVM
evm = vm.NewEVM(blockCtx, txCtx, st, chainConfig, vm.Config{Debug: false})
signer := types.MakeSigner(chainConfig, blockNum)
rules := chainConfig.Rules(blockNum, blockCtx.Time)

// Setup the gas pool (also for unmetered requests)
// and apply the message.
Expand Down
2 changes: 1 addition & 1 deletion cmd/state/commands/erigon2.go
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ func processBlock(trace bool, txNumStart uint64, rw *ReaderWrapper, ww *WriterWr
usedGas := new(uint64)
var receipts types.Receipts
daoBlock := chainConfig.DAOForkSupport && chainConfig.DAOForkBlock != nil && chainConfig.DAOForkBlock.Cmp(block.Number()) == 0
rules := chainConfig.Rules(block.NumberU64())
rules := chainConfig.Rules(block.NumberU64(), block.Time())
txNum := txNumStart

for i, tx := range block.Transactions() {
Expand Down
2 changes: 1 addition & 1 deletion cmd/state/commands/erigon4.go
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ func processBlock23(startTxNum uint64, trace bool, txNumStart uint64, rw *Reader
gp := new(core.GasPool).AddGas(block.GasLimit())
usedGas := new(uint64)
var receipts types.Receipts
rules := chainConfig.Rules(block.NumberU64())
rules := chainConfig.Rules(block.NumberU64(), block.Time())
txNum := txNumStart
ww.w.SetTxNum(txNum)
ww.w.SetBlockNum(block.NumberU64())
Expand Down
7 changes: 4 additions & 3 deletions cmd/state/commands/history22.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ import (
"github.com/ledgerwatch/erigon-lib/kv/mdbx"
kv2 "github.com/ledgerwatch/erigon-lib/kv/mdbx"
libstate "github.com/ledgerwatch/erigon-lib/state"
"github.com/ledgerwatch/log/v3"
"github.com/spf13/cobra"

"github.com/ledgerwatch/erigon/common"
"github.com/ledgerwatch/erigon/consensus/ethash"
"github.com/ledgerwatch/erigon/consensus/misc"
Expand All @@ -29,8 +32,6 @@ import (
"github.com/ledgerwatch/erigon/params"
"github.com/ledgerwatch/erigon/turbo/services"
"github.com/ledgerwatch/erigon/turbo/snapshotsync"
"github.com/ledgerwatch/log/v3"
"github.com/spf13/cobra"
)

func init() {
Expand Down Expand Up @@ -227,7 +228,7 @@ func runHistory22(trace bool, blockNum, txNumStart uint64, hw *state.HistoryRead
gp := new(core.GasPool).AddGas(block.GasLimit())
usedGas := new(uint64)
var receipts types.Receipts
rules := chainConfig.Rules(block.NumberU64())
rules := chainConfig.Rules(block.NumberU64(), block.Time())
txNum := txNumStart
hw.SetTxNum(txNum)
daoFork := chainConfig.DAOForkSupport && chainConfig.DAOForkBlock != nil && chainConfig.DAOForkBlock.Cmp(block.Number()) == 0
Expand Down
2 changes: 1 addition & 1 deletion cmd/state/commands/opcode_tracer.go
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,7 @@ func runBlock(engine consensus.Engine, ibs *state.IntraBlockState, txnWriter sta
misc.ApplyDAOHardFork(ibs)
}
systemcontracts.UpgradeBuildInSystemContract(chainConfig, header.Number, ibs)
rules := chainConfig.Rules(block.NumberU64())
rules := chainConfig.Rules(block.NumberU64(), block.Time())
for i, tx := range block.Transactions() {
ibs.Prepare(tx.Hash(), block.Hash(), i)
receipt, _, err := core.ApplyTransaction(chainConfig, core.GetHashFn(header, getHeader), engine, nil, gp, ibs, txnWriter, header, tx, usedGas, vmConfig)
Expand Down
2 changes: 1 addition & 1 deletion cmd/state/commands/replay_tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ func replayTxNum(ctx context.Context, allSnapshots *snapshotsync.RoSnapshots, bl
stateReader.SetTxNum(txNum)
stateWriter.SetTxNum(txNum)
noop := state.NewNoopWriter()
rules := chainConfig.Rules(bn)
rules := chainConfig.Rules(bn, header.Time)
for {
stateReader.ResetError()
ibs := state.New(stateReader)
Expand Down
4 changes: 2 additions & 2 deletions consensus/misc/eip1559_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ func copyConfig(original *params.ChainConfig) *params.ChainConfig {
TerminalTotalDifficulty: original.TerminalTotalDifficulty,
TerminalTotalDifficultyPassed: original.TerminalTotalDifficultyPassed,
MergeNetsplitBlock: original.MergeNetsplitBlock,
ShanghaiBlock: original.ShanghaiBlock,
CancunBlock: original.CancunBlock,
ShanghaiTime: original.ShanghaiTime,
CancunTime: original.CancunTime,
RamanujanBlock: original.RamanujanBlock,
NielsBlock: original.NielsBlock,
MirrorSyncBlock: original.MirrorSyncBlock,
Expand Down
2 changes: 1 addition & 1 deletion consensus/parlia/parlia.go
Original file line number Diff line number Diff line change
Expand Up @@ -1233,7 +1233,7 @@ func (p *Parlia) applyTransaction(from common.Address, to common.Address, value
receipt := types.NewReceipt(false, *usedGas)
receipt.TxHash = expectedTx.Hash()
receipt.GasUsed = gasUsed
if err := ibs.FinalizeTx(p.chainConfig.Rules(header.Number.Uint64()), state.NewNoopWriter()); err != nil {
if err := ibs.FinalizeTx(p.chainConfig.Rules(header.Number.Uint64(), header.Time), state.NewNoopWriter()); err != nil {
return nil, nil, nil, err
}
// Set the receipt logs and create a bloom for filtering
Expand Down
2 changes: 1 addition & 1 deletion consensus/serenity/serenity.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ func (s *Serenity) verifyHeader(chain consensus.ChainHeaderReader, header, paren
}

// Verify existence / non-existence of withdrawalsHash
shanghai := chain.Config().IsShanghai(header.Number.Uint64())
shanghai := chain.Config().IsShanghai(header.Time)
if shanghai && header.WithdrawalsHash == nil {
return fmt.Errorf("missing withdrawalsHash")
}
Expand Down
Loading