From 28d94dda614be3806cbb12f5e2bda615dd38616f Mon Sep 17 00:00:00 2001 From: Shane Bammel Date: Sat, 4 Mar 2023 14:18:50 -0600 Subject: [PATCH] Relax condition for updating chain config This allows for converting any ethereum mainnet node to PulseChain as long as its height is less than the PrimordialPulse fork block. --- params/config.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/params/config.go b/params/config.go index e89fb17a1..80fe3cdd8 100644 --- a/params/config.go +++ b/params/config.go @@ -708,8 +708,8 @@ func (c *ChainConfig) checkCompatible(newcfg *ChainConfig, headNumber *big.Int, if isForkBlockIncompatible(c.EIP158Block, newcfg.EIP158Block, headNumber) { return newBlockCompatError("EIP158 fork block", c.EIP158Block, newcfg.EIP158Block) } - // allow mismatching ChainID if we're at the PrimordialPulseBlock - if c.IsEIP158(headNumber) && !configBlockEqual(c.ChainID, newcfg.ChainID) && !newcfg.IsPrimordialPulseBlock(new(big.Int).Add(headNumber, common.Big1)) { + // allow mismatching ChainID if there is a PrimordialPulse block ahead + if c.IsEIP158(headNumber) && !configBlockEqual(c.ChainID, newcfg.ChainID) && !newcfg.PrimordialPulseAhead(headNumber) { return newBlockCompatError("EIP158 chain ID", c.EIP158Block, newcfg.EIP158Block) } if isForkBlockIncompatible(c.ByzantiumBlock, newcfg.ByzantiumBlock, headNumber) {