Skip to content

Commit 88413db

Browse files
committed
Merge remote-tracking branch 'origin/staging' into allow_tests_to_skip_proofs
2 parents e8cf23c + ea28380 commit 88413db

File tree

33 files changed

+1371
-287
lines changed

33 files changed

+1371
-287
lines changed

.circleci/config.yml

Lines changed: 125 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ orbs:
2323
executors:
2424
# The default docker image used in the main-workflow
2525
rust-docker:
26-
docker:
26+
docker:
2727
- image: cimg/rust:1.88.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well
2828

2929
commands:
@@ -35,32 +35,46 @@ commands:
3535
steps:
3636
- checkout
3737
- restore_cache:
38-
key: cargo-cache-{{ arch }}-{{ checksum "Cargo.lock" }}
38+
keys:
39+
- cargo-cache-{{ arch }}-{{ checksum "Cargo.lock" }}
40+
- cargo-cache-{{ arch }}-
3941
- run:
4042
name: "Install Rust"
43+
no_output_timeout: 15m
4144
command: |
45+
$ErrorActionPreference = "Stop"
4246
$ProgressPreference = "SilentlyContinue"
43-
# Remove the version of rustc that (might be) installed already..
44-
# Use non-interactive mode and force uninstall to prevent the job from getting stuck.
45-
choco uninstall rust -y --force
4647
47-
# Install rust with rustup.
48-
Invoke-WebRequest -Uri "https://win.rustup.rs/" -OutFile "C:\rustup-init.exe"
49-
& C:\rustup-init.exe -y --default-toolchain "1.88.0-x86_64-pc-windows-msvc" --no-modify-path --profile minimal # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well
48+
# Ensure rustup is installed
49+
if (-not (Get-Command rustup -ErrorAction SilentlyContinue)) {
50+
Write-Host "rustup not found, installing..."
51+
$rustupPath = "$env:TEMP\rustup-init.exe"
52+
Invoke-WebRequest -Uri "https://win.rustup.rs/" -OutFile $rustupPath
53+
& $rustupPath -y --default-toolchain "1.88.0-x86_64-pc-windows-msvc" --no-modify-path --profile minimal
54+
} else {
55+
Write-Host "rustup already installed, ensuring toolchain 1.88.0-x86_64-pc-windows-msvc is present..."
56+
rustup toolchain install 1.88.0-x86_64-pc-windows-msvc
57+
}
58+
59+
# Put cargo/rustup first in PATH for this step and subsequent steps
60+
$Env:Path = "$Env:USERPROFILE\.cargo\bin;$Env:Path"
61+
62+
# Select the toolchain
63+
rustup default 1.88.0-x86_64-pc-windows-msvc
5064
51-
# Add cargo to PATH
52-
$Env:Path += ";$Env:USERPROFILE\.cargo\bin"
5365
# Verify the installation.
5466
cargo --version --verbose
5567
rustc --version | Out-File -FilePath "rust-version"
68+
5669
if (!(Test-Path "Cargo.lock" -PathType Leaf)) {
5770
cargo generate-lockfile
5871
}
5972
- run:
6073
name: "Run cargo check"
6174
command: |
62-
# Add cargo to PATH
63-
$Env:Path += ";$Env:USERPROFILE\.cargo\bin"
75+
# Add cargo to PATH (for safety in case env is not carried perfectly)
76+
$Env:Path = "$Env:USERPROFILE\.cargo\bin;$Env:Path"
77+
6478
# Check that the given package compiles
6579
cd << parameters.workspace_member >>
6680
cargo check --examples --benches --tests
@@ -69,44 +83,69 @@ commands:
6983
- C:\Users\circleci\.cargo\registry
7084
- C:\Users\circleci\.cargo\git
7185
- target
72-
key: cargo-cache-{{ arch }}-{{ checksum "rust-version" }}-{{ checksum "Cargo.lock" }}
86+
key: cargo-cache-{{ arch }}-{{ checksum "Cargo.lock" }}
7387

7488
setup_environment:
7589
description: "Setup testing environment"
7690
parameters:
7791
cache_key:
7892
type: string
79-
default: v4.2.0-rust-1.88.0-snarkvm-stable-cache
93+
default: v4.2.0-rust-1.88.0-snarkvm-cache
94+
8095
steps:
81-
- run: set -e
8296
- run:
8397
name: Prepare environment variables and install dependencies
8498
command: |
85-
echo 'export "RUSTC_WRAPPER"="$CIRCLE_WORKING_DIRECTORY/.bin/sccache"' >> $BASH_ENV
86-
echo 'export "SCCACHE_CACHE_SIZE"="20000M"' >> $BASH_ENV
99+
# Make sure our local bin and cargo bin are on PATH
100+
echo 'export PATH="$HOME/.cargo/bin:$CIRCLE_WORKING_DIRECTORY/.bin:$PATH"' >> "$BASH_ENV"
101+
102+
# sccache settings
103+
echo 'export SCCACHE_DIR="$HOME/.cache/sccache"' >> "$BASH_ENV"
104+
echo 'export SCCACHE_CACHE_SIZE="20000M"' >> "$BASH_ENV"
105+
echo 'export SCCACHE_IDLE_TIMEOUT=0' >> "$BASH_ENV" # keep server alive
106+
echo 'export SCCACHE_LOG=info' >> "$BASH_ENV"
87107
88-
# Disable incremental builds so that sccache works as expected
108+
# Disable incremental builds so sccache behaves nicely
89109
echo 'export CARGO_INCREMENTAL=0' >> "$BASH_ENV"
110+
111+
# Use sccache for *all* Rust compile commands
112+
echo 'export RUSTC_WRAPPER="sccache"' >> "$BASH_ENV"
113+
114+
#mkdir -p .cargo
115+
#printf '%s\n' \
116+
# '[build]' \
117+
# 'rustc-wrapper = "/home/circleci/project/.bin/sccache"' \
118+
# > .cargo/config.toml
119+
90120
- run:
91121
name: Install sccache
92122
command: |
93-
export WORK_DIR="$CIRCLE_WORKING_DIRECTORY/.cache/sccache"
94-
export SCCACHE_DIR="$CIRCLE_WORKING_DIRECTORY/.cache/sccache"
123+
export WORK_DIR="$HOME/.cache/sccache"
124+
export SCCACHE_DIR="$HOME/.cache/sccache"
95125
export SCCACHE_VERSION=v0.10.0
96126
export SCCACHE_PKG="sccache-$SCCACHE_VERSION-x86_64-unknown-linux-musl"
97-
127+
98128
mkdir -p "$CIRCLE_WORKING_DIRECTORY/.bin"
99-
wget "https://github.com/mozilla/sccache/releases/download/$SCCACHE_VERSION/$SCCACHE_PKG.tar.gz"
100-
tar -C "$CIRCLE_WORKING_DIRECTORY/.bin" -xvf "$SCCACHE_PKG.tar.gz"
101-
chmod +x "$CIRCLE_WORKING_DIRECTORY/.bin/$SCCACHE_PKG/sccache"
102-
mv "$CIRCLE_WORKING_DIRECTORY/.bin/$SCCACHE_PKG/sccache" "$CIRCLE_WORKING_DIRECTORY/.bin/sccache"
103-
rm -rf "$CIRCLE_WORKING_DIRECTORY/.cargo/registry"
129+
mkdir -p "$HOME/.cache/sccache"
130+
if [ ! -x "$CIRCLE_WORKING_DIRECTORY/.bin/sccache" ]; then
131+
wget "https://github.com/mozilla/sccache/releases/download/$SCCACHE_VERSION/$SCCACHE_PKG.tar.gz"
132+
tar -C "$CIRCLE_WORKING_DIRECTORY/.bin" -xvf "$SCCACHE_PKG.tar.gz"
133+
chmod +x "$CIRCLE_WORKING_DIRECTORY/.bin/$SCCACHE_PKG/sccache"
134+
mv "$CIRCLE_WORKING_DIRECTORY/.bin/$SCCACHE_PKG/sccache" "$CIRCLE_WORKING_DIRECTORY/.bin/sccache"
135+
rm -rf "$CIRCLE_WORKING_DIRECTORY/.cargo/registry"
136+
fi
104137
105138
- run:
106139
name: Install debian packages
107140
command: |
108141
DEBIAN_FRONTEND=noninteractive sudo apt-get update
109142
DEBIAN_FRONTEND=noninteractive sudo apt-get install -y --no-install-recommends clang llvm-dev llvm lld pkg-config xz-utils make libssl-dev libssl-dev
143+
144+
- restore_cache:
145+
keys:
146+
- v4.2.0-rust-1.88.0-deps-{{ checksum "Cargo.lock" }}-
147+
- v4.2.0-rust-1.88.0-deps-
148+
110149
- restore_cache:
111150
keys:
112151
- << parameters.cache_key >>
@@ -116,16 +155,22 @@ commands:
116155
parameters:
117156
cache_key:
118157
type: string
119-
default: v4.2.0-rust-1.88.0-snarkvm-stable-cache
158+
default: v4.2.0-rust-1.88.0-snarkvm-cache
120159
steps:
121-
- run: (sccache -s || true)
122160
- run: set +e
161+
- save_cache:
162+
key: v4.2.0-rust-1.88.0-deps-{{ checksum "Cargo.lock" }}-{{ epoch }}
163+
paths:
164+
- /home/circleci/.cache/sccache
165+
- /home/circleci/.cargo/registry
166+
- /home/circleci/.cargo/git
167+
- /home/circleci/.rustup
168+
- /home/circleci/.cargo/bin
169+
- /home/circleci/project/.bin
123170
- save_cache:
124171
key: << parameters.cache_key >>
125172
paths:
126173
- /home/circleci/project/target
127-
- /home/circleci/.cache/sccache
128-
- /home/circleci/.cargo
129174
- /home/circleci/.aleo/resources
130175

131176
run_test:
@@ -150,10 +195,26 @@ commands:
150195
- setup_environment:
151196
cache_key: v4.2.0-rust-1.88.0-<< parameters.workspace_member >><< parameters.cache_key_suffix >>-cache
152197

198+
153199
- run:
154200
name: Install cargo-nextest
155201
command: |
156-
cargo install cargo-nextest --locked || true
202+
set -euo pipefail
203+
204+
BIN_ROOT="$CIRCLE_WORKING_DIRECTORY/.bin"
205+
mkdir -p "$BIN_ROOT"
206+
207+
export PATH="$HOME/.cargo/bin:$PATH"
208+
if ! command -v cargo-nextest >/dev/null 2>&1; then
209+
cargo install cargo-nextest --locked
210+
fi
211+
212+
- run:
213+
name: Debug rustc wrapper
214+
command: |
215+
echo "RUSTC_WRAPPER=${RUSTC_WRAPPER:-<unset>}"
216+
which sccache || echo "sccache not found on PATH"
217+
which rustc || echo "rustc not found on PATH"
157218
158219
- run:
159220
name: "Run Tests"
@@ -163,6 +224,18 @@ commands:
163224
set -euo pipefail
164225
export CARGO_TERM_COLOR=never
165226
227+
echo "[debug] PATH=$PATH"
228+
echo "[debug] RUSTC_WRAPPER=${RUSTC_WRAPPER:-<unset>}"
229+
which sccache || echo "[debug] sccache not found on PATH"
230+
which rustc || echo "[debug] rustc not found on PATH"
231+
echo "[debug] SCCACHE_DIR=${SCCACHE_DIR:-<unset>}"
232+
echo "[debug] SCCACHE_LOG=${SCCACHE_LOG:-<unset>}"
233+
echo "[debug] SCCACHE_IDLE_TIMEOUT=${SCCACHE_IDLE_TIMEOUT:-<unset>}"
234+
235+
"$CIRCLE_WORKING_DIRECTORY/.bin/sccache" --zero-stats || true
236+
echo "[sccache stats BEFORE nextest]"
237+
"$CIRCLE_WORKING_DIRECTORY/.bin/sccache" -s || true
238+
166239
# Create artifact + nextest output directories
167240
mkdir -p artifacts target/nextest/ci
168241
@@ -248,9 +321,8 @@ commands:
248321
fi
249322
fi
250323
251-
DEFAULT_JOBS=12
324+
DEFAULT_JOBS=8
252325
253-
# Default JOBS, overridden by TEST_THREADS if set
254326
JOBS="${NEXTEST_JOBS:-$DEFAULT_JOBS}"
255327
if [ -n "$TEST_THREADS" ]; then
256328
JOBS="$TEST_THREADS"
@@ -286,7 +358,8 @@ commands:
286358
RUST_MIN_STACK=67108864 cargo test --package="<< parameters.workspace_member >>" $BUILD_FLAGS_SANITIZED | tee "$OUT"
287359
: > "$CSV"; : > "$TOP"
288360
else
289-
RUST_MIN_STACK=67108864 cargo nextest run \
361+
RUST_MIN_STACK=67108864 \
362+
cargo nextest run \
290363
-p "<< parameters.workspace_member >>" $BUILD_FLAGS_SANITIZED \
291364
--profile ci -j "${JOBS}" "${CFG_ARGS[@]}" \
292365
--status-level fail --hide-progress-bar \
@@ -314,6 +387,9 @@ commands:
314387
fi
315388
fi
316389
390+
echo "[sccache stats AFTER nextest]"
391+
"$CIRCLE_WORKING_DIRECTORY/.bin/sccache" -s || true
392+
317393
- store_artifacts:
318394
path: artifacts
319395
destination: test-timings/<< parameters.workspace_member >>
@@ -339,7 +415,7 @@ jobs:
339415
workspace_member: snarkvm
340416

341417
algorithms:
342-
executor: rust-docker
418+
executor: rust-docker
343419
resource_class: << pipeline.parameters.large >>
344420
steps:
345421
- run_test:
@@ -349,11 +425,11 @@ jobs:
349425
executor: rust-docker
350426
resource_class: << pipeline.parameters.medium >>
351427
steps:
352-
- run_test: # This runs a single test with profiler enabled
428+
- run_test:
353429
workspace_member: snarkvm-algorithms
354430
flags: varuna::prove_and_verify_with_square_matrix --features profiler
355431
cache_key_suffix: -profiler-test
356-
432+
357433
circuit:
358434
executor: rust-docker
359435
resource_class: << pipeline.parameters.small >>
@@ -608,21 +684,21 @@ jobs:
608684

609685
ledger-with-rocksdb-partition1:
610686
executor: rust-docker
611-
resource_class: << pipeline.parameters.large >>
687+
resource_class: << pipeline.parameters.xlarge >>
612688
steps:
613689
- run_test:
614690
workspace_member: snarkvm-ledger
615-
flags: --release --features=rocks --partition count:1/2 -- --test-threads=8
691+
flags: --release --features=rocks --partition count:1/2 -- --test-threads=10
616692
no_output_timeout: 20m
617693
timeout: 30m
618694

619695
ledger-with-rocksdb-partition2:
620696
executor: rust-docker
621-
resource_class: << pipeline.parameters.large >>
697+
resource_class: << pipeline.parameters.xlarge >>
622698
steps:
623699
- run_test:
624700
workspace_member: snarkvm-ledger
625-
flags: --release --features=rocks --partition count:2/2 -- --test-threads=8
701+
flags: --release --features=rocks --partition count:2/2 -- --test-threads=10
626702
no_output_timeout: 20m
627703
timeout: 30m
628704

@@ -732,7 +808,6 @@ jobs:
732808
executor: rust-docker
733809
resource_class: << pipeline.parameters.twoxlarge >>
734810
steps:
735-
736811
- run_test:
737812
workspace_member: snarkvm-ledger-store
738813
flags: --features=rocks
@@ -796,7 +871,7 @@ jobs:
796871
flags: >
797872
--lib --bins --features test
798873
--partition count:1/2
799-
-- --test-threads 16
874+
-- --test-threads 8
800875
cache_key_suffix: -test1
801876
timeout: 25m
802877

@@ -809,19 +884,10 @@ jobs:
809884
flags: >
810885
--lib --bins --features test
811886
--partition count:2/2
812-
-- --test-threads 16
887+
-- --test-threads 8
813888
cache_key_suffix: -test2
814889
timeout: 25m
815890

816-
# synthesizer-mem-heavy:
817-
# executor: rust-docker
818-
# resource_class: << pipeline.parameters.twoxlarge >>
819-
# steps:
820-
# - run_test:
821-
# workspace_member: snarkvm-synthesizer
822-
# flags: -- --ignored test_deployment_synthesis_overload test_deep_nested_execution_cost
823-
# cache_key_suffix: -mem-heavy
824-
825891
synthesizer-integration:
826892
executor: rust-docker
827893
resource_class: << pipeline.parameters.twoxlarge >>
@@ -997,7 +1063,10 @@ jobs:
9971063
name: Check for unused dependencies
9981064
no_output_timeout: 10m
9991065
command: |
1000-
cargo install [email protected]
1066+
set -euo pipefail
1067+
if ! command -v cargo-machete >/dev/null 2>&1; then
1068+
cargo install [email protected] --locked
1069+
fi
10011070
cargo machete
10021071
- clear_environment:
10031072
cache_key: v4.2.0-rust-1.88.0-machete-cache
@@ -1022,7 +1091,8 @@ jobs:
10221091
executor: rust-docker
10231092
resource_class: << pipeline.parameters.twoxlarge >>
10241093
steps:
1025-
- checkout
1094+
- checkout:
1095+
method: full
10261096
- setup_environment:
10271097
cache_key: v4.2.0-rust-1.88.0-cargo-semver-checks-cache
10281098
- run:
@@ -1158,7 +1228,6 @@ workflows:
11581228
- synthesizer
11591229
- synthesizer-test-partition1
11601230
- synthesizer-test-partition2
1161-
# - synthesizer-mem-heavy
11621231
- synthesizer-integration
11631232
- synthesizer-process
11641233
- synthesizer-process-with-rocksdb

.circleci/semver-checks.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Ensure that the command is installed.
44
cargo install [email protected] --locked
55

6-
BASELINE_REV=d25622e60 # UPDATE ME ON NECESSARY BREAKING CHANGES
6+
BASELINE_REV=dec54170ce # UPDATE ME ON NECESSARY BREAKING CHANGES
77

88
# Exclude CLI as it has been removed
99
cargo semver-checks --workspace --default-features \

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Thank you for submitting the PR! We appreciate you spending the time to work on these changes!
1+
<!-- Thank you for submitting the PR! We appreciate you spending the time to work on these changes! -->
22

33
## Motivation
44

0 commit comments

Comments
 (0)