mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-24 05:36:46 +00:00
eth/tracers: fix case 7702_delegate
This commit is contained in:
parent
e9dca3b181
commit
a9e3685d44
2 changed files with 48 additions and 12 deletions
File diff suppressed because one or more lines are too long
|
|
@ -28,6 +28,7 @@ import (
|
||||||
"github.com/ethereum/go-ethereum/core"
|
"github.com/ethereum/go-ethereum/core"
|
||||||
"github.com/ethereum/go-ethereum/core/types"
|
"github.com/ethereum/go-ethereum/core/types"
|
||||||
"github.com/ethereum/go-ethereum/core/vm"
|
"github.com/ethereum/go-ethereum/core/vm"
|
||||||
|
"github.com/ethereum/go-ethereum/params"
|
||||||
|
|
||||||
// Force-load native and js packages, to trigger registration
|
// Force-load native and js packages, to trigger registration
|
||||||
_ "github.com/ethereum/go-ethereum/eth/tracers/js"
|
_ "github.com/ethereum/go-ethereum/eth/tracers/js"
|
||||||
|
|
@ -67,7 +68,13 @@ func (c *traceContext) toBlockContext(genesis *core.Genesis) vm.BlockContext {
|
||||||
context.BaseFee = (*big.Int)(c.BaseFee)
|
context.BaseFee = (*big.Int)(c.BaseFee)
|
||||||
}
|
}
|
||||||
|
|
||||||
if genesis.Config.TerminalTotalDifficulty != nil && genesis.Config.TerminalTotalDifficulty.Sign() == 0 {
|
isPostMerge := func(config *params.ChainConfig, blockNum uint64, timestamp uint64) bool {
|
||||||
|
mergedAtGenesis := config.TerminalTotalDifficulty != nil && config.TerminalTotalDifficulty.Sign() == 0
|
||||||
|
return mergedAtGenesis ||
|
||||||
|
config.MergeNetsplitBlock != nil && blockNum >= config.MergeNetsplitBlock.Uint64() ||
|
||||||
|
config.ShanghaiTime != nil && timestamp >= *config.ShanghaiTime
|
||||||
|
}
|
||||||
|
if isPostMerge(genesis.Config, uint64(c.Number), uint64(c.Time)) {
|
||||||
context.Random = &genesis.Mixhash
|
context.Random = &genesis.Mixhash
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue