diff --git a/changelog.md b/changelog.md index 1fa1f6d681..c535451228 100644 --- a/changelog.md +++ b/changelog.md @@ -36,6 +36,7 @@ * [1942](https://github.com/zeta-chain/node/pull/1982) - support Bitcoin P2TR, P2WSH, P2SH, P2PKH addresses * [1935](https://github.com/zeta-chain/node/pull/1935) - add an operational authority group * [1954](https://github.com/zeta-chain/node/pull/1954) - add metric for concurrent keysigns +* [2006](https://github.com/zeta-chain/node/pull/2006) - add Amoy testnet static chain information ### Tests diff --git a/docs/openapi/openapi.swagger.yaml b/docs/openapi/openapi.swagger.yaml index faf3e60692..c96ab5fa4f 100644 --- a/docs/openapi/openapi.swagger.yaml +++ b/docs/openapi/openapi.swagger.yaml @@ -53519,13 +53519,8 @@ definitions: - sepolia_testnet - goerli_localnet - btc_regtest + - amoy_testnet default: empty - title: |- - - goerli_testnet: Testnet - - goerli_localnet: LocalNet - zeta_localnet = 13; - - btc_regtest: Athens - zeta_athensnet=15; chainsReceiveStatus: type: string enum: diff --git a/pkg/chains/chain.go b/pkg/chains/chain.go index 9d24216272..b86d54a176 100644 --- a/pkg/chains/chain.go +++ b/pkg/chains/chain.go @@ -90,6 +90,7 @@ func IsZetaChain(chainID int64) bool { // https://github.com/zeta-chain/node-private/issues/63 func IsEVMChain(chainID int64) bool { return chainID == 5 || // Goerli + chainID == AmoyChain().ChainId || chainID == SepoliaChain().ChainId || // Sepolia chainID == 80001 || // Polygon mumbai chainID == 97 || // BSC testnet diff --git a/pkg/chains/chains.go b/pkg/chains/chains.go index ef1ffc9caf..651051da3c 100644 --- a/pkg/chains/chains.go +++ b/pkg/chains/chains.go @@ -99,6 +99,13 @@ func MumbaiChain() Chain { } } +func AmoyChain() Chain { + return Chain{ + ChainName: ChainName_amoy_testnet, + ChainId: 80002, + } +} + // Privnet chains func BtcRegtestChain() Chain { @@ -127,6 +134,7 @@ func DefaultChainsList() []*Chain { EthChain(), BtcTestNetChain(), MumbaiChain(), + AmoyChain(), BscTestnetChain(), GoerliChain(), SepoliaChain(), @@ -155,6 +163,7 @@ func TestnetChainList() []*Chain { ZetaTestnetChain(), BtcTestNetChain(), MumbaiChain(), + AmoyChain(), BscTestnetChain(), GoerliChain(), SepoliaChain(), @@ -178,6 +187,7 @@ func ExternalChainList() []*Chain { EthChain(), BtcTestNetChain(), MumbaiChain(), + AmoyChain(), BscTestnetChain(), GoerliChain(), SepoliaChain(), diff --git a/pkg/chains/chains.pb.go b/pkg/chains/chains.pb.go index a305e7adbd..27e8736dac 100644 --- a/pkg/chains/chains.pb.go +++ b/pkg/chains/chains.pb.go @@ -61,7 +61,6 @@ const ( ChainName_btc_mainnet ChainName = 3 ChainName_polygon_mainnet ChainName = 4 ChainName_bsc_mainnet ChainName = 5 - // Testnet ChainName_goerli_testnet ChainName = 6 ChainName_mumbai_testnet ChainName = 7 ChainName_ganache_testnet ChainName = 8 @@ -70,10 +69,9 @@ const ( ChainName_zeta_testnet ChainName = 11 ChainName_btc_testnet ChainName = 12 ChainName_sepolia_testnet ChainName = 13 - // LocalNet - // zeta_localnet = 13; ChainName_goerli_localnet ChainName = 14 ChainName_btc_regtest ChainName = 15 + ChainName_amoy_testnet ChainName = 16 ) var ChainName_name = map[int32]string{ @@ -93,6 +91,7 @@ var ChainName_name = map[int32]string{ 13: "sepolia_testnet", 14: "goerli_localnet", 15: "btc_regtest", + 16: "amoy_testnet", } var ChainName_value = map[string]int32{ @@ -112,6 +111,7 @@ var ChainName_value = map[string]int32{ "sepolia_testnet": 13, "goerli_localnet": 14, "btc_regtest": 15, + "amoy_testnet": 16, } func (x ChainName) String() string { @@ -183,32 +183,32 @@ func init() { func init() { proto.RegisterFile("pkg/chains/chains.proto", fileDescriptor_37ad35e0488e8bbc) } var fileDescriptor_37ad35e0488e8bbc = []byte{ - // 390 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x44, 0x92, 0x31, 0xaf, 0xd3, 0x30, - 0x10, 0x80, 0xe3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0x71, 0xc1, 0xef, 0x1b, 0x52, 0x1f, 0x46, - 0x98, 0x97, 0xfa, 0x18, 0x38, 0x74, 0x06, 0x13, 0xd4, 0xe9, 0x21, 0x67, 0xb2, 0x28, 0x50, 0x07, - 0x84, 0x06, 0x70, 0xff, 0x03, 0x35, 0xeb, 0x89, 0x6b, 0x94, 0x58, 0xf3, 0x1e, 0xdc, 0xd0, 0xa7, - 0x30, 0x2b, 0x55, 0x76, 0x14, 0xaa, 0xe8, 0xe1, 0xad, 0xb5, 0xea, 0xc1, 0x1a, 0x51, 0x0a, 0x53, - 0xa1, 0xb0, 0xca, 0xe4, 0x41, 0x63, 0xad, 0x0d, 0xf3, 0x0c, 0xcb, 0x9b, 0x3c, 0x66, 0x03, 0x1b, - 0x9b, 0x6a, 0x82, 0x15, 0x8c, 0xa7, 0xd8, 0xc3, 0x3b, 0x23, 0xc6, 0x4c, 0xc5, 0x2c, 0xee, 0x99, - 0xdf, 0x75, 0xe8, 0x00, 0xf4, 0xa3, 0x76, 0x64, 0xd2, 0x8d, 0xda, 0x81, 0x7b, 0x53, 0xbc, 0xc6, - 0x52, 0x65, 0x72, 0xb0, 0x1e, 0x6c, 0xc7, 0x76, 0xb2, 0x4c, 0x71, 0x96, 0x19, 0x38, 0xed, 0xae, - 0x56, 0x28, 0x8c, 0x18, 0xcc, 0xda, 0x1f, 0xf7, 0x61, 0xfb, 0xf7, 0x1c, 0x92, 0xd3, 0x39, 0x24, - 0xff, 0xcf, 0x21, 0xf9, 0x79, 0x09, 0x9d, 0xd3, 0x25, 0x74, 0xfe, 0x5d, 0x42, 0xe7, 0xeb, 0x2b, - 0x21, 0x75, 0xda, 0xc4, 0x1b, 0xae, 0xf2, 0xc8, 0x8c, 0xf1, 0xda, 0x3e, 0x94, 0x0d, 0xb9, 0xaa, - 0x30, 0x1a, 0x76, 0x27, 0xf6, 0xec, 0x5e, 0xbc, 0x7b, 0x0c, 0x00, 0x00, 0xff, 0xff, 0xad, 0x5e, - 0x66, 0xdc, 0x50, 0x02, 0x00, 0x00, + // 396 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x44, 0x92, 0x4f, 0x6f, 0xd3, 0x30, + 0x14, 0xc0, 0xe3, 0x6e, 0x6d, 0x97, 0xd7, 0xad, 0x35, 0x06, 0x89, 0xb1, 0x43, 0x34, 0x71, 0x1a, + 0x93, 0x68, 0x10, 0x1c, 0xb9, 0x51, 0x09, 0x89, 0x0b, 0x87, 0x8e, 0x13, 0x97, 0xca, 0x71, 0x9e, + 0x1c, 0x8b, 0x38, 0x8e, 0x12, 0x07, 0xa9, 0x7c, 0x0a, 0x3e, 0x04, 0x07, 0x3e, 0xca, 0x8e, 0x3b, + 0x72, 0x44, 0xed, 0x17, 0x99, 0xec, 0x2c, 0xce, 0x29, 0xef, 0xfd, 0xfc, 0x7b, 0x7f, 0x14, 0x1b, + 0x5e, 0xd6, 0x3f, 0x64, 0x2a, 0x0a, 0xae, 0xaa, 0xf6, 0xe9, 0xb3, 0xae, 0x1b, 0x63, 0x0d, 0x9b, + 0xf5, 0xd9, 0xd5, 0x0b, 0x69, 0xa4, 0xf1, 0x28, 0x75, 0x51, 0x7f, 0xfa, 0xfa, 0x1b, 0x4c, 0x37, + 0xee, 0x9c, 0xbd, 0x03, 0xf0, 0xe2, 0xae, 0xe2, 0x1a, 0x2f, 0xc9, 0x35, 0xb9, 0x59, 0xbe, 0x7f, + 0xb6, 0x7e, 0xea, 0xe4, 0x95, 0xaf, 0x5c, 0xe3, 0x36, 0x16, 0x43, 0xc8, 0x5e, 0xc1, 0x59, 0x5f, + 0xa1, 0xf2, 0xcb, 0xc9, 0x35, 0xb9, 0x39, 0xd9, 0xce, 0x7d, 0xfe, 0x25, 0xbf, 0xfd, 0x08, 0x17, + 0x5b, 0x14, 0xa8, 0x7e, 0xe2, 0x9d, 0xe5, 0xb6, 0x6b, 0xd9, 0x02, 0xe6, 0x9b, 0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, 0x91, 0xca, 0x16, 0x5d, 0xb6, 0x16, 0x46, 0xa7, 0x6e, 0xb1, 0xb7, + 0xfe, 0xea, 0x7c, 0x28, 0x4c, 0x83, 0xe9, 0xf8, 0x9a, 0xb2, 0x99, 0x7f, 0x29, 0x1f, 0x1e, 0x03, + 0x00, 0x00, 0xff, 0xff, 0xda, 0x8f, 0xd7, 0xf3, 0x62, 0x02, 0x00, 0x00, } func (m *Chain) Marshal() (dAtA []byte, err error) { diff --git a/pkg/chains/chains_test.go b/pkg/chains/chains_test.go index 070cb5922e..51e22e85fd 100644 --- a/pkg/chains/chains_test.go +++ b/pkg/chains/chains_test.go @@ -25,6 +25,7 @@ func TestChainRetrievalFunctions(t *testing.T) { {"BscTestnetChain", BscTestnetChain, Chain{ChainName: ChainName_bsc_testnet, ChainId: 97}}, {"BtcTestNetChain", BtcTestNetChain, Chain{ChainName: ChainName_btc_testnet, ChainId: 18332}}, {"MumbaiChain", MumbaiChain, Chain{ChainName: ChainName_mumbai_testnet, ChainId: 80001}}, + {"AmoyChain", AmoyChain, Chain{ChainName: ChainName_amoy_testnet, ChainId: 80002}}, {"BtcRegtestChain", BtcRegtestChain, Chain{ChainName: ChainName_btc_regtest, ChainId: 18444}}, {"GoerliLocalnetChain", GoerliLocalnetChain, Chain{ChainName: ChainName_goerli_localnet, ChainId: 1337}}, } @@ -43,11 +44,11 @@ func TestChainListFunctions(t *testing.T) { function func() []*Chain expected []Chain }{ - {"DefaultChainsList", DefaultChainsList, []Chain{BtcMainnetChain(), BscMainnetChain(), EthChain(), BtcTestNetChain(), MumbaiChain(), BscTestnetChain(), GoerliChain(), SepoliaChain(), BtcRegtestChain(), GoerliLocalnetChain(), ZetaChainMainnet(), ZetaTestnetChain(), ZetaMocknetChain(), ZetaPrivnetChain()}}, + {"DefaultChainsList", DefaultChainsList, []Chain{BtcMainnetChain(), BscMainnetChain(), EthChain(), BtcTestNetChain(), MumbaiChain(), AmoyChain(), BscTestnetChain(), GoerliChain(), SepoliaChain(), BtcRegtestChain(), GoerliLocalnetChain(), ZetaChainMainnet(), ZetaTestnetChain(), ZetaMocknetChain(), ZetaPrivnetChain()}}, {"MainnetChainList", MainnetChainList, []Chain{ZetaChainMainnet(), BtcMainnetChain(), BscMainnetChain(), EthChain()}}, - {"TestnetChainList", TestnetChainList, []Chain{ZetaTestnetChain(), BtcTestNetChain(), MumbaiChain(), BscTestnetChain(), GoerliChain(), SepoliaChain()}}, + {"TestnetChainList", TestnetChainList, []Chain{ZetaTestnetChain(), BtcTestNetChain(), MumbaiChain(), AmoyChain(), BscTestnetChain(), GoerliChain(), SepoliaChain()}}, {"PrivnetChainList", PrivnetChainList, []Chain{ZetaPrivnetChain(), BtcRegtestChain(), GoerliLocalnetChain()}}, - {"ExternalChainList", ExternalChainList, []Chain{BtcMainnetChain(), BscMainnetChain(), EthChain(), BtcTestNetChain(), MumbaiChain(), BscTestnetChain(), GoerliChain(), SepoliaChain(), BtcRegtestChain(), GoerliLocalnetChain()}}, + {"ExternalChainList", ExternalChainList, []Chain{BtcMainnetChain(), BscMainnetChain(), EthChain(), BtcTestNetChain(), MumbaiChain(), AmoyChain(), BscTestnetChain(), GoerliChain(), SepoliaChain(), BtcRegtestChain(), GoerliLocalnetChain()}}, {"ZetaChainList", ZetaChainList, []Chain{ZetaChainMainnet(), ZetaTestnetChain(), ZetaMocknetChain(), ZetaPrivnetChain()}}, } diff --git a/proto/pkg/chains/chains.proto b/proto/pkg/chains/chains.proto index fa9e9e49db..49305d4f16 100644 --- a/proto/pkg/chains/chains.proto +++ b/proto/pkg/chains/chains.proto @@ -21,7 +21,6 @@ enum ChainName { btc_mainnet = 3; polygon_mainnet = 4; bsc_mainnet = 5; - // Testnet goerli_testnet = 6; mumbai_testnet = 7; ganache_testnet = 8; @@ -30,12 +29,9 @@ enum ChainName { zeta_testnet = 11; btc_testnet = 12; sepolia_testnet = 13; - // LocalNet - // zeta_localnet = 13; goerli_localnet = 14; btc_regtest = 15; - // Athens - // zeta_athensnet=15; + amoy_testnet = 16; } message Chain { diff --git a/typescript/pkg/chains/chains_pb.d.ts b/typescript/pkg/chains/chains_pb.d.ts index 0a04c14420..4a2efde10d 100644 --- a/typescript/pkg/chains/chains_pb.d.ts +++ b/typescript/pkg/chains/chains_pb.d.ts @@ -63,8 +63,6 @@ export declare enum ChainName { bsc_mainnet = 5, /** - * Testnet - * * @generated from enum value: goerli_testnet = 6; */ goerli_testnet = 6, @@ -105,20 +103,19 @@ export declare enum ChainName { sepolia_testnet = 13, /** - * LocalNet - * zeta_localnet = 13; - * * @generated from enum value: goerli_localnet = 14; */ goerli_localnet = 14, /** - * Athens - * zeta_athensnet=15; - * * @generated from enum value: btc_regtest = 15; */ btc_regtest = 15, + + /** + * @generated from enum value: amoy_testnet = 16; + */ + amoy_testnet = 16, } /**