Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/mainnet' into update
Browse files Browse the repository at this point in the history
  • Loading branch information
NorbertBodziony committed Sep 11, 2024
2 parents 8292740 + 3576d33 commit 2e1e0ef
Show file tree
Hide file tree
Showing 895 changed files with 48,335 additions and 17,843 deletions.
5 changes: 5 additions & 0 deletions .cargo/config → .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ xclippy = [
"clippy", "--all-targets", "--all-features", "--",
"-Wclippy::all",
"-Wclippy::disallowed_methods",
"-Aclippy::unnecessary_get_then_check",
]
xlint = "run --package x --bin x -- lint"
xtest = "run --package x --bin x -- external-crates-tests"
Expand All @@ -22,6 +23,9 @@ move-clippy = [
"-Aclippy::upper_case_acronyms",
"-Aclippy::type_complexity",
"-Aclippy::new_without_default",
"-Aclippy::question_mark",
"-Aclippy::unnecessary_get_then_check",
"-Aclippy::needless_borrows_for_generic_args",
]

mysql-clippy = [
Expand All @@ -38,6 +42,7 @@ mysql-clippy = [
"-Aclippy::upper_case_acronyms",
"-Aclippy::type_complexity",
"-Aclippy::new_without_default",
"-Aclippy::unnecessary_get_then_check",
]

[build]
Expand Down
28 changes: 28 additions & 0 deletions .config/hakari.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# This file contains settings for `cargo hakari`.
# See https://docs.rs/cargo-hakari/latest/cargo_hakari/config for a full list of options.

# Right now we're only using hakari in a sort of hybrid manually managed mode
# to enforce that rocksdb is built only a single time in the workspace
hakari-package = "typed-store-workspace-hack"

# Format version for hakari's output. Version 4 requires cargo-hakari 0.9.22 or above.
dep-format-version = "4"

# Setting workspace.resolver = "2" in the root Cargo.toml is HIGHLY recommended.
# Hakari works much better with the new feature resolver.
# For more about the new feature resolver, see:
# https://blog.rust-lang.org/2021/03/25/Rust-1.51.0.html#cargos-new-feature-resolver
resolver = "2"

# Add triples corresponding to platforms commonly used by developers here.
# https://doc.rust-lang.org/rustc/platform-support.html
platforms = [
"x86_64-unknown-linux-gnu",
"x86_64-apple-darwin",
# "x86_64-pc-windows-msvc",
]

# Write out exact versions rather than a semver range. (Defaults to false.)
# exact-versions = true
output-single-feature = true
unify-target-host = "unify-if-both"
28 changes: 0 additions & 28 deletions .github/workflows/build-suiop-cli.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/cargo-llvm-cov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
swap-size-gb: 256

- name: Run code coverage for nextest
run: RUSTFLAGS="-C debuginfo=0" SUI_SKIP_SIMTESTS=1 cargo llvm-cov --ignore-run-fail --lcov --output-path lcov.info nextest -vv
run: RUSTFLAGS="-C debuginfo=0" SUI_SKIP_SIMTESTS=1 cargo llvm-cov --ignore-run-fail --lcov --output-path lcov.info nextest -vv -E '!package(sui-bridge)'

- name: Upload report to Codecov for nextest
uses: codecov/codecov-action@e0b68c6749509c5f83f984dd99a76a1c1a231044 # pin v4.0.1
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/external.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,4 +127,5 @@ jobs:
runs-on: [ubuntu-latest]
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # Pin v4.1.1
- uses: mystenlabs/cargo-deny-action@main
- uses: taiki-e/install-action@cargo-deny
- run: cargo deny check
71 changes: 71 additions & 0 deletions .github/workflows/release-notes-generator.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Create Sui Release with Release Notes

concurrency: ${{ github.workflow }}-${{ inputs.release_tag }}

on:
workflow_dispatch:
inputs:
release_tag:
description: 'Sui Release Tag'
type: string
required: true
previous_branch:
description: 'Previous Release Branch (Ex: releases/sui-vX.XX.X-release)'
type: string
required: true
current_branch:
description: 'Current Release Branch (Ex: releases/sui-vX.XX.X-release)'
type: string
required: true

env:
RELEASE_NOTES_FILE: "./release_notes.txt"

jobs:
get-release-notes:
name: Get Release Notes for ${{ inputs.release_tag }} release
runs-on: ubuntu-latest

steps:
- name: Get commits for branches
shell: bash
working-directory: ./
run: |
echo "previous_commit=$(curl https://api.github.com/repos/MystenLabs/sui/commits/${{ inputs.previous_branch }} | jq .sha)" >> $GITHUB_ENV
echo "current_commit=$(curl https://api.github.com/repos/MystenLabs/sui/commits/${{ inputs.current_branch }} | jq .sha)" >> $GITHUB_ENV
- name: Checkout main
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # Pin v4.1.1
with:
fetch-depth: 0
ref: main

- name: Setup Python
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # [email protected]
with:
python-version: 3.10.10

- name: Generate Release Notes
shell: bash
working-directory: ./
run: |
GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} python ./scripts/release_notes.py generate ${{ env.previous_commit }} ${{ env.current_commit }} | tee -a ${{ env.RELEASE_NOTES_FILE }}
echo "---" >> ${{ env.RELEASE_NOTES_FILE }}
echo "#### Full Log: https://github.com/MystenLabs/sui/commits/${{ inputs.release_tag }}" >> ${{ env.RELEASE_NOTES_FILE }}
if [[ ${{ inputs.release_tag }} == devnet* ]]; then
echo "pre_release=true" >> $GITHUB_ENV
else
echo "pre_release=false" >> $GITHUB_ENV
fi
- name: Create Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ inputs.release_tag }}
release_name: ${{ inputs.release_tag }}
body_path: ${{ env.RELEASE_NOTES_FILE }}
draft: false
prerelease: ${{ env.pre_release }}
42 changes: 24 additions & 18 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
name: Attach Sui binaries to a release
run-name: Attach Sui binaries to a ${{ inputs.sui_tag }} release

on:
release:
types: [ published ]
types: [ published, prereleased ]
workflow_dispatch:
inputs:
sui_tag:
Expand Down Expand Up @@ -43,10 +44,10 @@ jobs:
matrix:
os:
[
ubuntu-ghcloud, # ubuntu-x86_64
windows-ghcloud, # windows-x86_64
# ubuntu-ghcloud, # ubuntu-x86_64
# windows-ghcloud, # windows-x86_64
macos-latest-xl, # macos-x86_64
macos-latest-xlarge # macos-arm64
# macos-latest-xlarge # macos-arm64
]
fail-fast: false
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -94,7 +95,7 @@ jobs:
continue-on-error: true
shell: bash
run: |
echo "s3_archive_exist=$(curl -Is https://sui-releases.s3.us-east-1.amazonaws.com/releases/sui-${{ env.sui_tag }}-${{ env.os_type }}.tgz | head -n 1 | grep '200 OK')" >> $GITHUB_ENV
# echo "s3_archive_exist=$(curl -Is https://sui-releases.s3.us-east-1.amazonaws.com/releases/sui-${{ env.sui_tag }}-${{ env.os_type }}.tgz | head -n 1 | grep '200 OK')" >> $GITHUB_ENV
- name: Download archive, if it exists
if: ${{ env.s3_archive_exist != '' }}
Expand All @@ -112,13 +113,6 @@ jobs:
if: ${{ matrix.os == 'windows-ghcloud' && env.s3_archive_exist == '' }}
uses: taiki-e/install-action@33022ba120c3f523d134bbbee12278fc11a3df1a # pin@nextest

- name: Setup protoc (Windows)
if: ${{ matrix.os == 'windows-ghcloud' && env.s3_archive_exist == '' }}
uses: arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b # [email protected]
# this avoids rate-limiting
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Install postgres (Windows)
if: ${{ matrix.os == 'windows-ghcloud' && env.s3_archive_exist == '' }}
shell: bash
Expand All @@ -130,7 +124,7 @@ jobs:
echo "PG_DATABASE_URL=postgres://postgres:root@localhost/" >> $GITHUB_ENV
echo "PG_EXAMPLE_DATABASE_URL=postgres://postgres:root@localhost/diesel_example" >> $GITHUB_ENV
- name: Install postgres (Mac arm64)
- name: Install postgres (MacOS arm64)
if: ${{ matrix.os == 'macos-latest-xlarge' && env.gcloud_archive_exist == '' }}
shell: bash
env:
Expand All @@ -141,6 +135,19 @@ jobs:
run: |
brew install postgresql
- name: Remove unused apps (MacOS platform)
if: ${{ startsWith(matrix.os, 'macos') && env.gcloud_archive_exist == '' }}
continue-on-error: true
shell: bash
run: |
# MacOS arm64 runner only has 14GB avaialble, which is too small for our builds, so removing unused softwared.
df -hI /dev/disk3s1s1
sudo rm -rf /Applications/Xcode*.app
sudo rm -rf ~/Library/Developer/Xcode/DerivedData
sudo rm -rf ~/Library/Developer/CoreSimulator/Caches/*
sudo rm -rf ~/Library/Developer/Xcode/iOS\ DeviceSupport/*
df -hI /dev/disk3s1s1
- name: Cargo build for ${{ matrix.os }} platform
if: ${{ env.s3_archive_exist == '' }}
shell: bash
Expand Down Expand Up @@ -169,8 +176,7 @@ jobs:
[[ ${{ env.sui_tag }} == *"testnet"* ]] && aws s3 cp ./tmp/sui-${{ env.sui_tag }}-${{ env.os_type }}.tgz s3://sui-releases/releases/sui-${{ env.sui_tag }}-${{ env.os_type }}.tgz || true
- name: Publish Windows sui binary to Chocolatey
if: ${{ matrix.os == 'windows-ghcloud' && contains( env.sui_tag, 'testnet') }}
continue-on-error: true
if: ${{ matrix.os == 'windows-ghcloud' && contains(env.sui_tag, 'testnet') }}
shell: bash
run: |
choco install checksum
Expand All @@ -179,9 +185,9 @@ jobs:
cat <<EOF >>VERIFICATION.txt
Sui Binary verification steps
1. Go to https://github.com/MystenLabs/sui/releases/download/${{ env.sui_tag }}/sui-${{ env.sui_tag }}-windows-x86_64.tgz
2. Extract sui-windows-x86_64.exe
3. checksum.exe -t sha256 sui-windows-x86_64.exe: ${sui_sha}
1. Download https://github.com/MystenLabs/sui/releases/download/${{ env.sui_tag }}/sui-${{ env.sui_tag }}-windows-x86_64.tgz
2. Extract sui.exe
3. Verify binary: checksum.exe -t sha256 sui.exe: ${sui_sha}
File 'LICENSE.txt' is obtained from: https://github.com/MystenLabs/sui/blob/main/LICENSE
EOF
Expand Down
15 changes: 3 additions & 12 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ env:
RUSTUP_MAX_RETRIES: 10
# Don't emit giant backtraces in the CI logs.
RUST_BACKTRACE: short
# Some integration tests can produce too much INFO logs that are infeasible to be printed on failure.
RUST_LOG: error
# RUSTFLAGS: -D warnings
RUSTDOCFLAGS: -D warnings

Expand Down Expand Up @@ -202,10 +200,6 @@ jobs:
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # Pin v4.1.1
- uses: taiki-e/install-action@nextest
- uses: arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b # [email protected]
# this avoids rate-limiting
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Install postgres (Windows)
shell: bash
Expand Down Expand Up @@ -262,7 +256,7 @@ jobs:
- uses: taiki-e/install-action@nextest
- name: Run move tests
run: |
cargo nextest run -p sui-framework-tests -- unit_tests::
cargo nextest run -p sui-framework-tests --test move_tests
# # Disabled
# rosetta-validation:
Expand Down Expand Up @@ -345,10 +339,6 @@ jobs:
if: needs.diff.outputs.isRust == 'true'
runs-on: [ ubuntu-ghcloud ]
steps:
- uses: arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b # [email protected]
# this avoids rate-limiting
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # Pin v4.1.1
- run: rustup component add clippy
# TODO(bradh): debug and re-enable this; the caching is breaking the clippy build
Expand Down Expand Up @@ -385,7 +375,8 @@ jobs:
runs-on: [ ubuntu-latest ]
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # Pin v4.1.1
- uses: mystenlabs/cargo-deny-action@main
- uses: taiki-e/install-action@cargo-deny
- run: cargo deny check

sui-excution-cut:
name: cutting a new execution layer
Expand Down
Loading

0 comments on commit 2e1e0ef

Please sign in to comment.