From cedd8e30fafbd493131cc8df87703efa7ebb014f Mon Sep 17 00:00:00 2001 From: Shivam Sharma Date: Tue, 21 Nov 2023 17:58:08 +0530 Subject: [PATCH] add : amoy genesis hash --- cmd/devp2p/nodesetcmd.go | 4 ++-- core/genesis.go | 4 ++-- params/bootnodes.go | 2 ++ params/config.go | 3 +-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/cmd/devp2p/nodesetcmd.go b/cmd/devp2p/nodesetcmd.go index 5b70e564a1..df4e1b6507 100644 --- a/cmd/devp2p/nodesetcmd.go +++ b/cmd/devp2p/nodesetcmd.go @@ -254,8 +254,6 @@ func minAgeFilter(args []string) (nodeFilter, error) { return f, nil } -// TODO : 0xSharma : Add amoy genesis hash - func ethFilter(args []string) (nodeFilter, error) { var filter forkid.Filter @@ -270,6 +268,8 @@ func ethFilter(args []string) (nodeFilter, error) { filter = forkid.NewStaticFilter(params.MumbaiChainConfig, params.MumbaiGenesisHash) case "bor-mainnet": filter = forkid.NewStaticFilter(params.BorMainnetChainConfig, params.BorMainnetGenesisHash) + case "bor-amoy": + filter = forkid.NewStaticFilter(params.AmoyChainConfig, params.AmoyGenesisHash) default: return nil, fmt.Errorf("unknown network %q", args[0]) } diff --git a/core/genesis.go b/core/genesis.go index 49a3ecd5e0..9e57870593 100644 --- a/core/genesis.go +++ b/core/genesis.go @@ -466,8 +466,6 @@ func LoadCliqueConfig(db ethdb.Database, genesis *Genesis) (*params.CliqueConfig return nil, nil } -// TODO : 0xSharma : add : Amoy Genesis Hash - func (g *Genesis) configOrDefault(ghash common.Hash) *params.ChainConfig { switch { case g != nil: @@ -484,6 +482,8 @@ func (g *Genesis) configOrDefault(ghash common.Hash) *params.ChainConfig { return params.MumbaiChainConfig case ghash == params.BorMainnetGenesisHash: return params.BorMainnetChainConfig + case ghash == params.AmoyGenesisHash: + return params.AmoyChainConfig case ghash == params.KilnGenesisHash: return DefaultKilnGenesisBlock().Config default: diff --git a/params/bootnodes.go b/params/bootnodes.go index f74f068d08..3052701695 100644 --- a/params/bootnodes.go +++ b/params/bootnodes.go @@ -127,6 +127,8 @@ func KnownDNSNetwork(genesis common.Hash, protocol string) string { net = "mumbai" case BorMainnetGenesisHash: net = "bor-mainnet" + case AmoyGenesisHash: + net = "amoy" case SepoliaGenesisHash: net = "sepolia" default: diff --git a/params/config.go b/params/config.go index 5e16972a88..1dc84874fb 100644 --- a/params/config.go +++ b/params/config.go @@ -37,10 +37,9 @@ var ( MumbaiGenesisHash = common.HexToHash("0x7b66506a9ebdbf30d32b43c5f15a3b1216269a1ec3a75aa3182b86176a2b1ca7") BorMainnetGenesisHash = common.HexToHash("0xa9c28ce2141b56c474f1dc504bee9b01eb1bd7d1a507580d5519d4437a97de1b") KilnGenesisHash = common.HexToHash("0x51c7fe41be669f69c45c33a56982cbde405313342d9e2b00d7c91a7b284dd4f8") + AmoyGenesisHash = common.HexToHash("0x7202b2b53c5a0836e773e319d18922cc756dd67432f9a1f65352b61f4406c697") ) -// TODO : 0xSharma : Add BorAmoyGenesisHash - // TrustedCheckpoints associates each known checkpoint with the genesis hash of // the chain it belongs to. var TrustedCheckpoints = map[common.Hash]*TrustedCheckpoint{