diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 19488daf0..ebd05df12 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -188,7 +188,7 @@ jobs: e2e-matrix: runs-on: larger-runner - if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.base_ref == 'main') || github.event_name == 'merge_group' + if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.base_ref == 'main' || github.base_ref == 'cli-2.0') || github.event_name == 'merge_group' needs: [yarn-build] strategy: matrix: @@ -215,7 +215,7 @@ jobs: - name: rust cache uses: Swatinem/rust-cache@v2 with: - prefix-key: "v2-${{ runner.os }}-rust-cache" + prefix-key: "v1-${{ runner.os }}-rust-cache" shared-key: ${{ matrix.e2e-type }} workspaces: | ./rust @@ -266,7 +266,7 @@ jobs: working-directory: ./rust env: E2E_CI_MODE: 'true' - E2E_CI_TIMEOUT_SEC: '3600' + E2E_CI_TIMEOUT_SEC: '600' E2E_KATHY_MESSAGES: '20' RUST_BACKTRACE: 'full' @@ -282,7 +282,7 @@ jobs: prebuild-cli-e2e: runs-on: larger-runner - if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.base_ref == 'main') || github.event_name == 'merge_group' + if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.base_ref == 'main' || github.base_ref == 'cli-2.0') || github.event_name == 'merge_group' steps: - uses: actions/checkout@v4 with: @@ -331,7 +331,7 @@ jobs: cli-advanced-e2e: runs-on: larger-runner - if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.base_ref == 'main') || github.event_name == 'merge_group' + if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.base_ref == 'main' || github.base_ref == 'cli-2.0') || github.event_name == 'merge_group' needs: [yarn-build, prebuild-cli-e2e] strategy: matrix: diff --git a/typescript/infra/scripts/send-test-messages.ts b/typescript/infra/scripts/send-test-messages.ts index f602f4b30..d02826398 100644 --- a/typescript/infra/scripts/send-test-messages.ts +++ b/typescript/infra/scripts/send-test-messages.ts @@ -1,3 +1,4 @@ +import { Provider } from '@ethersproject/providers'; import { Wallet } from 'ethers'; import fs from 'fs'; import yargs from 'yargs'; @@ -100,15 +101,28 @@ async function main() { const { timeout, defaultHook, requiredHook, mineforever } = args; let messages = args.messages; + // Limit the test chains to a subset of the known chains + // E2E in Rust only knows about test1, test2 and test3 + const kathyTestChains = [ + TestChainName.test1, + TestChainName.test2, + TestChainName.test3, + ]; + + // Create a multi-provider with a signer const signer = new Wallet(ANVIL_KEY); const multiProvider = MultiProvider.createTestMultiProvider({ signer }); + + // Get the provider for the first chain const provider = multiProvider.getProvider(TestChainName.test1); + // Create core from addresses const addresses = JSON.parse( fs.readFileSync('./config/environments/test/core/addresses.json', 'utf8'), ); const core = HyperlaneCore.fromAddressesMap(addresses, multiProvider); + // helper function to get a random element from a list const randomElement = (list: T[]) => list[Math.floor(Math.random() * list.length)]; @@ -121,9 +135,11 @@ async function main() { const run_forever = messages === 0; while (run_forever || messages-- > 0) { // Round robin origin chain - const local = core.chains()[messages % core.chains().length]; + const local = kathyTestChains[messages % kathyTestChains.length]; // Random remote chain - const remote: ChainName = randomElement(await core.remoteChains(local)); + const remote: ChainName = randomElement( + kathyTestChains.filter((c) => c !== local), + ); const remoteId = multiProvider.getDomainId(remote); const contracts = core.getContracts(local); const mailbox = contracts.mailbox; diff --git a/typescript/sdk/src/consts/testChains.ts b/typescript/sdk/src/consts/testChains.ts index 878de285a..a5e8b91ee 100644 --- a/typescript/sdk/src/consts/testChains.ts +++ b/typescript/sdk/src/consts/testChains.ts @@ -68,11 +68,6 @@ export const test3: ChainMetadata = { export const test4: ChainMetadata = { ...test1, - blocks: { - confirmations: 1, - estimateBlockTime: 3, - reorgPeriod: 2, - }, chainId: 31337, displayName: 'Test 4', domainId: 31337,