diff --git a/Tiltfile b/Tiltfile index b65df508da..7d910a829f 100644 --- a/Tiltfile +++ b/Tiltfile @@ -715,7 +715,6 @@ if sui: "sui", port_forwards = [ port_forward(9000, 9000, name = "RPC [:9000]", host = webHost), - port_forward(5003, name = "Faucet [:5003]", host = webHost), port_forward(9184, name = "Prometheus [:9184]", host = webHost), ], labels = ["sui"], diff --git a/clients/js/src/consts/contracts.ts b/clients/js/src/consts/contracts.ts index f98bb0fafb..a0c00c8951 100644 --- a/clients/js/src/consts/contracts.ts +++ b/clients/js/src/consts/contracts.ts @@ -33,9 +33,9 @@ const OVERRIDES = { }, DEVNET: { sui: { - core: "0x6c0b10e14f6d9e817105765811faf144e591e9b286abde60a796775363bac14c", // wormhole module State object ID + core: "0xb49caa756546453e3145574c206a570a43506fbc2c43f0181834555f85dbe57d", // wormhole module State object ID token_bridge: - "0x7e8558339a0605f2ea79bb4dfd20523dc5ae44af3f5c6f891305cf6fe61044bf", // token_bridge module State object ID + "0xad0fd243ad451b773ccff4707842e0eeaa8c51a8071912fe3285247220b3fdd1", // token_bridge module State object ID }, aptos: { token_bridge: diff --git a/devnet/sui-devnet.yaml b/devnet/sui-devnet.yaml index b518104711..6e362bcb38 100644 --- a/devnet/sui-devnet.yaml +++ b/devnet/sui-devnet.yaml @@ -12,9 +12,6 @@ spec: - name: prometheus port: 9184 targetPort: prometheus - - name: faucet - port: 5003 - targetPort: faucet selector: app: sui --- @@ -52,9 +49,6 @@ spec: - containerPort: 9184 name: prometheus protocol: TCP - - containerPort: 5003 - name: faucet - protocol: TCP readinessProbe: tcpSocket: port: 9000 @@ -63,9 +57,10 @@ spec: command: ["/bin/bash", "-c"] args: [ - "cd /tmp && ./scripts/wait_for_devnet.sh && ./scripts/airdrop_devnet.sh && worm sui setup-devnet && touch success && sleep infinity", + "cd /tmp && ./scripts/wait_for_devnet.sh && worm sui setup-devnet && touch success && sleep infinity", ] readinessProbe: + initialDelaySeconds: 30 periodSeconds: 5 failureThreshold: 300 exec: diff --git a/sdk/js/src/token_bridge/__tests__/sui-integration.ts b/sdk/js/src/token_bridge/__tests__/sui-integration.ts index 5874d405a1..8e4bcf643a 100644 --- a/sdk/js/src/token_bridge/__tests__/sui-integration.ts +++ b/sdk/js/src/token_bridge/__tests__/sui-integration.ts @@ -67,7 +67,6 @@ import { Payload, VAA, parse, serialiseVAA } from "../../vaa/generic"; import { ETH_NODE_URL, ETH_PRIVATE_KEY10, - SUI_FAUCET_URL, SUI_NODE_URL, TEST_ERC20, WORMHOLE_RPC_HOSTS, @@ -92,7 +91,6 @@ const suiAddress: string = suiKeypair.getPublicKey().toSuiAddress(); const suiProvider: JsonRpcProvider = new JsonRpcProvider( new Connection({ fullnode: SUI_NODE_URL, - faucet: SUI_FAUCET_URL, }) ); const suiSigner: RawSigner = new RawSigner(suiKeypair, suiProvider); diff --git a/sdk/js/src/token_bridge/__tests__/utils/consts.ts b/sdk/js/src/token_bridge/__tests__/utils/consts.ts index fdddc59193..543258509a 100644 --- a/sdk/js/src/token_bridge/__tests__/utils/consts.ts +++ b/sdk/js/src/token_bridge/__tests__/utils/consts.ts @@ -92,6 +92,3 @@ export const APTOS_PRIVATE_KEY = "537c1f91e56891445b491068f519b705f8c0f1a1e66111816dd5d4aa85b8113d"; export const SUI_NODE_URL = ci ? "http://sui:9000" : "http://localhost:9000"; -export const SUI_FAUCET_URL = ci - ? "http://sui:5003/gas" - : "http://localhost:5003/gas"; diff --git a/sdk/js/src/utils/consts.ts b/sdk/js/src/utils/consts.ts index 95fb108ea1..4dedc70a01 100644 --- a/sdk/js/src/utils/consts.ts +++ b/sdk/js/src/utils/consts.ts @@ -732,9 +732,9 @@ const DEVNET = { "0x46da3d4c569388af61f951bdd1153f4c875f90c2991f6b2d0a38e2161a40852c", }, sui: { - core: "0x6c0b10e14f6d9e817105765811faf144e591e9b286abde60a796775363bac14c", // wormhole module State object ID + core: "0xb49caa756546453e3145574c206a570a43506fbc2c43f0181834555f85dbe57d", // wormhole module State object ID token_bridge: - "0x7e8558339a0605f2ea79bb4dfd20523dc5ae44af3f5c6f891305cf6fe61044bf", // token_bridge module State object ID + "0xad0fd243ad451b773ccff4707842e0eeaa8c51a8071912fe3285247220b3fdd1", // token_bridge module State object ID nft_bridge: undefined, }, moonbeam: { diff --git a/sui/Dockerfile b/sui/Dockerfile index d0ac4bd7b9..016b605916 100644 --- a/sui/Dockerfile +++ b/sui/Dockerfile @@ -2,10 +2,8 @@ FROM cli-gen AS cli-export FROM const-gen AS const-export FROM ghcr.io/wormhole-foundation/sui:1.19.1-mainnet@sha256:544a1b2aa5701fae25a19aed3c5e8c24e0caf7d1c9f511b6844d339a8f0b2a00 as sui -RUN sui genesis -f - -# COPY sui/devnet/client.yaml /root/.sui/sui_config/ -# COPY sui/devnet/sui.keystore /root/.sui/sui_config/ +COPY sui/devnet/genesis_config genesis_config +RUN sui genesis -f --from-config genesis_config WORKDIR /tmp diff --git a/sui/README.md b/sui/README.md index 09f3a4c46a..729a8c406c 100644 --- a/sui/README.md +++ b/sui/README.md @@ -24,14 +24,13 @@ Make sure your Cargo version is at least 1.65.0 and then follow the steps below: Install the `Sui` CLI. This tool is used to compile the contracts and run the tests. ```sh -cargo install --locked --git https://github.com/MystenLabs/sui.git --rev 041c5f2bae2fe52079e44b70514333532d69f4e6 sui sui-faucet +cargo install --locked --git https://github.com/MystenLabs/sui.git --rev 041c5f2bae2fe52079e44b70514333532d69f4e6 sui ``` Some useful Sui CLI commands are - `sui start` to spin up a local network - `rpc-server` to start a server for handling rpc calls -- `sui-faucet` to start a faucet for requesting funds from active-address Next, install the [worm](../clients/js/README.md) CLI tool by running @@ -93,13 +92,7 @@ Simply run worm start-validator sui ``` -which will start a local sui validator with an RPC endpoint at `0.0.0.0:9000` -and the faucet endpoint at `0.0.0.0:5003/gas`. Note that the faucet takes a few -(~10) seconds to come up, so only proceed when you see the following: - -```text -Faucet is running. Faucet endpoint: 0.0.0.0:5003/gas -``` +which will start a local sui validator with an RPC endpoint at `0.0.0.0:9000`. Once the validator is running, the contracts are ready to deploy. In the [scripts](./scripts) directory, run diff --git a/sui/devnet/genesis_config b/sui/devnet/genesis_config new file mode 100644 index 0000000000..aeb16458fa --- /dev/null +++ b/sui/devnet/genesis_config @@ -0,0 +1,55 @@ +--- +ssfn_config_info: ~ +validator_config_info: ~ +parameters: + chain_start_timestamp_ms: 1709486339140 + protocol_version: 36 + allow_insertion_of_extra_objects: true + epoch_duration_ms: 86400000 + stake_subsidy_start_epoch: 0 + stake_subsidy_initial_distribution_amount: 1000000000000000 + stake_subsidy_period_length: 10 + stake_subsidy_decrease_rate: 1000 +accounts: + - address: "0x2e425dd30f43ff1d59547322839cfc4b8fbaae54d72075181ebd7388b644fdbe" + gas_amounts: + - 30000000000000000 + - 30000000000000000 + - 30000000000000000 + - 30000000000000000 + - 30000000000000000 + - address: "0x8a8bb058d6c86aa175566c9e2d19278dd22ed9fecdda8fb486018f93a0629bb5" + gas_amounts: + - 30000000000000000 + - 30000000000000000 + - 30000000000000000 + - 30000000000000000 + - 30000000000000000 + - address: "0xa0f33ce147ecae789f535c64634851724284dd618a529672702b991a5f7bf816" + gas_amounts: + - 30000000000000000 + - 30000000000000000 + - 30000000000000000 + - 30000000000000000 + - 30000000000000000 + - address: "0xbd00a48078c0513a5f9a0d1c9352cd5c23a0e0cf3e6a82673cdae857cd00021e" + gas_amounts: + - 30000000000000000 + - 30000000000000000 + - 30000000000000000 + - 30000000000000000 + - 30000000000000000 + - address: "0xfd5f84cf9285f2b206e03727224b9daffa6092661b840d92434751792010b7de" + gas_amounts: + - 30000000000000000 + - 30000000000000000 + - 30000000000000000 + - 30000000000000000 + - 30000000000000000 + - address: "0xed867315e3f7c83ae82e6d5858b6a6cc57c291fd84f7509646ebc8162169cf96" + gas_amounts: + - 30000000000000000 + - 30000000000000000 + - 30000000000000000 + - 30000000000000000 + - 30000000000000000 diff --git a/sui/scripts/airdrop_devnet.sh b/sui/scripts/airdrop_devnet.sh deleted file mode 100755 index 047646fdb0..0000000000 --- a/sui/scripts/airdrop_devnet.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash - -set -euo pipefail - -# This is the address corresponding to the private key in the networks.ts file of the worm cli (for the sui devnet wallet) -# The faucet doesn't allow us to specify how many tokens we need, so we just run the command 20 times. -for i in {1..20} -do - sui client faucet --url http://localhost:5003/gas --address 0xed867315e3f7c83ae82e6d5858b6a6cc57c291fd84f7509646ebc8162169cf96 -done - -sleep 10 diff --git a/sui/scripts/start_node.sh b/sui/scripts/start_node.sh index 8db6bcf5cc..2ffce35438 100755 --- a/sui/scripts/start_node.sh +++ b/sui/scripts/start_node.sh @@ -2,6 +2,4 @@ set -x -sui start >/dev/null 2>&1 & -sleep 5 -sui-faucet --write-ahead-log faucet.log +sui start 2>&1 diff --git a/sui/scripts/wait_for_devnet.sh b/sui/scripts/wait_for_devnet.sh index 59f767d55e..ff0b00355e 100755 --- a/sui/scripts/wait_for_devnet.sh +++ b/sui/scripts/wait_for_devnet.sh @@ -4,6 +4,3 @@ set -e # Wait for sui to start while [[ "$(curl -X POST -H "Content-Type: application/json" -d '{ "jsonrpc":"2.0", "method":"rpc.discover","id":1 }' -s -o /dev/null -w '%{http_code}' 0.0.0.0:9000/)" != "200" ]]; do sleep 1; done - -# Wait for sui-faucet to start -while [[ "$(curl -s -o /dev/null -w '%{http_code}' 0.0.0.0:5003/)" != "200" ]]; do sleep 1; done