Skip to content

Commit 5485da1

Browse files
committed
internal/t8ntool: rework how isMerged is determined
1 parent 6e7fe4b commit 5485da1

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

cmd/evm/internal/t8ntool/transition.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,9 @@ func Transition(ctx *cli.Context) error {
252252
return NewError(ErrorConfig, errors.New("EIP-1559 config but missing 'currentBaseFee' in env section"))
253253
}
254254
}
255-
256-
if env := prestate.Env; chainConfig.IsMerged(big.NewInt(int64(env.Number))) {
255+
isMerged := chainConfig.TerminalTotalDifficulty != nil && chainConfig.TerminalTotalDifficulty.BitLen() == 0
256+
env := prestate.Env
257+
if isMerged {
257258
// post-merge:
258259
// - random must be supplied
259260
// - difficulty must be zero

params/config.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -477,11 +477,6 @@ func (c *ChainConfig) IsArrowGlacier(num *big.Int) bool {
477477
return isForked(c.ArrowGlacierBlock, num)
478478
}
479479

480-
// IsMerged returns whether num is either equal to the TheMerge fork block or greater.
481-
func (c *ChainConfig) IsMerged(num *big.Int) bool {
482-
return isForked(c.MergeForkBlock, num)
483-
}
484-
485480
// IsTerminalPoWBlock returns whether the given block is the last block of PoW stage.
486481
func (c *ChainConfig) IsTerminalPoWBlock(parentTotalDiff *big.Int, totalDiff *big.Int) bool {
487482
if c.TerminalTotalDifficulty == nil {

0 commit comments

Comments
 (0)