Skip to content

Commit

Permalink
fix migration test (#81)
Browse files Browse the repository at this point in the history
Migration test fixes and improvements.

    * Fixes naming of DeployAndInitEspressoSequencerInbox
    * adds readability and reliability improvements to migration-test script
    * adds a migration CI workflow

---------

Co-authored-by: tbro <[email protected]>
Co-authored-by: sveitser <[email protected]>
Co-authored-by: Jeremy <[email protected]>
Co-authored-by: Zach Showalter <[email protected]>
  • Loading branch information
5 people authored Jan 23, 2025
1 parent f3565c0 commit b593254
Show file tree
Hide file tree
Showing 7 changed files with 221 additions and 93 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/migration.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Migration Test
run-name: CI triggered from @${{ github.actor }} of ${{ github.head_ref }}

on:
workflow_dispatch:
merge_group:
push:
schedule:
# Run at the end of every day
- cron: "0 0 * * *"

# Cancel in-progress jobs except for integration branch
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ !contains(github.ref, 'integration/')}}

jobs:
migration_test:
runs-on: ubuntu-24.04

steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive

- name: Install Nix
uses: cachix/install-nix-action@v30

- name: Enable Cachix
uses: cachix/cachix-action@v15
continue-on-error: true
with:
name: espresso-systems-private
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
extraPullNames: nix-community
skipPush: ${{ github.actor == 'dependabot[bot]' }}

- name: Migration Test
run: |
nix develop --accept-flake-config --option sandbox relaxed \
-c espresso-tests/migration-test.bash
timeout-minutes: 45
1 change: 1 addition & 0 deletions espresso-tests/.env
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ UPGRADE_TIMESTAMP="1723664126"
READER_ADDRESS="0x7DD3F2a3fAeF3B9F2364c335163244D3388Feb83"
IS_USING_FEE_TOKEN="false"
IS_MIGRATION_TEST="true"
IS_REVERT="false"
MAX_DATA_SIZE="117964"
OLD_BATCH_POSTER_ADDRESS="0xe2148eE53c0755215Df69b2616E552154EdC584f"
NEW_BATCH_POSTER_ADDRESS="0xe2148eE53c0755215Df69b2616E552154EdC584f"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import "nitro-contracts/bridge/ISequencerInbox.sol";
/// with the espresso confirmation layer
/// @dev BATCH_POSTER_ADDRS should be a comma delimited list that includes addresses. This list will give batch posting affordances to those addresses
/// For chains using the Espresso TEE integration, this will be the address of your new batch poster, if you decide to change it.
contract DeployAndInitEspressoSequencerInboxTest is Script {
contract DeployAndInitEspressoSequencerInbox is Script {
function run() external {
bool isMigrationTest = vm.envBool("IS_MIGRATION_TEST");
// Grab addresses from env
Expand Down
4 changes: 2 additions & 2 deletions espresso-tests/create-espresso-integrated-nitro-node.bash
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
set -euo pipefail
set -x # print each command before executing it, for debugging
# set -x # print each command before executing it, for debugging

ESPRESSO_VERSION=ghcr.io/espressosystems/nitro-espresso-integration/nitro-node-dev:integration
lightClientAddr=0xb6eb235fa509e3206f959761d11e3777e16d0e98
Expand All @@ -18,5 +18,5 @@ docker compose run scripts-espresso write-config --simple --simpleWithValidator

# do whatever other espresso setup is needed.

# run esprsso-integrated nitro node for sequencing.
# run Espresso integrated nitro node for sequencing.
docker compose up sequencer-on-espresso --detach
261 changes: 172 additions & 89 deletions espresso-tests/migration-test.bash

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
packages = with pkgs; [
bashInteractive
jq
jnv # interactive JSON filter, useful to search forge broadcast files
nodejs
yarn
openssl # used by test-node.bash
Expand Down

0 comments on commit b593254

Please sign in to comment.