diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index fa16634aa..1655ee5b7 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -76,18 +76,18 @@ jobs: repo-token: ${{ secrets.GITHUB_TOKEN }} - name: Install Rust run: rustup show && rustup install nightly && rustup component add rustfmt --toolchain nightly-x86_64-unknown-linux-gnu # Nightly is needed for our configuration of cargo fmt - - name: Install cargo-risc0 # Risc0 v0.17 and higher require a cargo extension to build the guest code - run: cargo install cargo-risczero - - name: Install risc0-zkvm toolchain # Use the risc0 cargo extension to install the risc0 std library for the current toolchain - run: cargo risczero install - uses: Swatinem/rust-cache@v2 with: cache-provider: "buildjet" - shared-key: cargo-check + shared-key: cargo-check-cache save-if: ${{ github.ref == 'refs/heads/nightly' }} workspaces: | . fuzz + - name: Install cargo-risc0 # Risc0 v0.17 and higher require a cargo extension to build the guest code + run: cargo install cargo-risczero + - name: Install risc0-zkvm toolchain # Use the risc0 cargo extension to install the risc0 std library for the current toolchain + run: cargo risczero install - name: Run lint run: | if ! make lint ; then @@ -102,7 +102,7 @@ jobs: # effectively. needs: check runs-on: buildjet-8vcpu-ubuntu-2204 - timeout-minutes: 60 + timeout-minutes: 120 env: SKIP_GUEST_BUILD: "1" steps: @@ -120,7 +120,7 @@ jobs: - uses: Swatinem/rust-cache@v2 with: cache-provider: "buildjet" - shared-key: cargo-check + shared-key: cargo-check-cache save-if: ${{ github.ref == 'refs/heads/nightly' }} workspaces: | . @@ -140,18 +140,18 @@ jobs: with: version: "23.2" repo-token: ${{ secrets.GITHUB_TOKEN }} - - name: Install Rust - run: rustup show - - name: Install cargo-risc0 # Risc0 v0.17 and higher require a cargo extension to build the guest code - run: cargo install cargo-risczero - - name: Install risc0-zkvm toolchain # Use the risc0 cargo extension to install the risc0 std library for the current toolchain - run: cargo risczero install # `cargo-nextest` is much faster than standard `cargo test`. - uses: taiki-e/install-action@nextest + - name: Install Rust + run: rustup show - uses: Swatinem/rust-cache@v2 with: cache-provider: "buildjet" save-if: ${{ github.ref == 'refs/heads/nightly' }} + - name: Install cargo-risc0 # Risc0 v0.17 and higher require a cargo extension to build the guest code + run: cargo install cargo-risczero + - name: Install risc0-zkvm toolchain # Use the risc0 cargo extension to install the risc0 std library for the current toolchain + run: cargo risczero install - run: cargo nextest run --workspace --all-features test: name: test @@ -167,14 +167,14 @@ jobs: repo-token: ${{ secrets.GITHUB_TOKEN }} - name: Install Rust run: rustup show - - name: Install cargo-risc0 # Risc0 v0.17 and higher require a cargo extension to build the guest code - run: cargo install cargo-risczero - - name: Install risc0-zkvm toolchain # Use the risc0 cargo extension to install the risc0 std library for the current toolchain - run: cargo risczero install - uses: Swatinem/rust-cache@v2 with: cache-provider: "buildjet" save-if: ${{ github.ref == 'refs/heads/nightly' }} + - name: Install cargo-risc0 # Risc0 v0.17 and higher require a cargo extension to build the guest code + run: cargo install cargo-risczero + - name: Install risc0-zkvm toolchain # Use the risc0 cargo extension to install the risc0 std library for the current toolchain + run: cargo risczero install # `cargo-nextest` does not support doctests (yet?), so we have to run them # separately. # TODO: https://github.com/nextest-rs/nextest/issues/16 @@ -195,10 +195,6 @@ jobs: repo-token: ${{ secrets.GITHUB_TOKEN }} - name: Install Rust run: rustup show - - name: Install cargo-risc0 # Risc0 v0.17 and higher require a cargo extension to build the guest code - run: cargo install cargo-risczero - - name: Install risc0-zkvm toolchain # Use the risc0 cargo extension to install the risc0 std library for the current toolchain - run: cargo risczero install - name: add llvm component run: rustup component add llvm-tools-preview - name: cargo install cargo-llvm-cov @@ -207,6 +203,10 @@ jobs: with: cache-provider: "buildjet" save-if: ${{ github.ref == 'refs/heads/nightly' }} + - name: Install cargo-risc0 # Risc0 v0.17 and higher require a cargo extension to build the guest code + run: cargo install cargo-risczero + - name: Install risc0-zkvm toolchain # Use the risc0 cargo extension to install the risc0 std library for the current toolchain + run: cargo risczero install - name: cargo generate-lockfile if: hashFiles('Cargo.lock') == '' run: cargo generate-lockfile @@ -233,8 +233,7 @@ jobs: steps: - uses: actions/checkout@v3 # Not sure installing `mold` is actually needed, but it's what the - # `check` job does and their caches are shared, so it's best to keep - # things as similar as possible. + # `check` job, and we'd rather keep things as similar as possible. - uses: rui314/setup-mold@v1 - name: Install Protoc uses: arduino/setup-protoc@v2 @@ -246,7 +245,6 @@ jobs: - uses: Swatinem/rust-cache@v2 with: cache-provider: "buildjet" - shared-key: cargo-doc save-if: ${{ github.ref == 'refs/heads/nightly' }} # The docs' artifact tends to become quite large with all the # dependencies, so we don't include them. @@ -308,14 +306,14 @@ jobs: repo-token: ${{ secrets.GITHUB_TOKEN }} - name: Install Rust run: rustup show - - name: Install cargo-risc0 # Risc0 v0.17 and higher require a cargo extension to build the guest code - run: cargo install cargo-risczero - - name: Install risc0-zkvm toolchain # Use the risc0 cargo extension to install the risc0 std library for the current toolchain - run: cargo risczero install - uses: Swatinem/rust-cache@v2 with: cache-provider: "buildjet" save-if: ${{ github.ref == 'refs/heads/nightly' }} + - name: Install cargo-risc0 # Risc0 v0.17 and higher require a cargo extension to build the guest code + run: cargo install cargo-risczero + - name: Install risc0-zkvm toolchain # Use the risc0 cargo extension to install the risc0 std library for the current toolchain + run: cargo risczero install - name: Compile README.md to Bash run: cargo run --bin bashtestmd -- --input examples/demo-rollup/README.md --output demo-rollup-readme.sh --tag test-ci - run: cat demo-rollup-readme.sh diff --git a/Cargo.lock b/Cargo.lock index 655ca63b1..37b4d6914 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8625,6 +8625,7 @@ dependencies = [ "serde", "serde_json", "sov-db", + "sov-ledger-rpc", "sov-modules-api", "sov-rollup-interface", "tempfile", diff --git a/Makefile b/Makefile index 3e2fd59d8..cd154eced 100644 --- a/Makefile +++ b/Makefile @@ -37,7 +37,7 @@ lint-fix: ## cargo fmt, fix and clippy. Skip clippy on guest code since it's no SKIP_GUEST_BUILD=1 cargo clippy --fix --allow-dirty check-features: ## Checks that project compiles with all combinations of features. - cargo hack check --workspace --feature-powerset --exclude-features --all-targets + cargo hack check --workspace --feature-powerset --exclude-features default --all-targets check-fuzz: ## Checks that fuzz member compiles $(MAKE) -C fuzz check diff --git a/full-node/sov-ledger-rpc/Cargo.toml b/full-node/sov-ledger-rpc/Cargo.toml index c74d76cea..1ca92e6a5 100644 --- a/full-node/sov-ledger-rpc/Cargo.toml +++ b/full-node/sov-ledger-rpc/Cargo.toml @@ -28,6 +28,7 @@ tempfile = "3" serde_json = "1" sov-db = { path = "../../full-node/db/sov-db" } tokio = { workspace = true, features = ["full"] } +sov-ledger-rpc = { path = ".", features = ["client", "server"] } [features] default = ["client", "server"] diff --git a/module-system/module-implementations/examples/sov-value-setter/Cargo.toml b/module-system/module-implementations/examples/sov-value-setter/Cargo.toml index 0b11abf11..76a98e0dc 100644 --- a/module-system/module-implementations/examples/sov-value-setter/Cargo.toml +++ b/module-system/module-implementations/examples/sov-value-setter/Cargo.toml @@ -15,6 +15,7 @@ publish = false [dev-dependencies] sov-value-setter = { path = ".", features = ["native"] } +sov-modules-api = { path = "../../../sov-modules-api", features = ["native"] } tempfile = { workspace = true } [dependencies] diff --git a/module-system/module-implementations/examples/sov-vec-setter/Cargo.toml b/module-system/module-implementations/examples/sov-vec-setter/Cargo.toml index 5adfa4f79..70ca7e37d 100644 --- a/module-system/module-implementations/examples/sov-vec-setter/Cargo.toml +++ b/module-system/module-implementations/examples/sov-vec-setter/Cargo.toml @@ -13,7 +13,7 @@ resolver = "2" publish = false [dev-dependencies] -sov-modules-api = { path = "../../../sov-modules-api" } +sov-modules-api = { path = "../../../sov-modules-api", features = ["native", "macros"] } tempfile = { workspace = true } [dependencies] diff --git a/module-system/module-implementations/examples/sov-vec-setter/tests/tests.rs b/module-system/module-implementations/examples/sov-vec-setter/tests/tests.rs index 8aa205472..f623ea215 100644 --- a/module-system/module-implementations/examples/sov-vec-setter/tests/tests.rs +++ b/module-system/module-implementations/examples/sov-vec-setter/tests/tests.rs @@ -27,7 +27,6 @@ fn test_cases() -> Vec<(Address, CallMessage, Option>)> { } #[test] -#[cfg(feature = "native")] fn test_vec_setter_calls() { let tmpdir = tempfile::tempdir().unwrap();