Skip to content

Commit

Permalink
add : amoy genesis hash
Browse files Browse the repository at this point in the history
  • Loading branch information
0xsharma committed Nov 21, 2023
1 parent c8a7d63 commit cedd8e3
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions cmd/devp2p/nodesetcmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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])
}
Expand Down
4 changes: 2 additions & 2 deletions core/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down
2 changes: 2 additions & 0 deletions params/bootnodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 1 addition & 2 deletions params/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down

0 comments on commit cedd8e3

Please sign in to comment.