Skip to content

Commit

Permalink
internal/t8ntool: rework how isMerged is determined
Browse files Browse the repository at this point in the history
  • Loading branch information
holiman committed Apr 29, 2022
1 parent 6e7fe4b commit 5485da1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
5 changes: 3 additions & 2 deletions cmd/evm/internal/t8ntool/transition.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,9 @@ func Transition(ctx *cli.Context) error {
return NewError(ErrorConfig, errors.New("EIP-1559 config but missing 'currentBaseFee' in env section"))
}
}

if env := prestate.Env; chainConfig.IsMerged(big.NewInt(int64(env.Number))) {
isMerged := chainConfig.TerminalTotalDifficulty != nil && chainConfig.TerminalTotalDifficulty.BitLen() == 0
env := prestate.Env
if isMerged {
// post-merge:
// - random must be supplied
// - difficulty must be zero
Expand Down
5 changes: 0 additions & 5 deletions params/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -477,11 +477,6 @@ func (c *ChainConfig) IsArrowGlacier(num *big.Int) bool {
return isForked(c.ArrowGlacierBlock, num)
}

// IsMerged returns whether num is either equal to the TheMerge fork block or greater.
func (c *ChainConfig) IsMerged(num *big.Int) bool {
return isForked(c.MergeForkBlock, num)
}

// IsTerminalPoWBlock returns whether the given block is the last block of PoW stage.
func (c *ChainConfig) IsTerminalPoWBlock(parentTotalDiff *big.Int, totalDiff *big.Int) bool {
if c.TerminalTotalDifficulty == nil {
Expand Down

0 comments on commit 5485da1

Please sign in to comment.