Add Bor fork blocks (#893)

This is essential to have system_contract lookup which fixes the RPC
response for updated contract codes.
This commit is contained in:
Anshal Shukla 2023-02-20 10:20:47 +05:30 committed by GitHub
parent 36d52dad69
commit c1c1f29abf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -82,6 +82,9 @@ type Config struct {
Eip1559FeeCollector *common.Address `json:"eip1559FeeCollector,omitempty"` // (Optional) Address where burnt EIP-1559 fees go to 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 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 // Various consensus engines
Ethash *EthashConfig `json:"ethash,omitempty"` Ethash *EthashConfig `json:"ethash,omitempty"`
Clique *CliqueConfig `json:"clique,omitempty"` Clique *CliqueConfig `json:"clique,omitempty"`
@ -255,6 +258,15 @@ func (c *Config) IsOnNano(num *big.Int) bool {
return numEqual(c.NanoBlock, num) 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. // IsMuirGlacier returns whether num is either equal to the Muir Glacier (EIP-2384) fork block or greater.
func (c *Config) IsMuirGlacier(num uint64) bool { func (c *Config) IsMuirGlacier(num uint64) bool {
return isForked(c.MuirGlacierBlock, num) return isForked(c.MuirGlacierBlock, num)