Skip to content

Commit aaf4411

Browse files
authored
Merge branch 'MystenLabs:main' into main
2 parents 5de13d9 + 7bc276d commit aaf4411

File tree

4,557 files changed

+194055
-101809
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

4,557 files changed

+194055
-101809
lines changed

.cargo/config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ move-clippy = [
2626

2727
mysql-clippy = [
2828
"clippy",
29+
"--all-targets",
2930
"--package",
3031
"sui-indexer",
3132
"--features",

.changeset/config.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@
1414
"sponsored-transactions",
1515
"kiosk-demo",
1616
"kiosk-cli",
17-
"@mysten/sdk-docs"
17+
"@mysten/sdk-docs",
18+
"mev-bot",
19+
"escrow-api-demo",
20+
"trading-frontend-demo"
1821
],
1922
"___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": {
2023
"onlyUpdatePeerDependentsWhenOutOfRange": true

.config/nextest.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ failure-output = "immediate"
3131
status-level = "fail"
3232
# Do not cancel the test run on the first failure.
3333
fail-fast = false
34-
# Mark tests as slow after 20m, terminate after 1h
35-
slow-timeout = { period = "20m", terminate-after = 3 }
34+
# Mark tests as slow after 30m, terminate after 1.5h
35+
slow-timeout = { period = "30m", terminate-after = 3 }
3636

3737
[profile.ci.junit]
3838
path = "junit.xml"

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,5 @@ For each box you select, include information after the relevant heading that des
2020
- [ ] JSON-RPC:
2121
- [ ] GraphQL:
2222
- [ ] CLI:
23-
- [ ] Rust SDK:
23+
- [ ] Rust SDK:
24+
- [ ] REST API:

.github/actions/ts-e2e/action.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,30 +16,28 @@ runs:
1616
# - uses: bmwill/rust-cache@v1 # Fork of 'Swatinem/rust-cache' which allows caching additional paths
1717
- uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # [email protected]
1818
with:
19-
version: 9
19+
version: 9.1.1
2020

2121
- name: Check s3 if binaries have been uploaded already
2222
continue-on-error: true
2323
id: check_s3
2424
run: |
2525
echo "Checking if s3 binaries have been built for ${{ github.sha }}"
26-
echo "s3_file_exist=$(curl -Is https://sui-releases.s3.us-east-1.amazonaws.com/${{ github.sha }}/debug/sui-test-validator | head -n 1 | grep '200 OK')" >> $GITHUB_ENV
26+
echo "s3_file_exist=$(curl -Is https://sui-releases.s3.us-east-1.amazonaws.com/${{ github.sha }}/debug/sui-pg | head -n 1 | grep '200 OK')" >> $GITHUB_ENV
2727
shell: bash
2828

2929
- name: cargo build
3030
if: env.s3_file_exist == '' # if empty, we have not built and uploaded this binary to s3 yet
3131
run: |
32-
cargo build --bin sui-test-validator --bin sui
32+
cargo build --bin sui --features indexer
3333
shell: bash
3434

3535
- name: Dowload from S3
3636
if: env.s3_file_exist != '' # only download if the s3 file exists
3737
working-directory: ./target/debug
3838
run: |
3939
mkdir -p $PWD/target/debug
40-
wget -O target/debug/sui-test-validator https://sui-releases.s3.us-east-1.amazonaws.com/${{ github.sha }}/debug/sui-test-validator
41-
chmod +x $PWD/target/debug/sui-test-validator
42-
wget -O target/debug/sui-test-validator https://sui-releases.s3.us-east-1.amazonaws.com/${{ github.sha }}/debug/sui
40+
wget -O target/debug/sui https://sui-releases.s3.us-east-1.amazonaws.com/${{ github.sha }}/debug/sui-pg
4341
chmod +x $PWD/target/debug/sui
4442
shell: bash
4543

@@ -59,10 +57,10 @@ runs:
5957

6058
- name: Set env
6159
run: |
62-
echo "E2E_RUN_LOCAL_NET_CMD=(RUST_LOG=\"consensus=off\" $(echo $PWD/target/debug/sui-test-validator) --with-indexer --pg-port 5432 --pg-db-name sui_indexer_v2 --graphql-host 127.0.0.1 --graphql-port 9125)" >> $GITHUB_ENV
60+
echo "E2E_RUN_LOCAL_NET_CMD=(RUST_LOG=\"consensus=off\" $(echo $PWD/target/debug/sui) start --with-faucet --force-regenesis --with-indexer --pg-port 5432 --pg-db-name sui_indexer_v2 --with-graphql)" >> $GITHUB_ENV
6361
echo "VITE_SUI_BIN=$PWD/target/debug/sui" >> $GITHUB_ENV
6462
shell: bash
6563

6664
- name: Run TS SDK e2e tests
67-
run: pnpm dlx concurrently --kill-others --success command-1 "$E2E_RUN_LOCAL_NET_CMD" 'pnpm --filter @mysten/sui.js --filter @mysten/graphql-transport test:e2e'
65+
run: pnpm dlx concurrently --kill-others --success command-1 "$E2E_RUN_LOCAL_NET_CMD" 'pnpm --filter @mysten/sui --filter @mysten/graphql-transport test:e2e'
6866
shell: bash

.github/actions/turbo-diffs/action.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ runs:
1212
fetch-depth: 0
1313
- uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # [email protected]
1414
with:
15-
version: 9
15+
version: 9.1.1
16+
- name: Install dependencies
17+
run: pnpm install --frozen-lockfile
18+
shell: bash
1619
- id: changes
1720
name: Detect changes
1821
shell: bash

.github/workflows/bridge.yml

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
name: Native Bridge
2+
3+
on:
4+
push:
5+
branches:
6+
- 'main'
7+
- 'devnet'
8+
- 'testnet'
9+
- 'mainnet'
10+
- 'releases/sui-*-release'
11+
pull_request:
12+
types: [ opened, synchronize, reopened, ready_for_review ]
13+
workflow_dispatch:
14+
inputs:
15+
sui_repo_ref:
16+
description: "Branch / commit to test"
17+
type: string
18+
required: false
19+
default: ''
20+
21+
concurrency:
22+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
23+
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
24+
25+
env:
26+
CARGO_TERM_COLOR: always
27+
# Disable incremental compilation.
28+
#
29+
# Incremental compilation is useful as part of an edit-build-test-edit cycle,
30+
# as it lets the compiler avoid recompiling code that hasn't changed. However,
31+
# on CI, we're not making small edits; we're almost always building the entire
32+
# project from scratch. Thus, incremental compilation on CI actually
33+
# introduces *additional* overhead to support making future builds
34+
# faster...but no future builds will ever occur in any given CI environment.
35+
#
36+
# See https://matklad.github.io/2021/09/04/fast-rust-builds.html#ci-workflow
37+
# for details.
38+
CARGO_INCREMENTAL: 0
39+
# Allow more retries for network requests in cargo (downloading crates) and
40+
# rustup (installing toolchains). This should help to reduce flaky CI failures
41+
# from transient network timeouts or other issues.
42+
CARGO_NET_RETRY: 10
43+
RUSTUP_MAX_RETRIES: 10
44+
# Don't emit giant backtraces in the CI logs.
45+
RUST_BACKTRACE: short
46+
# Some integration tests can produce too much INFO logs that are infeasible to be printed on failure.
47+
RUST_LOG: error
48+
# RUSTFLAGS: -D warnings
49+
RUSTDOCFLAGS: -D warnings
50+
51+
jobs:
52+
diff:
53+
runs-on: [ ubuntu-latest ]
54+
outputs:
55+
isRust: ${{ steps.diff.outputs.isRust }}
56+
isMove: ${{ steps.diff.outputs.isMove }}
57+
isSolidity: ${{ steps.diff.outputs.isSolidity }}
58+
isReleaseNotesEligible: ${{ steps.diff.outputs.isReleaseNotesEligible }}
59+
isMoveAutoFormatter: ${{ steps.diff.outputs.isMoveAutoFormatter }}
60+
steps:
61+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # Pin v4.1.1
62+
- name: Detect Changes
63+
uses: './.github/actions/diffs'
64+
id: diff
65+
66+
test:
67+
needs: diff
68+
if: needs.diff.outputs.isRust == 'true' || needs.diff.outputs.isSolidity == 'true'
69+
timeout-minutes: 45
70+
env:
71+
# Tests written with #[sim_test] are often flaky if run as #[tokio::test] - this var
72+
# causes #[sim_test] to only run under the deterministic `simtest` job, and not the
73+
# non-deterministic `test` job.
74+
SUI_SKIP_SIMTESTS: 1
75+
runs-on: ${{ matrix.os }}
76+
strategy:
77+
matrix:
78+
os:
79+
- [ ubuntu-ghcloud ]
80+
fail-fast: false
81+
steps:
82+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # Pin v4.1.1
83+
- uses: taiki-e/install-action@nextest
84+
- name: Set Swap Space
85+
uses: pierotofy/set-swap-space@master
86+
with:
87+
swap-size-gb: 256
88+
- name: Install Foundry
89+
run: |
90+
curl -L https://foundry.paradigm.xyz | { cat; echo '$FOUNDRY_BIN_DIR/foundryup'; } | bash
91+
echo "$HOME/.config/.foundry/bin" >> $GITHUB_PATH
92+
- name: Install Foundry Dependencies
93+
working-directory: bridge/evm
94+
run: |
95+
forge install https://github.com/OpenZeppelin/[email protected] https://github.com/foundry-rs/[email protected] https://github.com/OpenZeppelin/openzeppelin-foundry-upgrades --no-git --no-commit
96+
- name: cargo test
97+
run: |
98+
cargo nextest run --profile ci -E 'package(sui-bridge)'
99+
# Ensure there are no uncommitted changes in the repo after running tests
100+
- run: scripts/changed-files.sh
101+
shell: bash
102+
103+
bridge-evm:
104+
name: bridge-evm-tests
105+
needs: diff
106+
if: needs.diff.outputs.isSolidity == 'true'
107+
runs-on: [ ubuntu-ghcloud ]
108+
steps:
109+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # Pin v4.1.1
110+
- name: Install Foundry
111+
run: |
112+
curl -L https://foundry.paradigm.xyz | { cat; echo '$FOUNDRY_BIN_DIR/foundryup'; } | bash
113+
echo "$HOME/.config/.foundry/bin" >> $GITHUB_PATH
114+
- name: Install Foundry Dependencies
115+
working-directory: bridge/evm
116+
run: |
117+
forge install https://github.com/OpenZeppelin/[email protected] https://github.com/foundry-rs/[email protected] https://github.com/OpenZeppelin/openzeppelin-foundry-upgrades --no-git --no-commit
118+
- name: Check Bridge EVM Unit Tests
119+
shell: bash
120+
working-directory: bridge/evm
121+
env:
122+
INFURA_API_KEY: ${{ secrets.INFURA_API_KEY }}
123+
run: |
124+
forge clean
125+
forge test --ffi

.github/workflows/build-suiop-cli.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Build suiop-cli binaries
2+
on:
3+
push:
4+
paths:
5+
- 'crates/suiop-cli/**'
6+
pull_request:
7+
paths:
8+
- 'crates/suiop-cli/**'
9+
10+
# Do not run the same workflow concurrenctly
11+
# for the same branch.
12+
concurrency: ${{ github.workflow }}-${{ github.ref }}
13+
14+
jobs:
15+
release:
16+
runs-on: ubuntu-latest
17+
steps:
18+
# Trigger a gh action in MystenLabs/sui-operations
19+
- name: Dispatch Build To Operations Repo
20+
uses: peter-evans/repository-dispatch@ff45666b9427631e3450c54a1bcbee4d9ff4d7c0 # [email protected]
21+
with:
22+
repository: MystenLabs/sui-operations
23+
# Using the changeset's token for now,
24+
# we could generate a different secret for this
25+
# for separation of concerns:
26+
token: ${{ secrets.CHANGESETS_DEPLOY_DISPATCH }}
27+
event-type: build-suiop-cli-binaries
28+
client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}'

.github/workflows/cargo-llvm-cov.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ jobs:
3636
env:
3737
CARGO_TERM_COLOR: always
3838
steps:
39+
- name: Install Rust
40+
run: rustup update stable
41+
3942
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # Pin v4.1.1
4043
- uses: bmwill/rust-cache@v1
4144

@@ -49,12 +52,9 @@ jobs:
4952
uses: pierotofy/set-swap-space@master
5053
with:
5154
swap-size-gb: 256
52-
53-
- name: Install Rust
54-
run: rustup update stable
5555

5656
- name: Run code coverage for nextest
57-
run: SUI_SKIP_SIMTESTS=1 cargo llvm-cov --ignore-run-fail --lcov --output-path lcov.info nextest
57+
run: RUSTFLAGS="-C debuginfo=0" SUI_SKIP_SIMTESTS=1 cargo llvm-cov --ignore-run-fail --lcov --output-path lcov.info nextest -vv
5858

5959
- name: Upload report to Codecov for nextest
6060
uses: codecov/codecov-action@e0b68c6749509c5f83f984dd99a76a1c1a231044 # pin v4.0.1

.github/workflows/changesets-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
fetch-depth: 0
1111
- uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # [email protected]
1212
with:
13-
version: 9
13+
version: 9.1.1
1414
- name: Install Nodejs
1515
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # [email protected]
1616
with:

.github/workflows/changesets.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
fetch-depth: 0
3838
- uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # [email protected]
3939
with:
40-
version: 9
40+
version: 9.1.1
4141
- name: Install Nodejs
4242
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # [email protected]
4343
with:

.github/workflows/ci-docs.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,7 @@ jobs:
1919
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # Pin v4.1.1
2020

2121
- name: Install Rust toolchain
22-
uses: actions-rs/toolchain@b2417cde72dcf67f306c0ae8e0828a81bf0b189f # [email protected]
23-
with:
24-
profile: minimal
25-
toolchain: stable
26-
override: true
22+
uses: taiki-e/install-action@nextest
2723

2824
- name: Generate documentation
2925
uses: actions-rs/cargo@ae10961054e4aa8b4aa7dffede299aaf087aa33b # [email protected]

.github/workflows/docs-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
fetch-depth: 2
1818
- uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # [email protected]
1919
with:
20-
version: 9
20+
version: 9.1.1
2121
- name: Install Nodejs
2222
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # [email protected]
2323
with:

0 commit comments

Comments
 (0)