Skip to content

Add prod deployment tests for MetaBoard on all supported networks#95

Merged
thedavidmeister merged 1 commit intomainfrom
2026-03-10-deploy-test
Mar 10, 2026
Merged

Add prod deployment tests for MetaBoard on all supported networks#95
thedavidmeister merged 1 commit intomainfrom
2026-03-10-deploy-test

Conversation

@thedavidmeister
Copy link
Contributor

@thedavidmeister thedavidmeister commented Mar 10, 2026

Fork each supported network and verify MetaBoard exists at the expected address with the correct code hash.

Motivation

Solution

Checks

By submitting this for review, I'm confirming I've done the following:

  • made this PR as small as possible
  • unit-tested any new functionality
  • linked any relevant issues or PRs
  • included screenshots (if this involves a front-end change)

Summary by CodeRabbit

  • Tests

    • Added production deployment validation tests for Arbitrum, Base, Base Sepolia, Flare, and Polygon networks.
  • Chores

    • Updated CI/CD workflow with environment variables for multi-network support.

Fork each supported network and verify MetaBoard exists at the expected
address with the correct code hash.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link

coderabbitai bot commented Mar 10, 2026

Walkthrough

This PR adds environment variable definitions to the CI workflow for multiple blockchain network RPC URLs and introduces production deployment validation tests that verify the MetaBoard contract is correctly deployed on Arbitrum, Base, Base Sepolia, Flare, and Polygon networks.

Changes

Cohort / File(s) Summary
CI Configuration
.github/workflows/rainix.yaml
Added five environment variables for fork RPC URLs (Arbitrum, Base, Base Sepolia, Flare, Polygon) to support network-specific testing.
Production Deployment Tests
test/lib/deploy/LibMetaBoardDeploy.t.sol
Added private helper function checkProdDeployment() and five corresponding test methods that validate MetaBoard contract deployment across different production networks using the new fork RPC URLs.

Sequence Diagram

sequenceDiagram
    participant Test as Test Function
    participant Fork as Network Fork
    participant Env as Environment
    participant Contract as Smart Contract

    Test->>Env: Read RPC URL from CI_FORK_*_RPC_URL
    Test->>Fork: Fork network using RPC URL
    Env->>Test: Provide METABOARD_DEPLOYED_ADDRESS
    Test->>Contract: Request code at address
    Contract->>Test: Return code
    Test->>Test: Assert code exists
    Test->>Contract: Request code hash
    Contract->>Test: Return code hash
    Test->>Test: Assert hash matches METABOARD_DEPLOYED_CODEHASH
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately describes the primary change: adding production deployment tests for MetaBoard across multiple networks, which is exactly what the changeset implements.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 2026-03-10-deploy-test

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@thedavidmeister thedavidmeister self-assigned this Mar 10, 2026
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/rainix.yaml (1)

50-60: ⚠️ Potential issue | 🟠 Major

Scope the new fork RPC URLs to rainix-sol-test only.

Lines 54-58 inject five more network endpoints into a step that also runs Rust and static-analysis tasks. Those jobs do not need fork access, so this broadens the exposure of private/paid RPC credentials for no test benefit. Split the step or otherwise gate these env vars to the Solidity test task only.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/rainix.yaml around lines 50 - 60, The step "Run ${{
matrix.task }}" is exporting the CI_FORK_* RPC env vars for every matrix task;
restrict those sensitive vars to only the Solidity test task by splitting the
workflow: keep the existing generic step named Run ${{ matrix.task }} without
the CI_FORK_* env vars for Rust/static-analysis, and add a separate step (e.g.,
Run solidity tests) that runs nix develop -c ${{ matrix.task }} but only for the
solidity test (use if: matrix.task == 'sol-test' or a dedicated matrix entry)
and include the five CI_FORK_* env variables (CI_FORK_ETH_RPC_URL,
CI_FORK_ARB_RPC_URL, CI_FORK_BASE_RPC_URL, CI_FORK_BASE_SEPOLIA_RPC_URL,
CI_FORK_FLARE_RPC_URL, CI_FORK_POLYGON_RPC_URL) and
ETH_RPC_URL/ETHERSCAN_API_KEY there so only the Solidity test receives the fork
RPC credentials.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@test/lib/deploy/LibMetaBoardDeploy.t.sol`:
- Around line 28-30: checkProdDeployment currently calls
vm.createSelectFork(vm.envString(envVar)) directly which will pass an empty
string in CI and produce a low-signal fork error; first read the env via
vm.envString(envVar) into a local, assert it is non-empty (e.g.
require(bytes(rpcUrl).length > 0, "missing RPC env: " + envVar) or revert with a
clear message) and only then call vm.createSelectFork(rpcUrl); reference the
function checkProdDeployment and the calls to vm.envString and
vm.createSelectFork to locate where to add the pre-check.

---

Outside diff comments:
In @.github/workflows/rainix.yaml:
- Around line 50-60: The step "Run ${{ matrix.task }}" is exporting the
CI_FORK_* RPC env vars for every matrix task; restrict those sensitive vars to
only the Solidity test task by splitting the workflow: keep the existing generic
step named Run ${{ matrix.task }} without the CI_FORK_* env vars for
Rust/static-analysis, and add a separate step (e.g., Run solidity tests) that
runs nix develop -c ${{ matrix.task }} but only for the solidity test (use if:
matrix.task == 'sol-test' or a dedicated matrix entry) and include the five
CI_FORK_* env variables (CI_FORK_ETH_RPC_URL, CI_FORK_ARB_RPC_URL,
CI_FORK_BASE_RPC_URL, CI_FORK_BASE_SEPOLIA_RPC_URL, CI_FORK_FLARE_RPC_URL,
CI_FORK_POLYGON_RPC_URL) and ETH_RPC_URL/ETHERSCAN_API_KEY there so only the
Solidity test receives the fork RPC credentials.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 251387ca-bd9e-4330-9c7e-2b48700634f8

📥 Commits

Reviewing files that changed from the base of the PR and between fb4c28a and cb862e6.

📒 Files selected for processing (2)
  • .github/workflows/rainix.yaml
  • test/lib/deploy/LibMetaBoardDeploy.t.sol

Comment on lines +28 to +30
function checkProdDeployment(string memory envVar) internal {
vm.createSelectFork(vm.envString(envVar));
address deployed = LibMetaBoardDeploy.METABOARD_DEPLOYED_ADDRESS;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Fail fast on an unset RPC URL before calling createSelectFork.

Line 29 forks whatever comes back from vm.envString(envVar). In CI these vars are wired with '' fallbacks, so a missing secret turns into createSelectFork("") and surfaces as a low-signal fork error instead of naming the misconfigured env key.

Proposed fix
     function checkProdDeployment(string memory envVar) internal {
-        vm.createSelectFork(vm.envString(envVar));
+        string memory rpcUrl = vm.envString(envVar);
+        require(bytes(rpcUrl).length > 0, string.concat("Missing RPC URL: ", envVar));
+        vm.createSelectFork(rpcUrl);
         address deployed = LibMetaBoardDeploy.METABOARD_DEPLOYED_ADDRESS;
         assertTrue(deployed.code.length > 0, string.concat("MetaBoard not deployed: ", envVar));
         assertEq(
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
function checkProdDeployment(string memory envVar) internal {
vm.createSelectFork(vm.envString(envVar));
address deployed = LibMetaBoardDeploy.METABOARD_DEPLOYED_ADDRESS;
function checkProdDeployment(string memory envVar) internal {
string memory rpcUrl = vm.envString(envVar);
require(bytes(rpcUrl).length > 0, string.concat("Missing RPC URL: ", envVar));
vm.createSelectFork(rpcUrl);
address deployed = LibMetaBoardDeploy.METABOARD_DEPLOYED_ADDRESS;
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test/lib/deploy/LibMetaBoardDeploy.t.sol` around lines 28 - 30,
checkProdDeployment currently calls vm.createSelectFork(vm.envString(envVar))
directly which will pass an empty string in CI and produce a low-signal fork
error; first read the env via vm.envString(envVar) into a local, assert it is
non-empty (e.g. require(bytes(rpcUrl).length > 0, "missing RPC env: " + envVar)
or revert with a clear message) and only then call vm.createSelectFork(rpcUrl);
reference the function checkProdDeployment and the calls to vm.envString and
vm.createSelectFork to locate where to add the pre-check.

@thedavidmeister thedavidmeister merged commit cda61a6 into main Mar 10, 2026
15 of 16 checks passed
@github-actions
Copy link
Contributor

@coderabbitai assess this PR size classification for the totality of the PR with the following criterias and report it in your comment:

S/M/L PR Classification Guidelines:

This guide helps classify merged pull requests by effort and complexity rather than just line count. The goal is to assess the difficulty and scope of changes after they have been completed.

Small (S)

Characteristics:

  • Simple bug fixes, typos, or minor refactoring
  • Single-purpose changes affecting 1-2 files
  • Documentation updates
  • Configuration tweaks
  • Changes that require minimal context to review

Review Effort: Would have taken 5-10 minutes

Examples:

  • Fix typo in variable name
  • Update README with new instructions
  • Adjust configuration values
  • Simple one-line bug fixes
  • Import statement cleanup

Medium (M)

Characteristics:

  • Feature additions or enhancements
  • Refactoring that touches multiple files but maintains existing behavior
  • Breaking changes with backward compatibility
  • Changes requiring some domain knowledge to review

Review Effort: Would have taken 15-30 minutes

Examples:

  • Add new feature or component
  • Refactor common utility functions
  • Update dependencies with minor breaking changes
  • Add new component with tests
  • Performance optimizations
  • More complex bug fixes

Large (L)

Characteristics:

  • Major feature implementations
  • Breaking changes or API redesigns
  • Complex refactoring across multiple modules
  • New architectural patterns or significant design changes
  • Changes requiring deep context and multiple review rounds

Review Effort: Would have taken 45+ minutes

Examples:

  • Complete new feature with frontend/backend changes
  • Protocol upgrades or breaking changes
  • Major architectural refactoring
  • Framework or technology upgrades

Additional Factors to Consider

When deciding between sizes, also consider:

  • Test coverage impact: More comprehensive test changes lean toward larger classification
  • Risk level: Changes to critical systems bump up a size category
  • Team familiarity: Novel patterns or technologies increase complexity

Notes:

  • the assessment must be for the totality of the PR, that means comparing the base branch to the last commit of the PR
  • the assessment output must be exactly one of: S, M or L (single-line comment) in format of: SIZE={S/M/L}
  • do not include any additional text, only the size classification
  • your assessment comment must not include tips or additional sections
  • do NOT tag me or anyone else on your comment

@coderabbitai
Copy link

coderabbitai bot commented Mar 10, 2026

Tip

For best results, initiate chat on the files or code changes.

SIZE=S

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant