Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade sui packages and compiler to 1.19.1-mainnet #3803

Merged
merged 7 commits into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def build_node_yaml():
"--suiRPC",
"http://sui:9000",
"--suiMoveEventType",
"0x7f6cebb8a489654d7a759483bd653c4be3e5ccfef17a8b5fd3ba98bd072fabc3::publish_message::WormholeMessage",
"0x320a40bff834b5ffa12d7f5cc2220dd733dd9e8e91c425800203d06fb2b1fee8::publish_message::WormholeMessage",
"--suiWS",
"ws://sui:9000",
]
Expand Down Expand Up @@ -732,7 +732,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"],
Expand Down
4 changes: 2 additions & 2 deletions clients/js/src/consts/contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ const OVERRIDES = {
},
DEVNET: {
sui: {
core: "0x5a5160ca3c2037f4b4051344096ef7a48ebf4400b3f385e57ea90e1628a8bde0", // wormhole module State object ID
core: "0x12253210c90f89e7a8525e6c52d41309ff5bfb31f43f561b5fe6f50cd72f9668", // wormhole module State object ID
token_bridge:
"0xa6a3da85bbe05da5bfd953708d56f1a3a023e7fb58e5a824a3d4de3791e8f690", // token_bridge module State object ID
"0x830ed228c6f1bcb40003bb49af3277df2cbf933d63a6bcdcb0ba4580a1a7654e", // token_bridge module State object ID
},
aptos: {
token_bridge:
Expand Down
7 changes: 1 addition & 6 deletions devnet/sui-devnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ spec:
- name: prometheus
port: 9184
targetPort: prometheus
- name: faucet
port: 5003
targetPort: faucet
selector:
app: sui
---
Expand Down Expand Up @@ -52,9 +49,6 @@ spec:
- containerPort: 9184
name: prometheus
protocol: TCP
- containerPort: 5003
name: faucet
protocol: TCP
readinessProbe:
tcpSocket:
port: 9000
Expand All @@ -66,6 +60,7 @@ spec:
"cd /tmp && ./scripts/wait_for_devnet.sh && worm sui setup-devnet && touch success && sleep infinity",
]
readinessProbe:
initialDelaySeconds: 30
periodSeconds: 5
failureThreshold: 300
exec:
Expand Down
2 changes: 1 addition & 1 deletion scripts/devnet-consts.json
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@
},
"21": {
"contracts": {
"tokenBridgeEmitterAddress": "be8d2e6809d4873bcf1d8be6af2b92500091ad6aa5dc76bc717af86a58d300ca"
"tokenBridgeEmitterAddress": "8c6ba6a65f1b9c7fba4c5ad710086ace208e9ac21786a923425efc8167a419f0"
}
},
"22": {
Expand Down
2 changes: 1 addition & 1 deletion sdk/devnet_consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ var knownDevnetTokenbridgeEmitters = map[vaa.ChainID]string{
vaa.ChainIDBSC: "0000000000000000000000000290fb167208af455bb137780163b7b7a9a10c16",
vaa.ChainIDAlgorand: "8ec299cb7f3efec28f542397e07f07118d74c875f85409ed8e6b93c17b60e992",
vaa.ChainIDWormchain: "c9138c6e5bd7a2ab79c1a87486c9d7349d064b35ac9f7498f3b207b3a61e6013",
vaa.ChainIDSui: "be8d2e6809d4873bcf1d8be6af2b92500091ad6aa5dc76bc717af86a58d300ca",
vaa.ChainIDSui: "8c6ba6a65f1b9c7fba4c5ad710086ace208e9ac21786a923425efc8167a419f0",
}

// KnownDevnetNFTBridgeEmitters is a map of known NFT emitters used during development.
Expand Down
2 changes: 0 additions & 2 deletions sdk/js/src/token_bridge/__tests__/sui-integration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,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,
Expand All @@ -79,7 +78,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);
Expand Down
3 changes: 0 additions & 3 deletions sdk/js/src/token_bridge/__tests__/utils/consts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,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";
4 changes: 2 additions & 2 deletions sdk/js/src/utils/consts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -757,9 +757,9 @@ const DEVNET = {
"0x46da3d4c569388af61f951bdd1153f4c875f90c2991f6b2d0a38e2161a40852c",
},
sui: {
core: "0x5a5160ca3c2037f4b4051344096ef7a48ebf4400b3f385e57ea90e1628a8bde0", // wormhole module State object ID
core: "0x12253210c90f89e7a8525e6c52d41309ff5bfb31f43f561b5fe6f50cd72f9668", // wormhole module State object ID
token_bridge:
"0xa6a3da85bbe05da5bfd953708d56f1a3a023e7fb58e5a824a3d4de3791e8f690", // token_bridge module State object ID
"0x830ed228c6f1bcb40003bb49af3277df2cbf933d63a6bcdcb0ba4580a1a7654e", // token_bridge module State object ID
nft_bridge: undefined,
},
moonbeam: {
Expand Down
4 changes: 2 additions & 2 deletions sui/Docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ cd ..; DOCKER_BUILDKIT=1 docker build --no-cache --progress plain -f sui/Dockerf

# tag the image with the appropriate version

docker tag sui:latest ghcr.io/wormhole-foundation/sui:1.0.0-testnet_1
docker tag sui:latest ghcr.io/wormhole-foundation/sui:1.19.1-mainnet

# push to ghcr

docker push ghcr.io/wormhole-foundation/sui:1.0.0-testnet_1
docker push ghcr.io/wormhole-foundation/sui:1.19.1-mainnet

echo remember to update both Dockerfile and Dockerfile.export
7 changes: 5 additions & 2 deletions sui/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
FROM cli-gen AS cli-export
FROM const-gen AS const-export
FROM ghcr.io/wormhole-foundation/sui:1.0.0-testnet_1@sha256:806fc83e7bbd59bca0a1960870d27b041d0b99a286d7eccfcec25beb74c2346c as sui
FROM ghcr.io/wormhole-foundation/sui:1.19.1-mainnet@sha256:544a1b2aa5701fae25a19aed3c5e8c24e0caf7d1c9f511b6844d339a8f0b2a00 as sui

RUN sui genesis -f
# initial run
# COPY sui/devnet/genesis_config genesis_config
# RUN sui genesis -f --from-config genesis_config

# subsequent runs after committing files from /root/.sui/sui_config/
COPY sui/devnet/ /root/.sui/sui_config/

WORKDIR /tmp
Expand Down
35 changes: 16 additions & 19 deletions sui/Dockerfile.base
Original file line number Diff line number Diff line change
@@ -1,27 +1,24 @@
FROM docker.io/redhat/ubi8@sha256:56c374376a42da40f3aec753c4eab029b5ea162d70cb5f0cda24758780c31d81 as sui-node

# RUN apt-get update && apt-get -y install libclang-dev jq cmake curl npm --no-install-recommends
RUN dnf -y update
RUN dnf -y install jq cmake curl npm git gcc openssl-devel gcc-c++ clang make git

COPY sui/scripts/setup_rust.sh /tmp
RUN /tmp/setup_rust.sh
FROM rust:1.62@sha256:5777f201f507075309c4d2d1c1e8d8219e654ae1de154c844341050016a64a0c as sui-node

WORKDIR /tmp

COPY sui/scripts/node_builder.sh /tmp
RUN curl -L https://github.com/MystenLabs/sui/releases/download/mainnet-v1.19.1/sui-mainnet-v1.19.1-ubuntu-x86_64.tgz > sui-mainnet-v1.19.1-ubuntu-x86_64.tgz
RUN echo "6a8cc96759760293143a00fe7031a5fea70d2dff5b98d18c0470c09555da63e0 sui-mainnet-v1.19.1-ubuntu-x86_64.tgz" | sha256sum -c --status

RUN /tmp/node_builder.sh
RUN tar -xvf sui-mainnet-v1.19.1-ubuntu-x86_64.tgz
RUN mv target/release/sui-ubuntu-x86_64 /bin/sui
RUN mv target/release/sui-faucet-ubuntu-x86_64 /bin/sui-faucet
RUN mv target/release/sui-node-ubuntu-x86_64 /bin/sui-node

FROM docker.io/redhat/ubi8@sha256:56c374376a42da40f3aec753c4eab029b5ea162d70cb5f0cda24758780c31d81 as export-stage
RUN rm sui-mainnet-v1.19.1-ubuntu-x86_64.tgz

RUN dnf -y update
RUN dnf -y install jq curl git make
RUN apt-get update
RUN apt-get install -y ca-certificates curl gnupg
RUN mkdir -p /etc/apt/keyrings
RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg

# Update nodejs version from 10.24.0 to 18.x
RUN yum install https://rpm.nodesource.com/pub_18.x/nodistro/repo/nodesource-release-nodistro-1.noarch.rpm -y
RUN yum install nodejs -y --setopt=nodesource-nodejs.module_hotfixes=1
ARG NODE_MAJOR=18
RUN echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list

COPY --from=sui-node /root/.cargo/bin/sui /bin/sui
COPY --from=sui-node /root/.cargo/bin/sui-faucet /bin/sui-faucet
COPY --from=sui-node /root/.cargo/bin/sui-node /bin/sui-node
RUN apt-get update
RUN apt-get install nodejs -y
13 changes: 3 additions & 10 deletions sui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,18 @@ Make sure your Cargo version is at least 1.65.0 and then follow the steps below:

- https://docs.sui.io/build/install

## Prerequisites
#https://docs.sui.io/guides/developer/getting-started/sui-install# Prerequisites

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 09b2081498366df936abae26eea4b2d5cafb2788 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

Expand Down Expand Up @@ -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
Expand Down
125 changes: 125 additions & 0 deletions sui/devnet/127.0.0.1-36219.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
---
protocol-key-pair:
value: avYcyVgYMXTyaUYh9IRwLK0gSzl7YF6ZQDAbrS1Bhvo=
worker-key-pair:
value: AAvfYqj1HPsXmthZ1t2Uw19vU6tdhK48YAFgkhJ7P/sV
account-key-pair:
value: ABmHnCaxw0GWzW+1MZYfTDonS1wZsO8KO37SXgm6pqc6
network-key-pair:
value: AEpJ6PVCvnrtaxREy8UNSiDwLPPrZMh12TbgELadmAHB
db-path: /root/.sui/sui_config/authorities_db/8dcff6d15504
network-address: /ip4/127.0.0.1/tcp/36219/http
json-rpc-address: "127.0.0.1:37179"
enable-experimental-rest-api: true
metrics-address: "127.0.0.1:44423"
admin-interface-port: 35585
consensus-config:
address: /ip4/127.0.0.1/tcp/35107/http
db-path: /root/.sui/sui_config/consensus_db/8dcff6d15504
internal-worker-address: ~
max-pending-transactions: ~
max-submit-position: ~
submit-delay-step-override-millis: ~
narwhal-config:
header_num_of_batches_threshold: 32
max_header_num_of_batches: 1000
max_header_delay: 1000ms
min_header_delay: 500ms
gc_depth: 50
sync_retry_delay: 5000ms
sync_retry_nodes: 3
batch_size: 5000000
max_batch_delay: 100ms
max_concurrent_requests: 500000
prometheus_metrics:
socket_addr: /ip4/127.0.0.1/tcp/42177/http
network_admin_server:
primary_network_admin_server_port: 34745
worker_network_admin_server_base_port: 43111
anemo:
send_certificate_rate_limit: ~
report_batch_rate_limit: ~
request_batches_rate_limit: ~
enable-event-processing: false
enable-index-processing: true
grpc-load-shed: ~
grpc-concurrency-limit: 20000000000
p2p-config:
listen-address: "127.0.0.1:41551"
external-address: /ip4/127.0.0.1/udp/41551
state-sync:
checkpoint-content-timeout-ms: 10000
genesis:
genesis-file-location: /root/.sui/sui_config/genesis.blob
authority-store-pruning-config:
num-latest-epoch-dbs-to-retain: 3
epoch-db-pruning-period-secs: 3600
num-epochs-to-retain: 0
max-checkpoints-in-batch: 10
max-transactions-in-batch: 1000
end-of-epoch-broadcast-channel-capacity: 128
checkpoint-executor-config:
checkpoint-execution-max-concurrency: 200
local-execution-timeout-sec: 30
db-checkpoint-config:
perform-db-checkpoints-at-epoch-end: false
indirect-objects-threshold: 18446744073709551615
expensive-safety-check-config:
enable-epoch-sui-conservation-check: false
enable-deep-per-tx-sui-conservation-check: false
force-disable-epoch-sui-conservation-check: false
enable-state-consistency-check: false
force-disable-state-consistency-check: false
enable-secondary-index-checks: false
transaction-deny-config:
package-publish-disabled: false
package-upgrade-disabled: false
shared-object-disabled: false
user-transaction-disabled: false
receiving-objects-disabled: false
zklogin-sig-disabled: false
zklogin-disabled-providers: []
certificate-deny-config: {}
state-debug-dump-config: {}
state-archive-write-config:
concurrency: 0
use-for-pruning-watermark: false
state-archive-read-config: []
state-snapshot-write-config:
concurrency: 0
indexer-max-subscriptions: ~
transaction-kv-store-read-config:
base-url: ""
jwk-fetch-interval-seconds: 3600
zklogin-oauth-providers:
Mainnet:
- Facebook
- Google
- Twitch
Testnet:
- Facebook
- Google
- Twitch
Unknown:
- Apple
- Facebook
- Google
- Kakao
- Slack
- Twitch
authority-overload-config:
max-txn-age-in-queue:
secs: 1
nanos: 0
overload-monitor-interval:
secs: 10
nanos: 0
execution-queue-latency-soft-limit:
secs: 1
nanos: 0
execution-queue-latency-hard-limit:
secs: 10
nanos: 0
max-load-shedding-percentage: 95
min-load-shedding-percentage-above-hard-limit: 50
safe-transaction-ready-rate: 100
Loading
Loading