refactor(rebalancer-sim): Use testcontainers for anvil setup#8004
Merged
nambrot merged 1 commit intoFeb 3, 2026
Merged
Conversation
Replaced spawn-based anvil process management with testcontainers, consistent with CLI e2e tests pattern. - No local anvil installation required (uses Docker image) - Automatic container cleanup even on test crashes - Retry logic for CI reliability Addresses PR #7903 review comment from @xeno097. Note: CI workflow change (.github/workflows/rebalancer-sim-test.yml) to remove Foundry setup step needs to be added separately due to token scope.
Contributor
⚙️ Node Service Docker Images Built Successfully
Full image paths |
paulbalaji
approved these changes
Feb 3, 2026
xeno097
approved these changes
Feb 3, 2026
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.
Summary
Replaced spawn-based anvil process management with testcontainers, consistent with CLI e2e tests pattern.
Addresses PR #7903 review comment from @xeno097.
Relates to ENG-3234.
Design Decision: Single Container
The rebalancer-sim intentionally uses a single anvil container with multiple virtual domains (domain IDs 1000, 2000, 3000) rather than multiple separate containers like CLI e2e tests. This is to:
The CLI e2e tests need multiple containers because they test real cross-chain scenarios. The rebalancer simulation tests the rebalancer's decision-making against synthetic scenarios on a shared state.
Changes
typescript/rebalancer-sim/package.json- Addedtestcontainersdependencytypescript/rebalancer-sim/test/utils/anvil.ts- Rewrote to use testcontainers (177 → 85 lines)CI Workflow Note
The CI workflow change (
.github/workflows/rebalancer-sim-test.yml) to remove the Foundry setup step couldn't be pushed due to token scope limitations. The change is:This can be added manually or the tests will still work (Foundry setup is just unnecessary overhead now).
Testing
All tests pass locally:
harness-setup✅inflight-guard✅full-simulation (extreme-drain)✅