From 0ba8137d866a1068b9dce33362649875ecb1a548 Mon Sep 17 00:00:00 2001 From: "clandestine.eth" <96172957+0xClandestine@users.noreply.github.com> Date: Thu, 30 Jan 2025 12:28:03 -0500 Subject: [PATCH] feat: mainnet storage diff ci --- .github/storage-diff.json | 28 +++++++++++++++++ .github/workflows/storage-diff.yml | 33 ++++++++++++++++++++ .github/workflows/storage-report.yml | 46 ---------------------------- 3 files changed, 61 insertions(+), 46 deletions(-) create mode 100644 .github/storage-diff.json create mode 100644 .github/workflows/storage-diff.yml delete mode 100644 .github/workflows/storage-report.yml diff --git a/.github/storage-diff.json b/.github/storage-diff.json new file mode 100644 index 0000000000..f3843f9c6e --- /dev/null +++ b/.github/storage-diff.json @@ -0,0 +1,28 @@ +{ + "contracts": [ + { + "name": "AVSDirectory", + "address": "0x135dda560e946695d6f155dacafc6f1f25c1f5af" + }, + { + "name": "DelegationManager", + "address": "0x39053D51B77DC0d36036Fc1fCc8Cb819df8Ef37A" + }, + { + "name": "RewardsCoordinator", + "address": "0x7750d328b314EfFa365A0402CcfD489B80B0adda" + }, + { + "name": "StrategyManager", + "address": "0x858646372CC42E1A627fcE94aa7A7033e7CF075A" + }, + { + "name": "StrategyFactory", + "address": "0x5e4C39Ad7A3E881585e383dB9827EB4811f6F647" + }, + { + "name": "EigenPodManager", + "address": "0x91E677b07F7AF907ec9a428aafA9fc14a0d3A338" + } + ] +} \ No newline at end of file diff --git a/.github/workflows/storage-diff.yml b/.github/workflows/storage-diff.yml new file mode 100644 index 0000000000..d60082c8ec --- /dev/null +++ b/.github/workflows/storage-diff.yml @@ -0,0 +1,33 @@ +name: Storage Diff + +on: + workflow_dispatch: + pull_request: + push: + branches: + - "dev" + +jobs: + storage-diff: + name: CI + + # Use latest Ubuntu runner. + runs-on: ubuntu-latest + + steps: + # Check out repository with all submodules for complete codebase access. + - uses: actions/checkout@v4 + with: + submodules: recursive + + # Install the Foundry toolchain. + - name: "Install Foundry" + uses: foundry-rs/foundry-toolchain@v1 + with: + version: stable + + # Run storage diff check to detect storage layout incompatibilities. + - name: "Storage Layout Check" + run: | + bash bin/storage-diff.sh --rpc-url ${{ secrets.RPC_MAINNET }} --etherscan-key ${{ secrets.ETHERSCAN_API_KEY }} --input .github//storage-diff.json + id: storage-diff diff --git a/.github/workflows/storage-report.yml b/.github/workflows/storage-report.yml deleted file mode 100644 index 9a6a3032fc..0000000000 --- a/.github/workflows/storage-report.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: Storage Layout - -on: - workflow_dispatch: - pull_request: - push: - branches: - - "dev" - -jobs: - check_storage: - name: CI - runs-on: "ubuntu-latest" - steps: - - uses: actions/checkout@v4 - with: - submodules: recursive - - - name: Install Foundry - uses: foundry-rs/foundry-toolchain@v1 - with: - version: stable - - - name: "Generate and prepare the storage reports for current branch" - run: | - bash bin/storage-report.sh pr - - - name: Checkout dev - env: - TARGET: ${{ github.event.pull_request.base.sha }} - run: | - git fetch origin $TARGET - git checkout $TARGET - - - name: "Generate and prepare the storage reports for target branch" - run: | - bash bin/storage-report.sh target - - - name: Compare outputs - run: | - if diff --unified pr target; then - echo "No differences found" - else - echo "::error::Differences found between PR and target branch storage layouts" - exit 1 - fi