Przeglądaj źródła

deploy_mezo_testnet (#4300)

bruce-riley 8 miesięcy temu
rodzic
commit
df918bb527

+ 2 - 0
cspell-custom-words.txt

@@ -106,6 +106,8 @@ localterra
 lockfiles
 merkle
 Metaplex
+mezo
+Mezo
 mindshare
 mlock
 moby

+ 1 - 0
deployments/testnet/tokenBridgeVAAs.csv

@@ -37,6 +37,7 @@ Worldchain (45) Testnet Token Bridge,01000000000100f1ae141e77e67110aecade87c6a5f
 HyperEVM (47) Testnet Token Bridge,010000000001003f9a225a8b004c871374f69c29e8a3335614270886719a9ce30b1e5afb1df04d144208fb42b74fbfb140977a13e4fb4fa6107e625745ede6d6ddca0e4eafcb3c01000000010000000100010000000000000000000000000000000000000000000000000000000000000004000000000456642800000000000000000000000000000000000000000000546f6b656e427269646765010000002f0000000000000000000000004a8bc80ed5a4067f1ccf107057b8270e0cc11a78
 Monad (48) Testnet Token Bridge,01000000000100f55193326b0cf4dc1fe356b47a9842ff751c033e0b002b1d572ccbf8b1cb45b6770d4ce7f415fb29b4d87f75fec9e5dd15df56fc20ba401a4f07e5956394225501000000010000000100010000000000000000000000000000000000000000000000000000000000000004000000000521e4d200000000000000000000000000000000000000000000546f6b656e4272696467650100000030000000000000000000000000f323dcde4d33efe83cf455f78f9f6cc656e6b659
 Movement (49) Testnet Token Bridge,010000000001006e366ef014166b9618721b6e7c37d6a0dab510a6526061c219f88d46f39ada887a870c4aeff812795a4a78d0334567af817c54c1bfe197f0b92c357f4e49a311000000000100000001000100000000000000000000000000000000000000000000000000000000000000040000000003d9804a00000000000000000000000000000000000000000000546f6b656e42726964676501000000310000000000000000000000000000000000000000000000000000000000000002
+Mezo (50) Testnet Token Bridge,0100000000010096e4e4db3e803f3fb71f1376984522e95b189a50c4705378752e547238c4be815a13aacc0a9c0b0c8be74826497080024c17bf834543b581b55418d71242651f0000000001000000010001000000000000000000000000000000000000000000000000000000000000000400000000005a3fb500000000000000000000000000000000000000000000546f6b656e4272696467650100000032000000000000000000000000a31aa3fdb7af7db93d18dda4e19f811342edf780
 Gateway (3104) Testnet Token Bridge,01000000000100117d1c7a124a9e2e29d82b3803b825be7c8a1dc7f19013669f7d11d42d448aa72339fe3657e4bd156c5c28dd10e78aab3e06e9e76c4bbd38c81e057533d577c40000000000d09296c5000100000000000000000000000000000000000000000000000000000000000000049ea4b9942b23298c20000000000000000000000000000000000000000000546f6b656e4272696467650100000c20ef5251ea1e99ae48732800ccc7b83b57881232a73eb796b63b1d86ed2ea44e27
 Sepolia (10002) (Ethereum) Testnet Token Bridge,01000000000100a03841125d40e9df3cd80d027bc660191755587980e49f6a46e9baa1b5c3f6b46e51256c225bd242139ae11d3c84439acdc204a5f39a2e1acb750ae98bb759f1000000000100000001000100000000000000000000000000000000000000000000000000000000000000040000000005491ea100000000000000000000000000000000000000000000546f6b656e4272696467650100002712000000000000000000000000db5492265f6038831e89f495670ff909ade94bd9
 Arbitrum Sepolia (10003) Testnet Token Bridge,010000000001001b0fbbcc7a3e8c491dc25f0a611075513032fe444d8e6585153e6ae2cf8c7514152b050e95a3e0af11e5b2705b2efb717bec3cfaa3b1617ff623c14e61a69224000000000100000001000100000000000000000000000000000000000000000000000000000000000000040000000001b8de3c00000000000000000000000000000000000000000000546f6b656e4272696467650100002713000000000000000000000000c7a204bdbfe983fcd8d8e61d02b475d4073ff97e

+ 21 - 0
ethereum/env/.env.mezo.testnet

@@ -0,0 +1,21 @@
+# Mezo matsnet testnet env
+# Rename to .env
+
+# Common config for forge deployment
+RPC_URL="https://rpc.test.mezo.org"
+FORGE_ARGS="--slow"
+
+# Wormhole Core Migrations
+INIT_SIGNERS=["0x13947Bd48b18E53fdAeEe77F3473391aC727C638"]
+INIT_CHAIN_ID=50
+INIT_GOV_CHAIN_ID=0x1
+INIT_GOV_CONTRACT=0x0000000000000000000000000000000000000000000000000000000000000004
+INIT_EVM_CHAIN_ID=31611
+
+# Bridge Migrations
+BRIDGE_INIT_CHAIN_ID=50
+BRIDGE_INIT_GOV_CHAIN_ID=0x1
+BRIDGE_INIT_GOV_CONTRACT=0x0000000000000000000000000000000000000000000000000000000000000004
+# Leaving WETH unset for now.
+BRIDGE_INIT_WETH=0x0000000000000000000000000000000000000000
+BRIDGE_INIT_FINALITY=1

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

@@ -133,6 +133,7 @@ func runListNodes(cmd *cobra.Command, args []string) {
 		{"Monad", vaa.ChainIDMonad},
 		{"Movement", vaa.ChainIDMovement},
 		{"Wormchain", vaa.ChainIDWormchain},
+		{"Mezo", vaa.ChainIDMezo},
 		// The IBC chains (4000 range) are not included here.
 		{"Sepolia", vaa.ChainIDSepolia},
 		{"ArbitrumSepolia", vaa.ChainIDArbitrumSepolia},

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

@@ -213,6 +213,9 @@ var (
 	seiEvmRPC      *string
 	seiEvmContract *string
 
+	mezoRPC      *string
+	mezoContract *string
+
 	sepoliaRPC      *string
 	sepoliaContract *string
 
@@ -450,6 +453,9 @@ func init() {
 	seiEvmRPC = node.RegisterFlagWithValidationOrFail(NodeCmd, "seiEvmRPC", "SeiEVM RPC URL", "ws://eth-devnet:8545", []string{"ws", "wss"})
 	seiEvmContract = NodeCmd.Flags().String("seiEvmContract", "", "SeiEVM contract address")
 
+	mezoRPC = node.RegisterFlagWithValidationOrFail(NodeCmd, "mezoRPC", "Mezo RPC URL", "ws://eth-devnet:8545", []string{"ws", "wss"})
+	mezoContract = NodeCmd.Flags().String("mezoContract", "", "Mezo contract address")
+
 	arbitrumSepoliaRPC = node.RegisterFlagWithValidationOrFail(NodeCmd, "arbitrumSepoliaRPC", "Arbitrum on Sepolia RPC URL", "ws://eth-devnet:8545", []string{"ws", "wss"})
 	arbitrumSepoliaContract = NodeCmd.Flags().String("arbitrumSepoliaContract", "", "Arbitrum on Sepolia contract address")
 
@@ -845,6 +851,7 @@ func runNode(cmd *cobra.Command, args []string) {
 	*hyperEvmContract = checkEvmArgs(logger, *hyperEvmRPC, *hyperEvmContract, vaa.ChainIDHyperEVM)
 	*monadContract = checkEvmArgs(logger, *monadRPC, *monadContract, vaa.ChainIDMonad)
 	*seiEvmContract = checkEvmArgs(logger, *seiEvmRPC, *seiEvmContract, vaa.ChainIDSeiEVM)
+	*mezoContract = checkEvmArgs(logger, *mezoRPC, *mezoContract, vaa.ChainIDMezo)
 
 	// These chains will only ever be testnet / devnet.
 	*sepoliaContract = checkEvmArgs(logger, *sepoliaRPC, *sepoliaContract, vaa.ChainIDSepolia)
@@ -1009,6 +1016,7 @@ func runNode(cmd *cobra.Command, args []string) {
 	rpcMap["hyperEvmRPC"] = *hyperEvmRPC
 	rpcMap["monadRPC"] = *monadRPC
 	rpcMap["movementRPC"] = *movementRPC
+	rpcMap["mezoRPC"] = *mezoRPC
 
 	// Wormchain is in the 3000 range.
 	rpcMap["wormchainURL"] = *wormchainURL
@@ -1526,6 +1534,18 @@ func runNode(cmd *cobra.Command, args []string) {
 		watcherConfigs = append(watcherConfigs, wc)
 	}
 
+	if shouldStart(mezoRPC) {
+		wc := &evm.WatcherConfig{
+			NetworkID:        "mezo",
+			ChainID:          vaa.ChainIDMezo,
+			Rpc:              *mezoRPC,
+			Contract:         *mezoContract,
+			CcqBackfillCache: *ccqBackfillCache,
+		}
+
+		watcherConfigs = append(watcherConfigs, wc)
+	}
+
 	if shouldStart(terraWS) {
 		wc := &cosmwasm.WatcherConfig{
 			NetworkID: "terra",

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

@@ -143,6 +143,7 @@ var perChainConfig = map[vaa.ChainID]PerChainConfig{
 	vaa.ChainIDHyperEVM:        {NumWorkers: 1, TimestampCacheSupported: true},
 	vaa.ChainIDMonad:           {NumWorkers: 1, TimestampCacheSupported: true},
 	vaa.ChainIDSeiEVM:          {NumWorkers: 1, TimestampCacheSupported: true},
+	vaa.ChainIDMezo:            {NumWorkers: 1, TimestampCacheSupported: true},
 }
 
 // GetPerChainConfig returns the config for the specified chain. If the chain is not configured it returns an empty struct,

+ 2 - 0
node/pkg/watchers/evm/chain_config.go

@@ -99,6 +99,7 @@ var (
 		vaa.ChainIDInk:        {Finalized: true, Safe: true, EvmChainID: 57073, PublicRPC: "https://rpc-qnd.inkonchain.com"},
 		// vaa.ChainIDHyperEVM:   Not in Mainnet yet.
 		// vaa.ChainIDMonad:      Not in Mainnet yet.
+		// vaa.ChainIDMezo:       Not in Mainnet yet.
 	}
 
 	// testnetChainConfig specifies the configuration for all chains enabled in Testnet.
@@ -149,6 +150,7 @@ var (
 		vaa.ChainIDInk:             {Finalized: true, Safe: true, EvmChainID: 763373, PublicRPC: "https://rpc-qnd-sepolia.inkonchain.com"},
 		vaa.ChainIDHyperEVM:        {Finalized: true, Safe: true, EvmChainID: 998, PublicRPC: "https://rpc.hyperliquid-testnet.xyz/evm"},
 		vaa.ChainIDMonad:           {Finalized: true, Safe: true, EvmChainID: 10143, PublicRPC: "https://testnet-rpc.monad.xyz"},
+		vaa.ChainIDMezo:            {Finalized: true, Safe: true, EvmChainID: 31611, PublicRPC: "https://rpc.test.mezo.org"},
 		vaa.ChainIDSepolia:         {Finalized: true, Safe: true, EvmChainID: 11155111, PublicRPC: "https://ethereum-sepolia-rpc.publicnode.com"},
 		vaa.ChainIDArbitrumSepolia: {Finalized: true, Safe: true, EvmChainID: 421614, PublicRPC: "https://arbitrum-sepolia-rpc.publicnode.com"},
 		vaa.ChainIDBaseSepolia:     {Finalized: true, Safe: true, EvmChainID: 84532, PublicRPC: "https://base-sepolia-rpc.publicnode.com"},

+ 0 - 103
node/pkg/watchers/evm/chain_config_test.go

@@ -1,7 +1,6 @@
 package evm
 
 import (
-	"fmt"
 	"testing"
 
 	"github.com/certusone/wormhole/node/pkg/common"
@@ -83,105 +82,3 @@ func TestGetFinality(t *testing.T) {
 		})
 	}
 }
-
-// TODO: Once this code is merged and verified to be stable, this test can be deleted.
-func TestFinalityValuesForMainnet(t *testing.T) {
-	testFinalityValuesForEnvironment(t, common.MainNet)
-}
-
-// TODO: Once this code is merged and verified to be stable, this test can be deleted.
-func TestFinalityValuesForTestnet(t *testing.T) {
-	testFinalityValuesForEnvironment(t, common.TestNet)
-}
-
-// TODO: Once this code is merged and verified to be stable, this function can be deleted.
-func testFinalityValuesForEnvironment(t *testing.T, env common.Environment) {
-	t.Helper()
-	m, err := GetChainConfigMap(env)
-	require.NoError(t, err)
-
-	for chainID, entry := range m {
-		t.Run(chainID.String(), func(t *testing.T) {
-			instantFinality, finalized, safe, err := getFinalityForTest(env, chainID)
-			require.NoError(t, err)
-			require.Equal(t, instantFinality, entry.InstantFinality)
-			// For instant finality, the values for finalized and safe are for documentation only, so we can't audit them.
-			if !instantFinality {
-				assert.Equal(t, finalized, entry.Finalized)
-				assert.Equal(t, safe, entry.Safe)
-			}
-		})
-	}
-}
-
-// getFinalityForTest was lifted from the old `getFinality` watcher function so we could validate our config data.
-// TODO: Once this code is merged and verified to be stable, this function can be deleted so we don't have to maintain it.
-func getFinalityForTest(env common.Environment, chainID vaa.ChainID) (instantFinality bool, finalized bool, safe bool, err error) {
-	// Tilt supports polling for both finalized and safe.
-	if env == common.UnsafeDevNet {
-		finalized = true
-		safe = true
-
-		// The following chains support polling for both finalized and safe.
-	} else if chainID == vaa.ChainIDAcala ||
-		chainID == vaa.ChainIDArbitrum ||
-		chainID == vaa.ChainIDArbitrumSepolia ||
-		chainID == vaa.ChainIDBase ||
-		chainID == vaa.ChainIDBaseSepolia ||
-		chainID == vaa.ChainIDBerachain || // Berachain really isn't instant finality, despite what this doc says: https://docs.berachain.com/faq/
-		chainID == vaa.ChainIDBlast ||
-		chainID == vaa.ChainIDBSC ||
-		chainID == vaa.ChainIDEthereum ||
-		chainID == vaa.ChainIDHolesky ||
-		chainID == vaa.ChainIDHyperEVM ||
-		chainID == vaa.ChainIDInk ||
-		chainID == vaa.ChainIDKarura ||
-		chainID == vaa.ChainIDMantle ||
-		chainID == vaa.ChainIDMonad ||
-		chainID == vaa.ChainIDMoonbeam ||
-		chainID == vaa.ChainIDOptimism ||
-		chainID == vaa.ChainIDOptimismSepolia ||
-		chainID == vaa.ChainIDSeiEVM ||
-		chainID == vaa.ChainIDSepolia ||
-		chainID == vaa.ChainIDSnaxchain ||
-		chainID == vaa.ChainIDUnichain ||
-		chainID == vaa.ChainIDWorldchain ||
-		chainID == vaa.ChainIDXLayer {
-		finalized = true
-		safe = true
-
-	} else if chainID == vaa.ChainIDCelo {
-		// TODO: Celo testnet now supports finalized and safe. As of January 2025, mainnet doesn't yet support safe. Once Celo mainnet cuts over, Celo can
-		// be added to the list above. That change won't be super urgent since we'll just continue to publish safe as finalized, which is not a huge deal.
-		finalized = true
-		safe = env != common.MainNet
-
-		// 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
-	} else if chainID == vaa.ChainIDPolygon ||
-		chainID == vaa.ChainIDPolygonSepolia {
-		finalized = true
-
-		// As of 11/10/2023 Scroll supports polling for finalized but not safe.
-	} else if chainID == vaa.ChainIDScroll {
-		finalized = true
-
-		// As of 9/06/2024 Linea supports polling for finalized but not safe.
-	} else if chainID == vaa.ChainIDLinea {
-		finalized = true
-
-		// The following chains support instant finality.
-	} else if chainID == vaa.ChainIDAvalanche ||
-		chainID == vaa.ChainIDOasis ||
-		chainID == vaa.ChainIDAurora ||
-		chainID == vaa.ChainIDFantom ||
-		chainID == vaa.ChainIDKlaytn {
-		return true, false, false, nil
-
-		// Anything else is undefined / not supported.
-	} else {
-		return false, false, false, fmt.Errorf("unsupported chain: %s", chainID.String())
-	}
-
-	return
-}

+ 1 - 0
sdk/testnet_consts.go

@@ -47,6 +47,7 @@ var knownTestnetTokenbridgeEmitters = map[vaa.ChainID]string{
 	vaa.ChainIDInk:             "000000000000000000000000376428e7f26D5867e69201b275553C45B09EE090",
 	vaa.ChainIDHyperEVM:        "0000000000000000000000004a8bc80Ed5a4067f1CCf107057b8270E0cC11A78",
 	vaa.ChainIDMonad:           "000000000000000000000000F323dcDe4d33efe83cf455F78F9F6cc656e6B659",
+	vaa.ChainIDMezo:            "000000000000000000000000A31aa3FDb7aF7Db93d18DDA4e19F811342EDF780",
 	vaa.ChainIDSepolia:         "000000000000000000000000DB5492265f6038831E89f495670FF909aDe94bd9",
 	vaa.ChainIDHolesky:         "00000000000000000000000076d093BbaE4529a342080546cAFEec4AcbA59EC6",
 	vaa.ChainIDArbitrumSepolia: "000000000000000000000000C7A204bDBFe983FCD8d8E61D02b475D4073fF97e",

+ 7 - 0
sdk/vaa/structs.go

@@ -227,6 +227,8 @@ func (c ChainID) String() string {
 		return "monad"
 	case ChainIDMovement:
 		return "movement"
+	case ChainIDMezo:
+		return "mezo"
 	case ChainIDWormchain:
 		return "wormchain"
 	case ChainIDCosmoshub:
@@ -364,6 +366,8 @@ func ChainIDFromString(s string) (ChainID, error) {
 		return ChainIDMonad, nil
 	case "movement":
 		return ChainIDMovement, nil
+	case "mezo":
+		return ChainIDMezo, nil
 	case "wormchain":
 		return ChainIDWormchain, nil
 	case "cosmoshub":
@@ -452,6 +456,7 @@ func GetAllNetworkIDs() []ChainID {
 		ChainIDHyperEVM,
 		ChainIDMonad,
 		ChainIDMovement,
+		ChainIDMezo,
 		ChainIDWormchain,
 		ChainIDCosmoshub,
 		ChainIDEvmos,
@@ -571,6 +576,8 @@ const (
 	ChainIDMonad ChainID = 48
 	// ChainIDMovement is the ChainID of Movement
 	ChainIDMovement ChainID = 49
+	// ChainIDMezo is the ChainID of Mezo
+	ChainIDMezo ChainID = 50
 	//ChainIDWormchain is the ChainID of Wormchain
 
 	// Wormchain is in it's own range.

+ 2 - 0
sdk/vaa/structs_test.go

@@ -76,6 +76,7 @@ func TestChainIDFromString(t *testing.T) {
 		{input: "hyperevm", output: ChainIDHyperEVM},
 		{input: "monad", output: ChainIDMonad},
 		{input: "movement", output: ChainIDMovement},
+		{input: "mezo", output: ChainIDMezo},
 		{input: "wormchain", output: ChainIDWormchain},
 		{input: "cosmoshub", output: ChainIDCosmoshub},
 		{input: "evmos", output: ChainIDEvmos},
@@ -141,6 +142,7 @@ func TestChainIDFromString(t *testing.T) {
 		{input: "HyperEVM", output: ChainIDHyperEVM},
 		{input: "Monad", output: ChainIDMonad},
 		{input: "Movement", output: ChainIDMovement},
+		{input: "Mezo", output: ChainIDMezo},
 		{input: "Wormchain", output: ChainIDWormchain},
 		{input: "Cosmoshub", output: ChainIDCosmoshub},
 		{input: "Evmos", output: ChainIDEvmos},