From 3ad57a7f7e87aa58de89cee34c896c74cee20c5c Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Tue, 10 Mar 2026 20:42:39 +0400 Subject: [PATCH 1/4] Add prod deploy verification tests for all supported networks Fork each supported network and verify all five contracts exist at their expected addresses with the expected codehash. Co-Authored-By: Claude Opus 4.6 --- .../lib/deploy/LibInterpreterDeployProd.t.sol | 84 +++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 test/src/lib/deploy/LibInterpreterDeployProd.t.sol diff --git a/test/src/lib/deploy/LibInterpreterDeployProd.t.sol b/test/src/lib/deploy/LibInterpreterDeployProd.t.sol new file mode 100644 index 000000000..8a8249a60 --- /dev/null +++ b/test/src/lib/deploy/LibInterpreterDeployProd.t.sol @@ -0,0 +1,84 @@ +// SPDX-License-Identifier: LicenseRef-DCL-1.0 +// SPDX-FileCopyrightText: Copyright (c) 2020 Rain Open Source Software Ltd +pragma solidity =0.8.25; + +import {Test} from "forge-std/Test.sol"; +import {LibRainDeploy} from "rain.deploy/lib/LibRainDeploy.sol"; +import {LibInterpreterDeploy} from "../../../../src/lib/deploy/LibInterpreterDeploy.sol"; + +/// @title LibInterpreterDeployProdTest +/// @notice Forks each supported network and verifies that all five interpreter +/// contracts are deployed at the expected addresses with the expected codehash. +contract LibInterpreterDeployProdTest is Test { + function _checkAllContracts() internal view { + assertTrue( + LibInterpreterDeploy.PARSER_DEPLOYED_ADDRESS.code.length > 0, "Parser not deployed" + ); + assertEq( + LibInterpreterDeploy.PARSER_DEPLOYED_ADDRESS.codehash, + LibInterpreterDeploy.PARSER_DEPLOYED_CODEHASH + ); + + assertTrue( + LibInterpreterDeploy.STORE_DEPLOYED_ADDRESS.code.length > 0, "Store not deployed" + ); + assertEq( + LibInterpreterDeploy.STORE_DEPLOYED_ADDRESS.codehash, + LibInterpreterDeploy.STORE_DEPLOYED_CODEHASH + ); + + assertTrue( + LibInterpreterDeploy.INTERPRETER_DEPLOYED_ADDRESS.code.length > 0, "Interpreter not deployed" + ); + assertEq( + LibInterpreterDeploy.INTERPRETER_DEPLOYED_ADDRESS.codehash, + LibInterpreterDeploy.INTERPRETER_DEPLOYED_CODEHASH + ); + + assertTrue( + LibInterpreterDeploy.EXPRESSION_DEPLOYER_DEPLOYED_ADDRESS.code.length > 0, "ExpressionDeployer not deployed" + ); + assertEq( + LibInterpreterDeploy.EXPRESSION_DEPLOYER_DEPLOYED_ADDRESS.codehash, + LibInterpreterDeploy.EXPRESSION_DEPLOYER_DEPLOYED_CODEHASH + ); + + assertTrue( + LibInterpreterDeploy.RAINLANG_DEPLOYED_ADDRESS.code.length > 0, "Rainlang not deployed" + ); + assertEq( + LibInterpreterDeploy.RAINLANG_DEPLOYED_ADDRESS.codehash, + LibInterpreterDeploy.RAINLANG_DEPLOYED_CODEHASH + ); + } + + /// All five contracts MUST be deployed on Arbitrum. + function testProdDeployArbitrum() external { + vm.createSelectFork(LibRainDeploy.ARBITRUM_ONE); + _checkAllContracts(); + } + + /// All five contracts MUST be deployed on Base. + function testProdDeployBase() external { + vm.createSelectFork(LibRainDeploy.BASE); + _checkAllContracts(); + } + + /// All five contracts MUST be deployed on Base Sepolia. + function testProdDeployBaseSepolia() external { + vm.createSelectFork(LibRainDeploy.BASE_SEPOLIA); + _checkAllContracts(); + } + + /// All five contracts MUST be deployed on Flare. + function testProdDeployFlare() external { + vm.createSelectFork(LibRainDeploy.FLARE); + _checkAllContracts(); + } + + /// All five contracts MUST be deployed on Polygon. + function testProdDeployPolygon() external { + vm.createSelectFork(LibRainDeploy.POLYGON); + _checkAllContracts(); + } +} From 4a89a28b2904cdab9f8769067ddddbb3c1483eda Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Tue, 10 Mar 2026 21:47:18 +0400 Subject: [PATCH 2/4] bump metadata --- foundry.lock | 2 +- lib/rain.metadata | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/foundry.lock b/foundry.lock index 004d595a2..139dc6894 100644 --- a/foundry.lock +++ b/foundry.lock @@ -12,7 +12,7 @@ "rev": "83e607990be8b3e06549338043c6b18f430f6bd2" }, "lib/rain.metadata": { - "rev": "a823381df1a118fe0e217150a416566e0c182210" + "rev": "cda61a682e6cbc954d3ad8b50913a9058c834283" }, "lib/rain.string": { "rev": "488f237cd59874e4eb91b5a4f747bd57578fec7f" diff --git a/lib/rain.metadata b/lib/rain.metadata index a823381df..cda61a682 160000 --- a/lib/rain.metadata +++ b/lib/rain.metadata @@ -1 +1 @@ -Subproject commit a823381df1a118fe0e217150a416566e0c182210 +Subproject commit cda61a682e6cbc954d3ad8b50913a9058c834283 From 96608b8023a564eed2e96c69cfb3255cb2bbfdb7 Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Tue, 10 Mar 2026 22:15:40 +0400 Subject: [PATCH 3/4] forge fmt prod deploy tests Co-Authored-By: Claude Opus 4.6 --- .../lib/deploy/LibInterpreterDeployProd.t.sol | 29 +++++-------------- 1 file changed, 7 insertions(+), 22 deletions(-) diff --git a/test/src/lib/deploy/LibInterpreterDeployProd.t.sol b/test/src/lib/deploy/LibInterpreterDeployProd.t.sol index 8a8249a60..80e527149 100644 --- a/test/src/lib/deploy/LibInterpreterDeployProd.t.sol +++ b/test/src/lib/deploy/LibInterpreterDeployProd.t.sol @@ -11,25 +11,13 @@ import {LibInterpreterDeploy} from "../../../../src/lib/deploy/LibInterpreterDep /// contracts are deployed at the expected addresses with the expected codehash. contract LibInterpreterDeployProdTest is Test { function _checkAllContracts() internal view { - assertTrue( - LibInterpreterDeploy.PARSER_DEPLOYED_ADDRESS.code.length > 0, "Parser not deployed" - ); - assertEq( - LibInterpreterDeploy.PARSER_DEPLOYED_ADDRESS.codehash, - LibInterpreterDeploy.PARSER_DEPLOYED_CODEHASH - ); + assertTrue(LibInterpreterDeploy.PARSER_DEPLOYED_ADDRESS.code.length > 0, "Parser not deployed"); + assertEq(LibInterpreterDeploy.PARSER_DEPLOYED_ADDRESS.codehash, LibInterpreterDeploy.PARSER_DEPLOYED_CODEHASH); - assertTrue( - LibInterpreterDeploy.STORE_DEPLOYED_ADDRESS.code.length > 0, "Store not deployed" - ); - assertEq( - LibInterpreterDeploy.STORE_DEPLOYED_ADDRESS.codehash, - LibInterpreterDeploy.STORE_DEPLOYED_CODEHASH - ); + assertTrue(LibInterpreterDeploy.STORE_DEPLOYED_ADDRESS.code.length > 0, "Store not deployed"); + assertEq(LibInterpreterDeploy.STORE_DEPLOYED_ADDRESS.codehash, LibInterpreterDeploy.STORE_DEPLOYED_CODEHASH); - assertTrue( - LibInterpreterDeploy.INTERPRETER_DEPLOYED_ADDRESS.code.length > 0, "Interpreter not deployed" - ); + assertTrue(LibInterpreterDeploy.INTERPRETER_DEPLOYED_ADDRESS.code.length > 0, "Interpreter not deployed"); assertEq( LibInterpreterDeploy.INTERPRETER_DEPLOYED_ADDRESS.codehash, LibInterpreterDeploy.INTERPRETER_DEPLOYED_CODEHASH @@ -43,12 +31,9 @@ contract LibInterpreterDeployProdTest is Test { LibInterpreterDeploy.EXPRESSION_DEPLOYER_DEPLOYED_CODEHASH ); - assertTrue( - LibInterpreterDeploy.RAINLANG_DEPLOYED_ADDRESS.code.length > 0, "Rainlang not deployed" - ); + assertTrue(LibInterpreterDeploy.RAINLANG_DEPLOYED_ADDRESS.code.length > 0, "Rainlang not deployed"); assertEq( - LibInterpreterDeploy.RAINLANG_DEPLOYED_ADDRESS.codehash, - LibInterpreterDeploy.RAINLANG_DEPLOYED_CODEHASH + LibInterpreterDeploy.RAINLANG_DEPLOYED_ADDRESS.codehash, LibInterpreterDeploy.RAINLANG_DEPLOYED_CODEHASH ); } From 335c68cc8e4e679379374febfa37c844ac114eac Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Tue, 10 Mar 2026 23:01:22 +0400 Subject: [PATCH 4/4] Add deploy RPC URL env vars to CI Co-Authored-By: Claude Opus 4.6 --- .github/workflows/rainix.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/rainix.yaml b/.github/workflows/rainix.yaml index 74d6a0d4f..fb2554411 100644 --- a/.github/workflows/rainix.yaml +++ b/.github/workflows/rainix.yaml @@ -61,4 +61,9 @@ jobs: DEPLOY_BROADCAST: "" DEPLOY_VERIFIER: "" DEPLOY_METABOARD_ADDRESS: ${{ vars.CI_DEPLOY_SEPOLIA_METABOARD_ADDRESS }} + CI_DEPLOY_ARBITRUM_RPC_URL: ${{ secrets.CI_DEPLOY_ARBITRUM_RPC_URL || vars.CI_DEPLOY_ARBITRUM_RPC_URL || '' }} + CI_DEPLOY_BASE_RPC_URL: ${{ secrets.CI_DEPLOY_BASE_RPC_URL || vars.CI_DEPLOY_BASE_RPC_URL || '' }} + CI_DEPLOY_BASE_SEPOLIA_RPC_URL: ${{ secrets.CI_DEPLOY_BASE_SEPOLIA_RPC_URL || vars.CI_DEPLOY_BASE_SEPOLIA_RPC_URL || '' }} + CI_DEPLOY_FLARE_RPC_URL: ${{ secrets.CI_DEPLOY_FLARE_RPC_URL || vars.CI_DEPLOY_FLARE_RPC_URL || '' }} + CI_DEPLOY_POLYGON_RPC_URL: ${{ secrets.CI_DEPLOY_POLYGON_RPC_URL || vars.CI_DEPLOY_POLYGON_RPC_URL || '' }} run: nix develop -c ${{ matrix.task }}