Jelajahi Sumber

Deploy Blast testnet (#3859)

* Deploy Blast testnet

* Update contract addresses
bruce-riley 1 tahun lalu
induk
melakukan
428920acb8

+ 2 - 0
devnet/node.yaml

@@ -114,6 +114,8 @@ spec:
             - ws://eth-devnet:8545
             - --mantleRPC
             - ws://eth-devnet:8545
+            - --blastRPC
+            - ws://eth-devnet:8545
             - --sepoliaRPC
             - ws://eth-devnet:8545
             - --holeskyRPC

+ 17 - 0
ethereum/.env.blast.testnet

@@ -0,0 +1,17 @@
+# Blast testnet env
+# Rename to .env to use with truffle migrations
+
+# Wormhole Core Migrations
+INIT_SIGNERS=["0x13947Bd48b18E53fdAeEe77F3473391aC727C638"]
+INIT_CHAIN_ID=36
+INIT_GOV_CHAIN_ID=0x1
+INIT_GOV_CONTRACT=0x0000000000000000000000000000000000000000000000000000000000000004
+INIT_EVM_CHAIN_ID=168587773
+
+# Bridge Migrations
+BRIDGE_INIT_CHAIN_ID=36
+BRIDGE_INIT_GOV_CHAIN_ID=0x1
+BRIDGE_INIT_GOV_CONTRACT=0x0000000000000000000000000000000000000000000000000000000000000004
+# Using "Non-rebasing WETH"
+BRIDGE_INIT_WETH=0x9D020B1697035d9d54f115194c9e04a1e4Eb9aF7
+BRIDGE_INIT_FINALITY=1

+ 11 - 0
ethereum/truffle-config.js

@@ -423,6 +423,17 @@ module.exports = {
       network_id: 5003,
       gasPrice: 2520000000,
     },
+    blast_testnet: {
+      provider: () => {
+        return new HDWalletProvider(
+          process.env.MNEMONIC,
+          "https://blast-sepolia.drpc.org"
+          // "https://sepolia.blast.io" // This didn't work.
+        );
+      },
+      network_id: 168587773,
+      gasPrice: 2500000000,
+    },
     rootstock: {
       provider: () => {
         return new HDWalletProvider(

+ 1 - 0
node/cmd/guardiand/adminnodes.go

@@ -115,6 +115,7 @@ func runListNodes(cmd *cobra.Command, args []string) {
 		{"Sei", vaa.ChainIDSei},
 		{"Scroll", vaa.ChainIDScroll},
 		{"Mantle", vaa.ChainIDMantle},
+		{"Blast", vaa.ChainIDBlast},
 		{"Wormchain", vaa.ChainIDWormchain},
 		{"Sepolia", vaa.ChainIDSepolia},
 		{"Holesky", vaa.ChainIDHolesky},

+ 28 - 0
node/cmd/guardiand/node.go

@@ -176,6 +176,9 @@ var (
 	mantleRPC      *string
 	mantleContract *string
 
+	blastRPC      *string
+	blastContract *string
+
 	sepoliaRPC      *string
 	sepoliaContract *string
 
@@ -363,6 +366,9 @@ func init() {
 	mantleRPC = node.RegisterFlagWithValidationOrFail(NodeCmd, "mantleRPC", "Mantle RPC URL", "ws://eth-devnet:8545", []string{"ws", "wss"})
 	mantleContract = NodeCmd.Flags().String("mantleContract", "", "Mantle contract address")
 
+	blastRPC = node.RegisterFlagWithValidationOrFail(NodeCmd, "blastRPC", "Blast RPC URL", "ws://eth-devnet:8545", []string{"ws", "wss"})
+	blastContract = NodeCmd.Flags().String("blastContract", "", "Blast contract address")
+
 	baseRPC = node.RegisterFlagWithValidationOrFail(NodeCmd, "baseRPC", "Base RPC URL", "ws://eth-devnet:8545", []string{"ws", "wss"})
 	baseContract = NodeCmd.Flags().String("baseContract", "", "Base contract address")
 
@@ -569,6 +575,7 @@ func runNode(cmd *cobra.Command, args []string) {
 		*holeskyContract = unsafeDevModeEvmContractAddress(*holeskyContract)
 		*scrollContract = unsafeDevModeEvmContractAddress(*scrollContract)
 		*mantleContract = unsafeDevModeEvmContractAddress(*mantleContract)
+		*blastContract = unsafeDevModeEvmContractAddress(*blastContract)
 		*arbitrumSepoliaContract = unsafeDevModeEvmContractAddress(*arbitrumSepoliaContract)
 		*baseSepoliaContract = unsafeDevModeEvmContractAddress(*baseSepoliaContract)
 		*optimismSepoliaContract = unsafeDevModeEvmContractAddress(*optimismSepoliaContract)
@@ -747,6 +754,14 @@ func runNode(cmd *cobra.Command, args []string) {
 		logger.Fatal("Both --mantleContract and --mantleRPC must be set together or both unset")
 	}
 
+	if *blastRPC != "" && !*testnetMode && !*unsafeDevMode {
+		logger.Fatal("blast is currently only supported in devnet and testnet")
+	}
+
+	if (*blastRPC == "") != (*blastContract == "") {
+		logger.Fatal("Both --blastContract and --blastRPC must be set together or both unset")
+	}
+
 	if *gatewayWS != "" {
 		if *gatewayLCD == "" || *gatewayContract == "" {
 			logger.Fatal("If --gatewayWS is specified, then --gatewayLCD and --gatewayContract must be specified")
@@ -974,6 +989,7 @@ func runNode(cmd *cobra.Command, args []string) {
 	rpcMap["karuraRPC"] = *karuraRPC
 	rpcMap["klaytnRPC"] = *klaytnRPC
 	rpcMap["mantleRPC"] = *mantleRPC
+	rpcMap["blastRPC"] = *blastRPC
 	rpcMap["moonbeamRPC"] = *moonbeamRPC
 	rpcMap["nearRPC"] = *nearRPC
 	rpcMap["oasisRPC"] = *oasisRPC
@@ -1412,6 +1428,18 @@ func runNode(cmd *cobra.Command, args []string) {
 		watcherConfigs = append(watcherConfigs, wc)
 	}
 
+	if shouldStart(blastRPC) {
+		wc := &evm.WatcherConfig{
+			NetworkID:        "blast",
+			ChainID:          vaa.ChainIDBlast,
+			Rpc:              *blastRPC,
+			Contract:         *blastContract,
+			CcqBackfillCache: *ccqBackfillCache,
+		}
+
+		watcherConfigs = append(watcherConfigs, wc)
+	}
+
 	if shouldStart(terraWS) {
 		wc := &cosmwasm.WatcherConfig{
 			NetworkID: "terra",

+ 1 - 0
node/pkg/query/query.go

@@ -126,6 +126,7 @@ var perChainConfig = map[vaa.ChainID]PerChainConfig{
 	vaa.ChainIDBase:            {NumWorkers: 5, TimestampCacheSupported: true},
 	vaa.ChainIDScroll:          {NumWorkers: 1, TimestampCacheSupported: true},
 	vaa.ChainIDMantle:          {NumWorkers: 1, TimestampCacheSupported: true},
+	vaa.ChainIDBlast:           {NumWorkers: 1, TimestampCacheSupported: true},
 	vaa.ChainIDSepolia:         {NumWorkers: 1, TimestampCacheSupported: true},
 	vaa.ChainIDHolesky:         {NumWorkers: 1, TimestampCacheSupported: true},
 	vaa.ChainIDArbitrumSepolia: {NumWorkers: 1, TimestampCacheSupported: true},

+ 1 - 0
node/pkg/watchers/evm/watcher.go

@@ -713,6 +713,7 @@ func (w *Watcher) getFinality(ctx context.Context) (bool, bool, error) {
 	} else if w.chainID == vaa.ChainIDAcala ||
 		w.chainID == vaa.ChainIDArbitrum ||
 		w.chainID == vaa.ChainIDBase ||
+		w.chainID == vaa.ChainIDBlast ||
 		w.chainID == vaa.ChainIDBSC ||
 		w.chainID == vaa.ChainIDEthereum ||
 		w.chainID == vaa.ChainIDKarura ||

+ 4 - 0
sdk/js/CHANGELOG.md

@@ -1,5 +1,9 @@
 # Changelog
 
+## 0.10.14
+
+Blast Sepolia support
+
 ## 0.10.13
 
 Mantle Sepolia support

+ 1 - 1
sdk/js/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@certusone/wormhole-sdk",
-  "version": "0.10.13",
+  "version": "0.10.14",
   "description": "SDK for interacting with Wormhole",
   "homepage": "https://wormhole.com",
   "main": "./lib/cjs/index.js",

+ 20 - 2
sdk/js/src/utils/consts.ts

@@ -33,6 +33,7 @@ export const CHAINS = {
   rootstock: 33,
   scroll: 34,
   mantle: 35,
+  blast: 36,
   wormchain: 3104,
   cosmoshub: 4000,
   evmos: 4001,
@@ -78,6 +79,7 @@ export const EVMChainNames = [
   "rootstock",
   "scroll",
   "mantle",
+  "blast",
   "sepolia",
   "arbitrum_sepolia",
   "base_sepolia",
@@ -306,6 +308,11 @@ const MAINNET = {
     token_bridge: undefined,
     nft_bridge: undefined,
   },
+  blast: {
+    core: undefined,
+    token_bridge: undefined,
+    nft_bridge: undefined,
+  },
   wormchain: {
     core: "wormhole1ufs3tlq4umljk0qfe8k5ya0x6hpavn897u2cnf9k0en9jr7qarqqaqfk2j",
     token_bridge:
@@ -560,12 +567,17 @@ const TESTNET = {
   scroll: {
     core: "0x055F47F1250012C6B20c436570a76e52c17Af2D5",
     token_bridge: "0x22427d90B7dA3fA4642F7025A854c7254E4e45BF",
-    nft_bridge: "0x47B9a1406BEe29a3001BFEB7e45aE45fFFB40c18",
+    nft_bridge: undefined,
   },
   mantle: {
     core: "0x376428e7f26D5867e69201b275553C45B09EE090",
     token_bridge: "0x75Bfa155a9D7A3714b0861c8a8aF0C4633c45b5D",
-    nft_bridge: "0xD7D732C8Bf5eBF620EA55b5828eae20418eEF083",
+    nft_bridge: undefined,
+  },
+  blast: {
+    core: "0x473e002D7add6fB67a4964F13bFd61280Ca46886",
+    token_bridge: "0x430855B4D43b8AEB9D2B9869B74d58dda79C0dB2",
+    nft_bridge: undefined,
   },
   wormchain: {
     core: "wormhole16jzpxp0e8550c9aht6q9svcux30vtyyyyxv5w2l2djjra46580wsazcjwp",
@@ -821,6 +833,11 @@ const DEVNET = {
     token_bridge: undefined,
     nft_bridge: undefined,
   },
+  blast: {
+    core: undefined,
+    token_bridge: undefined,
+    nft_bridge: undefined,
+  },
   wormchain: {
     core: "wormhole1ghd753shjuwexxywmgs4xz7x2q732vcnkm6h2pyv9s6ah3hylvrqtm7t3h",
     token_bridge:
@@ -971,6 +988,7 @@ export const CHAIN_ID_SEI = CHAINS["sei"];
 export const CHAIN_ID_ROOTSTOCK = CHAINS["rootstock"];
 export const CHAIN_ID_SCROLL = CHAINS["scroll"];
 export const CHAIN_ID_MANTLE = CHAINS["mantle"];
+export const CHAIN_ID_BLAST = CHAINS["blast"];
 export const CHAIN_ID_WORMCHAIN = CHAINS["wormchain"];
 export const CHAIN_ID_GATEWAY = CHAIN_ID_WORMCHAIN;
 export const CHAIN_ID_COSMOSHUB = CHAINS["cosmoshub"];

+ 2 - 3
sdk/testnet_consts.go

@@ -25,7 +25,6 @@ var knownTestnetTokenbridgeEmitters = map[vaa.ChainID]string{
 	vaa.ChainIDKlaytn:          "000000000000000000000000c7a13be098720840dea132d860fdfa030884b09a",
 	vaa.ChainIDCelo:            "00000000000000000000000005ca6037ec51f8b712ed2e6fa72219feae74e153",
 	vaa.ChainIDNear:            "c2c0b6ecbbe9ecf91b2b7999f0264018ba68126c2e83bf413f59f712f3a1df55",
-	vaa.ChainIDMantle:          "00000000000000000000000075Bfa155a9D7A3714b0861c8a8aF0C4633c45b5D",
 	vaa.ChainIDMoonbeam:        "000000000000000000000000bc976d4b9d57e57c3ca52e1fd136c45ff7955a96",
 	vaa.ChainIDArbitrum:        "00000000000000000000000023908A62110e21C04F3A4e011d24F901F911744A",
 	vaa.ChainIDOptimism:        "000000000000000000000000C7A204bDBFe983FCD8d8E61D02b475D4073fF97e",
@@ -35,6 +34,8 @@ var knownTestnetTokenbridgeEmitters = map[vaa.ChainID]string{
 	vaa.ChainIDBase:            "000000000000000000000000A31aa3FDb7aF7Db93d18DDA4e19F811342EDF780",
 	vaa.ChainIDSei:             "9328673cb5de3fd99974cefbbd90fea033f4c59a572abfd7e1a4eebcc5d18157",
 	vaa.ChainIDScroll:          "00000000000000000000000022427d90B7dA3fA4642F7025A854c7254E4e45BF",
+	vaa.ChainIDMantle:          "00000000000000000000000075Bfa155a9D7A3714b0861c8a8aF0C4633c45b5D",
+	vaa.ChainIDBlast:           "000000000000000000000000430855B4D43b8AEB9D2B9869B74d58dda79C0dB2",
 	vaa.ChainIDSepolia:         "000000000000000000000000DB5492265f6038831E89f495670FF909aDe94bd9",
 	vaa.ChainIDHolesky:         "00000000000000000000000076d093BbaE4529a342080546cAFEec4AcbA59EC6",
 	vaa.ChainIDArbitrumSepolia: "000000000000000000000000C7A204bDBFe983FCD8d8E61D02b475D4073fF97e",
@@ -59,12 +60,10 @@ var knownTestnetNFTBridgeEmitters = map[vaa.ChainID]string{
 	vaa.ChainIDAcala:           "00000000000000000000000096f1335e0acab3cfd9899b30b2374e25a2148a6e",
 	vaa.ChainIDKlaytn:          "00000000000000000000000094c994fc51c13101062958b567e743f1a04432de",
 	vaa.ChainIDCelo:            "000000000000000000000000acd8190f647a31e56a656748bc30f69259f245db",
-	vaa.ChainIDMantle:          "000000000000000000000000D7D732C8Bf5eBF620EA55b5828eae20418eEF083",
 	vaa.ChainIDMoonbeam:        "00000000000000000000000098a0f4b96972b32fcb3bd03caeb66a44a6ab9edb",
 	vaa.ChainIDArbitrum:        "000000000000000000000000Ee3dB83916Ccdc3593b734F7F2d16D630F39F1D0",
 	vaa.ChainIDOptimism:        "00000000000000000000000023908A62110e21C04F3A4e011d24F901F911744A",
 	vaa.ChainIDBase:            "000000000000000000000000F681d1cc5F25a3694E348e7975d7564Aa581db59",
-	vaa.ChainIDScroll:          "00000000000000000000000047B9a1406BEe29a3001BFEB7e45aE45fFFB40c18",
 	vaa.ChainIDSepolia:         "0000000000000000000000006a0B52ac198e4870e5F3797d5B403838a5bbFD99",
 	vaa.ChainIDHolesky:         "000000000000000000000000c8941d483c45eF8FB72E4d1F9dDE089C95fF8171",
 	vaa.ChainIDArbitrumSepolia: "00000000000000000000000023908A62110e21C04F3A4e011d24F901F911744A",

+ 7 - 0
sdk/vaa/structs.go

@@ -199,6 +199,8 @@ func (c ChainID) String() string {
 		return "scroll"
 	case ChainIDMantle:
 		return "mantle"
+	case ChainIDBlast:
+		return "blast"
 	case ChainIDCosmoshub:
 		return "cosmoshub"
 	case ChainIDEvmos:
@@ -302,6 +304,8 @@ func ChainIDFromString(s string) (ChainID, error) {
 		return ChainIDScroll, nil
 	case "mantle":
 		return ChainIDMantle, nil
+	case "blast":
+		return ChainIDBlast, nil
 	case "cosmoshub":
 		return ChainIDCosmoshub, nil
 	case "evmos":
@@ -369,6 +373,7 @@ func GetAllNetworkIDs() []ChainID {
 		ChainIDRootstock,
 		ChainIDScroll,
 		ChainIDMantle,
+		ChainIDBlast,
 		ChainIDWormchain,
 		ChainIDCosmoshub,
 		ChainIDEvmos,
@@ -454,6 +459,8 @@ const (
 	ChainIDScroll ChainID = 34
 	// ChainIDMantle is the ChainID of Mantle
 	ChainIDMantle ChainID = 35
+	// ChainIDBlast is the ChainID of Blast
+	ChainIDBlast ChainID = 36
 	//ChainIDWormchain is the ChainID of Wormchain
 	ChainIDWormchain ChainID = 3104
 	// ChainIDCosmoshub is the ChainID of Cosmoshub

+ 9 - 0
sdk/vaa/structs_test.go

@@ -59,6 +59,9 @@ func TestChainIDFromString(t *testing.T) {
 		{input: "base", output: ChainIDBase},
 		{input: "sei", output: ChainIDSei},
 		{input: "rootstock", output: ChainIDRootstock},
+		{input: "scroll", output: ChainIDScroll},
+		{input: "mantle", output: ChainIDMantle},
+		{input: "blast", output: ChainIDBlast},
 		{input: "wormchain", output: ChainIDWormchain},
 		{input: "cosmoshub", output: ChainIDCosmoshub},
 		{input: "evmos", output: ChainIDEvmos},
@@ -105,6 +108,9 @@ func TestChainIDFromString(t *testing.T) {
 		{input: "Base", output: ChainIDBase},
 		{input: "Sei", output: ChainIDSei},
 		{input: "Rootstock", output: ChainIDRootstock},
+		{input: "Scroll", output: ChainIDScroll},
+		{input: "Mantle", output: ChainIDMantle},
+		{input: "Blast", output: ChainIDBlast},
 		{input: "Wormchain", output: ChainIDWormchain},
 		{input: "Cosmoshub", output: ChainIDCosmoshub},
 		{input: "Evmos", output: ChainIDEvmos},
@@ -290,6 +296,9 @@ func TestChainId_String(t *testing.T) {
 		{input: 30, output: "base"},
 		{input: 32, output: "sei"},
 		{input: 33, output: "rootstock"},
+		{input: 34, output: "scroll"},
+		{input: 35, output: "mantle"},
+		{input: 36, output: "blast"},
 		{input: 3104, output: "wormchain"},
 		{input: 4000, output: "cosmoshub"},
 		{input: 4001, output: "evmos"},