test(contracts): add bridge integration test against supersim#46
Conversation
Exercises MARKBridgeAdapter against live SuperchainTokenBridge predeploy on two supersim L2 forks. Verifies tokens are burned on chain A and received on chain B via auto-relay, and that rate limits are enforced on a live fork. Run with: CHAIN_A_RPC_URL=http://127.0.0.1:9545 CHAIN_B_RPC_URL=http://127.0.0.1:9546 FOUNDRY_PROFILE=integration forge test --match-path 'test/integration/**/*.t.sol' -vv
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
WalkthroughThis PR adds integration tests for the ChangesCross-chain Bridge Integration Tests
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@contracts/test/integration/bridge/MARKBridgeIntegration.t.sol`:
- Around line 74-79: Before asserting recipient balance on chain B, confirm the
token contract is actually deployed there: after vm.selectFork(forkB) compute
the token address (tokenOnB / address(token)) and assert its code size > 0
(e.g., using address.code.length or extcodesize) so the test fails clearly if
the token is missing; then proceed to call RYLA(tokenOnB).balanceOf(recipient)
and assert equality with amount. Ensure the assertion message names the
token/address and explains the deployment check (e.g., "token contract not
deployed on chain B at tokenOnB").
- Around line 19-31: Introduce a new state variable destChainId in the test
contract and initialize it once inside setUp() instead of reading it from the
environment multiple times; update setUp() to read the environment variable once
and assign to destChainId, then remove the duplicate env reads in the test
functions (replace any direct env reads with the destChainId variable) so tests
use the single source of truth; locate usages around MARKBridgeIntegration tests
referencing destChainId and adjust them to use the new state variable.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: f4db0f57-335f-4770-8c00-f6983cdf7568
📒 Files selected for processing (1)
contracts/test/integration/bridge/MARKBridgeIntegration.t.sol
Summary
Adds the first integration test for
MARKBridgeAdapter. Unit tests mockSuperchainTokenBridge— this test exercises the real predeploy on two supersim L2 forks to verify tokens actually move cross-chain.Tests added
testBridgeToTransfersTokensCrossChain: deploys RYLA + adapter on chain A, callsbridgeTo, verifies tokens burned on A and received on B via supersim auto-relaytestBridgeToEnforcesMaxPerTxOnLiveFork: verifies rate limits work against the live bridgeHow to run
Scope
contractsRisk
None — test-only addition. Integration tests are excluded from the default Foundry profile and do not run in standard CI.
Summary by CodeRabbit