Skip to content

Commit 10759d4

Browse files
authored
Merge pull request #4022 from ProvableHQ/release-mainnet-4.4.0
[Release] Mainnet 4.4.0
2 parents 8d710d7 + 3bf1d5d commit 10759d4

File tree

106 files changed

+3004
-2091
lines changed

Some content is hidden

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

106 files changed

+3004
-2091
lines changed

.cargo/audit.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,6 @@ ignore = [
55
"RUSTSEC-2024-0436",
66
# TODO find a suitable replacement for fxhash.
77
"RUSTSEC-2025-0057",
8+
# TODO remove once newer versions of tracing-sbuscriber support colored logs again.
9+
"RUSTSEC-2025-0055",
810
]

.ci/devnet_ci.sh

Lines changed: 43 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ trap 'echo "⛔️ Error in $BASH_SOURCE at line $LINENO: \"$BASH_COMMAND\" fail
5050
# Flags used by all ndoes
5151
common_flags=(
5252
--nodisplay --nobanner --noupdater "--network=$network_id" --verbosity=1
53-
--allow-external-peers "--dev-num-validators=$total_validators"
53+
"--dev-num-validators=$total_validators"
5454
)
5555

5656
# Start all validator nodes in the background
@@ -134,7 +134,8 @@ done
134134

135135
# Creates a test program.
136136
mkdir -p program
137-
echo "program test_program.aleo;
137+
program_name="test_program.aleo"
138+
echo "program ${program_name};
138139
139140
function main:
140141
input r0 as u32.public;
@@ -147,7 +148,7 @@ constructor:
147148
" > program/main.aleo
148149

149150
echo "{
150-
\"program\": \"test_program.aleo\",
151+
\"program\": \"${program_name}\",
151152
\"version\": \"0.1.0\",
152153
\"description\": \"\",
153154
\"license\": \"\",
@@ -157,12 +158,48 @@ echo "{
157158
" > program/program.json
158159

159160
# Deploy the test program and wait for the deployment to be processed.
160-
_deploy_result=$(cd program && snarkos developer deploy --dev-key 0 --network "$network_id" --endpoint=localhost:3030 --broadcast --wait --timeout 10 test_program.aleo)
161+
_deploy_result=$(cd program && snarkos developer deploy --dev-key 0 --network "$network_id" --endpoint=localhost:3030 --broadcast --wait --timeout 10 "$program_name")
162+
163+
# Ensure we are able to fetch the program fromn the node.
164+
status_code=$(curl -s -o /dev/null -w "%{http_code}" "http://localhost:3030/v2/$network_name/program/${program_name}/0")
165+
if (( status_code == 200 )); then
166+
echo "✅ Program exists on the node"
167+
else
168+
echo "❌ Test failed! Failed to get program. Code was ${status_code}"
169+
exit 1
170+
fi
171+
172+
# Ensure the latest edition is indeed 0.
173+
edition=$(curl -s -o /dev/null "http://localhost:3030/v2/$network_name/program/${program_name}/latest_edition")
174+
if (( edition == 0 )); then
175+
echo "✅ Only program edition 0 exists on the node"
176+
else
177+
echo "❌ Test failed! Invalid latest edition {} for test program returned, not 0."
178+
exit 1
179+
fi
180+
181+
# Also check that the latest edition for the default program (credits.aleo) is 0.
182+
edition=$(curl -s -o /dev/null "http://localhost:3030/v2/$network_name/program/credits.aleo/latest_edition")
183+
if (( edition == 0 )); then
184+
echo "✅ Only program edition 0 exists on the node"
185+
else
186+
echo "❌ Test failed! Invalid latest edition {} for credits.aleo returned, not 0."
187+
exit 1
188+
fi
189+
190+
# Finally, check that we cannot fetch a non-existing edition of a program
191+
status_code=$(curl -s -o /dev/null -w "%{http_code}" "http://localhost:3030/v2/$network_name/program/${program_name}/1")
192+
if (( status_code == 404 )); then
193+
echo "✅ Only program edition 0 exists on the node"
194+
else
195+
echo "❌ Test failed! Invalid edition returnd ${status}, not 404."
196+
exit 1
197+
fi
161198

162199
# Execute a function in the deployed program and wait for the execution to be processed.
163200
# Use the old flags here `--query` and `--broadcast=URL` to test they still work.
164201
# Also, use the v1 API to test it still works.
165-
execute_result=$(cd program && snarkos developer execute --dev-key 0 --network "$network_id" --query=localhost:3030 "--broadcast=http://localhost:3030/v1/$network_name/transaction/broadcast" test_program.aleo main 1u32 1u32 --wait --timeout 10)
202+
execute_result=$(cd program && snarkos developer execute --dev-key 0 --network "$network_id" --query=localhost:3030 "--broadcast=http://localhost:3030/v1/$network_name/transaction/broadcast" "$program_name" main 1u32 1u32 --wait --timeout 10)
166203

167204
# Fail if the execution transaction does not exist.
168205
tx=$(echo "$execute_result" | tail -n 1)
@@ -190,7 +227,7 @@ echo "ℹ️Testing REST API and REST Error Handling"
190227
# Test invalid transaction data (JsonDataError) returns 422 Unprocessable Content
191228
echo "Testing invalid transaction data returns 422 status code..."
192229
(cd program && snarkos developer execute --dev-key 0 --network "$network_id" --endpoint=localhost:3030 \
193-
--store txn_data.json --store-format=string test_program.aleo main 1u32 1u32)
230+
--store txn_data.json --store-format=string "$program_name" main 1u32 1u32)
194231

195232
# Modify the proof data
196233
# This changes the last three characters in the hash but keeps the correct length.

.ci/generate_ledger.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ trap 'echo "⛔️ Error in $BASH_SOURCE at line $LINENO: \"$BASH_COMMAND\" fail
5050

5151
# Flags used by all ndoes
5252
common_flags=(--nodisplay --nobanner --noupdater "--network=$network_id"
53-
"--log-filter=$log_filter" --allow-external-peers "--dev-num-validators=$total_validators")
53+
"--log-filter=$log_filter" "--dev-num-validators=$total_validators")
5454

5555
# Start all validator nodes in the background
5656
for ((validator_index = 0; validator_index < total_validators; validator_index++)); do

.circleci/config.yml

Lines changed: 44 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -77,26 +77,32 @@ commands:
7777
parameters:
7878
cache_key:
7979
type: string
80-
default: v3.3.1-rust-1.88.0-snarkos-stable-cache
80+
default: v4.2.0-rust-1.88.0-snarkos-stable-cache
8181
steps:
8282
- run: set -e
83+
- run:
84+
name: Prepare environment variables
85+
command: |
86+
# Note: sccache cache is disabled for now
87+
# it causes longer build times and causes some builds to fail
88+
89+
# echo 'export "RUSTC_WRAPPER"="$HOME/.bin/sccache"' >> $BASH_ENV
90+
# echo 'export "SCCACHE_CACHE_SIZE"="20000M"' >> $BASH_ENV
91+
# Disable incremental builds so that sccache works as expected
92+
# echo 'export CARGO_INCREMENTAL=0' >> "$BASH_ENV"
8393
- run:
8494
name: Install sccache
8595
command: |
86-
export WORK_DIR="$CIRCLE_WORKING_DIRECTORY/.cache/sccache"
87-
export SCCACHE_DIR="$CIRCLE_WORKING_DIRECTORY/.cache/sccache"
96+
export SCCACHE_DIR="$HOME/.cache/sccache"
8897
export SCCACHE_VERSION=v0.10.0
8998
export SCCACHE_PKG="sccache-$SCCACHE_VERSION-x86_64-unknown-linux-musl"
9099
91-
mkdir -p "$CIRCLE_WORKING_DIRECTORY/.bin"
100+
mkdir -p "$HOME/.bin"
92101
wget "https://github.com/mozilla/sccache/releases/download/$SCCACHE_VERSION/$SCCACHE_PKG.tar.gz"
93-
tar -C "$CIRCLE_WORKING_DIRECTORY/.bin" -xvf "$SCCACHE_PKG.tar.gz"
94-
chmod +x "$CIRCLE_WORKING_DIRECTORY/.bin/$SCCACHE_PKG/sccache"
95-
mv "$CIRCLE_WORKING_DIRECTORY/.bin/$SCCACHE_PKG/sccache" "$CIRCLE_WORKING_DIRECTORY/.bin/sccache"
96-
rm -rf "$CIRCLE_WORKING_DIRECTORY/.cargo/registry"
97-
98-
export PATH="$PATH:$CIRCLE_WORKING_DIRECTORY/.bin"
99-
export RUSTC_WRAPPER="sccache"
102+
tar -C "$HOME/.bin" -xvf "$SCCACHE_PKG.tar.gz"
103+
chmod +x "$HOME/.bin/$SCCACHE_PKG/sccache"
104+
mv "$HOME/.bin/$SCCACHE_PKG/sccache" "$HOME/.bin/sccache"
105+
rm -rf "$HOME/.cargo/registry"
100106
- run:
101107
name: Install Debian packages
102108
command: |
@@ -111,15 +117,19 @@ commands:
111117
parameters:
112118
cache_key:
113119
type: string
114-
default: v3.3.1-rust-1.88.0-snarkos-stable-cache
120+
default: v4.2.0-rust-1.88.0-snarkos-stable-cache
115121
steps:
116-
- run: (sccache -s||true)
117122
- run: set +e
123+
- run:
124+
name: "Show sccache statistics"
125+
command: $HOME/.bin/sccache -s
118126
- save_cache:
119127
key: << parameters.cache_key >>
120128
paths:
121-
- .cache/sccache
122-
- .cargo
129+
# Store the sccache files
130+
- ~/.cache/sccache
131+
# Store the cargo registry
132+
- ~/.cargo
123133

124134
run_serial:
125135
description: "Build and run tests"
@@ -134,12 +144,17 @@ commands:
134144
steps:
135145
- checkout
136146
- setup_environment:
137-
cache_key: v3.3.1-rust-1.88.0-<< parameters.cache_key >>-cache
147+
cache_key: v4.2.0-rust-1.88.0-<< parameters.cache_key >>-cache
138148
- run:
149+
name: "Build tests"
150+
no_output_timeout: 30m
151+
command: cd << parameters.workspace_member >> && RUST_MIN_STACK=67108864 cargo test << parameters.flags >> --no-run
152+
- run:
153+
name: "Run tests"
139154
no_output_timeout: 30m
140155
command: cd << parameters.workspace_member >> && RUST_MIN_STACK=67108864 cargo test << parameters.flags >>
141156
- clear_environment:
142-
cache_key: v3.3.1-rust-1.88.0-<< parameters.cache_key >>-cache
157+
cache_key: v4.2.0-rust-1.88.0-<< parameters.cache_key >>-cache
143158

144159
run_serial_long:
145160
description: "Build and run long running tests"
@@ -297,7 +312,7 @@ jobs:
297312

298313
node-router:
299314
executor: rust-docker
300-
resource_class: << pipeline.parameters.large >>
315+
resource_class: << pipeline.parameters.xlarge >>
301316
steps:
302317
- run_serial:
303318
workspace_member: node/router
@@ -349,7 +364,7 @@ jobs:
349364
steps:
350365
- run_devnet:
351366
workspace_member: .
352-
cache_key: v3.3.1-rust-1.88.0-devnet-test-cache
367+
cache_key: v4.2.0-rust-1.88.0-devnet-test-cache
353368

354369
# Check crates that do not have any tests individually
355370
check-other-crates:
@@ -358,7 +373,7 @@ jobs:
358373
steps:
359374
- checkout
360375
- setup_environment:
361-
cache_key: v3.3.1-rust-1.88.0-check-other-crates-cache
376+
cache_key: v4.2.0-rust-1.88.0-check-other-crates-cache
362377
- run:
363378
name: Check snarkos-node-metrics crate
364379
no_output_timeout: 10m
@@ -368,7 +383,7 @@ jobs:
368383
no_output_timeout: 10m
369384
command: cargo check --package=snarkos-node-metrics --all-features
370385
- clear_environment:
371-
cache_key: v3.3.1-rust-1.88.0-check-other-crates-cache
386+
cache_key: v4.2.0-rust-1.88.0-check-other-crates-cache
372387

373388
check-fmt:
374389
executor: rust-docker
@@ -377,61 +392,61 @@ jobs:
377392
- checkout
378393
- install_rust_nightly
379394
- setup_environment:
380-
cache_key: v3.3.1-rust-1.88.0-fmt-cache
395+
cache_key: v4.2.0-rust-1.88.0-fmt-cache
381396
- run:
382397
name: Check style
383398
no_output_timeout: 35m
384399
command: cargo +nightly fmt --all -- --check
385400
- clear_environment:
386-
cache_key: v3.3.1-rust-1.88.0-fmt-cache
401+
cache_key: v4.2.0-rust-1.88.0-fmt-cache
387402

388403
check-unused-dependencies:
389404
executor: rust-docker
390405
resource_class: << pipeline.parameters.medium >>
391406
steps:
392407
- checkout
393408
- setup_environment:
394-
cache_key: v3.3.1-rust-1.88.0-machete-cache
409+
cache_key: v4.2.0-rust-1.88.0-machete-cache
395410
- run:
396411
name: Check for unused dependencies
397412
no_output_timeout: 10m
398413
command: |
399414
cargo install [email protected]
400415
cargo machete
401416
- clear_environment:
402-
cache_key: v3.3.1-rust-1.88.0-machete-cache
417+
cache_key: v4.2.0-rust-1.88.0-machete-cache
403418

404419
check-cargo-audit:
405420
executor: rust-docker
406421
resource_class: << pipeline.parameters.medium >>
407422
steps:
408423
- checkout
409424
- setup_environment:
410-
cache_key: v3.3.1-rust-1.88.0-cargo-audit-cache
425+
cache_key: v4.2.0-rust-1.88.0-cargo-audit-cache
411426
- run:
412427
name: Check for security vulnerabilities
413428
no_output_timeout: 10m
414429
command: |
415430
cargo install [email protected] --locked
416431
cargo audit -D warnings
417432
- clear_environment:
418-
cache_key: v3.3.1-rust-1.88.0-cargo-audit-cache
433+
cache_key: v4.2.0-rust-1.88.0-cargo-audit-cache
419434

420435
check-clippy:
421436
executor: rust-docker
422437
resource_class: << pipeline.parameters.medium >>
423438
steps:
424439
- checkout
425440
- setup_environment:
426-
cache_key: v3.3.1-rust-1.88.0-clippy-cache
441+
cache_key: v4.2.0-rust-1.88.0-clippy-cache
427442
- run:
428443
name: Check lint
429444
no_output_timeout: 35m
430445
command: |
431446
cargo clippy --workspace --all-targets -- -D warnings
432447
cargo clippy --workspace --all-targets --all-features -- -D warnings
433448
- clear_environment:
434-
cache_key: v3.3.1-rust-1.88.0-clippy-cache
449+
cache_key: v4.2.0-rust-1.88.0-clippy-cache
435450

436451
verify-windows:
437452
executor:

.devnet/start.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ start_snarkos_in_tmux() {
4343
tmux new-session -d -s snarkos-session
4444
4545
# Send the snarkOS start command to the tmux session with the NODE_ID
46-
tmux send-keys -t "snarkos-session" "snarkos start --nodisplay --bft 0.0.0.0:5000 --rest 0.0.0.0:3030 --allow-external-peers --peers $NODE_IP:4130 --validators $NODE_IP:5000 --rest-rps 1000 --verbosity $VERBOSITY --network $NETWORK_ID --dev $NODE_ID --dev-num-validators $NUM_INSTANCES --validator --metrics" C-m
46+
tmux send-keys -t "snarkos-session" "snarkos start --nodisplay --bft 0.0.0.0:5000 --rest 0.0.0.0:3030 --peers $NODE_IP:4130 --validators $NODE_IP:5000 --rest-rps 1000 --verbosity $VERBOSITY --network $NETWORK_ID --dev $NODE_ID --dev-num-validators $NUM_INSTANCES --validator --metrics" C-m
4747
4848
exit # Exit root user
4949
EOF

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
1-
<!-- Thank you for filing a PR! Help us understand by explaining your changes. Happy contributing! -->
1+
Thank you for submitting the PR! We appreciate you spending the time to work on these changes!
22

33
## Motivation
44

5-
(Write your motivation here)
5+
Write your motivation here, make sure to link related issues and PRs.
66

77
## Test Plan
88

9-
(If you changed any code, please provide clear instructions on how you verified your changes work.)
9+
If you changed any code, please provide us with clear instructions on how you verified your changes work. Bonus points for screenshots and videos!
1010

11-
## Related PRs
11+
## Documentation
1212

13-
(Link any related PRs here)
13+
If this PR adds or changes functionality, consider clarifying which docs need to be updated, e.g. on [AleoNet/welcome](https://github.com/AleoNet/welcome).
14+
15+
## Backwards compatibility
16+
17+
Please review backwards compatibility. Does any functionality need to be guarded by an existing or new `ConsensusVersion`?

0 commit comments

Comments
 (0)