Skip to content

Commit

Permalink
Deploy Worldchain testnet (#4140)
Browse files Browse the repository at this point in the history
* Deploy Worldchain testnet

* Update WETH address

* Fix cli test and add token bridge VAAs
  • Loading branch information
bruce-riley authored Oct 21, 2024
1 parent e82db71 commit abd0b33
Show file tree
Hide file tree
Showing 15 changed files with 171 additions and 112 deletions.
2 changes: 1 addition & 1 deletion clients/js/src/cli.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ describe("Info Tests", () => {
return;
}

const expectedOutput = "https://bsc-dataseed.binance.org/";
const expectedOutput = "https://bsc-rpc.publicnode.com";

expect(stdout.trim()).toBe(expectedOutput.trim());
done();
Expand Down
2 changes: 1 addition & 1 deletion clients/js/src/consts/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const Mainnet = {
chain_id: 1,
},
Bsc: {
rpc: "https://bsc-dataseed.binance.org/",
rpc: "https://bsc-rpc.publicnode.com",
key: getEnvVar("ETH_KEY"),
chain_id: 56,
},
Expand Down
2 changes: 2 additions & 0 deletions cspell-custom-words.txt
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,8 @@ vphash
wasmhooks
wasms
WORKDIR
worldchain
WorldChain
wormchain
Wormchain
wormchaind
Expand Down
2 changes: 2 additions & 0 deletions deployments/testnet/tokenBridgeVAAs.csv
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ XLayer (37) Testnet Token Bridge,01000000000100c983babda02e84e346e49f823aa201d65
Linea (38) Testnet Token Bridge,01000000000100411f65a20405ad0d85d6718a91bc16cf645a7eb7dbd29d4b2d0b9cc2d872dc01112cf96dc40c07ddf648325a5dcdba42c70612179126178e7fb9e9bcfef1cb4a01000000010000000100010000000000000000000000000000000000000000000000000000000000000004000000000183785600000000000000000000000000000000000000000000546f6b656e4272696467650100000026000000000000000000000000c7a204bdbfe983fcd8d8e61d02b475d4073ff97e
Berachain (39) Testnet Token Bridge,01000000000100c19d35faa10139fef5b3244f120efb67ad22d2d9ece7d777bcb6e957506ba9f15e2e6fd91a18dcdd6bf434d96d624fd725f957437f2e86dfdcbb6d0e97f3eeb100000000010000000100010000000000000000000000000000000000000000000000000000000000000004000000000404250300000000000000000000000000000000000000000000546f6b656e4272696467650100000027000000000000000000000000a10f2ef61de1f19f586ab8b6f2eba89bace63f7a
Snaxchain (43) Testnet Token Bridge,010000000001008ed60dec76f13f6da695fc5f134c8cf3527f264712e7bb98d2e54a5f457759e0491e3f1cb42eed9b84edc60a96836df98a3752c8a4e10977801e6c35a39f211b000000000100000001000100000000000000000000000000000000000000000000000000000000000000040000000005ba971e00000000000000000000000000000000000000000000546f6b656e427269646765010000002b000000000000000000000000a10f2ef61de1f19f586ab8b6f2eba89bace63f7a
Unichain (44) Testnet Token Bridge,010000000001004f9c7be0694bcabbf1fec2300004b9d82f6a122c459fababcfdc897e894769290c9a9655015909b5c17667d63f8edcec9ad9ee2d05e7cdb24a7a64136a4312c70100000001000000010001000000000000000000000000000000000000000000000000000000000000000400000000008006e100000000000000000000000000000000000000000000546f6b656e427269646765010000002c000000000000000000000000a10f2ef61de1f19f586ab8b6f2eba89bace63f7a
Worldchain (45) Testnet Token Bridge,01000000000100f1ae141e77e67110aecade87c6a5f9b34545638aba1a3a7dbf6a311fe58c99fd351650c8593a8161a03cc7f94b76cdc0a5978fa3e0ffbfb3738085a070172cc5010000000100000001000100000000000000000000000000000000000000000000000000000000000000040000000004f3500a00000000000000000000000000000000000000000000546f6b656e427269646765010000002d000000000000000000000000430855b4d43b8aeb9d2b9869b74d58dda79c0db2
Gateway (3104) Testnet Token Bridge,01000000000100117d1c7a124a9e2e29d82b3803b825be7c8a1dc7f19013669f7d11d42d448aa72339fe3657e4bd156c5c28dd10e78aab3e06e9e76c4bbd38c81e057533d577c40000000000d09296c5000100000000000000000000000000000000000000000000000000000000000000049ea4b9942b23298c20000000000000000000000000000000000000000000546f6b656e4272696467650100000c20ef5251ea1e99ae48732800ccc7b83b57881232a73eb796b63b1d86ed2ea44e27
Sepolia (10002) (Ethereum) Testnet Token Bridge,01000000000100a03841125d40e9df3cd80d027bc660191755587980e49f6a46e9baa1b5c3f6b46e51256c225bd242139ae11d3c84439acdc204a5f39a2e1acb750ae98bb759f1000000000100000001000100000000000000000000000000000000000000000000000000000000000000040000000005491ea100000000000000000000000000000000000000000000546f6b656e4272696467650100002712000000000000000000000000db5492265f6038831e89f495670ff909ade94bd9
Arbitrum Sepolia (10003) Testnet Token Bridge,010000000001001b0fbbcc7a3e8c491dc25f0a611075513032fe444d8e6585153e6ae2cf8c7514152b050e95a3e0af11e5b2705b2efb717bec3cfaa3b1617ff623c14e61a69224000000000100000001000100000000000000000000000000000000000000000000000000000000000000040000000001b8de3c00000000000000000000000000000000000000000000546f6b656e4272696467650100002713000000000000000000000000c7a204bdbfe983fcd8d8e61d02b475d4073ff97e
Expand Down
21 changes: 21 additions & 0 deletions ethereum/env/.env.worldchain.testnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Worldchain testnet env
# Rename to .env

# Common config for forge deployment
RPC_URL=https://worldchain-sepolia.g.alchemy.com/public
# FORGE_ARGS="--legacy"

# Wormhole Core Migrations
INIT_SIGNERS=["0x13947Bd48b18E53fdAeEe77F3473391aC727C638"]
INIT_CHAIN_ID=45
INIT_GOV_CHAIN_ID=0x1
INIT_GOV_CONTRACT=0x0000000000000000000000000000000000000000000000000000000000000004
INIT_EVM_CHAIN_ID=4801

# Bridge Migrations
BRIDGE_INIT_CHAIN_ID=45
BRIDGE_INIT_GOV_CHAIN_ID=0x1
BRIDGE_INIT_GOV_CONTRACT=0x0000000000000000000000000000000000000000000000000000000000000004
BRIDGE_INIT_FINALITY=1
# Worldchain is an OP Stack chain so it has the same WETH address.
BRIDGE_INIT_WETH=0x4200000000000000000000000000000000000006
6 changes: 0 additions & 6 deletions ethereum/sh/registerAllChainsOnTokenBridge.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ do
# Skip this chain. (We don't want to register this chain on itself.)
echo $tag | grep -i ${chain} > /dev/null
if [ $? == 0 ]; then
found_us=1
continue
fi

Expand All @@ -72,11 +71,6 @@ do
count=$(($count+1))
done < "$input_file"

if [ $found_us == 0 ]; then
echo "ERROR: failed to find chain ${chain} in ${input_file}, something is not right!" >&2
exit 1
fi

# Make it look like an array.
vaas="[${vaas}]"
echo $vaas
Expand Down
1 change: 1 addition & 0 deletions node/cmd/guardiand/adminnodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ func runListNodes(cmd *cobra.Command, args []string) {
{"Berachain", vaa.ChainIDBerachain},
{"Snaxchain", vaa.ChainIDSnaxchain},
{"Unichain", vaa.ChainIDUnichain},
{"Worldchain", vaa.ChainIDWorldchain},
{"Wormchain", vaa.ChainIDWormchain},
{"Sepolia", vaa.ChainIDSepolia},
{"Holesky", vaa.ChainIDHolesky},
Expand Down
20 changes: 20 additions & 0 deletions node/cmd/guardiand/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,9 @@ var (
unichainRPC *string
unichainContract *string

worldchainRPC *string
worldchainContract *string

sepoliaRPC *string
sepoliaContract *string

Expand Down Expand Up @@ -403,6 +406,9 @@ func init() {
unichainRPC = node.RegisterFlagWithValidationOrFail(NodeCmd, "unichainRPC", "Unichain RPC URL", "ws://eth-devnet:8545", []string{"ws", "wss"})
unichainContract = NodeCmd.Flags().String("unichainContract", "", "Unichain contract address")

worldchainRPC = node.RegisterFlagWithValidationOrFail(NodeCmd, "worldchainRPC", "Worldchain RPC URL", "ws://eth-devnet:8545", []string{"ws", "wss"})
worldchainContract = NodeCmd.Flags().String("worldchainContract", "", "Worldchain 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")

Expand Down Expand Up @@ -786,6 +792,7 @@ func runNode(cmd *cobra.Command, args []string) {
*berachainContract = checkEvmArgs(logger, *berachainRPC, *berachainContract, "berachain", false)
*snaxchainContract = checkEvmArgs(logger, *snaxchainRPC, *snaxchainContract, "snaxchain", true)
*unichainContract = checkEvmArgs(logger, *unichainRPC, *unichainContract, "unichain", false)
*worldchainContract = checkEvmArgs(logger, *worldchainRPC, *worldchainContract, "worldchain", false)

// These chains will only ever be testnet / devnet.
*sepoliaContract = checkEvmArgs(logger, *sepoliaRPC, *sepoliaContract, "sepolia", false)
Expand Down Expand Up @@ -930,6 +937,7 @@ func runNode(cmd *cobra.Command, args []string) {
rpcMap["terra2WS"] = *terra2WS
rpcMap["terra2LCD"] = *terra2LCD
rpcMap["unichainRPC"] = *unichainRPC
rpcMap["worldchainRPC"] = *worldchainRPC
rpcMap["gatewayWS"] = *gatewayWS
rpcMap["gatewayLCD"] = *gatewayLCD
rpcMap["wormchainURL"] = *wormchainURL
Expand Down Expand Up @@ -1375,6 +1383,18 @@ func runNode(cmd *cobra.Command, args []string) {
watcherConfigs = append(watcherConfigs, wc)
}

if shouldStart(worldchainRPC) {
wc := &evm.WatcherConfig{
NetworkID: "worldchain",
ChainID: vaa.ChainIDWorldchain,
Rpc: *worldchainRPC,
Contract: *worldchainContract,
CcqBackfillCache: *ccqBackfillCache,
}

watcherConfigs = append(watcherConfigs, wc)
}

if shouldStart(terraWS) {
wc := &cosmwasm.WatcherConfig{
NetworkID: "terra",
Expand Down
Loading

0 comments on commit abd0b33

Please sign in to comment.