optimize: CRE Startup Times - #23418
Open
kalverra wants to merge 2 commits into
Open
Conversation
Contributor
|
✅ No conflicts with other open PRs targeting |
Contributor
There was a problem hiding this comment.
Pull request overview
Risk Rating: MEDIUM
This PR optimizes CRE environment startup time (local + CI) by overlapping independent startup work, parallelizing some setup stages, and prefetching Docker images to avoid lazy pulls on the critical path.
Changes:
- Parallelize CRE topology DON metadata creation and blockchain deployments.
- Overlap Chip Router startup with blockchain startup.
- Prefetch required Docker images earlier in GitHub Actions workflows and wait for prefetch completion before “Start local CRE”.
Areas requiring scrupulous human review:
- Newly introduced goroutine-based parallelism in
NewTopologyand blockchainStart(index capture correctness, cancellation behavior). - Composite action behavior for background docker pulls (failure reporting correctness and robustness).
- Startup-stage cancellation/cleanup semantics when an early stage fails.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| system-tests/lib/cre/topology.go | Parallelizes DON metadata creation for topology construction. |
| system-tests/lib/cre/environment/environment.go | Overlaps Chip Router startup with blockchain startup via worker pool. |
| system-tests/lib/cre/environment/dons.go | Refactors node funding to build tasks and fund in parallel with per-chain serialization. |
| system-tests/lib/cre/environment/blockchains/blockchains.go | Parallelizes blockchain deployments using errgroup.WithContext. |
| system-tests/lib/cre/contracts/registry_pickup_wait.go | Speeds up capability registry sync polling interval. |
| .github/workflows/cre-system-tests.yaml | Adds image prefetch steps (public + private) and a wait barrier before CRE startup. |
| .github/workflows/cre-regression-system-tests.yaml | Adds image prefetch steps (public + private) and a wait barrier before CRE startup. |
| .github/workflows/cre-mixed-env-tests.yaml | Adds image prefetch steps (including baseline image) plus wait barrier(s). |
| .github/actions/prefetch-cre-images/action.yml | New composite action to start background docker pulls and later wait for completion. |
| .github/.agents/skills/optimize-workflow/SKILL.md | Updates workflow optimization skill guidance (switches to octometrics, adjusts constraints). |
| .github/.agents/skills/optimize-workflow/scripts/workflow_monitor.py | Removes legacy workflow monitoring script. |
| .github/.agents/skills/optimize-workflow/scripts/workflow_compare.py | Removes legacy workflow comparison script. |
| .github/.agents/skills/optimize-workflow/scripts/test_workflow_monitor.py | Removes legacy tests for removed monitoring script. |
| .github/.agents/skills/optimize-workflow/scripts/test_workflow_compare.py | Removes legacy tests for removed comparison script. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
kalverra
marked this pull request as ready for review
August 14, 2026 19:43
product-security-plaid-production
Bot
requested review from
MStreet3,
Tofel,
bolekk,
skudasov and
tvc-robsondebraga
August 14, 2026 19:43
chainchad
previously approved these changes
Aug 14, 2026
tvc-robsondebraga
previously approved these changes
Aug 14, 2026
kalverra
dismissed stale reviews from tvc-robsondebraga and chainchad
August 14, 2026 23:57
The merge-base changed after approval.
kalverra
force-pushed
the
DX-4988/cre-startup-speedup
branch
from
August 14, 2026 23:57
de47070 to
03e7fc3
Compare
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Intent
Optimize CRE test environment startup performance locally and in CI to reduce integration test runtime toward the <= 10m target.
Results
Cut runtime for
Start Local CREstep in half!Big Changes
CRE Docker Image Background Prefetching
Introduced a reusable composite action (
.github/actions/prefetch-cre-images) that initiates non-blocking backgrounddocker pulloperations for public and private images during early workflow setup steps, awaiting completion just before the local CRE environment start step.Eliminates lazy container image pull latencies from testcontainers during test startup, cutting
Start Local CREexecution time in CI from 53s to 21s.Parallelized Environment & Blockchain Initialization
Overlapped independent setup phases: Chip Router startup runs concurrently with blockchain deployment via worker pool, blockchain deployment is parallelized across instances using
errgroup,NewDonMetadatageneration runs concurrently across node sets with cloned capability configs, and node funding executes concurrently across blockchains while maintaining per-chain nonce serialization.Removes sequential blocking waits across environment components to substantially accelerate startup in multi-chain and multi-DON configurations.
Workflow Optimization Tooling Migration to
octometricsRemoved legacy Python scripts (
workflow_monitor.py,workflow_compare.py, and test suites) from.github/.agents/skills/optimize-workflow/and updated skill guidance to useoctometrics.Consolidates CI performance monitoring and run comparisons into a dedicated, standard tool.
Small Changes
system-tests/lib/cre/contracts/registry_pickup_wait.go. Speeds up capability registration pickup loops during CRE bootstrap.system-tests/lib/cre/environment/environment.gowith a cancelable context. Ensures background Chip Router tasks terminate immediately on early return errors.set +einprefetch-cre-imagessubshells. Guarantees exit codes are always written so the wait step accurately detects failed pulls.system-tests/lib/cre/environment/dons.go. Avoids runtime mutex map write contention during concurrent funding.