-
Notifications
You must be signed in to change notification settings - Fork 182
chore(ci): update f3 snapshot to speed up f3 checks #6036
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
WalkthroughUpdated F3 snapshot reference and certificate instance IDs in scripts/tests/harness.sh: changed the F3 snapshot filename to f3_snap_calibnet_622579.bin and adjusted instance checks/messages from 550000 to 622000. No function signatures or public interfaces were modified. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
Suggested reviewers
✨ Finishing Touches
🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
🧹 Nitpick comments (2)
scripts/tests/harness.sh (2)
30-47: Parameterize and verify the F3 snapshot; add checksum and retry hygiene.Hardcoding the URL and instance invites silent drift. Let’s: (a) make the URL/instance overridable via env vars; (b) fail fast if the header’s instance doesn’t match what the test expects; (c) add basic retries/timeouts and an optional SHA256 to keep CI deterministic. This aligns with your “fail fast” preference from prior PRs.
Apply:
function forest_download_and_import_snapshot_with_f3 { echo "Downloading v1 snapshot" aria2c -x5 https://forest-archive.chainsafe.dev/latest/calibnet/ -o v1.forest.car.zst echo "Inspecting v1 snapshot" $FOREST_TOOL_PATH archive info v1.forest.car.zst echo "Downloading F3 snapshot" - aria2c -x5 https://forest-snapshots.fra1.cdn.digitaloceanspaces.com/f3/f3_snap_calibnet_622579.bin -o f3.bin + # Allow overriding in CI: F3_SNAPSHOT_URL, F3_EXPECTED_CERT_INSTANCE, F3_SNAPSHOT_SHA256 + : "${F3_SNAPSHOT_URL:=https://forest-snapshots.fra1.cdn.digitaloceanspaces.com/f3/f3_snap_calibnet_622579.bin}" + : "${F3_EXPECTED_CERT_INSTANCE:=622000}" + aria2c -x5 --timeout=30 --retry-wait=5 --max-tries=5 --conditional-get=true "$F3_SNAPSHOT_URL" -o f3.bin + if [ -n "${F3_SNAPSHOT_SHA256:-}" ]; then + echo "${F3_SNAPSHOT_SHA256} f3.bin" | sha256sum -c - + fi echo "Inspecting F3 snapshot" - $FOREST_TOOL_PATH archive f3-header f3.bin + F3_HEADER=$($FOREST_TOOL_PATH archive f3-header f3.bin) + echo "$F3_HEADER" + # Fail fast if header instance doesn’t match the expected cert instance (prevents mixing incompatible assets). + F3_HEADER_INSTANCE=$(printf "%s\n" "$F3_HEADER" | grep -i 'instance' | awk '{print $NF}') + if [ -n "$F3_HEADER_INSTANCE" ] && [ -n "$F3_EXPECTED_CERT_INSTANCE" ] && [ "$F3_HEADER_INSTANCE" != "$F3_EXPECTED_CERT_INSTANCE" ]; then + echo "F3 header instance ($F3_HEADER_INSTANCE) != expected cert instance ($F3_EXPECTED_CERT_INSTANCE)"; exit 1 + fi echo "Generating v2 snapshot" $FOREST_TOOL_PATH archive merge-f3 --v1 v1.forest.car.zst --f3 f3.bin --output v2.forest.car.zst echo "Inspecting v2 snapshot info" $FOREST_TOOL_PATH archive info v2.forest.car.zst echo "Inspecting v2 snapshot metadata" $FOREST_TOOL_PATH archive metadata v2.forest.car.zst echo "Importing the v2 snapshot" $FOREST_PATH --chain calibnet --encrypt-keystore false --halt-after-import --height=-200 --import-snapshot v2.forest.car.zst }To verify now, run locally/CI with:
- F3_SNAPSHOT_URL only (happy path).
- With a mismatched F3_EXPECTED_CERT_INSTANCE to confirm it fails fast.
165-166: Make the certificate check robust and self-documenting.Tie the hardcoded instance to the same F3_EXPECTED_CERT_INSTANCE used during download, and fail if missing. Also fix capitalization in the echo.
- echo "ensure F3 certificate at instance 622000 has been imported" - $FOREST_CLI_PATH f3 c get 622000 + echo "Ensure F3 certificate at instance ${F3_EXPECTED_CERT_INSTANCE:-622000} has been imported" + if ! $FOREST_CLI_PATH f3 c get "${F3_EXPECTED_CERT_INSTANCE:-622000}"; then + echo "F3 certificate ${F3_EXPECTED_CERT_INSTANCE:-622000} not found"; exit 1 + fi
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
scripts/tests/harness.sh(2 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: hanabi1224
PR: ChainSafe/forest#5930
File: build.rs:64-77
Timestamp: 2025-08-13T09:43:20.301Z
Learning: hanabi1224 prefers hard compile-time errors in build scripts rather than runtime safeguards or collision detection, believing it's better to fail fast and fix root causes of issues like malformed snapshot names.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
- GitHub Check: tests-release
- GitHub Check: tests
- GitHub Check: Build forest binaries on Linux AMD64
- GitHub Check: All lint checks
- GitHub Check: cargo-publish-dry-run
- GitHub Check: Build MacOS
- GitHub Check: Build Ubuntu
- GitHub Check: Analyze (go)
- GitHub Check: Analyze (rust)
Summary of changes
This PR updates F3 snapshot to speed up the F3 readiness check (
forest-cli f3 ready). Hopefully, this is the last manual update before we switch to the rolling F3-aware v2 snapshots in CI testsChanges introduced in this pull request:
Reference issue to close (if applicable)
Closes
Other information and links
Change checklist
Summary by CodeRabbit