From 7e85f0e119a06b87ba9df00c32088e95cbeb60d0 Mon Sep 17 00:00:00 2001 From: Shivam Sharma Date: Wed, 8 Nov 2023 14:36:07 +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..69507f71e6 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 @@ -268,6 +266,8 @@ func ethFilter(args []string) (nodeFilter, error) { filter = forkid.NewStaticFilter(params.SepoliaChainConfig, params.SepoliaGenesisHash) case "bor-mumbai": filter = forkid.NewStaticFilter(params.MumbaiChainConfig, params.MumbaiGenesisHash) + case "bor-amoy": + filter = forkid.NewStaticFilter(params.AmoyChainConfig, params.AmoyGenesisHash) case "bor-mainnet": filter = forkid.NewStaticFilter(params.BorMainnetChainConfig, params.BorMainnetGenesisHash) default: diff --git a/core/genesis.go b/core/genesis.go index 32afb19de8..d8e8dab071 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: @@ -482,6 +480,8 @@ func (g *Genesis) configOrDefault(ghash common.Hash) *params.ChainConfig { return params.GoerliChainConfig case ghash == params.MumbaiGenesisHash: return params.MumbaiChainConfig + case ghash == params.AmoyGenesisHash: + return params.AmoyChainConfig case ghash == params.BorMainnetGenesisHash: return params.BorMainnetChainConfig case ghash == params.KilnGenesisHash: diff --git a/params/bootnodes.go b/params/bootnodes.go index f74f068d08..cb99ade98d 100644 --- a/params/bootnodes.go +++ b/params/bootnodes.go @@ -125,6 +125,8 @@ func KnownDNSNetwork(genesis common.Hash, protocol string) string { net = "goerli" case MumbaiGenesisHash: net = "mumbai" + case AmoyGenesisHash: + net = "amoy" case BorMainnetGenesisHash: net = "bor-mainnet" case SepoliaGenesisHash: diff --git a/params/config.go b/params/config.go index a6f7e3bc3e..209b4c8a17 100644 --- a/params/config.go +++ b/params/config.go @@ -35,12 +35,11 @@ var ( RinkebyGenesisHash = common.HexToHash("0x6341fd3daf94b748c72ced5a5b26028f2474f5f00d824504e4fa37a75767e177") GoerliGenesisHash = common.HexToHash("0xbf7e331f7f7c1dd2e05159666b3bf8bc7a8a3a9eb1d518969eab529dd9b88c1a") MumbaiGenesisHash = common.HexToHash("0x7b66506a9ebdbf30d32b43c5f15a3b1216269a1ec3a75aa3182b86176a2b1ca7") + AmoyGenesisHash = common.HexToHash("0xe5f6dea6c2596750f51f12caf61fdda0bd95ae81d0783c22ca7adb481320b9e6") BorMainnetGenesisHash = common.HexToHash("0xa9c28ce2141b56c474f1dc504bee9b01eb1bd7d1a507580d5519d4437a97de1b") KilnGenesisHash = common.HexToHash("0x51c7fe41be669f69c45c33a56982cbde405313342d9e2b00d7c91a7b284dd4f8") ) -// 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{