From c1c1f29abf27fa7bf2870de0b590ccf11ac79dde Mon Sep 17 00:00:00 2001 From: Anshal Shukla <53994948+anshalshukla@users.noreply.github.com> Date: Mon, 20 Feb 2023 10:20:47 +0530 Subject: [PATCH] Add Bor fork blocks (#893) This is essential to have system_contract lookup which fixes the RPC response for updated contract codes. --- chain/chain_config.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/chain/chain_config.go b/chain/chain_config.go index 0e973926e..dbd143dcf 100644 --- a/chain/chain_config.go +++ b/chain/chain_config.go @@ -82,6 +82,9 @@ type Config struct { Eip1559FeeCollector *common.Address `json:"eip1559FeeCollector,omitempty"` // (Optional) Address where burnt EIP-1559 fees go to Eip1559FeeCollectorTransition *big.Int `json:"eip1559FeeCollectorTransition,omitempty"` // (Optional) Block from which burnt EIP-1559 fees go to the Eip1559FeeCollector + // Bor fork blocks + CalcuttaBlock *big.Int `json:"calcuttaBlock,omitempty"` + // Various consensus engines Ethash *EthashConfig `json:"ethash,omitempty"` Clique *CliqueConfig `json:"clique,omitempty"` @@ -255,6 +258,15 @@ func (c *Config) IsOnNano(num *big.Int) bool { return numEqual(c.NanoBlock, num) } +// IsCalcutta returns whether num is either equal to the euler fork block or greater. +func (c *Config) IsCalcutta(num uint64) bool { + return isForked(c.CalcuttaBlock, num) +} + +func (c *Config) IsOnCalcutta(num *big.Int) bool { + return numEqual(c.CalcuttaBlock, num) +} + // IsMuirGlacier returns whether num is either equal to the Muir Glacier (EIP-2384) fork block or greater. func (c *Config) IsMuirGlacier(num uint64) bool { return isForked(c.MuirGlacierBlock, num)