From a883b7f351683eb37255b24ff3606ac073da47d2 Mon Sep 17 00:00:00 2001 From: bruce-riley <96066700+bruce-riley@users.noreply.github.com> Date: Tue, 12 Mar 2024 09:46:28 -0500 Subject: [PATCH] Deploy Polygon Sepolia Testnet (#3723) * Deploy Polygon Sepolia Testnet * Code review rework --- devnet/node.yaml | 2 + ethereum/.env.polygon.sepolia | 17 ++ ethereum/truffle-config.js | 9 ++ node/cmd/guardiand/adminnodes.go | 1 + node/cmd/guardiand/node.go | 25 +++ node/pkg/proto/publicrpc/v1/publicrpc.pb.go | 167 ++++++++++---------- node/pkg/query/query.go | 1 + node/pkg/watchers/evm/watcher.go | 3 +- proto/publicrpc/v1/publicrpc.proto | 1 + sdk/js/CHANGELOG.md | 4 + sdk/js/package.json | 2 +- sdk/js/src/utils/consts.ts | 19 +++ sdk/testnet_consts.go | 2 + sdk/vaa/structs.go | 7 + sdk/vaa/structs_test.go | 3 + 15 files changed, 180 insertions(+), 83 deletions(-) create mode 100644 ethereum/.env.polygon.sepolia diff --git a/devnet/node.yaml b/devnet/node.yaml index d01ebfa11..c0ea551c1 100644 --- a/devnet/node.yaml +++ b/devnet/node.yaml @@ -124,6 +124,8 @@ spec: - ws://eth-devnet:8545 - --optimismSepoliaRPC - ws://eth-devnet:8545 + - --polygonSepoliaRPC + - ws://eth-devnet:8545 # - --wormchainURL # - wormchain:9090 # - --accountantKeyPath diff --git a/ethereum/.env.polygon.sepolia b/ethereum/.env.polygon.sepolia new file mode 100644 index 000000000..f8dd412aa --- /dev/null +++ b/ethereum/.env.polygon.sepolia @@ -0,0 +1,17 @@ +# Polygon on Sepolia testnet +# Rename to .env to use with truffle migrations + +# Wormhole Core Migrations +INIT_SIGNERS=["0x13947Bd48b18E53fdAeEe77F3473391aC727C638"] +INIT_CHAIN_ID=10007 +INIT_GOV_CHAIN_ID=0x1 +INIT_GOV_CONTRACT=0x0000000000000000000000000000000000000000000000000000000000000004 +INIT_EVM_CHAIN_ID=80002 + +# Bridge Migrations +BRIDGE_INIT_CHAIN_ID=10007 +BRIDGE_INIT_GOV_CHAIN_ID=0x1 +BRIDGE_INIT_GOV_CONTRACT=0x0000000000000000000000000000000000000000000000000000000000000004 +# Can't find a WETH as of 1/18/2024. +BRIDGE_INIT_WETH=0x0000000000000000000000000000000000000000 +BRIDGE_INIT_FINALITY=1 \ No newline at end of file diff --git a/ethereum/truffle-config.js b/ethereum/truffle-config.js index 9d2934710..d0c464315 100644 --- a/ethereum/truffle-config.js +++ b/ethereum/truffle-config.js @@ -85,6 +85,15 @@ module.exports = { }, network_id: "80001", }, + polygon_sepolia_testnet: { + provider: () => { + return new HDWalletProvider( + process.env.MNEMONIC, + "https://rpc-amoy.polygon.technology/" + ); + }, + network_id: "80002", + }, avalanche: { provider: () => { return new HDWalletProvider( diff --git a/node/cmd/guardiand/adminnodes.go b/node/cmd/guardiand/adminnodes.go index 99cfefc7d..16780a996 100644 --- a/node/cmd/guardiand/adminnodes.go +++ b/node/cmd/guardiand/adminnodes.go @@ -121,6 +121,7 @@ func runListNodes(cmd *cobra.Command, args []string) { {"ArbitrumSepolia", vaa.ChainIDArbitrumSepolia}, {"BaseSepolia", vaa.ChainIDBaseSepolia}, {"OptimismSepolia", vaa.ChainIDOptimismSepolia}, + {"PolygonSepolia", vaa.ChainIDPolygonSepolia}, } if len(only) > 0 { diff --git a/node/cmd/guardiand/node.go b/node/cmd/guardiand/node.go index 112bb651e..087bf3a78 100644 --- a/node/cmd/guardiand/node.go +++ b/node/cmd/guardiand/node.go @@ -191,6 +191,9 @@ var ( optimismSepoliaRPC *string optimismSepoliaContract *string + polygonSepoliaRPC *string + polygonSepoliaContract *string + logLevel *string publicRpcLogDetailStr *string publicRpcLogToTelemetry *bool @@ -371,6 +374,9 @@ func init() { optimismSepoliaRPC = node.RegisterFlagWithValidationOrFail(NodeCmd, "optimismSepoliaRPC", "Optimism on Sepolia RPC URL", "ws://eth-devnet:8545", []string{"ws", "wss"}) optimismSepoliaContract = NodeCmd.Flags().String("optimismSepoliaContract", "", "Optimism on Sepolia contract address") + polygonSepoliaRPC = node.RegisterFlagWithValidationOrFail(NodeCmd, "polygonSepoliaRPC", "Polygon on Sepolia RPC URL", "ws://eth-devnet:8545", []string{"ws", "wss"}) + polygonSepoliaContract = NodeCmd.Flags().String("polygonSepoliaContract", "", "Polygon on Sepolia contract address") + logLevel = NodeCmd.Flags().String("logLevel", "info", "Logging level (debug, info, warn, error, dpanic, panic, fatal)") publicRpcLogDetailStr = NodeCmd.Flags().String("publicRpcLogDetail", "full", "The detail with which public RPC requests shall be logged (none=no logging, minimal=only log gRPC methods, full=log gRPC method, payload (up to 200 bytes) and user agent (up to 200 bytes))") publicRpcLogToTelemetry = NodeCmd.Flags().Bool("logPublicRpcToTelemetry", true, "whether or not to include publicRpc request logs in telemetry") @@ -543,6 +549,7 @@ func runNode(cmd *cobra.Command, args []string) { *arbitrumSepoliaContract = unsafeDevModeEvmContractAddress(*arbitrumSepoliaContract) *baseSepoliaContract = unsafeDevModeEvmContractAddress(*baseSepoliaContract) *optimismSepoliaContract = unsafeDevModeEvmContractAddress(*optimismSepoliaContract) + *polygonSepoliaContract = unsafeDevModeEvmContractAddress(*polygonSepoliaContract) } // Verify flags @@ -720,6 +727,9 @@ func runNode(cmd *cobra.Command, args []string) { if (*optimismSepoliaRPC == "") != (*optimismSepoliaContract == "") { logger.Fatal("Both --optimismSepoliaRPC and --optimismSepoliaContract must be set together or both unset") } + if (*polygonSepoliaRPC == "") != (*polygonSepoliaContract == "") { + logger.Fatal("Both --polygonSepoliaRPC and --polygonSepoliaContract must be set together or both unset") + } } else { if *sepoliaRPC != "" || *sepoliaContract != "" { logger.Fatal("Please do not specify --sepoliaRPC or --sepoliaContract") @@ -736,6 +746,9 @@ func runNode(cmd *cobra.Command, args []string) { if *optimismSepoliaRPC != "" || *optimismSepoliaContract != "" { logger.Fatal("Please do not specify --optimismSepoliaRPC or --optimismSepoliaContract") } + if *polygonSepoliaRPC != "" || *polygonSepoliaContract != "" { + logger.Fatal("Please do not specify --polygonSepoliaRPC or --polygonSepoliaContract") + } } var publicRpcLogDetail common.GrpcLogDetail @@ -944,6 +957,7 @@ func runNode(cmd *cobra.Command, args []string) { rpcMap["arbitrumSepoliaRPC"] = *arbitrumSepoliaRPC rpcMap["baseSepoliaRPC"] = *baseSepoliaRPC rpcMap["optimismSepoliaRPC"] = *optimismSepoliaRPC + rpcMap["polygonSepoliaRPC"] = *polygonSepoliaRPC } rpcMap["scrollRPC"] = *scrollRPC rpcMap["solanaRPC"] = *solanaRPC @@ -1552,6 +1566,17 @@ func runNode(cmd *cobra.Command, args []string) { watcherConfigs = append(watcherConfigs, wc) } + + if shouldStart(polygonSepoliaRPC) { + wc := &evm.WatcherConfig{ + NetworkID: "polygon_sepolia", + ChainID: vaa.ChainIDPolygonSepolia, + Rpc: *polygonSepoliaRPC, + Contract: *polygonSepoliaContract, + } + + watcherConfigs = append(watcherConfigs, wc) + } } var ibcWatcherConfig *node.IbcWatcherConfig = nil diff --git a/node/pkg/proto/publicrpc/v1/publicrpc.pb.go b/node/pkg/proto/publicrpc/v1/publicrpc.pb.go index 91da80448..32bded674 100644 --- a/node/pkg/proto/publicrpc/v1/publicrpc.pb.go +++ b/node/pkg/proto/publicrpc/v1/publicrpc.pb.go @@ -73,6 +73,7 @@ const ( ChainID_CHAIN_ID_BASE_SEPOLIA ChainID = 10004 ChainID_CHAIN_ID_OPTIMISM_SEPOLIA ChainID = 10005 ChainID_CHAIN_ID_HOLESKY ChainID = 10006 + ChainID_CHAIN_ID_POLYGON_SEPOLIA ChainID = 10007 ) // Enum value maps for ChainID. @@ -125,6 +126,7 @@ var ( 10004: "CHAIN_ID_BASE_SEPOLIA", 10005: "CHAIN_ID_OPTIMISM_SEPOLIA", 10006: "CHAIN_ID_HOLESKY", + 10007: "CHAIN_ID_POLYGON_SEPOLIA", } ChainID_value = map[string]int32{ "CHAIN_ID_UNSPECIFIED": 0, @@ -174,6 +176,7 @@ var ( "CHAIN_ID_BASE_SEPOLIA": 10004, "CHAIN_ID_OPTIMISM_SEPOLIA": 10005, "CHAIN_ID_HOLESKY": 10006, + "CHAIN_ID_POLYGON_SEPOLIA": 10007, } ) @@ -1364,7 +1367,7 @@ var file_publicrpc_v1_publicrpc_proto_rawDesc = []byte{ 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x02, 0x52, 0x05, 0x70, 0x72, 0x69, - 0x63, 0x65, 0x2a, 0x9c, 0x08, 0x0a, 0x07, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x44, 0x12, 0x18, + 0x63, 0x65, 0x2a, 0xbb, 0x08, 0x0a, 0x07, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x44, 0x12, 0x18, 0x0a, 0x14, 0x43, 0x48, 0x41, 0x49, 0x4e, 0x5f, 0x49, 0x44, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x13, 0x0a, 0x0f, 0x43, 0x48, 0x41, 0x49, 0x4e, 0x5f, 0x49, 0x44, 0x5f, 0x53, 0x4f, 0x4c, 0x41, 0x4e, 0x41, 0x10, 0x01, 0x12, 0x15, 0x0a, @@ -1430,88 +1433,90 @@ var file_publicrpc_v1_publicrpc_proto_rawDesc = []byte{ 0x41, 0x49, 0x4e, 0x5f, 0x49, 0x44, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4d, 0x49, 0x53, 0x4d, 0x5f, 0x53, 0x45, 0x50, 0x4f, 0x4c, 0x49, 0x41, 0x10, 0x95, 0x4e, 0x12, 0x15, 0x0a, 0x10, 0x43, 0x48, 0x41, 0x49, 0x4e, 0x5f, 0x49, 0x44, 0x5f, 0x48, 0x4f, 0x4c, 0x45, 0x53, 0x4b, 0x59, 0x10, 0x96, - 0x4e, 0x32, 0xc6, 0x09, 0x0a, 0x10, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x52, 0x50, 0x43, 0x53, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x7c, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x73, - 0x74, 0x48, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x73, 0x12, 0x26, 0x2e, 0x70, 0x75, - 0x62, 0x6c, 0x69, 0x63, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x61, - 0x73, 0x74, 0x48, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x72, 0x70, 0x63, 0x2e, - 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x73, 0x74, 0x48, 0x65, 0x61, 0x72, 0x74, 0x62, - 0x65, 0x61, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x16, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x10, 0x12, 0x0e, 0x2f, 0x76, 0x31, 0x2f, 0x68, 0x65, 0x61, 0x72, 0x74, 0x62, - 0x65, 0x61, 0x74, 0x73, 0x12, 0xbb, 0x01, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x53, 0x69, 0x67, 0x6e, - 0x65, 0x64, 0x56, 0x41, 0x41, 0x12, 0x21, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x72, 0x70, - 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x41, - 0x41, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, - 0x63, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x65, - 0x64, 0x56, 0x41, 0x41, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x64, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x5e, 0x12, 0x5c, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, - 0x5f, 0x76, 0x61, 0x61, 0x2f, 0x7b, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, - 0x2e, 0x65, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x72, 0x5f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x7d, 0x2f, - 0x7b, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x2e, 0x65, 0x6d, 0x69, 0x74, - 0x74, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x7d, 0x2f, 0x7b, 0x6d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x2e, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, - 0x65, 0x7d, 0x12, 0x91, 0x01, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, - 0x74, 0x47, 0x75, 0x61, 0x72, 0x64, 0x69, 0x61, 0x6e, 0x53, 0x65, 0x74, 0x12, 0x2a, 0x2e, 0x70, - 0x75, 0x62, 0x6c, 0x69, 0x63, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x43, - 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x47, 0x75, 0x61, 0x72, 0x64, 0x69, 0x61, 0x6e, 0x53, 0x65, - 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, - 0x63, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x75, 0x72, 0x72, 0x65, - 0x6e, 0x74, 0x47, 0x75, 0x61, 0x72, 0x64, 0x69, 0x61, 0x6e, 0x53, 0x65, 0x74, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x19, 0x12, 0x17, 0x2f, - 0x76, 0x31, 0x2f, 0x67, 0x75, 0x61, 0x72, 0x64, 0x69, 0x61, 0x6e, 0x73, 0x65, 0x74, 0x2f, 0x63, - 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x12, 0xcc, 0x01, 0x0a, 0x23, 0x47, 0x6f, 0x76, 0x65, 0x72, - 0x6e, 0x6f, 0x72, 0x47, 0x65, 0x74, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x4e, - 0x6f, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x42, 0x79, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x12, 0x38, - 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x6f, - 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x47, 0x65, 0x74, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, - 0x6c, 0x65, 0x4e, 0x6f, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x42, 0x79, 0x43, 0x68, 0x61, 0x69, - 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x39, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, - 0x63, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, - 0x47, 0x65, 0x74, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x6f, 0x74, 0x69, - 0x6f, 0x6e, 0x61, 0x6c, 0x42, 0x79, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x30, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2a, 0x12, 0x28, 0x2f, 0x76, 0x31, - 0x2f, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x2f, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, - 0x62, 0x6c, 0x65, 0x5f, 0x6e, 0x6f, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x62, 0x79, 0x5f, - 0x63, 0x68, 0x61, 0x69, 0x6e, 0x12, 0x9a, 0x01, 0x0a, 0x17, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, - 0x6f, 0x72, 0x47, 0x65, 0x74, 0x45, 0x6e, 0x71, 0x75, 0x65, 0x75, 0x65, 0x64, 0x56, 0x41, 0x41, - 0x73, 0x12, 0x2c, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, - 0x2e, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x47, 0x65, 0x74, 0x45, 0x6e, 0x71, 0x75, - 0x65, 0x75, 0x65, 0x64, 0x56, 0x41, 0x41, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x2d, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x47, - 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x47, 0x65, 0x74, 0x45, 0x6e, 0x71, 0x75, 0x65, 0x75, - 0x65, 0x64, 0x56, 0x41, 0x41, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x22, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1c, 0x12, 0x1a, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x6f, 0x76, 0x65, - 0x72, 0x6e, 0x6f, 0x72, 0x2f, 0x65, 0x6e, 0x71, 0x75, 0x65, 0x75, 0x65, 0x64, 0x5f, 0x76, 0x61, - 0x61, 0x73, 0x12, 0xe4, 0x01, 0x0a, 0x15, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x49, - 0x73, 0x56, 0x41, 0x41, 0x45, 0x6e, 0x71, 0x75, 0x65, 0x75, 0x65, 0x64, 0x12, 0x2a, 0x2e, 0x70, - 0x75, 0x62, 0x6c, 0x69, 0x63, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x6f, 0x76, 0x65, - 0x72, 0x6e, 0x6f, 0x72, 0x49, 0x73, 0x56, 0x41, 0x41, 0x45, 0x6e, 0x71, 0x75, 0x65, 0x75, 0x65, - 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, - 0x63, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, - 0x49, 0x73, 0x56, 0x41, 0x41, 0x45, 0x6e, 0x71, 0x75, 0x65, 0x75, 0x65, 0x64, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x72, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x6c, 0x12, 0x6a, 0x2f, - 0x76, 0x31, 0x2f, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x2f, 0x69, 0x73, 0x5f, 0x76, - 0x61, 0x61, 0x5f, 0x65, 0x6e, 0x71, 0x75, 0x65, 0x75, 0x65, 0x64, 0x2f, 0x7b, 0x6d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x2e, 0x65, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x72, 0x5f, - 0x63, 0x68, 0x61, 0x69, 0x6e, 0x7d, 0x2f, 0x7b, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, - 0x69, 0x64, 0x2e, 0x65, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x7d, 0x2f, 0x7b, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x2e, - 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x7d, 0x12, 0x8e, 0x01, 0x0a, 0x14, 0x47, 0x6f, - 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x47, 0x65, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x4c, 0x69, - 0x73, 0x74, 0x12, 0x29, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x72, 0x70, 0x63, 0x2e, 0x76, - 0x31, 0x2e, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x47, 0x65, 0x74, 0x54, 0x6f, 0x6b, - 0x65, 0x6e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, + 0x4e, 0x12, 0x1d, 0x0a, 0x18, 0x43, 0x48, 0x41, 0x49, 0x4e, 0x5f, 0x49, 0x44, 0x5f, 0x50, 0x4f, + 0x4c, 0x59, 0x47, 0x4f, 0x4e, 0x5f, 0x53, 0x45, 0x50, 0x4f, 0x4c, 0x49, 0x41, 0x10, 0x97, 0x4e, + 0x32, 0xc6, 0x09, 0x0a, 0x10, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x52, 0x50, 0x43, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x7c, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x73, 0x74, + 0x48, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x73, 0x12, 0x26, 0x2e, 0x70, 0x75, 0x62, + 0x6c, 0x69, 0x63, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x73, + 0x74, 0x48, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x72, 0x70, 0x63, 0x2e, 0x76, + 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x73, 0x74, 0x48, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, + 0x61, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x16, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x10, 0x12, 0x0e, 0x2f, 0x76, 0x31, 0x2f, 0x68, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, + 0x61, 0x74, 0x73, 0x12, 0xbb, 0x01, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x65, + 0x64, 0x56, 0x41, 0x41, 0x12, 0x21, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x72, 0x70, 0x63, + 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x41, 0x41, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, + 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, + 0x56, 0x41, 0x41, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x64, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x5e, 0x12, 0x5c, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x5f, + 0x76, 0x61, 0x61, 0x2f, 0x7b, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x2e, + 0x65, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x72, 0x5f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x7d, 0x2f, 0x7b, + 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x2e, 0x65, 0x6d, 0x69, 0x74, 0x74, + 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x7d, 0x2f, 0x7b, 0x6d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x2e, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, + 0x7d, 0x12, 0x91, 0x01, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, + 0x47, 0x75, 0x61, 0x72, 0x64, 0x69, 0x61, 0x6e, 0x53, 0x65, 0x74, 0x12, 0x2a, 0x2e, 0x70, 0x75, + 0x62, 0x6c, 0x69, 0x63, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x75, + 0x72, 0x72, 0x65, 0x6e, 0x74, 0x47, 0x75, 0x61, 0x72, 0x64, 0x69, 0x61, 0x6e, 0x53, 0x65, 0x74, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, + 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, + 0x74, 0x47, 0x75, 0x61, 0x72, 0x64, 0x69, 0x61, 0x6e, 0x53, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x19, 0x12, 0x17, 0x2f, 0x76, + 0x31, 0x2f, 0x67, 0x75, 0x61, 0x72, 0x64, 0x69, 0x61, 0x6e, 0x73, 0x65, 0x74, 0x2f, 0x63, 0x75, + 0x72, 0x72, 0x65, 0x6e, 0x74, 0x12, 0xcc, 0x01, 0x0a, 0x23, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, + 0x6f, 0x72, 0x47, 0x65, 0x74, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x6f, + 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x42, 0x79, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x12, 0x38, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x6f, 0x76, + 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x47, 0x65, 0x74, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, + 0x65, 0x4e, 0x6f, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x42, 0x79, 0x43, 0x68, 0x61, 0x69, 0x6e, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x39, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, + 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x47, + 0x65, 0x74, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x6f, 0x74, 0x69, 0x6f, + 0x6e, 0x61, 0x6c, 0x42, 0x79, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x30, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2a, 0x12, 0x28, 0x2f, 0x76, 0x31, 0x2f, + 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x2f, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, + 0x6c, 0x65, 0x5f, 0x6e, 0x6f, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x62, 0x79, 0x5f, 0x63, + 0x68, 0x61, 0x69, 0x6e, 0x12, 0x9a, 0x01, 0x0a, 0x17, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, + 0x72, 0x47, 0x65, 0x74, 0x45, 0x6e, 0x71, 0x75, 0x65, 0x75, 0x65, 0x64, 0x56, 0x41, 0x41, 0x73, + 0x12, 0x2c, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, + 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x47, 0x65, 0x74, 0x45, 0x6e, 0x71, 0x75, 0x65, + 0x75, 0x65, 0x64, 0x56, 0x41, 0x41, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, + 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x6f, + 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x47, 0x65, 0x74, 0x45, 0x6e, 0x71, 0x75, 0x65, 0x75, 0x65, + 0x64, 0x56, 0x41, 0x41, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x22, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x1c, 0x12, 0x1a, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x6f, 0x76, 0x65, 0x72, + 0x6e, 0x6f, 0x72, 0x2f, 0x65, 0x6e, 0x71, 0x75, 0x65, 0x75, 0x65, 0x64, 0x5f, 0x76, 0x61, 0x61, + 0x73, 0x12, 0xe4, 0x01, 0x0a, 0x15, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x49, 0x73, + 0x56, 0x41, 0x41, 0x45, 0x6e, 0x71, 0x75, 0x65, 0x75, 0x65, 0x64, 0x12, 0x2a, 0x2e, 0x70, 0x75, + 0x62, 0x6c, 0x69, 0x63, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x6f, 0x76, 0x65, 0x72, + 0x6e, 0x6f, 0x72, 0x49, 0x73, 0x56, 0x41, 0x41, 0x45, 0x6e, 0x71, 0x75, 0x65, 0x75, 0x65, 0x64, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, + 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x49, + 0x73, 0x56, 0x41, 0x41, 0x45, 0x6e, 0x71, 0x75, 0x65, 0x75, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x72, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x6c, 0x12, 0x6a, 0x2f, 0x76, + 0x31, 0x2f, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x2f, 0x69, 0x73, 0x5f, 0x76, 0x61, + 0x61, 0x5f, 0x65, 0x6e, 0x71, 0x75, 0x65, 0x75, 0x65, 0x64, 0x2f, 0x7b, 0x6d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x2e, 0x65, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x72, 0x5f, 0x63, + 0x68, 0x61, 0x69, 0x6e, 0x7d, 0x2f, 0x7b, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x69, + 0x64, 0x2e, 0x65, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x7d, 0x2f, 0x7b, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x2e, 0x73, + 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x7d, 0x12, 0x8e, 0x01, 0x0a, 0x14, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x47, 0x65, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x4c, 0x69, 0x73, - 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1f, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x19, 0x12, 0x17, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x2f, - 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x42, 0x47, 0x5a, 0x45, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x65, 0x72, 0x74, 0x75, 0x73, 0x6f, - 0x6e, 0x65, 0x2f, 0x77, 0x6f, 0x72, 0x6d, 0x68, 0x6f, 0x6c, 0x65, 0x2f, 0x6e, 0x6f, 0x64, 0x65, - 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x75, 0x62, 0x6c, 0x69, - 0x63, 0x72, 0x70, 0x63, 0x2f, 0x76, 0x31, 0x3b, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x72, 0x70, - 0x63, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x74, 0x12, 0x29, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, + 0x2e, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x47, 0x65, 0x74, 0x54, 0x6f, 0x6b, 0x65, + 0x6e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x70, + 0x75, 0x62, 0x6c, 0x69, 0x63, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x6f, 0x76, 0x65, + 0x72, 0x6e, 0x6f, 0x72, 0x47, 0x65, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x4c, 0x69, 0x73, 0x74, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x19, + 0x12, 0x17, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x2f, 0x74, + 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x42, 0x47, 0x5a, 0x45, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x65, 0x72, 0x74, 0x75, 0x73, 0x6f, 0x6e, + 0x65, 0x2f, 0x77, 0x6f, 0x72, 0x6d, 0x68, 0x6f, 0x6c, 0x65, 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x2f, + 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, + 0x72, 0x70, 0x63, 0x2f, 0x76, 0x31, 0x3b, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x72, 0x70, 0x63, + 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/node/pkg/query/query.go b/node/pkg/query/query.go index 28dd5f83e..80d00937a 100644 --- a/node/pkg/query/query.go +++ b/node/pkg/query/query.go @@ -155,6 +155,7 @@ func handleQueryRequestsImpl( vaa.ChainIDArbitrumSepolia: {}, vaa.ChainIDBaseSepolia: {}, vaa.ChainIDOptimismSepolia: {}, + vaa.ChainIDPolygonSepolia: {}, } // But we don't want to allow CCQ if the chain is not enabled. diff --git a/node/pkg/watchers/evm/watcher.go b/node/pkg/watchers/evm/watcher.go index 804bd6ac1..98705dabc 100644 --- a/node/pkg/watchers/evm/watcher.go +++ b/node/pkg/watchers/evm/watcher.go @@ -752,7 +752,8 @@ func (w *Watcher) getFinality(ctx context.Context) (bool, bool, error) { } else if w.chainID == vaa.ChainIDScroll { // As of 11/10/2023 Scroll supports polling for finalized but not safe. finalized = true - } else if w.chainID == vaa.ChainIDPolygon { + } else if w.chainID == vaa.ChainIDPolygon || + w.chainID == vaa.ChainIDPolygonSepolia { // Polygon now supports polling for finalized but not safe. // https://forum.polygon.technology/t/optimizing-decentralized-apps-ux-with-milestones-a-significantly-accelerated-finality-solution/13154 finalized = true diff --git a/proto/publicrpc/v1/publicrpc.proto b/proto/publicrpc/v1/publicrpc.proto index 17861ca9d..82aa18905 100644 --- a/proto/publicrpc/v1/publicrpc.proto +++ b/proto/publicrpc/v1/publicrpc.proto @@ -56,6 +56,7 @@ enum ChainID { CHAIN_ID_BASE_SEPOLIA = 10004; CHAIN_ID_OPTIMISM_SEPOLIA = 10005; CHAIN_ID_HOLESKY = 10006; + CHAIN_ID_POLYGON_SEPOLIA = 10007; } // MessageID is a VAA's globally unique identifier (see data availability design document). diff --git a/sdk/js/CHANGELOG.md b/sdk/js/CHANGELOG.md index db294e1a1..49ee4ac99 100644 --- a/sdk/js/CHANGELOG.md +++ b/sdk/js/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 0.10.12 + +Polygon Sepolia support + ## 0.10.11 ### Changes diff --git a/sdk/js/package.json b/sdk/js/package.json index ee21032eb..5c0a5ee23 100644 --- a/sdk/js/package.json +++ b/sdk/js/package.json @@ -1,6 +1,6 @@ { "name": "@certusone/wormhole-sdk", - "version": "0.10.11", + "version": "0.10.12", "description": "SDK for interacting with Wormhole", "homepage": "https://wormhole.com", "main": "./lib/cjs/index.js", diff --git a/sdk/js/src/utils/consts.ts b/sdk/js/src/utils/consts.ts index 7be45c9e5..e29f1ea6e 100644 --- a/sdk/js/src/utils/consts.ts +++ b/sdk/js/src/utils/consts.ts @@ -47,6 +47,7 @@ export const CHAINS = { base_sepolia: 10004, optimism_sepolia: 10005, holesky: 10006, + polygon_sepolia: 10007, } as const; export type ChainName = keyof typeof CHAINS; @@ -82,6 +83,7 @@ export const EVMChainNames = [ "base_sepolia", "optimism_sepolia", "holesky", + "polygon_sepolia", ] as const; export type EVMChainName = typeof EVMChainNames[number]; @@ -340,6 +342,12 @@ const MAINNET = { token_bridge: undefined, nft_bridge: undefined, }, + polygon_sepolia: { + // This is testnet only. + core: undefined, + token_bridge: undefined, + nft_bridge: undefined, + }, cosmoshub: { core: undefined, token_bridge: undefined, @@ -590,6 +598,11 @@ const TESTNET = { token_bridge: "0x76d093BbaE4529a342080546cAFEec4AcbA59EC6", nft_bridge: "0xc8941d483c45eF8FB72E4d1F9dDE089C95fF8171", }, + polygon_sepolia: { + core: "0x6b9C8671cdDC8dEab9c719bB87cBd3e782bA6a35", + token_bridge: "0xC7A204bDBFe983FCD8d8E61D02b475D4073fF97e", + nft_bridge: "0x23908A62110e21C04F3A4e011d24F901F911744A", + }, cosmoshub: { core: undefined, token_bridge: undefined, @@ -839,6 +852,11 @@ const DEVNET = { token_bridge: undefined, nft_bridge: undefined, }, + polygon_sepolia: { + core: undefined, + token_bridge: undefined, + nft_bridge: undefined, + }, cosmoshub: { core: undefined, token_bridge: undefined, @@ -968,6 +986,7 @@ export const CHAIN_ID_ARBITRUM_SEPOLIA = CHAINS["arbitrum_sepolia"]; export const CHAIN_ID_BASE_SEPOLIA = CHAINS["base_sepolia"]; export const CHAIN_ID_OPTIMISM_SEPOLIA = CHAINS["optimism_sepolia"]; export const CHAIN_ID_HOLESKY = CHAINS["holesky"]; +export const POLYGON_SEPOLIA = CHAINS["polygon_sepolia"]; // This inverts the [[CHAINS]] object so that we can look up a chain by id export type ChainIdToName = { diff --git a/sdk/testnet_consts.go b/sdk/testnet_consts.go index e9d93ef6c..94046487e 100644 --- a/sdk/testnet_consts.go +++ b/sdk/testnet_consts.go @@ -40,6 +40,7 @@ var knownTestnetTokenbridgeEmitters = map[vaa.ChainID]string{ vaa.ChainIDArbitrumSepolia: "000000000000000000000000C7A204bDBFe983FCD8d8E61D02b475D4073fF97e", vaa.ChainIDBaseSepolia: "00000000000000000000000086F55A04690fd7815A3D802bD587e83eA888B239", vaa.ChainIDOptimismSepolia: "00000000000000000000000099737Ec4B815d816c49A385943baf0380e75c0Ac", + vaa.ChainIDPolygonSepolia: "000000000000000000000000C7A204bDBFe983FCD8d8E61D02b475D4073fF97e", vaa.ChainIDWormchain: "ef5251ea1e99ae48732800ccc7b83b57881232a73eb796b63b1d86ed2ea44e27", } @@ -69,6 +70,7 @@ var knownTestnetNFTBridgeEmitters = map[vaa.ChainID]string{ vaa.ChainIDArbitrumSepolia: "00000000000000000000000023908A62110e21C04F3A4e011d24F901F911744A", vaa.ChainIDBaseSepolia: "000000000000000000000000268557122Ffd64c85750d630b716471118F323c8", vaa.ChainIDOptimismSepolia: "00000000000000000000000027812285fbe85BA1DF242929B906B31EE3dd1b9f", + vaa.ChainIDPolygonSepolia: "00000000000000000000000023908A62110e21C04F3A4e011d24F901F911744A", } // KnownTestnetAutomaticRelayerEmitters is a list of well-known testnet emitters for the Automatic Relayers. diff --git a/sdk/vaa/structs.go b/sdk/vaa/structs.go index 41de64491..2c3e3b950 100644 --- a/sdk/vaa/structs.go +++ b/sdk/vaa/structs.go @@ -225,6 +225,8 @@ func (c ChainID) String() string { return "optimism_sepolia" case ChainIDHolesky: return "holesky" + case ChainIDPolygonSepolia: + return "polygon_sepolia" default: return fmt.Sprintf("unknown chain ID: %d", c) } @@ -326,6 +328,8 @@ func ChainIDFromString(s string) (ChainID, error) { return ChainIDOptimismSepolia, nil case "holesky": return ChainIDHolesky, nil + case "polygon_sepolia": + return ChainIDPolygonSepolia, nil default: return ChainIDUnset, fmt.Errorf("unknown chain ID: %s", s) } @@ -379,6 +383,7 @@ func GetAllNetworkIDs() []ChainID { ChainIDBaseSepolia, ChainIDOptimismSepolia, ChainIDHolesky, + ChainIDPolygonSepolia, } } @@ -477,6 +482,8 @@ const ( ChainIDOptimismSepolia ChainID = 10005 // ChainIDHolesky is the ChainID of Holesky ChainIDHolesky ChainID = 10006 + // ChainIDPolygonSepolia is the ChainID of Polygon on Sepolia + ChainIDPolygonSepolia ChainID = 10007 // Minimum VAA size is derrived from the following assumptions: // HEADER diff --git a/sdk/vaa/structs_test.go b/sdk/vaa/structs_test.go index 3db428bd9..f561b7869 100644 --- a/sdk/vaa/structs_test.go +++ b/sdk/vaa/structs_test.go @@ -73,6 +73,7 @@ func TestChainIDFromString(t *testing.T) { {input: "base_sepolia", output: ChainIDBaseSepolia}, {input: "optimism_sepolia", output: ChainIDOptimismSepolia}, {input: "holesky", output: ChainIDHolesky}, + {input: "polygon_sepolia", output: ChainIDPolygonSepolia}, {input: "Solana", output: ChainIDSolana}, {input: "Ethereum", output: ChainIDEthereum}, @@ -117,6 +118,7 @@ func TestChainIDFromString(t *testing.T) { {input: "Base_Sepolia", output: ChainIDBaseSepolia}, {input: "Optimism_Sepolia", output: ChainIDOptimismSepolia}, {input: "Holesky", output: ChainIDHolesky}, + {input: "Polygon_Sepolia", output: ChainIDPolygonSepolia}, } // Negative Test Cases @@ -301,6 +303,7 @@ func TestChainId_String(t *testing.T) { {input: 10004, output: "base_sepolia"}, {input: 10005, output: "optimism_sepolia"}, {input: 10006, output: "holesky"}, + {input: 10007, output: "polygon_sepolia"}, {input: 10000, output: "unknown chain ID: 10000"}, }