Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/soroban-xdr-next' into 664/rpc-s…
Browse files Browse the repository at this point in the history
…tate-expiration
  • Loading branch information
Paul Bellamy committed Jun 28, 2023
2 parents b1426a7 + 8a81c8d commit b14f0fe
Show file tree
Hide file tree
Showing 108 changed files with 5,831 additions and 1,197 deletions.
6 changes: 3 additions & 3 deletions .cargo-husky/hooks/pre-push
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ echo 'git diff-index --quiet HEAD --'
git diff-index --quiet HEAD --

echo '+cargo clippy -- -Dwarnings -Dclippy::all -Dclippy::pedantic'
cargo clippy -- -Dwarnings -Dclippy::all -Dclippy::pedantic
cargo clippy --all -- -Dwarnings

echo '+cargo test'
cargo test
echo '+cargo test --all'
cargo test --all || (echo "might need to rebuild make build-snapshot` && exit 1)
1 change: 1 addition & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

[alias] # command aliases
md-gen = "run --bin doc-gen --features clap-markdown"
f = "fmt"
# b = "build"
# c = "check"
# t = "test"
Expand Down
3 changes: 3 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Involve the contract committer team when making changes to the soroban
# contract build command.
/cmd/soroban-cli/src/commands/contract/build.rs @stellar/contract-committers
2 changes: 1 addition & 1 deletion .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
SYSTEM_TEST_RUST_TOOLCHAIN_VERSION: stable

# sets the version of soroban-js-client used by tests
SYSTEM_TEST_JS_SOROBAN_CLIENT_NPM_VERSION: "0.7.0"
SYSTEM_TEST_JS_SOROBAN_CLIENT_NPM_VERSION: "0.8.1"

# system test will build quickstart image internally to use for running the service stack
# configured in standalone network mode(core, rpc)
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ jobs:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}

upload:
needs: publish
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-20.04 # Use 20.04 to get an older version of glibc for increased compat
Expand Down
31 changes: 27 additions & 4 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,11 @@ jobs:
- run: rustup update
- run: rustup +nightly component add rust-analyzer
- name: Check if rust-analyzer encounters any errors parsing project
run: rustup run nightly rust-analyzer analysis-stats . 2>&1 | (! grep ERROR)
run: rustup run nightly rust-analyzer analysis-stats . 2>&1 | (! grep '^\[ERROR')

build-and-test:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
Expand All @@ -66,25 +67,47 @@ jobs:
- if: startsWith(matrix.target, 'x86_64')
# specify directories explicitly to avoid building the preflight library (otherwise it will fail with missing symbols)
run: |
for I in cmd/soroban-cli cmd/crates/soroban-test cmd/crates/soroban-test/tests/fixtures/test-wasms/hello_world ; do
for I in cmd/soroban-cli cmd/crates/* cmd/crates/soroban-test/tests/fixtures/test-wasms/hello_world ; do
cargo test --target ${{ matrix.target }} --manifest-path $I/Cargo.toml
done
publish-dry-run:
if: github.event_name == 'push' || startsWith(github.head_ref, 'release/')
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
cargo-hack-feature-options: --feature-powerset
- os: ubuntu-latest
target: aarch64-unknown-linux-gnu
cargo-hack-feature-options: --feature-powerset
- os: macos-latest
target: x86_64-apple-darwin
cargo-hack-feature-options: --feature-powerset
- os: macos-latest
target: aarch64-apple-darwin
- os: windows-latest
cargo-hack-feature-options: --feature-powerset
# Windows builds notes:
#
# The different features that need testing are split over unique
# isolated builds for Windows, because there's a bug in Cargo [1] that
# causes builds of wasm-opt [2] to fail when run one after the other and
# attempting to clean up artifacts in between. The bug has been fixed,
# but will not make it into a stable release of Cargo until ~August
# 2023.
#
# [1]: https://github.com/rust-lang/cargo/pull/11442
# [2]: https://github.com/brson/wasm-opt-rs/issues/116
- os: windows-latest-8-cores
target: x86_64-pc-windows-msvc
cargo-hack-feature-options: ''
- os: windows-latest-8-cores
target: x86_64-pc-windows-msvc
uses: stellar/actions/.github/workflows/rust-publish-dry-run.yml@main
cargo-hack-feature-options: --features opt --ignore-unknown-features
uses: stellar/actions/.github/workflows/rust-publish-dry-run-v2.yml@main
with:
crates: soroban-spec-tools soroban-spec-json soroban-spec-typescript soroban-test soroban-cli
runs-on: ${{ matrix.os }}
target: ${{ matrix.target }}
cargo-hack-feature-options: ${{ matrix.cargo-hack-feature-options }}
30 changes: 15 additions & 15 deletions .github/workflows/soroban-rpc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,21 +61,16 @@ jobs:
with:
go-version: 1.20.1

- if: matrix.os == 'windows-latest'
name: Find the minimal supported rust version on windows
run: |
preflight_rust_version=$(sed -n 's/.*rust-version = "\(.*\)"/\1/p' cmd/soroban-rpc/lib/preflight/Cargo.toml)
echo "PREFLIGHT_RUST_VERSION=$preflight_rust_version" >> $GITHUB_ENV
- name: Update rust toolchain as needed
run: |
rustup update $PREFLIGHT_RUST_VERSION
- run: rustup target add ${{ matrix.rust_target }}

# On windows, make sure we have the same compiler (linker) used by rust.
# This is important since the symbols names won't match otherwise.
- if: matrix.os == 'windows-latest'
name: Configure preflight library to use explicit rust version
name: Install the same mingw gcc compiler used by rust
run: |
cd cmd/soroban-rpc/lib/preflight
rustup override set $PREFLIGHT_RUST_VERSION-${{ matrix.rust_target }}
cd ../../../..
C:/msys64/usr/bin/pacman.exe -S mingw-w64-x86_64-gcc --noconfirm
echo "CC=C:/msys64/mingw64/bin/gcc.exe" >> $GITHUB_ENV
echo "C:/msys64/mingw64/bin" >> $GITHUB_PATH
# Use cross-compiler for linux aarch64
- if: matrix.rust_target == 'aarch64-unknown-linux-gnu'
Expand All @@ -86,13 +81,18 @@ jobs:
echo 'CC=aarch64-linux-gnu-gcc-10' >> $GITHUB_ENV
- name: Build libpreflight
run: CARGO_BUILD_TARGET=${{ matrix.rust_target }} make build-libpreflight
run: make build-libpreflight
env:
CARGO_BUILD_TARGET: ${{ matrix.rust_target }}

- name: Build Soroban RPC reproducible build
run: |
CGO_ENABLED=1 GOARCH=${{ matrix.go_arch }} go build -trimpath -buildvcs=false ./cmd/soroban-rpc
go build -trimpath -buildvcs=false ./cmd/soroban-rpc
ls -lh soroban-rpc
file soroban-rpc
env:
CGO_ENABLED: 1
GOARCH: ${{ matrix.go_arch }}

integration:
name: Integration tests
Expand All @@ -103,7 +103,7 @@ jobs:
env:
SOROBAN_RPC_INTEGRATION_TESTS_ENABLED: true
SOROBAN_RPC_INTEGRATION_TESTS_CAPTIVE_CORE_BIN: /usr/bin/stellar-core
PROTOCOL_20_CORE_DEBIAN_PKG_VERSION: 19.10.1-1310.6649f5173.focal~soroban
PROTOCOL_20_CORE_DEBIAN_PKG_VERSION: 19.11.1-1353.cbac8d399.focal~soroban
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
Expand Down
Loading

0 comments on commit b14f0fe

Please sign in to comment.