-
Notifications
You must be signed in to change notification settings - Fork 592
feat(rebalancer-sim): Add simulation harness for warp route rebalancer testing #7903
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
Merged
Merged
Changes from 53 commits
Commits
Show all changes
55 commits
Select commit
Hold shift + click to select a range
006f305
plan: Add rebalancer simulation harness design
nambrot ab266c7
feat(rebalancer-sim): Add simulation harness for warp route rebalance…
nambrot 1bf45b7
feat(rebalancer-sim): Add separate signers and parallel message proce…
nambrot bdaccb2
feat(rebalancer-sim): Add MessageTracker for off-chain message tracking
nambrot 2d95f16
feat(rebalancer-sim): Add balancedTraffic scenario generator
nambrot 56007f1
feat(rebalancer-sim): Enhance scenario configs with defaults and expe…
nambrot 218a9eb
chore(rebalancer-sim): Regenerate scenarios with new format and balan…
nambrot b99d738
test(rebalancer-sim): Update tests to use scenario defaults and expec…
nambrot 20af934
feat(rebalancer-sim): Add test utilities and inflight guard test
nambrot 51b9241
feat(rebalancer-sim): Add RealRebalancerService for comparison testing
nambrot 9ef29fa
fix(rebalancer-sim): Clean up signal handlers from RebalancerService
nambrot bc1589c
fix(rebalancer-sim): Fix state leaks causing multi-run test failures
nambrot 980845a
fix(rebalancer-sim): Run both rebalancers by default for comparison
nambrot c3a4fca
fix(rebalancer-sim): Per-test anvil isolation for reliable multi-reba…
nambrot e27de79
feat(rebalancer-sim): Add HTML timeline visualizer for simulation res…
nambrot 9173026
feat(rebalancer-sim): Improve visualizer with computed balances and r…
nambrot 94e3ec3
feat(rebalancer-sim): Add rebalance e2e latency tracking
nambrot 7854021
fix(rebalancer-sim): Disable provider polling to reduce RPC contention
nambrot a4cd977
fix(rebalancer-sim): Wait for RealRebalancerService initialization
nambrot 006deb8
feat(rebalancer-sim): Add diagnostic logging to MessageTracker
nambrot bcf117a
fix(rebalancer-sim): Add cleanup between rebalancer comparison runs
nambrot d0c2952
refactor(rebalancer-sim): Simplify RealRebalancerRunner to in-process…
nambrot 5c4c20f
fix(rebalancer-sim): Fix bridge to pull tokens and use actual balance…
nambrot db1c910
feat(rebalancer-sim): Improve balance curve visualization
nambrot 53260a7
fix(rebalancer-sim): Fix transfer bar stacking overflow in visualizer
nambrot ba8589e
feat(rebalancer-sim): Add balance hover tooltips and config panel to …
nambrot 26347db
feat(rebalancer-sim): Add scenario metadata to visualizer
nambrot bce1afa
chore(rebalancer-sim): Ignore entire results folder in gitignore
nambrot 94a805a
Merge origin/main into feat/rebalancer-simulation-harness
nambrot e7d408e
fix(rebalancer-sim): Fix CI failures
nambrot 74d74c2
fix(rebalancer-sim): Fix lint errors
nambrot c1c4251
docs(rebalancer-sim): Update README to match implementation
nambrot 018fbd4
docs(rebalancer-sim): Add design decisions, usage examples, and futur…
nambrot 33ed6d1
fix(rebalancer-sim): Address PR #7903 review comments (#7960)
nambrot 7b438ba
fix(rebalancer-sim): Address PR #7903 human review comments (#7964)
nambrot f96999c
fix(rebalancer-sim): Rename rebalancer types and fix CLI rebalancer c…
nambrot e745538
fix(rebalancer-sim): Address final PR #7903 review comments
nambrot f05fe46
fix(rebalancer-sim): Fix CI test execution and format JSON files
nambrot 3ea6378
fix(rebalancer-sim): Address PR review feedback
nambrot 85781f6
refactor(rebalancer-sim): Rename CLIRebalancerRunner to ProductionReb…
nambrot 0372b3f
fix(rebalancer-sim): Address PR review feedback
nambrot cdd5a89
refactor(rebalancer-sim): Flatten directory structure and consolidate…
nambrot 77ddb29
ci(rebalancer-sim): Move to separate workflow with path filters
nambrot 02b5c6a
fix(solidity): MockValueTransferBridge now transfers tokens with Safe…
nambrot f7b4c60
fix(rebalancer-sim): Fix scenarios directory path resolution
nambrot ce54159
fix(ci): Use underscore separator in rebalancer-sim matrix test names
nambrot 3a09572
refactor(rebalancer-sim): Unify inflight-guard test with full-simulat…
nambrot 32565bf
fix(rebalancer-sim): Add balanceTimeline to visualization data
nambrot 83f0db8
style: Format inflight-guard.json with prettier
nambrot 62a9cfa
fix(cli): Fix warp-rebalancer e2e test to simulate bridge delivery co…
nambrot 9922620
chore: Add JSON to lint-staged precommit hook
nambrot eb05905
fix(rebalancer-sim): Address PR #7903 review comments
nambrot ee2935f
fix(rebalancer-sim): Cleanup simulation engine issues from PR review …
nambrot afbae12
refactor(rebalancer-sim): Use testcontainers for anvil setup (#8004)
nambrot-agent 7f37f6c
Fix prettier
nambrot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,84 @@ | ||
| name: rebalancer-sim-test | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| paths: | ||
| - 'typescript/rebalancer/**' | ||
| - 'typescript/rebalancer-sim/**' | ||
| - 'solidity/contracts/mock/MockValueTransferBridge.sol' | ||
| - '.github/workflows/rebalancer-sim-test.yml' | ||
| pull_request: | ||
| paths: | ||
| - 'typescript/rebalancer/**' | ||
| - 'typescript/rebalancer-sim/**' | ||
| - 'solidity/contracts/mock/MockValueTransferBridge.sol' | ||
| - '.github/workflows/rebalancer-sim-test.yml' | ||
| workflow_dispatch: | ||
|
|
||
| concurrency: | ||
| group: rebalancer-sim-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| rebalancer-sim-test-matrix: | ||
| runs-on: depot-ubuntu-latest | ||
| timeout-minutes: 15 | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| test: | ||
| # Split full-simulation by scenario (file_grep-pattern, using _ as separator) | ||
| - full-simulation_extreme-drain | ||
| - full-simulation_extreme-accumulate | ||
| - full-simulation_large-unidirectional | ||
| - full-simulation_whale-transfers | ||
| - full-simulation_balanced-bidirectional | ||
| - full-simulation_random-with-headroom | ||
| # Other test files | ||
| - inflight-guard | ||
| - harness-setup | ||
| - unidirectional | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| with: | ||
| ref: ${{ github.event.pull_request.head.sha || github.sha }} | ||
| submodules: recursive | ||
|
|
||
| - name: pnpm-build | ||
| uses: ./.github/actions/pnpm-build-with-cache | ||
|
|
||
| - name: Setup Foundry | ||
| uses: ./.github/actions/setup-foundry | ||
|
|
||
| - name: Run rebalancer-sim test (${{ matrix.test }}) | ||
| working-directory: typescript/rebalancer-sim | ||
| run: | | ||
| if [[ "${{ matrix.test }}" == *"_"* ]]; then | ||
| FILE=$(echo "${{ matrix.test }}" | cut -d_ -f1) | ||
| PATTERN=$(echo "${{ matrix.test }}" | cut -d_ -f2) | ||
| pnpm mocha --config .mocharc.json "./test/**/*${FILE}*.test.ts" --grep "${PATTERN}" --exit | ||
| else | ||
| pnpm mocha --config .mocharc.json "./test/**/*${{ matrix.test }}*.test.ts" --exit | ||
| fi | ||
|
|
||
| - name: Upload test results | ||
| if: always() | ||
| uses: actions/upload-artifact@v5 | ||
| with: | ||
| name: rebalancer-sim-results-${{ matrix.test }} | ||
| path: typescript/rebalancer-sim/results/*.html | ||
| if-no-files-found: ignore | ||
| retention-days: 7 | ||
|
|
||
| rebalancer-sim-test: | ||
| runs-on: ubuntu-latest | ||
| needs: [rebalancer-sim-test-matrix] | ||
| if: always() | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| - name: Check rebalancer-sim test status | ||
| uses: ./.github/actions/check-job-status | ||
| with: | ||
| job_name: 'Rebalancer Sim Test' | ||
| result: ${{ needs.rebalancer-sim-test-matrix.result }} | ||
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
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| .env | ||
| dist | ||
| cache | ||
|
|
||
| # Simulation results (generated at runtime) | ||
| results/ |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| { | ||
| "import": ["tsx"], | ||
| "extension": ["ts"], | ||
| "timeout": 120000, | ||
| "exit": true | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.