-
Notifications
You must be signed in to change notification settings - Fork 144
ci(l1,l2): add required check for outdated Cargo.lock #5722
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds a new CI check to the L1 workflow to ensure that Cargo.lock files for zkVM backends and TEE quote-gen remain up-to-date in the main branch. This prevents issues that can occur when dependencies are added to crates that are dependencies of zkVM backends, but the corresponding Cargo.lock files aren't updated.
Key changes:
- Adds
check-guest-program-cargo-lockjob that runsmake update-cargo-lockand verifies no diffs exist in the Cargo.lock files - Integrates this new job as a dependency of the
all-testsrequired check job
Comments suppressed due to low confidence (1)
.github/workflows/pr-main_l1.yaml:350
- The
all-testsjob's conditional logic and success check are incomplete. The job was updated to depend oncheck-guest-program-cargo-lock, but:
- The
ifcondition at line 338 doesn't check ifcheck-guest-program-cargo-lockwas skipped (unlike the checks forrun-assertoorandrun-hive) - The steps section (lines 340-350) doesn't verify that
check-guest-program-cargo-locksucceeded
This means if check-guest-program-cargo-lock fails, the all-tests job could still pass, defeating the purpose of adding this required check. Add a condition like && needs.check-guest-program-cargo-lock.result != 'skipped' to line 338, and add a success check in the steps section similar to the ones for other jobs.
needs: [detect-changes, run-assertoor, run-hive, check-guest-program-cargo-lock]
# Make sure this job runs even if the previous jobs failed or were skipped
if: ${{ needs.detect-changes.outputs.run_tests == 'true' && always() && needs.run-assertoor.result != 'skipped' && needs.run-hive.result != 'skipped' }}
steps:
- name: Check if any job failed
run: |
if [ "${{ needs.run-assertoor.result }}" != "success" ]; then
echo "Job Assertoor Tx Check failed"
exit 1
fi
if [ "${{ needs.run-hive.result }}" != "success" ]; then
echo "Job Hive failed"
exit 1
fi
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
.github/workflows/pr-main_l1.yaml
Outdated
| - name: Update Cargo.lock files | ||
| run: | | ||
| make update-cargo-lock | ||
| - name: Check Cargo.lock files are committed | ||
| run: | | ||
| git diff --exit-code -- \ | ||
| crates/l2/prover/src/guest_program/src/sp1/Cargo.lock \ | ||
| crates/l2/prover/src/guest_program/src/risc0/Cargo.lock \ | ||
| crates/l2/prover/src/guest_program/src/zisk/Cargo.lock \ | ||
| crates/l2/prover/src/guest_program/src/openvm/Cargo.lock \ | ||
| crates/l2/tee/quote-gen/Cargo.lock |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cargo check --locked already does this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right! changed here 96eb2b6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a bit slower though
022819e to
96eb2b6
Compare
Benchmark Results ComparisonNo significant difference was registered for any benchmark run. Detailed ResultsBenchmark Results: BubbleSort
Benchmark Results: ERC20Approval
Benchmark Results: ERC20Mint
Benchmark Results: ERC20Transfer
Benchmark Results: Factorial
Benchmark Results: FactorialRecursive
Benchmark Results: Fibonacci
Benchmark Results: FibonacciRecursive
Benchmark Results: ManyHashes
Benchmark Results: MstoreBench
Benchmark Results: Push
Benchmark Results: SstoreBench_no_opt
|
Motivation
We don't want to have in main outdated
Cargo.locks. This can happen if a dependency is added in a crate that is a dependency of any zkVM backendDescription
update-cargo-lockcheck-cargo-lockmake check-cargo-lockon every PR to ensure allCargo.locks are up to date.You can check a test run here