diff --git a/.circleci/config.yml b/.circleci/config.yml index 74be90f977a..61bbc786c58 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -72,6 +72,12 @@ parameters: go-cache-version: type: string default: "v0.1" + c-go_fresh_tests: + type: boolean + default: false + c-nut_provenance_full: + type: boolean + default: false orbs: continuation: circleci/continuation@2.0.1 @@ -216,6 +222,8 @@ jobs: name: Store boolean pipeline parameters in JSON file command: .circleci/scripts/collect-params.sh bool environment: + c-go_fresh_tests_effective: << pipeline.parameters.c-go_fresh_tests >> + c-nut_provenance_full_effective: << pipeline.parameters.c-nut_provenance_full >> c-main_dispatch: << pipeline.parameters.main_dispatch >> c-fault_proofs_dispatch: << pipeline.parameters.fault_proofs_dispatch >> c-reproducibility_dispatch: << pipeline.parameters.reproducibility_dispatch >> diff --git a/.circleci/continue/helpers.yml b/.circleci/continue/helpers.yml index 354e6e86c5f..f3d008ecd3a 100644 --- a/.circleci/continue/helpers.yml +++ b/.circleci/continue/helpers.yml @@ -1,18 +1,38 @@ # Shared command helpers merged into every continuation config (see # .circleci/scripts/merge-configs.sh). Defining them here once avoids # duplicating the definitions across main.yml and rust-e2e.yml. +executors: + ci-default-docker: + docker: + - image: <> + ci-memory-machine: + # The pilot matches RWX's 16 CPU / 64 GB allocation without reducing the + # acceptance suite's observed 38.5 GiB peak to a 32 GiB Docker worker. + machine: + image: <> + commands: # Shared Go module cache. There is a single Go module in the repo, so the - # downloaded module set is identical for every job at a given go.sum. It is + # downloaded module set is identified by go.mod/go.sum and the toolchain. It is # populated once by the prep-go-modules job and restored read-only everywhere - # else, so modules are downloaded a single time per go.sum rather than once + # else, so modules are downloaded once per module/toolchain snapshot, not once # per job (every download is an opportunity for a proxy.golang.org flake). # c-go-cache-version is the global cache-buster for breaking changes. restore-go-mod-cache: steps: + - run: + name: Configure shared Go module cache + command: | + # Machine images use a different GOPATH than the Docker image. + # Both must read the directory restored/saved by these helpers. + GO_MODULE_CACHE_DIR="$HOME/go/pkg/mod" + mkdir -p "$GO_MODULE_CACHE_DIR" + printf 'export GOMODCACHE=%q\n' "$GO_MODULE_CACHE_DIR" >> "$BASH_ENV" + printf 'Shared Go module cache: %s\n' "$GO_MODULE_CACHE_DIR" - restore_cache: name: Restore Go module cache (go.sum) keys: + - go-mod-<>-{{ checksum "go.mod" }}-{{ checksum "go.sum" }}-{{ checksum "mise.toml" }} - go-mod-<>-{{ checksum "go.sum" }} - go-mod-<>- @@ -20,7 +40,7 @@ commands: steps: - save_cache: name: Save Go module cache (go.sum) - key: go-mod-<>-{{ checksum "go.sum" }} + key: go-mod-<>-{{ checksum "go.mod" }}-{{ checksum "go.sum" }}-{{ checksum "mise.toml" }} paths: - ~/go/pkg/mod diff --git a/.circleci/continue/main.yml b/.circleci/continue/main.yml index 11b7490c25e..e614161c4a6 100644 --- a/.circleci/continue/main.yml +++ b/.circleci/continue/main.yml @@ -14,6 +14,21 @@ parameters: c-go-cache-version: type: string default: "v0.1" + c-go_fresh_tests: + type: boolean + default: false + c-go_fresh_tests_effective: + type: boolean + default: false + c-nut_provenance_full: + type: boolean + default: false + c-nut_provenance_full_effective: + type: boolean + default: false + c-run_selector_upload_replay: + type: boolean + default: false c-publish_contract_artifacts_ref: type: string default: "" @@ -684,8 +699,18 @@ commands: # time, so it needs no RUSTFLAGS change and does not perturb the sccache # compile-cache key. The CI env is controlled, so a missing mold must # fail loudly rather than silently falling back to the default linker. - mold -run cargo build $PROFILE $TARGET $PACKAGE $FEATURES $BINARY + if [ "<< parameters.directory >>" = rust ] && [ "<< parameters.profile >>" = debug ] && [ -z "<< parameters.package >>" ] && [ -z "<< parameters.binary >>" ] && [ "<< parameters.features >>" = default ] && [ -z "$TARGET" ]; then + bash ../ops/ci/runtime/rust-workspace.sh build + elif [ "<< parameters.directory >>" = rust ] && [ "<< parameters.profile >>" = release ] && [ -z "<< parameters.package >>" ] && [ -z "<< parameters.binary >>" ] && [ "<< parameters.features >>" = default ] && [ -z "$TARGET" ]; then + bash ../ops/ci/runtime/rust-e2e-release.sh + else + mold -run cargo build $PROFILE $TARGET $PACKAGE $FEATURES $BINARY + fi no_output_timeout: 30m + - store_artifacts: + path: .ci/rust-workspace + destination: rust-workspace + when: always - when: condition: << parameters.save_cache >> steps: @@ -888,22 +913,23 @@ jobs: mkdir -p ./tmp/test-results mkdir -p ./tmp/testlogs - run: - name: Cannon Go lint + name: Cannon Go lint and 64-bit tests + no_output_timeout: <> + environment: + CI_GO_FRESH_TESTS: << pipeline.parameters.c-go_fresh_tests_effective >> command: | - just lint - working_directory: cannon + python3 ops/ci/runtime/cannon-go.py --provider circleci --skip-slow-tests "<>" - run: - name: Cannon Go 64-bit tests - no_output_timeout: <> + name: Retain complete Cannon Go reports after failures + when: always command: | - export SKIP_SLOW_TESTS="<>" - TIMEOUT="10m" - if [ "$SKIP_SLOW_TESTS" = "false" ]; then - TIMEOUT="45m" + if [[ -f .ci/cannon-go/run/junit.xml ]]; then + cp .ci/cannon-go/run/junit.xml tmp/test-results/cannon-64.xml fi - ../ops/scripts/gotestsum-split.sh --format=testname --junitfile=../tmp/test-results/cannon-64.xml --jsonfile=../tmp/testlogs/log-64.json \ - -- -timeout=$TIMEOUT -parallel=$(nproc) ./... - working_directory: cannon + if [[ -f .ci/cannon-go/run/original.json ]]; then + cp .ci/cannon-go/run/original.json tmp/testlogs/log-64.json + fi + cp -a .ci/cannon-go/run/. tmp/testlogs/ - go-save-cache: namespace: cannon-go-lint-and-test - store_test_results: @@ -911,6 +937,9 @@ jobs: - store_artifacts: path: ./tmp/testlogs when: always + - store_artifacts: + path: .ci/cannon-go/run + when: always - when: condition: <> steps: @@ -983,6 +1012,18 @@ jobs: command: | just copy-contract-artifacts working_directory: op-deployer + - run: + name: Bind E2E contract dependency evidence + command: | + if [[ "<>" == ci && "<>" == "--skip test" ]]; then + export CI_COMMIT_SHA="$CIRCLE_SHA1" + python3 ops/ci/runtime/go-artifacts.py pack contracts-e2e packages/contracts-bedrock/cache \ + packages/contracts-bedrock/artifacts packages/contracts-bedrock/forge-artifacts \ + op-deployer/pkg/deployer/artifacts/forge-artifacts + fi + - store_artifacts: + path: .ci/go-tests/dependencies/contracts-e2e + when: always - go-save-cache: namespace: contracts-bedrock-build - persist_to_workspace: @@ -1050,13 +1091,11 @@ jobs: - setup_remote_docker: docker_layer_caching: true - run: - name: Run Kontrol build - command: just kontrol-summary-full - working_directory: packages/contracts-bedrock - - run: - name: Build Kontrol summary files - command: just forge-build ./test/kontrol/proofs - working_directory: packages/contracts-bedrock + name: Run original Kontrol summary and proof build with complete evidence + command: python3 ops/ci/runtime/kontrol-build.py --provider circleci + - store_artifacts: + path: .ci/kontrol-build/run + when: always - notify-failures-on-develop: mentions: "" @@ -1065,6 +1104,9 @@ jobs: - image: <> resource_class: 2xlarge.gen2 parameters: + parity_suite: + type: string + default: standard test_list: description: List of test files to run type: string @@ -1132,31 +1174,37 @@ jobs: - setup-features: features: <> - run: - name: Run tests - # `just test` partitions the shard between Amsterdam and default-EVM tests. + name: Run tests with complete original parity reports + # The runner partitions the shard between Amsterdam and default-EVM tests, as `just test` does. command: | - TEST_FILES=$(<>) - TEST_FILES=$(echo "$TEST_FILES" | circleci tests split --split-by=timings) - export TEST_FILES - JUNIT_TEST_DIR=results just test + python3 ops/ci/runtime/contract-suites.py run \ + --suite "<>" --feature "${CI_CONTRACT_FEATURE:-main}" environment: - FOUNDRY_PROFILE: <> - working_directory: packages/contracts-bedrock + CI_CONTRACT_FEATURE: "<>" + CI_CONTRACT_PROFILE: <> + CI_CONTRACT_TEST_LIST: <> + CI_CONTRACT_PROVIDER: circleci no_output_timeout: <> - run: - name: Print failed test traces - command: just test-rerun + name: Print failed dependency traces + command: | + run="../../.ci/contract-suites/<>-${CI_CONTRACT_FEATURE:-main}/run" + if [ ! -f "$run/tests-amsterdam.stage.json" ] && [ ! -f "$run/tests-l2.stage.json" ] \ + && { [ -s cache/test-failures-amsterdam ] || [ -s cache/test-failures-l2 ]; }; then + just test-rerun + fi environment: + CI_CONTRACT_FEATURE: "<>" FOUNDRY_PROFILE: <> working_directory: packages/contracts-bedrock when: on_fail - store_test_results: path: packages/contracts-bedrock/results when: always - - run: - name: Lint forge test names - command: just lint-forge-tests-check-no-build - working_directory: packages/contracts-bedrock + - store_artifacts: + path: .ci/contract-suites + destination: contract-suites + when: always - notify-failures-on-develop: mentions: "" @@ -1230,6 +1278,10 @@ jobs: description: Profile to use for testing type: string default: ci + parity_variant: + description: Shared full-workload parity identity; empty preserves the generic adapter + type: string + default: "" features: description: Comma-separated list of features to enable (e.g., "INTEROP", "CUSTOM_GAS_TOKEN") @@ -1276,9 +1328,14 @@ jobs: - run: name: Run tests command: | - mkdir -p results - just test-upgrade + if [ -n "$CI_CONTRACT_UPGRADE_VARIANT" ]; then + python3 ../../ops/ci/runtime/contract-upgrades.py run --variant "$CI_CONTRACT_UPGRADE_VARIANT" + else + mkdir -p results + just test-upgrade + fi environment: + CI_CONTRACT_UPGRADE_VARIANT: <> JUNIT_TEST_PATH: results/results.xml FOUNDRY_FUZZ_SEED: 42424242 FOUNDRY_FUZZ_RUNS: 1 @@ -1289,8 +1346,15 @@ jobs: no_output_timeout: 15m - run: name: Print failed test traces - command: just test-upgrade-rerun | tee failed-test-traces.log + command: | + if [ -n "$CI_CONTRACT_UPGRADE_VARIANT" ]; then + # The shared runner retains the original verdict and separate traces. + cat ../../.ci/contract-upgrades/"$CI_CONTRACT_UPGRADE_VARIANT"/run/rerun.log 2>/dev/null || true + else + just test-upgrade-rerun | tee failed-test-traces.log + fi environment: + CI_CONTRACT_UPGRADE_VARIANT: <> FOUNDRY_FUZZ_SEED: 42424242 FOUNDRY_FUZZ_RUNS: 1 FOUNDRY_PROFILE: <> @@ -1319,10 +1383,19 @@ jobs: - store_test_results: path: packages/contracts-bedrock/results when: always + - store_artifacts: + path: .ci/contract-upgrades + when: always + - store_test_results: + path: .ci/contract-upgrades + when: always - notify-failures-on-develop: mentions: "" contracts-bedrock-tests-l2-fork: parameters: + parity_shadow: + type: boolean + default: false fork_op_chain: description: L2 chain to fork for testing type: string @@ -1357,6 +1430,19 @@ jobs: steps: - checkout-with-mise: enable-mise-cache: true + - when: + condition: + or: + - <> + - equal: [codex/rwx-ci-pilot, <>] + steps: + - run: + name: Validate public L2 archive inputs before compilation + command: | + test "$CIRCLE_BRANCH" = codex/rwx-ci-pilot + python3 ops/ci/runtime/contract-l2-fork.py preflight --fork-block "$CI_L2_FORK_BLOCK" + environment: + CI_L2_FORK_BLOCK: <> - go-restore-cache: namespace: contracts-bedrock-tests-l2-fork - install-contracts-dependencies @@ -1398,16 +1484,24 @@ jobs: - run: name: Get latest block number if not specified command: | - if [ "<>" = "latest" ]; then + if [ "$CIRCLE_BRANCH" = codex/rwx-ci-pilot ] && [ -f ../../.ci/contract-l2-fork/preflight/block.json ]; then + BLOCK_NUMBER=$(jq -er '.number' ../../.ci/contract-l2-fork/preflight/block.json) + printf 'export L2_FORK_BLOCK_NUMBER=%s\n' "$BLOCK_NUMBER" >> "$BASH_ENV" + printf 'export L2_FORK_RPC_URL=%q\n' 'https://mainnet.optimism.io' >> "$BASH_ENV" + printf '%s\n' "$BLOCK_NUMBER" > ./l2ForkBlockNumber.txt + echo "Using shared pilot fork block: $BLOCK_NUMBER" + elif [ "$CI_L2_FORK_BLOCK" = "latest" ]; then BLOCK_NUMBER=$(cast block-number --rpc-url "$L2_FORK_RPC_URL") - echo "export L2_FORK_BLOCK_NUMBER=$BLOCK_NUMBER" >> $BASH_ENV + echo "export L2_FORK_BLOCK_NUMBER=$BLOCK_NUMBER" >> "$BASH_ENV" echo "Using latest block number: $BLOCK_NUMBER" echo "$BLOCK_NUMBER" > ./l2ForkBlockNumber.txt else - echo "export L2_FORK_BLOCK_NUMBER=<>" >> $BASH_ENV - echo "Using specified block number: <>" - echo "<>" > ./l2ForkBlockNumber.txt + printf 'export L2_FORK_BLOCK_NUMBER=%q\n' "$CI_L2_FORK_BLOCK" >> "$BASH_ENV" + echo "Using specified block number: $CI_L2_FORK_BLOCK" + printf '%s\n' "$CI_L2_FORK_BLOCK" > ./l2ForkBlockNumber.txt fi + environment: + CI_L2_FORK_BLOCK: <> working_directory: packages/contracts-bedrock - restore_cache: name: Restore forked L2 state @@ -1417,23 +1511,48 @@ jobs: features: <> - run: name: Check NUT bundle is up-to-date - command: just nut-bundle-check-no-build + command: | + if [ "$CI_L2_PARITY_SHADOW" = "true" ] || [ "$CI_L2_PARITY_SHADOW" = "1" ] || [ "$CIRCLE_BRANCH" = codex/rwx-ci-pilot ]; then + status=0 + python3 ../../ops/ci/runtime/contract-l2-fork.py prepare > ../../.ci/contract-l2-fork/prepare.console.log 2>&1 || status=$? + tail -n 20 ../../.ci/contract-l2-fork/prepare.console.log + exit "$status" + else + just nut-bundle-check-no-build + fi + environment: + CI_L2_PARITY_SHADOW: <> working_directory: packages/contracts-bedrock + no_output_timeout: 30m - run: name: Run L2 fork tests command: | - mkdir -p results - JUNIT_TEST_PATH=results/results.xml just test-l2-fork-upgrade + if [ "$CI_L2_PARITY_SHADOW" = "true" ] || [ "$CI_L2_PARITY_SHADOW" = "1" ] || [ "$CIRCLE_BRANCH" = codex/rwx-ci-pilot ]; then + status=0 + python3 ../../ops/ci/runtime/contract-l2-fork.py run --prepared ../../.ci/contract-l2-fork/prepare \ + --block ../../.ci/contract-l2-fork/preflight/block.json > ../../.ci/contract-l2-fork/run.console.log 2>&1 || status=$? + tail -n 20 ../../.ci/contract-l2-fork/run.console.log + exit "$status" + else + mkdir -p results + JUNIT_TEST_PATH=results/results.xml just test-l2-fork-upgrade + fi environment: FOUNDRY_PROFILE: <> + CI_L2_PARITY_SHADOW: <> working_directory: packages/contracts-bedrock no_output_timeout: 20m - run: name: Print failed test traces command: | - just test-l2-fork-upgrade-rerun | tee failed-test-traces-l2-fork.log + if [ "$CI_L2_PARITY_SHADOW" = "true" ] || [ "$CI_L2_PARITY_SHADOW" = "1" ] || [ "$CIRCLE_BRANCH" = codex/rwx-ci-pilot ]; then + tail -n 20 ../../.ci/contract-l2-fork/run/rerun.log 2>/dev/null || true + else + just test-l2-fork-upgrade-rerun | tee failed-test-traces-l2-fork.log + fi environment: FOUNDRY_PROFILE: <> + CI_L2_PARITY_SHADOW: <> working_directory: packages/contracts-bedrock when: on_fail - go-save-cache: @@ -1451,10 +1570,34 @@ jobs: - store_test_results: path: packages/contracts-bedrock/results when: always + - when: + condition: + or: + - <> + - equal: [codex/rwx-ci-pilot, <>] + steps: + - run: + name: Archive complete original L2 fork evidence + when: always + command: | + if [ -d .ci/contract-l2-fork ]; then + tar -C .ci/contract-l2-fork -czf .ci/contract-l2-fork-originals.tar.gz . + fi + - store_artifacts: + path: .ci/contract-l2-fork-originals.tar.gz + destination: contract-l2-fork-originals.tar.gz + when: always + - store_test_results: + path: .ci/contract-l2-fork/run + when: always - notify-failures-on-develop: mentions: "" contracts-bedrock-upload: + parameters: + selector_shadow: + type: boolean + default: false machine: true resource_class: large.gen2 steps: @@ -1465,15 +1608,63 @@ jobs: - check-changed: patterns: contracts-bedrock - get-target-branch - - run: - name: upload selectors - command: just update-selectors - working_directory: packages/contracts-bedrock + - unless: + condition: << parameters.selector_shadow >> + steps: + - run: + name: upload selectors + command: just update-selectors + working_directory: packages/contracts-bedrock + - when: + condition: << parameters.selector_shadow >> + steps: + - run: + name: Prepare private selector registry and complete ABI inventory + command: | + test "$CIRCLE_BRANCH" = codex/rwx-ci-pilot + mkdir -p .ci/selector-upload + # Keep the whole console stream; Circle's log API caps a + # step at 400 kB while this complete ABI table is larger. + { + git submodule sync --recursive + git -c protocol.file.allow=never submodule update --init --recursive --jobs 8 + bash .circleci/scripts/apt-install.sh iproute2 openssl + python3 ops/ci/migration/selector-registry.py images .ci/selector-registry + python3 ops/ci/migration/selector-upload.py prepare .ci/selector-upload/prepare + } > .ci/selector-upload/prepare.console.log 2>&1 + - run: + name: Run original selector publisher against private official registry + command: | + python3 ops/ci/migration/selector-upload.py run .ci/selector-upload/run .ci/selector-upload/prepare \ + .ci/selector-registry/sourcify .ci/selector-registry/images.json + - run: + name: Archive complete original selector reports + when: always + command: | + # Circle's directory artifact uploader omits empty files. + # Preserve every original byte and path in one archive too. + mkdir -p .ci/selector-upload + tar -C .ci/selector-upload -czf .ci/selector-upload-originals.tar.gz . + - store_artifacts: + path: .ci/selector-upload-originals.tar.gz + destination: selector-upload-originals.tar.gz + when: always + - run: + name: Archive complete original registry preparation + when: always + command: | + if [ -d .ci/selector-registry ]; then + tar -C .ci -czf .ci/selector-registry-originals.tar.gz selector-registry + fi + - store_artifacts: + path: .ci/selector-registry-originals.tar.gz + destination: selector-registry-originals.tar.gz + when: always required-contracts-ci: docker: - image: <> - resource_class: small.gen2 + resource_class: medium.gen2 parameters: always-succeed: description: Force always succeed (skip API gate; for contracts-feature-tests-short) @@ -1500,8 +1691,14 @@ jobs: command: forge --version - run: name: Run checks - command: just check-fast + command: python3 ../../ops/ci/runtime/pr-checks.py contracts-fast working_directory: packages/contracts-bedrock + - store_test_results: + path: .ci/pr-checks/contracts-fast + when: always + - store_artifacts: + path: .ci/pr-checks/contracts-fast + when: always - notify-failures-on-develop: mentions: "" @@ -1524,8 +1721,15 @@ jobs: checkout-method: blobless - run: name: Run shellcheck - command: | - find . -type f -name '*.sh' -not -path '*/node_modules/*' -not -path './packages/contracts-bedrock/lib/*' -not -path './packages/contracts-bedrock/kout*/*' -not -path './docs/public-docs/*' -not -path './rust/*target*/*' -print0 | xargs -0 shellcheck + # static-checks.py runs this job's find | xargs shellcheck and seals its reports. + command: python3 ops/ci/runtime/static-checks.py shell-check + - store_artifacts: + path: .ci/static-checks/shell-check + destination: static-checks/shell-check + when: always + - store_test_results: + path: .ci/static-checks/shell-check + when: always l2-chains-sync-check: docker: @@ -1535,7 +1739,13 @@ jobs: enable-mise-cache: false - run: name: Check l2-rpcs.json and daily matrix are in sync - command: bash .circleci/scripts/check-l2-chains-sync.sh + command: python3 ops/ci/migration/l2-chains-sync-check.py + - store_artifacts: + path: .ci/main-checks/l2-chains-sync-check + when: always + - store_test_results: + path: .ci/main-checks/l2-chains-sync-check + when: always todo-issues: parameters: @@ -1544,15 +1754,25 @@ jobs: default: true machine: image: <> + resource_class: large.gen2 steps: - checkout-with-mise: checkout-method: blobless enable-mise-cache: true - run: name: Check TODO issues - command: ./ops/scripts/todo-checker.sh --verbose --strict - <<#parameters.check_closed>> --check-closed - <> + command: | + if [ "<>" = "true" ]; then + ./ops/scripts/todo-checker.sh --verbose --strict --check-closed + else + python3 ops/ci/runtime/main-checks.py todo-issues-check + fi + - store_artifacts: + path: .ci/main-checks/todo-issues-check + when: always + - store_test_results: + path: .ci/main-checks/todo-issues-check + when: always - notify-failures-on-develop go-lint: @@ -1613,15 +1833,20 @@ jobs: check-op-geth-version: docker: - image: <> - resource_class: small.gen2 + resource_class: medium.gen2 steps: - checkout-with-mise: checkout-method: blobless enable-mise-cache: true - run: name: check op-geth version - command: | - just check-op-geth-version + command: python3 ops/ci/runtime/main-checks.py check-op-geth-version + - store_artifacts: + path: .ci/main-checks/check-op-geth-version + when: always + - store_test_results: + path: .ci/main-checks/check-op-geth-version + when: always opgeth-ratchet: docker: @@ -1653,7 +1878,7 @@ jobs: - run: name: Check op-geth-only API uses against the allowlist command: | - just opgeth-ratchet + python3 ops/ci/runtime/main-checks.py opgeth-ratchet - save_cache: name: Save upstream go-ethereum modules key: go-mod-opgeth-ratchet-<>-{{ checksum "go.mod" }} @@ -1664,6 +1889,12 @@ jobs: - ~/go/pkg/mod/cache/download/sumdb - go-save-cache: namespace: opgeth-ratchet + - store_artifacts: + path: .ci/main-checks/opgeth-ratchet + when: always + - store_test_results: + path: .ci/main-checks/opgeth-ratchet + when: always # Builds op-core/superchain/bundle/superchain-configs.zip from the pinned commit and # makes it available to downstream Go-build jobs via persist_to_workspace. @@ -1675,10 +1906,11 @@ jobs: # ~10s) and most of the job's wall-clock is mise restore anyway. Always # rebuilding gives strong consistency (every run validates the committed # .sha256 against a freshly-built zip) without cache-key complexity. + prep-superchain: docker: - image: <> - resource_class: small.gen2 + resource_class: medium.gen2 steps: - checkout-with-mise: checkout-method: blobless @@ -1718,27 +1950,21 @@ jobs: - run: name: Download Go modules command: | - # proxy.golang.org intermittently returns transient stream errors - # (INTERNAL_ERROR). Retry with exponential backoff so a flaky - # download doesn't fail this shared prep job and everything behind - # it. - n=0 - until go mod download; do - n=$((n+1)) - if [ "$n" -ge 5 ]; then - echo "go mod download failed after $n attempts" >&2 - exit 1 - fi - backoff=$((5 * 2 ** (n - 1))) - echo "go mod download failed (attempt $n); retrying in ${backoff}s..." >&2 - sleep "$backoff" - done + # Preserve the five downloads and exponential backoff, verify all + # downloaded modules, and retain the complete original module graph. + python3 ops/ci/runtime/pr-checks.py go-modules + - store_test_results: + path: .ci/pr-checks/go-modules + when: always + - store_artifacts: + path: .ci/pr-checks/go-modules + when: always - save-go-mod-cache check-nut-locks: docker: - image: <> - resource_class: small.gen2 + resource_class: medium.gen2 steps: - checkout-with-mise: checkout-method: blobless @@ -1747,8 +1973,13 @@ jobs: namespace: check-nut-locks - run: name: check nut locks - command: | - go run ./ops/scripts/check-nut-locks + command: python3 ops/ci/runtime/main-checks.py check-nut-locks + - store_artifacts: + path: .ci/main-checks/check-nut-locks + when: always + - store_test_results: + path: .ci/main-checks/check-nut-locks + when: always - go-save-cache: namespace: check-nut-locks @@ -1772,9 +2003,15 @@ jobs: command: | export RUST_BINARY_PATH_OP_RETH_TEST_ENGINE="$(pwd)/rust/target/release/op-reth-test-engine" test -x "$RUST_BINARY_PATH_OP_RETH_TEST_ENGINE" - just _check-nut-prefork-states + python3 ops/ci/runtime/nut-prefork.py --provider circleci - go-save-cache: namespace: check-nut-prefork-states + - store_test_results: + path: .ci/nut-prefork/run/native.junit.xml + when: always + - store_artifacts: + path: .ci/nut-prefork/run + when: always nut-provenance-verify: docker: @@ -1784,14 +2021,23 @@ jobs: - checkout-with-mise: enable-mise-cache: true - install-contracts-dependencies - - check-changed: - patterns: op-core/nuts + - when: + condition: + not: << pipeline.parameters.c-nut_provenance_full_effective >> + steps: + - check-changed: + patterns: op-core/nuts # The verify script runs `go run ./ops/scripts/nut-provenance-verify`. - restore-go-mod-cache - get-target-branch - run: name: verify NUT bundle provenance command: ./ops/scripts/nut-provenance-verify-changed.sh + environment: + CI_NUT_PROVENANCE_FULL: << pipeline.parameters.c-nut_provenance_full_effective >> + - store_artifacts: + path: .ci/nut-provenance/run + when: always go-tests: parameters: @@ -1852,8 +2098,10 @@ jobs: # needs libclang, absent from this image) or a stray local binary. echo "export RUST_BINARY_PATH_OP_RETH_TEST_ENGINE=$ROOT_DIR/rust/target/release/op-reth-test-engine" >> "$BASH_ENV" echo "export REQUIRE_RUST_ENGINE=1" >> "$BASH_ENV" + # Each worker must persist its own objects: immutable shared keys retain + # only the first finisher, leaving other shards partially cold next run. - go-restore-cache: - namespace: go-tests + namespace: "go-tests-node-{{ .Environment.CIRCLE_NODE_INDEX }}" - run: name: Run Go tests no_output_timeout: <> @@ -1861,8 +2109,14 @@ jobs: <> export TEST_TIMEOUT=<> just <> + environment: + CI_GO_FRESH_TESTS: << pipeline.parameters.c-go_fresh_tests_effective >> + - store_artifacts: + path: ./tmp/test-results + destination: go-junit + when: always - go-save-cache: - namespace: go-tests + namespace: "go-tests-node-{{ .Environment.CIRCLE_NODE_INDEX }}" - store_test_results: path: ./tmp/test-results - run: @@ -2163,6 +2417,7 @@ jobs: cannon-prestate: machine: docker_layer_caching: true # we rely on this for faster builds, and actively warm it up for builds with common stages + resource_class: large.gen2 steps: - checkout-with-mise: checkout-method: blobless @@ -2170,6 +2425,14 @@ jobs: - run: name: Build prestates command: just reproducible-prestate + - run: + name: Bind original prestate hashes + command: | + export CI_COMMIT_SHA="$CIRCLE_SHA1" + python3 ops/ci/runtime/go-artifacts.py pack prestate rust/kona/prestate-artifacts-* + - store_artifacts: + path: .ci/go-tests/dependencies/prestate + when: always - persist_to_workspace: root: . paths: @@ -2219,6 +2482,9 @@ jobs: semgrep-scan: parameters: + parity_job: + type: string + default: "" diff_branch: type: string default: develop @@ -2231,7 +2497,7 @@ jobs: SEMGREP_BRANCH: << pipeline.git.branch >> SEMGREP_COMMIT: << pipeline.git.revision >> docker: - - image: returntocorp/semgrep + - image: returntocorp/semgrep@sha256:32e459968daabe7ab86968184a29109b9564aa00392401156f9788452b42786b resource_class: xlarge.gen2 steps: - github-checkout: # no need to use mise here since the docker image contains the only dependency @@ -2257,9 +2523,21 @@ jobs: # --timeout (in seconds) limits the time per rule and file. # SEMGREP_TIMEOUT is the same, but docs have conflicting defaults (5s in CLI flag, 1800 in some places) # https://semgrep.dev/docs/troubleshooting/semgrep-app#if-the-job-is-aborted-due-to-taking-too-long - command: << parameters.scan_command >> + command: | + if [[ -n "<>" ]]; then + python3 ops/ci/runtime/static-checks.py "<>" + else + << parameters.scan_command >> + fi # If semgrep hangs, stop the scan after 20m, to prevent a useless 5h job no_output_timeout: 20m + - store_artifacts: + path: .ci/static-checks + destination: static-checks + when: always + - store_test_results: + path: .ci/static-checks + when: always - notify-failures-on-develop check-generated-mocks-op-node: @@ -2276,7 +2554,13 @@ jobs: namespace: check-generated-mocks-op-node - run: name: check-generated-mocks - command: just generate-mocks-op-node && git diff --exit-code + command: python3 ops/ci/runtime/main-checks.py check-generated-mocks-op-node + - store_artifacts: + path: .ci/main-checks/check-generated-mocks-op-node + when: always + - store_test_results: + path: .ci/main-checks/check-generated-mocks-op-node + when: always - go-save-cache: namespace: check-generated-mocks-op-node @@ -2294,7 +2578,13 @@ jobs: namespace: check-generated-mocks-op-service - run: name: check-generated-mocks - command: just generate-mocks-op-service && git diff --exit-code + command: python3 ops/ci/runtime/main-checks.py check-generated-mocks-op-service + - store_artifacts: + path: .ci/main-checks/check-generated-mocks-op-service + when: always + - store_test_results: + path: .ci/main-checks/check-generated-mocks-op-service + when: always - go-save-cache: namespace: check-generated-mocks-op-service @@ -2313,8 +2603,13 @@ jobs: no_go_deps: "true" - restore-go-mod-cache - run: - command: just check-forge-version - working_directory: op-deployer + command: python3 ops/ci/runtime/main-checks.py op-deployer-forge-version + - store_artifacts: + path: .ci/main-checks/op-deployer-forge-version + when: always + - store_test_results: + path: .ci/main-checks/op-deployer-forge-version + when: always kontrol-tests: docker: @@ -2428,26 +2723,35 @@ jobs: - run: name: Generate flaky acceptance tests report command: | - # Create reports directory - mkdir -p ./op-acceptance-tests/reports - - # Make the script executable - chmod +x ./op-acceptance-tests/scripts/generate-flaky-tests-report.sh - - # Run the script - ./op-acceptance-tests/scripts/generate-flaky-tests-report.sh \ - --branch "${CIRCLE_BRANCH:-develop}" \ - --org "${CIRCLE_PROJECT_USERNAME}" \ - --repo "${CIRCLE_PROJECT_REPONAME}" \ - --token "${CIRCLE_API_TOKEN}" \ - --output-dir "./op-acceptance-tests/reports" + python3 ops/ci/migration/flaky-report.py run .ci/flaky-report/run + - run: + name: Archive complete original flaky-test report + when: always + command: | + if [ -d .ci/flaky-report/run ]; then + tar -C .ci/flaky-report -czf .ci/flaky-report-originals.tar.gz run + fi + - store_artifacts: + path: .ci/flaky-report-originals.tar.gz + destination: flaky-report-originals.tar.gz + when: always # Store the flaky test reports - store_artifacts: - path: ./op-acceptance-tests/reports + path: .ci/flaky-report/run/reports destination: flaky-test-reports + when: always workflows: + # Test-only publication shadow selected on pilot pushes; no API replay route. + selector-upload-replay: + when: << pipeline.parameters.c-run_selector_upload_replay >> + jobs: + - contracts-bedrock-upload: + selector_shadow: true + context: + - circleci-repo-readonly-authenticated-github-token + main: when: << pipeline.parameters.c-run_main >> jobs: @@ -2485,12 +2789,14 @@ workflows: - circleci-repo-readonly-authenticated-github-token - semgrep-scan: name: semgrep-scan-local + parity_job: semgrep-scan-local scan_command: semgrep scan --timeout=100 --config .semgrep/rules/ --error . context: - slack - circleci-repo-readonly-authenticated-github-token - semgrep-scan: name: semgrep-test + parity_job: semgrep-test scan_command: semgrep scan --test --config .semgrep/rules/ .semgrep/tests/ context: - slack @@ -2627,8 +2933,10 @@ workflows: - prep-go-modules context: - circleci-repo-readonly-authenticated-github-token - # OP Node retains 20 vCPU / 40 GiB after a 38.5 GiB observed peak; Kona trials - # 16 vCPU / 32 GiB after a 21.3 GiB observed peak. + # Preserve the observed 38.5 GiB OP Node peak with 20 CPU / 40 GB Docker. + # Acceptance must run on the image that built its Rust binaries, so it + # cannot use the 16 CPU / 64 GB machine that matched RWX before #23594. + # Kona retains 16 CPU / 32 GB after a 21.3 GiB observed peak. # IN-MEMORY - op-node/op-reth - op-acceptance-tests: name: memory-all-opn-op-reth-<> @@ -2923,6 +3231,7 @@ workflows: './test/**/*.t.sol' | sed 's|packages/contracts-bedrock/||' test_timeout: 1h test_profile: ciheavy + parity_suite: modified features: <> matrix: parameters: @@ -2986,6 +3295,7 @@ workflows: # On PRs, run upgrade tests with lite profile for better build times. - contracts-bedrock-tests-upgrade: name: contracts-bedrock-tests-upgrade op-mainnet <> + parity_variant: feature-<> requires: - prep-go-modules fork_op_chain: op @@ -3005,6 +3315,7 @@ workflows: # On develop, run upgrade tests with ci profile to mirror production. - contracts-bedrock-tests-upgrade: name: contracts-bedrock-tests-upgrade-develop op-mainnet <> + parity_variant: feature-<> requires: - prep-go-modules fork_op_chain: op @@ -3024,6 +3335,7 @@ workflows: # On PRs, run chain-specific upgrade tests with lite profile for better build times. - contracts-bedrock-tests-upgrade: name: contracts-bedrock-tests-upgrade <>-mainnet + parity_variant: chain-<> requires: - prep-go-modules fork_op_chain: <> @@ -3042,6 +3354,7 @@ workflows: # On develop, run chain-specific upgrade tests with ci profile to mirror production. - contracts-bedrock-tests-upgrade: name: contracts-bedrock-tests-upgrade-develop <>-mainnet + parity_variant: chain-<> requires: - prep-go-modules fork_op_chain: <> diff --git a/.circleci/continue/rust-ci.yml b/.circleci/continue/rust-ci.yml index 0de4cd17d4d..6e245d67f06 100644 --- a/.circleci/continue/rust-ci.yml +++ b/.circleci/continue/rust-ci.yml @@ -71,9 +71,10 @@ jobs: description: "Clippy command to run" type: string default: "cargo clippy --workspace --all-targets --all-features" + # Preserve the Rust image and compiler cache while matching cold memory. docker: - image: <> - resource_class: medium.gen2 + resource_class: << pipeline.git.branch == "codex/rwx-ci-pilot" and "large.gen2" or "medium.gen2" >> steps: - checkout-with-mise: checkout-method: blobless @@ -87,6 +88,10 @@ jobs: environment: RUSTFLAGS: -Dwarnings command: <> + - store_artifacts: + path: .ci/rust-workspace + destination: rust-workspace + when: always - rust-save-build-cache: *clippy-cache-args # Shared cargo deny job @@ -112,6 +117,13 @@ jobs: name: Run cargo deny working_directory: <> command: <> + - store_artifacts: + path: .ci/rust-workspace + destination: rust-workspace + when: always + - store_test_results: + path: .ci/rust-workspace + when: always # No cache save: downloads no crates (index only). # Ping @protocol-oncall if it fails on develop. - notify-failures-on-develop: @@ -139,7 +151,16 @@ jobs: - run: name: Check feature propagation working_directory: <> - command: <> + command: | + if [[ "<>" == rust && "<>" == 'zepter run check' ]]; then + bash ../ops/ci/runtime/rust-workspace.sh zepter + else + <> + fi + - store_artifacts: + path: .ci/rust-workspace + destination: rust-workspace + when: always # No cache save: downloads no crates. # Shared typos check job @@ -160,7 +181,16 @@ jobs: - run: name: Check for typos working_directory: <> - command: typos + command: | + if [[ "<>" == rust ]]; then + bash ../ops/ci/runtime/rust-workspace.sh typos + else + typos + fi + - store_artifacts: + path: .ci/rust-workspace + destination: rust-workspace + when: always # No cache save: downloads no crates. # Shared no_std compatibility check job @@ -187,6 +217,10 @@ jobs: working_directory: <> no_output_timeout: 30m command: <> + - store_artifacts: + path: .ci/rust-workspace + destination: rust-workspace + when: always - rust-save-build-cache: *no-std-cache-args # Shared documentation build job @@ -213,6 +247,10 @@ jobs: working_directory: <> no_output_timeout: 30m command: <> + - store_artifacts: + path: .ci/rust-workspace + destination: rust-workspace + when: always - rust-save-build-cache: *docs-cache-args # Shared doc test job @@ -238,6 +276,10 @@ jobs: working_directory: <> no_output_timeout: 30m command: <> + - store_artifacts: + path: .ci/rust-workspace + destination: rust-workspace + when: always - rust-save-build-cache: *doctest-cache-args # Shared cargo tests job @@ -271,7 +313,12 @@ jobs: name: Run cargo tests working_directory: <> no_output_timeout: 40m - command: just <> <> + command: | + if [ "<>" = rust ] && [ "<>" = test ] && [ -z "<>" ]; then + bash ../ops/ci/runtime/rust-workspace.sh tests + else + just <> <> + fi # Surface individual test results in the CircleCI UI, including on failure. # nextest writes JUnit to /target/nextest/default/junit.xml. - store_test_results: @@ -331,6 +378,10 @@ jobs: echo "slack response: $resp" echo "$resp" | grep -q '"ok":true' || echo "SLACK POST FAILED (non-fatal) — check token/channel/mentions" exit 0 + - store_artifacts: + path: .ci/rust-workspace + destination: rust-workspace + when: always - rust-save-build-cache: *tests-cache-args # Cross-language differential test: runs the Go and Rust dumps of the Interop @@ -349,14 +400,13 @@ jobs: # builds Go code. Restore the shared Go module cache to avoid a cold # `go mod download` (slow, and a per-pipeline proxy.golang.org flake risk). - restore-go-mod-cache - # Build the superchain-configs.zip the Go dumper //go:embeds (no prep-superchain job here). - - run: - name: Build superchain bundle - command: just build-superchain-go - run: - name: Cross-language Interop activation diff - command: | - bash ops/scripts/test-interop-deposits-diff.sh + name: Build superchain bundle and compare original Interop dumps + command: bash ops/ci/runtime/rust-workspace.sh interop + - store_artifacts: + path: .ci/rust-workspace + destination: rust-workspace + when: always - rust-save-build-cache: *interop-diff-cache-args # Shared unused dependencies check job @@ -369,9 +419,10 @@ jobs: description: "Command to run for unused dependency check" type: string default: "just check-udeps" + # Preserve the Rust image and compiler cache while matching cold memory. docker: - image: <> - resource_class: medium.gen2 + resource_class: << pipeline.git.branch == "codex/rwx-ci-pilot" and "large.gen2" or "medium.gen2" >> steps: - checkout-with-mise: checkout-method: blobless @@ -383,6 +434,10 @@ jobs: working_directory: <> no_output_timeout: 40m command: <> + - store_artifacts: + path: .ci/rust-workspace + destination: rust-workspace + when: always - rust-save-build-cache: *udeps-cache-args # Shared cargo hack build job (cross-compile targets like WASM) @@ -410,7 +465,18 @@ jobs: name: Build for <> working_directory: <> no_output_timeout: 40m - command: rustup target add <> && cargo hack build --target <> <> + command: | + if [[ "<>" == rust && "<>" == wasm32-unknown-unknown && "<>" == '-p op-alloy-consensus -p op-alloy-rpc-types -p op-alloy-rpc-types-engine -p alloy-op-evm --no-default-features' ]]; then + bash ../ops/ci/runtime/rust-workspace.sh wasm-unknown + elif [[ "<>" == rust && "<>" == wasm32-wasip1 && "<>" == '-p op-alloy-consensus -p op-alloy-rpc-types-engine -p alloy-op-evm' ]]; then + bash ../ops/ci/runtime/rust-workspace.sh wasm-wasi + else + rustup target add <> && cargo hack build --target <> <> + fi + - store_artifacts: + path: .ci/rust-workspace + destination: rust-workspace + when: always - rust-save-build-cache: *hack-build-cache-args # Shared cargo hack job @@ -432,31 +498,14 @@ jobs: directory: rust features: "all" - run: - name: Run cargo hack - working_directory: rust - no_output_timeout: 60m - command: | - PARTITION_FLAG="" - if [ "$CIRCLE_NODE_TOTAL" -gt 1 ]; then - PARTITION_FLAG="$((CIRCLE_NODE_INDEX + 1))/$CIRCLE_NODE_TOTAL" - fi - just hack "$PARTITION_FLAG" "true" "$CIRCLE_WORKFLOW_ID" - # Check each crate's test targets in isolation with default features. The - # lib-only `hack` step above never compiles test code, so a crate whose - # tests rely on a feature only enabled via workspace feature unification - # passes the workspace test build yet fails when built alone. This step - # catches that class (whether the missing feature is a dependency's or the - # crate's own). - - run: - name: Run cargo hack (test targets) + name: Run library features and isolated test targets working_directory: rust no_output_timeout: 60m - command: | - PARTITION_FLAG="" - if [ "$CIRCLE_NODE_TOTAL" -gt 1 ]; then - PARTITION_FLAG="$((CIRCLE_NODE_INDEX + 1))/$CIRCLE_NODE_TOTAL" - fi - just hack-tests-default "$PARTITION_FLAG" "true" "$CIRCLE_WORKFLOW_ID" + command: bash ../ops/ci/runtime/rust-workspace.sh features + - store_artifacts: + path: .ci/rust-workspace + destination: rust-workspace + when: always - rust-save-build-cache: *hack-cache-args # -------------------------------------------------------------------------- @@ -533,37 +582,15 @@ jobs: extra_flags: "--no-install-recommends" - rust-prepare - run: - name: Build cannon - command: | - cd cannon && just cannon - sudo mv ./bin/cannon /usr/local/bin/ - - run: - name: Set run environment - command: | - echo 'export BLOCK_NUMBER=47600000' >> $BASH_ENV - echo 'export L2_CLAIM=0x6ac07d241d170ddd504532a2c8127bb85426e604a360f8ba2d976be3cc0aa7f0' >> $BASH_ENV - echo 'export L2_OUTPUT_ROOT=0x9c799a1b767f43d6c654f83e18ae20bfc2953e94e5093ef59664ae8244ffdc96' >> $BASH_ENV - echo 'export L2_HEAD=0x0084ac82023844b6f286783f3ea0ffddb8e597211ffbe01b56d8873f36a8bacb' >> $BASH_ENV - echo 'export L1_HEAD=0xf82badb3d56a53c373b501ec24e1e9ab2797feaab552c0d683849b1234308a2d' >> $BASH_ENV - echo 'export L2_CHAIN_ID=11155420' >> $BASH_ENV - - run: - name: Run host + client offline - working_directory: rust/kona/bin/client + name: Full Cannon host/client offline run and fresh guest-state verdict no_output_timeout: 40m - command: | - # Pre-create the workspace target dir as the circleci user. Without - # this, `just build-cannon-client` (invoked inside run-client-cannon-offline) - # runs Docker as root and creates `rust/target/` with root ownership, - # which then breaks the subsequent native `cargo build --bin kona-host` - # with EACCES when it tries to create `target/debug`. - mkdir -p ../../../target - just run-client-cannon-offline \ - $BLOCK_NUMBER \ - $L2_CLAIM \ - $L2_OUTPUT_ROOT \ - $L2_HEAD \ - $L1_HEAD \ - $L2_CHAIN_ID + command: bash ops/ci/runtime/rust-cannon.sh offline + - store_test_results: + path: .ci/rust-workspace/cannon-offline/checks.junit.xml + - store_artifacts: + path: .ci/rust-workspace + destination: rust-workspace + when: always # Kona Rust CI - Lint (cannon target) kona-cargo-lint: @@ -587,7 +614,18 @@ jobs: working_directory: rust/kona no_output_timeout: 40m command: | - just lint-<> + if [[ "<>" == cannon ]]; then + bash ../../ops/ci/runtime/rust-cannon.sh lint + else + just lint-<> + fi + + - store_test_results: + path: .ci/rust-workspace/cannon-lint/checks.junit.xml + - store_artifacts: + path: .ci/rust-workspace + destination: rust-workspace + when: always # Kona Build FPVM targets kona-build-fpvm: @@ -609,7 +647,18 @@ jobs: working_directory: rust/kona no_output_timeout: 40m command: | - just build-<> + if [[ "<>" == cannon-client ]]; then + bash ../../ops/ci/runtime/rust-cannon.sh build + else + just build-<> + fi + + - store_test_results: + path: .ci/rust-workspace/cannon-build/checks.junit.xml + - store_artifacts: + path: .ci/rust-workspace + destination: rust-workspace + when: always # Verifies that the committed `etc/{chainList,configs,depsets}.json` snapshots # in `kona-registry` match what `KONA_SYNC_SUPERCHAIN=true cargo build -p kona-registry` @@ -627,26 +676,12 @@ jobs: - rust-prepare-and-restore-cache: directory: rust - run: - name: Regenerate kona-registry snapshots - working_directory: rust/kona - environment: - KONA_SYNC_SUPERCHAIN: "true" - command: cargo build -p kona-registry - - run: - name: Assert committed snapshots match regenerated output - command: | - if ! git diff --exit-code -- \ - rust/kona/crates/protocol/registry/etc/; then - echo - echo "kona-registry etc/ snapshots are out of sync with the" - echo "superchain-registry submodule. Run:" - echo - echo " KONA_SYNC_SUPERCHAIN=true cargo build -p kona-registry" - echo - echo "from rust/kona and commit the resulting changes to" - echo "rust/kona/crates/protocol/registry/etc/." - exit 1 - fi + name: Regenerate and verify all kona-registry snapshots freshly + command: bash ops/ci/runtime/rust-workspace.sh registry + - store_artifacts: + path: .ci/rust-workspace + destination: rust-workspace + when: always # No cache save: single-package build, partial registry. # Verifies that op-reth's committed superchain-configs.tar.sha256 and the @@ -970,13 +1005,13 @@ workflows: - rust-ci-clippy: name: rust-clippy directory: rust - command: "cargo clippy --workspace --all-targets --all-features --locked" + command: "bash ../ops/ci/runtime/rust-workspace.sh clippy" context: *rust-ci-context - rust-ci-deny: name: rust-deny directory: rust - command: "just deny" + command: "bash ../ops/ci/runtime/rust-workspace.sh deny" # Not the shared *rust-ci-context anchor: this job and the two cargo-test jobs # below additionally need the `slack` context (SLACK_ACCESS_TOKEN) — rust-deny to # ping @protocol-oncall on a develop failure (below), the test jobs for the @@ -1013,16 +1048,19 @@ workflows: - rust-ci-doctest: name: rust-doctest directory: rust + command: "bash ../ops/ci/runtime/rust-workspace.sh doctest" context: *rust-ci-context - rust-ci-docs: name: rust-docs directory: rust + command: "bash ../ops/ci/runtime/rust-workspace.sh docs" context: *rust-ci-context - rust-ci-udeps: name: rust-udeps directory: rust + command: "bash ../ops/ci/runtime/rust-workspace.sh udeps" context: *rust-ci-context - rust-ci-cargo-hack: @@ -1048,8 +1086,7 @@ workflows: - rust-ci-check-no-std: name: rust-check-no-std directory: rust - command: | - just check-no-std + command: bash ../ops/ci/runtime/rust-workspace.sh no-std context: *rust-ci-context - rust-ci-cargo-hack-build: diff --git a/.circleci/continue/rust-e2e.yml b/.circleci/continue/rust-e2e.yml index a96a13d3651..4c5bab90d72 100644 --- a/.circleci/continue/rust-e2e.yml +++ b/.circleci/continue/rust-e2e.yml @@ -45,70 +45,7 @@ commands: - sp1-toolchain-v1-{{ arch }}-{{ checksum "mise.toml" }} - run: name: Install or link SP1 toolchain - command: | - install_sp1_toolchain() { - (cd rust/kona/sp1 && just install-sp1-toolchain) - } - - mise_sp1_version="$(yq -r '.tools."github:succinctlabs/sp1".version // ""' mise.toml)" - root_manifest_sp1_sdk="$(yq -r '.workspace.dependencies."sp1-sdk".version // ""' rust/Cargo.toml)" - guest_manifest_sp1_lib="$(yq -r '.workspace.dependencies."sp1-lib".version // ""' rust/kona/sp1/programs/Cargo.toml)" - guest_manifest_sp1_zkvm="$(yq -r '.workspace.dependencies."sp1-zkvm".version // ""' rust/kona/sp1/programs/Cargo.toml)" - sp1_tag="$(cd rust/kona/sp1 && just --evaluate SP1_TAG 2>/dev/null || printf '')" - - lock_data_dir="$(mktemp -d)" - trap 'rm -rf "$lock_data_dir"' EXIT - root_lock_sp1_sdk="" - if yq -p=toml -o=json '.package // []' rust/Cargo.lock > "$lock_data_dir/root.json"; then - if ! root_lock_sp1_sdk="$(jq -er '[.[] | select(.name == "sp1-sdk") | .version] | unique | if length == 1 then .[0] else error("expected exactly one resolved sp1-sdk version") end' "$lock_data_dir/root.json")"; then - root_lock_sp1_sdk="" - fi - fi - - guest_lock_sp1_lib="" - guest_lock_sp1_zkvm="" - if yq -p=toml -o=json '.package // []' rust/kona/sp1/programs/Cargo.lock > "$lock_data_dir/guest.json"; then - if ! guest_lock_sp1_lib="$(jq -er '[.[] | select(.name == "sp1-lib") | .version] | unique | if length == 1 then .[0] else error("expected exactly one resolved sp1-lib version") end' "$lock_data_dir/guest.json")"; then - guest_lock_sp1_lib="" - fi - if ! guest_lock_sp1_zkvm="$(jq -er '[.[] | select(.name == "sp1-zkvm") | .version] | unique | if length == 1 then .[0] else error("expected exactly one resolved sp1-zkvm version") end' "$lock_data_dir/guest.json")"; then - guest_lock_sp1_zkvm="" - fi - fi - - if [ "$root_manifest_sp1_sdk" != "$mise_sp1_version" ] || \ - [ "$guest_manifest_sp1_lib" != "$mise_sp1_version" ] || \ - [ "$guest_manifest_sp1_zkvm" != "$mise_sp1_version" ] || \ - [ "$root_lock_sp1_sdk" != "$mise_sp1_version" ] || \ - [ "$guest_lock_sp1_lib" != "$mise_sp1_version" ] || \ - [ "$guest_lock_sp1_zkvm" != "$mise_sp1_version" ] || \ - [ "$sp1_tag" != "v${mise_sp1_version}" ]; then - printf '%s\n' \ - "ERROR: SP1 version drift; mise.toml cargo-prove is canonical." \ - " mise.toml cargo-prove: ${mise_sp1_version}" \ - " rust/Cargo.toml sp1-sdk: ${root_manifest_sp1_sdk}" \ - " rust/Cargo.lock resolved sp1-sdk: ${root_lock_sp1_sdk}" \ - " rust/kona/sp1/programs/Cargo.toml sp1-lib: ${guest_manifest_sp1_lib}" \ - " rust/kona/sp1/programs/Cargo.toml sp1-zkvm: ${guest_manifest_sp1_zkvm}" \ - " rust/kona/sp1/programs/Cargo.lock resolved sp1-lib: ${guest_lock_sp1_lib}" \ - " rust/kona/sp1/programs/Cargo.lock resolved sp1-zkvm: ${guest_lock_sp1_zkvm}" \ - " rust/kona/sp1/justfile SP1_TAG: ${sp1_tag} (expected v${mise_sp1_version})" >&2 - exit 1 - fi - - toolchain_dir="$(find "$HOME/.sp1/toolchains" -mindepth 1 -maxdepth 1 -type d -print -quit 2>/dev/null || true)" - if [ -n "$toolchain_dir" ]; then - rustup toolchain remove succinct || true - if rustup toolchain link succinct "$toolchain_dir" && rustc +succinct --version >/dev/null; then - echo "Restored SP1 toolchain from $toolchain_dir" - else - echo "Cached SP1 toolchain is invalid; reinstalling" - install_sp1_toolchain - fi - else - install_sp1_toolchain - fi - rustc +succinct --version + command: python3 ops/ci/runtime/sp1-guest.py --provider circleci --phase toolchain - save_cache: name: Save SP1 toolchain cache key: sp1-toolchain-v1-{{ arch }}-{{ checksum "mise.toml" }} @@ -151,7 +88,7 @@ jobs: echo "Running tests..." export RUST_BINARY_PATH_OP_RETH="$WD/rust/target/release/op-reth" export RUST_BINARY_PATH_KONA_NODE="$WD/rust/target/release/kona-node" - cd rust/kona && just test-e2e-sysgo-run node node/common "<>" + bash ops/ci/runtime/rust-e2e.sh circle "<>" - when: condition: equal: [true, <>] @@ -168,10 +105,18 @@ jobs: - go-save-cache: namespace: kona-ci - store_test_results: - path: rust/kona/tests/tmp/test-results + path: .ci/rust-e2e/reports - store_artifacts: - path: rust/kona/tests/tmp/testlogs + path: .ci/rust-e2e when: always + - when: + condition: <> + steps: + - store_test_results: + path: rust/kona/tests/tmp/test-results + - store_artifacts: + path: rust/kona/tests/tmp/testlogs + when: always # Kona Node Restart Tests (from node_e2e_sysgo_tests.yaml) rust-restart-sysgo-tests: @@ -202,13 +147,13 @@ jobs: WD=$(pwd) export RUST_BINARY_PATH_OP_RETH="$WD/rust/target/release/op-reth" export RUST_BINARY_PATH_KONA_NODE="$WD/rust/target/release/kona-node" - cd rust/kona && just test-e2e-sysgo-run node node/restart + bash ops/ci/runtime/rust-e2e.sh circle restart - go-save-cache: namespace: kona-ci - store_test_results: - path: rust/kona/tests/tmp/test-results + path: .ci/rust-e2e/reports - store_artifacts: - path: rust/kona/tests/tmp/testlogs + path: .ci/rust-e2e when: always # op-reth E2E Sysgo Tests @@ -233,13 +178,13 @@ jobs: no_output_timeout: 60m command: | export RUST_BINARY_PATH_OP_RETH="$(pwd)/../../target/release/op-reth" - just test-e2e-sysgo + bash ../../../ops/ci/runtime/rust-e2e.sh circle op-reth - go-save-cache: namespace: op-reth-e2e - store_test_results: - path: rust/op-reth/tests/tmp/test-results + path: .ci/rust-e2e/reports - store_artifacts: - path: rust/op-reth/tests/tmp/testlogs + path: .ci/rust-e2e when: always # Kona Proof Action Tests (from proof.yaml) @@ -275,13 +220,14 @@ jobs: export RUST_BINARY_PATH_OP_RETH_TEST_ENGINE=$(pwd)/../target/release/op-reth-test-engine test -x "$KONA_HOST_PATH" test -x "$RUST_BINARY_PATH_OP_RETH_TEST_ENGINE" - just action-tests-<>-run + if [[ "<>" != single ]]; then echo "Unsupported shared proof kind" >&2; exit 1; fi + bash ../../ops/ci/runtime/rust-e2e.sh circle proof - go-save-cache: namespace: kona-ci - store_test_results: - path: rust/kona/tests/proofs/tmp/test-results + path: .ci/rust-e2e/reports - store_artifacts: - path: rust/kona/tests/proofs/tmp/testlogs + path: .ci/rust-e2e when: always # Build SP1 guest ELFs and persist them for future rust-e2e consumers. @@ -292,7 +238,8 @@ jobs: default: "" docker: - image: <> - resource_class: large.gen2 + # The matched pilot includes RWX's engine RAM reserve in its headroom. + resource_class: << pipeline.git.branch == "codex/rwx-ci-pilot" and "xlarge.gen2" or "large.gen2" >> steps: - checkout-with-mise: checkout-method: blobless @@ -302,15 +249,9 @@ jobs: init_superchain_submodule: false - sp1-toolchain-restore-or-install - run: - # Check the committed guest lock before build-elfs-native regenerates it in place and masks drift. - name: Check SP1 guest lock - working_directory: rust - command: just check-sp1-guest-lock - - run: - name: Build SP1 guest ELFs - working_directory: rust/kona/sp1 + name: Build SP1 guest ELFs with complete original artifact evidence no_output_timeout: 40m - command: just build-elfs-native "<< parameters.features >>" + command: python3 ops/ci/runtime/sp1-guest.py --provider circleci --phase build --features "<< parameters.features >>" - run: # The Go acceptance setup (op-acceptance-tests/tests/proofs/zk, # loadSuperAggregationVKey) reads super-aggregation when running with @@ -360,23 +301,14 @@ jobs: paths: - rust/kona/sp1/elf/ - run: - name: Test SP1 guest programs - working_directory: rust - environment: - RUSTFLAGS: -Dwarnings - command: just test-sp1-guest - - run: - name: Lint SP1 guest programs - working_directory: rust - environment: - RUSTFLAGS: -Dwarnings - command: just lint-sp1-guest - - run: - name: Check + test the vkey crates - working_directory: rust - environment: - RUSTFLAGS: -Dwarnings - command: just check-vkey-crates + name: Run all original SP1 guest, lint and range-vkeys checks freshly + no_output_timeout: 40m + command: python3 ops/ci/runtime/sp1-guest.py --provider circleci --phase checks --features "<< parameters.features >>" + - store_test_results: + path: .ci/sp1-guest/run + - store_artifacts: + path: .ci/sp1-guest + when: always - rust-save-build-cache: *sp1-guest-checks-cache-args sp1-super-range-elf-smoke: diff --git a/.circleci/routing.yml b/.circleci/routing.yml deleted file mode 100644 index c817da878c5..00000000000 --- a/.circleci/routing.yml +++ /dev/null @@ -1,91 +0,0 @@ -# Declarative routing data for the CircleCI setup pipeline. -# -# This file is the single source of truth for WHAT workflows run; the policy -# script (.circleci/scripts/compute-workflow-conditions.sh) decides WHEN they -# run. Keeping the data here means the workflow lists can be read directly by -# tooling (e.g. test-schedule-triggers.js) instead of parsing the script. -# -# Workflow names below map 1:1 to a "c-run_" boolean parameter declared -# in a continuation config under .circleci/continue/. Enabling c-run_ -# makes that continuation workflow execute. - -# Scheduled pipelines: CircleCI schedule name -> workflows it triggers. -# The schedule names must match the triggers configured in the CircleCI UI -# (verified live by test-schedule-triggers.js). -schedules: - build_four_hours: - - scheduled_todo_issues - - scheduled_cannon_full_tests - build_daily: - - scheduled_preimage_reproducibility - - scheduled_stale_check - - scheduled_heavy_fuzz_tests - - scheduled_daily_tests - - scheduled_sp1_elf_smoke - - circleci_schedule_trigger_check - build_weekly: - - scheduled_rust_nightly_bump - -# API triggers: dispatch flag -> workflows enabled when that flag is set. -api_dispatch: - main_dispatch: - - main - - contracts_feature_tests - fault_proofs_dispatch: - - develop_fault_proofs - kontrol_dispatch: - - develop_kontrol_tests - cannon_full_test_dispatch: - - scheduled_cannon_full_tests - reproducibility_dispatch: - - scheduled_preimage_reproducibility - stale_check_dispatch: - - scheduled_stale_check - heavy_fuzz_dispatch: - - scheduled_heavy_fuzz_tests - publish_contract_artifacts_dispatch: - - publish_contract_artifacts - l2_fork_test_dispatch: - - l2_fork_test - rust_ci_dispatch: - - rust_ci - rust_e2e_dispatch: - - rust_e2e_ci - rust_nightly_bump_dispatch: - - scheduled_rust_nightly_bump - -# Workflows that run only in ethereum-optimism/optimism. They publish to OP Labs -# infrastructure or check this project's CircleCI schedules, so other repos -# sharing this config lack the credentials or schedules they need. -public_repo_only: - - publish_contract_artifacts - - kona_publish_prestates - - circleci_schedule_trigger_check - -# Change-detection patterns. Each value is a POSIX Extended Regular Expression -# (ERE, like grep -E) matched line-by-line against the changed file list -# (git diff --name-only origin/develop...HEAD). collect-params.sh reads these. -# -# Test a pattern locally: -# git diff --name-only origin/develop...HEAD | grep -E "^your/pattern/" -change_patterns: - # "any": c- is true iff AT LEAST ONE changed file matches. - any: - circleci_changed: "^\\.circleci/" - contracts_changed: "^(packages/contracts-bedrock|op-core/forks|op-core/nuts|\\.circleci|\\.github|ops/check-changed)/|^(package\\.json|mise\\.toml)$" - docs_changes_detected: "^docs/public-docs/" - rust_changes_detected: "^(rust|op-e2e|op-core/nuts|\\.circleci)/|^mise\\.toml$" - # "all": c- is true iff EVERY changed file matches (and there is at - # least one). Used for the safe-by-default docs-only fast path: any path not - # enumerated still falls through to the full main workflow. - all: - only_docs_changes: "^docs/" - -# Pipeline parameters forwarded to continuation configs. Everything else in the -# parameters JSON is stripped before the continuation step (see finalize). -passthrough_params: - - c-default_docker_image - - c-rust_base_image - - c-base_image - - c-go-cache-version - - c-publish_contract_artifacts_ref diff --git a/.circleci/routing.yml b/.circleci/routing.yml new file mode 120000 index 00000000000..3546d6f0412 --- /dev/null +++ b/.circleci/routing.yml @@ -0,0 +1 @@ +../ops/ci/runtime/routing.yml \ No newline at end of file diff --git a/.circleci/scripts/apt-install.sh b/.circleci/scripts/apt-install.sh index ae1c76af988..f3cea4c3eb1 100755 --- a/.circleci/scripts/apt-install.sh +++ b/.circleci/scripts/apt-install.sh @@ -1,67 +1,4 @@ #!/usr/bin/env bash -# apt-get update + install. Arguments are passed to `apt-get install`. +# Circle adapter for the shared package installer. set -euo pipefail - -# Timeouts, so a mirror that stops responding errors out instead of being waited on. -APT_OPTS=(-o Acquire::Retries=3 -o Acquire::http::Timeout=20 -o Acquire::https::Timeout=20) - -export NEEDRESTART_MODE=a -export DEBIAN_FRONTEND=noninteractive - -# Copy of each list as the machine image shipped it. The suffix is not one apt -# reads (it only picks up *.list and *.sources), so the copies sit inertly next -# to the rewritten files until the fallback below needs them. Written once: some -# jobs call this script more than once, and re-copying would capture the -# already-rewritten file and make the fallback a no-op. -BACKUP_SUFFIX=".shipped-mirrors" -# Set once archive.ubuntu.com has been found unusable, so later calls in the -# same job don't rewrite back onto it. -FALLBACK_MARKER="/tmp/.apt-install-mirror-fallback" - -SOURCE_FILES=() -for f in /etc/apt/sources.list /etc/apt/sources.list.d/*.sources /etc/apt/sources.list.d/*.list; do - if [ -f "$f" ]; then - SOURCE_FILES+=("$f") - fi -done - -# The machine images point apt at the single-region EC2 mirror -# (us-east-1.ec2.archive.ubuntu.com), which is one set of AWS hosts with no -# routing of its own: when it degrades, apt has nowhere else to go, and it is only -# nearby when the runner happens to be in that region. archive.ubuntu.com is -# Cloudflare anycast, so redundancy, geo-routing and caching are the CDN's job. -# Third-party lists keep their own URIs. -if [ ! -f "$FALLBACK_MARKER" ]; then - for f in "${SOURCE_FILES[@]}"; do - if [ ! -f "$f$BACKUP_SUFFIX" ]; then - sudo cp -p -- "$f" "$f$BACKUP_SUFFIX" - fi - sudo sed -i -E "s#https?://[A-Za-z0-9.-]+\.ec2\.archive\.ubuntu\.com/ubuntu#http://archive.ubuntu.com/ubuntu#g" "$f" - done -fi - -# The CDN is a single point of failure of its own: Canonical has had -# archive.ubuntu.com outages that fail every job installing a package through it. -# The EC2 mirror the image shipped is usually still serving when that happens, so -# put it back and try once more instead of failing the job outright. -restore_shipped_mirrors() { - for f in "${SOURCE_FILES[@]}"; do - if [ -f "$f$BACKUP_SUFFIX" ]; then - sudo cp -p -- "$f$BACKUP_SUFFIX" "$f" - fi - done - touch "$FALLBACK_MARKER" -} - -apt_update_and_install() { - sudo -E apt-get "${APT_OPTS[@]}" update --error-on=any - sudo -E apt-get "${APT_OPTS[@]}" install -y "$@" -} - -if apt_update_and_install "$@"; then - exit 0 -fi - -echo "apt failed against archive.ubuntu.com; retrying with the mirrors the machine image shipped." >&2 -restore_shipped_mirrors -apt_update_and_install "$@" +exec bash "$(dirname "${BASH_SOURCE[0]}")/../../ops/ci/runtime/apt-install.sh" "$@" diff --git a/.circleci/scripts/collect-params.sh b/.circleci/scripts/collect-params.sh index a8500d94f91..0fa8156563a 100755 --- a/.circleci/scripts/collect-params.sh +++ b/.circleci/scripts/collect-params.sh @@ -1,89 +1,5 @@ #!/usr/bin/env bash -# Collects pipeline parameters from the environment and writes them to a JSON file. -# -# Called once per type with a mode argument: -# collect-params.sh str — emit all c-* env vars as JSON strings -# collect-params.sh bool — emit all c-* env vars as JSON booleans (normalizes 0/1) -# collect-params.sh detect — match routing.yml change_patterns.any against changed files; c- true iff ANY file matches -# collect-params.sh detect_all — match routing.yml change_patterns.all against changed files; c- true iff EVERY file matches (and there is at least one) -# -# str/bool read c-* env vars (CircleCI pipeline params). detect/detect_all read -# their ERE patterns from routing.yml so the patterns are declarative data. -# Each invocation appends to /tmp/pipeline-parameters.json. +# CircleCI compatibility entrypoint for shared parameter/path collection. set -euo pipefail - -MODE="${1:?Usage: collect-params.sh }" -OUTPUT="/tmp/pipeline-parameters.json" -ROUTING="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)/routing.yml" - -[ -f "${OUTPUT}" ] || echo '{}' > "${OUTPUT}" - -to_bool() { - case "${1}" in 1 | true | True | TRUE) echo "true" ;; *) echo "false" ;; esac -} - -json=$(cat "${OUTPUT}") - -case "${MODE}" in - str) - while IFS='=' read -r key value; do - [[ "${key}" == c-* ]] || continue - json=$(echo "${json}" | jq --arg v "${value}" '. + {"'"${key}"'": $v}') - echo " [str] ${key} = ${value}" - done < <(env | sort) - ;; - - bool) - while IFS='=' read -r key value; do - [[ "${key}" == c-* ]] || continue - json=$(echo "${json}" | jq --argjson v "$(to_bool "${value}")" '. + {"'"${key}"'": $v}') - echo " [bool] ${key} = $(to_bool "${value}")" - done < <(env | sort) - ;; - - detect | detect_all) - [[ "${MODE}" == "detect_all" ]] && section=".change_patterns.all" || section=".change_patterns.any" - - CHANGED=$(git diff --name-only --no-renames "origin/${BASE_REVISION}...HEAD" 2> /dev/null \ - || git diff --name-only --no-renames HEAD~1 HEAD || true) - echo "=== Changed files ===" - echo "${CHANGED:-}" - echo "=====================" - - while IFS= read -r name; do - [[ -n "${name}" ]] || continue - pattern=$(yq -r "${section}.\"${name}\"" "${ROUTING}") - # Here-strings, not pipes: `grep -q` exits on the first hit, and under pipefail the - # writer's SIGPIPE would turn a large file list into a false result. - if [ -z "${CHANGED}" ]; then - result=false - elif [[ "${MODE}" == "detect_all" ]]; then - # True iff every changed file matches the pattern (i.e., no file fails to match). - if grep -qvE "${pattern}" <<< "${CHANGED}"; then - result=false - else - result=true - fi - else - # detect: true iff at least one changed file matches the pattern. - if grep -qE "${pattern}" <<< "${CHANGED}"; then - result=true - else - result=false - fi - fi - json=$(echo "${json}" | jq --argjson v "${result}" '. + {"c-'"${name}"'": $v}') - echo " [${MODE}] c-${name} = ${result} (pattern: ${pattern})" - done < <(yq -r "${section} | keys | .[]" "${ROUTING}") - ;; - - *) - echo "ERROR: Unknown mode '${MODE}'. Use str, bool, detect, or detect_all." >&2 - exit 1 - ;; -esac - -echo "${json}" > "${OUTPUT}" -echo "=== Parameters so far ===" -cat "${OUTPUT}" -echo "=========================" +export CI_BASE_REVISION="${BASE_REVISION:-develop}" +exec bash "$(dirname "${BASH_SOURCE[0]}")/../../ops/ci/runtime/collect-params.sh" "$@" diff --git a/.circleci/scripts/compute-workflow-conditions.sh b/.circleci/scripts/compute-workflow-conditions.sh index 094f03ac8d8..ddd715477c6 100755 --- a/.circleci/scripts/compute-workflow-conditions.sh +++ b/.circleci/scripts/compute-workflow-conditions.sh @@ -1,151 +1,17 @@ #!/usr/bin/env bash -# Workflow routing policy for the CircleCI setup pipeline. -# -# Decides WHICH continuation workflows run, based on the trigger source, branch, -# tag, schedule name, and the change-detection / dispatch params already written -# to /tmp/pipeline-parameters.json by earlier steps. The workflow lists -# themselves live in routing.yml — this script only holds the conditions. -# -# Each enabled workflow sets c-run_: true in the JSON, which maps 1:1 to -# "when: << pipeline.parameters.c-run_ >>" in a continuation config. -# -# Inputs (set by the config.yml step environment): -# BRANCH, TRIGGER_SOURCE, TAG, SCHEDULE_NAME -# Built-in CircleCI inputs: -# CIRCLE_PROJECT_USERNAME, CIRCLE_PROJECT_REPONAME -# -# Helpers (workflow-helpers.sh): -# run enable workflows by literal name -# run_group enable the workflows listed under routing.yml sec.key -# skip_group disable the workflows listed under routing.yml sec -# is_true true if c-x is true in the JSON -# param raw value of c-x from the JSON -# finalize strip intermediate params, keep c-run_* + passthrough -# -# How to add a new workflow: -# 1. Declare "c-run_: {type: boolean, default: false}" in a continuation -# config under .circleci/continue/. -# 2. Wire it in here (literal "run " for a one-off, or add it to the -# relevant routing.yml list and use run_group). +# CircleCI adapter for the shared, provider-neutral workflow routing policy. set -euo pipefail -# shellcheck disable=SC1091 # sourced helper resolved at runtime, not by shellcheck -source "$(dirname "${BASH_SOURCE[0]}")/workflow-helpers.sh" -init_json - -case "${TRIGGER_SOURCE}" in - - # Scheduled pipelines: map schedule name -> workflows (routing.yml schedules). - scheduled_pipeline) - run_group schedules "${SCHEDULE_NAME}" - ;; - - # Webhook (push events) - webhook) - # --- Tag push --- - if [[ -n "${TAG}" ]]; then - run release - - # ========================================================= - # Three mutually exclusive lifecycle stages: - # ========================================================= - - # 1. PR (feature branch push) - # Runs on every push to a feature branch. - # Path-based gating: only changed areas are tested. - # Docs-only changes skip main/release entirely. - # --------------------------------------------------------- - elif [[ "${BRANCH}" != "develop" && ! "${BRANCH}" =~ ^gh-readonly-queue/ ]]; then - if is_true only_docs_changes; then - run ci_gate_skip - run contracts_feature_tests_short - run rust_ci_gate_short - run rust_e2e_gate_skip - else - run main - run release - if is_true contracts_changed; then - run contracts_feature_tests - else - run contracts_feature_tests_short - fi - if is_true rust_changes_detected; then - run rust_ci - run rust_e2e_ci - else - run rust_ci_gate_short - run rust_e2e_gate_skip - fi - if is_true circleci_changed; then - run circleci_schedule_trigger_check - fi - fi - - # 2. Merge queue (pre-merge validation) - # Runs when GitHub merge queue picks up the PR. - # Docs-only changes emit the required gates without running test suites. - # All other changes run full contract tests and path-gated Rust tests. - # --------------------------------------------------------- - elif [[ "${BRANCH}" =~ ^gh-readonly-queue/ ]]; then - if is_true only_docs_changes; then - run ci_gate_skip - run contracts_feature_tests_short - run rust_ci_gate_short - run rust_e2e_gate_skip - else - run main - run release - run contracts_feature_tests - if is_true rust_changes_detected; then - run rust_ci - run rust_e2e_ci - else - run rust_ci_gate_short - run rust_e2e_gate_skip - fi - if is_true circleci_changed; then - run circleci_schedule_trigger_check - fi - fi - - # 3. After merge (develop push) - # Runs after the merge queue completes and pushes to develop. - # Adds expensive post-merge jobs: fault proofs, kontrol, prestate publishing. - # - # Nothing here is path-gated. Change detection diffs against - # origin/${BASE_REVISION}, and BASE_REVISION is develop, so on a develop - # push HEAD is the base and the changed-file list is always empty. Every - # is_true check would therefore be false, making the gated branch dead - # code rather than a conditional. - # --------------------------------------------------------- - elif [[ "${BRANCH}" == "develop" ]]; then - run main - run release - run publish_contract_artifacts - run develop_fault_proofs - run develop_kontrol_tests - run contracts_feature_tests - run rust_ci - run rust_e2e_ci - run kona_publish_prestates - run circleci_schedule_trigger_check - fi - ;; - - # API triggers: dispatch flags select workflows (routing.yml api_dispatch). - api) - run release - # Each dispatch flag enables its workflows when the flag is set. - for flag in $(yq -r '.api_dispatch | keys | .[]' "${ROUTING}"); do - if is_true "${flag}"; then - run_group api_dispatch "${flag}" - fi - done +case "${TRIGGER_SOURCE:?TRIGGER_SOURCE must be set}" in + webhook) CI_EVENT=push ;; + scheduled_pipeline) CI_EVENT=schedule ;; + api) CI_EVENT=dispatch ;; + *) + echo "ERROR: unsupported CircleCI trigger '${TRIGGER_SOURCE}'" >&2 + exit 1 ;; esac - -if [[ "${CIRCLE_PROJECT_USERNAME:-}/${CIRCLE_PROJECT_REPONAME:-}" != "ethereum-optimism/optimism" ]]; then - skip_group public_repo_only -fi - -finalize +export CI_EVENT +export CI_BRANCH="${BRANCH:-}" CI_TAG="${TAG:-}" CI_SCHEDULE_NAME="${SCHEDULE_NAME:-}" +export CI_REPOSITORY="${CIRCLE_PROJECT_USERNAME:-}/${CIRCLE_PROJECT_REPONAME:-}" +exec bash "$(dirname "${BASH_SOURCE[0]}")/../../ops/ci/runtime/compute-workflow-conditions.sh" "$@" diff --git a/.circleci/scripts/test-decision-tree.sh b/.circleci/scripts/test-decision-tree.sh index b4e3635dc3f..6383072f615 100755 --- a/.circleci/scripts/test-decision-tree.sh +++ b/.circleci/scripts/test-decision-tree.sh @@ -1,263 +1,4 @@ #!/usr/bin/env bash -# Dry-run test for the workflow routing policy (compute-workflow-conditions.sh). -# Seeds the params JSON, sets the trigger/branch/tag/schedule environment, runs -# the routing script, then asserts the expected c-run_* flags are (or are not) -# set in the resulting JSON. -# -# Usage: -# bash .circleci/scripts/test-decision-tree.sh -# -# Requires: jq, yq (same version used in CI) +# Preserve the setup-pipeline command while exercising both provider entrypoints. set -euo pipefail - -SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -ROUTING_SCRIPT="${SCRIPT_DIR}/compute-workflow-conditions.sh" - -# Use an isolated params file so the test never writes the pipeline's real -# /tmp/pipeline-parameters.json. The routing script's finalize writes c-run_* -# flags, which the later collect-params/compute steps would otherwise inherit. -# Exported so the routing script (via workflow-helpers.sh) writes here too. -OUTPUT="$(mktemp)" -export OUTPUT -trap 'rm -f "${OUTPUT}"' EXIT - -# --- Test harness --- -PASS=0 -FAIL=0 - -run_scenario() { - local name="${1}" - local trigger="${2}" - local branch="${3}" - local tag="${4}" - local schedule="${5}" - local json_seed="${6}" - shift 6 - local expected=() - local unexpected=() - local collect_expected=true - for wf in "$@"; do - if [[ "${wf}" == "--not" ]]; then - collect_expected=false - continue - fi - if ${collect_expected}; then - expected+=("${wf}") - else - unexpected+=("${wf}") - fi - done - - # Seed the JSON and run the routing policy as the pipeline would. REPO is - # pinned so the result doesn't depend on which project runs the test. - local repo="${REPO:-ethereum-optimism/optimism}" - echo "${json_seed}" > "${OUTPUT}" - TRIGGER_SOURCE="${trigger}" BRANCH="${branch}" TAG="${tag}" SCHEDULE_NAME="${schedule}" \ - CIRCLE_PROJECT_USERNAME="${repo%%/*}" CIRCLE_PROJECT_REPONAME="${repo#*/}" \ - bash "${ROUTING_SCRIPT}" > /dev/null || true - - local _json - _json=$(cat "${OUTPUT}") - - # Check expected workflows are enabled - local all_pass=true - for wf in "${expected[@]}"; do - local val - val=$(echo "${_json}" | jq -r ".\"c-run_${wf}\" // false") - if [[ "${val}" != "true" ]]; then - echo " FAIL: expected c-run_${wf}=true, got ${val}" - all_pass=false - fi - done - for wf in "${unexpected[@]}"; do - local val - val=$(echo "${_json}" | jq -r ".\"c-run_${wf}\" // false") - if [[ "${val}" != "false" ]]; then - echo " FAIL: expected c-run_${wf}=false, got ${val}" - all_pass=false - fi - done - - if ${all_pass}; then - echo "PASS: ${name}" - PASS=$((PASS + 1)) - else - echo "FAIL: ${name}" - FAIL=$((FAIL + 1)) - fi -} - -echo "=== Decision Tree Dry-Run Tests ===" -echo "" - -# --- Scenarios --- - -run_scenario \ - "Tag push → release only" \ - "webhook" "" "v1.0.0" "" \ - '{}' \ - release - -run_scenario \ - "PR (feature branch), rust changed" \ - "webhook" "feat/my-thing" "" "" \ - '{"c-rust_changes_detected": true, "c-contracts_changed": false, "c-docs_changes_detected": false}' \ - main release contracts_feature_tests_short rust_ci rust_e2e_ci - -run_scenario \ - "PR (feature branch), contracts changed" \ - "webhook" "feat/my-thing" "" "" \ - '{"c-rust_changes_detected": false, "c-contracts_changed": true, "c-docs_changes_detected": false}' \ - main release contracts_feature_tests rust_ci_gate_short rust_e2e_gate_skip - -run_scenario \ - "PR (feature branch), docs only" \ - "webhook" "feat/my-thing" "" "" \ - '{"c-rust_changes_detected": false, "c-contracts_changed": false, "c-docs_changes_detected": true, "c-only_docs_changes": true}' \ - ci_gate_skip contracts_feature_tests_short rust_ci_gate_short rust_e2e_gate_skip - -run_scenario \ - "PR (feature branch), docs + rust changed" \ - "webhook" "feat/my-thing" "" "" \ - '{"c-rust_changes_detected": true, "c-contracts_changed": false, "c-docs_changes_detected": true, "c-only_docs_changes": false}' \ - main release contracts_feature_tests_short rust_ci rust_e2e_ci - -# Footgun guard: a docs PR that also touches code outside the detection regexes -# (e.g., op-node/, op-batcher/, any new top-level dir) MUST run main. Without -# the all-match check, this scenario previously hit the docs-only fast path. -run_scenario \ - "PR (feature branch), docs + undetected code (footgun guard)" \ - "webhook" "feat/my-thing" "" "" \ - '{"c-rust_changes_detected": false, "c-contracts_changed": false, "c-docs_changes_detected": true, "c-only_docs_changes": false}' \ - main release contracts_feature_tests_short rust_ci_gate_short rust_e2e_gate_skip - -run_scenario \ - "PR (feature branch), nothing changed" \ - "webhook" "feat/my-thing" "" "" \ - '{"c-rust_changes_detected": false, "c-contracts_changed": false, "c-circleci_changed": false, "c-docs_changes_detected": false, "c-only_docs_changes": false}' \ - main release contracts_feature_tests_short rust_ci_gate_short rust_e2e_gate_skip \ - --not circleci_schedule_trigger_check - -run_scenario \ - "PR (feature branch), CircleCI changed" \ - "webhook" "feat/my-thing" "" "" \ - '{"c-rust_changes_detected": true, "c-contracts_changed": true, "c-circleci_changed": true, "c-docs_changes_detected": false, "c-only_docs_changes": false}' \ - main release contracts_feature_tests rust_ci rust_e2e_ci circleci_schedule_trigger_check - -run_scenario \ - "Merge queue, rust changed" \ - "webhook" "gh-readonly-queue/develop/pr-123" "" "" \ - '{"c-rust_changes_detected": true, "c-contracts_changed": false, "c-docs_changes_detected": false, "c-only_docs_changes": false}' \ - main release contracts_feature_tests rust_ci rust_e2e_ci - -run_scenario \ - "Merge queue, no changes" \ - "webhook" "gh-readonly-queue/develop/pr-123" "" "" \ - '{"c-rust_changes_detected": false, "c-contracts_changed": false, "c-docs_changes_detected": false, "c-only_docs_changes": false}' \ - main release contracts_feature_tests rust_ci_gate_short rust_e2e_gate_skip - -run_scenario \ - "Merge queue, docs only" \ - "webhook" "gh-readonly-queue/develop/pr-123" "" "" \ - '{"c-rust_changes_detected": false, "c-contracts_changed": false, "c-docs_changes_detected": true, "c-only_docs_changes": true}' \ - ci_gate_skip contracts_feature_tests_short rust_ci_gate_short rust_e2e_gate_skip \ - --not main release contracts_feature_tests rust_ci rust_e2e_ci - -# Develop runs the full post-merge set unconditionally. The two scenarios below -# seed opposite change-detection results and assert an identical routing, which -# is what pins that behaviour: on a develop push the changed-file list is always -# empty (BASE_REVISION is develop, so HEAD is the base), so any path gating here -# would be dead code that never fires in production. -run_scenario \ - "After merge (develop), empty change set (production reality)" \ - "webhook" "develop" "" "" \ - '{"c-rust_changes_detected": false, "c-contracts_changed": false, "c-circleci_changed": false, "c-docs_changes_detected": false, "c-only_docs_changes": false}' \ - main release publish_contract_artifacts develop_fault_proofs develop_kontrol_tests contracts_feature_tests rust_ci rust_e2e_ci kona_publish_prestates circleci_schedule_trigger_check \ - --not rust_ci_gate_short rust_e2e_gate_skip ci_gate_skip contracts_feature_tests_short - -run_scenario \ - "After merge (develop), change detection must not alter routing" \ - "webhook" "develop" "" "" \ - '{"c-rust_changes_detected": true, "c-contracts_changed": true, "c-circleci_changed": true, "c-docs_changes_detected": true, "c-only_docs_changes": true}' \ - main release publish_contract_artifacts develop_fault_proofs develop_kontrol_tests contracts_feature_tests rust_ci rust_e2e_ci kona_publish_prestates circleci_schedule_trigger_check \ - --not rust_ci_gate_short rust_e2e_gate_skip ci_gate_skip contracts_feature_tests_short - -# Other repos sharing this config run the same post-merge set minus the -# routing.yml public_repo_only workflows. -REPO="ethereum-optimism/other" run_scenario \ - "After merge (develop), outside the public repo" \ - "webhook" "develop" "" "" \ - '{}' \ - main release develop_fault_proofs develop_kontrol_tests contracts_feature_tests rust_ci rust_e2e_ci \ - --not publish_contract_artifacts kona_publish_prestates circleci_schedule_trigger_check - -REPO="ethereum-optimism/other" run_scenario \ - "PR (feature branch), CircleCI changed, outside the public repo" \ - "webhook" "feat/my-thing" "" "" \ - '{"c-rust_changes_detected": true, "c-contracts_changed": true, "c-circleci_changed": true, "c-docs_changes_detected": false, "c-only_docs_changes": false}' \ - main release contracts_feature_tests rust_ci rust_e2e_ci \ - --not circleci_schedule_trigger_check - -REPO="ethereum-optimism/other" run_scenario \ - "API: publish_contract_artifacts_dispatch, outside the public repo" \ - "api" "" "" "" \ - '{"c-main_dispatch": false, "c-publish_contract_artifacts_dispatch": true}' \ - release \ - --not publish_contract_artifacts - -run_scenario \ - "Scheduled: build_four_hours" \ - "scheduled_pipeline" "" "" "build_four_hours" \ - '{}' \ - scheduled_todo_issues scheduled_cannon_full_tests - -run_scenario \ - "Scheduled: build_daily" \ - "scheduled_pipeline" "" "" "build_daily" \ - '{}' \ - scheduled_preimage_reproducibility scheduled_stale_check scheduled_heavy_fuzz_tests scheduled_daily_tests scheduled_sp1_elf_smoke circleci_schedule_trigger_check - -REPO="ethereum-optimism/other" run_scenario \ - "Scheduled: build_daily, outside the public repo" \ - "scheduled_pipeline" "" "" "build_daily" \ - '{}' \ - scheduled_preimage_reproducibility scheduled_stale_check scheduled_heavy_fuzz_tests scheduled_daily_tests scheduled_sp1_elf_smoke \ - --not circleci_schedule_trigger_check - -run_scenario \ - "Scheduled: build_weekly" \ - "scheduled_pipeline" "" "" "build_weekly" \ - '{}' \ - scheduled_rust_nightly_bump - -run_scenario \ - "API: main_dispatch" \ - "api" "" "" "" \ - '{"c-main_dispatch": true}' \ - release main contracts_feature_tests - -run_scenario \ - "API: rust_ci_dispatch" \ - "api" "" "" "" \ - '{"c-main_dispatch": false, "c-rust_ci_dispatch": true}' \ - release rust_ci - -run_scenario \ - "API: rust_nightly_bump_dispatch" \ - "api" "" "" "" \ - '{"c-main_dispatch": false, "c-rust_nightly_bump_dispatch": true}' \ - release scheduled_rust_nightly_bump - -run_scenario \ - "API: publish_contract_artifacts_dispatch" \ - "api" "" "" "" \ - '{"c-main_dispatch": false, "c-publish_contract_artifacts_dispatch": true}' \ - release publish_contract_artifacts - -# --- Summary --- -echo "" -echo "=== Results: ${PASS} passed, ${FAIL} failed ===" - -if [[ ${FAIL} -gt 0 ]]; then - exit 1 -fi +exec bash "$(dirname "${BASH_SOURCE[0]}")/../../ops/ci/migration/tests/test-circle-adapter.sh" "$@" diff --git a/.circleci/scripts/test-go-mod-cache.py b/.circleci/scripts/test-go-mod-cache.py new file mode 100644 index 00000000000..6503335514e --- /dev/null +++ b/.circleci/scripts/test-go-mod-cache.py @@ -0,0 +1,70 @@ +#!/usr/bin/env python3 +"""Exercise the Circle cache setup against an offline Go consumer.""" +import json +import os +from pathlib import Path +import subprocess +import tempfile +import unittest +import zipfile + +ROOT = Path(__file__).resolve().parents[2] + + +class ModuleCacheTests(unittest.TestCase): + def test_machine_gopath_uses_restored_docker_cache_in_later_shells(self): + helpers = json.loads(subprocess.check_output( + ['yq', '-o=json', '.', str(ROOT / '.circleci/continue/helpers.yml')], text=True)) + steps = helpers['commands']['restore-go-mod-cache']['steps'] + setup = next(step['run']['command'] for step in steps if 'run' in step) + save = helpers['commands']['save-go-mod-cache']['steps'][0]['save_cache'] + restore = next(step['restore_cache'] for step in steps if 'restore_cache' in step) + self.assertEqual(save['key'], restore['keys'][0]) + + with tempfile.TemporaryDirectory() as tmp: + root = Path(tmp) + home = root / 'home with spaces' + home.mkdir() + project = root / 'project' + project.mkdir() + proxy = root / 'proxy/example.invalid/dependency/@v' + proxy.mkdir(parents=True) + module = 'module example.invalid/dependency\n\ngo 1.22.0\n' + (proxy / 'v1.0.0.mod').write_text(module) + (proxy / 'v1.0.0.info').write_text('{"Version":"v1.0.0","Time":"2024-01-01T00:00:00Z"}') + with zipfile.ZipFile(proxy / 'v1.0.0.zip', 'w') as archive: + archive.writestr('example.invalid/dependency@v1.0.0/go.mod', module) + archive.writestr('example.invalid/dependency@v1.0.0/value.go', + 'package dependency\nconst Value = 42\n') + (project / 'go.mod').write_text( + 'module example.invalid/consumer\n\ngo 1.22.0\n\nrequire example.invalid/dependency v1.0.0\n') + (project / 'consumer.go').write_text( + 'package consumer\nimport "example.invalid/dependency"\nvar Value = dependency.Value\n') + env = {k: v for k, v in os.environ.items() if k not in ('GOROOT', 'GOMODCACHE', 'GOFLAGS', 'GOWORK')} + env.update(HOME=str(home), GOPATH=str(home / '.go_workspace'), + GOTOOLCHAIN='local', GOSUMDB='off', GOPROXY=(root / 'proxy').as_uri(), + GOCACHE=str(root / 'build-cache'), BASH_ENV=str(root / 'bash-env')) + self.assertEqual(len(save['paths']), 1) + canonical = home / Path(save['paths'][0]).relative_to('~') + # Model the producer's cache snapshot before the machine restores it. + subprocess.run(['go', 'mod', 'download', 'all'], cwd=project, + env={**env, 'GOMODCACHE': str(canonical)}, check=True, capture_output=True) + env['GOPROXY'] = 'off' + cold = subprocess.run(['go', 'list', '-deps', './...'], cwd=project, + env=env, capture_output=True, text=True) + self.assertNotEqual(cold.returncode, 0) + self.assertIn('module lookup disabled', cold.stderr) + subprocess.run(['bash', '-euc', setup], cwd=project, env=env, check=True, capture_output=True) + # Circle sources BASH_ENV afresh for each subsequent run step. + effective = subprocess.check_output(['bash', '-euc', 'go env GOMODCACHE'], + cwd=project, env=env, text=True).strip() + self.assertEqual(effective, str(canonical)) + nested = project / 'nested' + nested.mkdir() + result = subprocess.run(['bash', '-euc', 'go test -mod=readonly ../...'], + cwd=nested, env=env, capture_output=True, text=True) + self.assertEqual(result.returncode, 0, result.stdout + result.stderr) + + +if __name__ == '__main__': + unittest.main() diff --git a/.circleci/scripts/test-schedule-triggers.js b/.circleci/scripts/test-schedule-triggers.js index cddec565127..0b938b07c0d 100755 --- a/.circleci/scripts/test-schedule-triggers.js +++ b/.circleci/scripts/test-schedule-triggers.js @@ -4,7 +4,7 @@ import { readdirSync } from "node:fs"; import path from "node:path"; const repoRoot = path.resolve(import.meta.dir, "../.."); -const routingPath = path.join(repoRoot, ".circleci/routing.yml"); +const routingPath = path.join(repoRoot, "ops/ci/runtime/routing.yml"); const continuationDir = path.join(repoRoot, ".circleci/continue"); const apiBase = process.env.CIRCLECI_API_BASE ?? "https://circleci.com/api/v2"; const projectSlug = diff --git a/.circleci/scripts/workflow-helpers.sh b/.circleci/scripts/workflow-helpers.sh index 8f247e68a5d..fee5c8737c8 100755 --- a/.circleci/scripts/workflow-helpers.sh +++ b/.circleci/scripts/workflow-helpers.sh @@ -1,76 +1,4 @@ #!/usr/bin/env bash -# Sourceable helper functions for the workflow routing policy in -# compute-workflow-conditions.sh. Provides JSON plumbing and routing.yml -# readers so the policy script only contains the routing logic and routing.yml -# only contains the data. -# -# Usage (from compute-workflow-conditions.sh): -# source .circleci/scripts/workflow-helpers.sh -# init_json -# ...routing logic using run/run_group/param/is_true... -# finalize - -# OUTPUT is overridable so tests can point at an isolated file instead of the -# pipeline's real params file. -OUTPUT="${OUTPUT:-/tmp/pipeline-parameters.json}" -# routing.yml lives one directory up from this script (.circleci/routing.yml), -# resolved from the script location so it works regardless of the caller's cwd. -ROUTING="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)/routing.yml" -_json="" - -init_json() { - _json=$(cat "${OUTPUT}") -} - -run() { - for wf in "$@"; do - _json=$(echo "${_json}" | jq '. + {"c-run_'"${wf}"'": true}') - echo " [enable] c-run_${wf}" - done -} - -# run_group
: enable every workflow listed under -# routing.yml's
.. A missing key enables nothing. -run_group() { - local section="${1}" key="${2}" - local wfs - wfs=$(yq -r ".${section}.\"${key}\"[]?" "${ROUTING}") - if [[ -n "${wfs}" ]]; then - # shellcheck disable=SC2086 # intentional word-splitting of the name list - run ${wfs} - fi -} - -# skip_group
: disable every workflow listed under routing.yml's -#
, whatever enabled it. -skip_group() { - local wf - for wf in $(yq -r ".${1}[]?" "${ROUTING}"); do - _json=$(echo "${_json}" | jq 'del(."c-run_'"${wf}"'")') - echo " [skip] c-run_${wf}" - done -} - -param() { - echo "${_json}" | jq -r ".\"c-${1}\"" -} - -is_true() { - [[ "$(param "${1}")" == "true" ]] -} - -# Strip intermediate params, keeping only c-run_* flags and the passthrough -# params declared in routing.yml, then write the final JSON. -finalize() { - local jq_filter - jq_filter=$(yq -r '.passthrough_params[]' "${ROUTING}" | sed 's/.*/"&"/' | paste -sd',' -) - - _json=$(echo "${_json}" | jq "with_entries(select( - .key | startswith(\"c-run_\") or IN(${jq_filter}) - ))") - - echo "${_json}" > "${OUTPUT}" - echo "=== Enabled workflows ===" - echo "${_json}" | jq -r 'to_entries[] | select(.key | startswith("c-run_")) | select(.value == true) | " \(.key)"' - echo "=========================" -} +# Compatibility entrypoint for callers sourcing the former CircleCI helper. +# shellcheck disable=SC1091 # shared helper resolved relative to this wrapper +source "$(dirname "${BASH_SOURCE[0]}")/../../ops/ci/runtime/workflow-helpers.sh" diff --git a/.dockerignore b/.dockerignore index a5c202b7f25..516900701fc 100644 --- a/.dockerignore +++ b/.dockerignore @@ -20,3 +20,12 @@ build/_bin tests/testdata rust/target + +# CI caches/reports and offline runtime witnesses are never build inputs. +.ci +rust/kona/data +rust/kona/state.bin.gz +rust/kona/out.bin.gz +rust/kona/meta.json +rust/kona/bin/client/testdata/*.tar.zst +rust/kona/bin/client/testdata/*.etag diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index d4555578ba1..0c3e1f3f023 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -27,6 +27,8 @@ /docs/public-docs/scripts/ @ethereum-optimism/solutions # CI workflows +/.rwx/ @ethereum-optimism/cloud-security +/ops/ci/ @ethereum-optimism/cloud-security /.github/workflows/ @ethereum-optimism/cloud-security /.github/actions/ @ethereum-optimism/cloud-security diff --git a/.gitignore b/.gitignore index d5c528253dc..8e7b26c11f1 100644 --- a/.gitignore +++ b/.gitignore @@ -47,6 +47,9 @@ packages/contracts-bedrock/deployments/anvil # Local AI planning docs (op-claude and similar agent tooling) .claude/plans +# CI routing metadata generated by the RWX pilot. +.ci/ + # Ignore local fuzzing results **/testdata/fuzz/ diff --git a/.rwx/acceptance.yml b/.rwx/acceptance.yml new file mode 100644 index 00000000000..986c6433f27 --- /dev/null +++ b/.rwx/acceptance.yml @@ -0,0 +1,498 @@ +# Full acceptance variants. CircleCI retains all required gates. +on: + cache-rebuild: + if: ${{ event.git.branch == 'develop' }} + target: [go, contracts, kona, op-reth, prestate, sp1-executor, acceptance-tools, discovery-opn, discovery-kona] + init: + commit-sha: ${{ event.git.sha }} + branch: ${{ event.git.branch }} + tag: "" + cache-warm: "true" + cache-epoch: v1 + build-probe: "" + target-cache-mode: keep + shard-total: "8" + cli: + init: + commit-sha: ${{ event.git.sha }} + branch: ${{ event.git.branch }} + tag: "" + cache-warm: "false" + cache-epoch: v1 + build-probe: "" + target-cache-mode: keep + shard-total: "8" + +# Shared cache baseline: only develop may write; PRs restore it read-only. +tool-cache: + vault: optimism-op-reth-shadow + +base: + image: ubuntu:24.04@sha256:008173c23f95b170204355c12626cb5a965d779a7e1283b09e9cffbb1bf33ca3 + config: rwx/base 1.2.0 + arch: x86_64 + +defaults: + runner: + cpus: 2 + memory: 8gb + +tasks: + - key: code + call: git/clone 2.2.0 + with: + repository: https://github.com/ethereum-optimism/optimism.git + ref: ${{ init.commit-sha }} + preserve-git-dir: true + fetch-full-depth: true + submodules: false + + - key: bootstrap-inputs + use: code + run: 'true' + filter: [mise.toml, ops/ci/runtime] + outputs: + filesystem: + filter: + workspace: [mise.toml, ops/ci/runtime/apt-install.sh, ops/ci/runtime/rwx-prepare.sh, ops/ci/runtime/rwx-contracts-prepare.sh, ops/ci/runtime/rwx-rust-prepare.sh, ops/ci/runtime/op-reth-shadow.sh, ops/ci/runtime/op-reth-report.py, ops/ci/runtime/rust-target-cache.py] + system: [] + artifacts: + - key: mise-config + path: mise.toml + - key: ci-scripts + path: ops/ci/runtime + - key: apt-script + path: ops/ci/runtime/apt-install.sh + + - key: mise + call: mise/install 1.1.0 + with: + mise-version: "2026.2.2" + install: "false" + + # Artifact dependencies avoid inheriting the checkout's Git history into + # reusable tools. Language toolchains are added only by their own workload. + - key: tools + use: [mise, bootstrap-inputs] + call: ${{ run.dir }}/packages/toolchain-common.yml + + - key: go-build-tools + use: tools + call: ${{ run.dir }}/packages/toolchain-go.yml + with: + mode: go + + - key: route + use: [code, tools] + run: bash ops/ci/runtime/rwx-metadata.sh + env: + CI_EVENT: push + CI_CACHE_WARM: ${{ init.cache-warm }} + CI_BRANCH: ${{ init.branch }} + CI_TAG: ${{ init.tag }} + CI_COMMIT_SHA: ${{ init.commit-sha }} + cache: false + timeout: 10m + outputs: + filesystem: false + artifacts: + - key: routing + path: .ci/pipeline-parameters.json + + - key: contract-tools + use: [bootstrap-inputs, tools] + call: ${{ run.dir }}/packages/toolchain-foundry.yml + with: + mode: anvil + + - key: rust-tools + use: [bootstrap-inputs, tools] + call: ${{ run.dir }}/packages/toolchain-rust.yml + with: + mode: release + + - key: helper-tests + use: [code, go-build-tools] + if: ${{ init.cache-warm != 'true' }} + run: | + mise exec -- python3 -m unittest discover -s ops/ci/tests -p 'test_acceptance*.py' + python3 -m unittest discover -s ops/ci/tests -p 'test_rust_target_cache.py' + cache: false + timeout: 10m + outputs: + filesystem: false + + - key: source + use: [code, tools] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + run: | + git submodule sync --recursive + git submodule update --init --recursive --jobs 8 + git rev-parse HEAD >packages/contracts-bedrock/.gitcommit + timeout: 20m + + - key: go + use: [source, go-build-tools] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + call: ${{ run.dir }}/packages/go-go.yml + with: + commit-sha: ${{ init.commit-sha }} + cache-epoch: ${{ init.cache-epoch }} + build-probe: ${{ init.build-probe }} + target-cache-mode: ${{ init.target-cache-mode }} + + - key: contracts + use: [source, contract-tools, go-build-tools] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + call: ${{ run.dir }}/packages/go-contracts.yml + with: + commit-sha: ${{ init.commit-sha }} + cache-epoch: ${{ init.cache-epoch }} + build-probe: ${{ init.build-probe }} + target-cache-mode: ${{ init.target-cache-mode }} + + - key: kona + use: [source, rust-tools] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + call: ${{ run.dir }}/packages/go-kona.yml + with: + commit-sha: ${{ init.commit-sha }} + cache-epoch: ${{ init.cache-epoch }} + build-probe: ${{ init.build-probe }} + target-cache-mode: ${{ init.target-cache-mode }} + + - key: op-reth + use: [source, rust-tools] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + call: ${{ run.dir }}/packages/go-op-reth.yml + with: + commit-sha: ${{ init.commit-sha }} + cache-epoch: ${{ init.cache-epoch }} + build-probe: ${{ init.build-probe }} + target-cache-mode: ${{ init.target-cache-mode }} + + - key: prestate + use: [source, go-build-tools] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + call: ${{ run.dir }}/packages/go-prestate.yml + with: + commit-sha: ${{ init.commit-sha }} + cache-epoch: ${{ init.cache-epoch }} + build-probe: ${{ init.build-probe }} + target-cache-mode: ${{ init.target-cache-mode }} + + - key: sp1-executor + use: [source, rust-tools] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + call: ${{ run.dir }}/packages/go-sp1-executor.yml + with: + commit-sha: ${{ init.commit-sha }} + cache-epoch: ${{ init.cache-epoch }} + build-probe: ${{ init.build-probe }} + target-cache-mode: ${{ init.target-cache-mode }} + + - key: acceptance-tools + use: [go-build-tools, contract-tools] + run: | + bash ops/ci/runtime/apt-install.sh --no-install-recommends eatmydata + mise install go:github.com/ethereum/go-ethereum/cmd/geth + printf '%s\n' "$(mise bin-paths | paste -sd: -):$PATH" >"$RWX_ENV/PATH" + timeout: 30m + + - key: discovery-opn + use: [source, go-build-tools, go.build, contracts.build] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + call: ${{ run.dir }}/packages/acceptance-compile.yml + with: + commit-sha: ${{ init.commit-sha }} + shard-total: ${{ init.shard-total }} + cl-kind: op-node + cache-key: acceptance-discovery-opn-${{ init.cache-epoch }} + memory: 64gb + + - key: verdict-opn-0 + use: [source, acceptance-tools, go.build, contracts.build, kona.build, op-reth.build, prestate.build, sp1-executor.build, discovery-opn.build] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-main == 'true' }} + call: ${{ run.dir }}/packages/acceptance-verdict.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + shard-index: '0' + shard-total: ${{ init.shard-total }} + cl-kind: op-node + cache-key: acceptance-runtime-opn-0-${{ init.cache-epoch }} + memory: 64gb + + - key: verdict-opn-1 + use: [source, acceptance-tools, go.build, contracts.build, kona.build, op-reth.build, prestate.build, sp1-executor.build, discovery-opn.build] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-main == 'true' }} + call: ${{ run.dir }}/packages/acceptance-verdict.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + shard-index: '1' + shard-total: ${{ init.shard-total }} + cl-kind: op-node + cache-key: acceptance-runtime-opn-1-${{ init.cache-epoch }} + memory: 64gb + + - key: verdict-opn-2 + use: [source, acceptance-tools, go.build, contracts.build, kona.build, op-reth.build, prestate.build, sp1-executor.build, discovery-opn.build] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-main == 'true' }} + call: ${{ run.dir }}/packages/acceptance-verdict.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + shard-index: '2' + shard-total: ${{ init.shard-total }} + cl-kind: op-node + cache-key: acceptance-runtime-opn-2-${{ init.cache-epoch }} + memory: 64gb + + - key: verdict-opn-3 + use: [source, acceptance-tools, go.build, contracts.build, kona.build, op-reth.build, prestate.build, sp1-executor.build, discovery-opn.build] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-main == 'true' }} + call: ${{ run.dir }}/packages/acceptance-verdict.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + shard-index: '3' + shard-total: ${{ init.shard-total }} + cl-kind: op-node + cache-key: acceptance-runtime-opn-3-${{ init.cache-epoch }} + memory: 64gb + + - key: verdict-opn-4 + use: [source, acceptance-tools, go.build, contracts.build, kona.build, op-reth.build, prestate.build, sp1-executor.build, discovery-opn.build] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-main == 'true' }} + call: ${{ run.dir }}/packages/acceptance-verdict.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + shard-index: '4' + shard-total: ${{ init.shard-total }} + cl-kind: op-node + cache-key: acceptance-runtime-opn-4-${{ init.cache-epoch }} + memory: 64gb + + - key: verdict-opn-5 + use: [source, acceptance-tools, go.build, contracts.build, kona.build, op-reth.build, prestate.build, sp1-executor.build, discovery-opn.build] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-main == 'true' }} + call: ${{ run.dir }}/packages/acceptance-verdict.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + shard-index: '5' + shard-total: ${{ init.shard-total }} + cl-kind: op-node + cache-key: acceptance-runtime-opn-5-${{ init.cache-epoch }} + memory: 64gb + + - key: verdict-opn-6 + use: [source, acceptance-tools, go.build, contracts.build, kona.build, op-reth.build, prestate.build, sp1-executor.build, discovery-opn.build] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-main == 'true' }} + call: ${{ run.dir }}/packages/acceptance-verdict.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + shard-index: '6' + shard-total: ${{ init.shard-total }} + cl-kind: op-node + cache-key: acceptance-runtime-opn-6-${{ init.cache-epoch }} + memory: 64gb + + - key: verdict-opn-7 + use: [source, acceptance-tools, go.build, contracts.build, kona.build, op-reth.build, prestate.build, sp1-executor.build, discovery-opn.build] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-main == 'true' }} + call: ${{ run.dir }}/packages/acceptance-verdict.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + shard-index: '7' + shard-total: ${{ init.shard-total }} + cl-kind: op-node + cache-key: acceptance-runtime-opn-7-${{ init.cache-epoch }} + memory: 64gb + + - key: discovery-kona + use: [source, go-build-tools, go.build, contracts.build] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + call: ${{ run.dir }}/packages/acceptance-compile.yml + with: + commit-sha: ${{ init.commit-sha }} + shard-total: ${{ init.shard-total }} + cl-kind: kona-node + cache-key: acceptance-discovery-kona-${{ init.cache-epoch }} + + - key: verdict-kona-0 + use: [source, acceptance-tools, go.build, contracts.build, kona.build, op-reth.build, prestate.build, sp1-executor.build, discovery-kona.build] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-main == 'true' }} + call: ${{ run.dir }}/packages/acceptance-verdict.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + shard-index: '0' + shard-total: ${{ init.shard-total }} + cl-kind: kona-node + cache-key: acceptance-runtime-kona-0-${{ init.cache-epoch }} + memory: 32gb + + - key: verdict-kona-1 + use: [source, acceptance-tools, go.build, contracts.build, kona.build, op-reth.build, prestate.build, sp1-executor.build, discovery-kona.build] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-main == 'true' }} + call: ${{ run.dir }}/packages/acceptance-verdict.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + shard-index: '1' + shard-total: ${{ init.shard-total }} + cl-kind: kona-node + cache-key: acceptance-runtime-kona-1-${{ init.cache-epoch }} + memory: 32gb + + - key: verdict-kona-2 + use: [source, acceptance-tools, go.build, contracts.build, kona.build, op-reth.build, prestate.build, sp1-executor.build, discovery-kona.build] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-main == 'true' }} + call: ${{ run.dir }}/packages/acceptance-verdict.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + shard-index: '2' + shard-total: ${{ init.shard-total }} + cl-kind: kona-node + cache-key: acceptance-runtime-kona-2-${{ init.cache-epoch }} + memory: 32gb + + - key: verdict-kona-3 + use: [source, acceptance-tools, go.build, contracts.build, kona.build, op-reth.build, prestate.build, sp1-executor.build, discovery-kona.build] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-main == 'true' }} + call: ${{ run.dir }}/packages/acceptance-verdict.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + shard-index: '3' + shard-total: ${{ init.shard-total }} + cl-kind: kona-node + cache-key: acceptance-runtime-kona-3-${{ init.cache-epoch }} + memory: 32gb + + - key: verdict-kona-4 + use: [source, acceptance-tools, go.build, contracts.build, kona.build, op-reth.build, prestate.build, sp1-executor.build, discovery-kona.build] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-main == 'true' }} + call: ${{ run.dir }}/packages/acceptance-verdict.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + shard-index: '4' + shard-total: ${{ init.shard-total }} + cl-kind: kona-node + cache-key: acceptance-runtime-kona-4-${{ init.cache-epoch }} + memory: 32gb + + - key: verdict-kona-5 + use: [source, acceptance-tools, go.build, contracts.build, kona.build, op-reth.build, prestate.build, sp1-executor.build, discovery-kona.build] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-main == 'true' }} + call: ${{ run.dir }}/packages/acceptance-verdict.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + shard-index: '5' + shard-total: ${{ init.shard-total }} + cl-kind: kona-node + cache-key: acceptance-runtime-kona-5-${{ init.cache-epoch }} + memory: 32gb + + - key: verdict-kona-6 + use: [source, acceptance-tools, go.build, contracts.build, kona.build, op-reth.build, prestate.build, sp1-executor.build, discovery-kona.build] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-main == 'true' }} + call: ${{ run.dir }}/packages/acceptance-verdict.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + shard-index: '6' + shard-total: ${{ init.shard-total }} + cl-kind: kona-node + cache-key: acceptance-runtime-kona-6-${{ init.cache-epoch }} + memory: 32gb + + - key: verdict-kona-7 + use: [source, acceptance-tools, go.build, contracts.build, kona.build, op-reth.build, prestate.build, sp1-executor.build, discovery-kona.build] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-main == 'true' }} + call: ${{ run.dir }}/packages/acceptance-verdict.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + shard-index: '7' + shard-total: ${{ init.shard-total }} + cl-kind: kona-node + cache-key: acceptance-runtime-kona-7-${{ init.cache-epoch }} + memory: 32gb + + - key: main-gate-receipt + use: [code, tools] + after: ${{ (verdict-kona-0.succeeded || verdict-kona-0.failed || verdict-kona-0.skipped) && (verdict-kona-1.succeeded || verdict-kona-1.failed || verdict-kona-1.skipped) && (verdict-kona-2.succeeded || verdict-kona-2.failed || verdict-kona-2.skipped) && (verdict-kona-3.succeeded || verdict-kona-3.failed || verdict-kona-3.skipped) && (verdict-kona-4.succeeded || verdict-kona-4.failed || verdict-kona-4.skipped) && (verdict-kona-5.succeeded || verdict-kona-5.failed || verdict-kona-5.skipped) && (verdict-kona-6.succeeded || verdict-kona-6.failed || verdict-kona-6.skipped) && (verdict-kona-7.succeeded || verdict-kona-7.failed || verdict-kona-7.skipped) && (verdict-opn-0.succeeded || verdict-opn-0.failed || verdict-opn-0.skipped) && (verdict-opn-1.succeeded || verdict-opn-1.failed || verdict-opn-1.skipped) && (verdict-opn-2.succeeded || verdict-opn-2.failed || verdict-opn-2.skipped) && (verdict-opn-3.succeeded || verdict-opn-3.failed || verdict-opn-3.skipped) && (verdict-opn-4.succeeded || verdict-opn-4.failed || verdict-opn-4.skipped) && (verdict-opn-5.succeeded || verdict-opn-5.failed || verdict-opn-5.skipped) && (verdict-opn-6.succeeded || verdict-opn-6.failed || verdict-opn-6.skipped) && (verdict-opn-7.succeeded || verdict-opn-7.failed || verdict-opn-7.skipped) }} + if: ${{ init.cache-warm != 'true' && init.shard-total == '8' }} + run: python3 ops/ci/runtime/pr-gate.py receipt main-acceptance + env: + CI_COMMIT_SHA: ${{ init.commit-sha }} + CI_BRANCH: ${{ init.branch }} + GROUP_SELECTED: ${{ tasks.route.values.run-main }} + RWX_RUN_ID: + cache-key: included + RWX_TASK_ATTEMPT_NUMBER: + cache-key: included + TASK_VERDICT_KONA_0_SUCCEEDED: ${{ tasks.verdict-kona-0.succeeded }} + TASK_VERDICT_KONA_0_FAILED: ${{ tasks.verdict-kona-0.failed }} + TASK_VERDICT_KONA_0_SKIPPED: ${{ tasks.verdict-kona-0.skipped }} + TASK_VERDICT_KONA_1_SUCCEEDED: ${{ tasks.verdict-kona-1.succeeded }} + TASK_VERDICT_KONA_1_FAILED: ${{ tasks.verdict-kona-1.failed }} + TASK_VERDICT_KONA_1_SKIPPED: ${{ tasks.verdict-kona-1.skipped }} + TASK_VERDICT_KONA_2_SUCCEEDED: ${{ tasks.verdict-kona-2.succeeded }} + TASK_VERDICT_KONA_2_FAILED: ${{ tasks.verdict-kona-2.failed }} + TASK_VERDICT_KONA_2_SKIPPED: ${{ tasks.verdict-kona-2.skipped }} + TASK_VERDICT_KONA_3_SUCCEEDED: ${{ tasks.verdict-kona-3.succeeded }} + TASK_VERDICT_KONA_3_FAILED: ${{ tasks.verdict-kona-3.failed }} + TASK_VERDICT_KONA_3_SKIPPED: ${{ tasks.verdict-kona-3.skipped }} + TASK_VERDICT_KONA_4_SUCCEEDED: ${{ tasks.verdict-kona-4.succeeded }} + TASK_VERDICT_KONA_4_FAILED: ${{ tasks.verdict-kona-4.failed }} + TASK_VERDICT_KONA_4_SKIPPED: ${{ tasks.verdict-kona-4.skipped }} + TASK_VERDICT_KONA_5_SUCCEEDED: ${{ tasks.verdict-kona-5.succeeded }} + TASK_VERDICT_KONA_5_FAILED: ${{ tasks.verdict-kona-5.failed }} + TASK_VERDICT_KONA_5_SKIPPED: ${{ tasks.verdict-kona-5.skipped }} + TASK_VERDICT_KONA_6_SUCCEEDED: ${{ tasks.verdict-kona-6.succeeded }} + TASK_VERDICT_KONA_6_FAILED: ${{ tasks.verdict-kona-6.failed }} + TASK_VERDICT_KONA_6_SKIPPED: ${{ tasks.verdict-kona-6.skipped }} + TASK_VERDICT_KONA_7_SUCCEEDED: ${{ tasks.verdict-kona-7.succeeded }} + TASK_VERDICT_KONA_7_FAILED: ${{ tasks.verdict-kona-7.failed }} + TASK_VERDICT_KONA_7_SKIPPED: ${{ tasks.verdict-kona-7.skipped }} + TASK_VERDICT_OPN_0_SUCCEEDED: ${{ tasks.verdict-opn-0.succeeded }} + TASK_VERDICT_OPN_0_FAILED: ${{ tasks.verdict-opn-0.failed }} + TASK_VERDICT_OPN_0_SKIPPED: ${{ tasks.verdict-opn-0.skipped }} + TASK_VERDICT_OPN_1_SUCCEEDED: ${{ tasks.verdict-opn-1.succeeded }} + TASK_VERDICT_OPN_1_FAILED: ${{ tasks.verdict-opn-1.failed }} + TASK_VERDICT_OPN_1_SKIPPED: ${{ tasks.verdict-opn-1.skipped }} + TASK_VERDICT_OPN_2_SUCCEEDED: ${{ tasks.verdict-opn-2.succeeded }} + TASK_VERDICT_OPN_2_FAILED: ${{ tasks.verdict-opn-2.failed }} + TASK_VERDICT_OPN_2_SKIPPED: ${{ tasks.verdict-opn-2.skipped }} + TASK_VERDICT_OPN_3_SUCCEEDED: ${{ tasks.verdict-opn-3.succeeded }} + TASK_VERDICT_OPN_3_FAILED: ${{ tasks.verdict-opn-3.failed }} + TASK_VERDICT_OPN_3_SKIPPED: ${{ tasks.verdict-opn-3.skipped }} + TASK_VERDICT_OPN_4_SUCCEEDED: ${{ tasks.verdict-opn-4.succeeded }} + TASK_VERDICT_OPN_4_FAILED: ${{ tasks.verdict-opn-4.failed }} + TASK_VERDICT_OPN_4_SKIPPED: ${{ tasks.verdict-opn-4.skipped }} + TASK_VERDICT_OPN_5_SUCCEEDED: ${{ tasks.verdict-opn-5.succeeded }} + TASK_VERDICT_OPN_5_FAILED: ${{ tasks.verdict-opn-5.failed }} + TASK_VERDICT_OPN_5_SKIPPED: ${{ tasks.verdict-opn-5.skipped }} + TASK_VERDICT_OPN_6_SUCCEEDED: ${{ tasks.verdict-opn-6.succeeded }} + TASK_VERDICT_OPN_6_FAILED: ${{ tasks.verdict-opn-6.failed }} + TASK_VERDICT_OPN_6_SKIPPED: ${{ tasks.verdict-opn-6.skipped }} + TASK_VERDICT_OPN_7_SUCCEEDED: ${{ tasks.verdict-opn-7.succeeded }} + TASK_VERDICT_OPN_7_FAILED: ${{ tasks.verdict-opn-7.failed }} + TASK_VERDICT_OPN_7_SKIPPED: ${{ tasks.verdict-opn-7.skipped }} + cache: false + timeout: 10m + outputs: + filesystem: false + artifacts: + - key: receipt + path: .ci/pr-gates/groups/main-acceptance diff --git a/.rwx/cannon-go.yml b/.rwx/cannon-go.yml new file mode 100644 index 00000000000..70269631059 --- /dev/null +++ b/.rwx/cannon-go.yml @@ -0,0 +1,208 @@ +# Complete Cannon Go PR workload; Circle still owns its required gate. +on: + cache-rebuild: + if: ${{ event.git.branch == 'develop' }} + target: [modules, contracts] + init: + commit-sha: ${{ event.git.sha }} + branch: ${{ event.git.branch }} + tag: "" + cache-warm: "true" + cache-epoch: v1 + cli: + init: + commit-sha: ${{ event.git.sha }} + branch: ${{ event.git.branch }} + tag: "" + cache-warm: "false" + cache-epoch: v1 + +tool-cache: + vault: optimism-op-reth-shadow + +base: + image: ubuntu:24.04@sha256:008173c23f95b170204355c12626cb5a965d779a7e1283b09e9cffbb1bf33ca3 + config: rwx/base 1.2.0 + arch: x86_64 + +defaults: + runner: + cpus: 2 + memory: 8gb + +tasks: + - key: code + call: git/clone 2.2.0 + with: + repository: https://github.com/ethereum-optimism/optimism.git + ref: ${{ init.commit-sha }} + preserve-git-dir: true + fetch-full-depth: true + submodules: false + + - key: bootstrap-inputs + use: code + run: 'true' + filter: [mise.toml, ops/ci/runtime] + outputs: + filesystem: + filter: + workspace: [mise.toml, ops/ci/runtime/apt-install.sh, ops/ci/runtime/rwx-prepare.sh, ops/ci/runtime/rwx-contracts-prepare.sh, ops/ci/runtime/rwx-rust-prepare.sh, ops/ci/runtime/op-reth-shadow.sh, ops/ci/runtime/op-reth-report.py, ops/ci/runtime/rust-target-cache.py] + system: [] + artifacts: + - key: mise-config + path: mise.toml + - key: ci-scripts + path: ops/ci/runtime + - key: apt-script + path: ops/ci/runtime/apt-install.sh + + - key: mise + call: mise/install 1.1.0 + with: + mise-version: "2026.2.2" + install: "false" + + - key: tools + use: [mise, bootstrap-inputs] + call: ${{ run.dir }}/packages/toolchain-common.yml + + - key: route + use: [code, tools] + run: bash ops/ci/runtime/rwx-metadata.sh + env: + CI_EVENT: push + CI_CACHE_WARM: ${{ init.cache-warm }} + CI_BRANCH: ${{ init.branch }} + CI_TAG: ${{ init.tag }} + CI_COMMIT_SHA: ${{ init.commit-sha }} + cache: false + timeout: 10m + outputs: + filesystem: false + artifacts: + - key: routing + path: .ci/pipeline-parameters.json + + - key: go-tools + use: tools + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + call: ${{ run.dir }}/packages/toolchain-go.yml + with: + mode: go + + - key: contract-tools + use: [bootstrap-inputs, tools] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + call: ${{ run.dir }}/packages/toolchain-foundry.yml + with: + mode: compiler + + - key: source + use: [code, tools] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + run: | + git submodule sync --recursive + git -c protocol.file.allow=never submodule update --init --recursive --jobs 8 + git rev-parse HEAD >packages/contracts-bedrock/.gitcommit + timeout: 20m + + - key: modules + use: [code, go-tools] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + call: ${{ run.dir }}/packages/go-modules.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + cache-epoch: ${{ init.cache-epoch }} + + - key: contracts + use: [source, go-tools, contract-tools] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + call: ${{ run.dir }}/packages/go-contracts.yml + with: + commit-sha: ${{ init.commit-sha }} + cache-epoch: ${{ init.cache-epoch }} + build-probe: '' + target-cache-mode: keep + + - key: helper-tests + use: [code, go-tools, contract-tools] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-main == 'true' }} + run: | + RWX_LIVE_CONTRACT_DEPENDENCIES_FIXTURE=1 python3 -m unittest discover -s ops/ci/tests -p 'test_go_dependencies.py' + RWX_LIVE_CANNON_GO_FIXTURE=1 python3 -m unittest discover -s ops/ci/tests -p 'test_cannon_go.py' + RWX_LIVE_CANNON_GO_FIXTURE=1 python3 -m unittest discover -s ops/ci/migration/tests -p 'test_migration_cannon_go.py' + python3 -m unittest discover -s ops/ci/migration/tests -p 'test_compare_cannon_go.py' + cache: false + timeout: 15m + outputs: + filesystem: false + + artifacts: + - key: fixtures + path: .ci/cannon-go/helper-fixtures + + - key: tests + use: [source, go-tools, contract-tools] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-main == 'true' }} + run: | + export GOMODCACHE="$PWD/.ci/go-cache/pr-checks/modules" + export GOCACHE="$PWD/.ci/go-cache/cannon-go/build" + mkdir -p "$GOCACHE" + python3 ops/ci/runtime/cannon-go.py --provider rwx --skip-slow-tests true --fresh-tests true \ + --module-artifact "$MODULE_ARTIFACT" --contract-artifact "$CONTRACT_ARTIFACT" + env: + CI: "true" + CI_COMMIT_SHA: ${{ init.commit-sha }} + CI_BRANCH: ${{ init.branch }} + MODULE_ARTIFACT: ${{ tasks.modules.tasks.build.artifacts.dependency }} + CONTRACT_ARTIFACT: ${{ tasks.contracts.tasks.build.artifacts.dependency }} + RWX_RUN_ID: + cache-key: included + RWX_TASK_ATTEMPT_NUMBER: + cache-key: included + cache: false + tool-cache: cannon-go-compiler-${{ init.cache-epoch }} + timeout: 30m + runner: + cpus: 8 + memory: 16gb + outputs: + filesystem: + filter: + workspace: [.ci/go-cache/cannon-go/build] + system: [] + test-results: + - path: .ci/cannon-go/run/native.json + options: + language: Go + framework: go test + artifacts: + - key: reports + path: .ci/cannon-go/run + + # Exact Main dependency states; unrelated workload failures stay outside this gate. + - key: main-gate-receipt + use: [code, tools] + after: ${{ (tests.succeeded || tests.failed || tests.skipped) }} + if: ${{ init.cache-warm != 'true' }} + run: python3 ops/ci/runtime/pr-gate.py receipt main-cannon + env: + CI_COMMIT_SHA: ${{ init.commit-sha }} + CI_BRANCH: ${{ init.branch }} + GROUP_SELECTED: ${{ tasks.route.values.run-main }} + RWX_RUN_ID: + cache-key: included + RWX_TASK_ATTEMPT_NUMBER: + cache-key: included + TASK_TESTS_SUCCEEDED: ${{ tasks.tests.succeeded }} + TASK_TESTS_FAILED: ${{ tasks.tests.failed }} + TASK_TESTS_SKIPPED: ${{ tasks.tests.skipped }} + cache: false + timeout: 10m + outputs: + filesystem: false + artifacts: + - key: receipt + path: .ci/pr-gates/groups/main-cannon diff --git a/.rwx/contract-l2-fork.yml b/.rwx/contract-l2-fork.yml new file mode 100644 index 00000000000..661cada1c6e --- /dev/null +++ b/.rwx/contract-l2-fork.yml @@ -0,0 +1,215 @@ +# Full OP Mainnet L2 fork suite with original NUT verification and fresh verdicts. +on: + cache-rebuild: + if: ${{ event.git.branch == 'develop' }} + target: compile + init: + commit-sha: ${{ event.git.sha }} + branch: ${{ event.git.branch }} + tag: "" + cache-warm: "true" + cache-epoch: v1 + fork-block: latest + cli: + init: + commit-sha: ${{ event.git.sha }} + branch: ${{ event.git.branch }} + tag: "" + cache-warm: "false" + cache-epoch: v1 + fork-block: latest + +tool-cache: + vault: optimism-op-reth-shadow + +base: + image: ubuntu:24.04@sha256:008173c23f95b170204355c12626cb5a965d779a7e1283b09e9cffbb1bf33ca3 + config: rwx/base 1.2.0 + arch: x86_64 + +defaults: + runner: {cpus: 2, memory: 8gb} + +tasks: + - key: code + call: git/clone 2.2.0 + with: + repository: https://github.com/ethereum-optimism/optimism.git + ref: ${{ init.commit-sha }} + preserve-git-dir: true + fetch-full-depth: true + submodules: false + - key: mise + call: mise/install 1.1.0 + with: {mise-version: "2026.2.2", install: "false"} + - key: tools + use: [code, mise] + run: bash ops/ci/runtime/rwx-prepare.sh + timeout: 30m + - key: route + use: [code, tools] + run: | + bash ops/ci/runtime/rwx-metadata.sh + jq -er '."c-run_contracts_feature_tests" | if type == "boolean" then tostring else error("missing contracts route") end' \ + .ci/pipeline-parameters.json >"$RWX_VALUES/run-contracts" + env: + CI_EVENT: push + CI_CACHE_WARM: ${{ init.cache-warm }} + CI_COMMIT_SHA: ${{ init.commit-sha }} + CI_BRANCH: ${{ init.branch }} + CI_TAG: ${{ init.tag }} + cache: false + outputs: + filesystem: false + artifacts: + - key: routing + path: .ci/pipeline-parameters.json + - key: rpc-check + use: [code, tools] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-contracts == 'true' }} + run: | + python3 ops/ci/runtime/contract-l2-fork.py preflight --fork-block "$CI_L2_FORK_BLOCK" + printf 'true\n' >"$RWX_VALUES/ready" + env: + CI_COMMIT_SHA: ${{ init.commit-sha }} + CI_BRANCH: ${{ init.branch }} + CI_L2_FORK_BLOCK: ${{ init.fork-block }} + cache: false + timeout: 10m + outputs: + filesystem: false + artifacts: + - key: block + path: .ci/contract-l2-fork/preflight/block.json + - key: originals + path: .ci/contract-l2-fork/preflight + - key: go-tools + use: tools + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-contracts == 'true' }} + after: ${{ rpc-check.succeeded || rpc-check.skipped }} + call: ${{ run.dir }}/packages/toolchain-go.yml + with: + mode: go + + - key: contract-tools + use: tools + after: ${{ rpc-check.succeeded || rpc-check.skipped }} + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-contracts == 'true' }} + run: bash ops/ci/runtime/rwx-contracts-prepare.sh tools + timeout: 30m + - key: go-modules + use: [code, go-tools] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-contracts == 'true' }} + run: | + export GOMODCACHE="$PWD/.ci/go-cache/l2-fork/modules" + mkdir -p "$GOMODCACHE" + python3 ops/ci/runtime/pr-checks.py go-modules + env: + CI_COMMIT_SHA: ${{ init.commit-sha }} + CI_BRANCH: ${{ init.branch }} + CI_CHECK_PROVIDER: rwx + tool-cache: l2-fork-go-modules-${{ init.cache-epoch }} + timeout: 30m + runner: + cpus: 2 + memory: 4gb + outputs: + filesystem: + filter: + workspace: [.ci/go-cache/l2-fork/modules] + system: [] + artifacts: + - key: originals + path: .ci/pr-checks/go-modules + - key: source + use: [code, tools] + after: ${{ rpc-check.succeeded || rpc-check.skipped }} + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-contracts == 'true' }} + run: | + git submodule sync --recursive + git -c protocol.file.allow=never submodule update --init --recursive --jobs 8 + timeout: 20m + - key: helper-tests + use: [code, tools] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-contracts == 'true' }} + run: | + python3 -m unittest discover -s ops/ci/tests -p 'test*l2*.py' + python3 -m unittest discover -s ops/ci/migration/tests -p 'test*l2*.py' + cache: false + timeout: 10m + outputs: {filesystem: false} + - key: compile + use: [source, go-tools, contract-tools, go-modules] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-contracts == 'true' }} + run: | + export GOMODCACHE="$PWD/.ci/go-cache/l2-fork/modules" + export GOCACHE="$PWD/.ci/go-cache/l2-fork/compile" + python3 ops/ci/runtime/contract-l2-fork.py prepare + env: + CI_COMMIT_SHA: ${{ init.commit-sha }} + CI_BRANCH: ${{ init.branch }} + CI_CONTRACT_PROVIDER: rwx + tool-cache: l2-fork-compiled-ci-${{ init.cache-epoch }} + timeout: 40m + runner: {cpus: 16, memory: 32gb} + outputs: + filesystem: + filter: + workspace: [packages/contracts-bedrock/forge-artifacts, packages/contracts-bedrock/cache/solidity-files-cache.json, packages/contracts-bedrock/artifacts/build-info, packages/contracts-bedrock/scripts/go-ffi/go-ffi, .ci/go-cache/l2-fork/compile] + system: [/root/.svm, /home/*/.svm] + artifacts: + - key: compiled + path: .ci/contract-l2-fork/prepare + - key: verdict + use: [source, go-tools, contract-tools, go-modules, compile] + if: ${{ init.cache-warm != 'true' && tasks.rpc-check.values.ready == 'true' }} + run: | + export GOMODCACHE="$PWD/.ci/go-cache/l2-fork/modules" + export GOCACHE="$PWD/.ci/go-cache/l2-fork/runtime" + python3 ops/ci/runtime/contract-l2-fork.py run --prepared "$COMPILED" --block "$PINNED_BLOCK" + env: + CI_COMMIT_SHA: ${{ init.commit-sha }} + CI_BRANCH: ${{ init.branch }} + CI_CONTRACT_PROVIDER: rwx + COMPILED: ${{ tasks.compile.artifacts.compiled }} + PINNED_BLOCK: ${{ tasks.rpc-check.artifacts.originals }}/block.json + cache: false + tool-cache: l2-fork-runtime-state-${{ init.cache-epoch }} + timeout: 60m + runner: {cpus: 16, memory: 32gb} + outputs: + filesystem: + filter: + workspace: [.ci/go-cache/l2-fork/runtime] + system: [/root/.foundry/cache/rpc, /home/*/.foundry/cache/rpc] + test-results: + - path: .ci/contract-l2-fork/run/original.junit.xml + options: {language: Solidity, framework: Foundry} + artifacts: + - key: originals + path: .ci/contract-l2-fork/run + + # Bind every complete Contracts prerequisite to fresh engine terminal states. + - key: contracts-gate-receipt + use: [code, tools] + after: ${{ (verdict.succeeded || verdict.failed || verdict.skipped) }} + if: ${{ init.cache-warm != 'true' }} + run: python3 ops/ci/runtime/pr-gate.py receipt contracts-l2-fork + env: + CI_COMMIT_SHA: ${{ init.commit-sha }} + CI_BRANCH: ${{ init.branch }} + GROUP_SELECTED: ${{ tasks.route.values.run-contracts }} + RWX_RUN_ID: + cache-key: included + RWX_TASK_ATTEMPT_NUMBER: + cache-key: included + TASK_VERDICT_SUCCEEDED: ${{ tasks.verdict.succeeded }} + TASK_VERDICT_FAILED: ${{ tasks.verdict.failed }} + TASK_VERDICT_SKIPPED: ${{ tasks.verdict.skipped }} + cache: false + timeout: 10m + outputs: + filesystem: false + artifacts: + - key: receipt + path: .ci/pr-gates/groups/contracts-l2-fork diff --git a/.rwx/contract-upgrades.yml b/.rwx/contract-upgrades.yml new file mode 100644 index 00000000000..c2f96cad545 --- /dev/null +++ b/.rwx/contract-upgrades.yml @@ -0,0 +1,385 @@ +# Complete L1 upgrade matrices; Circle retains its required gates. +on: + cache-rebuild: + if: ${{ event.git.branch == 'develop' }} + target: [compile-feature-main, compile-feature-CUSTOM_GAS_TOKEN, compile-feature-INTEROP, compile-chain-op, compile-chain-ink, compile-chain-unichain, compile-feature-BRIDGE_HOOK, compile-feature-OP_PRIVATE] + init: + commit-sha: ${{ event.git.sha }} + branch: ${{ event.git.branch }} + tag: "" + cache-warm: "true" + cache-epoch: v1 + cli: + init: + commit-sha: ${{ event.git.sha }} + branch: ${{ event.git.branch }} + tag: "" + cache-warm: "false" + cache-epoch: v1 + +tool-cache: + vault: optimism-op-reth-shadow + +base: + image: ubuntu:24.04@sha256:008173c23f95b170204355c12626cb5a965d779a7e1283b09e9cffbb1bf33ca3 + config: rwx/base 1.2.0 + arch: x86_64 + +defaults: + runner: + cpus: 2 + memory: 8gb + +tasks: + - key: code + call: git/clone 2.2.0 + with: + repository: https://github.com/ethereum-optimism/optimism.git + ref: ${{ init.commit-sha }} + preserve-git-dir: true + fetch-full-depth: true + submodules: false + + - key: bootstrap-inputs + use: code + run: 'true' + filter: [mise.toml, ops/ci/runtime] + outputs: + filesystem: + filter: + workspace: [mise.toml, ops/ci/runtime/apt-install.sh, ops/ci/runtime/rwx-prepare.sh, ops/ci/runtime/rwx-contracts-prepare.sh, ops/ci/runtime/rwx-rust-prepare.sh, ops/ci/runtime/op-reth-shadow.sh, ops/ci/runtime/op-reth-report.py, ops/ci/runtime/rust-target-cache.py] + system: [] + artifacts: + - key: mise-config + path: mise.toml + - key: ci-scripts + path: ops/ci/runtime + - key: apt-script + path: ops/ci/runtime/apt-install.sh + + - key: mise + call: mise/install 1.1.0 + with: + mise-version: "2026.2.2" + install: "false" + + - key: tools + use: [mise, bootstrap-inputs] + call: ${{ run.dir }}/packages/toolchain-common.yml + + - key: route + use: [code, tools] + run: | + bash ops/ci/runtime/rwx-metadata.sh + jq -er '."c-run_contracts_feature_tests" | if type == "boolean" then tostring else error("missing contracts route") end' \ + .ci/pipeline-parameters.json >"$RWX_VALUES/run-contracts" + env: + CI_EVENT: push + CI_CACHE_WARM: ${{ init.cache-warm }} + CI_BRANCH: ${{ init.branch }} + CI_TAG: ${{ init.tag }} + CI_COMMIT_SHA: ${{ init.commit-sha }} + cache: false + timeout: 10m + outputs: + filesystem: false + artifacts: + - key: routing + path: .ci/pipeline-parameters.json + + - key: go-tools + use: tools + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-contracts == 'true' }} + call: ${{ run.dir }}/packages/toolchain-go.yml + with: + mode: go + + - key: contract-tools + use: [bootstrap-inputs, tools] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-contracts == 'true' }} + call: ${{ run.dir }}/packages/toolchain-foundry.yml + with: + mode: compiler + + - key: rpc-check + use: [code, contract-tools] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-contracts == 'true' }} + run: | + python3 ops/ci/runtime/contract-upgrades.py preflight + printf 'true\n' >"$RWX_VALUES/ready" + env: + CI_COMMIT_SHA: ${{ init.commit-sha }} + CI_BRANCH: ${{ init.branch }} + OP_CI_MAINNET_L1_ARCHIVE_RPC_URL: ${{ vaults.optimism-go-tests-rpc-shadow.secrets.OP_CI_MAINNET_L1_ARCHIVE_RPC_URL }} + cache: false + timeout: 10m + outputs: + filesystem: + filter: + workspace: [.ci/contract-upgrades/preflight] + system: [] + artifacts: + - key: block + path: .ci/contract-upgrades/preflight/block.json + - key: reports + path: .ci/contract-upgrades/preflight + + - key: go-modules + use: [code, go-tools] + # Allow an intentionally skipped preflight only for compiler-only warming. + after: ${{ rpc-check.succeeded || rpc-check.skipped }} + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-contracts == 'true' }} + run: | + export GOMODCACHE="$PWD/.ci/go-cache/contract-upgrades/modules" + mkdir -p "$GOMODCACHE" + python3 ops/ci/runtime/pr-checks.py go-modules + env: + CI_COMMIT_SHA: ${{ init.commit-sha }} + CI_BRANCH: ${{ init.branch }} + CI_CHECK_PROVIDER: rwx + tool-cache: contract-upgrades-modules-${{ init.cache-epoch }} + timeout: 30m + runner: + cpus: 2 + memory: 4gb + outputs: + filesystem: + filter: + workspace: [.ci/go-cache/contract-upgrades/modules] + system: [] + artifacts: + - key: reports + path: .ci/pr-checks/go-modules + + - key: helper-tests + use: [code, go-tools, contract-tools] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-contracts == 'true' }} + run: | + RWX_LIVE_FORGE_FIXTURE=1 python3 -m unittest discover -s ops/ci/tests -p 'test_contract_upgrades.py' + python3 -m unittest discover -s ops/ci/migration/tests -p 'test_compare_contract_upgrades.py' + cache: false + timeout: 10m + outputs: + filesystem: false + + # Explicit producer/verdict pairs keep each variant's filesystem isolated. + - key: compile-feature-main + use: [code, go-tools, contract-tools, go-modules] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-contracts == 'true' }} + call: ${{ run.dir }}/packages/contract-upgrades-compile.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + cache-key: contract-upgrades-feature-main-${{ init.cache-epoch }} + variant: feature-main + + - key: verdict-feature-main + use: [code, go-tools, contract-tools, go-modules, compile-feature-main, rpc-check] + if: ${{ init.cache-warm != 'true' && tasks.rpc-check.values.ready == 'true' }} + call: ${{ run.dir }}/packages/contract-upgrades-verdict.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + compiled: .ci/contract-upgrades/feature-main/prepare + pinned-block: .ci/contract-upgrades/preflight/block.json + cache-key: contract-upgrades-rpc-feature-main-${{ init.cache-epoch }} + variant: feature-main + + - key: compile-feature-CUSTOM_GAS_TOKEN + use: [code, go-tools, contract-tools, go-modules] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-contracts == 'true' }} + call: ${{ run.dir }}/packages/contract-upgrades-compile.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + cache-key: contract-upgrades-feature-CUSTOM_GAS_TOKEN-${{ init.cache-epoch }} + variant: feature-CUSTOM_GAS_TOKEN + + - key: verdict-feature-CUSTOM_GAS_TOKEN + use: [code, go-tools, contract-tools, go-modules, compile-feature-CUSTOM_GAS_TOKEN, rpc-check] + if: ${{ init.cache-warm != 'true' && tasks.rpc-check.values.ready == 'true' }} + call: ${{ run.dir }}/packages/contract-upgrades-verdict.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + compiled: .ci/contract-upgrades/feature-CUSTOM_GAS_TOKEN/prepare + pinned-block: .ci/contract-upgrades/preflight/block.json + cache-key: contract-upgrades-rpc-feature-CUSTOM_GAS_TOKEN-${{ init.cache-epoch }} + variant: feature-CUSTOM_GAS_TOKEN + + - key: compile-feature-INTEROP + use: [code, go-tools, contract-tools, go-modules] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-contracts == 'true' }} + call: ${{ run.dir }}/packages/contract-upgrades-compile.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + cache-key: contract-upgrades-feature-INTEROP-${{ init.cache-epoch }} + variant: feature-INTEROP + + - key: verdict-feature-INTEROP + use: [code, go-tools, contract-tools, go-modules, compile-feature-INTEROP, rpc-check] + if: ${{ init.cache-warm != 'true' && tasks.rpc-check.values.ready == 'true' }} + call: ${{ run.dir }}/packages/contract-upgrades-verdict.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + compiled: .ci/contract-upgrades/feature-INTEROP/prepare + pinned-block: .ci/contract-upgrades/preflight/block.json + cache-key: contract-upgrades-rpc-feature-INTEROP-${{ init.cache-epoch }} + variant: feature-INTEROP + + - key: compile-feature-BRIDGE_HOOK + use: [code, go-tools, contract-tools, go-modules] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-contracts == 'true' }} + call: ${{ run.dir }}/packages/contract-upgrades-compile.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + cache-key: contract-upgrades-feature-BRIDGE_HOOK-${{ init.cache-epoch }} + variant: feature-BRIDGE_HOOK + + - key: compile-feature-OP_PRIVATE + use: [code, go-tools, contract-tools, go-modules] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-contracts == 'true' }} + call: ${{ run.dir }}/packages/contract-upgrades-compile.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + cache-key: contract-upgrades-feature-OP_PRIVATE-${{ init.cache-epoch }} + variant: feature-OP_PRIVATE + + - key: verdict-feature-BRIDGE_HOOK + use: [code, go-tools, contract-tools, go-modules, compile-feature-BRIDGE_HOOK, rpc-check] + if: ${{ init.cache-warm != 'true' && tasks.rpc-check.values.ready == 'true' }} + call: ${{ run.dir }}/packages/contract-upgrades-verdict.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + compiled: .ci/contract-upgrades/feature-BRIDGE_HOOK/prepare + pinned-block: .ci/contract-upgrades/preflight/block.json + cache-key: contract-upgrades-rpc-feature-BRIDGE_HOOK-${{ init.cache-epoch }} + variant: feature-BRIDGE_HOOK + + - key: verdict-feature-OP_PRIVATE + use: [code, go-tools, contract-tools, go-modules, compile-feature-OP_PRIVATE, rpc-check] + if: ${{ init.cache-warm != 'true' && tasks.rpc-check.values.ready == 'true' }} + call: ${{ run.dir }}/packages/contract-upgrades-verdict.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + compiled: .ci/contract-upgrades/feature-OP_PRIVATE/prepare + pinned-block: .ci/contract-upgrades/preflight/block.json + cache-key: contract-upgrades-rpc-feature-OP_PRIVATE-${{ init.cache-epoch }} + variant: feature-OP_PRIVATE + + - key: compile-chain-op + use: [code, go-tools, contract-tools, go-modules] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-contracts == 'true' }} + call: ${{ run.dir }}/packages/contract-upgrades-compile.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + cache-key: contract-upgrades-chain-op-${{ init.cache-epoch }} + variant: chain-op + + - key: verdict-chain-op + use: [code, go-tools, contract-tools, go-modules, compile-chain-op, rpc-check] + if: ${{ init.cache-warm != 'true' && tasks.rpc-check.values.ready == 'true' }} + call: ${{ run.dir }}/packages/contract-upgrades-verdict.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + compiled: .ci/contract-upgrades/chain-op/prepare + pinned-block: .ci/contract-upgrades/preflight/block.json + cache-key: contract-upgrades-rpc-chain-op-${{ init.cache-epoch }} + variant: chain-op + + - key: compile-chain-ink + use: [code, go-tools, contract-tools, go-modules] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-contracts == 'true' }} + call: ${{ run.dir }}/packages/contract-upgrades-compile.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + cache-key: contract-upgrades-chain-ink-${{ init.cache-epoch }} + variant: chain-ink + + - key: verdict-chain-ink + use: [code, go-tools, contract-tools, go-modules, compile-chain-ink, rpc-check] + if: ${{ init.cache-warm != 'true' && tasks.rpc-check.values.ready == 'true' }} + call: ${{ run.dir }}/packages/contract-upgrades-verdict.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + compiled: .ci/contract-upgrades/chain-ink/prepare + pinned-block: .ci/contract-upgrades/preflight/block.json + cache-key: contract-upgrades-rpc-chain-ink-${{ init.cache-epoch }} + variant: chain-ink + + - key: compile-chain-unichain + use: [code, go-tools, contract-tools, go-modules] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-contracts == 'true' }} + call: ${{ run.dir }}/packages/contract-upgrades-compile.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + cache-key: contract-upgrades-chain-unichain-${{ init.cache-epoch }} + variant: chain-unichain + + - key: verdict-chain-unichain + use: [code, go-tools, contract-tools, go-modules, compile-chain-unichain, rpc-check] + if: ${{ init.cache-warm != 'true' && tasks.rpc-check.values.ready == 'true' }} + call: ${{ run.dir }}/packages/contract-upgrades-verdict.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + compiled: .ci/contract-upgrades/chain-unichain/prepare + pinned-block: .ci/contract-upgrades/preflight/block.json + cache-key: contract-upgrades-rpc-chain-unichain-${{ init.cache-epoch }} + variant: chain-unichain + + - key: contracts-gate-receipt + use: [code, tools] + after: ${{ (verdict-chain-ink.succeeded || verdict-chain-ink.failed || verdict-chain-ink.skipped) && (verdict-chain-op.succeeded || verdict-chain-op.failed || verdict-chain-op.skipped) && (verdict-chain-unichain.succeeded || verdict-chain-unichain.failed || verdict-chain-unichain.skipped) && (verdict-feature-BRIDGE_HOOK.succeeded || verdict-feature-BRIDGE_HOOK.failed || verdict-feature-BRIDGE_HOOK.skipped) && (verdict-feature-CUSTOM_GAS_TOKEN.succeeded || verdict-feature-CUSTOM_GAS_TOKEN.failed || verdict-feature-CUSTOM_GAS_TOKEN.skipped) && (verdict-feature-INTEROP.succeeded || verdict-feature-INTEROP.failed || verdict-feature-INTEROP.skipped) && (verdict-feature-OP_PRIVATE.succeeded || verdict-feature-OP_PRIVATE.failed || verdict-feature-OP_PRIVATE.skipped) && (verdict-feature-main.succeeded || verdict-feature-main.failed || verdict-feature-main.skipped) }} + if: ${{ init.cache-warm != 'true' }} + run: python3 ops/ci/runtime/pr-gate.py receipt contracts-upgrades + env: + TASK_VERDICT_FEATURE_BRIDGE_HOOK_SUCCEEDED: ${{ tasks.verdict-feature-BRIDGE_HOOK.succeeded }} + TASK_VERDICT_FEATURE_BRIDGE_HOOK_FAILED: ${{ tasks.verdict-feature-BRIDGE_HOOK.failed }} + TASK_VERDICT_FEATURE_BRIDGE_HOOK_SKIPPED: ${{ tasks.verdict-feature-BRIDGE_HOOK.skipped }} + CI_COMMIT_SHA: ${{ init.commit-sha }} + CI_BRANCH: ${{ init.branch }} + GROUP_SELECTED: ${{ tasks.route.values.run-contracts }} + RWX_RUN_ID: + cache-key: included + RWX_TASK_ATTEMPT_NUMBER: + cache-key: included + TASK_VERDICT_CHAIN_INK_SUCCEEDED: ${{ tasks.verdict-chain-ink.succeeded }} + TASK_VERDICT_CHAIN_INK_FAILED: ${{ tasks.verdict-chain-ink.failed }} + TASK_VERDICT_CHAIN_INK_SKIPPED: ${{ tasks.verdict-chain-ink.skipped }} + TASK_VERDICT_CHAIN_OP_SUCCEEDED: ${{ tasks.verdict-chain-op.succeeded }} + TASK_VERDICT_CHAIN_OP_FAILED: ${{ tasks.verdict-chain-op.failed }} + TASK_VERDICT_CHAIN_OP_SKIPPED: ${{ tasks.verdict-chain-op.skipped }} + TASK_VERDICT_CHAIN_UNICHAIN_SUCCEEDED: ${{ tasks.verdict-chain-unichain.succeeded }} + TASK_VERDICT_CHAIN_UNICHAIN_FAILED: ${{ tasks.verdict-chain-unichain.failed }} + TASK_VERDICT_CHAIN_UNICHAIN_SKIPPED: ${{ tasks.verdict-chain-unichain.skipped }} + TASK_VERDICT_FEATURE_CUSTOM_GAS_TOKEN_SUCCEEDED: ${{ tasks.verdict-feature-CUSTOM_GAS_TOKEN.succeeded }} + TASK_VERDICT_FEATURE_CUSTOM_GAS_TOKEN_FAILED: ${{ tasks.verdict-feature-CUSTOM_GAS_TOKEN.failed }} + TASK_VERDICT_FEATURE_CUSTOM_GAS_TOKEN_SKIPPED: ${{ tasks.verdict-feature-CUSTOM_GAS_TOKEN.skipped }} + TASK_VERDICT_FEATURE_INTEROP_SUCCEEDED: ${{ tasks.verdict-feature-INTEROP.succeeded }} + TASK_VERDICT_FEATURE_INTEROP_FAILED: ${{ tasks.verdict-feature-INTEROP.failed }} + TASK_VERDICT_FEATURE_INTEROP_SKIPPED: ${{ tasks.verdict-feature-INTEROP.skipped }} + TASK_VERDICT_FEATURE_OP_PRIVATE_SUCCEEDED: ${{ tasks.verdict-feature-OP_PRIVATE.succeeded }} + TASK_VERDICT_FEATURE_OP_PRIVATE_FAILED: ${{ tasks.verdict-feature-OP_PRIVATE.failed }} + TASK_VERDICT_FEATURE_OP_PRIVATE_SKIPPED: ${{ tasks.verdict-feature-OP_PRIVATE.skipped }} + TASK_VERDICT_FEATURE_MAIN_SUCCEEDED: ${{ tasks.verdict-feature-main.succeeded }} + TASK_VERDICT_FEATURE_MAIN_FAILED: ${{ tasks.verdict-feature-main.failed }} + TASK_VERDICT_FEATURE_MAIN_SKIPPED: ${{ tasks.verdict-feature-main.skipped }} + cache: false + timeout: 10m + outputs: + filesystem: false + artifacts: + - key: receipt + path: .ci/pr-gates/groups/contracts-upgrades diff --git a/.rwx/contracts.yml b/.rwx/contracts.yml new file mode 100644 index 00000000000..f14b0cc8a54 --- /dev/null +++ b/.rwx/contracts.yml @@ -0,0 +1,474 @@ +# Complete standard contracts in an optional shadow; CircleCI keeps its gates. +on: + cache-rebuild: + if: ${{ event.git.branch == 'develop' }} + target: [compile-standard-main, compile-standard-CUSTOM_GAS_TOKEN, compile-standard-INTEROP, compile-modified-main, compile-modified-CUSTOM_GAS_TOKEN, compile-modified-INTEROP, compile-standard-BRIDGE_HOOK, compile-standard-OP_PRIVATE, compile-modified-BRIDGE_HOOK, compile-modified-OP_PRIVATE] + init: + commit-sha: ${{ event.git.sha }} + branch: ${{ event.git.branch }} + tag: "" + cache-warm: "true" + cache-epoch: v1 + build-probe: "" + cli: + init: + commit-sha: ${{ event.git.sha }} + branch: ${{ event.git.branch }} + tag: "" + cache-warm: "false" + cache-epoch: v1 + build-probe: "" + +# Cache-only vault; no RPC or publishing credentials. +tool-cache: + vault: optimism-op-reth-shadow + +base: + image: ubuntu:24.04@sha256:008173c23f95b170204355c12626cb5a965d779a7e1283b09e9cffbb1bf33ca3 + config: rwx/base 1.2.0 + arch: x86_64 + +defaults: + runner: + cpus: 2 + memory: 8gb + +tasks: + - key: code + call: git/clone 2.2.0 + with: + repository: https://github.com/ethereum-optimism/optimism.git + ref: ${{ init.commit-sha }} + preserve-git-dir: true + fetch-full-depth: true + submodules: false + + - key: bootstrap-inputs + use: code + run: 'true' + filter: [mise.toml, ops/ci/runtime] + outputs: + filesystem: + filter: + workspace: [mise.toml, ops/ci/runtime/apt-install.sh, ops/ci/runtime/rwx-prepare.sh, ops/ci/runtime/rwx-contracts-prepare.sh, ops/ci/runtime/rwx-rust-prepare.sh, ops/ci/runtime/op-reth-shadow.sh, ops/ci/runtime/op-reth-report.py, ops/ci/runtime/rust-target-cache.py] + system: [] + artifacts: + - key: mise-config + path: mise.toml + - key: ci-scripts + path: ops/ci/runtime + - key: apt-script + path: ops/ci/runtime/apt-install.sh + + - key: mise + call: mise/install 1.1.0 + with: + mise-version: "2026.2.2" + install: "false" + + # Artifact dependencies avoid inheriting the checkout's Git history into + # reusable tools. Language toolchains are added only by their own workload. + - key: tools + use: [mise, bootstrap-inputs] + call: ${{ run.dir }}/packages/toolchain-common.yml + + - key: route + use: [code, tools] + run: | + bash ops/ci/runtime/rwx-metadata.sh + jq -er '."c-run_contracts_feature_tests" | if type == "boolean" then tostring else error("missing contract routing flag") end' \ + .ci/pipeline-parameters.json >"$RWX_VALUES/run-contracts" + env: + CI_EVENT: push + CI_CACHE_WARM: ${{ init.cache-warm }} + CI_BRANCH: ${{ init.branch }} + CI_TAG: ${{ init.tag }} + CI_COMMIT_SHA: ${{ init.commit-sha }} + cache: false + timeout: 10m + outputs: + filesystem: false + artifacts: + - key: routing + path: .ci/pipeline-parameters.json + + - key: go-tools + use: tools + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-contracts == 'true' }} + call: ${{ run.dir }}/packages/toolchain-go.yml + with: + mode: go + + - key: contract-tools + use: [bootstrap-inputs, tools] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-contracts == 'true' }} + call: ${{ run.dir }}/packages/toolchain-foundry.yml + with: + mode: compiler + + - key: go-modules + use: [code, go-tools] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-contracts == 'true' }} + run: | + export GOMODCACHE="$PWD/.ci/go-cache/contract-suites/modules" + python3 ops/ci/runtime/pr-checks.py go-modules + env: + CI_COMMIT_SHA: ${{ init.commit-sha }} + CI_BRANCH: ${{ init.branch }} + CI_CHECK_PROVIDER: rwx + tool-cache: contract-suites-modules-${{ init.cache-epoch }} + timeout: 30m + runner: + cpus: 2 + memory: 4gb + outputs: + filesystem: + filter: + workspace: [.ci/go-cache/contract-suites/modules] + system: [] + artifacts: + - key: reports + path: .ci/pr-checks/go-modules + + # Freeze the moving discovery baseline once per run. Its Git object travels + # with the source snapshot; producers and verdicts use the same explicit SHA. + - key: modified-baseline + use: source + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-contracts == 'true' }} + run: | + git fetch --no-tags origin +refs/heads/develop:refs/remotes/origin/develop + mkdir -p .ci + git rev-parse --verify 'origin/develop^{commit}' > .ci/contract-baseline.txt + cp .ci/contract-baseline.txt "$RWX_VALUES/target-sha" + cache: false + timeout: 10m + outputs: + artifacts: + - key: baseline + path: .ci/contract-baseline.txt + + # One initialized checkout supplies compiler and runtime submodule sources. + # Consumers validate the retained revisions instead of cloning them again. + - key: source + use: [code, tools] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-contracts == 'true' }} + run: | + git submodule sync --recursive + git -c protocol.file.allow=never submodule update --init --recursive --jobs 8 + timeout: 20m + + - key: helper-tests + use: [code, go-tools, contract-tools, go-modules] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-contracts == 'true' }} + run: | + export GOMODCACHE="$PWD/.ci/go-cache/contract-suites/modules" + RWX_LIVE_CONTRACT_SUITE_FIXTURE=1 python3 -m unittest discover -s ops/ci/tests -p 'test_contract_suites.py' + RWX_LIVE_CONTRACT_SUITE_FIXTURE=1 python3 -m unittest discover -s ops/ci/migration/tests -p 'test_migration_contract_suites.py' + python3 -m unittest discover -s ops/ci/migration/tests -p 'test_compare_contract_suites.py' + python3 ops/ci/tests/test_contracts_shadow.py + python3 ops/ci/migration/tests/test_check_changed.py + cache: false + timeout: 15m + outputs: + filesystem: false + + - key: compile-standard-main + use: [source, go-tools, contract-tools, go-modules] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-contracts == 'true' }} + call: ${{ run.dir }}/packages/contracts-compile.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + build-probe: ${{ init.build-probe }} + cache-key: contract-suites-standard-main-${{ init.cache-epoch }} + suite: standard + feature: main + + - key: verdict-standard-main + use: [source, go-tools, contract-tools, go-modules, compile-standard-main] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-contracts == 'true' && tasks.compile-standard-main.tasks.build.values.eligible == 'true' }} + call: ${{ run.dir }}/packages/contracts-verdict.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + compiled: .ci/contract-suites/standard-main/prepare + cache-key: contract-suites-runtime-standard-main-${{ init.cache-epoch }} + suite: standard + feature: main + + - key: compile-standard-CUSTOM_GAS_TOKEN + use: [source, go-tools, contract-tools, go-modules] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-contracts == 'true' }} + call: ${{ run.dir }}/packages/contracts-compile.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + build-probe: ${{ init.build-probe }} + cache-key: contract-suites-standard-CUSTOM_GAS_TOKEN-${{ init.cache-epoch }} + suite: standard + feature: CUSTOM_GAS_TOKEN + + - key: verdict-standard-CUSTOM_GAS_TOKEN + use: [source, go-tools, contract-tools, go-modules, compile-standard-CUSTOM_GAS_TOKEN] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-contracts == 'true' && tasks.compile-standard-CUSTOM_GAS_TOKEN.tasks.build.values.eligible == 'true' }} + call: ${{ run.dir }}/packages/contracts-verdict.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + compiled: .ci/contract-suites/standard-CUSTOM_GAS_TOKEN/prepare + cache-key: contract-suites-runtime-standard-CUSTOM_GAS_TOKEN-${{ init.cache-epoch }} + suite: standard + feature: CUSTOM_GAS_TOKEN + + - key: compile-standard-INTEROP + use: [source, go-tools, contract-tools, go-modules] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-contracts == 'true' }} + call: ${{ run.dir }}/packages/contracts-compile.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + build-probe: ${{ init.build-probe }} + cache-key: contract-suites-standard-INTEROP-${{ init.cache-epoch }} + suite: standard + feature: INTEROP + + - key: verdict-standard-INTEROP + use: [source, go-tools, contract-tools, go-modules, compile-standard-INTEROP] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-contracts == 'true' && tasks.compile-standard-INTEROP.tasks.build.values.eligible == 'true' }} + call: ${{ run.dir }}/packages/contracts-verdict.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + compiled: .ci/contract-suites/standard-INTEROP/prepare + cache-key: contract-suites-runtime-standard-INTEROP-${{ init.cache-epoch }} + suite: standard + feature: INTEROP + + - key: compile-standard-BRIDGE_HOOK + use: [source, go-tools, contract-tools, go-modules] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-contracts == 'true' }} + call: ${{ run.dir }}/packages/contracts-compile.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + build-probe: ${{ init.build-probe }} + cache-key: contract-suites-standard-BRIDGE_HOOK-${{ init.cache-epoch }} + suite: standard + feature: BRIDGE_HOOK + + - key: compile-standard-OP_PRIVATE + use: [source, go-tools, contract-tools, go-modules] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-contracts == 'true' }} + call: ${{ run.dir }}/packages/contracts-compile.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + build-probe: ${{ init.build-probe }} + cache-key: contract-suites-standard-OP_PRIVATE-${{ init.cache-epoch }} + suite: standard + feature: OP_PRIVATE + + - key: verdict-standard-BRIDGE_HOOK + use: [source, go-tools, contract-tools, go-modules, compile-standard-BRIDGE_HOOK] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-contracts == 'true' && tasks.compile-standard-BRIDGE_HOOK.tasks.build.values.eligible == 'true' }} + call: ${{ run.dir }}/packages/contracts-verdict.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + compiled: .ci/contract-suites/standard-BRIDGE_HOOK/prepare + cache-key: contract-suites-runtime-standard-BRIDGE_HOOK-${{ init.cache-epoch }} + suite: standard + feature: BRIDGE_HOOK + + - key: verdict-standard-OP_PRIVATE + use: [source, go-tools, contract-tools, go-modules, compile-standard-OP_PRIVATE] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-contracts == 'true' && tasks.compile-standard-OP_PRIVATE.tasks.build.values.eligible == 'true' }} + call: ${{ run.dir }}/packages/contracts-verdict.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + compiled: .ci/contract-suites/standard-OP_PRIVATE/prepare + cache-key: contract-suites-runtime-standard-OP_PRIVATE-${{ init.cache-epoch }} + suite: standard + feature: OP_PRIVATE + + - key: compile-modified-main + use: [modified-baseline, go-tools, contract-tools, go-modules] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-contracts == 'true' }} + call: ${{ run.dir }}/packages/contracts-compile.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + build-probe: ${{ init.build-probe }} + cache-key: contract-suites-modified-main-${{ init.cache-epoch }} + target-sha: ${{ tasks.modified-baseline.values.target-sha }} + suite: modified + feature: main + + - key: verdict-modified-main + use: [modified-baseline, go-tools, contract-tools, go-modules, compile-modified-main] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-contracts == 'true' && tasks.compile-modified-main.tasks.build.values.eligible == 'true' }} + call: ${{ run.dir }}/packages/contracts-verdict.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + compiled: .ci/contract-suites/modified-main/prepare + cache-key: contract-suites-runtime-modified-main-${{ init.cache-epoch }} + target-sha: ${{ tasks.modified-baseline.values.target-sha }} + suite: modified + feature: main + + - key: compile-modified-CUSTOM_GAS_TOKEN + use: [modified-baseline, go-tools, contract-tools, go-modules] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-contracts == 'true' }} + call: ${{ run.dir }}/packages/contracts-compile.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + build-probe: ${{ init.build-probe }} + cache-key: contract-suites-modified-CUSTOM_GAS_TOKEN-${{ init.cache-epoch }} + target-sha: ${{ tasks.modified-baseline.values.target-sha }} + suite: modified + feature: CUSTOM_GAS_TOKEN + + - key: verdict-modified-CUSTOM_GAS_TOKEN + use: [modified-baseline, go-tools, contract-tools, go-modules, compile-modified-CUSTOM_GAS_TOKEN] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-contracts == 'true' && tasks.compile-modified-CUSTOM_GAS_TOKEN.tasks.build.values.eligible == 'true' }} + call: ${{ run.dir }}/packages/contracts-verdict.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + compiled: .ci/contract-suites/modified-CUSTOM_GAS_TOKEN/prepare + cache-key: contract-suites-runtime-modified-CUSTOM_GAS_TOKEN-${{ init.cache-epoch }} + target-sha: ${{ tasks.modified-baseline.values.target-sha }} + suite: modified + feature: CUSTOM_GAS_TOKEN + + - key: compile-modified-INTEROP + use: [modified-baseline, go-tools, contract-tools, go-modules] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-contracts == 'true' }} + call: ${{ run.dir }}/packages/contracts-compile.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + build-probe: ${{ init.build-probe }} + cache-key: contract-suites-modified-INTEROP-${{ init.cache-epoch }} + target-sha: ${{ tasks.modified-baseline.values.target-sha }} + suite: modified + feature: INTEROP + + - key: verdict-modified-INTEROP + use: [modified-baseline, go-tools, contract-tools, go-modules, compile-modified-INTEROP] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-contracts == 'true' && tasks.compile-modified-INTEROP.tasks.build.values.eligible == 'true' }} + call: ${{ run.dir }}/packages/contracts-verdict.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + compiled: .ci/contract-suites/modified-INTEROP/prepare + cache-key: contract-suites-runtime-modified-INTEROP-${{ init.cache-epoch }} + target-sha: ${{ tasks.modified-baseline.values.target-sha }} + suite: modified + feature: INTEROP + + - key: compile-modified-BRIDGE_HOOK + use: [modified-baseline, go-tools, contract-tools, go-modules] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-contracts == 'true' }} + call: ${{ run.dir }}/packages/contracts-compile.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + build-probe: ${{ init.build-probe }} + cache-key: contract-suites-modified-BRIDGE_HOOK-${{ init.cache-epoch }} + target-sha: ${{ tasks.modified-baseline.values.target-sha }} + suite: modified + feature: BRIDGE_HOOK + + - key: compile-modified-OP_PRIVATE + use: [modified-baseline, go-tools, contract-tools, go-modules] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-contracts == 'true' }} + call: ${{ run.dir }}/packages/contracts-compile.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + build-probe: ${{ init.build-probe }} + cache-key: contract-suites-modified-OP_PRIVATE-${{ init.cache-epoch }} + target-sha: ${{ tasks.modified-baseline.values.target-sha }} + suite: modified + feature: OP_PRIVATE + + - key: verdict-modified-BRIDGE_HOOK + use: [modified-baseline, go-tools, contract-tools, go-modules, compile-modified-BRIDGE_HOOK] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-contracts == 'true' && tasks.compile-modified-BRIDGE_HOOK.tasks.build.values.eligible == 'true' }} + call: ${{ run.dir }}/packages/contracts-verdict.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + compiled: .ci/contract-suites/modified-BRIDGE_HOOK/prepare + cache-key: contract-suites-runtime-modified-BRIDGE_HOOK-${{ init.cache-epoch }} + target-sha: ${{ tasks.modified-baseline.values.target-sha }} + suite: modified + feature: BRIDGE_HOOK + + - key: verdict-modified-OP_PRIVATE + use: [modified-baseline, go-tools, contract-tools, go-modules, compile-modified-OP_PRIVATE] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-contracts == 'true' && tasks.compile-modified-OP_PRIVATE.tasks.build.values.eligible == 'true' }} + call: ${{ run.dir }}/packages/contracts-verdict.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + compiled: .ci/contract-suites/modified-OP_PRIVATE/prepare + cache-key: contract-suites-runtime-modified-OP_PRIVATE-${{ init.cache-epoch }} + target-sha: ${{ tasks.modified-baseline.values.target-sha }} + suite: modified + feature: OP_PRIVATE + + - key: contracts-gate-receipt + use: [code, tools] + after: ${{ (verdict-modified-BRIDGE_HOOK.succeeded || verdict-modified-BRIDGE_HOOK.failed || verdict-modified-BRIDGE_HOOK.skipped) && (verdict-modified-CUSTOM_GAS_TOKEN.succeeded || verdict-modified-CUSTOM_GAS_TOKEN.failed || verdict-modified-CUSTOM_GAS_TOKEN.skipped) && (verdict-modified-INTEROP.succeeded || verdict-modified-INTEROP.failed || verdict-modified-INTEROP.skipped) && (verdict-modified-OP_PRIVATE.succeeded || verdict-modified-OP_PRIVATE.failed || verdict-modified-OP_PRIVATE.skipped) && (verdict-modified-main.succeeded || verdict-modified-main.failed || verdict-modified-main.skipped) && (verdict-standard-BRIDGE_HOOK.succeeded || verdict-standard-BRIDGE_HOOK.failed || verdict-standard-BRIDGE_HOOK.skipped) && (verdict-standard-CUSTOM_GAS_TOKEN.succeeded || verdict-standard-CUSTOM_GAS_TOKEN.failed || verdict-standard-CUSTOM_GAS_TOKEN.skipped) && (verdict-standard-INTEROP.succeeded || verdict-standard-INTEROP.failed || verdict-standard-INTEROP.skipped) && (verdict-standard-OP_PRIVATE.succeeded || verdict-standard-OP_PRIVATE.failed || verdict-standard-OP_PRIVATE.skipped) && (verdict-standard-main.succeeded || verdict-standard-main.failed || verdict-standard-main.skipped) }} + if: ${{ init.cache-warm != 'true' }} + run: python3 ops/ci/runtime/pr-gate.py receipt contracts-suites + env: + TASK_VERDICT_STANDARD_BRIDGE_HOOK_SUCCEEDED: ${{ tasks.verdict-standard-BRIDGE_HOOK.succeeded }} + TASK_VERDICT_STANDARD_BRIDGE_HOOK_FAILED: ${{ tasks.verdict-standard-BRIDGE_HOOK.failed }} + TASK_VERDICT_STANDARD_BRIDGE_HOOK_SKIPPED: ${{ tasks.verdict-standard-BRIDGE_HOOK.skipped }} + TASK_VERDICT_MODIFIED_BRIDGE_HOOK_SUCCEEDED: ${{ tasks.verdict-modified-BRIDGE_HOOK.succeeded }} + TASK_VERDICT_MODIFIED_BRIDGE_HOOK_FAILED: ${{ tasks.verdict-modified-BRIDGE_HOOK.failed }} + TASK_VERDICT_MODIFIED_BRIDGE_HOOK_SKIPPED: ${{ tasks.verdict-modified-BRIDGE_HOOK.skipped }} + CI_COMMIT_SHA: ${{ init.commit-sha }} + CI_BRANCH: ${{ init.branch }} + GROUP_SELECTED: ${{ tasks.route.values.run-contracts }} + RWX_RUN_ID: + cache-key: included + RWX_TASK_ATTEMPT_NUMBER: + cache-key: included + TASK_VERDICT_MODIFIED_CUSTOM_GAS_TOKEN_SUCCEEDED: ${{ tasks.verdict-modified-CUSTOM_GAS_TOKEN.succeeded }} + TASK_VERDICT_MODIFIED_CUSTOM_GAS_TOKEN_FAILED: ${{ tasks.verdict-modified-CUSTOM_GAS_TOKEN.failed }} + TASK_VERDICT_MODIFIED_CUSTOM_GAS_TOKEN_SKIPPED: ${{ tasks.verdict-modified-CUSTOM_GAS_TOKEN.skipped }} + TASK_VERDICT_MODIFIED_INTEROP_SUCCEEDED: ${{ tasks.verdict-modified-INTEROP.succeeded }} + TASK_VERDICT_MODIFIED_INTEROP_FAILED: ${{ tasks.verdict-modified-INTEROP.failed }} + TASK_VERDICT_MODIFIED_INTEROP_SKIPPED: ${{ tasks.verdict-modified-INTEROP.skipped }} + TASK_VERDICT_MODIFIED_OP_PRIVATE_SUCCEEDED: ${{ tasks.verdict-modified-OP_PRIVATE.succeeded }} + TASK_VERDICT_MODIFIED_OP_PRIVATE_FAILED: ${{ tasks.verdict-modified-OP_PRIVATE.failed }} + TASK_VERDICT_MODIFIED_OP_PRIVATE_SKIPPED: ${{ tasks.verdict-modified-OP_PRIVATE.skipped }} + TASK_VERDICT_MODIFIED_MAIN_SUCCEEDED: ${{ tasks.verdict-modified-main.succeeded }} + TASK_VERDICT_MODIFIED_MAIN_FAILED: ${{ tasks.verdict-modified-main.failed }} + TASK_VERDICT_MODIFIED_MAIN_SKIPPED: ${{ tasks.verdict-modified-main.skipped }} + TASK_VERDICT_STANDARD_CUSTOM_GAS_TOKEN_SUCCEEDED: ${{ tasks.verdict-standard-CUSTOM_GAS_TOKEN.succeeded }} + TASK_VERDICT_STANDARD_CUSTOM_GAS_TOKEN_FAILED: ${{ tasks.verdict-standard-CUSTOM_GAS_TOKEN.failed }} + TASK_VERDICT_STANDARD_CUSTOM_GAS_TOKEN_SKIPPED: ${{ tasks.verdict-standard-CUSTOM_GAS_TOKEN.skipped }} + TASK_VERDICT_STANDARD_INTEROP_SUCCEEDED: ${{ tasks.verdict-standard-INTEROP.succeeded }} + TASK_VERDICT_STANDARD_INTEROP_FAILED: ${{ tasks.verdict-standard-INTEROP.failed }} + TASK_VERDICT_STANDARD_INTEROP_SKIPPED: ${{ tasks.verdict-standard-INTEROP.skipped }} + TASK_VERDICT_STANDARD_OP_PRIVATE_SUCCEEDED: ${{ tasks.verdict-standard-OP_PRIVATE.succeeded }} + TASK_VERDICT_STANDARD_OP_PRIVATE_FAILED: ${{ tasks.verdict-standard-OP_PRIVATE.failed }} + TASK_VERDICT_STANDARD_OP_PRIVATE_SKIPPED: ${{ tasks.verdict-standard-OP_PRIVATE.skipped }} + TASK_VERDICT_STANDARD_MAIN_SUCCEEDED: ${{ tasks.verdict-standard-main.succeeded }} + TASK_VERDICT_STANDARD_MAIN_FAILED: ${{ tasks.verdict-standard-main.failed }} + TASK_VERDICT_STANDARD_MAIN_SKIPPED: ${{ tasks.verdict-standard-main.skipped }} + cache: false + timeout: 10m + outputs: + filesystem: false + artifacts: + - key: receipt + path: .ci/pr-gates/groups/contracts-suites diff --git a/.rwx/flaky-report.yml b/.rwx/flaky-report.yml new file mode 100644 index 00000000000..de59c7d2fcd --- /dev/null +++ b/.rwx/flaky-report.yml @@ -0,0 +1,91 @@ +# Execute the original reporting workload against the real public Insights API. +on: + cache-rebuild: + if: ${{ event.git.branch == 'develop' }} + target: tools + init: + commit-sha: ${{ event.git.sha }} + branch: ${{ event.git.branch }} + tag: "" + cache-warm: "true" + github: + push: + if: ${{ event.git.branch == 'codex/rwx-ci-pilot' || event.git.branch == 'develop' }} + init: + commit-sha: ${{ event.git.sha }} + branch: ${{ event.git.branch }} + tag: ${{ event.git.tag }} + cache-warm: "false" + status-checks: + name: optimism-flaky-report-shadow + cli: + init: + commit-sha: ${{ event.git.sha }} + branch: ${{ event.git.branch }} + tag: "" + cache-warm: "false" + +tool-cache: + vault: optimism-op-reth-shadow + +base: + image: ubuntu:24.04@sha256:008173c23f95b170204355c12626cb5a965d779a7e1283b09e9cffbb1bf33ca3 + config: rwx/base 1.2.0 + arch: x86_64 + +defaults: + runner: {cpus: 2, memory: 8gb} + +tasks: + - key: code + call: git/clone 2.2.0 + with: + repository: https://github.com/ethereum-optimism/optimism.git + ref: ${{ init.commit-sha }} + preserve-git-dir: true + fetch-full-depth: true + submodules: false + - key: mise + call: mise/install 1.1.0 + with: {mise-version: "2026.2.2", install: "false"} + - key: tools + use: [code, mise] + run: bash ops/ci/runtime/rwx-prepare.sh + timeout: 30m + - key: route + use: [code, tools] + run: bash ops/ci/runtime/rwx-metadata.sh + env: + CI_EVENT: push + CI_CACHE_WARM: ${{ init.cache-warm }} + CI_BRANCH: ${{ init.branch }} + CI_TAG: ${{ init.tag }} + CI_COMMIT_SHA: ${{ init.commit-sha }} + cache: false + outputs: + filesystem: false + artifacts: + - key: routing + path: .ci/pipeline-parameters.json + - key: helper-tests + use: [code, tools] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-main == 'true' }} + run: python3 -m unittest discover -s ops/ci/migration/tests -p 'test*flaky_report.py' + cache: false + timeout: 10m + outputs: {filesystem: false} + - key: report + use: [code, tools] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-main == 'true' }} + run: python3 ops/ci/migration/flaky-report.py run .ci/flaky-report/run + env: + CI_COMMIT_SHA: ${{ init.commit-sha }} + CI_BRANCH: ${{ init.branch }} + CI_CHECK_PROVIDER: rwx + cache: false + timeout: 20m + outputs: + filesystem: false + artifacts: + - key: originals + path: .ci/flaky-report/run diff --git a/.rwx/go-rollup.yml b/.rwx/go-rollup.yml new file mode 100644 index 00000000000..5a573c91417 --- /dev/null +++ b/.rwx/go-rollup.yml @@ -0,0 +1,166 @@ +# CLI-only rollup regression mode; the full go-tests shadow owns native routing. +on: + cli: + init: + commit-sha: ${{ event.git.sha }} + branch: ${{ event.git.branch }} + tag: "" + cache-warm: "false" + cache-epoch: v1 + build-probe: "" + +# Shared cache baseline: only develop may write; PRs restore it read-only. +tool-cache: + vault: optimism-op-reth-shadow + +base: + image: ubuntu:24.04@sha256:008173c23f95b170204355c12626cb5a965d779a7e1283b09e9cffbb1bf33ca3 + config: rwx/base 1.2.0 + arch: x86_64 + +defaults: + runner: + cpus: 2 + memory: 8gb + +tasks: + - key: code + call: git/clone 2.2.0 + with: + repository: https://github.com/ethereum-optimism/optimism.git + ref: ${{ init.commit-sha }} + preserve-git-dir: true + fetch-full-depth: true + submodules: false + + - key: bootstrap-inputs + use: code + run: 'true' + filter: [mise.toml, ops/ci/runtime] + outputs: + filesystem: + filter: + workspace: [mise.toml, ops/ci/runtime/apt-install.sh, ops/ci/runtime/rwx-prepare.sh, ops/ci/runtime/rwx-contracts-prepare.sh, ops/ci/runtime/rwx-rust-prepare.sh, ops/ci/runtime/op-reth-shadow.sh, ops/ci/runtime/op-reth-report.py, ops/ci/runtime/rust-target-cache.py] + system: [] + artifacts: + - key: mise-config + path: mise.toml + - key: ci-scripts + path: ops/ci/runtime + - key: apt-script + path: ops/ci/runtime/apt-install.sh + + - key: mise + call: mise/install 1.1.0 + with: + mise-version: "2026.2.2" + install: "false" + + # Artifact dependencies avoid inheriting the checkout's Git history into + # reusable tools. Language toolchains are added only by their own workload. + - key: tools + use: [mise, bootstrap-inputs] + call: ${{ run.dir }}/packages/toolchain-common.yml + + - key: go-build-tools + use: tools + call: ${{ run.dir }}/packages/toolchain-go.yml + with: + mode: go + + - key: go-runtime + use: tools + run: bash ops/ci/runtime/rwx-prepare.sh go-runtime + timeout: 15m + + - key: route + use: [code, tools] + run: bash ops/ci/runtime/rwx-metadata.sh + env: + CI_EVENT: push + CI_CACHE_WARM: ${{ init.cache-warm }} + CI_BRANCH: ${{ init.branch }} + CI_TAG: ${{ init.tag }} + CI_COMMIT_SHA: ${{ init.commit-sha }} + cache: false + timeout: 10m + outputs: + filesystem: false + artifacts: + - key: routing + path: .ci/pipeline-parameters.json + + - key: shard-tests + use: [code, go-build-tools] + run: | + mise exec -- python ops/ci/tests/test_go_package_shards.py + mise exec -- python ops/ci/tests/test_go_compiled_tests.py + cache: false + timeout: 10m + outputs: + filesystem: false + + # Full source and Git metadata are compiler inputs. Native tool caches restore + # downloaded modules and compiled Go objects only on a content-cache miss. + - key: go-build + use: [code, go-build-tools] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + run: mise exec -- bash ops/ci/runtime/go-rollup-tests.sh build + env: + CI_COMMIT_SHA: ${{ init.commit-sha }} + CI_SHARD_TOTAL: "4" + BUILD_PROBE: ${{ init.build-probe }} + tool-cache: go-rollup-build-${{ init.cache-epoch }} + runner: + cpus: 16 + memory: 32gb + timeout: 40m + outputs: + filesystem: + filter: + workspace: [.ci/go-cache/rollup, .ci/go-rollup/build] + system: [] + artifacts: + - key: compilation + path: .ci/go-rollup/build + + - key: go-rollup + use: go-runtime + if: ${{ tasks.route.values.run-main == 'true' }} + parallel: 4 + run: | + mkdir -p .ci/go-rollup/build + cp -a "$GO_BUILD_ARTIFACT/." .ci/go-rollup/build/ + tar -xzf .ci/go-rollup/build/source.tar.gz + cp .ci/go-rollup/build/manifest.json .ci/go-rollup/manifest.json + export GOMODCACHE="$PWD/.ci/go-runtime/modules" + export GOCACHE="$PWD/.ci/go-runtime/build" + mkdir -p "$GOMODCACHE" "$GOCACHE" + tar -xzf .ci/go-rollup/build/runtime-modules.tar.gz -C "$GOMODCACHE" + mise exec -- bash ops/ci/runtime/go-rollup-tests.sh + env: + CI_COMMIT_SHA: ${{ init.commit-sha }} + GO_BUILD_ARTIFACT: ${{ tasks.go-build.artifacts.compilation }} + RWX_COMPILED_GO: "true" + CI_SHARD_INDEX: ${{ parallel.index }} + CI_SHARD_TOTAL: ${{ parallel.total }} + TEST_TIMEOUT: 40m + cache: false + timeout: 50m + runner: + cpus: 8 + memory: 16gb + outputs: + filesystem: false + test-results: + - path: tmp/testlogs/log.json + options: + language: Go + framework: go test + artifacts: + - key: junit + path: tmp/test-results + - key: go-json + path: tmp/testlogs/log.json + - key: test-logs + path: tmp/testlogs diff --git a/.rwx/go-tests.yml b/.rwx/go-tests.yml new file mode 100644 index 00000000000..d843c78b9a2 --- /dev/null +++ b/.rwx/go-tests.yml @@ -0,0 +1,1121 @@ +# Full aggregate Go workload. CircleCI retains all required gates. +on: + cache-rebuild: + if: ${{ event.git.branch == 'develop' }} + target: [go, contracts, kona, op-reth, prestate, compile-0, compile-1, compile-2, compile-3, compile-4, compile-5, compile-6, compile-7, compile-8, compile-9, compile-10, compile-11] + init: + commit-sha: ${{ event.git.sha }} + branch: ${{ event.git.branch }} + tag: "" + cache-warm: "true" + cache-epoch: v1 + build-probe: "" + target-cache-mode: keep + shard-total: "12" + test-parallel: "8" + cli: + init: + commit-sha: ${{ event.git.sha }} + branch: ${{ event.git.branch }} + tag: "" + cache-warm: "false" + cache-epoch: v1 + build-probe: "" + target-cache-mode: keep + shard-total: "12" + test-parallel: "8" + +# Shared cache baseline: only develop may write; PRs restore it read-only. +tool-cache: + vault: optimism-op-reth-shadow + +base: + image: ubuntu:24.04@sha256:008173c23f95b170204355c12626cb5a965d779a7e1283b09e9cffbb1bf33ca3 + config: rwx/base 1.2.0 + arch: x86_64 + +defaults: + runner: + cpus: 2 + memory: 8gb + +tasks: + - key: code + call: git/clone 2.2.0 + with: + repository: https://github.com/ethereum-optimism/optimism.git + ref: ${{ init.commit-sha }} + preserve-git-dir: true + fetch-full-depth: true + submodules: false + + - key: bootstrap-inputs + use: code + run: 'true' + filter: [mise.toml, ops/ci/runtime] + outputs: + filesystem: + filter: + workspace: [mise.toml, ops/ci/runtime/apt-install.sh, ops/ci/runtime/rwx-prepare.sh, ops/ci/runtime/rwx-contracts-prepare.sh, ops/ci/runtime/rwx-rust-prepare.sh, ops/ci/runtime/op-reth-shadow.sh, ops/ci/runtime/op-reth-report.py, ops/ci/runtime/rust-target-cache.py] + system: [] + artifacts: + - key: mise-config + path: mise.toml + - key: ci-scripts + path: ops/ci/runtime + - key: apt-script + path: ops/ci/runtime/apt-install.sh + + - key: mise + call: mise/install 1.1.0 + with: + mise-version: "2026.2.2" + install: "false" + + # Artifact dependencies avoid inheriting the checkout's Git history into + # reusable tools. Language toolchains are added only by their own workload. + - key: tools + use: [mise, bootstrap-inputs] + call: ${{ run.dir }}/packages/toolchain-common.yml + + - key: go-build-tools + use: tools + call: ${{ run.dir }}/packages/toolchain-go.yml + with: + mode: go + + - key: route + use: [tools, code] + run: bash ops/ci/runtime/rwx-metadata.sh + env: + CI_EVENT: push + CI_CACHE_WARM: ${{ init.cache-warm }} + CI_BRANCH: ${{ init.branch }} + CI_TAG: ${{ init.tag }} + CI_COMMIT_SHA: ${{ init.commit-sha }} + cache: false + timeout: 10m + outputs: + filesystem: false + artifacts: + - key: routing + path: .ci/pipeline-parameters.json + + - key: contract-tools + use: [bootstrap-inputs, tools] + call: ${{ run.dir }}/packages/toolchain-foundry.yml + with: + mode: anvil + + - key: rust-tools + use: [bootstrap-inputs, tools] + call: ${{ run.dir }}/packages/toolchain-rust.yml + with: + mode: release + + - key: helper-tests + use: [go-build-tools, code] + if: ${{ init.cache-warm != 'true' }} + run: mise exec -- python3 -m unittest discover -s ops/ci/tests -p 'test_go*.py' + cache: false + timeout: 10m + outputs: + filesystem: false + + # This is a runtime preflight: only it and fresh verdicts receive RPC inputs. + - key: rpc-preflight + use: tools + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-main == 'true' }} + run: python3 "$CI_SCRIPTS/go-rpc-preflight.py" + filter: + ${{ tasks.bootstrap-inputs.artifacts.ci-scripts }}: [go-rpc-preflight.py] + env: + CI_SCRIPTS: ${{ tasks.bootstrap-inputs.artifacts.ci-scripts }} + OP_CI_MAINNET_L1_ARCHIVE_RPC_URL: ${{ vaults.optimism-go-tests-rpc-shadow.secrets.OP_CI_MAINNET_L1_ARCHIVE_RPC_URL }} + OP_CI_SEPOLIA_L1_ARCHIVE_RPC_URL: ${{ vaults.optimism-go-tests-rpc-shadow.secrets.OP_CI_SEPOLIA_L1_ARCHIVE_RPC_URL }} + cache: false + outputs: + filesystem: false + + - key: source + use: [tools, code] + after: ${{ rpc-preflight.succeeded || rpc-preflight.skipped }} + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + run: | + git reset --hard "$CI_COMMIT_SHA" + git submodule sync --recursive + git submodule update --init --recursive --jobs 8 + git rev-parse HEAD >packages/contracts-bedrock/.gitcommit + env: + CI_COMMIT_SHA: ${{ init.commit-sha }} + timeout: 20m + + # Producers build an immutable ancestor with identical tracked build inputs. + # Consumers verify that identity against HEAD before restoring any binaries. + - key: dependency-plan + use: code + run: python3 ops/ci/runtime/go-dependency-source.py plan + outputs: + filesystem: false + + - key: go-code + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + call: git/clone 2.2.0 + with: + repository: https://github.com/ethereum-optimism/optimism.git + ref: ${{ tasks.dependency-plan.values.go }} + preserve-git-dir: true + fetch-full-depth: true + submodules: false + + - key: go-common-tools + use: [mise, go-code] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + call: ${{ run.dir }}/packages/toolchain-common.yml + + - key: go-go-tools + use: [go-code, go-common-tools] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + call: ${{ run.dir }}/packages/toolchain-go.yml + with: + mode: go + + - key: go-source + use: [go-go-tools, go-code] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + run: | + git reset --hard "$DEPENDENCY_BASE_SHA" + git submodule sync --recursive + git submodule update --init --recursive --jobs 8 + git rev-parse HEAD >packages/contracts-bedrock/.gitcommit + env: + DEPENDENCY_BASE_SHA: ${{ tasks.dependency-plan.values.go }} + timeout: 20m + + - key: go + use: go-source + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + call: ${{ run.dir }}/packages/go-go.yml + with: + commit-sha: ${{ tasks.dependency-plan.values.go }} + cache-epoch: ${{ init.cache-epoch }} + build-probe: ${{ init.build-probe }} + target-cache-mode: ${{ init.target-cache-mode }} + + - key: contracts-code + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + call: git/clone 2.2.0 + with: + repository: https://github.com/ethereum-optimism/optimism.git + ref: ${{ tasks.dependency-plan.values.contracts }} + preserve-git-dir: true + fetch-full-depth: true + submodules: false + + - key: contracts-common-tools + use: [mise, contracts-code] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + call: ${{ run.dir }}/packages/toolchain-common.yml + + - key: contracts-go-tools + use: [contracts-code, contracts-common-tools] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + call: ${{ run.dir }}/packages/toolchain-go.yml + with: + mode: go + + - key: contracts-foundry-tools + use: [contracts-code, contracts-common-tools] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + call: ${{ run.dir }}/packages/toolchain-foundry.yml + with: + mode: anvil + + - key: contracts-source + use: [contracts-go-tools, contracts-foundry-tools, contracts-code] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + run: | + git reset --hard "$DEPENDENCY_BASE_SHA" + git submodule sync --recursive + git submodule update --init --recursive --jobs 8 + git rev-parse HEAD >packages/contracts-bedrock/.gitcommit + env: + DEPENDENCY_BASE_SHA: ${{ tasks.dependency-plan.values.contracts }} + timeout: 20m + + - key: contracts + use: contracts-source + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + call: ${{ run.dir }}/packages/go-contracts.yml + with: + commit-sha: ${{ tasks.dependency-plan.values.contracts }} + cache-epoch: ${{ init.cache-epoch }} + build-probe: ${{ init.build-probe }} + target-cache-mode: ${{ init.target-cache-mode }} + + - key: kona-code + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + call: git/clone 2.2.0 + with: + repository: https://github.com/ethereum-optimism/optimism.git + ref: ${{ tasks.dependency-plan.values.kona }} + preserve-git-dir: true + fetch-full-depth: true + submodules: false + + - key: kona-common-tools + use: [mise, kona-code] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + call: ${{ run.dir }}/packages/toolchain-common.yml + + - key: kona-rust-tools + use: [kona-code, kona-common-tools] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + call: ${{ run.dir }}/packages/toolchain-rust.yml + with: + mode: release + + - key: kona-source + use: [kona-rust-tools, kona-code] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + run: | + git reset --hard "$DEPENDENCY_BASE_SHA" + git submodule sync --recursive + git submodule update --init --recursive --jobs 8 + git rev-parse HEAD >packages/contracts-bedrock/.gitcommit + env: + DEPENDENCY_BASE_SHA: ${{ tasks.dependency-plan.values.kona }} + timeout: 20m + + - key: kona + use: kona-source + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + call: ${{ run.dir }}/packages/go-kona.yml + with: + commit-sha: ${{ tasks.dependency-plan.values.kona }} + cache-epoch: ${{ init.cache-epoch }} + build-probe: ${{ init.build-probe }} + target-cache-mode: ${{ init.target-cache-mode }} + + - key: op-reth-code + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + call: git/clone 2.2.0 + with: + repository: https://github.com/ethereum-optimism/optimism.git + ref: ${{ tasks.dependency-plan.values.op-reth }} + preserve-git-dir: true + fetch-full-depth: true + submodules: false + + - key: op-reth-common-tools + use: [mise, op-reth-code] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + call: ${{ run.dir }}/packages/toolchain-common.yml + + - key: op-reth-rust-tools + use: [op-reth-code, op-reth-common-tools] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + call: ${{ run.dir }}/packages/toolchain-rust.yml + with: + mode: release + + - key: op-reth-source + use: [op-reth-rust-tools, op-reth-code] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + run: | + git reset --hard "$DEPENDENCY_BASE_SHA" + git submodule sync --recursive + git submodule update --init --recursive --jobs 8 + git rev-parse HEAD >packages/contracts-bedrock/.gitcommit + env: + DEPENDENCY_BASE_SHA: ${{ tasks.dependency-plan.values.op-reth }} + timeout: 20m + + - key: op-reth + use: op-reth-source + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + call: ${{ run.dir }}/packages/go-op-reth.yml + with: + commit-sha: ${{ tasks.dependency-plan.values.op-reth }} + cache-epoch: ${{ init.cache-epoch }} + build-probe: ${{ init.build-probe }} + target-cache-mode: ${{ init.target-cache-mode }} + + - key: prestate-code + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + call: git/clone 2.2.0 + with: + repository: https://github.com/ethereum-optimism/optimism.git + ref: ${{ tasks.dependency-plan.values.prestate }} + preserve-git-dir: true + fetch-full-depth: true + submodules: false + + - key: prestate-common-tools + use: [mise, prestate-code] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + call: ${{ run.dir }}/packages/toolchain-common.yml + + - key: prestate-go-tools + use: [prestate-code, prestate-common-tools] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + call: ${{ run.dir }}/packages/toolchain-go.yml + with: + mode: go + + - key: prestate-source + use: [prestate-go-tools, prestate-code] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + run: | + git reset --hard "$DEPENDENCY_BASE_SHA" + git submodule sync --recursive + git submodule update --init --recursive --jobs 8 + git rev-parse HEAD >packages/contracts-bedrock/.gitcommit + env: + DEPENDENCY_BASE_SHA: ${{ tasks.dependency-plan.values.prestate }} + timeout: 20m + + - key: prestate + use: prestate-source + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + call: ${{ run.dir }}/packages/go-prestate.yml + with: + commit-sha: ${{ tasks.dependency-plan.values.prestate }} + cache-epoch: ${{ init.cache-epoch }} + build-probe: ${{ init.build-probe }} + target-cache-mode: ${{ init.target-cache-mode }} + + # Immutable parent compiler state is reusable by PR readers. Current-source + # compilation and every verdict still execute with the current sealed plan. + - key: compiler-code + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + call: git/clone 2.2.0 + with: + repository: https://github.com/ethereum-optimism/optimism.git + ref: ${{ tasks.dependency-plan.values.compiler }} + preserve-git-dir: true + fetch-full-depth: true + submodules: false + + - key: compiler-common-tools + use: [mise, compiler-code] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + call: ${{ run.dir }}/packages/toolchain-common.yml + + - key: compiler-go-tools + use: [compiler-code, compiler-common-tools] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + call: ${{ run.dir }}/packages/toolchain-go.yml + with: + mode: go + + - key: compiler-preparation + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + use: [compiler-go-tools, contracts.build, compiler-code] + run: | + git reset --hard "$CI_COMMIT_SHA" + git submodule sync --recursive + git submodule update --init --recursive --jobs 8 + export GOMODCACHE="$PWD/.ci/go-cache/full/modules" GOCACHE="$PWD/.ci/go-cache/full/build" + go mod download + just sync-superchain-go + git diff --exit-code op-core/superchain/bundle/superchain-configs.zip.sha256 + just cannon + python3 ops/ci/runtime/go-artifacts.py restore contracts .ci/go-tests/dependencies/contracts + mise exec -- bash ops/ci/runtime/go-full-tests.sh discover + env: + CI_COMMIT_SHA: ${{ tasks.dependency-plan.values.compiler }} + CI_BRANCH: compiler-base + CI_SHARD_TOTAL: ${{ init.shard-total }} + PARALLEL: ${{ init.test-parallel }} + COMPILER_CACHE_EPOCH: ${{ init.cache-epoch }} + timeout: 30m + + - key: compiler-seed-0 + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + use: compiler-preparation + run: mise exec -- bash ops/ci/runtime/go-full-tests.sh build + env: + CI_COMMIT_SHA: ${{ tasks.dependency-plan.values.compiler }} + CI_SHARD_INDEX: '0' + CI_SHARD_TOTAL: ${{ init.shard-total }} + PARALLEL: ${{ init.test-parallel }} + COMPILER_CACHE_EPOCH: ${{ init.cache-epoch }} + timeout: 60m + runner: + cpus: 8 + memory: 16gb + outputs: + filesystem: + filter: + workspace: [.ci/go-cache/full/build] + system: [] + artifacts: + - key: report + path: .ci/go-tests/build/metadata.json + + - key: compiler-seed-1 + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + use: compiler-preparation + run: mise exec -- bash ops/ci/runtime/go-full-tests.sh build + env: + CI_COMMIT_SHA: ${{ tasks.dependency-plan.values.compiler }} + CI_SHARD_INDEX: '1' + CI_SHARD_TOTAL: ${{ init.shard-total }} + PARALLEL: ${{ init.test-parallel }} + COMPILER_CACHE_EPOCH: ${{ init.cache-epoch }} + timeout: 60m + runner: + cpus: 8 + memory: 16gb + outputs: + filesystem: + filter: + workspace: [.ci/go-cache/full/build] + system: [] + artifacts: + - key: report + path: .ci/go-tests/build/metadata.json + + - key: compiler-seed-2 + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + use: compiler-preparation + run: mise exec -- bash ops/ci/runtime/go-full-tests.sh build + env: + CI_COMMIT_SHA: ${{ tasks.dependency-plan.values.compiler }} + CI_SHARD_INDEX: '2' + CI_SHARD_TOTAL: ${{ init.shard-total }} + PARALLEL: ${{ init.test-parallel }} + COMPILER_CACHE_EPOCH: ${{ init.cache-epoch }} + timeout: 60m + runner: + cpus: 8 + memory: 16gb + outputs: + filesystem: + filter: + workspace: [.ci/go-cache/full/build] + system: [] + artifacts: + - key: report + path: .ci/go-tests/build/metadata.json + + - key: compiler-seed-3 + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + use: compiler-preparation + run: mise exec -- bash ops/ci/runtime/go-full-tests.sh build + env: + CI_COMMIT_SHA: ${{ tasks.dependency-plan.values.compiler }} + CI_SHARD_INDEX: '3' + CI_SHARD_TOTAL: ${{ init.shard-total }} + PARALLEL: ${{ init.test-parallel }} + COMPILER_CACHE_EPOCH: ${{ init.cache-epoch }} + timeout: 60m + runner: + cpus: 8 + memory: 16gb + outputs: + filesystem: + filter: + workspace: [.ci/go-cache/full/build] + system: [] + artifacts: + - key: report + path: .ci/go-tests/build/metadata.json + + - key: compiler-seed-4 + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + use: compiler-preparation + run: mise exec -- bash ops/ci/runtime/go-full-tests.sh build + env: + CI_COMMIT_SHA: ${{ tasks.dependency-plan.values.compiler }} + CI_SHARD_INDEX: '4' + CI_SHARD_TOTAL: ${{ init.shard-total }} + PARALLEL: ${{ init.test-parallel }} + COMPILER_CACHE_EPOCH: ${{ init.cache-epoch }} + timeout: 60m + runner: + cpus: 8 + memory: 16gb + outputs: + filesystem: + filter: + workspace: [.ci/go-cache/full/build] + system: [] + artifacts: + - key: report + path: .ci/go-tests/build/metadata.json + + - key: compiler-seed-5 + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + use: compiler-preparation + run: mise exec -- bash ops/ci/runtime/go-full-tests.sh build + env: + CI_COMMIT_SHA: ${{ tasks.dependency-plan.values.compiler }} + CI_SHARD_INDEX: '5' + CI_SHARD_TOTAL: ${{ init.shard-total }} + PARALLEL: ${{ init.test-parallel }} + COMPILER_CACHE_EPOCH: ${{ init.cache-epoch }} + timeout: 60m + runner: + cpus: 8 + memory: 16gb + outputs: + filesystem: + filter: + workspace: [.ci/go-cache/full/build] + system: [] + artifacts: + - key: report + path: .ci/go-tests/build/metadata.json + + - key: compiler-seed-6 + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + use: compiler-preparation + run: mise exec -- bash ops/ci/runtime/go-full-tests.sh build + env: + CI_COMMIT_SHA: ${{ tasks.dependency-plan.values.compiler }} + CI_SHARD_INDEX: '6' + CI_SHARD_TOTAL: ${{ init.shard-total }} + PARALLEL: ${{ init.test-parallel }} + COMPILER_CACHE_EPOCH: ${{ init.cache-epoch }} + timeout: 60m + runner: + cpus: 8 + memory: 16gb + outputs: + filesystem: + filter: + workspace: [.ci/go-cache/full/build] + system: [] + artifacts: + - key: report + path: .ci/go-tests/build/metadata.json + + - key: compiler-seed-7 + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + use: compiler-preparation + run: mise exec -- bash ops/ci/runtime/go-full-tests.sh build + env: + CI_COMMIT_SHA: ${{ tasks.dependency-plan.values.compiler }} + CI_SHARD_INDEX: '7' + CI_SHARD_TOTAL: ${{ init.shard-total }} + PARALLEL: ${{ init.test-parallel }} + COMPILER_CACHE_EPOCH: ${{ init.cache-epoch }} + timeout: 60m + runner: + cpus: 8 + memory: 16gb + outputs: + filesystem: + filter: + workspace: [.ci/go-cache/full/build] + system: [] + artifacts: + - key: report + path: .ci/go-tests/build/metadata.json + + - key: compiler-seed-8 + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + use: compiler-preparation + run: mise exec -- bash ops/ci/runtime/go-full-tests.sh build + env: + CI_COMMIT_SHA: ${{ tasks.dependency-plan.values.compiler }} + CI_SHARD_INDEX: '8' + CI_SHARD_TOTAL: ${{ init.shard-total }} + PARALLEL: ${{ init.test-parallel }} + COMPILER_CACHE_EPOCH: ${{ init.cache-epoch }} + timeout: 60m + runner: + cpus: 8 + memory: 16gb + outputs: + filesystem: + filter: + workspace: [.ci/go-cache/full/build] + system: [] + artifacts: + - key: report + path: .ci/go-tests/build/metadata.json + + - key: compiler-seed-9 + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + use: compiler-preparation + run: mise exec -- bash ops/ci/runtime/go-full-tests.sh build + env: + CI_COMMIT_SHA: ${{ tasks.dependency-plan.values.compiler }} + CI_SHARD_INDEX: '9' + CI_SHARD_TOTAL: ${{ init.shard-total }} + PARALLEL: ${{ init.test-parallel }} + COMPILER_CACHE_EPOCH: ${{ init.cache-epoch }} + timeout: 60m + runner: + cpus: 8 + memory: 16gb + outputs: + filesystem: + filter: + workspace: [.ci/go-cache/full/build] + system: [] + artifacts: + - key: report + path: .ci/go-tests/build/metadata.json + + - key: compiler-seed-10 + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + use: compiler-preparation + run: mise exec -- bash ops/ci/runtime/go-full-tests.sh build + env: + CI_COMMIT_SHA: ${{ tasks.dependency-plan.values.compiler }} + CI_SHARD_INDEX: '10' + CI_SHARD_TOTAL: ${{ init.shard-total }} + PARALLEL: ${{ init.test-parallel }} + COMPILER_CACHE_EPOCH: ${{ init.cache-epoch }} + timeout: 60m + runner: + cpus: 8 + memory: 16gb + outputs: + filesystem: + filter: + workspace: [.ci/go-cache/full/build] + system: [] + artifacts: + - key: report + path: .ci/go-tests/build/metadata.json + + - key: compiler-seed-11 + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + use: compiler-preparation + run: mise exec -- bash ops/ci/runtime/go-full-tests.sh build + env: + CI_COMMIT_SHA: ${{ tasks.dependency-plan.values.compiler }} + CI_SHARD_INDEX: '11' + CI_SHARD_TOTAL: ${{ init.shard-total }} + PARALLEL: ${{ init.test-parallel }} + COMPILER_CACHE_EPOCH: ${{ init.cache-epoch }} + timeout: 60m + runner: + cpus: 8 + memory: 16gb + outputs: + filesystem: + filter: + workspace: [.ci/go-cache/full/build] + system: [] + artifacts: + - key: report + path: .ci/go-tests/build/metadata.json + + - key: discovery + use: [go-build-tools, go.build, contracts.build, source] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + run: | + if ! git cat-file -e "$CI_COMMIT_SHA^{commit}"; then git fetch --no-tags origin "$CI_COMMIT_SHA"; fi + git reset --hard "$CI_COMMIT_SHA" + git submodule sync --recursive + git submodule update --init --recursive --jobs 8 + git rev-parse HEAD >packages/contracts-bedrock/.gitcommit + python3 ops/ci/runtime/go-artifacts.py restore go "$GO_ARTIFACT" + python3 ops/ci/runtime/go-artifacts.py restore contracts "$CONTRACT_ARTIFACT" + mise exec -- bash ops/ci/runtime/go-full-tests.sh discover + env: + CI_BRANCH: ${{ init.branch }} + CI_COMMIT_SHA: ${{ init.commit-sha }} + CI_SHARD_TOTAL: ${{ init.shard-total }} + PARALLEL: ${{ init.test-parallel }} + GO_ARTIFACT: .ci/go-tests/dependencies/go + CONTRACT_ARTIFACT: .ci/go-tests/dependencies/contracts + outputs: + filesystem: + filter: + workspace: [.ci/go-tests/manifest.json, .ci/go-tests/go-list.json, .ci/go-tests/all-packages.txt, .ci/go-cache/full/modules, cannon/bin, cannon/multicannon/embeds, cannon/testdata/bin, op-core/superchain/bundle/superchain-configs.zip, packages/contracts-bedrock/cache, packages/contracts-bedrock/artifacts, packages/contracts-bedrock/forge-artifacts, op-deployer/pkg/deployer/artifacts/forge-artifacts] + system: [] + artifacts: + - key: discovery + path: .ci/go-tests + filter: ['!.ci/go-cache/full/dependencies'] + + - key: compile-0 + use: [compiler-seed-0, go-build-tools, discovery, source] + if: ${{ (init.cache-warm == 'true' || tasks.route.values.run-main == 'true') }} + call: ${{ run.dir }}/packages/go-test-compile.yml + with: + commit-sha: ${{ init.commit-sha }} + shard-index: '0' + shard-total: ${{ init.shard-total }} + test-parallel: ${{ init.test-parallel }} + build-probe: ${{ init.build-probe }} + cache-key: go-full-compile-0-${{ init.cache-epoch }} + + - key: verdict-0 + use: [go-build-tools, contract-tools, go.build, contracts.build, kona.build, op-reth.build, prestate.build, discovery, compile-0.build, source] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-main == 'true' }} + call: ${{ run.dir }}/packages/go-test-verdict.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + shard-index: '0' + shard-total: ${{ init.shard-total }} + test-parallel: ${{ init.test-parallel }} + cache-key: go-full-runtime-0-${{ init.cache-epoch }} + + - key: compile-1 + use: [compiler-seed-1, go-build-tools, discovery, source] + if: ${{ (init.cache-warm == 'true' || tasks.route.values.run-main == 'true') }} + call: ${{ run.dir }}/packages/go-test-compile.yml + with: + commit-sha: ${{ init.commit-sha }} + shard-index: '1' + shard-total: ${{ init.shard-total }} + test-parallel: ${{ init.test-parallel }} + build-probe: ${{ init.build-probe }} + cache-key: go-full-compile-1-${{ init.cache-epoch }} + + - key: verdict-1 + use: [go-build-tools, contract-tools, go.build, contracts.build, kona.build, op-reth.build, prestate.build, discovery, compile-1.build, source] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-main == 'true' }} + call: ${{ run.dir }}/packages/go-test-verdict.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + shard-index: '1' + shard-total: ${{ init.shard-total }} + test-parallel: ${{ init.test-parallel }} + cache-key: go-full-runtime-1-${{ init.cache-epoch }} + + - key: compile-2 + use: [compiler-seed-2, go-build-tools, discovery, source] + if: ${{ (init.cache-warm == 'true' || tasks.route.values.run-main == 'true') }} + call: ${{ run.dir }}/packages/go-test-compile.yml + with: + commit-sha: ${{ init.commit-sha }} + shard-index: '2' + shard-total: ${{ init.shard-total }} + test-parallel: ${{ init.test-parallel }} + build-probe: ${{ init.build-probe }} + cache-key: go-full-compile-2-${{ init.cache-epoch }} + + - key: verdict-2 + use: [go-build-tools, contract-tools, go.build, contracts.build, kona.build, op-reth.build, prestate.build, discovery, compile-2.build, source] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-main == 'true' }} + call: ${{ run.dir }}/packages/go-test-verdict.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + shard-index: '2' + shard-total: ${{ init.shard-total }} + test-parallel: ${{ init.test-parallel }} + cache-key: go-full-runtime-2-${{ init.cache-epoch }} + + - key: compile-3 + use: [compiler-seed-3, go-build-tools, discovery, source] + if: ${{ (init.cache-warm == 'true' || tasks.route.values.run-main == 'true') }} + call: ${{ run.dir }}/packages/go-test-compile.yml + with: + commit-sha: ${{ init.commit-sha }} + shard-index: '3' + shard-total: ${{ init.shard-total }} + test-parallel: ${{ init.test-parallel }} + build-probe: ${{ init.build-probe }} + cache-key: go-full-compile-3-${{ init.cache-epoch }} + + - key: verdict-3 + use: [go-build-tools, contract-tools, go.build, contracts.build, kona.build, op-reth.build, prestate.build, discovery, compile-3.build, source] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-main == 'true' }} + call: ${{ run.dir }}/packages/go-test-verdict.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + shard-index: '3' + shard-total: ${{ init.shard-total }} + test-parallel: ${{ init.test-parallel }} + cache-key: go-full-runtime-3-${{ init.cache-epoch }} + + - key: compile-4 + use: [compiler-seed-4, go-build-tools, discovery, source] + if: ${{ (init.cache-warm == 'true' || tasks.route.values.run-main == 'true') }} + call: ${{ run.dir }}/packages/go-test-compile.yml + with: + commit-sha: ${{ init.commit-sha }} + shard-index: '4' + shard-total: ${{ init.shard-total }} + test-parallel: ${{ init.test-parallel }} + build-probe: ${{ init.build-probe }} + cache-key: go-full-compile-4-${{ init.cache-epoch }} + + - key: verdict-4 + use: [go-build-tools, contract-tools, go.build, contracts.build, kona.build, op-reth.build, prestate.build, discovery, compile-4.build, source] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-main == 'true' }} + call: ${{ run.dir }}/packages/go-test-verdict.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + shard-index: '4' + shard-total: ${{ init.shard-total }} + test-parallel: ${{ init.test-parallel }} + cache-key: go-full-runtime-4-${{ init.cache-epoch }} + + - key: compile-5 + use: [compiler-seed-5, go-build-tools, discovery, source] + if: ${{ (init.cache-warm == 'true' || tasks.route.values.run-main == 'true') }} + call: ${{ run.dir }}/packages/go-test-compile.yml + with: + commit-sha: ${{ init.commit-sha }} + shard-index: '5' + shard-total: ${{ init.shard-total }} + test-parallel: ${{ init.test-parallel }} + build-probe: ${{ init.build-probe }} + cache-key: go-full-compile-5-${{ init.cache-epoch }} + + - key: verdict-5 + use: [go-build-tools, contract-tools, go.build, contracts.build, kona.build, op-reth.build, prestate.build, discovery, compile-5.build, source] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-main == 'true' }} + call: ${{ run.dir }}/packages/go-test-verdict.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + shard-index: '5' + shard-total: ${{ init.shard-total }} + test-parallel: ${{ init.test-parallel }} + cache-key: go-full-runtime-5-${{ init.cache-epoch }} + + - key: compile-6 + use: [compiler-seed-6, go-build-tools, discovery, source] + if: ${{ (init.cache-warm == 'true' || tasks.route.values.run-main == 'true') }} + call: ${{ run.dir }}/packages/go-test-compile.yml + with: + commit-sha: ${{ init.commit-sha }} + shard-index: '6' + shard-total: ${{ init.shard-total }} + test-parallel: ${{ init.test-parallel }} + build-probe: ${{ init.build-probe }} + cache-key: go-full-compile-6-${{ init.cache-epoch }} + + - key: verdict-6 + use: [go-build-tools, contract-tools, go.build, contracts.build, kona.build, op-reth.build, prestate.build, discovery, compile-6.build, source] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-main == 'true' }} + call: ${{ run.dir }}/packages/go-test-verdict.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + shard-index: '6' + shard-total: ${{ init.shard-total }} + test-parallel: ${{ init.test-parallel }} + cache-key: go-full-runtime-6-${{ init.cache-epoch }} + + - key: compile-7 + use: [compiler-seed-7, go-build-tools, discovery, source] + if: ${{ (init.cache-warm == 'true' || tasks.route.values.run-main == 'true') }} + call: ${{ run.dir }}/packages/go-test-compile.yml + with: + commit-sha: ${{ init.commit-sha }} + shard-index: '7' + shard-total: ${{ init.shard-total }} + test-parallel: ${{ init.test-parallel }} + build-probe: ${{ init.build-probe }} + cache-key: go-full-compile-7-${{ init.cache-epoch }} + + - key: verdict-7 + use: [go-build-tools, contract-tools, go.build, contracts.build, kona.build, op-reth.build, prestate.build, discovery, compile-7.build, source] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-main == 'true' }} + call: ${{ run.dir }}/packages/go-test-verdict.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + shard-index: '7' + shard-total: ${{ init.shard-total }} + test-parallel: ${{ init.test-parallel }} + cache-key: go-full-runtime-7-${{ init.cache-epoch }} + + - key: compile-8 + use: [compiler-seed-8, go-build-tools, discovery, source] + if: ${{ (init.cache-warm == 'true' || tasks.route.values.run-main == 'true') }} + call: ${{ run.dir }}/packages/go-test-compile.yml + with: + commit-sha: ${{ init.commit-sha }} + shard-index: '8' + shard-total: ${{ init.shard-total }} + test-parallel: ${{ init.test-parallel }} + build-probe: ${{ init.build-probe }} + cache-key: go-full-compile-8-${{ init.cache-epoch }} + + - key: verdict-8 + use: [go-build-tools, contract-tools, go.build, contracts.build, kona.build, op-reth.build, prestate.build, discovery, compile-8.build, source] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-main == 'true' }} + call: ${{ run.dir }}/packages/go-test-verdict.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + shard-index: '8' + shard-total: ${{ init.shard-total }} + test-parallel: ${{ init.test-parallel }} + cache-key: go-full-runtime-8-${{ init.cache-epoch }} + + - key: compile-9 + use: [compiler-seed-9, go-build-tools, discovery, source] + if: ${{ (init.cache-warm == 'true' || tasks.route.values.run-main == 'true') }} + call: ${{ run.dir }}/packages/go-test-compile.yml + with: + commit-sha: ${{ init.commit-sha }} + shard-index: '9' + shard-total: ${{ init.shard-total }} + test-parallel: ${{ init.test-parallel }} + build-probe: ${{ init.build-probe }} + cache-key: go-full-compile-9-${{ init.cache-epoch }} + + - key: verdict-9 + use: [go-build-tools, contract-tools, go.build, contracts.build, kona.build, op-reth.build, prestate.build, discovery, compile-9.build, source] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-main == 'true' }} + call: ${{ run.dir }}/packages/go-test-verdict.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + shard-index: '9' + shard-total: ${{ init.shard-total }} + test-parallel: ${{ init.test-parallel }} + cache-key: go-full-runtime-9-${{ init.cache-epoch }} + + - key: compile-10 + use: [compiler-seed-10, go-build-tools, discovery, source] + if: ${{ (init.cache-warm == 'true' || tasks.route.values.run-main == 'true') }} + call: ${{ run.dir }}/packages/go-test-compile.yml + with: + commit-sha: ${{ init.commit-sha }} + shard-index: '10' + shard-total: ${{ init.shard-total }} + test-parallel: ${{ init.test-parallel }} + build-probe: ${{ init.build-probe }} + cache-key: go-full-compile-10-${{ init.cache-epoch }} + + - key: verdict-10 + use: [go-build-tools, contract-tools, go.build, contracts.build, kona.build, op-reth.build, prestate.build, discovery, compile-10.build, source] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-main == 'true' }} + call: ${{ run.dir }}/packages/go-test-verdict.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + shard-index: '10' + shard-total: ${{ init.shard-total }} + test-parallel: ${{ init.test-parallel }} + cache-key: go-full-runtime-10-${{ init.cache-epoch }} + + - key: compile-11 + use: [compiler-seed-11, go-build-tools, discovery, source] + if: ${{ (init.cache-warm == 'true' || tasks.route.values.run-main == 'true') }} + call: ${{ run.dir }}/packages/go-test-compile.yml + with: + commit-sha: ${{ init.commit-sha }} + shard-index: '11' + shard-total: ${{ init.shard-total }} + test-parallel: ${{ init.test-parallel }} + build-probe: ${{ init.build-probe }} + cache-key: go-full-compile-11-${{ init.cache-epoch }} + + - key: verdict-11 + use: [go-build-tools, contract-tools, go.build, contracts.build, kona.build, op-reth.build, prestate.build, discovery, compile-11.build, source] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-main == 'true' }} + call: ${{ run.dir }}/packages/go-test-verdict.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + shard-index: '11' + shard-total: ${{ init.shard-total }} + test-parallel: ${{ init.test-parallel }} + cache-key: go-full-runtime-11-${{ init.cache-epoch }} + + # op-e2e/actions has its own Circle job (go-actions-tests); list-test-packages + # excludes it from the general verdicts, so it never runs twice. + - key: actions-verdict + use: [go-build-tools, go.build, contracts.build, op-reth.build, source] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-main == 'true' }} + run: | + if ! git cat-file -e "$CI_COMMIT_SHA^{commit}"; then git fetch --no-tags origin "$CI_COMMIT_SHA"; fi + git reset --hard "$CI_COMMIT_SHA" + git submodule sync --recursive + git submodule update --init --recursive --jobs 8 + git rev-parse HEAD >packages/contracts-bedrock/.gitcommit + python3 ops/ci/runtime/go-artifacts.py restore contracts .ci/go-tests/dependencies/contracts + python3 ops/ci/runtime/go-artifacts.py restore op-reth .ci/go-tests/dependencies/op-reth + export RUST_BINARY_PATH_OP_RETH_TEST_ENGINE="$PWD/rust/target/release/op-reth-test-engine" + test -x "$RUST_BINARY_PATH_OP_RETH_TEST_ENGINE" + export GOMODCACHE="$PWD/.ci/go-cache/full/modules" GOCACHE="$PWD/.ci/go-cache/actions/run" + mkdir -p "$GOCACHE" + TEST_TIMEOUT=30m mise exec -- just go-actions-tests-ci + env: + CI_COMMIT_SHA: ${{ init.commit-sha }} + CIRCLE_BRANCH: ${{ init.branch }} + cache: false + timeout: 60m + runner: + cpus: 16 + memory: 32gb + outputs: + filesystem: false + test-results: + - path: tmp/test-results/results.xml + artifacts: + - key: junit + path: tmp/test-results + - key: test-logs + path: tmp/testlogs + + - key: main-gate-receipt + use: [tools, code] + after: ${{ (actions-verdict.succeeded || actions-verdict.failed || actions-verdict.skipped) && (verdict-0.succeeded || verdict-0.failed || verdict-0.skipped) && (verdict-1.succeeded || verdict-1.failed || verdict-1.skipped) && (verdict-10.succeeded || verdict-10.failed || verdict-10.skipped) && (verdict-11.succeeded || verdict-11.failed || verdict-11.skipped) && (verdict-2.succeeded || verdict-2.failed || verdict-2.skipped) && (verdict-3.succeeded || verdict-3.failed || verdict-3.skipped) && (verdict-4.succeeded || verdict-4.failed || verdict-4.skipped) && (verdict-5.succeeded || verdict-5.failed || verdict-5.skipped) && (verdict-6.succeeded || verdict-6.failed || verdict-6.skipped) && (verdict-7.succeeded || verdict-7.failed || verdict-7.skipped) && (verdict-8.succeeded || verdict-8.failed || verdict-8.skipped) && (verdict-9.succeeded || verdict-9.failed || verdict-9.skipped) }} + if: ${{ init.cache-warm != 'true' && init.shard-total == '12' }} + run: python3 ops/ci/runtime/pr-gate.py receipt main-go + env: + CI_COMMIT_SHA: ${{ init.commit-sha }} + CI_BRANCH: ${{ init.branch }} + GROUP_SELECTED: ${{ tasks.route.values.run-main }} + RWX_RUN_ID: + cache-key: included + RWX_TASK_ATTEMPT_NUMBER: + cache-key: included + TASK_ACTIONS_VERDICT_SUCCEEDED: ${{ tasks.actions-verdict.succeeded }} + TASK_ACTIONS_VERDICT_FAILED: ${{ tasks.actions-verdict.failed }} + TASK_ACTIONS_VERDICT_SKIPPED: ${{ tasks.actions-verdict.skipped }} + TASK_VERDICT_0_SUCCEEDED: ${{ tasks.verdict-0.succeeded }} + TASK_VERDICT_0_FAILED: ${{ tasks.verdict-0.failed }} + TASK_VERDICT_0_SKIPPED: ${{ tasks.verdict-0.skipped }} + TASK_VERDICT_1_SUCCEEDED: ${{ tasks.verdict-1.succeeded }} + TASK_VERDICT_1_FAILED: ${{ tasks.verdict-1.failed }} + TASK_VERDICT_1_SKIPPED: ${{ tasks.verdict-1.skipped }} + TASK_VERDICT_10_SUCCEEDED: ${{ tasks.verdict-10.succeeded }} + TASK_VERDICT_10_FAILED: ${{ tasks.verdict-10.failed }} + TASK_VERDICT_10_SKIPPED: ${{ tasks.verdict-10.skipped }} + TASK_VERDICT_11_SUCCEEDED: ${{ tasks.verdict-11.succeeded }} + TASK_VERDICT_11_FAILED: ${{ tasks.verdict-11.failed }} + TASK_VERDICT_11_SKIPPED: ${{ tasks.verdict-11.skipped }} + TASK_VERDICT_2_SUCCEEDED: ${{ tasks.verdict-2.succeeded }} + TASK_VERDICT_2_FAILED: ${{ tasks.verdict-2.failed }} + TASK_VERDICT_2_SKIPPED: ${{ tasks.verdict-2.skipped }} + TASK_VERDICT_3_SUCCEEDED: ${{ tasks.verdict-3.succeeded }} + TASK_VERDICT_3_FAILED: ${{ tasks.verdict-3.failed }} + TASK_VERDICT_3_SKIPPED: ${{ tasks.verdict-3.skipped }} + TASK_VERDICT_4_SUCCEEDED: ${{ tasks.verdict-4.succeeded }} + TASK_VERDICT_4_FAILED: ${{ tasks.verdict-4.failed }} + TASK_VERDICT_4_SKIPPED: ${{ tasks.verdict-4.skipped }} + TASK_VERDICT_5_SUCCEEDED: ${{ tasks.verdict-5.succeeded }} + TASK_VERDICT_5_FAILED: ${{ tasks.verdict-5.failed }} + TASK_VERDICT_5_SKIPPED: ${{ tasks.verdict-5.skipped }} + TASK_VERDICT_6_SUCCEEDED: ${{ tasks.verdict-6.succeeded }} + TASK_VERDICT_6_FAILED: ${{ tasks.verdict-6.failed }} + TASK_VERDICT_6_SKIPPED: ${{ tasks.verdict-6.skipped }} + TASK_VERDICT_7_SUCCEEDED: ${{ tasks.verdict-7.succeeded }} + TASK_VERDICT_7_FAILED: ${{ tasks.verdict-7.failed }} + TASK_VERDICT_7_SKIPPED: ${{ tasks.verdict-7.skipped }} + TASK_VERDICT_8_SUCCEEDED: ${{ tasks.verdict-8.succeeded }} + TASK_VERDICT_8_FAILED: ${{ tasks.verdict-8.failed }} + TASK_VERDICT_8_SKIPPED: ${{ tasks.verdict-8.skipped }} + TASK_VERDICT_9_SUCCEEDED: ${{ tasks.verdict-9.succeeded }} + TASK_VERDICT_9_FAILED: ${{ tasks.verdict-9.failed }} + TASK_VERDICT_9_SKIPPED: ${{ tasks.verdict-9.skipped }} + cache: false + timeout: 10m + outputs: + filesystem: false + artifacts: + - key: receipt + path: .ci/pr-gates/groups/main-go diff --git a/.rwx/kontrol-build.yml b/.rwx/kontrol-build.yml new file mode 100644 index 00000000000..a382acc6217 --- /dev/null +++ b/.rwx/kontrol-build.yml @@ -0,0 +1,211 @@ +# Full Kontrol summary generation and proof build; Circle retains required ownership. +on: + cache-rebuild: + if: ${{ event.git.branch == 'develop' }} + target: [contracts, image] + init: + commit-sha: ${{ event.git.sha }} + branch: ${{ event.git.branch }} + tag: "" + cache-warm: "true" + cache-epoch: v1 + cli: + init: + commit-sha: ${{ event.git.sha }} + branch: ${{ event.git.branch }} + tag: "" + cache-warm: "false" + cache-epoch: v1 + +tool-cache: + vault: optimism-op-reth-shadow + +base: + image: ubuntu:24.04@sha256:008173c23f95b170204355c12626cb5a965d779a7e1283b09e9cffbb1bf33ca3 + config: rwx/base 1.2.0 + arch: x86_64 + +defaults: + runner: + cpus: 2 + memory: 8gb + +tasks: + - key: code + call: git/clone 2.2.0 + with: + repository: https://github.com/ethereum-optimism/optimism.git + ref: ${{ init.commit-sha }} + preserve-git-dir: true + fetch-full-depth: true + submodules: false + + - key: bootstrap-inputs + use: code + run: 'true' + filter: [mise.toml, ops/ci/runtime] + outputs: + filesystem: + filter: + workspace: [mise.toml, ops/ci/runtime/apt-install.sh, ops/ci/runtime/rwx-prepare.sh, ops/ci/runtime/rwx-contracts-prepare.sh, ops/ci/runtime/rwx-rust-prepare.sh, ops/ci/runtime/op-reth-shadow.sh, ops/ci/runtime/op-reth-report.py, ops/ci/runtime/rust-target-cache.py] + system: [] + artifacts: + - key: mise-config + path: mise.toml + - key: ci-scripts + path: ops/ci/runtime + - key: apt-script + path: ops/ci/runtime/apt-install.sh + + - key: mise + call: mise/install 1.1.0 + with: + mise-version: "2026.2.2" + install: "false" + + - key: tools + use: [mise, bootstrap-inputs] + call: ${{ run.dir }}/packages/toolchain-common.yml + + - key: route + use: [code, tools] + run: bash ops/ci/runtime/rwx-metadata.sh + env: + CI_EVENT: push + CI_CACHE_WARM: ${{ init.cache-warm }} + CI_BRANCH: ${{ init.branch }} + CI_TAG: ${{ init.tag }} + CI_COMMIT_SHA: ${{ init.commit-sha }} + cache: false + timeout: 10m + outputs: + filesystem: false + artifacts: + - key: routing + path: .ci/pipeline-parameters.json + + - key: contract-tools + use: [bootstrap-inputs, tools] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + call: ${{ run.dir }}/packages/toolchain-foundry.yml + with: + mode: compiler + + - key: go-tools + use: tools + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + call: ${{ run.dir }}/packages/toolchain-go.yml + with: + mode: go + timeout: 20m + + - key: compiler-set + use: contract-tools + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + run: | + if ! svm which 0.8.30 >/dev/null 2>&1; then + for attempt in 1 2 3 4 5; do + if svm install 0.8.30; then break; fi + if [ "$attempt" = 5 ]; then exit 1; fi + sleep "$((2 ** attempt))" + done + fi + timeout: 15m + + - key: image + use: [code, tools] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + filter: [mise.toml, ops/ci/runtime/kontrol-image.py, ops/ci/runtime/kontrol-image.json] + run: python3 ops/ci/runtime/kontrol-image.py prepare + docker: preserve-data + timeout: 30m + outputs: + filesystem: + filter: + workspace: [.ci/kontrol-build/image] + system: [] + artifacts: + - key: reports + path: .ci/kontrol-build/image + + - key: source + use: [code, tools] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + run: | + git submodule sync --recursive + git -c protocol.file.allow=never submodule update --init --recursive --jobs 8 + git rev-parse HEAD >packages/contracts-bedrock/.gitcommit + timeout: 20m + + - key: contracts + use: [source, go-tools, compiler-set] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + call: ${{ run.dir }}/packages/kontrol-contracts.yml + with: + commit-sha: ${{ init.commit-sha }} + cache-epoch: ${{ init.cache-epoch }} + + - key: helper-tests + use: [source, go-tools, compiler-set, image] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-main == 'true' }} + run: | + RWX_LIVE_KONTROL_FIXTURE=1 python3 -m unittest discover -s ops/ci/tests -p 'test_kontrol_build.py' + RWX_LIVE_KONTROL_FIXTURE=1 python3 -m unittest discover -s ops/ci/migration/tests -p 'test_migration_kontrol_build.py' + docker: true + cache: false + timeout: 20m + outputs: + filesystem: false + artifacts: + - key: fixtures + path: .ci/kontrol-build/helper-fixtures + + - key: check + use: [source, go-tools, compiler-set, image] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-main == 'true' }} + run: python3 ops/ci/runtime/kontrol-build.py --provider rwx --contract-artifact "$CONTRACT_ARTIFACT" + env: + CI: "true" + CI_COMMIT_SHA: ${{ init.commit-sha }} + CI_BRANCH: ${{ init.branch }} + CONTRACT_ARTIFACT: ${{ tasks.contracts.tasks.build.artifacts.dependency }} + RWX_RUN_ID: + cache-key: included + RWX_TASK_ATTEMPT_NUMBER: + cache-key: included + docker: true + cache: false + timeout: 90m + runner: + cpus: 2 + memory: 8gb + outputs: + filesystem: false + artifacts: + - key: reports + path: .ci/kontrol-build/run + + # Exact Main dependency states; unrelated workload failures stay outside this gate. + - key: main-gate-receipt + use: [code, tools] + after: ${{ (check.succeeded || check.failed || check.skipped) }} + if: ${{ init.cache-warm != 'true' }} + run: python3 ops/ci/runtime/pr-gate.py receipt main-kontrol + env: + CI_COMMIT_SHA: ${{ init.commit-sha }} + CI_BRANCH: ${{ init.branch }} + GROUP_SELECTED: ${{ tasks.route.values.run-main }} + RWX_RUN_ID: + cache-key: included + RWX_TASK_ATTEMPT_NUMBER: + cache-key: included + TASK_CHECK_SUCCEEDED: ${{ tasks.check.succeeded }} + TASK_CHECK_FAILED: ${{ tasks.check.failed }} + TASK_CHECK_SKIPPED: ${{ tasks.check.skipped }} + cache: false + timeout: 10m + outputs: + filesystem: false + artifacts: + - key: receipt + path: .ci/pr-gates/groups/main-kontrol diff --git a/.rwx/nut-prefork.yml b/.rwx/nut-prefork.yml new file mode 100644 index 00000000000..38038112568 --- /dev/null +++ b/.rwx/nut-prefork.yml @@ -0,0 +1,243 @@ +# Complete NUT pre-fork state regeneration; Circle still owns its required gate. +on: + cache-rebuild: + if: ${{ event.git.branch == 'develop' }} + target: [modules, contracts, superchain, op-reth] + init: + commit-sha: ${{ event.git.sha }} + branch: ${{ event.git.branch }} + tag: "" + cache-warm: "true" + cache-epoch: v1 + cli: + init: + commit-sha: ${{ event.git.sha }} + branch: ${{ event.git.branch }} + tag: "" + cache-warm: "false" + cache-epoch: v1 + +tool-cache: + vault: optimism-op-reth-shadow + +base: + image: ubuntu:24.04@sha256:008173c23f95b170204355c12626cb5a965d779a7e1283b09e9cffbb1bf33ca3 + config: rwx/base 1.2.0 + arch: x86_64 + +defaults: + runner: + cpus: 2 + memory: 8gb + +tasks: + - key: code + call: git/clone 2.2.0 + with: + repository: https://github.com/ethereum-optimism/optimism.git + ref: ${{ init.commit-sha }} + preserve-git-dir: true + fetch-full-depth: true + submodules: false + + - key: bootstrap-inputs + use: code + run: 'true' + filter: [mise.toml, ops/ci/runtime] + outputs: + filesystem: + filter: + workspace: [mise.toml, ops/ci/runtime/apt-install.sh, ops/ci/runtime/rwx-prepare.sh, ops/ci/runtime/rwx-contracts-prepare.sh, ops/ci/runtime/rwx-rust-prepare.sh, ops/ci/runtime/op-reth-shadow.sh, ops/ci/runtime/op-reth-report.py, ops/ci/runtime/rust-target-cache.py] + system: [] + artifacts: + - key: mise-config + path: mise.toml + - key: ci-scripts + path: ops/ci/runtime + - key: apt-script + path: ops/ci/runtime/apt-install.sh + + - key: mise + call: mise/install 1.1.0 + with: + mise-version: "2026.2.2" + install: "false" + + - key: tools + use: [mise, bootstrap-inputs] + call: ${{ run.dir }}/packages/toolchain-common.yml + + - key: route + use: [code, tools] + run: bash ops/ci/runtime/rwx-metadata.sh + env: + CI_EVENT: push + CI_CACHE_WARM: ${{ init.cache-warm }} + CI_BRANCH: ${{ init.branch }} + CI_TAG: ${{ init.tag }} + CI_COMMIT_SHA: ${{ init.commit-sha }} + cache: false + timeout: 10m + outputs: + filesystem: false + artifacts: + - key: routing + path: .ci/pipeline-parameters.json + + - key: go-tools + use: tools + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + call: ${{ run.dir }}/packages/toolchain-go.yml + with: + mode: go + + - key: contract-tools + use: [bootstrap-inputs, tools] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + call: ${{ run.dir }}/packages/toolchain-foundry.yml + with: + mode: compiler + + - key: rust-tools + use: [bootstrap-inputs, tools] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + call: ${{ run.dir }}/packages/toolchain-rust.yml + with: + mode: release + + - key: source + use: [code, tools] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + run: | + git submodule sync --recursive + git -c protocol.file.allow=never submodule update --init --recursive --jobs 8 + git rev-parse HEAD >packages/contracts-bedrock/.gitcommit + timeout: 20m + + - key: modules + use: [code, go-tools] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + call: ${{ run.dir }}/packages/go-modules.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + cache-epoch: ${{ init.cache-epoch }} + + - key: contracts + use: [source, go-tools, contract-tools] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + call: ${{ run.dir }}/packages/go-contracts.yml + with: + commit-sha: ${{ init.commit-sha }} + cache-epoch: ${{ init.cache-epoch }} + build-probe: '' + target-cache-mode: keep + + - key: superchain + use: [source, go-tools] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + run: python3 ops/ci/runtime/main-checks.py --prepare-superchain + env: + CI_COMMIT_SHA: ${{ init.commit-sha }} + timeout: 15m + outputs: + filesystem: + filter: + workspace: [op-core/superchain/bundle/superchain-configs.zip] + system: [] + artifacts: + - key: reports + path: .ci/main-checks/prep-superchain + + # The generator runs the L2 chain on op-reth-test-engine. + - key: op-reth + use: [source, rust-tools] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + call: ${{ run.dir }}/packages/go-op-reth.yml + with: + commit-sha: ${{ init.commit-sha }} + cache-epoch: ${{ init.cache-epoch }} + build-probe: '' + target-cache-mode: keep + + - key: helper-tests + use: [code, go-tools, contract-tools] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-main == 'true' }} + run: | + RWX_LIVE_NUT_PREFORK_FIXTURE=1 python3 -m unittest discover -s ops/ci/tests -p 'test_nut_prefork.py' + RWX_LIVE_NUT_PREFORK_FIXTURE=1 python3 -m unittest discover -s ops/ci/migration/tests -p 'test_migration_nut_prefork.py' + cache: false + timeout: 15m + outputs: + filesystem: false + + artifacts: + - key: fixtures + path: .ci/nut-prefork/helper-fixtures + + - key: tests + use: [source, go-tools, contract-tools, superchain] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-main == 'true' }} + run: | + export GOMODCACHE="$PWD/.ci/go-cache/pr-checks/modules" + export GOCACHE="$PWD/.ci/go-cache/nut-prefork/build" + mkdir -p "$GOCACHE" + python3 ops/ci/runtime/go-artifacts.py restore op-reth "$RETH_ARTIFACT" + export RUST_BINARY_PATH_OP_RETH_TEST_ENGINE="$PWD/rust/target/release/op-reth-test-engine" + test -x "$RUST_BINARY_PATH_OP_RETH_TEST_ENGINE" + python3 ops/ci/runtime/nut-prefork.py --provider rwx \ + --module-artifact "$MODULE_ARTIFACT" --contract-artifact "$CONTRACT_ARTIFACT" \ + --bundle-artifact "$BUNDLE_ARTIFACT" + env: + CI: "true" + CI_COMMIT_SHA: ${{ init.commit-sha }} + CI_BRANCH: ${{ init.branch }} + MODULE_ARTIFACT: ${{ tasks.modules.tasks.build.artifacts.dependency }} + CONTRACT_ARTIFACT: ${{ tasks.contracts.tasks.build.artifacts.dependency }} + BUNDLE_ARTIFACT: ${{ tasks.superchain.artifacts.reports }} + RETH_ARTIFACT: ${{ tasks.op-reth.tasks.build.artifacts.dependency }} + RWX_RUN_ID: + cache-key: included + RWX_TASK_ATTEMPT_NUMBER: + cache-key: included + cache: false + tool-cache: nut-prefork-compiler-${{ init.cache-epoch }} + timeout: 45m + runner: + cpus: 2 + memory: 8gb + outputs: + filesystem: + filter: + workspace: [.ci/go-cache/nut-prefork/build] + system: [] + test-results: + - path: .ci/nut-prefork/run/native.junit.xml + artifacts: + - key: reports + path: .ci/nut-prefork/run + + # Exact Main dependency states; unrelated workload failures stay outside this gate. + - key: main-gate-receipt + use: [code, tools] + after: ${{ (tests.succeeded || tests.failed || tests.skipped) }} + if: ${{ init.cache-warm != 'true' }} + run: python3 ops/ci/runtime/pr-gate.py receipt main-nut-prefork + env: + CI_COMMIT_SHA: ${{ init.commit-sha }} + CI_BRANCH: ${{ init.branch }} + GROUP_SELECTED: ${{ tasks.route.values.run-main }} + RWX_RUN_ID: + cache-key: included + RWX_TASK_ATTEMPT_NUMBER: + cache-key: included + TASK_TESTS_SUCCEEDED: ${{ tasks.tests.succeeded }} + TASK_TESTS_FAILED: ${{ tasks.tests.failed }} + TASK_TESTS_SKIPPED: ${{ tasks.tests.skipped }} + cache: false + timeout: 10m + outputs: + filesystem: false + artifacts: + - key: receipt + path: .ci/pr-gates/groups/main-nut-prefork diff --git a/.rwx/nut-provenance.yml b/.rwx/nut-provenance.yml new file mode 100644 index 00000000000..0fad3a96068 --- /dev/null +++ b/.rwx/nut-provenance.yml @@ -0,0 +1,181 @@ +# Full recorded-source NUT provenance regeneration; Circle still owns its required gate. +on: + cache-rebuild: + if: ${{ event.git.branch == 'develop' }} + target: [modules, historical-tools] + init: + commit-sha: ${{ event.git.sha }} + branch: ${{ event.git.branch }} + tag: "" + cache-warm: "true" + cache-epoch: v1 + cli: + init: + commit-sha: ${{ event.git.sha }} + branch: ${{ event.git.branch }} + tag: "" + cache-warm: "false" + cache-epoch: v1 + +tool-cache: + vault: optimism-op-reth-shadow + +base: + image: ubuntu:24.04@sha256:008173c23f95b170204355c12626cb5a965d779a7e1283b09e9cffbb1bf33ca3 + config: rwx/base 1.2.0 + arch: x86_64 + +defaults: + runner: + cpus: 2 + memory: 8gb + +tasks: + - key: code + call: git/clone 2.2.0 + with: + repository: https://github.com/ethereum-optimism/optimism.git + ref: ${{ init.commit-sha }} + preserve-git-dir: true + fetch-full-depth: true + submodules: false + + - key: bootstrap-inputs + use: code + run: 'true' + filter: [mise.toml, ops/ci/runtime] + outputs: + filesystem: + filter: + workspace: [mise.toml, ops/ci/runtime/apt-install.sh, ops/ci/runtime/rwx-prepare.sh, ops/ci/runtime/rwx-contracts-prepare.sh, ops/ci/runtime/rwx-rust-prepare.sh, ops/ci/runtime/op-reth-shadow.sh, ops/ci/runtime/op-reth-report.py, ops/ci/runtime/rust-target-cache.py] + system: [] + artifacts: + - key: mise-config + path: mise.toml + - key: ci-scripts + path: ops/ci/runtime + - key: apt-script + path: ops/ci/runtime/apt-install.sh + + - key: mise + call: mise/install 1.1.0 + with: + mise-version: "2026.2.2" + install: "false" + + - key: tools + use: [mise, bootstrap-inputs] + call: ${{ run.dir }}/packages/toolchain-common.yml + + - key: route + use: [code, tools] + run: bash ops/ci/runtime/rwx-metadata.sh + env: + CI_EVENT: push + CI_CACHE_WARM: ${{ init.cache-warm }} + CI_BRANCH: ${{ init.branch }} + CI_TAG: ${{ init.tag }} + CI_COMMIT_SHA: ${{ init.commit-sha }} + cache: false + timeout: 10m + outputs: + filesystem: false + artifacts: + - key: routing + path: .ci/pipeline-parameters.json + + - key: go-tools + use: tools + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + call: ${{ run.dir }}/packages/toolchain-go.yml + with: + mode: go + + - key: modules + use: [code, go-tools] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + call: ${{ run.dir }}/packages/go-modules.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + cache-epoch: ${{ init.cache-epoch }} + + - key: historical-tools + use: [code, go-tools] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + call: ${{ run.dir }}/packages/nut-tools.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + cache-epoch: ${{ init.cache-epoch }} + + - key: helper-tests + use: [code, go-tools] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-main == 'true' }} + run: | + python3 -m unittest discover -s ops/ci/tests -p 'test_nut_provenance.py' -v + python3 -m unittest discover -s ops/ci/migration/tests -p 'test_migration_nut_provenance.py' -v + go test -count=1 ./ops/scripts/nut-provenance-verify + cache: false + timeout: 15m + outputs: + filesystem: false + + - key: verify + use: [code, go-tools, historical-tools] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-main == 'true' }} + run: | + export GOMODCACHE="$PWD/.ci/go-cache/pr-checks/modules" + export GOCACHE="$PWD/.ci/go-cache/nut-provenance/build" + mkdir -p "$GOCACHE" + python3 ops/ci/runtime/nut-provenance.py --provider rwx --full \ + --module-artifact "$MODULE_ARTIFACT" --tool-artifact "$TOOL_ARTIFACT" + env: + CI: "true" + CI_COMMIT_SHA: ${{ init.commit-sha }} + CI_BRANCH: ${{ init.branch }} + MODULE_ARTIFACT: ${{ tasks.modules.tasks.build.artifacts.dependency }} + TOOL_ARTIFACT: ${{ tasks.historical-tools.tasks.prepare.artifacts.tools }} + RWX_RUN_ID: + cache-key: included + RWX_TASK_ATTEMPT_NUMBER: + cache-key: included + cache: false + tool-cache: nut-provenance-go-compiler-${{ init.cache-epoch }} + timeout: 45m + runner: + cpus: 16 + memory: 32gb + outputs: + filesystem: + filter: + workspace: [.ci/go-cache/nut-provenance/build] + system: [] + artifacts: + - key: reports + path: .ci/nut-provenance/run + + # Exact Main dependency states; unrelated workload failures stay outside this gate. + - key: main-gate-receipt + use: [code, tools] + after: ${{ (verify.succeeded || verify.failed || verify.skipped) }} + if: ${{ init.cache-warm != 'true' }} + run: python3 ops/ci/runtime/pr-gate.py receipt main-nut-provenance + env: + CI_COMMIT_SHA: ${{ init.commit-sha }} + CI_BRANCH: ${{ init.branch }} + GROUP_SELECTED: ${{ tasks.route.values.run-main }} + RWX_RUN_ID: + cache-key: included + RWX_TASK_ATTEMPT_NUMBER: + cache-key: included + TASK_VERIFY_SUCCEEDED: ${{ tasks.verify.succeeded }} + TASK_VERIFY_FAILED: ${{ tasks.verify.failed }} + TASK_VERIFY_SKIPPED: ${{ tasks.verify.skipped }} + cache: false + timeout: 10m + outputs: + filesystem: false + artifacts: + - key: receipt + path: .ci/pr-gates/groups/main-nut-provenance diff --git a/.rwx/op-reth.yml b/.rwx/op-reth.yml new file mode 100644 index 00000000000..4acf59428c2 --- /dev/null +++ b/.rwx/op-reth.yml @@ -0,0 +1,423 @@ +# Four complete op-reth workloads. CircleCI retains the required checks. +on: + cache-rebuild: + if: ${{ event.git.branch == 'develop' }} + target: [release-build, integration-build, codec-base-build, codec-head-build, snapshot-build] + init: + commit-sha: ${{ event.git.sha }} + branch: ${{ event.git.branch }} + tag: "" + cache-epoch: v1 + build-probe: "" + target-cache-mode: keep + codec-base-sha: ${{ event.git.sha }} + cache-warm: "true" + # Automatic pushes are coordinated by pr-gates.yml; CLI and warming remain. + cli: + init: + commit-sha: ${{ event.git.sha }} + branch: ${{ event.git.branch }} + tag: "" + cache-epoch: v1 + build-probe: "" + target-cache-mode: keep + codec-base-sha: "" + cache-warm: "false" + +base: + image: ubuntu:24.04@sha256:008173c23f95b170204355c12626cb5a965d779a7e1283b09e9cffbb1bf33ca3 + config: rwx/base 1.2.0 + arch: x86_64 + +# Cache-only vault: no publishing credentials. Only develop may write; +# PRs restore the protected shared baseline and compile changes locally. +tool-cache: + vault: optimism-op-reth-shadow + +defaults: + runner: + cpus: 2 + memory: 8gb + +tasks: + - key: code + call: git/clone 2.2.0 + with: + repository: https://github.com/ethereum-optimism/optimism.git + ref: ${{ init.commit-sha }} + preserve-git-dir: true + fetch-full-depth: true + submodules: false + + - key: bootstrap-inputs + use: code + run: 'true' + filter: [mise.toml, ops/ci/runtime] + outputs: + filesystem: + filter: + workspace: [mise.toml, ops/ci/runtime/apt-install.sh, ops/ci/runtime/rwx-prepare.sh, ops/ci/runtime/rwx-contracts-prepare.sh, ops/ci/runtime/rwx-rust-prepare.sh, ops/ci/runtime/op-reth-shadow.sh, ops/ci/runtime/op-reth-report.py, ops/ci/runtime/rust-target-cache.py] + system: [] + artifacts: + - key: mise-config + path: mise.toml + - key: ci-scripts + path: ops/ci/runtime + - key: apt-script + path: ops/ci/runtime/apt-install.sh + + - key: mise + call: mise/install 1.1.0 + with: + mise-version: "2026.2.2" + install: "false" + + # Artifact dependencies avoid inheriting the checkout's Git history into + # reusable tools. Language toolchains are added only by their own workload. + - key: tools + use: [mise, bootstrap-inputs] + call: ${{ run.dir }}/packages/toolchain-common.yml + + - key: route + use: [code, tools] + run: bash ops/ci/runtime/rwx-metadata.sh + env: + CI_EVENT: push + CI_CACHE_WARM: ${{ init.cache-warm }} + CI_BRANCH: ${{ init.branch }} + CI_TAG: ${{ init.tag }} + CI_COMMIT_SHA: ${{ init.commit-sha }} + cache: false + timeout: 10m + outputs: + filesystem: false + artifacts: + - key: routing + path: .ci/pipeline-parameters.json + + - key: helper-tests + use: [code, tools] + run: | + python3 ops/ci/tests/test_op_reth_shadow.py + python3 -m unittest discover -s ops/ci/tests -p 'test_rust_target_cache.py' + cache: false + timeout: 10m + outputs: + filesystem: false + + - key: rust-tools + use: [bootstrap-inputs, tools] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' || tasks.route.values.run-rust-ci == 'true' }} + call: ${{ run.dir }}/packages/toolchain-rust.yml + with: + mode: release + + - key: rust-dependencies + use: [code, rust-tools] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' || tasks.route.values.run-rust-ci == 'true' }} + run: | + export CARGO_HOME="$PWD/.ci/rust-cache/cargo" + cd rust + attempt=0 + until cargo fetch --locked; do + attempt=$((attempt + 1)) + if [[ "$attempt" -ge 5 ]]; then exit 1; fi + sleep "$((2 ** attempt))" + done + filter: [rust, mise.toml] + tool-cache: op-reth-dependencies-${{ init.cache-epoch }} + timeout: 30m + outputs: + filesystem: + filter: + workspace: [.ci/rust-cache/cargo] + system: [] + + # Keep full source, Git metadata and the pinned submodule as build inputs. + - key: head-source + use: [code, rust-dependencies] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' || tasks.route.values.run-rust-ci == 'true' }} + run: bash /usr/local/lib/optimism-ci/op-reth-shadow.sh source + timeout: 15m + + - key: codec-base-revision + use: [code, tools] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-rust-ci == 'true' }} + run: | + revision="$CODEC_BASE_SHA" + if [[ -z "$revision" ]]; then + revision="$(git ls-remote --exit-code origin refs/heads/develop | cut -f1)" + fi + [[ "$revision" =~ ^[0-9a-f]{40}$ ]] || { echo 'Expected an immutable develop SHA.' >&2; exit 1; } + mkdir -p .ci + printf '%s\n' "$revision" >"$RWX_VALUES/sha" + printf '%s\n' "$revision" >.ci/op-reth-codec-base-sha.txt + env: + CODEC_BASE_SHA: ${{ init.codec-base-sha }} + cache: false + timeout: 5m + outputs: + filesystem: false + artifacts: + - key: codec-base-revision + path: .ci/op-reth-codec-base-sha.txt + + - key: codec-base-code + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-rust-ci == 'true' }} + call: git/clone 2.2.0 + with: + repository: https://github.com/ethereum-optimism/optimism.git + ref: ${{ tasks.codec-base-revision.values.sha }} + preserve-git-dir: true + fetch-full-depth: true + submodules: false + + - key: codec-base-source + # Baseline checkout wins over the PR manifest tree in the dependency layer. + use: [rust-dependencies, codec-base-code] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-rust-ci == 'true' }} + run: bash /usr/local/lib/optimism-ci/op-reth-shadow.sh source + timeout: 15m + + # Each producer has its own mutable cache, avoiding concurrent writers. RWX + # content hits skip compilation; misses restore Cargo targets and local + # sccache entries, then Cargo checks source, flags, profiles and lockfiles. + # BUILD_PROBE forces a content miss for measurements without disabling the + # tool cache. A new CACHE_EPOCH gives genuinely cold build/compile caches. + - key: release-build + use: head-source + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + call: ${{ run.dir }}/packages/go-op-reth.yml + with: + commit-sha: ${{ init.commit-sha }} + cache-epoch: ${{ init.cache-epoch }} + build-probe: ${{ init.build-probe }} + target-cache-mode: ${{ init.target-cache-mode }} + + - key: release + # Artifact references create dependencies without inheriting Cargo/sccache + # filesystem layers. Input filters affect cache keys, not layer downloads. + use: [code, rust-tools] + if: ${{ tasks.route.values.run-main == 'true' }} + run: | + mkdir -p .ci/op-reth/release-build + cp -a "$RELEASE_ARTIFACT/." .ci/op-reth/release-build/ + bash /usr/local/lib/optimism-ci/op-reth-shadow.sh release + env: + CI_COMMIT_SHA: ${{ init.commit-sha }} + RELEASE_ARTIFACT: ${{ tasks.release-build.tasks.build.artifacts.release-binaries }} + cache: false + timeout: 10m + outputs: + filesystem: false + artifacts: + - key: release-verification + path: .ci/op-reth/release + + - key: integration-build + use: head-source + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-rust-ci == 'true' }} + run: bash /usr/local/lib/optimism-ci/op-reth-shadow.sh integration-build + env: &build-env + CI_COMMIT_SHA: ${{ init.commit-sha }} + CACHE_EPOCH: ${{ init.cache-epoch }} + BUILD_PROBE: ${{ init.build-probe }} + TARGET_CACHE_MODE: ${{ init.target-cache-mode }} + tool-cache: op-reth-integration-${{ init.cache-epoch }} + timeout: 60m + runner: &build-runner + cpus: 16 + memory: 32gb + outputs: + filesystem: + filter: + workspace: [rust/target, rust/op-reth/crates/chainspec/res/superchain-configs.tar, .ci/rust-cache, .ci/op-reth/integration-build] + system: [] + artifacts: + - key: integration-build-report + path: .ci/op-reth/integration-build + + - key: integration + use: [code, rust-tools] + if: ${{ tasks.route.values.run-rust-ci == 'true' }} + run: | + mkdir -p .ci/op-reth/integration-build + cp -a "$INTEGRATION_ARTIFACT/." .ci/op-reth/integration-build/ + bash /usr/local/lib/optimism-ci/op-reth-shadow.sh integration + env: + CI_COMMIT_SHA: ${{ init.commit-sha }} + INTEGRATION_ARTIFACT: ${{ tasks.integration-build.artifacts.integration-build-report }} + cache: false + timeout: 60m + runner: *build-runner + outputs: + filesystem: false + test-results: + # Captain has no nextest-specific parser. Infer its generic JUnit parser. + - path: .ci/op-reth/integration/junit.xml + artifacts: + - key: integration-reports + path: .ci/op-reth/integration + + - key: codec-base-build + use: codec-base-source + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-rust-ci == 'true' }} + run: bash /usr/local/lib/optimism-ci/op-reth-shadow.sh codec-base-build + env: + # The PR SHA is deliberately absent: an unchanged pinned develop build + # can content-hit when only the PR changes. + CACHE_EPOCH: ${{ init.cache-epoch }} + BUILD_PROBE: ${{ init.build-probe }} + TARGET_CACHE_MODE: ${{ init.target-cache-mode }} + CODEC_BASE_SHA: ${{ tasks.codec-base-revision.values.sha }} + tool-cache: op-reth-codec-base-${{ init.cache-epoch }} + timeout: 60m + runner: + cpus: 8 + memory: 16gb + outputs: + filesystem: + filter: + workspace: [rust/target, rust/op-reth/crates/chainspec/res/superchain-configs.tar, .ci/rust-cache, .ci/op-reth/codec-base-build] + system: [] + artifacts: + - key: codec-base-build-report + path: .ci/op-reth/codec-base-build + + - key: codec-head-build + use: head-source + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-rust-ci == 'true' }} + run: bash /usr/local/lib/optimism-ci/op-reth-shadow.sh codec-head-build + env: *build-env + tool-cache: op-reth-codec-head-${{ init.cache-epoch }} + timeout: 60m + runner: + cpus: 8 + memory: 16gb + outputs: + filesystem: + filter: + workspace: [rust/target, rust/op-reth/crates/chainspec/res/superchain-configs.tar, .ci/rust-cache, .ci/op-reth/codec-head-build] + system: [] + artifacts: + - key: codec-head-build-report + path: .ci/op-reth/codec-head-build + + # Generate random baseline vectors afresh on every run. Only the immutable + # baseline compiler output is reusable, preserving CircleCI's sample cadence. + - key: codec-vectors + use: [code, rust-tools] + if: ${{ tasks.route.values.run-rust-ci == 'true' }} + run: | + mkdir -p .ci/op-reth/codec-base-build + cp -a "$CODEC_BASE_ARTIFACT/." .ci/op-reth/codec-base-build/ + bash /usr/local/lib/optimism-ci/op-reth-shadow.sh codec-vectors + env: + CODEC_BASE_SHA: ${{ tasks.codec-base-revision.values.sha }} + CODEC_BASE_ARTIFACT: ${{ tasks.codec-base-build.artifacts.codec-base-build-report }} + cache: false + timeout: 10m + runner: + cpus: 8 + memory: 16gb + outputs: + filesystem: false + artifacts: + - key: codec-vectors + path: testdata/micro/compact + - key: codec-vector-provenance + path: .ci/op-reth/codec-vectors + + - key: codec + # Keep the PR checkout and mount only the head binary and fresh vectors. + use: [code, rust-tools] + if: ${{ tasks.route.values.run-rust-ci == 'true' }} + run: | + mkdir -p .ci/op-reth/codec-head-build .ci/op-reth/codec-vectors + cp -a "$CODEC_HEAD_ARTIFACT/." .ci/op-reth/codec-head-build/ + cp -a "$CODEC_PROVENANCE/." .ci/op-reth/codec-vectors/ + rm -rf testdata/micro/compact + mkdir -p testdata/micro/compact + cp -a "$CODEC_VECTORS/." testdata/micro/compact/ + bash /usr/local/lib/optimism-ci/op-reth-shadow.sh codec + env: + CI_COMMIT_SHA: ${{ init.commit-sha }} + CODEC_BASE_SHA: ${{ tasks.codec-base-revision.values.sha }} + CODEC_HEAD_ARTIFACT: ${{ tasks.codec-head-build.artifacts.codec-head-build-report }} + CODEC_PROVENANCE: ${{ tasks.codec-vectors.artifacts.codec-vector-provenance }} + CODEC_VECTORS: ${{ tasks.codec-vectors.artifacts.codec-vectors }} + cache: false + timeout: 10m + runner: + cpus: 8 + memory: 16gb + outputs: + filesystem: false + artifacts: + - key: codec-verification + path: .ci/op-reth/codec + + - key: snapshot-build + use: head-source + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-rust-ci == 'true' }} + run: bash /usr/local/lib/optimism-ci/op-reth-shadow.sh snapshot-build + env: *build-env + tool-cache: op-reth-snapshot-${{ init.cache-epoch }} + timeout: 30m + runner: + cpus: 4 + memory: 8gb + outputs: + filesystem: + filter: + workspace: [rust/target, rust/op-reth/crates/chainspec/res/superchain-configs.tar, .ci/rust-cache, .ci/op-reth/snapshot-build] + system: [] + artifacts: + - key: snapshot-build-report + path: .ci/op-reth/snapshot-build + + - key: snapshot + use: snapshot-build + if: ${{ tasks.route.values.run-rust-ci == 'true' }} + run: bash /usr/local/lib/optimism-ci/op-reth-shadow.sh snapshot + cache: false + timeout: 30m + runner: + cpus: 4 + memory: 8gb + outputs: + filesystem: false + artifacts: + - key: snapshot-verification + path: .ci/op-reth/snapshot + + # Terminal task states preserve exact Rust dependencies without Main-only failures. + - key: rust-gate-receipt + use: [code, tools] + if: ${{ init.cache-warm != 'true' }} + after: ${{ (codec.succeeded || codec.failed || codec.skipped) && (integration.succeeded || integration.failed || integration.skipped) && (snapshot.succeeded || snapshot.failed || snapshot.skipped) }} + run: python3 ops/ci/runtime/pr-gate.py receipt op-reth-rust + env: + CI_COMMIT_SHA: ${{ init.commit-sha }} + CI_BRANCH: ${{ init.branch }} + GROUP_SELECTED: ${{ tasks.route.values.run-rust-ci }} + RWX_RUN_ID: + cache-key: included + RWX_TASK_ATTEMPT_NUMBER: + cache-key: included + TASK_CODEC_SUCCEEDED: ${{ tasks.codec.succeeded }} + TASK_CODEC_FAILED: ${{ tasks.codec.failed }} + TASK_CODEC_SKIPPED: ${{ tasks.codec.skipped }} + TASK_INTEGRATION_SUCCEEDED: ${{ tasks.integration.succeeded }} + TASK_INTEGRATION_FAILED: ${{ tasks.integration.failed }} + TASK_INTEGRATION_SKIPPED: ${{ tasks.integration.skipped }} + TASK_SNAPSHOT_SUCCEEDED: ${{ tasks.snapshot.succeeded }} + TASK_SNAPSHOT_FAILED: ${{ tasks.snapshot.failed }} + TASK_SNAPSHOT_SKIPPED: ${{ tasks.snapshot.skipped }} + cache: false + timeout: 10m + outputs: + filesystem: false + artifacts: + - key: receipt + path: .ci/pr-gates/groups/op-reth-rust diff --git a/.rwx/packages/acceptance-compile.yml b/.rwx/packages/acceptance-compile.yml new file mode 100644 index 00000000000..ae357917bc2 --- /dev/null +++ b/.rwx/packages/acceptance-compile.yml @@ -0,0 +1,45 @@ +package: + parameters: + commit-sha: + required: true + shard-total: + required: true + cl-kind: + required: true + go-artifact: + default: .ci/go-tests/dependencies/go + contract-artifact: + default: .ci/go-tests/dependencies/contracts + cache-key: + required: true + memory: + default: 32gb +tasks: + - key: build + use: package.use + run: | + python3 ops/ci/runtime/go-artifacts.py restore go "$GO_ARTIFACT" + python3 ops/ci/runtime/go-artifacts.py restore contracts "$CONTRACT_ARTIFACT" + mise exec -- bash ops/ci/runtime/acceptance-tests.sh discover + env: + CI_COMMIT_SHA: ${{ params.commit-sha }} + CI_SHARD_TOTAL: ${{ params.shard-total }} + DEVSTACK_L1_FORK: fusaka + DEVSTACK_L2CL_KIND: ${{ params.cl-kind }} + DEVSTACK_L2EL_KIND: op-reth + GO_ARTIFACT: ${{ params.go-artifact }} + CONTRACT_ARTIFACT: ${{ params.contract-artifact }} + tool-cache: ${{ params.cache-key }} + timeout: 60m + runner: + cpus: 16 + memory: ${{ params.memory }} + outputs: + filesystem: + filter: + workspace: [.ci/go-cache/acceptance/discover, .ci/acceptance/discovery] + system: [] + artifacts: + - key: discovery + path: .ci/acceptance/discovery + filter: ['!.ci/go-cache/full/dependencies'] diff --git a/.rwx/packages/acceptance-verdict.yml b/.rwx/packages/acceptance-verdict.yml new file mode 100644 index 00000000000..4c291545602 --- /dev/null +++ b/.rwx/packages/acceptance-verdict.yml @@ -0,0 +1,85 @@ +package: + parameters: + commit-sha: + required: true + branch: + required: true + shard-index: + required: true + shard-total: + required: true + cl-kind: + required: true + discovery: + default: .ci/acceptance/discovery + go-artifact: + default: .ci/go-tests/dependencies/go + contract-artifact: + default: .ci/go-tests/dependencies/contracts + kona-artifact: + default: .ci/go-tests/dependencies/kona + reth-artifact: + default: .ci/go-tests/dependencies/op-reth + prestate-artifact: + default: .ci/go-tests/dependencies/prestate + sp1-artifact: + default: .ci/go-tests/dependencies/sp1-executor + cache-key: + required: true + memory: + required: true +tasks: + - key: run + use: package.use + docker: true + run: | + for dependency in go contracts kona op-reth prestate sp1-executor; do + case "$dependency" in + go) artifact="$GO_ARTIFACT" ;; + contracts) artifact="$CONTRACT_ARTIFACT" ;; + kona) artifact="$KONA_ARTIFACT" ;; + op-reth) artifact="$RETH_ARTIFACT" ;; + prestate) artifact="$PRESTATE_ARTIFACT" ;; + sp1-executor) artifact="$SP1_ARTIFACT" ;; + esac + python3 ops/ci/runtime/go-artifacts.py restore "$dependency" "$artifact" + done + export CI_ACCEPTANCE_MANIFEST="$PWD/$CI_ACCEPTANCE_MANIFEST" + mise exec -- bash ops/ci/runtime/acceptance-tests.sh run + env: + CI_COMMIT_SHA: ${{ params.commit-sha }} + CI_BRANCH: ${{ params.branch }} + CIRCLE_BRANCH: ${{ params.branch }} + CI_SHARD_INDEX: ${{ params.shard-index }} + CI_SHARD_TOTAL: ${{ params.shard-total }} + DEVSTACK_L1_FORK: fusaka + DEVSTACK_L2CL_KIND: ${{ params.cl-kind }} + DEVSTACK_L2EL_KIND: op-reth + CI_ACCEPTANCE_MANIFEST: ${{ params.discovery }} + GO_ARTIFACT: ${{ params.go-artifact }} + CONTRACT_ARTIFACT: ${{ params.contract-artifact }} + KONA_ARTIFACT: ${{ params.kona-artifact }} + RETH_ARTIFACT: ${{ params.reth-artifact }} + PRESTATE_ARTIFACT: ${{ params.prestate-artifact }} + SP1_ARTIFACT: ${{ params.sp1-artifact }} + cache: false + tool-cache: ${{ params.cache-key }} + timeout: 120m + runner: + cpus: 16 + memory: ${{ params.memory }} + outputs: + filesystem: + filter: + workspace: [.ci/go-cache/acceptance/run] + system: [] + test-results: + - path: .ci/acceptance/reports/native.json + options: + language: Go + framework: go test + artifacts: + - key: reports + path: .ci/acceptance/reports + # Keep the producer's module cache so tests do not refetch modules; exclude compiler state. + filter: ['!.ci/go-cache/full/build', '!.ci/go-cache/full/dependencies', '!.ci/go-cache/acceptance/run', '!.ci/rust-cache', '!rust/target', '!packages/contracts-bedrock/cache', '!packages/contracts-bedrock/artifacts', '!packages/contracts-bedrock/forge-artifacts', '!op-deployer/pkg/deployer/artifacts/forge-artifacts', '!.ci/go-cache/acceptance/discover'] diff --git a/.rwx/packages/contract-upgrades-compile.yml b/.rwx/packages/contract-upgrades-compile.yml new file mode 100644 index 00000000000..6f5d41ade44 --- /dev/null +++ b/.rwx/packages/contract-upgrades-compile.yml @@ -0,0 +1,37 @@ +package: + parameters: + commit-sha: + required: true + branch: + required: true + cache-key: + required: true + variant: + required: true +tasks: + - key: build + use: package.use + run: | + export GOMODCACHE="$PWD/.ci/go-cache/contract-upgrades/modules" + export GOCACHE="$PWD/.ci/go-cache/contract-upgrades/build" + git submodule sync --recursive + git -c protocol.file.allow=never submodule update --init --recursive --jobs 8 + python3 ops/ci/runtime/contract-upgrades.py prepare --variant "$CI_CONTRACT_VARIANT" + env: + CI_COMMIT_SHA: ${{ params.commit-sha }} + CI_BRANCH: ${{ params.branch }} + CI_CONTRACT_PROVIDER: rwx + CI_CONTRACT_VARIANT: ${{ params.variant }} + tool-cache: ${{ params.cache-key }} + timeout: 40m + runner: + cpus: 16 + memory: 32gb + outputs: + filesystem: + filter: + workspace: [packages/contracts-bedrock/forge-artifacts, packages/contracts-bedrock/cache/solidity-files-cache.json, packages/contracts-bedrock/artifacts/build-info, packages/contracts-bedrock/scripts/go-ffi/go-ffi, .ci/go-cache/contract-upgrades/build, '.ci/contract-upgrades'] + system: [] + artifacts: + - key: compiled + path: .ci/contract-upgrades/${{ params.variant }}/prepare diff --git a/.rwx/packages/contract-upgrades-verdict.yml b/.rwx/packages/contract-upgrades-verdict.yml new file mode 100644 index 00000000000..2f26b1739b0 --- /dev/null +++ b/.rwx/packages/contract-upgrades-verdict.yml @@ -0,0 +1,55 @@ +package: + parameters: + commit-sha: + required: true + branch: + required: true + compiled: + required: true + pinned-block: + required: true + cache-key: + required: true + variant: + required: true +tasks: + - key: run + use: package.use + run: | + export GOMODCACHE="$PWD/.ci/go-cache/contract-upgrades/modules" + export GOCACHE="$PWD/.ci/go-cache/contract-upgrades/build" + git submodule sync --recursive + git -c protocol.file.allow=never submodule update --init --recursive --jobs 8 + python3 ops/ci/runtime/contract-upgrades.py run --variant "$CI_CONTRACT_VARIANT" \ + --prepared "$COMPILED" --block "$PINNED_BLOCK" + env: + CI_COMMIT_SHA: ${{ params.commit-sha }} + CI_BRANCH: ${{ params.branch }} + CI_CONTRACT_PROVIDER: rwx + COMPILED: ${{ params.compiled }} + PINNED_BLOCK: ${{ params.pinned-block }} + OP_CI_MAINNET_L1_ARCHIVE_RPC_URL: ${{ vaults.optimism-go-tests-rpc-shadow.secrets.OP_CI_MAINNET_L1_ARCHIVE_RPC_URL }} + CI_CONTRACT_VARIANT: ${{ params.variant }} + # Fresh verdicts retain read-only access to protected fork-state caches. + RWX_RUN_ID: + cache-key: included + RWX_TASK_ATTEMPT_NUMBER: + cache-key: included + tool-cache: ${{ params.cache-key }} + timeout: 60m + runner: + cpus: 16 + memory: 32gb + outputs: + filesystem: + filter: + workspace: [] + system: [~/.foundry/cache/rpc] + test-results: + - path: .ci/contract-upgrades/${{ params.variant }}/run/original.junit.xml + options: + language: Solidity + framework: Foundry + artifacts: + - key: reports + path: .ci/contract-upgrades/${{ params.variant }}/run diff --git a/.rwx/packages/contracts-compile.yml b/.rwx/packages/contracts-compile.yml new file mode 100644 index 00000000000..a1e00ca6e9f --- /dev/null +++ b/.rwx/packages/contracts-compile.yml @@ -0,0 +1,44 @@ +package: + parameters: + commit-sha: + required: true + branch: + required: true + build-probe: + required: true + cache-key: + required: true + target-sha: + default: "" + suite: + required: true + feature: + required: true +tasks: + - key: build + use: package.use + run: | + export GOMODCACHE="$PWD/.ci/go-cache/contract-suites/modules" + export GOCACHE="$PWD/.ci/go-cache/contract-suites/build" + python3 ops/ci/runtime/contract-suites.py prepare --suite "$CI_CONTRACT_SUITE" --feature "$CI_CONTRACT_FEATURE" + env: + CI_COMMIT_SHA: ${{ params.commit-sha }} + CI_BRANCH: ${{ params.branch }} + CI_CONTRACT_PROVIDER: rwx + BUILD_PROBE: ${{ params.build-probe }} + CI_CONTRACT_TARGET_SHA: ${{ params.target-sha }} + CI_CONTRACT_SUITE: ${{ params.suite }} + CI_CONTRACT_FEATURE: ${{ params.feature }} + tool-cache: ${{ params.cache-key }} + timeout: 40m + runner: + cpus: 16 + memory: 32gb + outputs: + filesystem: + filter: + workspace: [packages/contracts-bedrock/forge-artifacts, packages/contracts-bedrock/cache/solidity-files-cache.json, packages/contracts-bedrock/artifacts/build-info, packages/contracts-bedrock/scripts/go-ffi/go-ffi, .ci/go-cache/contract-suites/build, '.ci/contract-suites'] + system: [] + artifacts: + - key: compiled + path: .ci/contract-suites/${{ params.suite }}-${{ params.feature }}/prepare diff --git a/.rwx/packages/contracts-verdict.yml b/.rwx/packages/contracts-verdict.yml new file mode 100644 index 00000000000..e6bdef9b12d --- /dev/null +++ b/.rwx/packages/contracts-verdict.yml @@ -0,0 +1,54 @@ +package: + parameters: + commit-sha: + required: true + branch: + required: true + compiled: + required: true + cache-key: + required: true + target-sha: + default: "" + suite: + required: true + feature: + required: true +tasks: + - key: run + use: package.use + run: | + export GOMODCACHE="$PWD/.ci/go-cache/contract-suites/modules" + export GOCACHE="$PWD/.ci/go-cache/contract-suites-runtime/build" + python3 ops/ci/runtime/contract-suites.py run --suite "$CI_CONTRACT_SUITE" --feature "$CI_CONTRACT_FEATURE" --prepared "$COMPILED" + env: + CI_COMMIT_SHA: ${{ params.commit-sha }} + CI_BRANCH: ${{ params.branch }} + CI_CONTRACT_PROVIDER: rwx + COMPILED: ${{ params.compiled }} + RWX_RUN_ID: + cache-key: included + RWX_TASK_ATTEMPT_NUMBER: + cache-key: included + CI_CONTRACT_TARGET_SHA: ${{ params.target-sha }} + CI_CONTRACT_SUITE: ${{ params.suite }} + CI_CONTRACT_FEATURE: ${{ params.feature }} + cache: false + tool-cache: ${{ params.cache-key }} + timeout: 60m + runner: + cpus: 16 + memory: 32gb + outputs: + filesystem: + filter: + workspace: [.ci/go-cache/contract-suites-runtime/build] + system: [] + test-results: + - path: .ci/contract-suites/${{ params.suite }}-${{ params.feature }}/run/original.junit.xml + options: + language: Solidity + framework: Foundry + artifacts: + - key: reports + path: .ci/contract-suites/${{ params.suite }}-${{ params.feature }}/run diff --git a/.rwx/packages/go-contracts.yml b/.rwx/packages/go-contracts.yml new file mode 100644 index 00000000000..18f942e97f0 --- /dev/null +++ b/.rwx/packages/go-contracts.yml @@ -0,0 +1,29 @@ +package: + parameters: + commit-sha: + cache-epoch: + build-probe: + target-cache-mode: +tasks: + - key: build + use: package.use + run: mise exec -- bash ops/ci/runtime/go-dependencies.sh contracts + env: + CI_GO_REUSABLE_DEPENDENCY: "1" + CI_COMMIT_SHA: ${{ params.commit-sha }} + BUILD_PROBE: ${{ params.build-probe }} + TARGET_CACHE_MODE: ${{ params.target-cache-mode }} + # Keep artifacts from the former full test-graph build out of this baseline. + tool-cache: go-full-contracts-ci-source-scripts-${{ params.cache-epoch }} + timeout: 90m + runner: + cpus: 4 + memory: 8gb + outputs: + filesystem: + filter: + workspace: [packages/contracts-bedrock/cache, packages/contracts-bedrock/artifacts, packages/contracts-bedrock/forge-artifacts, .ci/go-cache/full, .ci/go-tests/dependencies/contracts] + system: [] + artifacts: + - key: dependency + path: .ci/go-tests/dependencies/contracts diff --git a/.rwx/packages/go-go.yml b/.rwx/packages/go-go.yml new file mode 100644 index 00000000000..7de6d1e8fc8 --- /dev/null +++ b/.rwx/packages/go-go.yml @@ -0,0 +1,28 @@ +package: + parameters: + commit-sha: + cache-epoch: + build-probe: + target-cache-mode: +tasks: + - key: build + use: package.use + run: mise exec -- bash ops/ci/runtime/go-dependencies.sh go + env: + CI_GO_REUSABLE_DEPENDENCY: "1" + CI_COMMIT_SHA: ${{ params.commit-sha }} + BUILD_PROBE: ${{ params.build-probe }} + TARGET_CACHE_MODE: ${{ params.target-cache-mode }} + tool-cache: go-full-dependencies-${{ params.cache-epoch }} + timeout: 90m + runner: + cpus: 2 + memory: 4gb + outputs: + filesystem: + filter: + workspace: [.ci/go-cache/full, .ci/go-tests/dependencies/go] + system: [] + artifacts: + - key: dependency + path: .ci/go-tests/dependencies/go diff --git a/.rwx/packages/go-kona.yml b/.rwx/packages/go-kona.yml new file mode 100644 index 00000000000..c57b190a831 --- /dev/null +++ b/.rwx/packages/go-kona.yml @@ -0,0 +1,28 @@ +package: + parameters: + commit-sha: + cache-epoch: + build-probe: + target-cache-mode: +tasks: + - key: build + use: package.use + run: mise exec -- bash ops/ci/runtime/go-dependencies.sh kona + env: + CI_GO_REUSABLE_DEPENDENCY: "1" + CI_COMMIT_SHA: ${{ params.commit-sha }} + BUILD_PROBE: ${{ params.build-probe }} + TARGET_CACHE_MODE: ${{ params.target-cache-mode }} + tool-cache: kona-release-${{ params.cache-epoch }} + timeout: 90m + runner: + cpus: 8 + memory: 16gb + outputs: + filesystem: + filter: + workspace: [rust/target, .ci/rust-cache, .ci/go-tests/dependencies/kona] + system: [] + artifacts: + - key: dependency + path: .ci/go-tests/dependencies/kona diff --git a/.rwx/packages/go-modules.yml b/.rwx/packages/go-modules.yml new file mode 100644 index 00000000000..33c74fcab83 --- /dev/null +++ b/.rwx/packages/go-modules.yml @@ -0,0 +1,33 @@ +# Modules only: Cannon's Circle job does not embed generated Cannon binaries. +package: + parameters: + commit-sha: + branch: + cache-epoch: +tasks: + - key: build + use: package.use + run: | + export GOMODCACHE="$PWD/.ci/go-cache/pr-checks/modules" + mkdir -p "$GOMODCACHE" + python3 ops/ci/runtime/pr-checks.py go-modules + python3 ops/ci/runtime/go-artifacts.py pack go-modules .ci/go-cache/pr-checks/modules + env: + CI_COMMIT_SHA: ${{ params.commit-sha }} + CI_BRANCH: ${{ params.branch }} + CI_CHECK_PROVIDER: rwx + tool-cache: pr-checks-go-modules-${{ params.cache-epoch }} + timeout: 30m + runner: + cpus: 2 + memory: 4gb + outputs: + filesystem: + filter: + workspace: [.ci/go-cache/pr-checks/modules, .ci/go-tests/dependencies/go-modules] + system: [] + artifacts: + - key: dependency + path: .ci/go-tests/dependencies/go-modules + - key: preparation + path: .ci/pr-checks/go-modules diff --git a/.rwx/packages/go-op-reth.yml b/.rwx/packages/go-op-reth.yml new file mode 100644 index 00000000000..8c7a7e1ce77 --- /dev/null +++ b/.rwx/packages/go-op-reth.yml @@ -0,0 +1,30 @@ +package: + parameters: + commit-sha: + cache-epoch: + build-probe: + target-cache-mode: +tasks: + - key: build + use: package.use + run: mise exec -- bash ops/ci/runtime/go-dependencies.sh op-reth + env: + CI_GO_REUSABLE_DEPENDENCY: "1" + CI_COMMIT_SHA: ${{ params.commit-sha }} + BUILD_PROBE: ${{ params.build-probe }} + TARGET_CACHE_MODE: ${{ params.target-cache-mode }} + tool-cache: op-reth-release-${{ params.cache-epoch }} + timeout: 90m + runner: + cpus: 8 + memory: 16gb + outputs: + filesystem: + filter: + workspace: [rust/target, .ci/rust-cache, .ci/op-reth/release-build, .ci/go-tests/dependencies/op-reth] + system: [] + artifacts: + - key: dependency + path: .ci/go-tests/dependencies/op-reth + - key: release-binaries + path: .ci/op-reth/release-build diff --git a/.rwx/packages/go-prestate.yml b/.rwx/packages/go-prestate.yml new file mode 100644 index 00000000000..1601bdd28f8 --- /dev/null +++ b/.rwx/packages/go-prestate.yml @@ -0,0 +1,29 @@ +package: + parameters: + commit-sha: + cache-epoch: + build-probe: + target-cache-mode: +tasks: + - key: build + use: package.use + run: mise exec -- bash ops/ci/runtime/go-dependencies.sh prestate + env: + CI_GO_REUSABLE_DEPENDENCY: "1" + CI_COMMIT_SHA: ${{ params.commit-sha }} + BUILD_PROBE: ${{ params.build-probe }} + TARGET_CACHE_MODE: ${{ params.target-cache-mode }} + tool-cache: go-full-prestate-${{ params.cache-epoch }} + docker: preserve-data + timeout: 90m + runner: + cpus: 4 + memory: 16gb + outputs: + filesystem: + filter: + workspace: [rust/kona/prestate-artifacts-*, .ci/go-tests/dependencies/prestate] + system: [] + artifacts: + - key: dependency + path: .ci/go-tests/dependencies/prestate diff --git a/.rwx/packages/go-sp1-executor.yml b/.rwx/packages/go-sp1-executor.yml new file mode 100644 index 00000000000..f46d02ebf4f --- /dev/null +++ b/.rwx/packages/go-sp1-executor.yml @@ -0,0 +1,27 @@ +package: + parameters: + commit-sha: + cache-epoch: + build-probe: + target-cache-mode: +tasks: + - key: build + use: package.use + run: mise exec -- bash ops/ci/runtime/go-dependencies.sh sp1-executor + env: + CI_COMMIT_SHA: ${{ params.commit-sha }} + BUILD_PROBE: ${{ params.build-probe }} + TARGET_CACHE_MODE: ${{ params.target-cache-mode }} + tool-cache: sp1-executor-release-${{ params.cache-epoch }} + timeout: 90m + runner: + cpus: 8 + memory: 16gb + outputs: + filesystem: + filter: + workspace: [rust/target, .ci/rust-cache, .ci/go-tests/dependencies/sp1-executor] + system: [] + artifacts: + - key: dependency + path: .ci/go-tests/dependencies/sp1-executor diff --git a/.rwx/packages/go-test-compile.yml b/.rwx/packages/go-test-compile.yml new file mode 100644 index 00000000000..7290cd6748b --- /dev/null +++ b/.rwx/packages/go-test-compile.yml @@ -0,0 +1,43 @@ +package: + parameters: + commit-sha: + required: true + shard-index: + required: true + shard-total: + required: true + test-parallel: + required: true + build-probe: + required: true + cache-key: + required: true +tasks: + - key: build + use: package.use + run: | + if ! git cat-file -e "$CI_COMMIT_SHA^{commit}"; then git fetch --no-tags origin "$CI_COMMIT_SHA"; fi + git reset --hard "$CI_COMMIT_SHA" + git submodule sync --recursive + git submodule update --init --recursive --jobs 8 + git rev-parse HEAD >packages/contracts-bedrock/.gitcommit + mise exec -- bash ops/ci/runtime/go-full-tests.sh build + env: + CI_COMMIT_SHA: ${{ params.commit-sha }} + CI_SHARD_INDEX: ${{ params.shard-index }} + CI_SHARD_TOTAL: ${{ params.shard-total }} + PARALLEL: ${{ params.test-parallel }} + BUILD_PROBE: ${{ params.build-probe }} + tool-cache: ${{ params.cache-key }} + timeout: 60m + runner: + cpus: 8 + memory: 16gb + outputs: + filesystem: + filter: + workspace: [.ci/go-tests/build] + system: [] + artifacts: + - key: binaries + path: .ci/go-tests/build diff --git a/.rwx/packages/go-test-verdict.yml b/.rwx/packages/go-test-verdict.yml new file mode 100644 index 00000000000..5fb3f473b76 --- /dev/null +++ b/.rwx/packages/go-test-verdict.yml @@ -0,0 +1,86 @@ +package: + parameters: + commit-sha: + required: true + branch: + required: true + shard-index: + required: true + shard-total: + required: true + test-parallel: + required: true + go-artifact: + default: .ci/go-tests/dependencies/go + contract-artifact: + default: .ci/go-tests/dependencies/contracts + kona-artifact: + default: .ci/go-tests/dependencies/kona + reth-artifact: + default: .ci/go-tests/dependencies/op-reth + prestate-artifact: + default: .ci/go-tests/dependencies/prestate + cache-key: + required: true +tasks: + - key: run + use: package.use + docker: true + run: | + if ! git cat-file -e "$CI_COMMIT_SHA^{commit}"; then git fetch --no-tags origin "$CI_COMMIT_SHA"; fi + git reset --hard "$CI_COMMIT_SHA" + git submodule sync --recursive + git submodule update --init --recursive --jobs 8 + git rev-parse HEAD >packages/contracts-bedrock/.gitcommit + for dependency in go contracts kona op-reth prestate; do + case "$dependency" in + go) artifact="$GO_ARTIFACT" ;; + contracts) artifact="$CONTRACT_ARTIFACT" ;; + kona) artifact="$KONA_ARTIFACT" ;; + op-reth) artifact="$RETH_ARTIFACT" ;; + prestate) artifact="$PRESTATE_ARTIFACT" ;; + esac + python3 ops/ci/runtime/go-artifacts.py restore "$dependency" "$artifact" + done + export RUST_BINARY_PATH_OP_RETH="$PWD/rust/target/release/op-reth" + # A missing engine must fail instead of building one locally, as on Circle. + export RUST_BINARY_PATH_OP_RETH_TEST_ENGINE="$PWD/rust/target/release/op-reth-test-engine" + export REQUIRE_RUST_ENGINE=1 + mise exec -- bash ops/ci/runtime/go-full-tests.sh run + env: + CI_COMMIT_SHA: ${{ params.commit-sha }} + CIRCLE_BRANCH: ${{ params.branch }} + CI_SHARD_INDEX: ${{ params.shard-index }} + CI_SHARD_TOTAL: ${{ params.shard-total }} + PARALLEL: ${{ params.test-parallel }} + GO_ARTIFACT: ${{ params.go-artifact }} + CONTRACT_ARTIFACT: ${{ params.contract-artifact }} + KONA_ARTIFACT: ${{ params.kona-artifact }} + RETH_ARTIFACT: ${{ params.reth-artifact }} + PRESTATE_ARTIFACT: ${{ params.prestate-artifact }} + OP_CI_MAINNET_L1_ARCHIVE_RPC_URL: ${{ vaults.optimism-go-tests-rpc-shadow.secrets.OP_CI_MAINNET_L1_ARCHIVE_RPC_URL }} + OP_CI_SEPOLIA_L1_ARCHIVE_RPC_URL: ${{ vaults.optimism-go-tests-rpc-shadow.secrets.OP_CI_SEPOLIA_L1_ARCHIVE_RPC_URL }} + cache: false + tool-cache: ${{ params.cache-key }} + timeout: 60m + runner: + cpus: 8 + memory: 16gb + outputs: + filesystem: + filter: + workspace: [.ci/go-cache/full/run] + system: [] + test-results: + - path: tmp/testlogs/native.json + options: + language: Go + framework: go test + artifacts: + - key: junit + path: tmp/test-results + - key: go-json + path: tmp/testlogs/log.json + - key: test-logs + path: tmp/testlogs + filter: ['!.ci/go-cache/full/build', '!.ci/go-cache/full/dependencies', '!.ci/go-cache/full/run', '!.ci/rust-cache', '!rust/target', '!packages/contracts-bedrock/cache', '!packages/contracts-bedrock/artifacts', '!packages/contracts-bedrock/forge-artifacts', '!op-deployer/pkg/deployer/artifacts/forge-artifacts'] diff --git a/.rwx/packages/kontrol-contracts.yml b/.rwx/packages/kontrol-contracts.yml new file mode 100644 index 00000000000..6dd6d6d1a55 --- /dev/null +++ b/.rwx/packages/kontrol-contracts.yml @@ -0,0 +1,23 @@ +package: + parameters: + commit-sha: + cache-epoch: +tasks: + - key: build + use: package.use + run: python3 ops/ci/runtime/kontrol-contracts.py + env: + CI_COMMIT_SHA: ${{ params.commit-sha }} + tool-cache: kontrol-contracts-${{ params.cache-epoch }} + timeout: 90m + runner: + cpus: 2 + memory: 8gb + outputs: + filesystem: + filter: + workspace: [packages/contracts-bedrock/cache, packages/contracts-bedrock/artifacts, packages/contracts-bedrock/forge-artifacts, .ci/go-cache/full, .ci/kontrol-contracts] + system: [] + artifacts: + - key: dependency + path: .ci/go-tests/dependencies/contracts-kontrol diff --git a/.rwx/packages/nut-tools.yml b/.rwx/packages/nut-tools.yml new file mode 100644 index 00000000000..07e1894280f --- /dev/null +++ b/.rwx/packages/nut-tools.yml @@ -0,0 +1,27 @@ +# Reusable historical generators and immutable Solidity compiler binaries. +package: + parameters: + commit-sha: + branch: + cache-epoch: +tasks: + - key: prepare + use: package.use + run: python3 ops/ci/runtime/nut-provenance.py --provider rwx --full --prepare-tools + env: + CI: "true" + CI_COMMIT_SHA: ${{ params.commit-sha }} + CI_BRANCH: ${{ params.branch }} + RWX_RUN_ID: + cache-key: excluded + RWX_TASK_ATTEMPT_NUMBER: + cache-key: excluded + tool-cache: nut-provenance-historical-tools-${{ params.cache-epoch }} + timeout: 30m + runner: + cpus: 2 + memory: 8gb + outputs: + artifacts: + - key: tools + path: .ci/nut-provenance/toolchain diff --git a/.rwx/packages/rust-e2e-contracts.yml b/.rwx/packages/rust-e2e-contracts.yml new file mode 100644 index 00000000000..0ba56b78b25 --- /dev/null +++ b/.rwx/packages/rust-e2e-contracts.yml @@ -0,0 +1,27 @@ +package: + parameters: + commit-sha: + cache-epoch: + build-probe: + target-cache-mode: +tasks: + - key: build + use: package.use + run: mise exec -- bash ops/ci/runtime/go-dependencies.sh contracts-e2e + env: + CI_COMMIT_SHA: ${{ params.commit-sha }} + BUILD_PROBE: ${{ params.build-probe }} + TARGET_CACHE_MODE: ${{ params.target-cache-mode }} + tool-cache: go-rust-e2e-contracts-ci-${{ params.cache-epoch }} + timeout: 90m + runner: + cpus: 4 + memory: 8gb + outputs: + filesystem: + filter: + workspace: [packages/contracts-bedrock/cache, packages/contracts-bedrock/artifacts, packages/contracts-bedrock/forge-artifacts, .ci/go-cache/full, .ci/go-tests/dependencies/contracts-e2e] + system: [] + artifacts: + - key: dependency + path: .ci/go-tests/dependencies/contracts-e2e diff --git a/.rwx/packages/rust-e2e-release.yml b/.rwx/packages/rust-e2e-release.yml new file mode 100644 index 00000000000..67f33db3a06 --- /dev/null +++ b/.rwx/packages/rust-e2e-release.yml @@ -0,0 +1,28 @@ +package: + parameters: + commit-sha: + cache-epoch: +tasks: + - key: build + use: package.use + run: bash ops/ci/runtime/rust-e2e-release.sh + env: + CI_RUST_PROVIDER: rwx + CI_COMMIT_SHA: ${{ params.commit-sha }} + tool-cache: rust-e2e-workspace-release-${{ params.cache-epoch }} + timeout: 120m + runner: + cpus: 16 + memory: 32gb + outputs: + filesystem: + filter: + workspace: [.ci/rust-cache, rust/target] + system: [] + test-results: + - path: .ci/rust-workspace/e2e-release/checks.junit.xml + artifacts: + - key: reports + path: .ci/rust-workspace/e2e-release + - key: dependency + path: .ci/go-tests/dependencies/rust-e2e-release diff --git a/.rwx/packages/toolchain-common.yml b/.rwx/packages/toolchain-common.yml new file mode 100644 index 00000000000..28fdee9e5da --- /dev/null +++ b/.rwx/packages/toolchain-common.yml @@ -0,0 +1,9 @@ +package: true +tasks: + - key: prepare + use: package.use + run: | + bash ops/ci/runtime/rwx-prepare.sh + filter: + workspace: [mise.toml, ops/ci/runtime/apt-install.sh, ops/ci/runtime/rwx-prepare.sh] + timeout: 30m diff --git a/.rwx/packages/toolchain-foundry.yml b/.rwx/packages/toolchain-foundry.yml new file mode 100644 index 00000000000..a94dafe92fa --- /dev/null +++ b/.rwx/packages/toolchain-foundry.yml @@ -0,0 +1,30 @@ +package: + parameters: + mode: + required: true +tasks: + - key: prepare + use: package.use + run: | + bash ops/ci/runtime/rwx-contracts-prepare.sh tools + case "$FOUNDRY_TOOL_MODE" in + compiler) ;; + anvil) mise install anvil ;; + analysis) + mise install uv + PATH="$(mise bin-paths | paste -sd: -):$PATH" + export PATH + # The pinned Semgrep's MCP dependency imports a Pydantic private API + # removed in later releases. Keep this constraint in its own tool env. + semgrep_version="$(mise tool pipx:semgrep --requested)" + mise install "pipx:semgrep[uvx_args=--with pydantic==2.11.10]@$semgrep_version" + printf '%s:%s\n' "$(mise bin-paths | paste -sd: -)" "$PATH" >"$RWX_ENV/PATH" + mise exec -- semgrep --version + ;; + *) echo "Unknown Foundry tool mode: $FOUNDRY_TOOL_MODE" >&2; exit 1 ;; + esac + env: + FOUNDRY_TOOL_MODE: ${{ params.mode }} + filter: + workspace: [mise.toml, ops/ci/runtime/apt-install.sh, ops/ci/runtime/rwx-prepare.sh, ops/ci/runtime/rwx-contracts-prepare.sh] + timeout: 30m diff --git a/.rwx/packages/toolchain-go.yml b/.rwx/packages/toolchain-go.yml new file mode 100644 index 00000000000..28744221e39 --- /dev/null +++ b/.rwx/packages/toolchain-go.yml @@ -0,0 +1,14 @@ +# Pinned Go tool layers; language installation remains separate from source and verdicts. +package: + parameters: + mode: + required: true + timeout: + default: 30m +tasks: + - key: prepare + use: package.use + run: bash ops/ci/runtime/rwx-prepare.sh "$GO_TOOL_MODE" + env: + GO_TOOL_MODE: ${{ params.mode }} + timeout: ${{ params.timeout }} diff --git a/.rwx/packages/toolchain-rust.yml b/.rwx/packages/toolchain-rust.yml new file mode 100644 index 00000000000..f2f91df06d6 --- /dev/null +++ b/.rwx/packages/toolchain-rust.yml @@ -0,0 +1,29 @@ +package: + parameters: + mode: + required: true +tasks: + - key: prepare + use: package.use + run: | + bash ops/ci/runtime/rwx-prepare.sh rust + mise exec -- bash ops/ci/runtime/rwx-rust-prepare.sh + case "$RUST_TOOL_MODE" in + release) ;; + e2e) bash ops/ci/runtime/apt-install.sh m4 file ;; + workspace|sp1) + bash ops/ci/runtime/apt-install.sh m4 file + if [[ "$RUST_TOOL_MODE" == workspace ]]; then + mise install github:est31/cargo-udeps github:taiki-e/cargo-hack + else + mise install github:succinctlabs/sp1 + fi + printf '%s:%s\n' "$(mise bin-paths | paste -sd: -)" "$PATH" >"$RWX_ENV/PATH" + ;; + *) echo "Unknown Rust tool mode: $RUST_TOOL_MODE" >&2; exit 1 ;; + esac + env: + RUST_TOOL_MODE: ${{ params.mode }} + filter: + workspace: [mise.toml, ops/ci/runtime/apt-install.sh, ops/ci/runtime/rwx-prepare.sh, ops/ci/runtime/rwx-rust-prepare.sh, ops/ci/runtime/op-reth-shadow.sh, ops/ci/runtime/op-reth-report.py, ops/ci/runtime/rust-target-cache.py] + timeout: 30m diff --git a/.rwx/pilot.yml b/.rwx/pilot.yml new file mode 100644 index 00000000000..826773f97ae --- /dev/null +++ b/.rwx/pilot.yml @@ -0,0 +1,192 @@ +# Optional shadow checks. CircleCI remains responsible for the required gates. +# Pushes include Bailiff's human-authorized external-fork branches and GitHub's +# gh-readonly-queue branches. Avoid a second pull_request trigger for those SHAs. +on: + cache-rebuild: + if: ${{ event.git.branch == 'develop' }} + target: [go-lint-tools, rust-fmt-tools] + init: + commit-sha: ${{ event.git.sha }} + branch: ${{ event.git.branch }} + tag: "" + # Automatic pushes are coordinated by pr-gates.yml; CLI and warming remain. + cli: + init: + commit-sha: ${{ event.git.sha }} + branch: ${{ event.git.branch }} + tag: "" + +base: + image: ubuntu:24.04@sha256:008173c23f95b170204355c12626cb5a965d779a7e1283b09e9cffbb1bf33ca3 + config: rwx/base 1.2.0 + arch: x86_64 + +defaults: + runner: + cpus: 2 + memory: 8gb + +tasks: + # This public checkout deliberately has no GitHub token or vault access. + - key: code + call: git/clone 2.2.0 + with: + repository: https://github.com/ethereum-optimism/optimism.git + ref: ${{ init.commit-sha }} + preserve-git-dir: true + fetch-full-depth: true + submodules: false + + - key: bootstrap-inputs + use: code + run: 'true' + filter: [mise.toml, ops/ci/runtime] + outputs: + filesystem: + filter: + workspace: [mise.toml, ops/ci/runtime/apt-install.sh, ops/ci/runtime/rwx-prepare.sh, ops/ci/runtime/rwx-contracts-prepare.sh, ops/ci/runtime/rwx-rust-prepare.sh, ops/ci/runtime/op-reth-shadow.sh, ops/ci/runtime/op-reth-report.py, ops/ci/runtime/rust-target-cache.py] + system: [] + artifacts: + - key: mise-config + path: mise.toml + - key: ci-scripts + path: ops/ci/runtime + - key: apt-script + path: ops/ci/runtime/apt-install.sh + + - key: mise + call: mise/install 1.1.0 + with: + mise-version: "2026.2.2" + install: "false" + + # Artifact dependencies avoid inheriting the checkout's Git history into + # reusable tools. Language toolchains are added only by their own workload. + - key: tools + use: [mise, bootstrap-inputs] + call: ${{ run.dir }}/packages/toolchain-common.yml + + - key: go-lint-tools + use: tools + run: bash ops/ci/runtime/rwx-prepare.sh go-lint + timeout: 30m + + - key: rust-fmt-tools + use: tools + run: bash ops/ci/runtime/rwx-prepare.sh rust + timeout: 30m + + - key: route + use: [code, tools] + run: bash ops/ci/runtime/rwx-metadata.sh + env: + CI_EVENT: push + CI_BRANCH: ${{ init.branch }} + CI_TAG: ${{ init.tag }} + CI_COMMIT_SHA: ${{ init.commit-sha }} + cache: false + timeout: 10m + outputs: + artifacts: + - key: routing + path: .ci/pipeline-parameters.json + + - key: routing-tests + use: [code, tools] + run: | + mise exec -- bash ops/ci/tests/test-decision-tree.sh + mise exec -- python -m unittest discover -s ops/ci/tests -p 'test_rwx_metadata.py' + mise exec -- python ops/ci/migration/tests/test_compare_ci.py + cache: false + timeout: 10m + outputs: + filesystem: false + + # Preserve the superchain bundle's existing verification before Go consumes it. + - key: prep-superchain + use: [code, go-lint-tools] + if: ${{ tasks.route.values.run-main == 'true' }} + run: mise exec -- just build-superchain-go + cache: false + timeout: 15m + runner: + cpus: 2 + memory: 4gb + + - key: go-lint + use: prep-superchain + if: ${{ tasks.route.values.run-main == 'true' }} + run: | + mise exec -- just lint-go + mise exec -- bash ops/prestate-reproducibility/test-build-prestates.sh + cache: false + timeout: 30m + runner: + cpus: 4 + memory: 8gb + outputs: + filesystem: false + + - key: rust-fmt + use: [code, rust-fmt-tools] + if: ${{ tasks.route.values.run-rust-ci == 'true' }} + run: | + mise exec -- just update-superchain-registry-submodule + cd rust + mise exec -- just fmt-check + mise exec -- just check-upstream-mirrors + cache: false + timeout: 20m + runner: + cpus: 2 + memory: 4gb + outputs: + filesystem: false + + # Terminal task states preserve exact Rust dependencies without Main-only failures. + - key: rust-gate-receipt + use: [code, tools] + after: ${{ (rust-fmt.succeeded || rust-fmt.failed || rust-fmt.skipped) }} + run: python3 ops/ci/runtime/pr-gate.py receipt rust-fmt + env: + CI_COMMIT_SHA: ${{ init.commit-sha }} + CI_BRANCH: ${{ init.branch }} + GROUP_SELECTED: ${{ tasks.route.values.run-rust-ci }} + RWX_RUN_ID: + cache-key: included + RWX_TASK_ATTEMPT_NUMBER: + cache-key: included + TASK_RUST_FMT_SUCCEEDED: ${{ tasks.rust-fmt.succeeded }} + TASK_RUST_FMT_FAILED: ${{ tasks.rust-fmt.failed }} + TASK_RUST_FMT_SKIPPED: ${{ tasks.rust-fmt.skipped }} + cache: false + timeout: 10m + outputs: + filesystem: false + artifacts: + - key: receipt + path: .ci/pr-gates/groups/rust-fmt + + # Exact Main dependency states; unrelated workload failures stay outside this gate. + - key: main-gate-receipt + use: [code, tools] + after: ${{ (go-lint.succeeded || go-lint.failed || go-lint.skipped) }} + run: python3 ops/ci/runtime/pr-gate.py receipt main-pilot + env: + CI_COMMIT_SHA: ${{ init.commit-sha }} + CI_BRANCH: ${{ init.branch }} + GROUP_SELECTED: ${{ tasks.route.values.run-main }} + RWX_RUN_ID: + cache-key: included + RWX_TASK_ATTEMPT_NUMBER: + cache-key: included + TASK_GO_LINT_SUCCEEDED: ${{ tasks.go-lint.succeeded }} + TASK_GO_LINT_FAILED: ${{ tasks.go-lint.failed }} + TASK_GO_LINT_SKIPPED: ${{ tasks.go-lint.skipped }} + cache: false + timeout: 10m + outputs: + filesystem: false + artifacts: + - key: receipt + path: .ci/pr-gates/groups/main-pilot diff --git a/.rwx/pr-checks.yml b/.rwx/pr-checks.yml new file mode 100644 index 00000000000..977d224f6a7 --- /dev/null +++ b/.rwx/pr-checks.yml @@ -0,0 +1,635 @@ +# Complete remaining PR checks, with Circle continuing to own required gates. +on: + cache-rebuild: + if: ${{ event.git.branch == 'develop' }} + target: [go-modules, contract-tools, main-tools, main-superchain, static-tools] + init: + commit-sha: ${{ event.git.sha }} + branch: ${{ event.git.branch }} + tag: "" + cache-warm: "true" + cache-epoch: v1 + cli: + init: + commit-sha: ${{ event.git.sha }} + branch: ${{ event.git.branch }} + tag: "" + cache-warm: "false" + cache-epoch: v1 + +tool-cache: + vault: optimism-op-reth-shadow + +base: + image: ubuntu:24.04@sha256:008173c23f95b170204355c12626cb5a965d779a7e1283b09e9cffbb1bf33ca3 + config: rwx/base 1.2.0 + arch: x86_64 + +defaults: + runner: + cpus: 2 + memory: 8gb + +tasks: + - key: code + call: git/clone 2.2.0 + with: + repository: https://github.com/ethereum-optimism/optimism.git + ref: ${{ init.commit-sha }} + preserve-git-dir: true + fetch-full-depth: true + submodules: false + + - key: bootstrap-inputs + use: code + run: 'true' + filter: [mise.toml, ops/ci/runtime] + outputs: + filesystem: + filter: + workspace: [mise.toml, ops/ci/runtime/apt-install.sh, ops/ci/runtime/rwx-prepare.sh, ops/ci/runtime/rwx-contracts-prepare.sh, ops/ci/runtime/rwx-rust-prepare.sh, ops/ci/runtime/op-reth-shadow.sh, ops/ci/runtime/op-reth-report.py, ops/ci/runtime/rust-target-cache.py] + system: [] + artifacts: + - key: mise-config + path: mise.toml + - key: ci-scripts + path: ops/ci/runtime + - key: apt-script + path: ops/ci/runtime/apt-install.sh + + - key: mise + call: mise/install 1.1.0 + with: + mise-version: "2026.2.2" + install: "false" + + - key: tools + use: [mise, bootstrap-inputs] + call: ${{ run.dir }}/packages/toolchain-common.yml + + - key: route + use: [code, tools] + run: | + bash ops/ci/runtime/rwx-metadata.sh + jq -er '."c-run_contracts_feature_tests" | if type == "boolean" then tostring else error("missing contracts route") end' \ + .ci/pipeline-parameters.json >"$RWX_VALUES/run-contracts" + env: + CI_EVENT: push + CI_CACHE_WARM: ${{ init.cache-warm }} + CI_BRANCH: ${{ init.branch }} + CI_TAG: ${{ init.tag }} + CI_COMMIT_SHA: ${{ init.commit-sha }} + cache: false + timeout: 10m + outputs: + filesystem: false + artifacts: + - key: routing + path: .ci/pipeline-parameters.json + + - key: go-tools + use: tools + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' || tasks.route.values.run-contracts == 'true' }} + call: ${{ run.dir }}/packages/toolchain-go.yml + with: + mode: go + + - key: contract-tools + use: [bootstrap-inputs, tools] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-contracts == 'true' }} + call: ${{ run.dir }}/packages/toolchain-foundry.yml + with: + mode: analysis + + - key: main-tools + use: go-tools + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + run: | + mise install ripgrep mockery + printf '%s:%s\n' "$(mise bin-paths | paste -sd: -)" "$PATH" >"$RWX_ENV/PATH" + timeout: 30m + + - key: static-tools + use: tools + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + run: | + mise install uv shellcheck shfmt + PATH="$(mise bin-paths | paste -sd: -):$PATH" + export PATH + mise install pipx:semgrep@1.178.0 + mise exec shellcheck shfmt pipx:semgrep@1.178.0 -- sh -c 'printf "%s\n" "$PATH"' >"$RWX_ENV/PATH" + timeout: 30m + + - key: static-helper-tests + use: [code, static-tools] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-main == 'true' }} + run: | + RWX_LIVE_SHELL_FIXTURE=1 RWX_LIVE_SEMGREP_FIXTURE=1 python3 -m unittest discover -s ops/ci/tests -p 'test_static_checks.py' + RWX_LIVE_SHELL_FIXTURE=1 RWX_LIVE_SEMGREP_FIXTURE=1 python3 -m unittest discover -s ops/ci/migration/tests -p 'test_migration_static_checks.py' + python3 -m unittest discover -s ops/ci/migration/tests -p 'test_compare_static_checks.py' + env: + RWX_STATIC_FIXTURE_RETAIN_DIR: .ci/static-fixture-evidence + cache: false + timeout: 15m + outputs: + filesystem: false + artifacts: + - key: original-failure-fixtures + path: .ci/static-fixture-evidence + + - key: shell-check + use: [code, static-tools] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-main == 'true' }} + run: python3 ops/ci/runtime/static-checks.py shell-check + env: + CI_COMMIT_SHA: ${{ init.commit-sha }} + CI_BRANCH: ${{ init.branch }} + CI_CHECK_PROVIDER: rwx + cache: false + timeout: 20m + runner: + cpus: 4 + memory: 8gb + outputs: + filesystem: false + test-results: + - path: .ci/static-checks/shell-check/derived.junit.xml + artifacts: + - key: reports + path: .ci/static-checks/shell-check + + - key: shfmt-check + use: [code, static-tools] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-main == 'true' }} + run: just shfmt-check + cache: false + timeout: 10m + + - key: semgrep-test + use: [code, static-tools] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-main == 'true' }} + run: | + if [[ "$CI_BRANCH" != develop ]]; then + git fetch --no-tags origin develop + git update-ref refs/heads/develop FETCH_HEAD + fi + python3 ops/ci/runtime/static-checks.py semgrep-test + env: + CI_COMMIT_SHA: ${{ init.commit-sha }} + CI_BRANCH: ${{ init.branch }} + CI_CHECK_PROVIDER: rwx + cache: false + timeout: 20m + runner: + cpus: 8 + memory: 16gb + outputs: + filesystem: false + test-results: + - path: .ci/static-checks/semgrep-test/derived.junit.xml + artifacts: + - key: reports + path: .ci/static-checks/semgrep-test + + - key: semgrep-scan-local + use: [code, static-tools] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-main == 'true' }} + run: | + if [[ "$CI_BRANCH" != develop ]]; then + git fetch --no-tags origin develop + git update-ref refs/heads/develop FETCH_HEAD + fi + python3 ops/ci/runtime/static-checks.py semgrep-scan-local + env: + CI_COMMIT_SHA: ${{ init.commit-sha }} + CI_BRANCH: ${{ init.branch }} + CI_CHECK_PROVIDER: rwx + cache: false + timeout: 30m + runner: + cpus: 8 + memory: 16gb + outputs: + filesystem: false + test-results: + - path: .ci/static-checks/semgrep-scan-local/derived.junit.xml + artifacts: + - key: reports + path: .ci/static-checks/semgrep-scan-local + + - key: helper-tests + use: [code, go-tools] + if: ${{ init.cache-warm != 'true' && (tasks.route.values.run-main == 'true' || tasks.route.values.run-contracts == 'true') }} + run: | + RWX_LIVE_GO_FIXTURE=1 python3 -m unittest discover -s ops/ci/tests -p 'test_pr_checks.py' + python3 -m unittest discover -s ops/ci/migration/tests -p 'test_compare_pr_checks.py' + cache: false + timeout: 10m + outputs: + filesystem: false + + - key: go-modules + use: [code, go-tools] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' || tasks.route.values.run-contracts == 'true' }} + run: | + export GOMODCACHE="$PWD/.ci/go-cache/pr-checks/modules" + mkdir -p "$GOMODCACHE" + python3 ops/ci/runtime/pr-checks.py go-modules + env: + CI_COMMIT_SHA: ${{ init.commit-sha }} + CI_BRANCH: ${{ init.branch }} + CI_CHECK_PROVIDER: rwx + tool-cache: pr-checks-go-modules-${{ init.cache-epoch }} + timeout: 30m + runner: + cpus: 2 + memory: 4gb + outputs: + filesystem: + filter: + workspace: [.ci/go-cache/pr-checks/modules] + system: [] + artifacts: + - key: reports + path: .ci/pr-checks/go-modules + + - key: contracts-fast + use: [code, go-tools, go-modules, contract-tools] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-contracts == 'true' }} + run: | + export GOMODCACHE="$PWD/.ci/go-cache/pr-checks/modules" + export GOCACHE="$PWD/.ci/go-cache/pr-checks/fast-build" + git submodule sync --recursive + git -c protocol.file.allow=never submodule update --init --recursive --jobs 8 + python3 ops/ci/runtime/pr-checks.py contracts-fast + env: + CI_COMMIT_SHA: ${{ init.commit-sha }} + CI_BRANCH: ${{ init.branch }} + CI_CHECK_PROVIDER: rwx + RWX_RUN_ID: + cache-key: included + RWX_TASK_ATTEMPT_NUMBER: + cache-key: included + tool-cache: pr-checks-contracts-fast-${{ init.cache-epoch }} + timeout: 60m + runner: + cpus: 16 + memory: 32gb + outputs: + filesystem: + filter: + workspace: [packages/contracts-bedrock/forge-artifacts, packages/contracts-bedrock/cache/solidity-files-cache.json, packages/contracts-bedrock/artifacts/build-info, .ci/go-cache/pr-checks/fast-build] + system: [] + test-results: + - path: .ci/pr-checks/contracts-fast/checks.junit.xml + artifacts: + - key: reports + path: .ci/pr-checks/contracts-fast + + - key: main-helper-tests + use: [code, main-tools] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-main == 'true' }} + run: | + RWX_LIVE_MAIN_FIXTURE=1 python3 -m unittest discover -s ops/ci/tests -p 'test_main_checks.py' + RWX_LIVE_MAIN_FIXTURE=1 python3 -m unittest discover -s ops/ci/migration/tests -p 'test_migration_main_checks.py' + python3 -m unittest discover -s ops/ci/migration/tests -p 'test_compare_main_checks.py' + cache: false + timeout: 15m + outputs: + filesystem: false + + - key: main-superchain + use: [code, go-tools] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + run: python3 ops/ci/runtime/main-checks.py --prepare-superchain + env: + CI_COMMIT_SHA: ${{ init.commit-sha }} + timeout: 15m + runner: + cpus: 2 + memory: 4gb + outputs: + filesystem: + filter: + workspace: [op-core/superchain/bundle/superchain-configs.zip] + system: [] + artifacts: + - key: reports + path: .ci/main-checks/prep-superchain + + - key: todo-issues-check + use: [code, main-tools] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-main == 'true' }} + run: | + python3 ops/ci/runtime/main-checks.py todo-issues-check + env: + CI_COMMIT_SHA: ${{ init.commit-sha }} + CI_BRANCH: ${{ init.branch }} + CI_CHECK_PROVIDER: rwx + RWX_RUN_ID: + cache-key: included + RWX_TASK_ATTEMPT_NUMBER: + cache-key: included + cache: false + timeout: 30m + runner: + cpus: 4 + memory: 16gb + outputs: + filesystem: false + test-results: + - path: .ci/main-checks/todo-issues-check/check.junit.xml + artifacts: + - key: reports + path: .ci/main-checks/todo-issues-check + + - key: l2-chains-sync-check + use: [code, main-tools] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-main == 'true' }} + run: | + python3 ops/ci/migration/l2-chains-sync-check.py + env: + CI_COMMIT_SHA: ${{ init.commit-sha }} + CI_BRANCH: ${{ init.branch }} + CI_CHECK_PROVIDER: rwx + RWX_RUN_ID: + cache-key: included + RWX_TASK_ATTEMPT_NUMBER: + cache-key: included + cache: false + timeout: 30m + runner: + cpus: 4 + memory: 8gb + outputs: + filesystem: false + test-results: + - path: .ci/main-checks/l2-chains-sync-check/check.junit.xml + artifacts: + - key: reports + path: .ci/main-checks/l2-chains-sync-check + + - key: op-deployer-forge-version + use: [code, main-tools] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-main == 'true' }} + run: | + python3 ops/ci/runtime/main-checks.py op-deployer-forge-version + env: + CI_COMMIT_SHA: ${{ init.commit-sha }} + CI_BRANCH: ${{ init.branch }} + CI_CHECK_PROVIDER: rwx + RWX_RUN_ID: + cache-key: included + RWX_TASK_ATTEMPT_NUMBER: + cache-key: included + cache: false + timeout: 30m + runner: + cpus: 4 + memory: 8gb + outputs: + filesystem: false + test-results: + - path: .ci/main-checks/op-deployer-forge-version/check.junit.xml + artifacts: + - key: reports + path: .ci/main-checks/op-deployer-forge-version + + - key: opgeth-ratchet + use: [code, main-tools, go-modules, main-superchain] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-main == 'true' }} + run: | + export GOMODCACHE="$PWD/.ci/go-cache/pr-checks/modules" + export GOCACHE="$PWD/.ci/go-cache/main-checks/opgeth-ratchet" + python3 ops/ci/runtime/main-checks.py opgeth-ratchet + env: + CI_COMMIT_SHA: ${{ init.commit-sha }} + CI_BRANCH: ${{ init.branch }} + CI_CHECK_PROVIDER: rwx + SUPERCHAIN_PREPARED: ${{ tasks.main-superchain.artifacts.reports }} + RWX_RUN_ID: + cache-key: included + RWX_TASK_ATTEMPT_NUMBER: + cache-key: included + cache: false + timeout: 30m + runner: + cpus: 2 + memory: 4gb + outputs: + filesystem: false + test-results: + - path: .ci/main-checks/opgeth-ratchet/check.junit.xml + artifacts: + - key: reports + path: .ci/main-checks/opgeth-ratchet + + - key: check-op-geth-version + use: [code, main-tools, go-modules] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-main == 'true' }} + run: | + export GOMODCACHE="$PWD/.ci/go-cache/pr-checks/modules" + export GOCACHE="$PWD/.ci/go-cache/main-checks/check-op-geth-version" + python3 ops/ci/runtime/main-checks.py check-op-geth-version + env: + CI_COMMIT_SHA: ${{ init.commit-sha }} + CI_BRANCH: ${{ init.branch }} + CI_CHECK_PROVIDER: rwx + RWX_RUN_ID: + cache-key: included + RWX_TASK_ATTEMPT_NUMBER: + cache-key: included + cache: false + tool-cache: main-checks-check-op-geth-version-${{ init.cache-epoch }} + timeout: 30m + runner: + cpus: 2 + memory: 4gb + outputs: + filesystem: + filter: + workspace: [.ci/go-cache/main-checks/check-op-geth-version] + system: [] + test-results: + - path: .ci/main-checks/check-op-geth-version/check.junit.xml + artifacts: + - key: reports + path: .ci/main-checks/check-op-geth-version + + - key: check-nut-locks + use: [code, main-tools, go-modules] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-main == 'true' }} + run: | + export GOMODCACHE="$PWD/.ci/go-cache/pr-checks/modules" + export GOCACHE="$PWD/.ci/go-cache/main-checks/check-nut-locks" + python3 ops/ci/runtime/main-checks.py check-nut-locks + env: + CI_COMMIT_SHA: ${{ init.commit-sha }} + CI_BRANCH: ${{ init.branch }} + CI_CHECK_PROVIDER: rwx + RWX_RUN_ID: + cache-key: included + RWX_TASK_ATTEMPT_NUMBER: + cache-key: included + cache: false + tool-cache: main-checks-check-nut-locks-${{ init.cache-epoch }} + timeout: 30m + runner: + cpus: 2 + memory: 4gb + outputs: + filesystem: + filter: + workspace: [.ci/go-cache/main-checks/check-nut-locks] + system: [] + test-results: + - path: .ci/main-checks/check-nut-locks/check.junit.xml + artifacts: + - key: reports + path: .ci/main-checks/check-nut-locks + + - key: check-generated-mocks-op-node + use: [code, main-tools, go-modules, main-superchain] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-main == 'true' }} + run: | + export GOMODCACHE="$PWD/.ci/go-cache/pr-checks/modules" + export GOCACHE="$PWD/.ci/go-cache/main-checks/check-generated-mocks-op-node" + python3 ops/ci/runtime/main-checks.py check-generated-mocks-op-node + env: + CI_COMMIT_SHA: ${{ init.commit-sha }} + CI_BRANCH: ${{ init.branch }} + CI_CHECK_PROVIDER: rwx + SUPERCHAIN_PREPARED: ${{ tasks.main-superchain.artifacts.reports }} + RWX_RUN_ID: + cache-key: included + RWX_TASK_ATTEMPT_NUMBER: + cache-key: included + cache: false + tool-cache: main-checks-check-generated-mocks-op-node-${{ init.cache-epoch }} + timeout: 30m + runner: + cpus: 4 + memory: 8gb + outputs: + filesystem: + filter: + workspace: [.ci/go-cache/main-checks/check-generated-mocks-op-node] + system: [] + test-results: + - path: .ci/main-checks/check-generated-mocks-op-node/check.junit.xml + artifacts: + - key: reports + path: .ci/main-checks/check-generated-mocks-op-node + + - key: check-generated-mocks-op-service + use: [code, main-tools, go-modules, main-superchain] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-main == 'true' }} + run: | + export GOMODCACHE="$PWD/.ci/go-cache/pr-checks/modules" + export GOCACHE="$PWD/.ci/go-cache/main-checks/check-generated-mocks-op-service" + python3 ops/ci/runtime/main-checks.py check-generated-mocks-op-service + env: + CI_COMMIT_SHA: ${{ init.commit-sha }} + CI_BRANCH: ${{ init.branch }} + CI_CHECK_PROVIDER: rwx + SUPERCHAIN_PREPARED: ${{ tasks.main-superchain.artifacts.reports }} + RWX_RUN_ID: + cache-key: included + RWX_TASK_ATTEMPT_NUMBER: + cache-key: included + cache: false + tool-cache: main-checks-check-generated-mocks-op-service-${{ init.cache-epoch }} + timeout: 30m + runner: + cpus: 4 + memory: 8gb + outputs: + filesystem: + filter: + workspace: [.ci/go-cache/main-checks/check-generated-mocks-op-service] + system: [] + test-results: + - path: .ci/main-checks/check-generated-mocks-op-service/check.junit.xml + artifacts: + - key: reports + path: .ci/main-checks/check-generated-mocks-op-service + + # Exact Main dependency states; unrelated workload failures stay outside this gate. + - key: main-gate-receipt + use: [code, tools] + after: ${{ (check-generated-mocks-op-node.succeeded || check-generated-mocks-op-node.failed || check-generated-mocks-op-node.skipped) && (check-generated-mocks-op-service.succeeded || check-generated-mocks-op-service.failed || check-generated-mocks-op-service.skipped) && (check-nut-locks.succeeded || check-nut-locks.failed || check-nut-locks.skipped) && (check-op-geth-version.succeeded || check-op-geth-version.failed || check-op-geth-version.skipped) && (l2-chains-sync-check.succeeded || l2-chains-sync-check.failed || l2-chains-sync-check.skipped) && (op-deployer-forge-version.succeeded || op-deployer-forge-version.failed || op-deployer-forge-version.skipped) && (opgeth-ratchet.succeeded || opgeth-ratchet.failed || opgeth-ratchet.skipped) && (semgrep-scan-local.succeeded || semgrep-scan-local.failed || semgrep-scan-local.skipped) && (semgrep-test.succeeded || semgrep-test.failed || semgrep-test.skipped) && (shell-check.succeeded || shell-check.failed || shell-check.skipped) && (shfmt-check.succeeded || shfmt-check.failed || shfmt-check.skipped) }} + if: ${{ init.cache-warm != 'true' }} + run: python3 ops/ci/runtime/pr-gate.py receipt main-checks + env: + CI_COMMIT_SHA: ${{ init.commit-sha }} + CI_BRANCH: ${{ init.branch }} + GROUP_SELECTED: ${{ tasks.route.values.run-main }} + RWX_RUN_ID: + cache-key: included + RWX_TASK_ATTEMPT_NUMBER: + cache-key: included + TASK_CHECK_GENERATED_MOCKS_OP_NODE_SUCCEEDED: ${{ tasks.check-generated-mocks-op-node.succeeded }} + TASK_CHECK_GENERATED_MOCKS_OP_NODE_FAILED: ${{ tasks.check-generated-mocks-op-node.failed }} + TASK_CHECK_GENERATED_MOCKS_OP_NODE_SKIPPED: ${{ tasks.check-generated-mocks-op-node.skipped }} + TASK_CHECK_GENERATED_MOCKS_OP_SERVICE_SUCCEEDED: ${{ tasks.check-generated-mocks-op-service.succeeded }} + TASK_CHECK_GENERATED_MOCKS_OP_SERVICE_FAILED: ${{ tasks.check-generated-mocks-op-service.failed }} + TASK_CHECK_GENERATED_MOCKS_OP_SERVICE_SKIPPED: ${{ tasks.check-generated-mocks-op-service.skipped }} + TASK_CHECK_NUT_LOCKS_SUCCEEDED: ${{ tasks.check-nut-locks.succeeded }} + TASK_CHECK_NUT_LOCKS_FAILED: ${{ tasks.check-nut-locks.failed }} + TASK_CHECK_NUT_LOCKS_SKIPPED: ${{ tasks.check-nut-locks.skipped }} + TASK_OPGETH_RATCHET_SUCCEEDED: ${{ tasks.opgeth-ratchet.succeeded }} + TASK_OPGETH_RATCHET_FAILED: ${{ tasks.opgeth-ratchet.failed }} + TASK_OPGETH_RATCHET_SKIPPED: ${{ tasks.opgeth-ratchet.skipped }} + TASK_CHECK_OP_GETH_VERSION_SUCCEEDED: ${{ tasks.check-op-geth-version.succeeded }} + TASK_CHECK_OP_GETH_VERSION_FAILED: ${{ tasks.check-op-geth-version.failed }} + TASK_CHECK_OP_GETH_VERSION_SKIPPED: ${{ tasks.check-op-geth-version.skipped }} + TASK_L2_CHAINS_SYNC_CHECK_SUCCEEDED: ${{ tasks.l2-chains-sync-check.succeeded }} + TASK_L2_CHAINS_SYNC_CHECK_FAILED: ${{ tasks.l2-chains-sync-check.failed }} + TASK_L2_CHAINS_SYNC_CHECK_SKIPPED: ${{ tasks.l2-chains-sync-check.skipped }} + TASK_OP_DEPLOYER_FORGE_VERSION_SUCCEEDED: ${{ tasks.op-deployer-forge-version.succeeded }} + TASK_OP_DEPLOYER_FORGE_VERSION_FAILED: ${{ tasks.op-deployer-forge-version.failed }} + TASK_OP_DEPLOYER_FORGE_VERSION_SKIPPED: ${{ tasks.op-deployer-forge-version.skipped }} + TASK_SEMGREP_SCAN_LOCAL_SUCCEEDED: ${{ tasks.semgrep-scan-local.succeeded }} + TASK_SEMGREP_SCAN_LOCAL_FAILED: ${{ tasks.semgrep-scan-local.failed }} + TASK_SEMGREP_SCAN_LOCAL_SKIPPED: ${{ tasks.semgrep-scan-local.skipped }} + TASK_SEMGREP_TEST_SUCCEEDED: ${{ tasks.semgrep-test.succeeded }} + TASK_SEMGREP_TEST_FAILED: ${{ tasks.semgrep-test.failed }} + TASK_SEMGREP_TEST_SKIPPED: ${{ tasks.semgrep-test.skipped }} + TASK_SHELL_CHECK_SUCCEEDED: ${{ tasks.shell-check.succeeded }} + TASK_SHELL_CHECK_FAILED: ${{ tasks.shell-check.failed }} + TASK_SHELL_CHECK_SKIPPED: ${{ tasks.shell-check.skipped }} + TASK_SHFMT_CHECK_SUCCEEDED: ${{ tasks.shfmt-check.succeeded }} + TASK_SHFMT_CHECK_FAILED: ${{ tasks.shfmt-check.failed }} + TASK_SHFMT_CHECK_SKIPPED: ${{ tasks.shfmt-check.skipped }} + cache: false + timeout: 10m + outputs: + filesystem: false + artifacts: + - key: receipt + path: .ci/pr-gates/groups/main-checks + + # Bind every complete Contracts prerequisite to fresh engine terminal states. + - key: contracts-gate-receipt + use: [code, tools] + after: ${{ (contracts-fast.succeeded || contracts-fast.failed || contracts-fast.skipped) }} + if: ${{ init.cache-warm != 'true' }} + run: python3 ops/ci/runtime/pr-gate.py receipt contracts-checks + env: + CI_COMMIT_SHA: ${{ init.commit-sha }} + CI_BRANCH: ${{ init.branch }} + GROUP_SELECTED: ${{ tasks.route.values.run-contracts }} + RWX_RUN_ID: + cache-key: included + RWX_TASK_ATTEMPT_NUMBER: + cache-key: included + TASK_CONTRACTS_FAST_SUCCEEDED: ${{ tasks.contracts-fast.succeeded }} + TASK_CONTRACTS_FAST_FAILED: ${{ tasks.contracts-fast.failed }} + TASK_CONTRACTS_FAST_SKIPPED: ${{ tasks.contracts-fast.skipped }} + cache: false + timeout: 10m + outputs: + filesystem: false + artifacts: + - key: receipt + path: .ci/pr-gates/groups/contracts-checks diff --git a/.rwx/pr-gates.yml b/.rwx/pr-gates.yml new file mode 100644 index 00000000000..2987d5b8e61 --- /dev/null +++ b/.rwx/pr-gates.yml @@ -0,0 +1,587 @@ +# Genuine optional PR gates; Circle continues to own every required gate. +on: + github: + push: + if: ${{ event.git.branch == 'codex/rwx-ci-pilot' || event.git.branch == 'develop' }} + init: + commit-sha: ${{ event.git.sha }} + branch: ${{ event.git.branch }} + tag: ${{ event.git.tag }} + status-checks: + default: + name: optimism-rwx-pr-coordinator + custom: + - name: optimism-pilot + tasks: native-fmt + - name: optimism-rust-shadow + tasks: native-workspace + - name: optimism-op-reth-shadow + tasks: native-op-reth + - name: optimism-rust-gate-shadow + tasks: gate-status + - name: optimism-pr-checks-shadow + tasks: native-pr-checks + - name: optimism-go-tests-shadow + tasks: native-go + - name: optimism-acceptance-shadow + tasks: native-acceptance + - name: optimism-cannon-go-shadow + tasks: native-cannon + - name: optimism-nut-prefork-shadow + tasks: native-nut-prefork + - name: optimism-nut-provenance-shadow + tasks: native-nut-provenance + - name: optimism-sp1-guest-shadow + tasks: native-sp1 + - name: optimism-kontrol-build-shadow + tasks: native-kontrol + - name: optimism-main-gate-shadow + tasks: main-gate-status + - name: optimism-contracts-shadow + tasks: native-contracts + - name: optimism-contract-upgrades-shadow + tasks: native-contract-upgrades + - name: optimism-contract-l2-fork-shadow + tasks: native-contract-l2-fork + - name: optimism-contracts-gate-shadow + tasks: contracts-gate-status + cli: + init: + commit-sha: ${{ event.git.sha }} + branch: ${{ event.git.branch }} + tag: "" + +base: + image: ubuntu:24.04@sha256:008173c23f95b170204355c12626cb5a965d779a7e1283b09e9cffbb1bf33ca3 + config: rwx/base 1.2.0 + arch: x86_64 + +defaults: + runner: + cpus: 2 + memory: 8gb + +tasks: + - key: code + call: git/clone 2.2.0 + with: + repository: https://github.com/ethereum-optimism/optimism.git + ref: ${{ init.commit-sha }} + preserve-git-dir: true + fetch-full-depth: true + submodules: false + + - key: bootstrap-inputs + use: code + run: 'true' + filter: [mise.toml, ops/ci/runtime] + outputs: + filesystem: + filter: + workspace: [mise.toml, ops/ci/runtime/apt-install.sh, ops/ci/runtime/rwx-prepare.sh, ops/ci/runtime/rwx-contracts-prepare.sh, ops/ci/runtime/rwx-rust-prepare.sh, ops/ci/runtime/op-reth-shadow.sh, ops/ci/runtime/op-reth-report.py, ops/ci/runtime/rust-target-cache.py] + system: [] + artifacts: + - key: mise-config + path: mise.toml + - key: ci-scripts + path: ops/ci/runtime + - key: apt-script + path: ops/ci/runtime/apt-install.sh + + - key: mise + call: mise/install 1.1.0 + with: + mise-version: "2026.2.2" + install: "false" + + - key: tools + use: [mise, bootstrap-inputs] + call: ${{ run.dir }}/packages/toolchain-common.yml + + - key: route + use: [code, tools] + run: bash ops/ci/runtime/rwx-metadata.sh + env: + CI_EVENT: push + CI_BRANCH: ${{ init.branch }} + CI_TAG: ${{ init.tag }} + CI_COMMIT_SHA: ${{ init.commit-sha }} + cache: false + timeout: 10m + outputs: + filesystem: false + artifacts: + - key: routing + path: .ci/pipeline-parameters.json + + - key: helper-tests + use: [code, tools] + run: | + python3 -m unittest discover -s ops/ci/tests -p 'test_pr_gate.py' -v + python3 -m unittest discover -s ops/ci/migration/tests -p 'test_pr_gate_parity.py' -v + python3 -m unittest discover -s ops/ci/migration/tests -p 'test_circle_alignment.py' -v + python3 ops/ci/migration/circle-alignment.py + python3 -m unittest discover -s ops/ci/tests -p 'test_rwx_local_packages.py' -v + python3 -m unittest discover -s ops/ci/tests -p 'test_ci_report.py' -v + python3 -m unittest discover -s ops/ci/tests -p 'test_ci_source.py' -v + python3 -m unittest discover -s ops/ci/tests -p 'test_ci_layout.py' -v + python3 -m unittest discover -s ops/ci/migration/tests -p 'test_report_evidence.py' -v + python3 -m unittest discover -s ops/ci/migration/tests -p 'test_compare_ci.py' -v + cache: false + timeout: 10m + outputs: + filesystem: false + + - key: native-fmt + call: ${{ run.dir }}/pilot.yml + init: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + tag: ${{ init.tag }} + + - key: native-workspace + call: ${{ run.dir }}/rust.yml + init: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + tag: ${{ init.tag }} + cache-warm: "false" + cache-epoch: v1 + cargo-incremental: "0" + + - key: native-op-reth + call: ${{ run.dir }}/op-reth.yml + init: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + tag: ${{ init.tag }} + cache-warm: "false" + cache-epoch: v1 + build-probe: "" + target-cache-mode: keep + codec-base-sha: "" + + - key: aggregate + use: [code, tools] + after: ${{ (native-op-reth.succeeded || native-op-reth.failed || native-op-reth.skipped) && (native-fmt.succeeded || native-fmt.failed || native-fmt.skipped) && (native-workspace.succeeded || native-workspace.failed || native-workspace.skipped) }} + if: ${{ tasks.native-op-reth.tasks.rust-gate-receipt.succeeded && tasks.native-fmt.tasks.rust-gate-receipt.succeeded && tasks.native-workspace.tasks.rust-gate-receipt.succeeded }} + run: python3 ops/ci/runtime/pr-gate.py aggregate required-rust-ci + env: + CI_COMMIT_SHA: ${{ init.commit-sha }} + CI_BRANCH: ${{ init.branch }} + GATE_ROUTING: ${{ tasks.route.artifacts.routing }} + GROUP_RUST_FMT_REPORT: ${{ tasks.native-fmt.tasks.rust-gate-receipt.artifacts.receipt }} + GROUP_RUST_FMT_SUCCEEDED: ${{ tasks.native-fmt.tasks.rust-gate-receipt.succeeded }} + GROUP_RUST_FMT_FAILED: ${{ tasks.native-fmt.tasks.rust-gate-receipt.failed }} + GROUP_RUST_FMT_SKIPPED: ${{ tasks.native-fmt.tasks.rust-gate-receipt.skipped }} + GROUP_RUST_WORKSPACE_REPORT: ${{ tasks.native-workspace.tasks.rust-gate-receipt.artifacts.receipt }} + GROUP_RUST_WORKSPACE_SUCCEEDED: ${{ tasks.native-workspace.tasks.rust-gate-receipt.succeeded }} + GROUP_RUST_WORKSPACE_FAILED: ${{ tasks.native-workspace.tasks.rust-gate-receipt.failed }} + GROUP_RUST_WORKSPACE_SKIPPED: ${{ tasks.native-workspace.tasks.rust-gate-receipt.skipped }} + GROUP_OP_RETH_RUST_REPORT: ${{ tasks.native-op-reth.tasks.rust-gate-receipt.artifacts.receipt }} + GROUP_OP_RETH_RUST_SUCCEEDED: ${{ tasks.native-op-reth.tasks.rust-gate-receipt.succeeded }} + GROUP_OP_RETH_RUST_FAILED: ${{ tasks.native-op-reth.tasks.rust-gate-receipt.failed }} + GROUP_OP_RETH_RUST_SKIPPED: ${{ tasks.native-op-reth.tasks.rust-gate-receipt.skipped }} + RWX_RUN_ID: + cache-key: included + RWX_TASK_ATTEMPT_NUMBER: + cache-key: included + cache: false + timeout: 10m + outputs: + filesystem: false + artifacts: + - key: report + path: .ci/pr-gates/aggregate + + # RWX custom checks fail on skipped tasks. Observe both mutually exclusive + # collectors, then publish one executed verdict with their actual outcomes. + - key: gate-status + use: [code, tools] + after: ${{ (aggregate.succeeded || aggregate.failed || aggregate.skipped) && (gate-failure.succeeded || gate-failure.failed || gate-failure.skipped) }} + run: python3 ops/ci/runtime/pr-gate.py status required-rust-ci + env: + CI_COMMIT_SHA: ${{ init.commit-sha }} + CI_BRANCH: ${{ init.branch }} + OBSERVER_AGGREGATE_SUCCEEDED: ${{ tasks.aggregate.succeeded }} + OBSERVER_AGGREGATE_FAILED: ${{ tasks.aggregate.failed }} + OBSERVER_AGGREGATE_SKIPPED: ${{ tasks.aggregate.skipped }} + OBSERVER_GATE_FAILURE_SUCCEEDED: ${{ tasks.gate-failure.succeeded }} + OBSERVER_GATE_FAILURE_FAILED: ${{ tasks.gate-failure.failed }} + OBSERVER_GATE_FAILURE_SKIPPED: ${{ tasks.gate-failure.skipped }} + RWX_RUN_ID: + cache-key: included + RWX_TASK_ATTEMPT_NUMBER: + cache-key: included + cache: false + timeout: 10m + outputs: + filesystem: false + artifacts: + - key: status + path: .ci/pr-gates/status/required-rust-ci + + - key: gate-failure + use: [code, tools] + after: ${{ (native-op-reth.succeeded || native-op-reth.failed || native-op-reth.skipped) && (native-fmt.succeeded || native-fmt.failed || native-fmt.skipped) && (native-workspace.succeeded || native-workspace.failed || native-workspace.skipped) }} + if: ${{ (tasks.native-op-reth.tasks.rust-gate-receipt.failed || tasks.native-op-reth.tasks.rust-gate-receipt.skipped) || (tasks.native-fmt.tasks.rust-gate-receipt.failed || tasks.native-fmt.tasks.rust-gate-receipt.skipped) || (tasks.native-workspace.tasks.rust-gate-receipt.failed || tasks.native-workspace.tasks.rust-gate-receipt.skipped) }} + run: python3 ops/ci/runtime/pr-gate.py aggregate required-rust-ci --failed + env: + CI_COMMIT_SHA: ${{ init.commit-sha }} + CI_BRANCH: ${{ init.branch }} + GATE_ROUTING: ${{ tasks.route.artifacts.routing }} + GROUP_RUST_FMT_SUCCEEDED: ${{ tasks.native-fmt.tasks.rust-gate-receipt.succeeded }} + GROUP_RUST_FMT_FAILED: ${{ tasks.native-fmt.tasks.rust-gate-receipt.failed }} + GROUP_RUST_FMT_SKIPPED: ${{ tasks.native-fmt.tasks.rust-gate-receipt.skipped }} + GROUP_RUST_WORKSPACE_SUCCEEDED: ${{ tasks.native-workspace.tasks.rust-gate-receipt.succeeded }} + GROUP_RUST_WORKSPACE_FAILED: ${{ tasks.native-workspace.tasks.rust-gate-receipt.failed }} + GROUP_RUST_WORKSPACE_SKIPPED: ${{ tasks.native-workspace.tasks.rust-gate-receipt.skipped }} + GROUP_OP_RETH_RUST_SUCCEEDED: ${{ tasks.native-op-reth.tasks.rust-gate-receipt.succeeded }} + GROUP_OP_RETH_RUST_FAILED: ${{ tasks.native-op-reth.tasks.rust-gate-receipt.failed }} + GROUP_OP_RETH_RUST_SKIPPED: ${{ tasks.native-op-reth.tasks.rust-gate-receipt.skipped }} + RWX_RUN_ID: + cache-key: included + RWX_TASK_ATTEMPT_NUMBER: + cache-key: included + cache: false + timeout: 10m + outputs: + filesystem: false + artifacts: + - key: report + path: .ci/pr-gates/aggregate + + - key: native-pr-checks + call: ${{ run.dir }}/pr-checks.yml + init: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + tag: ${{ init.tag }} + cache-warm: "false" + cache-epoch: "v1" + + - key: native-go + call: ${{ run.dir }}/go-tests.yml + init: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + tag: ${{ init.tag }} + cache-warm: "false" + cache-epoch: "v1" + build-probe: "" + target-cache-mode: "keep" + shard-total: "12" + test-parallel: "8" + + - key: native-acceptance + call: ${{ run.dir }}/acceptance.yml + init: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + tag: ${{ init.tag }} + cache-warm: "false" + cache-epoch: "v1" + build-probe: "" + target-cache-mode: "keep" + shard-total: "8" + + - key: native-cannon + call: ${{ run.dir }}/cannon-go.yml + init: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + tag: ${{ init.tag }} + cache-warm: "false" + cache-epoch: "v1" + + - key: native-nut-prefork + call: ${{ run.dir }}/nut-prefork.yml + init: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + tag: ${{ init.tag }} + cache-warm: "false" + cache-epoch: "v1" + + - key: native-nut-provenance + call: ${{ run.dir }}/nut-provenance.yml + init: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + tag: ${{ init.tag }} + cache-warm: "false" + cache-epoch: "v1" + + - key: native-sp1 + call: ${{ run.dir }}/sp1-guest.yml + init: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + tag: ${{ init.tag }} + cache-warm: "false" + cache-epoch: "v1" + target-cache-mode: "keep" + + - key: native-kontrol + call: ${{ run.dir }}/kontrol-build.yml + init: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + tag: ${{ init.tag }} + cache-warm: "false" + cache-epoch: "v1" + + - key: main-aggregate + use: [code, tools] + after: ${{ (native-acceptance.succeeded || native-acceptance.failed || native-acceptance.skipped) && (native-cannon.succeeded || native-cannon.failed || native-cannon.skipped) && (native-pr-checks.succeeded || native-pr-checks.failed || native-pr-checks.skipped) && (native-go.succeeded || native-go.failed || native-go.skipped) && (native-kontrol.succeeded || native-kontrol.failed || native-kontrol.skipped) && (native-nut-prefork.succeeded || native-nut-prefork.failed || native-nut-prefork.skipped) && (native-nut-provenance.succeeded || native-nut-provenance.failed || native-nut-provenance.skipped) && (native-fmt.succeeded || native-fmt.failed || native-fmt.skipped) && (native-sp1.succeeded || native-sp1.failed || native-sp1.skipped) }} + if: ${{ tasks.native-acceptance.tasks.main-gate-receipt.succeeded && tasks.native-cannon.tasks.main-gate-receipt.succeeded && tasks.native-pr-checks.tasks.main-gate-receipt.succeeded && tasks.native-go.tasks.main-gate-receipt.succeeded && tasks.native-kontrol.tasks.main-gate-receipt.succeeded && tasks.native-nut-prefork.tasks.main-gate-receipt.succeeded && tasks.native-nut-provenance.tasks.main-gate-receipt.succeeded && tasks.native-fmt.tasks.main-gate-receipt.succeeded && tasks.native-sp1.tasks.main-gate-receipt.succeeded }} + run: python3 ops/ci/runtime/pr-gate.py aggregate ci-gate + env: + CI_COMMIT_SHA: ${{ init.commit-sha }} + CI_BRANCH: ${{ init.branch }} + GATE_ROUTING: ${{ tasks.route.artifacts.routing }} + GROUP_MAIN_ACCEPTANCE_REPORT: ${{ tasks.native-acceptance.tasks.main-gate-receipt.artifacts.receipt }} + GROUP_MAIN_ACCEPTANCE_SUCCEEDED: ${{ tasks.native-acceptance.tasks.main-gate-receipt.succeeded }} + GROUP_MAIN_ACCEPTANCE_FAILED: ${{ tasks.native-acceptance.tasks.main-gate-receipt.failed }} + GROUP_MAIN_ACCEPTANCE_SKIPPED: ${{ tasks.native-acceptance.tasks.main-gate-receipt.skipped }} + GROUP_MAIN_CANNON_REPORT: ${{ tasks.native-cannon.tasks.main-gate-receipt.artifacts.receipt }} + GROUP_MAIN_CANNON_SUCCEEDED: ${{ tasks.native-cannon.tasks.main-gate-receipt.succeeded }} + GROUP_MAIN_CANNON_FAILED: ${{ tasks.native-cannon.tasks.main-gate-receipt.failed }} + GROUP_MAIN_CANNON_SKIPPED: ${{ tasks.native-cannon.tasks.main-gate-receipt.skipped }} + GROUP_MAIN_CHECKS_REPORT: ${{ tasks.native-pr-checks.tasks.main-gate-receipt.artifacts.receipt }} + GROUP_MAIN_CHECKS_SUCCEEDED: ${{ tasks.native-pr-checks.tasks.main-gate-receipt.succeeded }} + GROUP_MAIN_CHECKS_FAILED: ${{ tasks.native-pr-checks.tasks.main-gate-receipt.failed }} + GROUP_MAIN_CHECKS_SKIPPED: ${{ tasks.native-pr-checks.tasks.main-gate-receipt.skipped }} + GROUP_MAIN_GO_REPORT: ${{ tasks.native-go.tasks.main-gate-receipt.artifacts.receipt }} + GROUP_MAIN_GO_SUCCEEDED: ${{ tasks.native-go.tasks.main-gate-receipt.succeeded }} + GROUP_MAIN_GO_FAILED: ${{ tasks.native-go.tasks.main-gate-receipt.failed }} + GROUP_MAIN_GO_SKIPPED: ${{ tasks.native-go.tasks.main-gate-receipt.skipped }} + GROUP_MAIN_KONTROL_REPORT: ${{ tasks.native-kontrol.tasks.main-gate-receipt.artifacts.receipt }} + GROUP_MAIN_KONTROL_SUCCEEDED: ${{ tasks.native-kontrol.tasks.main-gate-receipt.succeeded }} + GROUP_MAIN_KONTROL_FAILED: ${{ tasks.native-kontrol.tasks.main-gate-receipt.failed }} + GROUP_MAIN_KONTROL_SKIPPED: ${{ tasks.native-kontrol.tasks.main-gate-receipt.skipped }} + GROUP_MAIN_NUT_PREFORK_REPORT: ${{ tasks.native-nut-prefork.tasks.main-gate-receipt.artifacts.receipt }} + GROUP_MAIN_NUT_PREFORK_SUCCEEDED: ${{ tasks.native-nut-prefork.tasks.main-gate-receipt.succeeded }} + GROUP_MAIN_NUT_PREFORK_FAILED: ${{ tasks.native-nut-prefork.tasks.main-gate-receipt.failed }} + GROUP_MAIN_NUT_PREFORK_SKIPPED: ${{ tasks.native-nut-prefork.tasks.main-gate-receipt.skipped }} + GROUP_MAIN_NUT_PROVENANCE_REPORT: ${{ tasks.native-nut-provenance.tasks.main-gate-receipt.artifacts.receipt }} + GROUP_MAIN_NUT_PROVENANCE_SUCCEEDED: ${{ tasks.native-nut-provenance.tasks.main-gate-receipt.succeeded }} + GROUP_MAIN_NUT_PROVENANCE_FAILED: ${{ tasks.native-nut-provenance.tasks.main-gate-receipt.failed }} + GROUP_MAIN_NUT_PROVENANCE_SKIPPED: ${{ tasks.native-nut-provenance.tasks.main-gate-receipt.skipped }} + GROUP_MAIN_PILOT_REPORT: ${{ tasks.native-fmt.tasks.main-gate-receipt.artifacts.receipt }} + GROUP_MAIN_PILOT_SUCCEEDED: ${{ tasks.native-fmt.tasks.main-gate-receipt.succeeded }} + GROUP_MAIN_PILOT_FAILED: ${{ tasks.native-fmt.tasks.main-gate-receipt.failed }} + GROUP_MAIN_PILOT_SKIPPED: ${{ tasks.native-fmt.tasks.main-gate-receipt.skipped }} + GROUP_MAIN_SP1_REPORT: ${{ tasks.native-sp1.tasks.main-gate-receipt.artifacts.receipt }} + GROUP_MAIN_SP1_SUCCEEDED: ${{ tasks.native-sp1.tasks.main-gate-receipt.succeeded }} + GROUP_MAIN_SP1_FAILED: ${{ tasks.native-sp1.tasks.main-gate-receipt.failed }} + GROUP_MAIN_SP1_SKIPPED: ${{ tasks.native-sp1.tasks.main-gate-receipt.skipped }} + RWX_RUN_ID: + cache-key: included + RWX_TASK_ATTEMPT_NUMBER: + cache-key: included + cache: false + timeout: 10m + outputs: + filesystem: false + artifacts: + - key: report + path: .ci/pr-gates/aggregate + + - key: main-gate-failure + use: [code, tools] + after: ${{ (native-acceptance.succeeded || native-acceptance.failed || native-acceptance.skipped) && (native-cannon.succeeded || native-cannon.failed || native-cannon.skipped) && (native-pr-checks.succeeded || native-pr-checks.failed || native-pr-checks.skipped) && (native-go.succeeded || native-go.failed || native-go.skipped) && (native-kontrol.succeeded || native-kontrol.failed || native-kontrol.skipped) && (native-nut-prefork.succeeded || native-nut-prefork.failed || native-nut-prefork.skipped) && (native-nut-provenance.succeeded || native-nut-provenance.failed || native-nut-provenance.skipped) && (native-fmt.succeeded || native-fmt.failed || native-fmt.skipped) && (native-sp1.succeeded || native-sp1.failed || native-sp1.skipped) }} + if: ${{ (tasks.native-acceptance.tasks.main-gate-receipt.failed || tasks.native-acceptance.tasks.main-gate-receipt.skipped) || (tasks.native-cannon.tasks.main-gate-receipt.failed || tasks.native-cannon.tasks.main-gate-receipt.skipped) || (tasks.native-pr-checks.tasks.main-gate-receipt.failed || tasks.native-pr-checks.tasks.main-gate-receipt.skipped) || (tasks.native-go.tasks.main-gate-receipt.failed || tasks.native-go.tasks.main-gate-receipt.skipped) || (tasks.native-kontrol.tasks.main-gate-receipt.failed || tasks.native-kontrol.tasks.main-gate-receipt.skipped) || (tasks.native-nut-prefork.tasks.main-gate-receipt.failed || tasks.native-nut-prefork.tasks.main-gate-receipt.skipped) || (tasks.native-nut-provenance.tasks.main-gate-receipt.failed || tasks.native-nut-provenance.tasks.main-gate-receipt.skipped) || (tasks.native-fmt.tasks.main-gate-receipt.failed || tasks.native-fmt.tasks.main-gate-receipt.skipped) || (tasks.native-sp1.tasks.main-gate-receipt.failed || tasks.native-sp1.tasks.main-gate-receipt.skipped) }} + run: python3 ops/ci/runtime/pr-gate.py aggregate ci-gate --failed + env: + CI_COMMIT_SHA: ${{ init.commit-sha }} + CI_BRANCH: ${{ init.branch }} + GATE_ROUTING: ${{ tasks.route.artifacts.routing }} + GROUP_MAIN_ACCEPTANCE_SUCCEEDED: ${{ tasks.native-acceptance.tasks.main-gate-receipt.succeeded }} + GROUP_MAIN_ACCEPTANCE_FAILED: ${{ tasks.native-acceptance.tasks.main-gate-receipt.failed }} + GROUP_MAIN_ACCEPTANCE_SKIPPED: ${{ tasks.native-acceptance.tasks.main-gate-receipt.skipped }} + GROUP_MAIN_CANNON_SUCCEEDED: ${{ tasks.native-cannon.tasks.main-gate-receipt.succeeded }} + GROUP_MAIN_CANNON_FAILED: ${{ tasks.native-cannon.tasks.main-gate-receipt.failed }} + GROUP_MAIN_CANNON_SKIPPED: ${{ tasks.native-cannon.tasks.main-gate-receipt.skipped }} + GROUP_MAIN_CHECKS_SUCCEEDED: ${{ tasks.native-pr-checks.tasks.main-gate-receipt.succeeded }} + GROUP_MAIN_CHECKS_FAILED: ${{ tasks.native-pr-checks.tasks.main-gate-receipt.failed }} + GROUP_MAIN_CHECKS_SKIPPED: ${{ tasks.native-pr-checks.tasks.main-gate-receipt.skipped }} + GROUP_MAIN_GO_SUCCEEDED: ${{ tasks.native-go.tasks.main-gate-receipt.succeeded }} + GROUP_MAIN_GO_FAILED: ${{ tasks.native-go.tasks.main-gate-receipt.failed }} + GROUP_MAIN_GO_SKIPPED: ${{ tasks.native-go.tasks.main-gate-receipt.skipped }} + GROUP_MAIN_KONTROL_SUCCEEDED: ${{ tasks.native-kontrol.tasks.main-gate-receipt.succeeded }} + GROUP_MAIN_KONTROL_FAILED: ${{ tasks.native-kontrol.tasks.main-gate-receipt.failed }} + GROUP_MAIN_KONTROL_SKIPPED: ${{ tasks.native-kontrol.tasks.main-gate-receipt.skipped }} + GROUP_MAIN_NUT_PREFORK_SUCCEEDED: ${{ tasks.native-nut-prefork.tasks.main-gate-receipt.succeeded }} + GROUP_MAIN_NUT_PREFORK_FAILED: ${{ tasks.native-nut-prefork.tasks.main-gate-receipt.failed }} + GROUP_MAIN_NUT_PREFORK_SKIPPED: ${{ tasks.native-nut-prefork.tasks.main-gate-receipt.skipped }} + GROUP_MAIN_NUT_PROVENANCE_SUCCEEDED: ${{ tasks.native-nut-provenance.tasks.main-gate-receipt.succeeded }} + GROUP_MAIN_NUT_PROVENANCE_FAILED: ${{ tasks.native-nut-provenance.tasks.main-gate-receipt.failed }} + GROUP_MAIN_NUT_PROVENANCE_SKIPPED: ${{ tasks.native-nut-provenance.tasks.main-gate-receipt.skipped }} + GROUP_MAIN_PILOT_SUCCEEDED: ${{ tasks.native-fmt.tasks.main-gate-receipt.succeeded }} + GROUP_MAIN_PILOT_FAILED: ${{ tasks.native-fmt.tasks.main-gate-receipt.failed }} + GROUP_MAIN_PILOT_SKIPPED: ${{ tasks.native-fmt.tasks.main-gate-receipt.skipped }} + GROUP_MAIN_SP1_SUCCEEDED: ${{ tasks.native-sp1.tasks.main-gate-receipt.succeeded }} + GROUP_MAIN_SP1_FAILED: ${{ tasks.native-sp1.tasks.main-gate-receipt.failed }} + GROUP_MAIN_SP1_SKIPPED: ${{ tasks.native-sp1.tasks.main-gate-receipt.skipped }} + RWX_RUN_ID: + cache-key: included + RWX_TASK_ATTEMPT_NUMBER: + cache-key: included + cache: false + timeout: 10m + outputs: + filesystem: false + artifacts: + - key: report + path: .ci/pr-gates/aggregate + + - key: main-gate-status + use: [code, tools] + after: ${{ (main-aggregate.succeeded || main-aggregate.failed || main-aggregate.skipped) && (main-gate-failure.succeeded || main-gate-failure.failed || main-gate-failure.skipped) }} + run: python3 ops/ci/runtime/pr-gate.py status ci-gate + env: + CI_COMMIT_SHA: ${{ init.commit-sha }} + CI_BRANCH: ${{ init.branch }} + OBSERVER_AGGREGATE_SUCCEEDED: ${{ tasks.main-aggregate.succeeded }} + OBSERVER_AGGREGATE_FAILED: ${{ tasks.main-aggregate.failed }} + OBSERVER_AGGREGATE_SKIPPED: ${{ tasks.main-aggregate.skipped }} + OBSERVER_GATE_FAILURE_SUCCEEDED: ${{ tasks.main-gate-failure.succeeded }} + OBSERVER_GATE_FAILURE_FAILED: ${{ tasks.main-gate-failure.failed }} + OBSERVER_GATE_FAILURE_SKIPPED: ${{ tasks.main-gate-failure.skipped }} + RWX_RUN_ID: + cache-key: included + RWX_TASK_ATTEMPT_NUMBER: + cache-key: included + cache: false + timeout: 10m + outputs: + filesystem: false + artifacts: + - key: status + path: .ci/pr-gates/status/ci-gate + + # Contracts shares the existing fast-check child and executes all matrices once. + - key: native-contracts + call: ${{ run.dir }}/contracts.yml + init: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + tag: ${{ init.tag }} + cache-warm: "false" + cache-epoch: "v1" + build-probe: "" + + - key: native-contract-upgrades + call: ${{ run.dir }}/contract-upgrades.yml + init: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + tag: ${{ init.tag }} + cache-warm: "false" + cache-epoch: "v1" + + - key: native-contract-l2-fork + call: ${{ run.dir }}/contract-l2-fork.yml + init: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + tag: ${{ init.tag }} + cache-warm: "false" + cache-epoch: "v1" + fork-block: "latest" + + - key: contracts-aggregate + use: [code, tools] + after: ${{ (native-pr-checks.succeeded || native-pr-checks.failed || native-pr-checks.skipped) && (native-contract-l2-fork.succeeded || native-contract-l2-fork.failed || native-contract-l2-fork.skipped) && (native-contracts.succeeded || native-contracts.failed || native-contracts.skipped) && (native-contract-upgrades.succeeded || native-contract-upgrades.failed || native-contract-upgrades.skipped) }} + if: ${{ tasks.native-pr-checks.tasks.contracts-gate-receipt.succeeded && tasks.native-contract-l2-fork.tasks.contracts-gate-receipt.succeeded && tasks.native-contracts.tasks.contracts-gate-receipt.succeeded && tasks.native-contract-upgrades.tasks.contracts-gate-receipt.succeeded }} + run: python3 ops/ci/runtime/pr-gate.py aggregate required-contracts-ci + env: + CI_COMMIT_SHA: ${{ init.commit-sha }} + CI_BRANCH: ${{ init.branch }} + GATE_ROUTING: ${{ tasks.route.artifacts.routing }} + GROUP_CONTRACTS_CHECKS_REPORT: ${{ tasks.native-pr-checks.tasks.contracts-gate-receipt.artifacts.receipt }} + GROUP_CONTRACTS_CHECKS_SUCCEEDED: ${{ tasks.native-pr-checks.tasks.contracts-gate-receipt.succeeded }} + GROUP_CONTRACTS_CHECKS_FAILED: ${{ tasks.native-pr-checks.tasks.contracts-gate-receipt.failed }} + GROUP_CONTRACTS_CHECKS_SKIPPED: ${{ tasks.native-pr-checks.tasks.contracts-gate-receipt.skipped }} + GROUP_CONTRACTS_L2_FORK_REPORT: ${{ tasks.native-contract-l2-fork.tasks.contracts-gate-receipt.artifacts.receipt }} + GROUP_CONTRACTS_L2_FORK_SUCCEEDED: ${{ tasks.native-contract-l2-fork.tasks.contracts-gate-receipt.succeeded }} + GROUP_CONTRACTS_L2_FORK_FAILED: ${{ tasks.native-contract-l2-fork.tasks.contracts-gate-receipt.failed }} + GROUP_CONTRACTS_L2_FORK_SKIPPED: ${{ tasks.native-contract-l2-fork.tasks.contracts-gate-receipt.skipped }} + GROUP_CONTRACTS_SUITES_REPORT: ${{ tasks.native-contracts.tasks.contracts-gate-receipt.artifacts.receipt }} + GROUP_CONTRACTS_SUITES_SUCCEEDED: ${{ tasks.native-contracts.tasks.contracts-gate-receipt.succeeded }} + GROUP_CONTRACTS_SUITES_FAILED: ${{ tasks.native-contracts.tasks.contracts-gate-receipt.failed }} + GROUP_CONTRACTS_SUITES_SKIPPED: ${{ tasks.native-contracts.tasks.contracts-gate-receipt.skipped }} + GROUP_CONTRACTS_UPGRADES_REPORT: ${{ tasks.native-contract-upgrades.tasks.contracts-gate-receipt.artifacts.receipt }} + GROUP_CONTRACTS_UPGRADES_SUCCEEDED: ${{ tasks.native-contract-upgrades.tasks.contracts-gate-receipt.succeeded }} + GROUP_CONTRACTS_UPGRADES_FAILED: ${{ tasks.native-contract-upgrades.tasks.contracts-gate-receipt.failed }} + GROUP_CONTRACTS_UPGRADES_SKIPPED: ${{ tasks.native-contract-upgrades.tasks.contracts-gate-receipt.skipped }} + RWX_RUN_ID: + cache-key: included + RWX_TASK_ATTEMPT_NUMBER: + cache-key: included + cache: false + timeout: 10m + outputs: + filesystem: false + artifacts: + - key: report + path: .ci/pr-gates/aggregate/required-contracts-ci + + - key: contracts-gate-failure + use: [code, tools] + after: ${{ (native-pr-checks.succeeded || native-pr-checks.failed || native-pr-checks.skipped) && (native-contract-l2-fork.succeeded || native-contract-l2-fork.failed || native-contract-l2-fork.skipped) && (native-contracts.succeeded || native-contracts.failed || native-contracts.skipped) && (native-contract-upgrades.succeeded || native-contract-upgrades.failed || native-contract-upgrades.skipped) }} + if: ${{ (tasks.native-pr-checks.tasks.contracts-gate-receipt.failed || tasks.native-pr-checks.tasks.contracts-gate-receipt.skipped) || (tasks.native-contract-l2-fork.tasks.contracts-gate-receipt.failed || tasks.native-contract-l2-fork.tasks.contracts-gate-receipt.skipped) || (tasks.native-contracts.tasks.contracts-gate-receipt.failed || tasks.native-contracts.tasks.contracts-gate-receipt.skipped) || (tasks.native-contract-upgrades.tasks.contracts-gate-receipt.failed || tasks.native-contract-upgrades.tasks.contracts-gate-receipt.skipped) }} + run: python3 ops/ci/runtime/pr-gate.py aggregate required-contracts-ci --failed + env: + CI_COMMIT_SHA: ${{ init.commit-sha }} + CI_BRANCH: ${{ init.branch }} + GATE_ROUTING: ${{ tasks.route.artifacts.routing }} + GROUP_CONTRACTS_CHECKS_SUCCEEDED: ${{ tasks.native-pr-checks.tasks.contracts-gate-receipt.succeeded }} + GROUP_CONTRACTS_CHECKS_FAILED: ${{ tasks.native-pr-checks.tasks.contracts-gate-receipt.failed }} + GROUP_CONTRACTS_CHECKS_SKIPPED: ${{ tasks.native-pr-checks.tasks.contracts-gate-receipt.skipped }} + GROUP_CONTRACTS_L2_FORK_SUCCEEDED: ${{ tasks.native-contract-l2-fork.tasks.contracts-gate-receipt.succeeded }} + GROUP_CONTRACTS_L2_FORK_FAILED: ${{ tasks.native-contract-l2-fork.tasks.contracts-gate-receipt.failed }} + GROUP_CONTRACTS_L2_FORK_SKIPPED: ${{ tasks.native-contract-l2-fork.tasks.contracts-gate-receipt.skipped }} + GROUP_CONTRACTS_SUITES_SUCCEEDED: ${{ tasks.native-contracts.tasks.contracts-gate-receipt.succeeded }} + GROUP_CONTRACTS_SUITES_FAILED: ${{ tasks.native-contracts.tasks.contracts-gate-receipt.failed }} + GROUP_CONTRACTS_SUITES_SKIPPED: ${{ tasks.native-contracts.tasks.contracts-gate-receipt.skipped }} + GROUP_CONTRACTS_UPGRADES_SUCCEEDED: ${{ tasks.native-contract-upgrades.tasks.contracts-gate-receipt.succeeded }} + GROUP_CONTRACTS_UPGRADES_FAILED: ${{ tasks.native-contract-upgrades.tasks.contracts-gate-receipt.failed }} + GROUP_CONTRACTS_UPGRADES_SKIPPED: ${{ tasks.native-contract-upgrades.tasks.contracts-gate-receipt.skipped }} + RWX_RUN_ID: + cache-key: included + RWX_TASK_ATTEMPT_NUMBER: + cache-key: included + cache: false + timeout: 10m + outputs: + filesystem: false + artifacts: + - key: report + path: .ci/pr-gates/aggregate/required-contracts-ci + + - key: contracts-gate-status + use: [code, tools] + after: ${{ (contracts-aggregate.succeeded || contracts-aggregate.failed || contracts-aggregate.skipped) && (contracts-gate-failure.succeeded || contracts-gate-failure.failed || contracts-gate-failure.skipped) }} + run: python3 ops/ci/runtime/pr-gate.py status required-contracts-ci + env: + CI_COMMIT_SHA: ${{ init.commit-sha }} + CI_BRANCH: ${{ init.branch }} + OBSERVER_AGGREGATE_SUCCEEDED: ${{ tasks.contracts-aggregate.succeeded }} + OBSERVER_AGGREGATE_FAILED: ${{ tasks.contracts-aggregate.failed }} + OBSERVER_AGGREGATE_SKIPPED: ${{ tasks.contracts-aggregate.skipped }} + OBSERVER_GATE_FAILURE_SUCCEEDED: ${{ tasks.contracts-gate-failure.succeeded }} + OBSERVER_GATE_FAILURE_FAILED: ${{ tasks.contracts-gate-failure.failed }} + OBSERVER_GATE_FAILURE_SKIPPED: ${{ tasks.contracts-gate-failure.skipped }} + RWX_RUN_ID: + cache-key: included + RWX_TASK_ATTEMPT_NUMBER: + cache-key: included + cache: false + timeout: 10m + outputs: + filesystem: false + artifacts: + - key: status + path: .ci/pr-gates/status/required-contracts-ci diff --git a/.rwx/rust-e2e.yml b/.rwx/rust-e2e.yml new file mode 100644 index 00000000000..f4f627bc67d --- /dev/null +++ b/.rwx/rust-e2e.yml @@ -0,0 +1,1001 @@ +# Full Rust E2E shadows. CircleCI retains all required gates. +on: + cache-rebuild: + if: ${{ event.git.branch == 'develop' }} + target: [go, contracts, release, prestate, compile-proof, compile-restart, compile-simple-kona, compile-simple-kona-sequencer, compile-op-reth] + init: + commit-sha: ${{ event.git.sha }} + branch: ${{ event.git.branch }} + tag: "" + cache-warm: "true" + cache-epoch: v1 + build-probe: "" + target-cache-mode: keep + github: + push: + init: + commit-sha: ${{ event.git.sha }} + branch: ${{ event.git.branch }} + tag: ${{ event.git.tag }} + cache-warm: "false" + cache-epoch: v1 + build-probe: "" + target-cache-mode: keep + status-checks: + name: optimism-rust-e2e-shadow + cli: + init: + commit-sha: ${{ event.git.sha }} + branch: ${{ event.git.branch }} + tag: "" + cache-warm: "false" + cache-epoch: v1 + build-probe: "" + target-cache-mode: keep + +# Shared cache baseline: only develop may write; PRs restore it read-only. +tool-cache: + vault: optimism-op-reth-shadow + +base: + image: ubuntu:24.04@sha256:008173c23f95b170204355c12626cb5a965d779a7e1283b09e9cffbb1bf33ca3 + config: rwx/base 1.2.0 + arch: x86_64 + +defaults: + runner: + cpus: 2 + memory: 8gb + +tasks: + - key: code + call: git/clone 2.2.0 + with: + repository: https://github.com/ethereum-optimism/optimism.git + ref: ${{ init.commit-sha }} + preserve-git-dir: true + fetch-full-depth: true + submodules: false + + - key: bootstrap-inputs + use: code + run: 'true' + filter: [mise.toml, ops/ci/runtime] + outputs: + filesystem: + filter: + workspace: [mise.toml, ops/ci/runtime/apt-install.sh, ops/ci/runtime/rwx-prepare.sh, ops/ci/runtime/rwx-contracts-prepare.sh, ops/ci/runtime/rwx-rust-prepare.sh, ops/ci/runtime/op-reth-shadow.sh, ops/ci/runtime/op-reth-report.py, ops/ci/runtime/rust-target-cache.py] + system: [] + artifacts: + - key: mise-config + path: mise.toml + - key: ci-scripts + path: ops/ci/runtime + - key: apt-script + path: ops/ci/runtime/apt-install.sh + + - key: mise + call: mise/install 1.1.0 + with: + mise-version: "2026.2.2" + install: "false" + + # Artifact dependencies avoid inheriting the checkout's Git history into + # reusable tools. Language toolchains are added only by their own workload. + - key: tools + use: [mise, bootstrap-inputs] + call: ${{ run.dir }}/packages/toolchain-common.yml + + - key: go-build-tools + use: tools + call: ${{ run.dir }}/packages/toolchain-go.yml + with: + mode: go + + - key: route + use: [code, tools] + run: bash ops/ci/runtime/rwx-metadata.sh + env: + CI_EVENT: push + CI_CACHE_WARM: ${{ init.cache-warm }} + CI_BRANCH: ${{ init.branch }} + CI_TAG: ${{ init.tag }} + CI_COMMIT_SHA: ${{ init.commit-sha }} + cache: false + timeout: 10m + outputs: + filesystem: false + artifacts: + - key: routing + path: .ci/pipeline-parameters.json + + - key: contract-tools + use: [bootstrap-inputs, tools] + call: ${{ run.dir }}/packages/toolchain-foundry.yml + with: + mode: anvil + + - key: rust-tools + use: [bootstrap-inputs, tools] + call: ${{ run.dir }}/packages/toolchain-rust.yml + with: + mode: e2e + + - key: helper-tests + use: [code, go-build-tools, contract-tools] + run: | + bash ops/ci/runtime/apt-install.sh zstd + RWX_LIVE_GO_FIXTURE=1 RWX_LIVE_FORGE_FIXTURE=1 python3 -m unittest discover -s ops/ci/tests -p 'test_rust_e2e.py' + python3 -m unittest discover -s ops/ci/tests -p 'test_rust_e2e_release.py' + python3 -m unittest discover -s ops/ci/tests -p 'test_rust_e2e_gate.py' + python3 -m unittest discover -s ops/ci/migration/tests -p 'test_compare_rust_e2e.py' + python3 -m unittest discover -s ops/ci/migration/tests -p 'test_compare_contract_artifacts.py' + python3 -m unittest discover -s ops/ci/tests -p 'test_go_artifacts.py' + cache: false + timeout: 10m + outputs: + filesystem: false + + - key: source + use: [code, tools] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-rust-e2e-ci == 'true' }} + run: | + git submodule sync --recursive + git submodule update --init --recursive --jobs 8 + git rev-parse HEAD >packages/contracts-bedrock/.gitcommit + timeout: 20m + + - key: rust-dependencies + use: [source, rust-tools] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-rust-e2e-ci == 'true' }} + run: | + export CARGO_HOME="$PWD/.ci/rust-cache/cargo" + cd rust + attempt=0 + until cargo fetch --locked; do + attempt=$((attempt + 1)) + if [[ "$attempt" -ge 5 ]]; then exit 1; fi + sleep "$((2 ** attempt))" + done + filter: [rust, mise.toml] + tool-cache: op-reth-dependencies-${{ init.cache-epoch }} + timeout: 30m + outputs: + filesystem: + filter: + workspace: [.ci/rust-cache/cargo] + system: [] + + - key: head-source + use: [source, rust-dependencies] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-rust-e2e-ci == 'true' }} + run: 'true' + + - key: go + use: [source, go-build-tools] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-rust-e2e-ci == 'true' }} + call: ${{ run.dir }}/packages/go-go.yml + with: + commit-sha: ${{ init.commit-sha }} + cache-epoch: ${{ init.cache-epoch }} + build-probe: ${{ init.build-probe }} + target-cache-mode: ${{ init.target-cache-mode }} + + - key: contracts + use: [source, contract-tools, go-build-tools] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-rust-e2e-ci == 'true' }} + call: ${{ run.dir }}/packages/rust-e2e-contracts.yml + with: + commit-sha: ${{ init.commit-sha }} + cache-epoch: ${{ init.cache-epoch }} + build-probe: ${{ init.build-probe }} + target-cache-mode: ${{ init.target-cache-mode }} + + - key: release + use: [rust-tools, head-source] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-rust-e2e-ci == 'true' }} + call: ${{ run.dir }}/packages/rust-e2e-release.yml + with: + commit-sha: ${{ init.commit-sha }} + cache-epoch: ${{ init.cache-epoch }} + + - key: prestate + use: [source, go-build-tools] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-rust-e2e-ci == 'true' }} + call: ${{ run.dir }}/packages/go-prestate.yml + with: + commit-sha: ${{ init.commit-sha }} + cache-epoch: ${{ init.cache-epoch }} + build-probe: ${{ init.build-probe }} + target-cache-mode: ${{ init.target-cache-mode }} + + - key: runtime-tools + use: [go-build-tools, contract-tools] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-rust-e2e-ci == 'true' }} + run: | + mise install go:github.com/ethereum/go-ethereum/cmd/geth + printf '%s\n' "$(mise bin-paths | paste -sd: -):$PATH" >"$RWX_ENV/PATH" + timeout: 30m + + - key: compile-proof + use: [source, go-build-tools] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-rust-e2e-ci == 'true' }} + run: | + python3 ops/ci/runtime/go-artifacts.py restore go "$GO_ARTIFACT" + python3 ops/ci/runtime/go-artifacts.py restore contracts-e2e "$CONTRACT_ARTIFACT" + bash ops/ci/runtime/rust-e2e.sh compile proof + env: + CI_COMMIT_SHA: ${{ init.commit-sha }} + CI_E2E_PROVIDER: rwx + GO_ARTIFACT: ${{ tasks.go.tasks.build.artifacts.dependency }} + CONTRACT_ARTIFACT: ${{ tasks.contracts.tasks.build.artifacts.dependency }} + tool-cache: rust-e2e-go-compile-${{ init.cache-epoch }} + timeout: 60m + runner: + cpus: 8 + memory: 16gb + outputs: + filesystem: + filter: + workspace: [.ci/go-cache/rust-e2e/compile] + system: [] + artifacts: + - key: compiled + path: .ci/rust-e2e/compiled/proof + + - key: compile-restart + use: [source, go-build-tools] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-rust-e2e-ci == 'true' }} + run: | + python3 ops/ci/runtime/go-artifacts.py restore go "$GO_ARTIFACT" + python3 ops/ci/runtime/go-artifacts.py restore contracts-e2e "$CONTRACT_ARTIFACT" + bash ops/ci/runtime/rust-e2e.sh compile restart + env: + CI_COMMIT_SHA: ${{ init.commit-sha }} + CI_E2E_PROVIDER: rwx + GO_ARTIFACT: ${{ tasks.go.tasks.build.artifacts.dependency }} + CONTRACT_ARTIFACT: ${{ tasks.contracts.tasks.build.artifacts.dependency }} + tool-cache: rust-e2e-go-compile-${{ init.cache-epoch }} + timeout: 60m + runner: + cpus: 8 + memory: 16gb + outputs: + filesystem: + filter: + workspace: [.ci/go-cache/rust-e2e/compile] + system: [] + artifacts: + - key: compiled + path: .ci/rust-e2e/compiled/restart + + - key: compile-simple-kona + use: [source, go-build-tools] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-rust-e2e-ci == 'true' }} + run: | + python3 ops/ci/runtime/go-artifacts.py restore go "$GO_ARTIFACT" + python3 ops/ci/runtime/go-artifacts.py restore contracts-e2e "$CONTRACT_ARTIFACT" + bash ops/ci/runtime/rust-e2e.sh compile simple-kona + env: + CI_COMMIT_SHA: ${{ init.commit-sha }} + CI_E2E_PROVIDER: rwx + GO_ARTIFACT: ${{ tasks.go.tasks.build.artifacts.dependency }} + CONTRACT_ARTIFACT: ${{ tasks.contracts.tasks.build.artifacts.dependency }} + tool-cache: rust-e2e-go-compile-${{ init.cache-epoch }} + timeout: 60m + runner: + cpus: 8 + memory: 16gb + outputs: + filesystem: + filter: + workspace: [.ci/go-cache/rust-e2e/compile] + system: [] + artifacts: + - key: compiled + path: .ci/rust-e2e/compiled/simple-kona + + - key: compile-simple-kona-sequencer + use: [source, go-build-tools] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-rust-e2e-ci == 'true' }} + run: | + python3 ops/ci/runtime/go-artifacts.py restore go "$GO_ARTIFACT" + python3 ops/ci/runtime/go-artifacts.py restore contracts-e2e "$CONTRACT_ARTIFACT" + bash ops/ci/runtime/rust-e2e.sh compile simple-kona-sequencer + env: + CI_COMMIT_SHA: ${{ init.commit-sha }} + CI_E2E_PROVIDER: rwx + GO_ARTIFACT: ${{ tasks.go.tasks.build.artifacts.dependency }} + CONTRACT_ARTIFACT: ${{ tasks.contracts.tasks.build.artifacts.dependency }} + tool-cache: rust-e2e-go-compile-${{ init.cache-epoch }} + timeout: 60m + runner: + cpus: 8 + memory: 16gb + outputs: + filesystem: + filter: + workspace: [.ci/go-cache/rust-e2e/compile] + system: [] + artifacts: + - key: compiled + path: .ci/rust-e2e/compiled/simple-kona-sequencer + + - key: compile-op-reth + use: [source, go-build-tools] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-rust-e2e-ci == 'true' }} + run: | + python3 ops/ci/runtime/go-artifacts.py restore go "$GO_ARTIFACT" + python3 ops/ci/runtime/go-artifacts.py restore contracts-e2e "$CONTRACT_ARTIFACT" + bash ops/ci/runtime/rust-e2e.sh compile op-reth + env: + CI_COMMIT_SHA: ${{ init.commit-sha }} + CI_E2E_PROVIDER: rwx + GO_ARTIFACT: ${{ tasks.go.tasks.build.artifacts.dependency }} + CONTRACT_ARTIFACT: ${{ tasks.contracts.tasks.build.artifacts.dependency }} + tool-cache: rust-e2e-go-compile-${{ init.cache-epoch }} + timeout: 60m + runner: + cpus: 8 + memory: 16gb + outputs: + filesystem: + filter: + workspace: [.ci/go-cache/rust-e2e/compile] + system: [] + artifacts: + - key: compiled + path: .ci/rust-e2e/compiled/op-reth + + # Run/attempt identity forces fresh verdicts while preserving runtime Go caches. + - key: verdict-proof-0 + use: [source, runtime-tools] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-rust-e2e-ci == 'true' }} + docker: true + run: | + python3 ops/ci/runtime/go-artifacts.py restore go "$GO_ARTIFACT" + python3 ops/ci/runtime/go-artifacts.py restore contracts-e2e "$CONTRACT_ARTIFACT" + python3 ops/ci/runtime/go-artifacts.py restore rust-e2e-release "$RELEASE_ARTIFACT" + bash ops/ci/runtime/rust-e2e.sh run proof + env: + CI_COMMIT_SHA: ${{ init.commit-sha }} + CI_BRANCH: ${{ init.branch }} + CI_E2E_PROVIDER: rwx + CI_SHARD_INDEX: "0" + PARALLEL: "8" + RWX_RUN_ID: + cache-key: included + RWX_TASK_ATTEMPT_NUMBER: + cache-key: included + CI_E2E_COMPILED: ${{ tasks.compile-proof.artifacts.compiled }} + GO_ARTIFACT: ${{ tasks.go.tasks.build.artifacts.dependency }} + CONTRACT_ARTIFACT: ${{ tasks.contracts.tasks.build.artifacts.dependency }} + RELEASE_ARTIFACT: ${{ tasks.release.tasks.build.artifacts.dependency }} + tool-cache: rust-e2e-runtime-proof-${{ init.cache-epoch }} + timeout: 90m + runner: + cpus: 8 + memory: 16gb + outputs: + filesystem: + filter: + workspace: [.ci/go-cache/rust-e2e/run] + system: [] + test-results: + - path: .ci/rust-e2e/reports/proof/native.json + options: + language: Go + framework: go test + artifacts: + - key: reports + path: .ci/rust-e2e/reports/proof + + - key: verdict-proof-1 + use: [source, runtime-tools] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-rust-e2e-ci == 'true' }} + docker: true + run: | + python3 ops/ci/runtime/go-artifacts.py restore go "$GO_ARTIFACT" + python3 ops/ci/runtime/go-artifacts.py restore contracts-e2e "$CONTRACT_ARTIFACT" + python3 ops/ci/runtime/go-artifacts.py restore rust-e2e-release "$RELEASE_ARTIFACT" + bash ops/ci/runtime/rust-e2e.sh run proof + env: + CI_COMMIT_SHA: ${{ init.commit-sha }} + CI_BRANCH: ${{ init.branch }} + CI_E2E_PROVIDER: rwx + CI_SHARD_INDEX: "1" + PARALLEL: "8" + RWX_RUN_ID: + cache-key: included + RWX_TASK_ATTEMPT_NUMBER: + cache-key: included + CI_E2E_COMPILED: ${{ tasks.compile-proof.artifacts.compiled }} + GO_ARTIFACT: ${{ tasks.go.tasks.build.artifacts.dependency }} + CONTRACT_ARTIFACT: ${{ tasks.contracts.tasks.build.artifacts.dependency }} + RELEASE_ARTIFACT: ${{ tasks.release.tasks.build.artifacts.dependency }} + tool-cache: rust-e2e-runtime-proof-${{ init.cache-epoch }} + timeout: 90m + runner: + cpus: 8 + memory: 16gb + outputs: + filesystem: + filter: + workspace: [.ci/go-cache/rust-e2e/run] + system: [] + test-results: + - path: .ci/rust-e2e/reports/proof/native.json + options: + language: Go + framework: go test + artifacts: + - key: reports + path: .ci/rust-e2e/reports/proof + + - key: verdict-proof-2 + use: [source, runtime-tools] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-rust-e2e-ci == 'true' }} + docker: true + run: | + python3 ops/ci/runtime/go-artifacts.py restore go "$GO_ARTIFACT" + python3 ops/ci/runtime/go-artifacts.py restore contracts-e2e "$CONTRACT_ARTIFACT" + python3 ops/ci/runtime/go-artifacts.py restore rust-e2e-release "$RELEASE_ARTIFACT" + bash ops/ci/runtime/rust-e2e.sh run proof + env: + CI_COMMIT_SHA: ${{ init.commit-sha }} + CI_BRANCH: ${{ init.branch }} + CI_E2E_PROVIDER: rwx + CI_SHARD_INDEX: "2" + PARALLEL: "8" + RWX_RUN_ID: + cache-key: included + RWX_TASK_ATTEMPT_NUMBER: + cache-key: included + CI_E2E_COMPILED: ${{ tasks.compile-proof.artifacts.compiled }} + GO_ARTIFACT: ${{ tasks.go.tasks.build.artifacts.dependency }} + CONTRACT_ARTIFACT: ${{ tasks.contracts.tasks.build.artifacts.dependency }} + RELEASE_ARTIFACT: ${{ tasks.release.tasks.build.artifacts.dependency }} + tool-cache: rust-e2e-runtime-proof-${{ init.cache-epoch }} + timeout: 90m + runner: + cpus: 8 + memory: 16gb + outputs: + filesystem: + filter: + workspace: [.ci/go-cache/rust-e2e/run] + system: [] + test-results: + - path: .ci/rust-e2e/reports/proof/native.json + options: + language: Go + framework: go test + artifacts: + - key: reports + path: .ci/rust-e2e/reports/proof + + - key: verdict-proof-3 + use: [source, runtime-tools] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-rust-e2e-ci == 'true' }} + docker: true + run: | + python3 ops/ci/runtime/go-artifacts.py restore go "$GO_ARTIFACT" + python3 ops/ci/runtime/go-artifacts.py restore contracts-e2e "$CONTRACT_ARTIFACT" + python3 ops/ci/runtime/go-artifacts.py restore rust-e2e-release "$RELEASE_ARTIFACT" + bash ops/ci/runtime/rust-e2e.sh run proof + env: + CI_COMMIT_SHA: ${{ init.commit-sha }} + CI_BRANCH: ${{ init.branch }} + CI_E2E_PROVIDER: rwx + CI_SHARD_INDEX: "3" + PARALLEL: "8" + RWX_RUN_ID: + cache-key: included + RWX_TASK_ATTEMPT_NUMBER: + cache-key: included + CI_E2E_COMPILED: ${{ tasks.compile-proof.artifacts.compiled }} + GO_ARTIFACT: ${{ tasks.go.tasks.build.artifacts.dependency }} + CONTRACT_ARTIFACT: ${{ tasks.contracts.tasks.build.artifacts.dependency }} + RELEASE_ARTIFACT: ${{ tasks.release.tasks.build.artifacts.dependency }} + tool-cache: rust-e2e-runtime-proof-${{ init.cache-epoch }} + timeout: 90m + runner: + cpus: 8 + memory: 16gb + outputs: + filesystem: + filter: + workspace: [.ci/go-cache/rust-e2e/run] + system: [] + test-results: + - path: .ci/rust-e2e/reports/proof/native.json + options: + language: Go + framework: go test + artifacts: + - key: reports + path: .ci/rust-e2e/reports/proof + + - key: verdict-proof-4 + use: [source, runtime-tools] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-rust-e2e-ci == 'true' }} + docker: true + run: | + python3 ops/ci/runtime/go-artifacts.py restore go "$GO_ARTIFACT" + python3 ops/ci/runtime/go-artifacts.py restore contracts-e2e "$CONTRACT_ARTIFACT" + python3 ops/ci/runtime/go-artifacts.py restore rust-e2e-release "$RELEASE_ARTIFACT" + bash ops/ci/runtime/rust-e2e.sh run proof + env: + CI_COMMIT_SHA: ${{ init.commit-sha }} + CI_BRANCH: ${{ init.branch }} + CI_E2E_PROVIDER: rwx + CI_SHARD_INDEX: "4" + PARALLEL: "8" + RWX_RUN_ID: + cache-key: included + RWX_TASK_ATTEMPT_NUMBER: + cache-key: included + CI_E2E_COMPILED: ${{ tasks.compile-proof.artifacts.compiled }} + GO_ARTIFACT: ${{ tasks.go.tasks.build.artifacts.dependency }} + CONTRACT_ARTIFACT: ${{ tasks.contracts.tasks.build.artifacts.dependency }} + RELEASE_ARTIFACT: ${{ tasks.release.tasks.build.artifacts.dependency }} + tool-cache: rust-e2e-runtime-proof-${{ init.cache-epoch }} + timeout: 90m + runner: + cpus: 8 + memory: 16gb + outputs: + filesystem: + filter: + workspace: [.ci/go-cache/rust-e2e/run] + system: [] + test-results: + - path: .ci/rust-e2e/reports/proof/native.json + options: + language: Go + framework: go test + artifacts: + - key: reports + path: .ci/rust-e2e/reports/proof + + - key: verdict-proof-5 + use: [source, runtime-tools] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-rust-e2e-ci == 'true' }} + docker: true + run: | + python3 ops/ci/runtime/go-artifacts.py restore go "$GO_ARTIFACT" + python3 ops/ci/runtime/go-artifacts.py restore contracts-e2e "$CONTRACT_ARTIFACT" + python3 ops/ci/runtime/go-artifacts.py restore rust-e2e-release "$RELEASE_ARTIFACT" + bash ops/ci/runtime/rust-e2e.sh run proof + env: + CI_COMMIT_SHA: ${{ init.commit-sha }} + CI_BRANCH: ${{ init.branch }} + CI_E2E_PROVIDER: rwx + CI_SHARD_INDEX: "5" + PARALLEL: "8" + RWX_RUN_ID: + cache-key: included + RWX_TASK_ATTEMPT_NUMBER: + cache-key: included + CI_E2E_COMPILED: ${{ tasks.compile-proof.artifacts.compiled }} + GO_ARTIFACT: ${{ tasks.go.tasks.build.artifacts.dependency }} + CONTRACT_ARTIFACT: ${{ tasks.contracts.tasks.build.artifacts.dependency }} + RELEASE_ARTIFACT: ${{ tasks.release.tasks.build.artifacts.dependency }} + tool-cache: rust-e2e-runtime-proof-${{ init.cache-epoch }} + timeout: 90m + runner: + cpus: 8 + memory: 16gb + outputs: + filesystem: + filter: + workspace: [.ci/go-cache/rust-e2e/run] + system: [] + test-results: + - path: .ci/rust-e2e/reports/proof/native.json + options: + language: Go + framework: go test + artifacts: + - key: reports + path: .ci/rust-e2e/reports/proof + + - key: verdict-proof-6 + use: [source, runtime-tools] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-rust-e2e-ci == 'true' }} + docker: true + run: | + python3 ops/ci/runtime/go-artifacts.py restore go "$GO_ARTIFACT" + python3 ops/ci/runtime/go-artifacts.py restore contracts-e2e "$CONTRACT_ARTIFACT" + python3 ops/ci/runtime/go-artifacts.py restore rust-e2e-release "$RELEASE_ARTIFACT" + bash ops/ci/runtime/rust-e2e.sh run proof + env: + CI_COMMIT_SHA: ${{ init.commit-sha }} + CI_BRANCH: ${{ init.branch }} + CI_E2E_PROVIDER: rwx + CI_SHARD_INDEX: "6" + PARALLEL: "8" + RWX_RUN_ID: + cache-key: included + RWX_TASK_ATTEMPT_NUMBER: + cache-key: included + CI_E2E_COMPILED: ${{ tasks.compile-proof.artifacts.compiled }} + GO_ARTIFACT: ${{ tasks.go.tasks.build.artifacts.dependency }} + CONTRACT_ARTIFACT: ${{ tasks.contracts.tasks.build.artifacts.dependency }} + RELEASE_ARTIFACT: ${{ tasks.release.tasks.build.artifacts.dependency }} + tool-cache: rust-e2e-runtime-proof-${{ init.cache-epoch }} + timeout: 90m + runner: + cpus: 8 + memory: 16gb + outputs: + filesystem: + filter: + workspace: [.ci/go-cache/rust-e2e/run] + system: [] + test-results: + - path: .ci/rust-e2e/reports/proof/native.json + options: + language: Go + framework: go test + artifacts: + - key: reports + path: .ci/rust-e2e/reports/proof + + - key: verdict-proof-7 + use: [source, runtime-tools] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-rust-e2e-ci == 'true' }} + docker: true + run: | + python3 ops/ci/runtime/go-artifacts.py restore go "$GO_ARTIFACT" + python3 ops/ci/runtime/go-artifacts.py restore contracts-e2e "$CONTRACT_ARTIFACT" + python3 ops/ci/runtime/go-artifacts.py restore rust-e2e-release "$RELEASE_ARTIFACT" + bash ops/ci/runtime/rust-e2e.sh run proof + env: + CI_COMMIT_SHA: ${{ init.commit-sha }} + CI_BRANCH: ${{ init.branch }} + CI_E2E_PROVIDER: rwx + CI_SHARD_INDEX: "7" + PARALLEL: "8" + RWX_RUN_ID: + cache-key: included + RWX_TASK_ATTEMPT_NUMBER: + cache-key: included + CI_E2E_COMPILED: ${{ tasks.compile-proof.artifacts.compiled }} + GO_ARTIFACT: ${{ tasks.go.tasks.build.artifacts.dependency }} + CONTRACT_ARTIFACT: ${{ tasks.contracts.tasks.build.artifacts.dependency }} + RELEASE_ARTIFACT: ${{ tasks.release.tasks.build.artifacts.dependency }} + tool-cache: rust-e2e-runtime-proof-${{ init.cache-epoch }} + timeout: 90m + runner: + cpus: 8 + memory: 16gb + outputs: + filesystem: + filter: + workspace: [.ci/go-cache/rust-e2e/run] + system: [] + test-results: + - path: .ci/rust-e2e/reports/proof/native.json + options: + language: Go + framework: go test + artifacts: + - key: reports + path: .ci/rust-e2e/reports/proof + + - key: verdict-restart-0 + use: [source, runtime-tools] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-rust-e2e-ci == 'true' }} + docker: true + run: | + python3 ops/ci/runtime/go-artifacts.py restore go "$GO_ARTIFACT" + python3 ops/ci/runtime/go-artifacts.py restore contracts-e2e "$CONTRACT_ARTIFACT" + python3 ops/ci/runtime/go-artifacts.py restore rust-e2e-release "$RELEASE_ARTIFACT" + python3 ops/ci/runtime/go-artifacts.py restore prestate "$PRESTATE_ARTIFACT" + bash ops/ci/runtime/rust-e2e.sh run restart + env: + CI_COMMIT_SHA: ${{ init.commit-sha }} + CI_BRANCH: ${{ init.branch }} + CI_E2E_PROVIDER: rwx + CI_SHARD_INDEX: "0" + PARALLEL: "8" + RWX_RUN_ID: + cache-key: included + RWX_TASK_ATTEMPT_NUMBER: + cache-key: included + CI_E2E_COMPILED: ${{ tasks.compile-restart.artifacts.compiled }} + GO_ARTIFACT: ${{ tasks.go.tasks.build.artifacts.dependency }} + CONTRACT_ARTIFACT: ${{ tasks.contracts.tasks.build.artifacts.dependency }} + RELEASE_ARTIFACT: ${{ tasks.release.tasks.build.artifacts.dependency }} + PRESTATE_ARTIFACT: ${{ tasks.prestate.tasks.build.artifacts.dependency }} + tool-cache: rust-e2e-runtime-restart-${{ init.cache-epoch }} + timeout: 60m + runner: + cpus: 8 + memory: 16gb + outputs: + filesystem: + filter: + workspace: [.ci/go-cache/rust-e2e/run] + system: [] + test-results: + - path: .ci/rust-e2e/reports/restart/native.json + options: + language: Go + framework: go test + artifacts: + - key: reports + path: .ci/rust-e2e/reports/restart + + - key: verdict-restart-1 + use: [source, runtime-tools] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-rust-e2e-ci == 'true' }} + docker: true + run: | + python3 ops/ci/runtime/go-artifacts.py restore go "$GO_ARTIFACT" + python3 ops/ci/runtime/go-artifacts.py restore contracts-e2e "$CONTRACT_ARTIFACT" + python3 ops/ci/runtime/go-artifacts.py restore rust-e2e-release "$RELEASE_ARTIFACT" + python3 ops/ci/runtime/go-artifacts.py restore prestate "$PRESTATE_ARTIFACT" + bash ops/ci/runtime/rust-e2e.sh run restart + env: + CI_COMMIT_SHA: ${{ init.commit-sha }} + CI_BRANCH: ${{ init.branch }} + CI_E2E_PROVIDER: rwx + CI_SHARD_INDEX: "1" + PARALLEL: "8" + RWX_RUN_ID: + cache-key: included + RWX_TASK_ATTEMPT_NUMBER: + cache-key: included + CI_E2E_COMPILED: ${{ tasks.compile-restart.artifacts.compiled }} + GO_ARTIFACT: ${{ tasks.go.tasks.build.artifacts.dependency }} + CONTRACT_ARTIFACT: ${{ tasks.contracts.tasks.build.artifacts.dependency }} + RELEASE_ARTIFACT: ${{ tasks.release.tasks.build.artifacts.dependency }} + PRESTATE_ARTIFACT: ${{ tasks.prestate.tasks.build.artifacts.dependency }} + tool-cache: rust-e2e-runtime-restart-${{ init.cache-epoch }} + timeout: 60m + runner: + cpus: 8 + memory: 16gb + outputs: + filesystem: + filter: + workspace: [.ci/go-cache/rust-e2e/run] + system: [] + test-results: + - path: .ci/rust-e2e/reports/restart/native.json + options: + language: Go + framework: go test + artifacts: + - key: reports + path: .ci/rust-e2e/reports/restart + + - key: verdict-restart-2 + use: [source, runtime-tools] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-rust-e2e-ci == 'true' }} + docker: true + run: | + python3 ops/ci/runtime/go-artifacts.py restore go "$GO_ARTIFACT" + python3 ops/ci/runtime/go-artifacts.py restore contracts-e2e "$CONTRACT_ARTIFACT" + python3 ops/ci/runtime/go-artifacts.py restore rust-e2e-release "$RELEASE_ARTIFACT" + python3 ops/ci/runtime/go-artifacts.py restore prestate "$PRESTATE_ARTIFACT" + bash ops/ci/runtime/rust-e2e.sh run restart + env: + CI_COMMIT_SHA: ${{ init.commit-sha }} + CI_BRANCH: ${{ init.branch }} + CI_E2E_PROVIDER: rwx + CI_SHARD_INDEX: "2" + PARALLEL: "8" + RWX_RUN_ID: + cache-key: included + RWX_TASK_ATTEMPT_NUMBER: + cache-key: included + CI_E2E_COMPILED: ${{ tasks.compile-restart.artifacts.compiled }} + GO_ARTIFACT: ${{ tasks.go.tasks.build.artifacts.dependency }} + CONTRACT_ARTIFACT: ${{ tasks.contracts.tasks.build.artifacts.dependency }} + RELEASE_ARTIFACT: ${{ tasks.release.tasks.build.artifacts.dependency }} + PRESTATE_ARTIFACT: ${{ tasks.prestate.tasks.build.artifacts.dependency }} + tool-cache: rust-e2e-runtime-restart-${{ init.cache-epoch }} + timeout: 60m + runner: + cpus: 8 + memory: 16gb + outputs: + filesystem: + filter: + workspace: [.ci/go-cache/rust-e2e/run] + system: [] + test-results: + - path: .ci/rust-e2e/reports/restart/native.json + options: + language: Go + framework: go test + artifacts: + - key: reports + path: .ci/rust-e2e/reports/restart + + - key: verdict-simple-kona-0 + use: [source, runtime-tools] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-rust-e2e-ci == 'true' }} + docker: true + run: | + python3 ops/ci/runtime/go-artifacts.py restore go "$GO_ARTIFACT" + python3 ops/ci/runtime/go-artifacts.py restore contracts-e2e "$CONTRACT_ARTIFACT" + python3 ops/ci/runtime/go-artifacts.py restore rust-e2e-release "$RELEASE_ARTIFACT" + python3 ops/ci/runtime/go-artifacts.py restore prestate "$PRESTATE_ARTIFACT" + bash ops/ci/runtime/rust-e2e.sh run simple-kona + env: + CI_COMMIT_SHA: ${{ init.commit-sha }} + CI_BRANCH: ${{ init.branch }} + CI_E2E_PROVIDER: rwx + CI_SHARD_INDEX: "0" + PARALLEL: "8" + RWX_RUN_ID: + cache-key: included + RWX_TASK_ATTEMPT_NUMBER: + cache-key: included + CI_E2E_COMPILED: ${{ tasks.compile-simple-kona.artifacts.compiled }} + GO_ARTIFACT: ${{ tasks.go.tasks.build.artifacts.dependency }} + CONTRACT_ARTIFACT: ${{ tasks.contracts.tasks.build.artifacts.dependency }} + RELEASE_ARTIFACT: ${{ tasks.release.tasks.build.artifacts.dependency }} + PRESTATE_ARTIFACT: ${{ tasks.prestate.tasks.build.artifacts.dependency }} + tool-cache: rust-e2e-runtime-simple-kona-${{ init.cache-epoch }} + timeout: 60m + runner: + cpus: 8 + memory: 16gb + outputs: + filesystem: + filter: + workspace: [.ci/go-cache/rust-e2e/run] + system: [] + test-results: + - path: .ci/rust-e2e/reports/simple-kona/native.json + options: + language: Go + framework: go test + artifacts: + - key: reports + path: .ci/rust-e2e/reports/simple-kona + + - key: verdict-simple-kona-sequencer-0 + use: [source, runtime-tools] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-rust-e2e-ci == 'true' }} + docker: true + run: | + python3 ops/ci/runtime/go-artifacts.py restore go "$GO_ARTIFACT" + python3 ops/ci/runtime/go-artifacts.py restore contracts-e2e "$CONTRACT_ARTIFACT" + python3 ops/ci/runtime/go-artifacts.py restore rust-e2e-release "$RELEASE_ARTIFACT" + python3 ops/ci/runtime/go-artifacts.py restore prestate "$PRESTATE_ARTIFACT" + bash ops/ci/runtime/rust-e2e.sh run simple-kona-sequencer + env: + CI_COMMIT_SHA: ${{ init.commit-sha }} + CI_BRANCH: ${{ init.branch }} + CI_E2E_PROVIDER: rwx + CI_SHARD_INDEX: "0" + PARALLEL: "8" + RWX_RUN_ID: + cache-key: included + RWX_TASK_ATTEMPT_NUMBER: + cache-key: included + CI_E2E_COMPILED: ${{ tasks.compile-simple-kona-sequencer.artifacts.compiled }} + GO_ARTIFACT: ${{ tasks.go.tasks.build.artifacts.dependency }} + CONTRACT_ARTIFACT: ${{ tasks.contracts.tasks.build.artifacts.dependency }} + RELEASE_ARTIFACT: ${{ tasks.release.tasks.build.artifacts.dependency }} + PRESTATE_ARTIFACT: ${{ tasks.prestate.tasks.build.artifacts.dependency }} + tool-cache: rust-e2e-runtime-simple-kona-sequencer-${{ init.cache-epoch }} + timeout: 60m + runner: + cpus: 8 + memory: 16gb + outputs: + filesystem: + filter: + workspace: [.ci/go-cache/rust-e2e/run] + system: [] + test-results: + - path: .ci/rust-e2e/reports/simple-kona-sequencer/native.json + options: + language: Go + framework: go test + artifacts: + - key: reports + path: .ci/rust-e2e/reports/simple-kona-sequencer + + - key: verdict-op-reth-0 + use: [source, runtime-tools] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-rust-e2e-ci == 'true' }} + docker: true + run: | + python3 ops/ci/runtime/go-artifacts.py restore go "$GO_ARTIFACT" + python3 ops/ci/runtime/go-artifacts.py restore contracts-e2e "$CONTRACT_ARTIFACT" + python3 ops/ci/runtime/go-artifacts.py restore rust-e2e-release "$RELEASE_ARTIFACT" + bash ops/ci/runtime/rust-e2e.sh run op-reth + env: + CI_COMMIT_SHA: ${{ init.commit-sha }} + CI_BRANCH: ${{ init.branch }} + CI_E2E_PROVIDER: rwx + CI_SHARD_INDEX: "0" + PARALLEL: "8" + RWX_RUN_ID: + cache-key: included + RWX_TASK_ATTEMPT_NUMBER: + cache-key: included + CI_E2E_COMPILED: ${{ tasks.compile-op-reth.artifacts.compiled }} + GO_ARTIFACT: ${{ tasks.go.tasks.build.artifacts.dependency }} + CONTRACT_ARTIFACT: ${{ tasks.contracts.tasks.build.artifacts.dependency }} + RELEASE_ARTIFACT: ${{ tasks.release.tasks.build.artifacts.dependency }} + tool-cache: rust-e2e-runtime-op-reth-${{ init.cache-epoch }} + timeout: 60m + runner: + cpus: 8 + memory: 16gb + outputs: + filesystem: + filter: + workspace: [.ci/go-cache/rust-e2e/run] + system: [] + test-results: + - path: .ci/rust-e2e/reports/op-reth/native.json + options: + language: Go + framework: go test + artifacts: + - key: reports + path: .ci/rust-e2e/reports/op-reth + + - key: required-rust-e2e + use: [code, tools] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-rust-e2e-ci == 'true' }} + after: [release, verdict-proof-0, verdict-proof-1, verdict-proof-2, verdict-proof-3, verdict-proof-4, verdict-proof-5, verdict-proof-6, verdict-proof-7, verdict-restart-0, verdict-restart-1, verdict-restart-2, verdict-simple-kona-0, verdict-simple-kona-sequencer-0, verdict-op-reth-0] + run: | + reports=() + for index in 0 1 2 3 4 5 6 7 8 9 10 11 12 13; do + name="REPORT_$index" + reports+=("${!name}") + done + python3 ops/ci/runtime/rust-e2e-gate.py --release "$RELEASE_REPORT" --sha "$CI_COMMIT_SHA" \ + --output .ci/rust-e2e/gate.json "${reports[@]}" + env: + CI_COMMIT_SHA: ${{ init.commit-sha }} + RELEASE_REPORT: ${{ tasks.release.tasks.build.artifacts.reports }} + REPORT_0: ${{ tasks.verdict-proof-0.artifacts.reports }} + REPORT_1: ${{ tasks.verdict-proof-1.artifacts.reports }} + REPORT_2: ${{ tasks.verdict-proof-2.artifacts.reports }} + REPORT_3: ${{ tasks.verdict-proof-3.artifacts.reports }} + REPORT_4: ${{ tasks.verdict-proof-4.artifacts.reports }} + REPORT_5: ${{ tasks.verdict-proof-5.artifacts.reports }} + REPORT_6: ${{ tasks.verdict-proof-6.artifacts.reports }} + REPORT_7: ${{ tasks.verdict-proof-7.artifacts.reports }} + REPORT_8: ${{ tasks.verdict-restart-0.artifacts.reports }} + REPORT_9: ${{ tasks.verdict-restart-1.artifacts.reports }} + REPORT_10: ${{ tasks.verdict-restart-2.artifacts.reports }} + REPORT_11: ${{ tasks.verdict-simple-kona-0.artifacts.reports }} + REPORT_12: ${{ tasks.verdict-simple-kona-sequencer-0.artifacts.reports }} + REPORT_13: ${{ tasks.verdict-op-reth-0.artifacts.reports }} + cache: false + timeout: 10m + outputs: + filesystem: false + artifacts: + - key: gate + path: .ci/rust-e2e/gate.json + + # The overall optional check fails on a build failure even if no consumer ran. + # RWX cancels all tasks when the run is canceled; this task cannot turn it green. + - key: required-rust-e2e-failure + use: [code, tools] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-rust-e2e-ci == 'true' }} + after: ${{ release.failed || verdict-proof-0.failed || verdict-proof-1.failed || verdict-proof-2.failed || verdict-proof-3.failed || verdict-proof-4.failed || verdict-proof-5.failed || verdict-proof-6.failed || verdict-proof-7.failed || verdict-restart-0.failed || verdict-restart-1.failed || verdict-restart-2.failed || verdict-simple-kona-0.failed || verdict-simple-kona-sequencer-0.failed || verdict-op-reth-0.failed }} + run: | + mkdir -p .ci/rust-e2e + printf '%s\n' '{"passed":false,"reason":"E2E dependency or verdict failed or was aborted"}' >.ci/rust-e2e/gate-failure.json + exit 1 + cache: false + outputs: + filesystem: false + artifacts: + - key: gate + path: .ci/rust-e2e/gate-failure.json diff --git a/.rwx/rust.yml b/.rwx/rust.yml new file mode 100644 index 00000000000..8ee767f7c4c --- /dev/null +++ b/.rwx/rust.yml @@ -0,0 +1,1201 @@ +# Rust workspace builds, tests, cross-compilation and source checks. Circle retains required gates. +on: + cache-rebuild: + if: ${{ event.git.branch == 'develop' }} + target: [tests-cache, tests-build, build, clippy, docs, no-std, udeps, feature-plan, features-build-0, features-build-1, features-build-2, features-build-3, features-build-4, features-build-5, features-build-6, features-build-7, features-build-8, features-build-9, wasm-unknown, wasm-wasi, registry, cannon-env, cannon-go, cannon-witness, cannon-build] + init: + commit-sha: ${{ event.git.sha }} + branch: ${{ event.git.branch }} + tag: "" + cache-epoch: v1 + cargo-incremental: "0" + cache-warm: "true" + # Automatic pushes are coordinated by pr-gates.yml; CLI and warming remain. + cli: + init: + commit-sha: ${{ event.git.sha }} + branch: ${{ event.git.branch }} + tag: "" + cache-epoch: v1 + cargo-incremental: "0" + cache-warm: "false" + +base: + image: ubuntu:24.04@sha256:008173c23f95b170204355c12626cb5a965d779a7e1283b09e9cffbb1bf33ca3 + config: rwx/base 1.2.0 + arch: x86_64 + +# Cache-only vault: no publishing credentials. Only develop may write; +# PRs restore the protected shared baseline and compile changes locally. +tool-cache: + vault: optimism-op-reth-shadow + +defaults: + runner: + cpus: 2 + memory: 8gb + +tasks: + - key: code + call: git/clone 2.2.0 + with: + repository: https://github.com/ethereum-optimism/optimism.git + ref: ${{ init.commit-sha }} + preserve-git-dir: true + fetch-full-depth: true + submodules: false + + - key: bootstrap-inputs + use: code + run: 'true' + filter: [mise.toml, ops/ci/runtime] + outputs: + filesystem: + filter: + workspace: [mise.toml, ops/ci/runtime/apt-install.sh, ops/ci/runtime/rwx-prepare.sh, ops/ci/runtime/rwx-contracts-prepare.sh, ops/ci/runtime/rwx-rust-prepare.sh, ops/ci/runtime/op-reth-shadow.sh, ops/ci/runtime/op-reth-report.py, ops/ci/runtime/rust-target-cache.py] + system: [] + artifacts: + - key: mise-config + path: mise.toml + - key: ci-scripts + path: ops/ci/runtime + - key: apt-script + path: ops/ci/runtime/apt-install.sh + + - key: mise + call: mise/install 1.1.0 + with: + mise-version: "2026.2.2" + install: "false" + + # Artifact dependencies avoid inheriting the checkout's Git history into + # reusable tools. Language toolchains are added only by their own workload. + - key: tools + use: [mise, bootstrap-inputs] + call: ${{ run.dir }}/packages/toolchain-common.yml + + - key: route + use: [code, tools] + run: bash ops/ci/runtime/rwx-metadata.sh + env: + CI_EVENT: push + CI_CACHE_WARM: ${{ init.cache-warm }} + CI_BRANCH: ${{ init.branch }} + CI_TAG: ${{ init.tag }} + CI_COMMIT_SHA: ${{ init.commit-sha }} + cache: false + timeout: 10m + outputs: + filesystem: false + artifacts: + - key: routing + path: .ci/pipeline-parameters.json + + - key: helper-tests + use: [code, tools] + run: | + python3 -m unittest discover -s ops/ci/tests -p 'test_rust_workspace.py' + python3 -m unittest discover -s ops/ci/tests -p 'test_rust_compiler_baseline.py' + python3 -m unittest discover -s ops/ci/tests -p 'test_rust_dependencies.py' + python3 -m unittest discover -s ops/ci/tests -p 'test_rwx_materialize_linker.py' + python3 -m unittest discover -s ops/ci/migration/tests -p 'test_migration_rust_workspace.py' + python3 -m unittest discover -s ops/ci/tests -p 'test_rust_target_cache.py' + python3 -m unittest discover -s ops/ci/migration/tests -p 'test_compare_rust_extra.py' + python3 -m unittest discover -s ops/ci/tests -p 'test_rust_cannon.py' + python3 -m unittest discover -s ops/ci/migration/tests -p 'test_compare_rust_cannon.py' + cache: false + timeout: 10m + outputs: + filesystem: false + + - key: rust-tools + use: [bootstrap-inputs, tools] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-rust-ci == 'true' }} + call: ${{ run.dir }}/packages/toolchain-rust.yml + with: + mode: workspace + + - key: wasm-tools + use: rust-tools + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-rust-ci == 'true' }} + run: rustup target add wasm32-unknown-unknown wasm32-wasip1 + timeout: 30m + + - key: lint-tools + use: rust-tools + if: ${{ tasks.route.values.run-rust-ci == 'true' }} + run: | + mise install github:ggwpez/zepter github:crate-ci/typos github:EmbarkStudios/cargo-deny + printf '%s:%s\n' "$(mise bin-paths | paste -sd: -)" "$PATH" >"$RWX_ENV/PATH" + timeout: 30m + + - key: go-tools + use: rust-tools + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-rust-ci == 'true' }} + call: ${{ run.dir }}/packages/toolchain-go.yml + with: + mode: go + + # Fetch from the immutable compiler ancestor, so source-only edits reuse the + # same Cargo registry/checkouts even when PRs cannot write shared tool caches. + - key: rust-dependencies + use: compiler-source + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-rust-ci == 'true' }} + run: python3 ops/ci/runtime/rust-dependencies.py + env: + COMPILER_CACHE_EPOCH: ${{ init.cache-epoch }} + timeout: 30m + outputs: + filesystem: + filter: + workspace: [.ci/rust-cache/cargo] + system: [] + artifacts: + - key: report + path: .ci/rust-dependencies + + # Keep full source, Git metadata and the pinned submodule as build inputs. + - key: head-source + use: [rust-dependencies, code] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-rust-ci == 'true' }} + run: | + git reset --hard "$CI_COMMIT_SHA" + git clean -fdx -- rust + bash /usr/local/lib/optimism-ci/op-reth-shadow.sh source + env: + CI_COMMIT_SHA: ${{ init.commit-sha }} + timeout: 15m + + - key: feature-plan + use: head-source + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-rust-ci == 'true' }} + run: bash ops/ci/runtime/rust-workspace.sh feature-plan + env: &rust-env + CI_RUST_PROVIDER: rwx + CI_COMMIT_SHA: ${{ init.commit-sha }} + cache: false + timeout: 15m + outputs: + filesystem: false + artifacts: + - key: report + path: .ci/rust-workspace/feature-plan + + # Anchor compiler preparation at the last compiler/configuration change. + # Ordinary source edits reuse these immutable task results without granting + # PRs shared-cache writes. Fresh HEAD workers below still run every verdict. + - key: compiler-base + use: code + run: python3 ops/ci/runtime/rust-target-cache.py base > "$RWX_VALUES/sha" + outputs: + filesystem: false + + - key: compiler-code + call: git/clone 2.2.0 + with: + repository: https://github.com/ethereum-optimism/optimism.git + ref: ${{ tasks.compiler-base.values.sha }} + preserve-git-dir: true + fetch-full-depth: true + submodules: false + + # Build the ancestor toolchain from ancestor inputs too. Depending on the + # HEAD toolchain would carry changing checkout metadata into the cache key. + - key: compiler-tools + use: [mise, compiler-code] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-rust-ci == 'true' }} + call: ${{ run.dir }}/packages/toolchain-common.yml + + - key: compiler-rust-tools + use: [compiler-code, compiler-tools] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-rust-ci == 'true' }} + call: ${{ run.dir }}/packages/toolchain-rust.yml + with: + mode: workspace + + - key: compiler-source + use: [compiler-rust-tools, compiler-code] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-rust-ci == 'true' }} + run: | + git reset --hard "$COMPILER_BASE_SHA" + git clean -fdx -- rust + bash /usr/local/lib/optimism-ci/op-reth-shadow.sh source + env: + COMPILER_BASE_SHA: ${{ tasks.compiler-base.values.sha }} + timeout: 15m + + - key: tests-cache + use: rust-dependencies + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-rust-ci == 'true' }} + run: python3 ops/ci/runtime/rust-compiler-baseline.py tests-build + env: &compiler-base-env + COMPILER_CACHE_EPOCH: ${{ init.cache-epoch }} + CI_RUST_PROVIDER: rwx + CI_COMMIT_SHA: ${{ tasks.compiler-base.values.sha }} + CI_RUST_INCREMENTAL: ${{ init.cargo-incremental }} + timeout: 90m + runner: &test-runner + cpus: 16 + memory: 32gb + disk: 150gb + outputs: + filesystem: &test-compiler-output + filter: + workspace: [rust/target, .ci/rust-cache, rust/op-reth/crates/chainspec/res/superchain-configs.tar] + system: [] + artifacts: + - key: report + path: .ci/rust-workspace/compiler-baseline/tests-build + + - key: tests-build + use: [tests-cache, head-source] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-rust-ci == 'true' }} + run: bash ops/ci/runtime/rust-workspace.sh tests-build + env: &incremental-rust-env + <<: *rust-env + CI_RUST_INCREMENTAL: ${{ init.cargo-incremental }} + # Compile the current source afresh using the ancestor's compiler state. + cache: false + timeout: 90m + runner: *test-runner + outputs: + filesystem: *test-compiler-output + artifacts: + - key: report + path: .ci/rust-workspace/tests-build + - key: compiler-state + path: .ci/rust-workspace/tests-build/compiler.json + + # Execution-only nextest workers receive the verified test archive, never the + # full compiler snapshot. + - key: tests-unit + use: head-source + if: ${{ tasks.route.values.run-rust-ci == 'true' }} + run: bash ops/ci/runtime/rust-workspace.sh tests-unit + env: + <<: *incremental-rust-env + TEST_ARCHIVE: ${{ tasks.tests-build.artifacts.report }} + RWX_RUN_ID: + cache-key: included + RWX_TASK_ATTEMPT_NUMBER: + cache-key: included + cache: false + timeout: 90m + runner: *test-runner + outputs: + filesystem: false + test-results: + - path: .ci/rust-workspace/tests-unit/junit.xml + artifacts: + - key: report + path: .ci/rust-workspace/tests-unit + + # Compiler-dependent verdicts inherit the producer's immutable filesystem. + # Publish reports only: never pack, restore or republish the compiler tree. + - key: tests-compiler + use: [tests-build, head-source] + if: ${{ tasks.route.values.run-rust-ci == 'true' }} + run: bash ops/ci/runtime/rust-workspace.sh tests-compiler + env: + <<: *incremental-rust-env + COMPILED_STATE: ${{ tasks.tests-build.artifacts.compiler-state }} + RWX_RUN_ID: + cache-key: included + RWX_TASK_ATTEMPT_NUMBER: + cache-key: included + cache: false + timeout: 90m + runner: *test-runner + outputs: + filesystem: false + test-results: + - path: .ci/rust-workspace/tests-compiler/beacon.junit.xml + - path: .ci/rust-workspace/tests-compiler/doctests.junit.xml + artifacts: + - key: report + path: .ci/rust-workspace/tests-compiler + + # Preserve the existing full-suite artifact and task key. Finished expressions + # collect original child failures; compiler layers never reach this fan-in. + - key: tests + use: head-source + if: ${{ tasks.route.values.run-rust-ci == 'true' }} + after: ${{ tests-unit.finished && tests-compiler.finished }} + run: bash ops/ci/runtime/rust-workspace.sh tests-merge + env: + <<: *incremental-rust-env + UNIT_REPORT: ${{ tasks.tests-unit.artifacts.report }} + COMPILER_REPORT: ${{ tasks.tests-compiler.artifacts.report }} + cache: false + timeout: 10m + outputs: + filesystem: false + artifacts: + - key: report + path: .ci/rust-workspace/tests + + - key: doctest + use: head-source + if: ${{ tasks.route.values.run-rust-ci == 'true' }} + run: bash ops/ci/runtime/rust-workspace.sh doctest + env: &fresh-rust-env + <<: *rust-env + RWX_RUN_ID: + cache-key: included + RWX_TASK_ATTEMPT_NUMBER: + cache-key: included + tool-cache: rust-workspace-doctest-${{ init.cache-epoch }} + timeout: 90m + runner: &build-runner + cpus: 16 + memory: 32gb + outputs: + filesystem: &compiler-output + filter: + workspace: [rust/target, .ci/rust-cache, rust/op-reth/crates/chainspec/res/superchain-configs.tar] + system: [] + test-results: + - path: .ci/rust-workspace/doctest/doctests.junit.xml + artifacts: + - key: report + path: .ci/rust-workspace/doctest + + - key: build + use: head-source + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-rust-ci == 'true' }} + run: bash ops/ci/runtime/rust-workspace.sh build + env: *fresh-rust-env + tool-cache: rust-workspace-build-${{ init.cache-epoch }} + timeout: 90m + runner: + cpus: 8 + memory: 16gb + outputs: + filesystem: *compiler-output + artifacts: + - key: report + path: .ci/rust-workspace/build + + - key: docs + use: head-source + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-rust-ci == 'true' }} + run: bash ops/ci/runtime/rust-workspace.sh docs + env: *fresh-rust-env + tool-cache: rust-workspace-docs-${{ init.cache-epoch }} + timeout: 90m + runner: + cpus: 8 + memory: 16gb + outputs: + filesystem: *compiler-output + artifacts: + - key: report + path: .ci/rust-workspace/docs + + - key: clippy + use: head-source + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-rust-ci == 'true' }} + run: bash ops/ci/runtime/rust-workspace.sh clippy + env: *fresh-rust-env + tool-cache: rust-workspace-clippy-${{ init.cache-epoch }} + timeout: 90m + runner: + cpus: 4 + memory: 8gb + outputs: + filesystem: *compiler-output + artifacts: + - key: report + path: .ci/rust-workspace/clippy + + - key: no-std + use: head-source + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-rust-ci == 'true' }} + run: bash ops/ci/runtime/rust-workspace.sh no-std + env: *fresh-rust-env + tool-cache: rust-workspace-no-std-${{ init.cache-epoch }} + timeout: 90m + runner: + cpus: 2 + memory: 4gb + outputs: + filesystem: *compiler-output + artifacts: + - key: report + path: .ci/rust-workspace/no-std + + - key: udeps + use: head-source + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-rust-ci == 'true' }} + run: bash ops/ci/runtime/rust-workspace.sh udeps + env: *fresh-rust-env + tool-cache: rust-workspace-udeps-${{ init.cache-epoch }} + timeout: 90m + runner: + cpus: 4 + memory: 8gb + outputs: + filesystem: *compiler-output + artifacts: + - key: report + path: .ci/rust-workspace/udeps + + # Reuse compiler preparation; the separate consumer always checks this PR afresh. + - key: features-build-0 + use: rust-dependencies + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-rust-ci == 'true' }} + run: python3 ops/ci/runtime/rust-compiler-baseline.py features + env: + <<: *compiler-base-env + CI_RUST_INCREMENTAL: ${{ init.cargo-incremental }} + CI_RUST_PARTITION_INDEX: "0" + CI_RUST_PARTITION_TOTAL: "10" + timeout: 120m + runner: + cpus: 4 + memory: 8gb + outputs: + filesystem: *compiler-output + artifacts: + - key: report + path: .ci/rust-workspace/compiler-baseline/features-0 + + - key: features-0 + use: [features-build-0, head-source] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-rust-ci == 'true' }} + run: bash ops/ci/runtime/rust-workspace.sh features + env: + <<: *fresh-rust-env + CI_RUST_INCREMENTAL: ${{ init.cargo-incremental }} + CI_RUST_PARTITION_INDEX: "0" + CI_RUST_PARTITION_TOTAL: "10" + cache: false + timeout: 120m + runner: + cpus: 4 + memory: 8gb + outputs: + filesystem: false + artifacts: + - key: report + path: .ci/rust-workspace/features-0 + + # Reuse compiler preparation; the separate consumer always checks this PR afresh. + - key: features-build-1 + use: rust-dependencies + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-rust-ci == 'true' }} + run: python3 ops/ci/runtime/rust-compiler-baseline.py features + env: + <<: *compiler-base-env + CI_RUST_INCREMENTAL: ${{ init.cargo-incremental }} + CI_RUST_PARTITION_INDEX: "1" + CI_RUST_PARTITION_TOTAL: "10" + timeout: 120m + runner: + cpus: 4 + memory: 8gb + outputs: + filesystem: *compiler-output + artifacts: + - key: report + path: .ci/rust-workspace/compiler-baseline/features-1 + + - key: features-1 + use: [features-build-1, head-source] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-rust-ci == 'true' }} + run: bash ops/ci/runtime/rust-workspace.sh features + env: + <<: *fresh-rust-env + CI_RUST_INCREMENTAL: ${{ init.cargo-incremental }} + CI_RUST_PARTITION_INDEX: "1" + CI_RUST_PARTITION_TOTAL: "10" + cache: false + timeout: 120m + runner: + cpus: 4 + memory: 8gb + outputs: + filesystem: false + artifacts: + - key: report + path: .ci/rust-workspace/features-1 + + # Reuse compiler preparation; the separate consumer always checks this PR afresh. + - key: features-build-2 + use: rust-dependencies + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-rust-ci == 'true' }} + run: python3 ops/ci/runtime/rust-compiler-baseline.py features + env: + <<: *compiler-base-env + CI_RUST_INCREMENTAL: ${{ init.cargo-incremental }} + CI_RUST_PARTITION_INDEX: "2" + CI_RUST_PARTITION_TOTAL: "10" + timeout: 120m + runner: + cpus: 4 + memory: 8gb + outputs: + filesystem: *compiler-output + artifacts: + - key: report + path: .ci/rust-workspace/compiler-baseline/features-2 + + - key: features-2 + use: [features-build-2, head-source] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-rust-ci == 'true' }} + run: bash ops/ci/runtime/rust-workspace.sh features + env: + <<: *fresh-rust-env + CI_RUST_INCREMENTAL: ${{ init.cargo-incremental }} + CI_RUST_PARTITION_INDEX: "2" + CI_RUST_PARTITION_TOTAL: "10" + cache: false + timeout: 120m + runner: + cpus: 4 + memory: 8gb + outputs: + filesystem: false + artifacts: + - key: report + path: .ci/rust-workspace/features-2 + + # Reuse compiler preparation; the separate consumer always checks this PR afresh. + - key: features-build-3 + use: rust-dependencies + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-rust-ci == 'true' }} + run: python3 ops/ci/runtime/rust-compiler-baseline.py features + env: + <<: *compiler-base-env + CI_RUST_INCREMENTAL: ${{ init.cargo-incremental }} + CI_RUST_PARTITION_INDEX: "3" + CI_RUST_PARTITION_TOTAL: "10" + timeout: 120m + runner: + cpus: 4 + memory: 8gb + outputs: + filesystem: *compiler-output + artifacts: + - key: report + path: .ci/rust-workspace/compiler-baseline/features-3 + + - key: features-3 + use: [features-build-3, head-source] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-rust-ci == 'true' }} + run: bash ops/ci/runtime/rust-workspace.sh features + env: + <<: *fresh-rust-env + CI_RUST_INCREMENTAL: ${{ init.cargo-incremental }} + CI_RUST_PARTITION_INDEX: "3" + CI_RUST_PARTITION_TOTAL: "10" + cache: false + timeout: 120m + runner: + cpus: 4 + memory: 8gb + outputs: + filesystem: false + artifacts: + - key: report + path: .ci/rust-workspace/features-3 + + # Reuse compiler preparation; the separate consumer always checks this PR afresh. + - key: features-build-4 + use: rust-dependencies + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-rust-ci == 'true' }} + run: python3 ops/ci/runtime/rust-compiler-baseline.py features + env: + <<: *compiler-base-env + CI_RUST_INCREMENTAL: ${{ init.cargo-incremental }} + CI_RUST_PARTITION_INDEX: "4" + CI_RUST_PARTITION_TOTAL: "10" + timeout: 120m + runner: + cpus: 4 + memory: 8gb + outputs: + filesystem: *compiler-output + artifacts: + - key: report + path: .ci/rust-workspace/compiler-baseline/features-4 + + - key: features-4 + use: [features-build-4, head-source] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-rust-ci == 'true' }} + run: bash ops/ci/runtime/rust-workspace.sh features + env: + <<: *fresh-rust-env + CI_RUST_INCREMENTAL: ${{ init.cargo-incremental }} + CI_RUST_PARTITION_INDEX: "4" + CI_RUST_PARTITION_TOTAL: "10" + cache: false + timeout: 120m + runner: + cpus: 4 + memory: 8gb + outputs: + filesystem: false + artifacts: + - key: report + path: .ci/rust-workspace/features-4 + + # Reuse compiler preparation; the separate consumer always checks this PR afresh. + - key: features-build-5 + use: rust-dependencies + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-rust-ci == 'true' }} + run: python3 ops/ci/runtime/rust-compiler-baseline.py features + env: + <<: *compiler-base-env + CI_RUST_INCREMENTAL: ${{ init.cargo-incremental }} + CI_RUST_PARTITION_INDEX: "5" + CI_RUST_PARTITION_TOTAL: "10" + timeout: 120m + runner: + cpus: 4 + memory: 8gb + outputs: + filesystem: *compiler-output + artifacts: + - key: report + path: .ci/rust-workspace/compiler-baseline/features-5 + + - key: features-5 + use: [features-build-5, head-source] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-rust-ci == 'true' }} + run: bash ops/ci/runtime/rust-workspace.sh features + env: + <<: *fresh-rust-env + CI_RUST_INCREMENTAL: ${{ init.cargo-incremental }} + CI_RUST_PARTITION_INDEX: "5" + CI_RUST_PARTITION_TOTAL: "10" + cache: false + timeout: 120m + runner: + cpus: 4 + memory: 8gb + outputs: + filesystem: false + artifacts: + - key: report + path: .ci/rust-workspace/features-5 + + # Reuse compiler preparation; the separate consumer always checks this PR afresh. + - key: features-build-6 + use: rust-dependencies + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-rust-ci == 'true' }} + run: python3 ops/ci/runtime/rust-compiler-baseline.py features + env: + <<: *compiler-base-env + CI_RUST_INCREMENTAL: ${{ init.cargo-incremental }} + CI_RUST_PARTITION_INDEX: "6" + CI_RUST_PARTITION_TOTAL: "10" + timeout: 120m + runner: + cpus: 4 + memory: 8gb + outputs: + filesystem: *compiler-output + artifacts: + - key: report + path: .ci/rust-workspace/compiler-baseline/features-6 + + - key: features-6 + use: [features-build-6, head-source] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-rust-ci == 'true' }} + run: bash ops/ci/runtime/rust-workspace.sh features + env: + <<: *fresh-rust-env + CI_RUST_INCREMENTAL: ${{ init.cargo-incremental }} + CI_RUST_PARTITION_INDEX: "6" + CI_RUST_PARTITION_TOTAL: "10" + cache: false + timeout: 120m + runner: + cpus: 4 + memory: 8gb + outputs: + filesystem: false + artifacts: + - key: report + path: .ci/rust-workspace/features-6 + + # Reuse compiler preparation; the separate consumer always checks this PR afresh. + - key: features-build-7 + use: rust-dependencies + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-rust-ci == 'true' }} + run: python3 ops/ci/runtime/rust-compiler-baseline.py features + env: + <<: *compiler-base-env + CI_RUST_INCREMENTAL: ${{ init.cargo-incremental }} + CI_RUST_PARTITION_INDEX: "7" + CI_RUST_PARTITION_TOTAL: "10" + timeout: 120m + runner: + cpus: 4 + memory: 8gb + outputs: + filesystem: *compiler-output + artifacts: + - key: report + path: .ci/rust-workspace/compiler-baseline/features-7 + + - key: features-7 + use: [features-build-7, head-source] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-rust-ci == 'true' }} + run: bash ops/ci/runtime/rust-workspace.sh features + env: + <<: *fresh-rust-env + CI_RUST_INCREMENTAL: ${{ init.cargo-incremental }} + CI_RUST_PARTITION_INDEX: "7" + CI_RUST_PARTITION_TOTAL: "10" + cache: false + timeout: 120m + runner: + cpus: 4 + memory: 8gb + outputs: + filesystem: false + artifacts: + - key: report + path: .ci/rust-workspace/features-7 + + # Reuse compiler preparation; the separate consumer always checks this PR afresh. + - key: features-build-8 + use: rust-dependencies + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-rust-ci == 'true' }} + run: python3 ops/ci/runtime/rust-compiler-baseline.py features + env: + <<: *compiler-base-env + CI_RUST_INCREMENTAL: ${{ init.cargo-incremental }} + CI_RUST_PARTITION_INDEX: "8" + CI_RUST_PARTITION_TOTAL: "10" + timeout: 120m + runner: + cpus: 4 + memory: 8gb + outputs: + filesystem: *compiler-output + artifacts: + - key: report + path: .ci/rust-workspace/compiler-baseline/features-8 + + - key: features-8 + use: [features-build-8, head-source] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-rust-ci == 'true' }} + run: bash ops/ci/runtime/rust-workspace.sh features + env: + <<: *fresh-rust-env + CI_RUST_INCREMENTAL: ${{ init.cargo-incremental }} + CI_RUST_PARTITION_INDEX: "8" + CI_RUST_PARTITION_TOTAL: "10" + cache: false + timeout: 120m + runner: + cpus: 4 + memory: 8gb + outputs: + filesystem: false + artifacts: + - key: report + path: .ci/rust-workspace/features-8 + + # Reuse compiler preparation; the separate consumer always checks this PR afresh. + - key: features-build-9 + use: rust-dependencies + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-rust-ci == 'true' }} + run: python3 ops/ci/runtime/rust-compiler-baseline.py features + env: + <<: *compiler-base-env + CI_RUST_INCREMENTAL: ${{ init.cargo-incremental }} + CI_RUST_PARTITION_INDEX: "9" + CI_RUST_PARTITION_TOTAL: "10" + timeout: 120m + runner: + cpus: 4 + memory: 8gb + outputs: + filesystem: *compiler-output + artifacts: + - key: report + path: .ci/rust-workspace/compiler-baseline/features-9 + + - key: features-9 + use: [features-build-9, head-source] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-rust-ci == 'true' }} + run: bash ops/ci/runtime/rust-workspace.sh features + env: + <<: *fresh-rust-env + CI_RUST_INCREMENTAL: ${{ init.cargo-incremental }} + CI_RUST_PARTITION_INDEX: "9" + CI_RUST_PARTITION_TOTAL: "10" + cache: false + timeout: 120m + runner: + cpus: 4 + memory: 8gb + outputs: + filesystem: false + artifacts: + - key: report + path: .ci/rust-workspace/features-9 + + - key: wasm-unknown + use: [head-source, wasm-tools] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-rust-ci == 'true' }} + run: bash ops/ci/runtime/rust-workspace.sh wasm-unknown + env: *fresh-rust-env + tool-cache: rust-workspace-wasm-unknown-${{ init.cache-epoch }} + timeout: 90m + runner: + cpus: 2 + memory: 4gb + outputs: + filesystem: *compiler-output + test-results: + - path: .ci/rust-workspace/wasm-unknown/checks.junit.xml + artifacts: + - key: report + path: .ci/rust-workspace/wasm-unknown + + - key: wasm-wasi + use: [head-source, wasm-tools] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-rust-ci == 'true' }} + run: bash ops/ci/runtime/rust-workspace.sh wasm-wasi + env: *fresh-rust-env + tool-cache: rust-workspace-wasm-wasi-${{ init.cache-epoch }} + timeout: 90m + runner: + cpus: 2 + memory: 4gb + outputs: + filesystem: *compiler-output + test-results: + - path: .ci/rust-workspace/wasm-wasi/checks.junit.xml + artifacts: + - key: report + path: .ci/rust-workspace/wasm-wasi + + - key: zepter + use: [head-source, lint-tools] + if: ${{ tasks.route.values.run-rust-ci == 'true' }} + run: bash ops/ci/runtime/rust-workspace.sh zepter + env: *fresh-rust-env + tool-cache: rust-workspace-zepter-${{ init.cache-epoch }} + timeout: 90m + runner: + cpus: 2 + memory: 4gb + outputs: + filesystem: *compiler-output + test-results: + - path: .ci/rust-workspace/zepter/checks.junit.xml + artifacts: + - key: report + path: .ci/rust-workspace/zepter + + - key: deny + use: [head-source, lint-tools] + if: ${{ tasks.route.values.run-rust-ci == 'true' }} + run: bash ops/ci/runtime/rust-workspace.sh deny + env: *fresh-rust-env + cache: false + timeout: 90m + runner: + cpus: 2 + memory: 4gb + outputs: + filesystem: false + test-results: + - path: .ci/rust-workspace/deny/checks.junit.xml + artifacts: + - key: report + path: .ci/rust-workspace/deny + + - key: typos + use: [head-source, lint-tools] + if: ${{ tasks.route.values.run-rust-ci == 'true' }} + run: bash ops/ci/runtime/rust-workspace.sh typos + env: *fresh-rust-env + tool-cache: rust-workspace-typos-${{ init.cache-epoch }} + timeout: 90m + runner: + cpus: 2 + memory: 4gb + outputs: + filesystem: *compiler-output + test-results: + - path: .ci/rust-workspace/typos/checks.junit.xml + artifacts: + - key: report + path: .ci/rust-workspace/typos + + - key: registry + use: head-source + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-rust-ci == 'true' }} + run: bash ops/ci/runtime/rust-workspace.sh registry + env: *fresh-rust-env + tool-cache: rust-workspace-registry-${{ init.cache-epoch }} + timeout: 90m + runner: + cpus: 2 + memory: 4gb + outputs: + filesystem: *compiler-output + test-results: + - path: .ci/rust-workspace/registry/checks.junit.xml + artifacts: + - key: report + path: .ci/rust-workspace/registry + + - key: interop + use: [head-source, go-tools] + if: ${{ tasks.route.values.run-rust-ci == 'true' }} + run: bash ops/ci/runtime/rust-workspace.sh interop + env: *fresh-rust-env + tool-cache: rust-workspace-interop-${{ init.cache-epoch }} + timeout: 90m + runner: + cpus: 2 + memory: 4gb + outputs: + filesystem: + filter: + workspace: [rust/target, .ci/rust-cache, .ci/interop-go, rust/op-reth/crates/chainspec/res/superchain-configs.tar] + system: [] + test-results: + - path: .ci/rust-workspace/interop/checks.junit.xml + artifacts: + - key: report + path: .ci/rust-workspace/interop + + # Preserve Docker/BuildKit data through the normal use dependency, without + # exporting image tarballs. The original recipe builds all configured ELFs. + - key: cannon-env + use: [head-source, cannon-witness] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-rust-ci == 'true' }} + run: bash ops/ci/runtime/rust-cannon.sh env + env: *rust-env + docker: preserve-data + tool-cache: rust-cannon-env-${{ init.cache-epoch }} + timeout: 90m + runner: + cpus: 8 + memory: 32gb + outputs: + filesystem: *compiler-output + artifacts: + - key: report + path: .ci/rust-workspace/cannon-env + + - key: cannon-go + use: [head-source, go-tools] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-rust-ci == 'true' }} + run: bash ops/ci/runtime/rust-cannon.sh go + env: *rust-env + tool-cache: rust-cannon-go-${{ init.cache-epoch }} + timeout: 30m + runner: + cpus: 8 + memory: 32gb + outputs: + filesystem: + filter: + workspace: [cannon/bin, cannon/multicannon/embeds, .ci/cannon-cache/go] + system: [] + artifacts: + - key: report + path: .ci/rust-workspace/cannon-go + + # Fail a missing/corrupt public fixture before the expensive environment build. + - key: cannon-witness + use: head-source + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-rust-ci == 'true' }} + run: bash ops/ci/runtime/rust-cannon.sh witness + env: *rust-env + timeout: 15m + outputs: + filesystem: + filter: + workspace: [rust/kona/bin/client/testdata/*.tar.zst, rust/kona/bin/client/testdata/*.etag] + system: [] + artifacts: + - key: report + path: .ci/rust-workspace/cannon-witness + + - key: cannon-lint + use: [head-source, cannon-env] + if: ${{ tasks.route.values.run-rust-ci == 'true' }} + run: bash ops/ci/runtime/rust-cannon.sh lint + env: + <<: *fresh-rust-env + CANNON_ENV_ARTIFACT: ${{ tasks.cannon-env.artifacts.report }} + docker: preserve-data + tool-cache: rust-cannon-lint-${{ init.cache-epoch }} + timeout: 90m + runner: + cpus: 8 + memory: 32gb + outputs: + filesystem: *compiler-output + test-results: + - path: .ci/rust-workspace/cannon-lint/checks.junit.xml + artifacts: + - key: report + path: .ci/rust-workspace/cannon-lint + + - key: cannon-build + use: [head-source, cannon-env] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-rust-ci == 'true' }} + run: bash ops/ci/runtime/rust-cannon.sh build + env: + <<: *fresh-rust-env + CANNON_ENV_ARTIFACT: ${{ tasks.cannon-env.artifacts.report }} + docker: preserve-data + tool-cache: rust-cannon-build-${{ init.cache-epoch }} + timeout: 90m + runner: + cpus: 8 + memory: 32gb + outputs: + filesystem: *compiler-output + test-results: + - path: .ci/rust-workspace/cannon-build/checks.junit.xml + artifacts: + - key: report + path: .ci/rust-workspace/cannon-build + + - key: cannon-offline + use: [head-source, go-tools, cannon-witness, cannon-go, cannon-build] + if: ${{ tasks.route.values.run-rust-ci == 'true' }} + run: bash ops/ci/runtime/rust-cannon.sh offline + env: + <<: *fresh-rust-env + CANNON_GO_ARTIFACT: ${{ tasks.cannon-go.artifacts.report }} + CANNON_WITNESS_ARTIFACT: ${{ tasks.cannon-witness.artifacts.report }} + CANNON_BUILD_ARTIFACT: ${{ tasks.cannon-build.artifacts.report }} + docker: preserve-data + tool-cache: rust-cannon-offline-${{ init.cache-epoch }} + timeout: 90m + runner: + cpus: 8 + memory: 32gb + outputs: + filesystem: + filter: + workspace: [rust/target, .ci/rust-cache, .ci/cannon-cache] + system: [] + test-results: + - path: .ci/rust-workspace/cannon-offline/checks.junit.xml + artifacts: + - key: report + path: .ci/rust-workspace/cannon-offline + + # Terminal task states preserve exact Rust dependencies without Main-only failures. + - key: rust-gate-receipt + use: [code, tools] + if: ${{ init.cache-warm != 'true' }} + after: ${{ (build.succeeded || build.failed || build.skipped) && (cannon-build.succeeded || cannon-build.failed || cannon-build.skipped) && (cannon-lint.succeeded || cannon-lint.failed || cannon-lint.skipped) && (cannon-offline.succeeded || cannon-offline.failed || cannon-offline.skipped) && (clippy.succeeded || clippy.failed || clippy.skipped) && (deny.succeeded || deny.failed || deny.skipped) && (docs.succeeded || docs.failed || docs.skipped) && (doctest.succeeded || doctest.failed || doctest.skipped) && (features-0.succeeded || features-0.failed || features-0.skipped) && (features-1.succeeded || features-1.failed || features-1.skipped) && (features-2.succeeded || features-2.failed || features-2.skipped) && (features-3.succeeded || features-3.failed || features-3.skipped) && (features-4.succeeded || features-4.failed || features-4.skipped) && (features-5.succeeded || features-5.failed || features-5.skipped) && (features-6.succeeded || features-6.failed || features-6.skipped) && (features-7.succeeded || features-7.failed || features-7.skipped) && (features-8.succeeded || features-8.failed || features-8.skipped) && (features-9.succeeded || features-9.failed || features-9.skipped) && (interop.succeeded || interop.failed || interop.skipped) && (no-std.succeeded || no-std.failed || no-std.skipped) && (registry.succeeded || registry.failed || registry.skipped) && (tests.succeeded || tests.failed || tests.skipped) && (tests-compiler.succeeded || tests-compiler.failed || tests-compiler.skipped) && (tests-unit.succeeded || tests-unit.failed || tests-unit.skipped) && (typos.succeeded || typos.failed || typos.skipped) && (udeps.succeeded || udeps.failed || udeps.skipped) && (wasm-unknown.succeeded || wasm-unknown.failed || wasm-unknown.skipped) && (wasm-wasi.succeeded || wasm-wasi.failed || wasm-wasi.skipped) && (zepter.succeeded || zepter.failed || zepter.skipped) }} + run: python3 ops/ci/runtime/pr-gate.py receipt rust-workspace + env: + CI_COMMIT_SHA: ${{ init.commit-sha }} + CI_BRANCH: ${{ init.branch }} + GROUP_SELECTED: ${{ tasks.route.values.run-rust-ci }} + RWX_RUN_ID: + cache-key: included + RWX_TASK_ATTEMPT_NUMBER: + cache-key: included + TASK_BUILD_SUCCEEDED: ${{ tasks.build.succeeded }} + TASK_BUILD_FAILED: ${{ tasks.build.failed }} + TASK_BUILD_SKIPPED: ${{ tasks.build.skipped }} + TASK_CANNON_BUILD_SUCCEEDED: ${{ tasks.cannon-build.succeeded }} + TASK_CANNON_BUILD_FAILED: ${{ tasks.cannon-build.failed }} + TASK_CANNON_BUILD_SKIPPED: ${{ tasks.cannon-build.skipped }} + TASK_CANNON_LINT_SUCCEEDED: ${{ tasks.cannon-lint.succeeded }} + TASK_CANNON_LINT_FAILED: ${{ tasks.cannon-lint.failed }} + TASK_CANNON_LINT_SKIPPED: ${{ tasks.cannon-lint.skipped }} + TASK_CANNON_OFFLINE_SUCCEEDED: ${{ tasks.cannon-offline.succeeded }} + TASK_CANNON_OFFLINE_FAILED: ${{ tasks.cannon-offline.failed }} + TASK_CANNON_OFFLINE_SKIPPED: ${{ tasks.cannon-offline.skipped }} + TASK_CLIPPY_SUCCEEDED: ${{ tasks.clippy.succeeded }} + TASK_CLIPPY_FAILED: ${{ tasks.clippy.failed }} + TASK_CLIPPY_SKIPPED: ${{ tasks.clippy.skipped }} + TASK_DOCS_SUCCEEDED: ${{ tasks.docs.succeeded }} + TASK_DOCS_FAILED: ${{ tasks.docs.failed }} + TASK_DOCS_SKIPPED: ${{ tasks.docs.skipped }} + TASK_DOCTEST_SUCCEEDED: ${{ tasks.doctest.succeeded }} + TASK_DOCTEST_FAILED: ${{ tasks.doctest.failed }} + TASK_DOCTEST_SKIPPED: ${{ tasks.doctest.skipped }} + TASK_DENY_SUCCEEDED: ${{ tasks.deny.succeeded }} + TASK_DENY_FAILED: ${{ tasks.deny.failed }} + TASK_DENY_SKIPPED: ${{ tasks.deny.skipped }} + TASK_FEATURES_0_SUCCEEDED: ${{ tasks.features-0.succeeded }} + TASK_FEATURES_0_FAILED: ${{ tasks.features-0.failed }} + TASK_FEATURES_0_SKIPPED: ${{ tasks.features-0.skipped }} + TASK_FEATURES_1_SUCCEEDED: ${{ tasks.features-1.succeeded }} + TASK_FEATURES_1_FAILED: ${{ tasks.features-1.failed }} + TASK_FEATURES_1_SKIPPED: ${{ tasks.features-1.skipped }} + TASK_FEATURES_2_SUCCEEDED: ${{ tasks.features-2.succeeded }} + TASK_FEATURES_2_FAILED: ${{ tasks.features-2.failed }} + TASK_FEATURES_2_SKIPPED: ${{ tasks.features-2.skipped }} + TASK_FEATURES_3_SUCCEEDED: ${{ tasks.features-3.succeeded }} + TASK_FEATURES_3_FAILED: ${{ tasks.features-3.failed }} + TASK_FEATURES_3_SKIPPED: ${{ tasks.features-3.skipped }} + TASK_FEATURES_4_SUCCEEDED: ${{ tasks.features-4.succeeded }} + TASK_FEATURES_4_FAILED: ${{ tasks.features-4.failed }} + TASK_FEATURES_4_SKIPPED: ${{ tasks.features-4.skipped }} + TASK_FEATURES_5_SUCCEEDED: ${{ tasks.features-5.succeeded }} + TASK_FEATURES_5_FAILED: ${{ tasks.features-5.failed }} + TASK_FEATURES_5_SKIPPED: ${{ tasks.features-5.skipped }} + TASK_FEATURES_6_SUCCEEDED: ${{ tasks.features-6.succeeded }} + TASK_FEATURES_6_FAILED: ${{ tasks.features-6.failed }} + TASK_FEATURES_6_SKIPPED: ${{ tasks.features-6.skipped }} + TASK_FEATURES_7_SUCCEEDED: ${{ tasks.features-7.succeeded }} + TASK_FEATURES_7_FAILED: ${{ tasks.features-7.failed }} + TASK_FEATURES_7_SKIPPED: ${{ tasks.features-7.skipped }} + TASK_FEATURES_8_SUCCEEDED: ${{ tasks.features-8.succeeded }} + TASK_FEATURES_8_FAILED: ${{ tasks.features-8.failed }} + TASK_FEATURES_8_SKIPPED: ${{ tasks.features-8.skipped }} + TASK_FEATURES_9_SUCCEEDED: ${{ tasks.features-9.succeeded }} + TASK_FEATURES_9_FAILED: ${{ tasks.features-9.failed }} + TASK_FEATURES_9_SKIPPED: ${{ tasks.features-9.skipped }} + TASK_INTEROP_SUCCEEDED: ${{ tasks.interop.succeeded }} + TASK_INTEROP_FAILED: ${{ tasks.interop.failed }} + TASK_INTEROP_SKIPPED: ${{ tasks.interop.skipped }} + TASK_NO_STD_SUCCEEDED: ${{ tasks.no-std.succeeded }} + TASK_NO_STD_FAILED: ${{ tasks.no-std.failed }} + TASK_NO_STD_SKIPPED: ${{ tasks.no-std.skipped }} + TASK_REGISTRY_SUCCEEDED: ${{ tasks.registry.succeeded }} + TASK_REGISTRY_FAILED: ${{ tasks.registry.failed }} + TASK_REGISTRY_SKIPPED: ${{ tasks.registry.skipped }} + TASK_TESTS_COMPILER_SUCCEEDED: ${{ tasks.tests-compiler.succeeded }} + TASK_TESTS_COMPILER_FAILED: ${{ tasks.tests-compiler.failed }} + TASK_TESTS_COMPILER_SKIPPED: ${{ tasks.tests-compiler.skipped }} + TASK_TESTS_UNIT_SUCCEEDED: ${{ tasks.tests-unit.succeeded }} + TASK_TESTS_UNIT_FAILED: ${{ tasks.tests-unit.failed }} + TASK_TESTS_UNIT_SKIPPED: ${{ tasks.tests-unit.skipped }} + TASK_TESTS_SUCCEEDED: ${{ tasks.tests.succeeded }} + TASK_TESTS_FAILED: ${{ tasks.tests.failed }} + TASK_TESTS_SKIPPED: ${{ tasks.tests.skipped }} + TASK_TYPOS_SUCCEEDED: ${{ tasks.typos.succeeded }} + TASK_TYPOS_FAILED: ${{ tasks.typos.failed }} + TASK_TYPOS_SKIPPED: ${{ tasks.typos.skipped }} + TASK_UDEPS_SUCCEEDED: ${{ tasks.udeps.succeeded }} + TASK_UDEPS_FAILED: ${{ tasks.udeps.failed }} + TASK_UDEPS_SKIPPED: ${{ tasks.udeps.skipped }} + TASK_WASM_UNKNOWN_SUCCEEDED: ${{ tasks.wasm-unknown.succeeded }} + TASK_WASM_UNKNOWN_FAILED: ${{ tasks.wasm-unknown.failed }} + TASK_WASM_UNKNOWN_SKIPPED: ${{ tasks.wasm-unknown.skipped }} + TASK_WASM_WASI_SUCCEEDED: ${{ tasks.wasm-wasi.succeeded }} + TASK_WASM_WASI_FAILED: ${{ tasks.wasm-wasi.failed }} + TASK_WASM_WASI_SKIPPED: ${{ tasks.wasm-wasi.skipped }} + TASK_ZEPTER_SUCCEEDED: ${{ tasks.zepter.succeeded }} + TASK_ZEPTER_FAILED: ${{ tasks.zepter.failed }} + TASK_ZEPTER_SKIPPED: ${{ tasks.zepter.skipped }} + cache: false + timeout: 10m + outputs: + filesystem: false + artifacts: + - key: receipt + path: .ci/pr-gates/groups/rust-workspace diff --git a/.rwx/selector-upload.yml b/.rwx/selector-upload.yml new file mode 100644 index 00000000000..bbcac470347 --- /dev/null +++ b/.rwx/selector-upload.yml @@ -0,0 +1,168 @@ +# Execute the original selector publisher against a private official registry. +on: + cache-rebuild: + if: ${{ event.git.branch == 'develop' }} + target: [registry-images, prepare] + init: + commit-sha: ${{ event.git.sha }} + branch: ${{ event.git.branch }} + tag: "" + cache-warm: "true" + cache-epoch: v1 + github: + push: + init: + commit-sha: ${{ event.git.sha }} + branch: ${{ event.git.branch }} + tag: ${{ event.git.tag }} + cache-warm: "false" + cache-epoch: v1 + status-checks: + name: optimism-selector-upload-shadow + cli: + init: + commit-sha: ${{ event.git.sha }} + branch: ${{ event.git.branch }} + tag: "" + cache-warm: "false" + cache-epoch: v1 + +tool-cache: + vault: optimism-op-reth-shadow + +base: + image: ubuntu:24.04@sha256:008173c23f95b170204355c12626cb5a965d779a7e1283b09e9cffbb1bf33ca3 + config: rwx/base 1.2.0 + arch: x86_64 + +defaults: + runner: {cpus: 2, memory: 8gb} + +tasks: + - key: code + call: git/clone 2.2.0 + with: + repository: https://github.com/ethereum-optimism/optimism.git + ref: ${{ init.commit-sha }} + preserve-git-dir: true + fetch-full-depth: true + submodules: false + + - key: mise + call: mise/install 1.1.0 + with: + mise-version: "2026.2.2" + install: "false" + + - key: tools + use: [code, mise] + run: bash ops/ci/runtime/rwx-prepare.sh + timeout: 30m + + - key: route + use: [code, tools] + run: bash ops/ci/runtime/rwx-metadata.sh + env: + CI_EVENT: push + CI_CACHE_WARM: ${{ init.cache-warm }} + CI_BRANCH: ${{ init.branch }} + CI_TAG: ${{ init.tag }} + CI_COMMIT_SHA: ${{ init.commit-sha }} + cache: false + timeout: 10m + outputs: + filesystem: false + artifacts: + - key: routing + path: .ci/pipeline-parameters.json + + - key: contract-tools + use: [code, tools] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + run: | + bash ops/ci/runtime/rwx-contracts-prepare.sh tools + bash ops/ci/runtime/apt-install.sh iproute2 openssl + timeout: 30m + + - key: registry-images + use: [code, tools] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + docker: preserve-data + run: python3 ops/ci/migration/selector-registry.py images .ci/selector-registry + timeout: 45m + runner: {cpus: 8, memory: 16gb} + outputs: + artifacts: + - key: images + path: .ci/selector-registry + + - key: source + use: [code, contract-tools] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + run: | + git submodule sync --recursive + for attempt in 1 2 3 4 5; do + if git -c protocol.file.allow=never submodule update --init --recursive --jobs 8; then break; fi + if [ "$attempt" = 5 ]; then exit 1; fi + sleep "$((2 ** attempt))" + done + timeout: 20m + + - key: prepare + use: source + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + run: python3 ops/ci/migration/selector-upload.py prepare .ci/selector-upload/prepare + env: + CI_COMMIT_SHA: ${{ init.commit-sha }} + CI_BRANCH: ${{ init.branch }} + CI_CHECK_PROVIDER: rwx + tool-cache: selector-upload-abi-v2-${{ init.cache-epoch }} + timeout: 40m + runner: {cpus: 16, memory: 32gb} + outputs: + filesystem: + filter: + workspace: [packages/contracts-bedrock/cache, packages/contracts-bedrock/forge-artifacts, packages/contracts-bedrock/artifacts, packages/contracts-bedrock/foundry-pp] + system: [/root/.svm, /home/*/.svm] + artifacts: + - key: compiled + path: .ci/selector-upload/prepare + + - key: helper-tests + use: [code, contract-tools, registry-images] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-main == 'true' }} + docker: true + run: | + python3 -m unittest discover -s ops/ci/migration/tests -p 'test*selector_upload.py' + python3 ops/ci/migration/selector-registry.py fixture "$REGISTRY_IMAGES/sourcify" .ci/selector-upload/fixtures + env: + REGISTRY_IMAGES: ${{ tasks.registry-images.artifacts.images }} + cache: false + timeout: 10m + outputs: + filesystem: false + artifacts: + - key: original-failure-fixtures + path: .ci/selector-upload/fixtures + + - key: upload + use: [source, prepare, registry-images] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-main == 'true' }} + docker: true + run: | + python3 ops/ci/migration/selector-upload.py run .ci/selector-upload/run "$COMPILED" \ + "$REGISTRY_IMAGES/sourcify" "$REGISTRY_IMAGES/images.json" + env: + CI_COMMIT_SHA: ${{ init.commit-sha }} + CI_BRANCH: ${{ init.branch }} + CI_CHECK_PROVIDER: rwx + COMPILED: ${{ tasks.prepare.artifacts.compiled }} + REGISTRY_IMAGES: ${{ tasks.registry-images.artifacts.images }} + cache: false + timeout: 60m + runner: {cpus: 8, memory: 16gb} + outputs: + filesystem: false + artifacts: + - key: report + path: .ci/selector-upload/run diff --git a/.rwx/sp1-guest.yml b/.rwx/sp1-guest.yml new file mode 100644 index 00000000000..74107b0e175 --- /dev/null +++ b/.rwx/sp1-guest.yml @@ -0,0 +1,218 @@ +# Complete SP1 guest ELF build and fresh original checks; Circle retains required ownership. +on: + cache-rebuild: + if: ${{ event.git.branch == 'develop' }} + target: [build] + init: + commit-sha: ${{ event.git.sha }} + branch: ${{ event.git.branch }} + tag: "" + cache-warm: "true" + cache-epoch: v1 + target-cache-mode: keep + cli: + init: + commit-sha: ${{ event.git.sha }} + branch: ${{ event.git.branch }} + tag: "" + cache-warm: "false" + cache-epoch: v1 + target-cache-mode: keep + +tool-cache: + vault: optimism-op-reth-shadow + +base: + image: ubuntu:24.04@sha256:008173c23f95b170204355c12626cb5a965d779a7e1283b09e9cffbb1bf33ca3 + config: rwx/base 1.2.0 + arch: x86_64 + +defaults: + runner: + cpus: 2 + memory: 8gb + +tasks: + - key: code + call: git/clone 2.2.0 + with: + repository: https://github.com/ethereum-optimism/optimism.git + ref: ${{ init.commit-sha }} + preserve-git-dir: true + fetch-full-depth: true + submodules: false + + - key: bootstrap-inputs + use: code + run: 'true' + filter: [mise.toml, ops/ci/runtime] + outputs: + filesystem: + filter: + workspace: [mise.toml, ops/ci/runtime/apt-install.sh, ops/ci/runtime/rwx-prepare.sh, ops/ci/runtime/rwx-contracts-prepare.sh, ops/ci/runtime/rwx-rust-prepare.sh, ops/ci/runtime/op-reth-shadow.sh, ops/ci/runtime/op-reth-report.py, ops/ci/runtime/rust-target-cache.py] + system: [] + artifacts: + - key: mise-config + path: mise.toml + - key: ci-scripts + path: ops/ci/runtime + - key: apt-script + path: ops/ci/runtime/apt-install.sh + + - key: mise + call: mise/install 1.1.0 + with: + mise-version: "2026.2.2" + install: "false" + + - key: tools + use: [mise, bootstrap-inputs] + call: ${{ run.dir }}/packages/toolchain-common.yml + + - key: route + use: [code, tools] + run: bash ops/ci/runtime/rwx-metadata.sh + env: + CI_EVENT: push + CI_CACHE_WARM: ${{ init.cache-warm }} + CI_BRANCH: ${{ init.branch }} + CI_TAG: ${{ init.tag }} + CI_COMMIT_SHA: ${{ init.commit-sha }} + cache: false + timeout: 10m + outputs: + filesystem: false + artifacts: + - key: routing + path: .ci/pipeline-parameters.json + + - key: rust-tools + use: [bootstrap-inputs, tools] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + call: ${{ run.dir }}/packages/toolchain-rust.yml + with: + mode: sp1 + + - key: toolchain + use: [code, rust-tools] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + run: python3 ops/ci/runtime/sp1-guest.py --provider rwx --phase toolchain + filter: + - mise.toml + - rust/Cargo.toml + - rust/Cargo.lock + - rust/justfile + - rust/kona/sp1/programs/Cargo.toml + - rust/kona/sp1/programs/Cargo.lock + - rust/kona/sp1/justfile + - rust/rust-toolchain.toml + - rust/.cargo/config.toml + - ops/ci/runtime/sp1-guest.py + - ops/ci/runtime/sp1-guest-native-build.py + - ops/ci/runtime/sp1-guest-toolchain.sh + - ops/ci/runtime/rust-workspace-report.py + - ops/ci/runtime/ci-report.py + - ops/ci/runtime/rust-target-cache.py + timeout: 40m + outputs: + artifacts: + - key: reports + path: .ci/sp1-guest/toolchain + + - key: build + use: [code, toolchain] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-main == 'true' }} + run: python3 ops/ci/runtime/sp1-guest.py --provider rwx --phase build --features test-config-fallback + env: + CI: "true" + CI_COMMIT_SHA: ${{ init.commit-sha }} + CI_BRANCH: ${{ init.branch }} + CARGO_INCREMENTAL: "0" + SP1_GUEST_TARGET_MODE: ${{ init.target-cache-mode }} + tool-cache: sp1-guest-canonical-elf-${{ init.cache-epoch }} + timeout: 90m + runner: + cpus: 8 + memory: 16gb + outputs: + filesystem: + filter: + workspace: [.ci/sp1-cache/cargo, .ci/sp1-cache/elf-target, .ci/sp1-cache/elf-sccache] + system: [] + artifacts: + - key: dependency + path: .ci/sp1-guest/dependency + + - key: helper-tests + use: [code, toolchain] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-main == 'true' }} + run: | + RWX_LIVE_SP1_FIXTURE=1 python3 -m unittest discover -s ops/ci/tests -p 'test_sp1_guest.py' + RWX_LIVE_SP1_FIXTURE=1 python3 -m unittest discover -s ops/ci/migration/tests -p 'test_migration_sp1_guest.py' + env: + SP1_GUEST_ARTIFACT: ${{ tasks.build.artifacts.dependency }} + SP1_GUEST_REPORT: ${{ tasks.check.artifacts.reports }} + cache: false + timeout: 15m + outputs: + filesystem: false + artifacts: + - key: fixtures + path: .ci/sp1-guest/helper-fixtures + + - key: check + use: [code, toolchain] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-main == 'true' }} + run: python3 ops/ci/runtime/sp1-guest.py --provider rwx --phase checks --features test-config-fallback --artifact "$SP1_GUEST_ARTIFACT" + env: + CI: "true" + CI_COMMIT_SHA: ${{ init.commit-sha }} + CI_BRANCH: ${{ init.branch }} + CARGO_INCREMENTAL: "0" + SP1_GUEST_TARGET_MODE: ${{ init.target-cache-mode }} + SP1_GUEST_ARTIFACT: ${{ tasks.build.artifacts.dependency }} + RWX_RUN_ID: + cache-key: included + RWX_TASK_ATTEMPT_NUMBER: + cache-key: included + tool-cache: sp1-guest-checks-${{ init.cache-epoch }} + cache: false + timeout: 90m + runner: + cpus: 8 + memory: 16gb + outputs: + filesystem: + filter: + workspace: [.ci/sp1-cache/cargo, .ci/sp1-cache/checks-target, .ci/sp1-cache/checks-sccache] + system: [] + test-results: + - path: .ci/sp1-guest/run/*.junit.xml + artifacts: + - key: reports + path: .ci/sp1-guest/run + + # Exact Main dependency states; unrelated workload failures stay outside this gate. + - key: main-gate-receipt + use: [code, tools] + after: ${{ (check.succeeded || check.failed || check.skipped) }} + if: ${{ init.cache-warm != 'true' }} + run: python3 ops/ci/runtime/pr-gate.py receipt main-sp1 + env: + CI_COMMIT_SHA: ${{ init.commit-sha }} + CI_BRANCH: ${{ init.branch }} + GROUP_SELECTED: ${{ tasks.route.values.run-main }} + RWX_RUN_ID: + cache-key: included + RWX_TASK_ATTEMPT_NUMBER: + cache-key: included + TASK_CHECK_SUCCEEDED: ${{ tasks.check.succeeded }} + TASK_CHECK_FAILED: ${{ tasks.check.failed }} + TASK_CHECK_SKIPPED: ${{ tasks.check.skipped }} + cache: false + timeout: 10m + outputs: + filesystem: false + artifacts: + - key: receipt + path: .ci/pr-gates/groups/main-sp1 diff --git a/docs/ai/ci-config-review.md b/docs/ai/ci-config-review.md index bc48412142a..5b219d17f1a 100644 --- a/docs/ai/ci-config-review.md +++ b/docs/ai/ci-config-review.md @@ -1,8 +1,9 @@ # CI Config Review -Checklist for reviewing changes to `.circleci/` and `.github/workflows/`. The -repo-specific items are the high-priority ones — they're where the real bugs -hide. For each changed file, walk the relevant items and look for the bad pattern. +Checklist for reviewing changes to `.circleci/`, `.rwx/`, `ops/ci/`, and +`.github/workflows/`. The repo-specific items are the high-priority ones — they're +where the real bugs hide. For each changed file, walk the relevant items and look +for the bad pattern. ## How CI is wired here @@ -13,10 +14,12 @@ hide. For each changed file, walk the relevant items and look for the bad patter toolset (`utils/install-mise`): it always finishes before any continuation job starts, so on a cold cache it is the only job that installs over the network — continuation jobs restore the mise cache it saved. -- **Routing is data + logic split**: `routing.yml` holds the declarative data +- **Routing is data + logic split**: `ops/ci/runtime/routing.yml` holds the declarative data (schedule→workflows, API dispatch flag→workflows, change-detection patterns, - passthrough params); `compute-workflow-conditions.sh` holds the conditions that - decide which entries fire. Add a schedule/dispatch/pattern by editing `routing.yml`. + passthrough params); `ops/ci/runtime/compute-workflow-conditions.sh` holds the conditions + that decide which entries fire. CircleCI scripts adapt its pipeline metadata; + `.circleci/routing.yml` points to the shared data. Add a schedule/dispatch/pattern + by editing the shared `routing.yml`, and validate the CircleCI adapter too. - **The real config is merged from fragments** under `.circleci/continue/` (`helpers.yml` → `main.yml` → `rust-ci.yml` → `rust-e2e.yml` → `rust-nightly-bump.yml`) by `merge-configs.sh`. **Merge is later-wins**: a key @@ -26,7 +29,9 @@ hide. For each changed file, walk the relevant items and look for the bad patter params; `detect`/`detect_all` match the `routing.yml` change patterns against the changed files (`detect` true if *any* file matches, `detect_all` only if *every* file matches). `workflow-helpers.sh` sets the `c-run_*` flags; - `test-decision-tree.sh` asserts the routing policy. + `ops/ci/tests/test-decision-tree.sh` asserts the routing policy, real changed-file + fixtures. `ops/ci/migration/tests/test-circle-adapter.sh` adds CircleCI adapter parity. `.rwx/` and `ops/ci/` changes select the + same CI, contract and Rust validation as `.circleci/` changes. - **The gate**: the GitHub `enforce-ci-checks-develop` ruleset requires exactly four checks — `ci-gate`, `required-contracts-ci`, `required-rust-ci`, `required-rust-e2e`. These are fan-in jobs (no work, just `requires:`). A merge @@ -38,6 +43,11 @@ hide. For each changed file, walk the relevant items and look for the bad patter ## Validating a change locally +For the RWX pilot, use [rwx-migration.md](rwx-migration.md). The pilot must keep +distinct check names and must not silently remove a CircleCI gate dependency or +enable an additional publisher. Validate shared routing changes through both the +shared tests and the existing CircleCI entrypoints. + Because the real config is merged from fragments, validate the **merged** file, not a single fragment: @@ -45,16 +55,20 @@ single fragment: # 1. Merge the fragments into /tmp/merged-config.yml (uses mise's yq; resolves anchors). mise exec -- bash .circleci/scripts/merge-configs.sh -# 2. Validate it. --org-slug is REQUIRED: the private org orb +# 2. Validate it. --org is REQUIRED: the private org orb # ethereum-optimism/circleci-utils won't resolve without it (and the CLI -# needs CIRCLECI_CLI_TOKEN set to resolve --org-slug). -export CIRCLECI_CLI_TOKEN="" -circleci config validate --org-slug gh/ethereum-optimism /tmp/merged-config.yml +# needs CIRCLE_TOKEN set to resolve the organization). +export CIRCLE_TOKEN="" +circleci config validate --org gh/ethereum-optimism /tmp/merged-config.yml # 3. The setup config imports the private orb too, so it needs the same flag. -circleci config validate --org-slug gh/ethereum-optimism .circleci/config.yml +circleci config validate --org gh/ethereum-optimism .circleci/config.yml ``` +These commands use CircleCI CLI 1.x. With the older 0.x CLI, use `--org-slug` +and `CIRCLECI_CLI_TOKEN` instead. Do not confuse a shell-profile variable name +with the environment variable the selected CLI actually reads. + Install the CLI without sudo: `curl -fLSs https://raw.githubusercontent.com/CircleCI-Public/circleci-cli/main/install.sh | DESTDIR="$HOME/.local/bin" bash`. @@ -62,6 +76,10 @@ This checks orb resolution and config structure, but **not** continuation-time p wiring — a param leak across fragment anchors still only surfaces when the pipeline actually continues. +Run shared routing and Circle adapter fixtures with +`mise exec yq jq -- bash ops/ci/tests/test-decision-tree.sh` using Bash 4+ or Linux. +macOS `/bin/bash` 3 is unsupported; the fixture entrypoint rejects it explicitly. + ## Choosing where a new job runs When a diff adds a job, the first question is cadence, not correctness. Options diff --git a/docs/ai/ci-ops.md b/docs/ai/ci-ops.md index 7c949b3b989..3c4b1c9eb6d 100644 --- a/docs/ai/ci-ops.md +++ b/docs/ai/ci-ops.md @@ -4,6 +4,12 @@ This document provides guidance for AI agents working with CI/CD operational tas For Docker image build failures — especially flaky `apt`/`apk`/`curl` downloads from package registries and CDNs — see [docker.md](docker.md). +For a fresh session on the RWX project, start with the +[handoff](rwx-handoff.md) and [evidence index](rwx-evidence-index.md). +The optional RWX pilot and migration checklist are documented in +[rwx-migration.md](rwx-migration.md). CircleCI remains the required CI provider; +an RWX pilot result does not replace watching the existing merge gates. + ## Watching CI after a push Watch every push to a terminal state — `AGENTS.md` requires it. Most jobs run on @@ -38,9 +44,10 @@ Notes that matter in practice: run on fast paths; for every other suite, look for an open flake issue instead. A rerun that hides a real regression costs more than the minutes it saved, and a confirmed flake needs an issue, not a silent retry. Reruns through the CircleCI v2 API need a - personal API token in `CIRCLE_TOKEN` — not the `CIRCLECI_CLI_TOKEN` the CLI reads for - [ci-config-review.md](ci-config-review.md)'s `circleci config validate --org-slug`, and - not the `CIRCLE_API_TOKEN` in `.circleci/`, which is the in-job context token. For + personal API token in `CIRCLE_TOKEN`, also read by CircleCI CLI 1.x for + [ci-config-review.md](ci-config-review.md)'s `circleci config validate --org`. + Older CLI 0.x uses `CIRCLECI_CLI_TOKEN` and `--org-slug`. The `CIRCLE_API_TOKEN` + in `.circleci/` is the in-job context token. For flakes in `op-acceptance-tests/`/`op-devstack/`, [flake-prevention.md](flake-prevention.md) catalogues the recurring causes. @@ -63,6 +70,16 @@ branch that only added a new `op-core/types` package. The diff touched nothing i `op-deployer`; the failures were a data-dependent flake already fixed on `develop` by #21396. Rebasing made CI green with no change to the branch's own work. +## Go module cache on Circle machines + +Machine and Docker images can use different `GOPATH` defaults. The shared +`restore-go-mod-cache` helper sets `GOMODCACHE=$HOME/go/pkg/mod` through `BASH_ENV` +so every later step reads the directory Circle actually restores and saves. +A successful cache restore alone does not prove Go uses it: compare `go env +GOMODCACHE` with the cached paths. The cache key includes `go.mod`, `go.sum` and +`mise.toml` so the module producer can retain newly selected modules/toolchains +instead of trying to overwrite an immutable older snapshot. + ## Missing `op-core/superchain/bundle` bundle (`superchain-configs.zip`) A CI-only compile error like: diff --git a/docs/ai/rwx-evidence-index.md b/docs/ai/rwx-evidence-index.md new file mode 100644 index 00000000000..0e3ceb53056 --- /dev/null +++ b/docs/ai/rwx-evidence-index.md @@ -0,0 +1,492 @@ +# RWX evidence retrieval and comparison + +Start with the [project handoff](rwx-handoff.md) for current PR state, decisions +and next steps. This index links the final source-change benchmarks and the +earlier parity archives. Generated reports, billing details and raw originals +remain outside Git in operator-private storage. + +PR #23151 covered all 86 **historical baseline** CircleCI PR job occurrences; +that is not a current-upstream coverage claim. Maintain this index alongside +the [operator guide](rwx-migration.md), [coverage checklist](rwx-parity-todos.md) +and handoff. The small +[summary checksum index](rwx-evidence-summaries.sha256) remains integrity data. +Historical human-written closeouts and experiments are archived below. + +## Representative source-change benchmarks + +These are one-sample measurements with fresh verdicts and normal PR cache +permissions. Each provider pair used the same source commit and matched +advertised resources. The three languages used different frozen commits and +dates. Report preparation separately from measured runs; do not combine this +table into a whole-repository or monthly savings estimate. + +| Workload / proof PR | Measured commit | CircleCI | RWX | Selected verdict wall time | +| --- | --- | --- | --- | --- | +| [Go #23513](https://github.com/ethereum-optimism/optimism/pull/23513) | `3c99ebf34eb00d5478e2ebb50493ccb08524b8cc` | [137098](https://app.circleci.com/pipelines/github/ethereum-optimism/optimism/137098) | [measured run](https://cloud.rwx.com/optimism/runs/01a15bb4570477c5be0a3b63cfd00997) | 1,021.488s → 816.490s | +| [Rust #23517](https://github.com/ethereum-optimism/optimism/pull/23517) | `de695f31eb719bbc6ca924184a5dc1b0fcf29209` | [137046](https://app.circleci.com/pipelines/github/ethereum-optimism/optimism/137046) | [measured run](https://cloud.rwx.com/optimism/runs/01a15a1b284e751cba4cb65a19dd9723) | 1,055.205s → 423.459s | +| [Solidity #23519](https://github.com/ethereum-optimism/optimism/pull/23519) | `13a35ccd4af7a665e047af20467b3fc236513324` | [136984](https://app.circleci.com/pipelines/github/ethereum-optimism/optimism/136984) | [measured run](https://cloud.rwx.com/optimism/runs/01a156127d9e75a981107c3f48f7ad84) | 934.893s → 595.913s | + +Wall time includes setup, queueing, prerequisites, cache restore, compilation +and publication through the selected verdicts. It excludes unrelated native +E2E/GitHub checks and GitHub status-publication delay. Resource matching is per +phase/worker, not identical hardware or an aggregate CPU cap. Cache-transfer +totals have different provider scopes and are not comparable network-only or +critical-path measurements. + +### Go: final corrected warm-parent experiment + +The edit preserves the original error when `ErrorData()` is nil, including +wrapped errors, in `op-service/errutil/errors.go`. Two regression subtests in +`errors_test.go` failed before the fix and passed on both providers. + +Warm parent: `e2d7e980154cb31ee38ce6f055d91e9556de3bae`, with the same tree as +harness head `f8b1c43bfb7a489f8eb5a2aa9d2a16ea19dffa0c`. +Parent [Circle 137097](https://app.circleci.com/pipelines/github/ethereum-optimism/optimism/137097) +(Go job `5732694`) and [RWX parent](https://cloud.rwx.com/optimism/runs/01a15ba177687ff09dddb636c7796d26) +passed strict warmth validation before the new edit. The +[seed-hit probe](https://cloud.rwx.com/optimism/runs/01a15ba4f5db7c27ad8cc5de2d04f80c) +is unmeasured preparation. Measured Circle Go job: `5732707`. + +All 12 Circle compiler caches restored from the verified parent job; all 12 RWX +seed cache keys and original source-task IDs matched verified parent evidence. +Both used Go 1.26.9 without SDK/module downloads or captured standard-library / +external-dependency recompilation. The compiler checkpoint +`3dab7ff1acea716f7ea23760258a43ce0e21ae9a` has the same tracked Go sources as the +parent, not the same whole repository tree. Embedded inputs can still differ. + +Scope: the 12-worker Go unit-test job plus contracts, superchain, Go modules, +Cannon prestate, Kona binaries, op-reth and sysgo binaries, including setup. +Both selected 462 packages, 34 split top-level tests, 495 unique work units and +3,191 unique top-level cases. No original failure events or measured retries +were observed. All eleven final protocol checks passed. Compile/verdict workers +used 8 CPU / 16 GiB, `-p=4`, `-parallel=32`, and `-count=1`. These are measured +settings; consult definitions and launch records for ordinary defaults. + +For a UI example, [Go verdict shard 0](https://cloud.rwx.com/optimism/tasks/01a15bb8091e726e80ecf38faa1c90be) +passed with 476 seconds of execution. That task duration is distinct from the +816.490-second selected workflow verdict. + +### Rust: warm-parent source edit + +Parent: `8dd70d3246a7b9adade2df998dbb2bbd6046247e`. Migration implementation at +measurement: `8368c4c35ef1f63ff629d49ddd33187389966ffc`. +The edit changes quantity diagnostics and adds three regression tests in +`rust/kona/crates/utilities/serde/src/quantity.rs`. All three passed. Parent +warmth was verified before editing; the measured commit was not prewarmed. + +Scope: workspace unit tests, beacon, doctests and ten feature partitions. +Feature partitions compile test configurations without executing tests. Unit +phases used 16 CPU / 32 GiB; feature phases used 4 CPU / 8 GiB. All 24 resource +comparisons passed. Larger accumulated source deltas were not measured; some +compilation misses on the new edit are expected. Separate native E2E duration +does not belong to this benchmark. + +### Solidity: normal PR permissions, qualified cache state + +The edit checks byte-array length before hashing in `Bytes.sol`, with a prefix +regression. Scope is the standard `main` suite, not all feature, upgrade, +coverage or later bridge-hook variants. Both providers reported 3,024 cases: +2,453 passed and 571 skipped. Compile/verdict phases used 16 CPU / 32 GiB. + +Caches were not uniformly warm. Circle's selected target queued for 170.372 +seconds. Consequently the 36.3% wall reduction is not a compilation/test-body +speedup claim. Preserve this qualification in presentations and future reports. + +### Retention and superseded results + +The private companion index identifies the comparative HTML/JSON report, +detailed Go evidence, Rust report and original source-change report. It also +locates the sealed Go bundle: 488 indexed evidence files plus report and helper +copies, with SHA-256 +`836951e7f6f913ab562e17c799d4c7573661ed0d91ddd553b2c587d649ed4f85`. +Its report copies retain historical Rust/Solidity metadata; they do not imply +that all Rust/Solidity raw originals are contained in the Go bundle. Verify +custody before deleting any older collection. Provider UI retention is not a +backup, and another machine needs an operator-mediated private transfer. + +The earlier Go sample at `4f65e67b2c5a5da841b670ff1a9c0a6fa86595ac` +([Circle 137077](https://app.circleci.com/pipelines/github/ethereum-optimism/optimism/137077)) +downloaded the SDK on every Circle worker. It remains diagnostic history and +is superseded by the corrected Go pair above. Older forced whole-repository +reruns and initial source fixtures also must not replace these final samples. + +Keep billing, provider responses, logs, signed artifact URLs and machine-local +collection paths out of new public updates. Follow the private index to inspect +original evidence or cost models. Historical archives below have their own +custody and limitations; their parity credit is separate from runtime evidence. + +## Current split Rust reports + +The native `tests-unit` and `tests-compiler` tasks retain their reports at +`.ci/rust-workspace/tests-unit` and `.ci/rust-workspace/tests-compiler`. The stable +`tests` task still exports `.ci/rust-workspace/tests`. Its `parts.json` maps every +original child file to its retained aggregate filename and records each child's +attempt and original `final.json` checksum. Owned unit, beacon and doctest logs, +discovery and JUnit keep their original filenames and bytes. Other child originals +use `unit.` or `compiler.` prefixes. The aggregate verifies manifest-declared bytes +without repairing originals. Preserve all three task reports and terminal states +for hosted validation; use the archived source revision for historical reports. + +## Archive identity and custody + +The archive captures source revision +`a1aa49aaf3713a8172f3f615f094488fd8e39c3d` on October 5, 2026. +It contains 216,558 report paths, including complete provider originals, +preparation and test logs, selections, settings, retries, failure fixtures, +provider run/check observations, and the 92 previously committed summaries. +Deduplication and Zstandard compression reduce 38,238,271,163 logical bytes +to 1,347,568,690 bytes of report objects. The manifest and source bundle bring +the complete archive to about 2.4 GB. + +Two private copies are retained: + +- Operator workstation: + `/Users/edward/Workspace/op/rwx-ci-pilot-evidence/2026-10-05-a1aa49aa/` +- Existing CI validation host, accessed through the operator's `hetzner` SSH + alias: `/home/admin/.local/share/optimism-ci-evidence/2026-10-05-a1aa49aa/` + +Both archive directories are private to their owner. They are not public +downloads or managed artifact storage. An operator with access to either copy +must supply the archive to a reviewer. Keep both copies until the team assigns +an evidence storage location and retention policy. + +| File | SHA-256 | +| --- | --- | +| `manifest.json` | `450aaa5e07daa581c258feb3e94b713215d382f559cfd66186f8fa3efa09b8b3` | +| `source.bundle` | `9a548a480c0b2c8636d1074f3e2ed3a5d8ba2853353be83f23f8cc2919a87c3a` | +| `restore.py` | `bd419f52c0f7d5a9e707ac4d984334e769f1c386d591c1658e079e7eeb84e320` | + +The manifest binds each report path, byte count, mode, original SHA-256 and +compressed object parts. It retains original collection seals and labels the +historical exceptions below. `SHA256SUMS` in the archive covers every stored +file. `verification-record.json` records restoration and comparison results. +The self-contained Git bundle preserves the pilot branch's source history +through the captured revision. No archive, bundle or compressed object is added +to the repository. + +## Retrieve and restore + +Copy the whole archive directory, including `objects/`, outside a checkout. +For the existing private host: + +```bash +rsync -a hetzner:/home/admin/.local/share/optimism-ci-evidence/2026-10-05-a1aa49aa/ ./rwx-evidence-archive/ +``` + +Use Python 3.11 or newer and the `zstd` command. Check the three identity hashes +against the table above before running the archived helper. From the archive +directory, verify all stored files and restore into a new directory: + +```bash +sha256sum -c SHA256SUMS +python3 restore.py \ + --manifest-sha256 450aaa5e07daa581c258feb3e94b713215d382f559cfd66186f8fa3efa09b8b3 \ + --destination ../rwx-evidence-restored +``` + +On macOS, use `shasum -a 256 -c SHA256SUMS`. Omit `--destination` to verify +every original without retaining decompressed files. Add repeatable `--prefix` +arguments to restore selected families, for example +`--prefix .ci/rwx-l2-evidence/f821/ --prefix captures/`. +The helper rejects a changed manifest, missing or corrupt compressed parts, +changed original bytes and an existing destination. Identical restored files +can share hard links; treat the restored originals as read-only. + +Use `git clone source.bundle ../rwx-pilot-source` to recover the recorded source +and run the comparers at that archived revision (historically `ops/ci/compare-*.py`; currently `ops/ci/migration/compare-*.py`) against restored `.ci/` reports. +Provider run/check captures reside under `captures/` or alongside their report +families. They retain original source revisions and run identities. + +Archived workload closeouts link historical summaries at the immutable +[captured revision](https://github.com/ethereum-optimism/optimism/tree/a1aa49aaf3713a8172f3f615f094488fd8e39c3d/docs/ai). +Their exact bytes are also recoverable from the archive and checked by the +92-line summary checksum file. Deleting them from the PR's final tree does not +remove commits already pushed to the pilot branch. A future squash merge can +land the reviewed final tree without importing those earlier report blobs. + +## Verified coverage and historical exceptions + +Archive validation restored every report path on the workstation and independently +verified every original on the private CI host. All 23,141 unique objects passed +their compressed and decompressed hashes. The existing L2 fork, Contracts gate, +selector and flaky-report comparers passed against restored originals. Empty-file +restoration passed; changed manifests, missing/corrupt parts and an existing +restore destination were rejected. All 92 summary hashes and 97 historical report +links were verified before deleting the generated files from the final tree. +The source bundle passed a clean clone to its recorded revision and branch, +followed by `git fsck`. An initial bundle inherited shallow history and failed +that clone rehearsal; its original and failure log remain under `validation/`. + +The authoritative last three workload comparisons use +`f821983dd56cbd7e488ab903d1ac386a330de7f6`: complete L2 fork reports, the 21 +Contracts prerequisites, and selector publication/readback. Final readiness at +`a1aa49aa` passed all four required Circle gates, dependency review and all 23 +optional RWX checks. These are historical observations; a later PR head needs +its own terminal checks. Earlier workload revisions and complete failure +evidence remain in the archive. + +The archive labels these older collection limitations explicitly: + +- 113 unavailable files belong only to the incomplete preliminary selector + collection `.ci/rwx-selector-evidence/86f`. They are not part of the passing + `6384` or `f821` selector comparisons. +- 4,368 missing local paths were recovered from other collected copies with + the exact SHA-256 required by their original seals. +- 188 files declared empty by original manifests are retained as empty files. +- Ten regenerated derived files under `.ci/rwx-rust-stage-evidence/6a/derived` + differ from their older seals. The observed bytes and original expected + hashes are both recorded. The authoritative `68ad` Rust originals are intact. + +These exceptions receive no new parity credit. The archive preserves them for +audit rather than treating every historical collection as complete. + +## Documentation and experiment archive + +The October 6 cleanup captures the pre-cleanup source +`57094f2aeece2b08ec7c2cba8ae19609b2859ae3`. Its private archive contains all +28 earlier RWX/comparison Markdown files, three retired package-probe definitions, +pre-cleanup Circle replay/routing files, exact non-CI and Circle audit diffs, and +the successful pre-cleanup check snapshot. These are historical instructions; +use the maintained guide for current operations. The audit diffs compare against +the PR merge base `c8e4ba855d79ca56463909ef5a2c5830a1189401`; the October 5 +upstream observation is recorded separately in `index.json`. + +Two owner-private copies retain 40 hashed files (about 6.3 MB): + +- `/Users/edward/Workspace/op/rwx-ci-pilot-evidence/2026-10-06-maintenance-57094f2aee/` +- `hetzner:/home/admin/.local/share/optimism-ci-evidence/2026-10-06-maintenance-57094f2aee/` + +`SHA256SUMS` has SHA-256 +`d46f4a3b14c0cef29a5e68b71c8edcfdcd931b463d6ec3de0db3e355fe1baea9`. +Both copies were verified before removing the old documentation and machinery. +Files under `source/` preserve repository-relative paths. Retrieval requires no +archive script or decompressor: + +```bash +rsync -a hetzner:/home/admin/.local/share/optimism-ci-evidence/2026-10-06-maintenance-57094f2aee/ ./rwx-maintenance-history/ +cd rwx-maintenance-history +shasum -a 256 SHA256SUMS # compare with the independently recorded value above +shasum -a 256 -c SHA256SUMS +# Historical package probe: +# source/.rwx/local-package-fixture.yml and source/.rwx/packages/fixture-*.yml +``` + +The [pre-cleanup source](https://github.com/ethereum-optimism/optimism/tree/57094f2aeece2b08ec7c2cba8ae19609b2859ae3) +also preserves its tracked history. Keep archive data outside Git. No report, +compressed object or source bundle is added to the final PR tree. + +Later local-package/helper evidence is stored separately under the operator's +same `rwx-ci-pilot-evidence` root: `2026-10-05-local-packages-af0d89bfb2`, +`2026-10-05-helper-refactor-8ec3e62ce9` and +`2026-10-05-helper-refactor-57094f2aee`. The first has a private host mirror; +the helper archives are workstation collections. Their own indices record +validation scope. The initial helper archive preserves the missing-SP1-import +failure; the corrected source adds the filtered library and verifies both hosted +tasks. The full pre-cleanup terminal check snapshot is in the maintenance archive. +Do not infer two-copy custody for archives that only have one recorded copy. + +## Collect new evidence + +Use a clean pushed SHA with an open PR for Circle's PR-only project setting. +Verify each provider's full SHA, branch, effective settings, selection and final +job/task status before downloading originals. Fetch every API page and every +expected shard. Keep run/job URLs, provider responses and checks alongside the +reports. Avoid secret values and expiring signed download URLs in maintained docs. + +Retain complete selection, shard assignments, source/tool/settings hashes, +compiler inventories, initial Go JSON/JUnit, stdout/stderr, per-test logs, +retry/diagnostic histories and job outcomes. Final JUnit or Circle's case API +alone cannot prove zero retries. A diagnostic pass never replaces the initial +failure. Store derived comparison outputs separately from sealed originals. +Report collection must run after failures and cancellations too. + +For full Go, select packages from `just list-test-packages`, not a rollup prefix. +Circle's `c-go_fresh_tests=true` enables `-count=1`; RWX verdicts are always fresh. +Acceptance retains each variant's test listing and package manifest. Contracts +retain every feature/profile's complete test files, compiler-bound signatures, +initial reports and diagnostic reruns. Retained coverage evidence used Circle's +explicit `c-contract_coverage_replay=true` for identical SHA/feature-derived +Solidity and Go FFI inputs; #23879 retired coverage on both providers. Full historical NUT +regeneration uses `c-nut_provenance_full=true` in a normal pipeline, not a separate +replay workflow. L2 comparisons retain the pinned block, state reads and sealed +relay observations. Different upstream request counts alone do not establish +parity or a speed difference; native Foundry caches can serve reads locally. + +Use the suite's `compare-*.py --help` and archived invocation/collection index. +For example, standard contract reports use directory inputs and a full SHA: + +```bash +python3 ops/ci/migration/compare-contract-suites.py \ + --circle /path/to/circle-report --rwx /path/to/rwx-report \ + --sha FULL_COMMIT_SHA --suite standard --feature main \ + --output /path/to/derived/parity.json +``` + +The generic `compare-ci.py` remains available for Go JSON/JUnit/case collections, +including rollup CLI compatibility. Its version-1 collection records `metadata` +(provider, SHA, branch, workload, profile, features, routing context, effective +`test_config`), `sources` (format, path, provider `metadata_path`, feature, role, +shard index/total), complete `discovery` with provenance, and measurements. Paths +are relative to the collection JSON. Source metadata must record actual +`sha`, `branch`, terminal `status`. Set completeness only from retained discovery; +matching case reports alone do not prove selection. + +```bash +python3 ops/ci/migration/compare-ci.py normalize --input circle.json --output circle.normalized.json +python3 ops/ci/migration/compare-ci.py normalize --input rwx.json --output rwx.normalized.json +python3 ops/ci/migration/compare-ci.py compare --baseline circle.normalized.json --candidate rwx.normalized.json --output parity.json +``` + +Exit 0 means supplied evidence is equivalent; exit 1 means different or incomplete; +exit 2 means incomparable or rejected input. These tools validate supplied bytes, +not collector identity or provider authentication. Review discovered gaps, skips +and retry histories explicitly; equivalence does not transfer gate ownership. + +Measure push/run creation through the final verdict, including queueing, setup, +compilation, transfers and tests. Label unavailable push timestamps, warm/cold +compiler state, resource allocation and every sample. Cached task timestamps can +belong to a prior run: do not count them as current compute time. Archived +benchmark experiments establish observations, not an RWX speed claim. Preserve +all samples outside Git; the chosen 12-shard configuration stays in the operator +guide until a separately justified change. + +For the Rust incremental trial, retain both `settings.json` profile overrides and +`cache-source.json` restored/refreshed file counts, sccache statistics and original +feature/test reports. Use the same SHA, partition and runner resources for the +`cargo-incremental=0` baseline and `cargo-incremental=1` candidate. Distinguish +the first incremental-state population from subsequent warm reuse. Measure cache +restoration/output time as well as the command stages; the source timestamp map's +version upgrade requires one conservative refresh. Do not interpret local crate +sccache bypasses as lost registry cache coverage. + +## Runtime separation evidence + +New native receipts bind `native_policy_sha256` and manifest version 4. Circle +workflow mappings live in `ops/ci/migration/circle-gates.json`; the native manifest +contains no Circle configuration references. Retain the mapping, policy, +definitions and source revision with each comparison. Historical evidence remains +immutable and uses the archived comparer/source revision, including its original +helper paths and receipt schema. + +Run permanent and migration tests separately. Retain scenario results and skips, +layer code sizes, routing/adapter output, configuration lint/validation and exact +hosted check identities. Empty originals may be recovered only offline from their +manifest-declared empty hash; retain the audit records. Runtime verification never +writes missing originals. No rerun may replace original failure evidence. + +The NUT provenance comparer was previously an inline `--compare` mode of the +runtime runner. It now runs as +`python3 ops/ci/migration/compare-nut-provenance.py --compare CIRCLE RWX --output comparison.json`. +Other moved comparers retain their basenames and argument interfaces. + +Pilot-readiness evidence (2026-10-06) is retained outside Git in +`/Users/edward/Workspace/op/rwx-ci-pilot-evidence/2026-10-06-pilot-ready` and its +checksum-verified Hetzner mirror at +`/home/admin/rwx-ci-pilot-evidence/2026-10-06-pilot-ready`. The retrieval bundle +contains source, exact experiment definitions, complete sample/stage JSON, original +stdout/stderr archives, current vault/ruleset metadata, denied credential/cache +probe results, cancellation before/action/terminal observations, combined local +validation and final-head hosted observations. `SHA256SUMS` seals the collection; +verify it before using evidence. No secret values are included. + +Changed-crate benchmark run: `294e0a96fdf44c288e2c0d2abd747b45`, source +`3df2ffe9191e710834a567254cbb92461f51f29c`. Both cases used three samples per +mode, alternating order, the same source edits and commands, isolated targets, +pinned sccache, and the permanent per-file timestamp helper. Each original is +manifest-hash verified. Seeds start with empty Cargo targets and are excluded. Rust compiler hits were zero; the second seed can reuse shared C/C++/assembler sccache entries. Archive/restore +measure local uncompressed tar round trips; RWX cache-network transfer and whole +pipeline cost were not measured. The fixture method added an isolated probe +function only in the worker and restored the source afterward; it is not in Git. + +RPC denial: `30e1d38ecac44f80b08f06bd9be5a8b8`; protected cache-write probe: +`0505b0c81496457d96bd731fd52b8d76`; cancellation: +`9af37c3158a1494e865d12e7c7c0621d`. These CLI runs do not establish automatic +fork/merge-queue GitHub check association. + +The independent cache reader `a9d19a4233c741fc95d6f57a788c9005` uses the same +protected cache name and confirms the CLI writer's harmless marker was not +restored. Retain its definition, terminal result and +`cache-denial-reader-observation.json`; a task's empty list of restored tool +caches alone does not prove that it published no cache version. + +The first pilot-readiness push (`d3bfc043fb`) compiled the full Rust test workload +successfully but exceeded the filesystem-layer cap (64.9 GiB inherited + 54.2 GiB +added). Its failed producer, original archive and terminal engine diagnosis are +retained as `rust-build-layer-limit-d3bfc043fb.tar` and the matching coordinator +observation. The corrective target-cache namespace and final-head hosted result +are separate evidence; no original failure was overwritten. + +The corrected producer at `6fcfba3e43` published successfully. Its first target +layer uploaded 57,315 MiB in 292 seconds. This is a cold-namespace publication +observation, not a warm-run benchmark. Retain its task log and engine result; +cache transfer remains a performance follow-up. + +The merged `develop` revision includes `27766c0270`, which removes historical +proofs v1 and changes the op-reth test recipe's validator selector to `op-reth`. +The first cache-namespace correction still supplied `op-reth-proof-v1`; its nine +op-reth E2E cases failed before node startup. Retain that original report as +`rust-e2e-op-reth-6fcfba3e43-failure.tar`. The shared runner now matches the owning +recipe for both providers. A permanent test compares its sequencer, validator +and proof-history environment with that recipe so future selector changes fail +locally before a hosted run. + +At `d256ae4611`, both providers pass all nine corrected op-reth cases. The +same-SHA verdict comparison in `final-d256ae4611/op-reth-verdict-parity.json` +verifies 21 Circle and 24 RWX originals, identical selection/runtime settings, +parallelism eight and no empty-file recovery. This is an op-reth verdict +comparison, not a new complete Rust E2E producer/dependency comparison. + +The same revision's Rust test producer returned `ESTALE` on the same cached +metadata in attempts one and two. Each nine-file original manifest is verified; +all 1,344 source timestamps were restored, with zero refreshed files. The +breakpoint observation records readable, shared-inode metadata and probes that +did not reproduce the error. That attempt touched cached files, compiled and +archived successfully, then exceeded the layer cap (64.6 + 45.3 GiB). Retain its +original report, terminal engine message and +`rust-tests-build-d256ae4611-estale-debug-observations.json`. Keep subsequent +unmodified cold/warm validation distinct from this diagnostic attempt. Retain +`cache-output.json` and `cache-publication.json` with the corrective validation. + +At `75f51b1427`, the cold producer and fresh verdict passed, followed by an +untouched warm producer retry. The warm verdict did not execute: RWX rejected +its 100 GB disk because dependency layers occupied 88.37 GB and required another +20 GB of scratch space. Retain both attempt engine records and original reports; +compare the subsequent 150 GB validation separately. Successful warm compilation +does not establish a passing warm verdict. + +The 150 GB producer at `d233b6c244` compiled successfully, then failed the +separate layer cap: 73.5 GiB inherited plus 26.6 GiB added. Executable pruning +did not provide enough headroom for repeated updates. Subsequent full-test +compiler snapshots use compressed PAX archives and artifact-only producer +transfer. Retrieve their `cache-restore`/`cache-pack` logs, stage timings and +terminal engine records. Keep the read-only cache-size probe labeled diagnostic; +it executes no tests and is separate from untouched hosted reuse. +## Protected baseline and file cache transition + +The 2026-10-07 cache publication probe and its original logs are outside Git in +`../rwx-ci-pilot-evidence/2026-10-07-cache-contract`. Both writers restored the +same seed; B finished first and A finished last. The next reader restored A +without B's marker. This observes competing task inputs, not Git ancestry or +a general server ordering guarantee. + +The cache vault's pilot grant was revoked on 2026-10-07. Retain before/after +`rwx vaults access list --vault optimism-op-reth-shadow --json` results and the +revocation result in `../rwx-ci-pilot-evidence/2026-10-07-target-baseline`. +Only `ethereum-optimism/optimism:refs/heads/develop` may write. Keep RPC grants +separate. A missing cache is a cold baseline; do not widen grants to seed it. + +The immutable full-test compiler artifact from task +`8344202bce407bac7cf69433127fa646`, source `4047caccc5`, contains 72,244 regular +files and 14,082 hardlink aliases. Its decoded payload is 54.24 GiB, or 59.26 GiB +counting aliases, versus 11.44 GiB compressed. Retain the exact byte counts, +directory/extension breakdowns, source fingerprint and decode result. The artifact +stays outside Git. A separate read-only RWX lookup missed this cache; retain +that diagnostic failure separately from the artifact measurement. + +New workspace reports retain `cache-size.json` for target, Cargo and sccache +file bytes. Their engine records establish the total inherited/output layer size +and publication result; tree bytes alone do not establish remaining capacity. +Full-test file caches use explicit `files` namespaces. Producer transfer archives +remain artifacts but are excluded from reusable filesystem outputs, and verdicts +do not repack targets. Validate cold publication and untouched native-file reuse +separately. Until merge, PR validation cannot populate the protected namespace. diff --git a/docs/ai/rwx-evidence-summaries.sha256 b/docs/ai/rwx-evidence-summaries.sha256 new file mode 100644 index 00000000000..c0a7c08ee1d --- /dev/null +++ b/docs/ai/rwx-evidence-summaries.sha256 @@ -0,0 +1,92 @@ +7357ff4b8184339e8074da406e33d2554afa033106886c7678a5c5a58faf506f docs/ai/rwx-acceptance-evidence/cargo-freshness-failure.json +3d5018c20c8783ba96a1464aeb4e4066682edc050b86e30685730dabbf883d92 docs/ai/rwx-acceptance-evidence/first-failure.json +52b4f442bbff2d9064c8145f778d9ed292f8ce5305d7775cb8989d769242b6b2 docs/ai/rwx-acceptance-evidence/parity.json +7e37cec16c12da3ee3b54464447c99614f24d9b8ebd17c5ef8d07c82ae76e5bf docs/ai/rwx-cannon-go-evidence/cache-and-fixtures.json +6c75a3cfdf559228ed8fb2a83baa9b798db99823dfb62e55bbe64a529a3a8143 docs/ai/rwx-cannon-go-evidence/first-failures.json +5bf55dbe7d27f0549f6e761fb72cef20618a28e1ae12680e460f056bc8787238 docs/ai/rwx-cannon-go-evidence/parity.json +b44d7593f7b79e3c4f147482590251d96ba5b8f3ede12c042f29047d04131877 docs/ai/rwx-contract-coverage-evidence/cache-and-fixtures.json +b60db3aff31458441454198a5f16e8da0dcf48f4392b79faaacd8ede100d851a docs/ai/rwx-contract-coverage-evidence/first-failure.json +d6ccc0672d264baae35552cc6ee44e524a8ff0e36eea68c128bdfd565882944a docs/ai/rwx-contract-coverage-evidence/parity.json +c4726e477b90f11fcdc298ba944c507405dfc9f6d08a1c4cc56fd59089b29f2a docs/ai/rwx-contract-l2-fork-evidence/3be5-batch-parity.json +03605659438b00adaf3d8699f59ffd2626a701ec01b8d390fe28c8b408a03425 docs/ai/rwx-contract-l2-fork-evidence/first-hosted-failure.json +1f5139a0e9ac45430966c80bf59aa81e934887f0db260a09534d55d0221d2284 docs/ai/rwx-contract-l2-fork-evidence/parity.json +4902886b94e6b6802e16c2a1703fadea2ca79c869fc2cd8e595e60fb8eaeb9bb docs/ai/rwx-contract-suites-evidence/ffef-parity.json +4439c0c53a5d4826b886f5a207cca1ef83b605ba4b328f3c8c3d46766063796e docs/ai/rwx-contract-suites-evidence/first-failures.json +2315a4ed4775c264a82ba653b4969da46bf8101a1f7b7f9eaa0c4fb52c9d44c4 docs/ai/rwx-contract-suites-evidence/parity.json +36e1529dd10309372a6fb0a28557ec05df774570fb40ec8bb0a5c3cd178d02f8 docs/ai/rwx-contract-upgrades-evidence/first-failure.json +0557a64d64a0a8c0c905282075469004e90920f093942d0993afb9a2f4a32a39 docs/ai/rwx-contract-upgrades-evidence/parity.json +3c9733556eee4e056ac53a0806118b2fea11f69737e29898100c43321f8ae168 docs/ai/rwx-fetcher-artifacts-evidence/first-native-failure.json +4a86353e8c5ecd92288448fca17cd16985576a57880818742021abde4c3aa0a4 docs/ai/rwx-fetcher-artifacts-evidence/fixture-originals.json +8ed7900f077dc78809e0f8899b0613e4b26beaf3604fb84cde4a8b068459e598 docs/ai/rwx-fetcher-artifacts-evidence/parity.json +b97ab7885b0bd08e2c6452dc591ebff389f44e4f6ce90fd0d2243e2e5232dbfd docs/ai/rwx-fetcher-artifacts-evidence/preflight.json +09d63c59cb1a894cbacf0e1504f32811a03ca15b168fa9241123794653c03f33 docs/ai/rwx-fetcher-artifacts-evidence/tool-only-reuse.json +67a9cce163718c136090015447c2c2f40f0650dbf1fca8854168729711556d26 docs/ai/rwx-flaky-report-evidence/parity.json +3729034b49766f77c55486a09f8a9659dc63dce8cb5f672d6ef010cc363b654b docs/ai/rwx-go-evidence/parity.json +cede5340b94b509a0ba133243a8a3769fc1fe4e39bedb3fef5efa53248dafb6c docs/ai/rwx-kontrol-build-evidence/compiler-inventory-discrepancy.json +ae66f8467ff6bcc668cf71efeeef76f9f34a8c93252b17aa01d8cddd2207963e docs/ai/rwx-kontrol-build-evidence/complete-compiler-input-probe.json +0f641692d4235847b97f27ddb449eb1614a64896f7b23f51d7001045b87ecd7b docs/ai/rwx-kontrol-build-evidence/complete-input-fixtures.json +081db3cc1071e7661d4be1ec12ea94c7f2010f009e434e86716b05ed1b8697c2 docs/ai/rwx-kontrol-build-evidence/first-full-preflight.json +70958864ba916d8d15b759fc556b4db5714d007d29160eca584d46768922fe8b docs/ai/rwx-kontrol-build-evidence/first-native-image-failure.json +64017275e684bb2a56199421df80aa87eda7d4c7db8a8d1c7753afaf869d0718 docs/ai/rwx-kontrol-build-evidence/hosted-parity.json +458d81ba6133bfc8b37074080bb148974a6e1cadd15f1cfe09e48b682044ec2b docs/ai/rwx-kontrol-build-evidence/image-identity-fixtures.json +858f004144d61b005997f56bb8b7cd15673850286c96e0e5ec0502d9c9a9e204 docs/ai/rwx-kontrol-build-evidence/immutable-image-manifest.json +8f7f1f056746f8d56fe8dc3c5f09c80eae03511bb48fab2c64075a40f432e66a docs/ai/rwx-kontrol-build-evidence/local-fixtures.json +f006f62bf704e4cf1d837616a5291e66120299a26ea898bd843726e7ea132595 docs/ai/rwx-main-checks-evidence/first-failure.json +cc18a31f5f93f5e1adc22d87e2a74c3a74afcdb174fc9ce73aef94fd37e8393a docs/ai/rwx-main-checks-evidence/parity.json +a117f47b259bd5af31a904cf2b6aa93b99836b8cd22b71212b2c8cca7fc68665 docs/ai/rwx-nut-prefork-evidence/parity.json +6c33c80c4f716937befdaf8fc8d682d816f3d93b8eee1cd91266609e2557baae docs/ai/rwx-nut-prefork-evidence/pushed-reporting-confirmation.json +f3fc234509887057258618e587130c9d028a65b0c35b5a28f2f00fc5a836129a docs/ai/rwx-nut-prefork-evidence/runs-cache-and-fixtures.json +08eb077ca74fc1c6d56c78120851b6461386c1a57e4f8abef031547e206e0690 docs/ai/rwx-nut-prefork-evidence/verified-native-definition.yml +b0c69732aa1885ee7422d6f70812a2d6ba14d69efe2a88149f3c5d8295a3c51f docs/ai/rwx-nut-provenance-evidence/hosted-preflight.json +c76050dbcd20c83aec3ecfe954e60d9f88e16fe416e996e372beda889ebe75e5 docs/ai/rwx-nut-provenance-evidence/parity.json +3ec8c7f531be2c62041ab16194918087d567c7b95433f1d555ed5ab7f8ad818b docs/ai/rwx-nut-provenance-evidence/preflight.json +b7da8f6d2e5aaf4604796200aac5031d5b380d7e3a9542377456b87d63e25487 docs/ai/rwx-pr-checks-evidence/first-failure.json +35716dd39981394640830efbcaee28033b2c0535b9553b83f45bfc046fae26d6 docs/ai/rwx-pr-checks-evidence/parity.json +50cf001ee8455a0827217c18faa94491b0bd9765d78be706a1775ec76bab15fb docs/ai/rwx-pr-gates-evidence/.gitattributes +5ad48986c9ea82a143f9fad77e385f9bb136c2801e2d8acc41b7b347d412597a docs/ai/rwx-pr-gates-evidence/3be5-contracts-parity.json +ea66859c2d7d906484835d19e4456aa3185902a2af720e5ef26e5f78acc8ee01 docs/ai/rwx-pr-gates-evidence/contracts-first-batch.json +be87a57f6658857b359a9e843b6e72bedaba2963f9cd61f59769421e83e82c1e docs/ai/rwx-pr-gates-evidence/contracts-pacing-preflight.json +5ecd8a64e1a8e51e18d77c4cebff0c9a05beb5cf1244beaa995f636688ba50e2 docs/ai/rwx-pr-gates-evidence/contracts-parity.json +21f5270fb913aae33ddf0c0684f489016f4caeac811d7d88a4c5bb57c10d7a6d docs/ai/rwx-pr-gates-evidence/contracts-preflight.json +07551cd185cc537eaa72f2355507bb72d1eb949c5e3b6672d172ae60fec42248 docs/ai/rwx-pr-gates-evidence/contracts-second-batch.json +d456b883edb33d271c8d7df72997861ac66789a6dd1f2de712eca7faf44f121e docs/ai/rwx-pr-gates-evidence/contracts-shell-preflight.json +78b0cbd10b1b0f6962ee96c7b47a413272cb82df4be425dfdd7bf5f5b534703f docs/ai/rwx-pr-gates-evidence/embedded-preflight.json +58116abc983e14151f6f05bf37fecb63287aa5583f12c153a8f81d03b3b2a15e docs/ai/rwx-pr-gates-evidence/f821-coverage-closeout.json +fa88cfcbd409bf2bd2582661a40cdabc8a549873c7c19eef2c1c624b2a5cee58 docs/ai/rwx-pr-gates-evidence/f821-kontrol-helper-first-failure.txt +7632ae132eb59848758ed47284d3e4072d0e721814447f2936eeaa1fa69b1470 docs/ai/rwx-pr-gates-evidence/f821-main-aggregate-first-failure.txt +22dd66095774d7872b046cdc52c0549aab02be7b42b987be51fc31f50ba5eb77 docs/ai/rwx-pr-gates-evidence/f821-rust-e2e-source-first-failure.txt +bd4087f594666eb6d2a1970897ad6e0847ea0b1333c22c369e9d754529471265 docs/ai/rwx-pr-gates-evidence/first-hosted-failure.json +3c6cf6147fc194082ea1d9b919245f7885312c5b991691427eeef2a541118ac0 docs/ai/rwx-pr-gates-evidence/hosted-correction-preflight.json +19d9b7be2bee1a33b0594a3ae18b6791580edca046f25347bcd2ac5e255167d6 docs/ai/rwx-pr-gates-evidence/main-parity.json +16281e99daad6b132ff962b5d443aab59faa7c498a63d0f143e3e710b4a8f001 docs/ai/rwx-pr-gates-evidence/main-preflight.json +9547148b072606e0a6650dfc66f10fe59e83ac692f00402b7dd91753cda65d60 docs/ai/rwx-pr-gates-evidence/pr-closeout.json +2c8fe4662a73f08a2030a56176d7d6a7c20465c53e7d44fe9f49b5d7b7f8825c docs/ai/rwx-pr-gates-evidence/preflight.json +0b618e1fabd0069b504bf019fa42fd094805b8a34d6d4a652e5057de3053a225 docs/ai/rwx-pr-gates-evidence/rust-parity.json +7386457e0c0ba9b2aade13c76723c2812ef6367b2a963a68a35576b062a0efa5 docs/ai/rwx-pr-gates-evidence/status-preflight.json +491d9bd12bd9f646fa13574d3eb8f25672f997e1d401a8d4cacf5e2cae34550d docs/ai/rwx-rust-e2e-evidence/6245-circle-sysgo-failure.json +65fc77ae26cef769571cd2edbd75ccd64c573d758ab91cdc0cf0f05161c51c34 docs/ai/rwx-rust-e2e-evidence/cache-and-warming.json +a6b0fdd44088051aebfc78f3b849472b2d8ce6d07c226b7eacbc67e2fcb38f94 docs/ai/rwx-rust-e2e-evidence/first-failures.json +5ef4710e179d763a8752984ec2fdeaeb7518611b4362e35a4e8e3d92917d77cb docs/ai/rwx-rust-e2e-evidence/negative-probes.json +d2f6122e5869a3eab976298f168d11f4da34510ff19c09fd33b205272f98db5e docs/ai/rwx-rust-e2e-evidence/parity.json +ba17f0c3d95c2b163287750756ccfcf626a8c1e15696e39d4b186a76e33d2d92 docs/ai/rwx-rust-evidence/cannon-cache-and-failure.json +75b84a965c2324fb1c58682ad049707293ed5fa4db862c457b4d83fb36190112 docs/ai/rwx-rust-evidence/cannon-parity.json +bb4b20ff29f34d95608d152b4e87916b5303b5369ae7cc4c2bd6d0e47a927dcf docs/ai/rwx-rust-evidence/extra-cache-reuse.json +387be2aa892005af939426fa1b4d2db0558dbab09e7277968342f0b81c9447c2 docs/ai/rwx-rust-evidence/extra-parity.json +408f62b782d587b0ee1f678f06c5eed47333b39d8a2a92c39e890f8bca08743a docs/ai/rwx-rust-evidence/first-failures.json +33a4fa5e0b993dd98359b6bb6188c35f5525f105a13eda11075f9f7daa24f073 docs/ai/rwx-rust-evidence/parity.json +515c77d24dbbd964a6494318d3c1a70e3b880c587f46649aa34ece4a3cfce4e7 docs/ai/rwx-selector-upload-evidence/3be5-batch-parity.json +10860cf6e8d69f3a49c211f9a08fe66244a343de6cb52345bc0cc5fb440defc0 docs/ai/rwx-selector-upload-evidence/a3a0-batch-parity.json +90b691175a1f29dd2ea86158a9c127f9f31efadbd9cb2d2f78d99bdc6f4a73c6 docs/ai/rwx-selector-upload-evidence/batch-parity.json +e5ff7219a037dc5ac4748dc191d03fe9027d776ba6b73c9420ea55546967dff1 docs/ai/rwx-selector-upload-evidence/cb34-batch-parity.json +a1b5f417d0c9a0381fd27e9af70a4ff3b577cd5370649f86a139704df155124a docs/ai/rwx-selector-upload-evidence/compiler-warm.json +5de31e81a6ed77e3948b0325bc2e33b340983ec37bf054824b273f28f828b084 docs/ai/rwx-selector-upload-evidence/f821-batch-parity.json +b1bbb2d0abd9c368d71524a14b73c38fd96e57a4e5f1b354b8ae83e2df16d43d docs/ai/rwx-selector-upload-evidence/parity.json +cd0de166c7788b3bb93b7ea45ce76bcdeb2d874b5d297c1ad8ecaaa6814d3d4a docs/ai/rwx-selector-upload-evidence/preflight.json +f38e078a127e2d92a5c07b80b3cc7828c77f36a488c2ac34967906251166cab7 docs/ai/rwx-sp1-guest-evidence/canonical-path-probe.json +403e14f55a8b9bb7018319e0d1389f743e74d1bcd97e6567c2b241c25ae50c72 docs/ai/rwx-sp1-guest-evidence/first-full-preflight.json +4ebd67e7c470f766317b7dafb8538463fd06671f9919adf263958b51a6f292fe docs/ai/rwx-sp1-guest-evidence/first-hosted-elf-discrepancy.json +2834247f0ba3f998ddc989ee9916d63ce81c6a1bd3ed8c5fa32339ac94c7bcb8 docs/ai/rwx-sp1-guest-evidence/hosted-parity.json +6299403bf67127e79cd8f2e0a8001105c548955b7aaefc570e423be29b6a1ed1 docs/ai/rwx-sp1-guest-evidence/latest-full-preflight.json +3dd8cfab24f3f5ff0d3dbfd03d42f1940adcd1aeaf374c8ecc9b50674b2d841b docs/ai/rwx-sp1-guest-evidence/local-fixtures.json +6d3b545f7bcddd65947176af2ae9ffc823074b1615d503317579ef8a372cdfaa docs/ai/rwx-static-checks-evidence/first-failures.json +803d75c8148d54f15f4d60d962b85cde53911a0c450772664a4dc6e38f8c4b51 docs/ai/rwx-static-checks-evidence/parity.json diff --git a/docs/ai/rwx-handoff.md b/docs/ai/rwx-handoff.md new file mode 100644 index 00000000000..d486ca7b345 --- /dev/null +++ b/docs/ai/rwx-handoff.md @@ -0,0 +1,206 @@ +# RWX migration handoff + +Updated October 27, 2026. Start here when continuing the CircleCI-to-RWX +evaluation in a fresh session. Read [AGENTS.md](../../AGENTS.md), then this +document and the [evidence index](rwx-evidence-index.md). The +[operator guide](rwx-migration.md) owns implementation details; the +[coverage checklist](rwx-parity-todos.md) owns the dated workload inventory. + +## Objective and decision so far + +Evaluate moving Optimism's monorepo CI to RWX while preserving selection, +test execution, required checks and normal PR cache permissions. The measured +source-change samples support investing in a staged rollout, especially Rust +and Go. They do not establish whole-repository savings or production readiness. +CircleCI still owns the four required CI gates; dependency review remains in +place. No gate cutover, release migration or production publication was performed. + +RWX tasks can reuse results for unchanged inputs, inherit dependency filesystems +with `use`, order work without inheriting state with `after`, narrow inputs with +filters, and recover compiler state through tool caches. This pilot separates +reusable preparation/compilation from fresh verdicts and hands test workers +smaller binary/runtime artifacts. Circle also supports dependency graphs, +caches and workspaces; several optimizations were applied to both services. + +## Current state + +GitHub was checked on October 27, 2026 at approximately 16:42 EDT. All five PR +heads still match the final benchmark records. **PR #23151 now conflicts with +`develop`**, despite passing checks at its unchanged head. Observed `develop` was +`8b8df208b2a2f51055f8d03e305d597d001a02d0`. These are observations, not promises +about the next checkout or merge result. + +| Role | PR | Head commit | State at handoff | +| --- | --- | --- | --- | +| Migration, base `develop` | [#23151](https://github.com/ethereum-optimism/optimism/pull/23151) | `5552a61cccd569961d9ae100f896c28bc440ea9d` | Open, ready for review, conflicts with base | +| Harness, base migration | [#23533](https://github.com/ethereum-optimism/optimism/pull/23533) | `f8b1c43bfb7a489f8eb5a2aa9d2a16ea19dffa0c` | Open draft | +| Go fixture, base harness | [#23513](https://github.com/ethereum-optimism/optimism/pull/23513) | `3c99ebf34eb00d5478e2ebb50493ccb08524b8cc` | Open draft | +| Rust fixture, base harness | [#23517](https://github.com/ethereum-optimism/optimism/pull/23517) | `de695f31eb719bbc6ca924184a5dc1b0fcf29209` | Open draft | +| Solidity fixture, base harness | [#23519](https://github.com/ethereum-optimism/optimism/pull/23519) | `13a35ccd4af7a665e047af20467b3fc236513324` | Open draft | + +Latest named checks reported by `gh pr checks` were 183 passing plus one neutral +for migration; 112 passing plus one skipped for the harness; and 25, 20 and 20 +passing for Go, Rust and Solidity respectively. Dependency review succeeded for +all five. Raw `statusCheckRollup` also includes superseded attempts, including +an old cancelled Rust subject check; do not count those as new failures. +No CI was rerun while preparing this handoff. + +Remote branches, in table order, are `codex/rwx-ci-pilot`, +`codex/rwx-source-benchmark-base`, `codex/rwx-bench-go-20261019`, +`codex/rwx-bench-rust-20261019` and `codex/rwx-bench-solidity-20261019`. +The initial handoff was captured from local branch +`codex/rwx-sdk-benchmark-go-20261021` at the Go fixture SHA. The documentation +is retained on `codex/rwx-handoff-docs-20261027`, based on migration head +`5552a61cccd569961d9ae100f896c28bc440ea9d`, with only four documentation files +changed and no PR opened. Other local worktrees and branch refs may be stale; +inspect them before using them. + +The fixture PRs are benchmark evidence, not production changes to merge. +The shared harness advanced after the Rust/Solidity measurements. Their frozen +commits remain the source of truth even though their PR base branch has moved. +Preserve those commits and provider run identities when updating migration code. + +### Local `develop` integration after the handoff + +Later on October 27, `codex/rwx-handoff-docs-20261027` merged `develop` at +`60698d94a5ebfae2df26005f3baf1d358f6c61f5` (76 commits). It is a merge, not a +rebase: the branch already integrated `develop` eight times, and a rebase would +rewrite cited evidence commits such as `3dab7ff1ac` and `8368c4c35e`. The merge +is local and unpushed. #23151 still points at `5552a61ccc`, and no hosted check +has run on the merged tree. + +| `develop` change | Migration update | +| --- | --- | +| #23527 removed the fetcher forge script and artifacts | Took `develop`'s deletions; removed the native fetcher workload, its shadow check, `main-fetcher` gate group and tests; moved Kontrol's two helper imports out of the fetcher module | +| #23594 moved Rust builds to a new Wolfi image | Rust-binary consumers run on that image. OP Node acceptance and NUT pre-fork dropped the pilot's Ubuntu machine executor; the acceptance `executor` parameter is gone | +| #23648, #22632 run Go engine, NUT and kona proof tests on `op-reth-test-engine` | RWX `op-reth` release producer builds, seals and packs both binaries with Circle's flags; Go verdicts set `REQUIRE_RUST_ENGINE=1`; NUT pre-fork gained an `op-reth` producer; the E2E release report requires the engine | +| #21786 added the required `go-actions-tests` job | New `actions-verdict` in `go-tests.yml`, mapped into `ci-gate` after `go-tests` | +| #23614 moved the superchain bundle to `op-core/superchain/bundle/` | Updated RWX filters, helpers and fixtures | + +SP1 6.10.0, Go 1.26.10 and Rust 1.99.1 reach RWX through `mise.toml` without +other edits; all SP1 pins agree. RWX does not need Circle's new `PROTOC` +export, because its Rust layer puts mise's real binary directories on `PATH`. + +Local validation on macOS: both Circle configs validate; the merged config +processes with all 24 `c-run_*` workflows enabled; native gate configuration +and Circle alignment pass for all three mapped gates; the permanent (403) and +migration (238) helper suites pass; `rwx lint` reports only the pre-existing +`mise/install` 1.1.1 notice, which also appears before the merge. Not run: +`test-decision-tree.sh` and the Circle adapter fixtures, which need Bash 4+ or +Linux. Neither side of the merge changed routing data or the adapters. + +## What the benchmarks establish + +| Selected workload | CircleCI | RWX | Less wall time | Qualification | +| --- | ---: | ---: | ---: | --- | +| Go | 17m01s | 13m36s | 20.1% | New source edit after verified warm parent | +| Rust | 17m35s | 7m03s | 59.9% | New source edit after verified warm parent | +| Solidity | 15m35s | 9m56s | 36.3% | Normal PR permissions; caches not uniformly warm | + +The [evidence index](rwx-evidence-index.md#representative-source-change-benchmarks) +links the exact runs, source edits, warm parents and scope. Wall time starts at +provider pipeline/run creation/start and ends at selected verdict completion, +including prerequisites, queueing, setup and transfers. It excludes unrelated +checks and native GitHub status-publication delay. Go covers the full 12-worker +Go job and seven prerequisites; Rust covers workspace tests, beacon, doctests +and ten feature partitions; Solidity covers the standard `main` contract suite. +Rust feature checks compile test configurations; they do not execute tests. + +Each language has one measured sample on its own frozen revision. Advertised +CPU/RAM match per build/verdict phase; hardware, OS, storage, usable memory and +peak aggregate concurrency can differ. Tests execute freshly on both services. +Solidity's Circle queue contributed about 170 seconds. Cache telemetry does not +measure equivalent total network traffic: parallel totals are not critical-path +time, and RWX log counters can omit lazy filesystem reads. + +Go and Rust verify warmed parent reuse, not prewarming the changed commit. +The compiler checkpoints match the parent's tracked Go source files / Rust +tree; broader accumulated source-only deltas are not established by these +samples. The earlier Go comparison with SDK downloads is diagnostic history, +not the final warm-cache result. Cost analysis is private and modeled rather +than verified invoice savings. + +## Important fixes already implemented + +| Area | Change and reason | Entry point | +| --- | --- | --- | +| Rust timestamps | Restore unchanged source mtimes at whole-second precision; stamp changed inputs into the next second and wait past that stamp before Cargo. Prevents false freshness after filesystem timestamp quantization. | [rust-target-cache.py](../../ops/ci/runtime/rust-target-cache.py) | +| Rust compiler reuse and handoffs | Reusable per-partition compiler producers feed fresh consumers; unit workers receive execution archives, while beacon/doctests retain required compiler state. Avoid passing full targets to every test worker. | [rust.yml](../../.rwx/rust.yml), [rust-workspace.sh](../../ops/ci/runtime/rust-workspace.sh) | +| System-file read timeouts | Materialize host linker inputs into fresh inodes with integrity checks and bounded retries of timed-out reads. Provider-side root cause remains unconfirmed. | [rwx-materialize-linker.py](../../ops/ci/runtime/rwx-materialize-linker.py) | +| Contract RPC 502s | Shared relay bounds concurrency and retries transient HTTP failures; nested shells preserve the relay environment. Permanent/exhausted failures still fail tests, and original attempts are retained. | [l2-rpc-proxy.py](../../ops/ci/runtime/l2-rpc-proxy.py), [contracts-test-env.sh](../../ops/ci/runtime/contracts-test-env.sh) | +| Go dependency reuse | Reuse source ancestors only after build-input identity checks; preserve current-source discovery after layer assembly; inherit modules and pass sealed runtime assets. | [go-dependency-source.py](../../ops/ci/runtime/go-dependency-source.py), [go-compiled-tests.py](../../ops/ci/runtime/go-compiled-tests.py) | +| Go test splitting | Share a 12-worker plan across providers and divide the slow deployer CLI package into four top-level groups without dropping tests. | [go-package-shards.py](../../ops/ci/runtime/go-package-shards.py), [go-test-names.go](../../ops/ci/runtime/go-test-names.go) | +| Circle Go cache correctness | Align `GOMODCACHE` with the restored directory across executors; include `go.mod`, `go.sum` and `mise.toml` in the immutable module key; retain per-node compiler caches. | [CI operations](ci-ops.md#go-module-cache-on-circle-machines) | + +The latest migration head also includes a `develop` merge and refreshed generated +fetcher artifacts. Do not undo Circle cache fixes to make a comparison look better. + +RWX support reported raising this organization's filesystem-layer limit to +200 GiB during the pilot. Older 100 GiB references in the operator guide describe +earlier incidents; the current account limit was not rechecked for this handoff. +Support also recommended binary/runtime artifacts and acknowledged ongoing +permission/hardlink work. Keep those open operational questions distinct from +the timestamp and local materialization fixes already validated. + +## Next steps, in order + +1. **Recheck state and preserve evidence.** Read the index, inspect local changes, + and fetch current PR heads. The documentation branch preserves this handoff; + use an appropriate migration checkout for implementation. Keep benchmark + fixtures frozen; do not rerun experiments merely to reconstruct context. +2. **Finish the migration drift.** The local merge above resolves the conflicts + and maps the new upstream workloads. An operator must still push it to + `codex/rwx-ci-pilot` (a fast-forward from `5552a61ccc`), then watch checks + and dependency review to terminal states on the resulting SHA. The first + hosted run must confirm the new `actions-verdict`, the NUT `op-reth` + producer and the two-binary release manifest. Historical green checks do + not validate that merge. +3. **Refresh coverage before claiming completion.** The 86/86 baseline is an + October 1 inventory with later original-report parity. The October 19 guide + mentions 88 occurrences, but later upstream jobs and variants need a new + inventory, including SP1 smoke/action jobs. Audit current gate dependencies, + routing, feature matrices, fork authorization, merge queue, denied cache + access, schedules and publication boundaries. +4. **Plan a bounded shadow rollout.** Start with Rust and Go, retain Circle as + the required provider, and observe ordinary PRs for latency, cold fallbacks, + flakes, cancellation and artifact completeness. Define the acceptance and + rollback criteria before changing required-gate ownership. +5. **Close commercial and operational questions privately.** Reconcile billed + usage with the models, confirm evidence retention/backups, and follow up on + filesystem reliability and permission/hardlink behavior. Do not publish raw + reports, credentials, pricing details or signed download URLs. + +The requested engineering report and copyable Slack draft were delivered in the +conversation. A slide deck was requested but that turn was interrupted before +creation; it is not an existing deliverable. + +## Resume safely + +Read [CI operations](ci-ops.md), [CI review](ci-config-review.md), and the +[operator guide](rwx-migration.md) before changing pipeline behavior. Inspect +the current checkout and current remote state with read-only commands: + +```bash +git status --short --branch +git rev-parse HEAD +git worktree list +gh pr view 23151 --repo ethereum-optimism/optimism \ + --json headRefName,headRefOid,baseRefName,state,isDraft,mergeable +gh pr checks 23151 --repo ethereum-optimism/optimism +``` + +The installed GitHub CLI supports the commands above but lacks +`gh pr checks --json`. Use `gh pr view --json statusCheckRollup` for structured +observations and account for superseded attempts. The connector lacked org SSO +access during handoff; the existing CLI authentication worked. + +Use existing authentication without copying token values into files or chat. +CLI RPC-vault access is separate from tool-cache write permission; recheck both +before any new hosted run. Normal PRs must not gain protected cache writes or +spoof `develop`. This handoff does not renew vault grants or run CI. + +The private companion index holds machine paths, collection scripts, original +checksums, billing methodology and raw evidence. It is outside Git and requires +operator access. Public PRs should retain source/run links, validation summaries +and caveats. A new session should begin by reporting changes since this snapshot +and the next required action, without treating this document as live CI state. diff --git a/docs/ai/rwx-migration.md b/docs/ai/rwx-migration.md new file mode 100644 index 00000000000..771f3c1f40e --- /dev/null +++ b/docs/ai/rwx-migration.md @@ -0,0 +1,557 @@ +# RWX CI operator guide + +Start with the [project handoff](rwx-handoff.md) for the latest dated PR state, +benchmark conclusions and next steps. Operational details below include older +snapshots; refresh the inventory and hosted limits before a cutover decision. + +Maintain this guide, the [86-job checklist](rwx-parity-todos.md), and +[evidence retrieval instructions](rwx-evidence-index.md). Historical closeouts, +benchmark samples and earlier inventories are archived outside Git. Implementation +stays in [PR #23151](https://github.com/ethereum-optimism/optimism/pull/23151) +on `codex/rwx-ci-pilot`, targeting `develop`. + +## Authority and rollout + +CircleCI owns `ci-gate`, `required-contracts-ci`, `required-rust-ci` and +`required-rust-e2e`. Keep dependency review and existing rulesets. Optional RWX +checks supply shadow evidence; they do not authorize required-gate migration. +Production publication, release/tag jobs and scheduled maintenance remain with +Circle. The private selector registry exercises publication without writing to +production. Only the pilot branch and `develop` trigger the native coordinator. +Fork authorization remains Bailiff's human-approved `external-fork/*` path; +fork, merge-queue and denied-cache-access rehearsals are still cutover work. + +Shared selection is [routing.yml](../../ops/ci/runtime/routing.yml), interpreted by +[compute-workflow-conditions.sh](../../ops/ci/runtime/compute-workflow-conditions.sh). +Circle scripts adapt Circle metadata; RWX metadata adapts native events. Unknown +or mixed code paths cannot take the docs-only shortcut. Safe skips still emit +Circle's exact required contexts. CI source changes select contracts and Rust +validation too. See [CI review](ci-config-review.md) for the merged continuation +config and gate review procedure. + +## Reusing feature compilation on PRs + +Each `features-build-N` task runs the original two Cargo Hack phases with the +source SHA, pinned tools, flags, incremental mode and one of ten partitions bound +to its inputs. Its compiler filesystem can be reused without granting PRs writes +to the protected tool-cache vault. `features-N` then inherits the current source +and that compiler state, reruns both original phases with `cache: false`, and +publishes only its fresh report. The Rust gate still depends on all ten fresh +consumers. Both stages use 4 CPUs and 8 GB; preparation and filesystem transfer +must be included in benchmark wall time and cost. A cold producer is additional +work, so warm results must be reported separately from warm-up. + +RWX WASM checks also link native Cargo build scripts. Restored GCC/glibc inputs +have intermittently returned `ETIMEDOUT` from file opens (`crti.o`, +`crtbeginS.o`, `libgcc.a`). Before these checks compile, `rwx-materialize-linker.py` +copies the image's host linker inputs into fresh local inodes, preserving their +bytes, ownership, mode and timestamps. It retries only timed-out input reads, +at most three times, and fails on exhaustion or any other error. The sealed +`host-linker` stage retains hashes, inode changes, timing and timeout counts. +Compilation and verdicts are never retried by this helper. This is a local +mitigation; the provider-side cause of the original reads remains unconfirmed. + +Develop refresh on October 19, 2026 adds required `rust-deny` and +`opgeth-ratchet` checks, bringing the current inventory to 88 PR occurrences. +The historical 86-occurrence parity snapshot remains dated evidence. SP1 now +also includes the log-commitment ELF and standalone vkey crate discovered from +its original recipes. Current-source validation must include those additions. + +## Helper ownership and removable boundaries + +| Directory | Owner and lifetime | +| --- | --- | +| `ops/ci/runtime/` | Permanent runners, report/source libraries, routing, native gate policy, timing seeds and build inputs | +| `ops/ci/tests/` | Permanent execution/configuration tests, routing scenarios and shared fixture construction | +| `ops/ci/migration/` | Offline comparers, Circle gate mappings/alignment, Insights, schedule/RPC synchronization, private publication rehearsal and their tests/fixtures | + +Runtime imports only runtime. Permanent tests consume runtime and permanent test +support. Migration tooling may consume both. Moved commands retain their basenames, +arguments and artifact destinations; there are no old-path forwarding helpers. +The existing Circle apt installer is the sole installer adapter; RWX uses +`runtime/apt-install.sh` directly. Toolchain snapshots exclude migration inputs. + +The native gate manifest is version 4. It contains native assignments, routing, +observers and check names. `migration/circle-gates.json` owns the Circle workflow +mapping; `migration/circle-alignment.py` verifies expanded Circle prerequisites. +Native execution does not read Circle YAML. Receipts use `native_policy_sha256`, +a hash of native policy, workload definitions/packages and the gate implementation. +The gate also verifies checked-out SHA, clean tracked source, current run/attempt, +complete assignments, engine states and sealed artifacts. Workload producers and +consumers own source/toolchain/settings binding and binary integrity. + +Shared runners still accept `--provider circleci`, `record-circle`, and +`CI_CHECK_PROVIDER`, `CI_CONTRACT_PROVIDER`, `CI_RUST_PROVIDER` and +`CI_E2E_PROVIDER=circleci`. Retained metadata aliases are `CIRCLE_SHA1`, +`CIRCLE_BRANCH`, `CIRCLE_NODE_INDEX`, `CIRCLE_NODE_TOTAL` and `CIRCLE_WORKFLOW_ID`. +Acceptance/Rust dependencies retain `.circleci-cache/rust-binaries`; Circle +selection paths retain their CLI partitioning adapter where applicable. These are caller compatibility inputs, not native +gate dependencies. Their tests stay with the execution contract until those +callers retire. Insights and the schedule/RPC synchronization remain transitional +workloads in both providers; the production publisher is unchanged. + +Offline `migration/report-evidence.py` centralizes original byte verification, +explicit empty-file recovery with audit records, and common path normalization. +Suite comparers still own discovery, required reports, settings, retries and +verdict interpretation. Runtime verification is read-only and rejects missing +empty files. Comparison helpers must not repair runtime artifacts. + +## Chosen execution graph + +[pr-gates.yml](../../.rwx/pr-gates.yml) coordinates full workloads and exact +engine-bound receipts. Workload definitions retain CLI entrypoints and protected +`develop` cache warming. The definitions and their local package parameters own +current resources, eligibility and settings; change them with their regression +fixtures. The 24-shard Go experiment and standalone package-transfer probe have +been retired. + +| Workload | Definition / contract | +| --- | --- | +| Full Go | `go-tests.yml`: 12 duration-balanced workers, with four top-level test groups for the deployer CLI package; compile 8 CPU / 16 GiB, verdict 8 CPU / 16 GiB; `-p=4`, `-parallel=8`, `40m` package timeout, three gotestsum retries / 50-failure ceiling. Verdicts require the sealed `op-reth-test-engine` (`REQUIRE_RUST_ENGINE=1`) | +| Go action tests | `go-tests.yml` `actions-verdict`: Circle's `just go-actions-tests-ci` recipe for `op-e2e/actions` on `op-reth-test-engine`, 16 CPU / 32 GiB like `2xlarge.gen2`; `list-test-packages` excludes this package from the 12 general workers | +| Acceptance | `acceptance.yml`: eight shards each for op-node and Kona, Fusaka / op-reth; separate discovery/compilation and fresh verdicts, per-variant memory | +| Contracts | `contracts.yml`: standard and modified-file matrices for four features; PR standard `liteci`, protected standard `ci`, modified `ciheavy` | +| Upgrades / L2 fork | Separate definitions and compile/verdict packages; preserve chain/feature matrices, pinned fork inputs and reporting | +| Rust | `rust.yml`, `op-reth.yml`, `rust-e2e.yml`; preserve package/features/partitions and original command authorities | +| Other PR jobs | `pilot.yml`, `pr-checks.yml`, `cannon-go.yml`, `nut-prefork.yml`, `nut-provenance.yml`, `sp1-guest.yml`, `kontrol-build.yml`, `flaky-report.yml`, `selector-upload.yml` | +| Rollup compatibility | `go-rollup.yml` remains CLI-only; shared compiled-Go helpers retain `--suite go-rollup` alongside `go-tests`; it adds no coverage credit | + +`just list-test-packages` owns full Go selection, including packages without tests. +Its acceptance, Cannon, Rust and deployer Forge exclusions remain. Discovery +rejects errors with the `ci` tag. Every selected package has one initial shard. +Timing seeds affect placement only; unknown packages stay included. Captain has +no Go partitioning support here; the shared package balancer assigns packages. + +Compile packages and verdict packages are separate. Go compilation starts after +Go preparation and contracts, while Rust/prestates continue. A verdict consumes +its own compiler leaf and runtime dependencies; it does not wait for other shard +compilers. Use `package.use` for file inputs, and caller leaves such as +`compile-0.build`. Artifact mount and vault expressions are not package value +arguments. Output filesystem filters use static family roots: native RWX omitted +parameterized output paths despite successful lint. + +## Go dependency reuse and test splitting + +Go helpers use a source ancestor with identical tracked build inputs. The input +identity includes source trees, submodule pins, toolchain/build configuration, +Docker inputs and CI helpers. Restoring a different source revision requires an +ancestor relationship and exact input identity; changed helper inputs force a +new producer. Binaries retain their actual build revision and consumers record +the current PR revision separately. +Reusable producers verify their tracked inputs before publishing. Same-commit +consumers retain strict revision/settings/hash checks and may project build-only +files out of their runtime workspace. Ancestor reuse additionally requires the +complete unchanged input scope; a filtered or modified ancestor scope fails closed. + +RWX output filters apply to a task's modified layer; inherited parent layers +remain part of downstream filesystems. Mixing ancestor helper producers with +HEAD can therefore restore ancestor Git metadata. Discovery, compilation and +runtime entrypoints reset to their declared current SHA after assembly, then +verify the actual checkout and clean tracked source before using sealed inputs. +The compiler bundle also seals and carries its discovery manifest, tagged package +inventory and complete package list. Runtime restores these verified files after +layer assembly so compiler-seed discovery cannot override the current shard plan. + +Module sources travel through native filesystem inheritance instead of a full +module-cache tarball repeated in every runtime artifact. The sealed helper +archives retain binaries and runtime assets. Runtime filters exclude Go compiler +objects and Rust targets. Immutable parent compiler seeds retain Go build-cache +objects for fresh current-source compilation, without PR tool-cache writes. +Compiler logs record actual compiler/linker commands for cache verification. +Preparation time and cost must be reported separately from warm PR measurements. +Circle prefers its own branch cache before broader fallbacks: warm the benchmark +branch at the parent source, then measure the new edit, and retain the actual +restored cache key plus compilation evidence. Another branch warming successfully +does not prove the measured branch will select that cache. + +Both providers use the same full-suite plan on the existing 12 workers. Static +Go AST discovery lists the CLI package's registered top-level tests, examples and +fuzz targets without running init or TestMain. Four groups retain every discovered +test once, including newly added tests; subtests stay together. The remaining +packages run whole. The current-source compiler seals the plan, test binaries and +prepared CLI helper; missing/corrupt helpers fail before tests. Runtime retries +cannot escape the assigned group. Ordinary local CLI tests retain their own +helper build. Splitting repeats package setup, so benchmark the complete affected +workflow rather than summing individual test durations. + +The 12-worker Circle Go job uses per-node build-cache namespaces. Shared immutable branch/revision keys preserve only the first writer's snapshot, so a successful parent run does not establish warmth for every shard. Verify all twelve restored parent keys and actual compiler subprocess counts; module-cache permissions and sharing are unchanged. + +## Cache, artifacts and credentials + +Keep native Go module/build/runtime, Foundry, Cargo target, sccache and +Docker/BuildKit caches isolated by producer, profile and toolchain. A content miss +restores compiler state and recompiles changed inputs. `cache-epoch`, build-probe +and the empty-target sccache mode remain explicit cache diagnostics; normal runs +use their chosen defaults. Retain probe evidence outside Git rather than adding +alternative task graphs. Compiler warming targets producers and executes zero +tests, RPC verdicts or helper fixtures. + +Rust target restoration records a content hash and timestamp for each source +file. Unchanged files recover their prior timestamps; changed/new files get new +timestamps. Legacy manifests and uncommitted prior builds refresh all inputs +once. The caller commits the map only after a successful build. Cargo owns +dependency freshness, including embedded bundles and compiler/toolchain changes. + +The RWX Rust feature checks and test build/runtime tasks trial incremental host +compilation with `cargo-incremental: "1"` (CLI override: `--init +cargo-incremental=0`). The shared runner enables the `dev`, `test`, and +`fast-build` profiles; it unsets the global incremental switch because sccache +0.18.0 rejects `CARGO_INCREMENTAL=1`. Local incremental invocations pass through +sccache; registry dependencies remain eligible for compiler caching. Reports and +test archives bind the effective profile settings. Test build/runtime cache names +include the incremental mode: combining old nonincremental targets with the new +outputs exceeded RWX's 100 GiB filesystem-layer limit in the first hosted trial. +Only test build/runtime workers use 150 GB writable disks. A compiler-cold run +exhausted the default 50 GB disk; a later warm verdict required 150 GB before +execution because its dependencies occupied 88.37 GB and RWX requires 20 GB of +scratch space. This does not increase the separate 100 GiB filesystem-layer +limit. CPU/memory resources stay unchanged. Feature cache names, shards and +selected commands remain. Circle, release/prestate builds +and other Rust jobs retain their current incremental policy. Compare complete +compile/cache-transfer timings before claiming a speed improvement. + +Verdicts execute freshly. Most use `cache: false`; Rust and contract fork verdicts +include run and attempt identity in their cache keys so tool-cache reads remain +available. RWX's `cache: false` disables tool caches as well as result reuse. +Exclude test results, logs and failure caches from +reusable outputs. Go/acceptance runtime snapshots exclude build caches and Cargo +targets, then validate and restore sealed dependency archives. Preserve fixtures, +working directories, source paths, submodules and branch/commit metadata. Go, +Forge, Cast, Anvil and Docker remain available when runtime fixtures require them. + +Each producer binds source revision, toolchain, effective settings and file hashes. +Consumers reject missing/corrupt binaries or stale bindings. The latest Cannon +build owns its Docker image identity; rebuilding can replace the initial image. +Gate receipts bind actual selected caller states, attempts and source. Failed, +canceled or missing selected verdicts fail; successful diagnostic retries do not +erase original failures. + +The shared cache-only vault permits writes only from `refs/heads/develop`. +PRs, including the pilot branch, restore this baseline read-only and compile their +changes locally. The pilot cache grant was revoked on 2026-10-07. Verify the +repository grants with `rwx vaults access list --vault optimism-op-reth-shadow +--json`; the only repository grant must be `ethereum-optimism/optimism` on +`refs/heads/develop`. New namespaces start cold until a protected `develop` run +warms them. The separate test-only archive-RPC vault +supplies Go runtime and contract archive inputs. Availability checks precede +expensive builds. Values stay in preflight/runtime tasks, outside tool setup, +compilation, package arguments and retained evidence. No production publishing +credentials are introduced into RWX. + +Contract archive calls use the shared HTTP relay for preflight and Forge runtime. +It allows one upstream request at a time, at most 20 requests/second per verdict, +and five attempts for HTTP 429/500/502/503/504 with 2/4/8/16-second backoff. +JSON-RPC errors returned with HTTP 200, permanent HTTP errors and exhausted +transport failures still reach Forge unchanged. This is a per-verdict limit, +not a provider-wide quota. Each attempt retains redacted request/response bytes +and status; the outer report seals the relay's final manifest too. Nested Bash +must not reload `BASH_ENV` and replace the loopback RPC environment with the +original upstream. Diagnostic suite retries never replace an original failure. + +For a resource-matched benchmark, freeze one commit and warm both providers +before measured pairs. Use the committed RWX definitions and protected cache +vault without private writable namespaces or permission changes. Set Circle's +`c-go_fresh_tests` to true to match RWX's fresh Go verdicts. Record every +failed sample. Compare actual provider allocations, including producers and +shards. Since #23594, every Circle job that runs +Rust binaries must use the Wolfi image that built them, so OP Node acceptance +and NUT pre-fork can no longer use the Ubuntu machine. OP Node acceptance runs +on 20 CPU / 40 GB Docker against RWX's 16 CPU / 64 GB; report that allocation +difference with any acceptance comparison. Equal allocations do not imply equal +available RAM: RWX reserves 2 GB for its own processes. Report executor differences +and unmatched bootstrap/control tasks separately, but include them in elapsed +time and cost. Keep preparation, execution and output processing visible; cache +phase worker-seconds overlap and must not be added to critical-path time. +Cold preparation killed SP1 at 4 CPU / 8 GB on RWX; its matched pilot build and +check allocations use 8 CPU / 16 GB on both providers. Non-pilot Circle jobs keep +their existing allocation. Do not infer adequate cold-build headroom from a +successful cached build. +The RWX NUT verdict uses 2 CPU / 8 GB because its cold Go build was killed at +2 CPU / 4 GB. Circle runs this job on the Rust Wolfi image at `medium.gen2` +(2 CPU / 4 GB) on all branches, so the allocations no longer match. Both +providers restore the sealed `op-reth-test-engine` that the generator spawns. +Clippy and udeps use 4 CPU / 8 GB on both pilot providers after both cold +checks were killed at 2 CPU / 4 GB. Circle retains its Rust Docker image and +normal compiler-cache setup; non-pilot jobs keep their existing allocation. + +The general Go contract producer matches Circle's `ci` profile and +`--deny-warnings --skip test` arguments, sealed in dependency settings. Forge's +`test` alias skips `.t.sol` files, retaining helpers such as `MockSP1Verifier.sol` +under `test/`. Rust E2E retains its original `--skip test` arguments. Compiling +the extra executable Solidity test graph exhausted 4 CPU / 8 GB and one +8 CPU / 16 GB cold producer; those failed preparations are separate evidence. +The corrected general producer uses the normal 4 CPU / 8 GB allocation and a +production `source-scripts` tool-cache namespace so old full-build artifacts +cannot enter its dependency archive. This namespace has the same protected +`develop` write grant; it is not a private writable benchmark cache. + +Runtime scripts import `ci-report.py` for JSON, hashes, manifest byte verification +and one subprocess invocation, and `ci-test-results.py` for original Go/JUnit +parsing. Suite owners choose discovery, settings, required reports, retries and +verdicts. The shared process helper forwards cancellation and preserves exit +status; it never retries. Contract callers redact before storing or hashing. +Only offline collectors may explicitly recover a manifest-declared empty file, +with an audit record. Runtime recovery is forbidden. Every runtime import belongs +in the producer's source/input seal and filtered snapshot. Test imports from the +actual filtered files, including SP1's toolchain snapshot. + +Rust test target-cache names include a namespace of tracked Cargo manifests, +`Cargo.lock`, Cargo configuration, the pinned Superchain bundle checksum, +compiler flags, build/cache helper settings, +and actual Rust/Cargo/sccache versions. Source-only edits keep the namespace and +use per-file timestamp restoration. Dependency/toolchain changes seed a new +initial layer. This fixes the observed `develop` dependency update: compilation +passed, but retaining the old 64.9 GiB layers plus 54.2 GiB of new outputs exceeded +RWX's 100 GiB filesystem-layer cap. Runner disk size cannot raise that cap. The +failed producer's original archive and logs remain in external evidence. + +Timestamp preparation also tracks the ignored Superchain tar declared by Cargo's +build script. Its producer still owns checksum verification. A cold build may +materialize it after preparation; successful compilation records its actual +timestamp. Later restores preserve that timestamp when its bytes are unchanged. + +Raw target restores can quantize mtimes to whole seconds. Preparation rounds +unchanged input timestamps down to the same resolution and stamps changed inputs +with the next whole second. It waits until the wall clock is strictly past every +prepared input timestamp before returning to Cargo. Unchanged inputs normally +return immediately; the clock check also handles an early wake or a backwards +clock adjustment. Newly materialized generated assets keep their producer-owned +timestamps until their next restore. + +CLI validation of this helper on `fd722f0900` with uploaded CI changes passed the +[full Rust test workload](https://cloud.rwx.com/optimism/runs/01a13ae1ed257f0a9061db6cfe987fd5): +3,314 passes, 17 existing doctest skips and 10 policy-excluded nextest cases. +The [following cache reuse check](https://cloud.rwx.com/optimism/runs/01a13b0aacc373e795a9328169eeacc6) +restored 1,346 source files and the generated tar with no refreshed inputs and +zero crate recompilations. A [whole-second target regression](https://cloud.rwx.com/optimism/runs/01a13ae6f4987ee69ca2c04698ee113b) +also verified source-change invalidation and reuse after the changed build. +These trials used isolated default-vault cache names; they do not establish +protected-branch cache warming or change the production cache grants. + +Full-test compiler producers retain individual `rust/target` files. Keep compiler +binaries and fingerprints; +remove nextest reports before publication. RWX can reuse unchanged filesystem +files without retaining another full compressed snapshot on every update. +The complete producer artifact at `4047caccc5` measured 54.24 GiB of regular-file +payload (59.26 GiB counting hardlink aliases), versus 11.44 GiB compressed. +This is a current-tree measurement, not the complete RWX layer total. +Successful workspace runs retain `cache-size.json` with regular-file bytes, +allocated bytes, hardlink counts and directory breakdowns for targets, Cargo +and sccache. These sizes describe the current tree; the engine's layer accounting +also includes inherited and superseded layers. + +The Rust test handoff uses RWX's immutable filesystem directly. The current-source +`tests-build` producer publishes compiler files plus a small `compiler.json` +artifact. The compiler-dependent worker inherits those files and checks the +manifest's revision, toolchain, flags and source-fingerprint digest before Cargo +runs. A pending fingerprint is rejected. Neither task packs a target archive; +compiler and unit verdict workers publish reports only, avoiding another full +compiler-layer publication after tests. The nextest binary archive remains the +handoff to the execution-only worker. + +Compiler preparation uses a source ancestor selected by the last change to build +inputs: manifests, lockfile, toolchain, Cargo/Just configuration and CI helpers. +Its checkout, dependency fetch and compiler outputs are immutable cached tasks, reusable across +source-only PR edits without shared-cache writer permission. Current-source +workers reset/clean the Rust checkout to HEAD and always invoke Cargo; source fingerprint preparation +restores unchanged timestamps and refreshes edited inputs. Feature partitions use +the Cargo.lock digest on both services, keeping assignments stable across source +edits. Both providers default to `CARGO_INCREMENTAL=0` so sccache can cache local +crate compilations. The explicit incremental trial remains available on RWX. + +The test compiler seed runs a second compilation discovery after its cold build, +so generated watched inputs (the superchain archive) precede Cargo's final +build-script fingerprints. Fresh HEAD workers still create their own test archive. + +An intermediate ancestor need not build. Optional preparation retains its original +failure and discards partial targets before fresh HEAD compilation. Such a fallback +is not evidence of a warm cache. Changes to `cache-epoch` invalidate the preparation +tasks. Benchmark evidence must verify the actual restored targets, current-source +recompilation, cache hits and fresh coverage rather than assuming warmth from a +successful previous run. + +The full Rust test workload has two fresh verdict workers. `tests-unit` executes +nextest from the checksum-verified binary archive. It receives no compiler archive; +its unpacked execution binaries and runtime fixture outputs are excluded from +filesystem publication. `tests-compiler` runs the beacon Cargo test +and doctests using the current producer's inherited compiler filesystem. +Both workers retain the selected 16 CPU / 32 GiB resources and may execute in +parallel. The `tests` task collects both artifacts after execution, including +ordinary failures. It verifies source, tools, settings and run identity, retains +each child's original settings and attempt, consumes its validated coverage, and +emits the existing +`.ci/rust-workspace/tests` full-suite report. Native gates observe both workers and +the aggregate, including cancellation or absent artifacts. Warm-only runs select +neither verdict worker nor the aggregate. + +For an isolated execution fixture, run +`RWX_LIVE_RUST_FIXTURE=1 python3 -m unittest discover -s ops/ci/tests -p 'test_rust_workspace.py'` +on Linux with the pinned Rust, nextest, Just, mold and sccache tools. This exercises +an empty-target nextest worker, native compiler handoff validation, aggregate coverage and +original failure retention. It also copies the real Lokahi CLI tests and verifies +the runtime `CARGO_BIN_EXE_lokahi` path under nextest and ordinary Cargo. Rust 1.95 +and nextest 0.9.132 provide this input; compile-time executable paths are not +portable to an extracted target directory. The shared `tests` CLI mode remains available for +Circle and earlier collected commands. The split changes scheduling and transport; +it does not remove the independently scheduled `doctest` workload. Compare hosted +end-to-end timings before claiming a speed improvement. The compiler-dependent +worker inherits compiler state and publishes only reports; hosted cache transport +and filesystem restoration performance remain part of the benchmark. + +Raw target layers exceeded the cap even after executable pruning: at +`d233b6c244`, 73.5 GiB inherited plus 26.6 GiB added failed publication after +successful compilation. Keep those original failure records outside Git. +Cache preparation +separates host `deps/*.rmeta` hardlinks from incremental metadata while preserving +bytes, permissions and timestamps; retain `cache-publication.json`. The engine +result, rather than this preparation record, proves filesystem publication. A restored +shared entry returned `ESTALE` twice, but the filesystem root cause is unproven. +These changes need cold publication and untouched warm-update validation; a +breakpoint run that touched cached files is diagnostic evidence only. + +Modified-contract runs capture `develop` once in `modified-baseline` and retain +`.ci/contract-baseline.txt`. Compile/verdict packages receive that full SHA through +`target-sha` / `CI_CONTRACT_TARGET_SHA`; originals record `target_binding: +run-pinned`, `target_sha`, and `merge_base_sha`. Discovery keeps Circle's three-dot +changed-file rule but names the pinned commit. Verdicts verify the same pin and +selection without fetching the moving branch. Standard-contract cache inputs do +not inherit this baseline. Circle's standalone commands retain their existing +fetch/selection behavior; comparison requires both providers to use the same +recorded target and merge base. + +The bounded changed-crate experiment on `3df2ffe919` used three samples per mode +for `kona-providers-alloy`, 4 CPU/8 GiB checks and 16 CPU/32 GiB test compilation. +Median compile seconds were 1.79/0.60 (off/on) for checks and 2.42/0.81 for tests. +Including local tar archive/restore, medians were 3.42/3.03 and 3.14/1.75 seconds. +Target contents grew from 996 MB to 1,173 MB for checks and from 1,053 MB to +1,417 MB for tests. Keep the selected incremental configuration. This experiment +measures a small crate edit, not full-workspace runtime or cost; local tar timings +do not measure RWX cache-network transfer. Cold seeds are excluded from samples. + +The historical pilot-readiness rehearsal allowed the pilot branch and `develop` +in both vaults. Cache writes are now restricted to `develop`; the test-only RPC +vault still permits the pilot branch. A patched CLI run with `branch: develop` was denied +the RPC vault before execution; a harmless cache-write probe ran but declared no +protected tool-cache version. A separate running task was canceled and returned +`aborted/cancelled`, `failed`. Routing and gate fixtures cover safe skips, +unknown/mixed paths, queue metadata and failed/canceled/missing prerequisites. +Actual fork and merge-queue events remain required before gate cutover. GitHub +currently requires one approving review plus two contract-team approvals for this +PR's contract paths; CI success does not satisfy these reviews. + +## Run and validate + +Use repository tool pins via mise. RWX CLI v3.32.1 was used for retained pilot +validation; install/authenticate it separately and retain the actual version in +new evidence. Do not copy authentication wrappers or secret values into reports. +An authenticated operator can run a workload from a clean pushed checkout: + +```bash +rwx whoami +rwx run .rwx/pr-gates.yml --wait +# A CLI workload run does not establish automatic push/check association. +rwx results RUN_ID --json +rwx logs TASK_ID +``` + +Validate changes as one batch, then observe one combined hosted push. Do not run +Circle per edit or restart performance tuning. Additional runs follow diagnosed +failures or material fixes. On macOS use Bash 4+ for routing and a Python with +PyYAML; the pinned Python environment may require its dependencies installed. + +```bash +mise exec yq jq -- bash ops/ci/tests/test-decision-tree.sh +mise exec yq jq -- bash .circleci/scripts/test-decision-tree.sh +python3 -m unittest discover -s ops/ci/tests -p 'test_*.py' +python3 -m unittest discover -s ops/ci/migration/tests -p 'test_*.py' +python3 ops/ci/migration/circle-alignment.py +rwx lint .rwx/*.yml .rwx/packages/*.yml --warnings-as-errors +# Merge and validate both setup and activated continuation configs as described +# in ci-config-review.md, with the authenticated Circle CLI. +``` + +Run ShellCheck on changed scripts using the native task's Bash context. Live +Go/Forge/Docker fixtures are opt-in locally and execute in their hosted helper +tasks; report local skips honestly. Preserve failure originals before retrying. +Watch the exact pushed SHA's four Circle gates, dependency review and all optional +checks to terminal states. Git conflict status and local tests are not hosted +readiness. + +## Retained changes outside CI + +This audit covers every non-CI source/config change against the pilot's upstream +base, plus the Circle adapters below. Archived pre-cleanup diffs retain exact +bytes. The table distinguishes required reporting from workload changes. + +| Retained path(s) | Necessity and behavior | Regression rationale / evidence | +| --- | --- | --- | +| `.dockerignore` | Exclude `.ci` caches/reports and generated offline witnesses from image contexts; these are not image inputs | Prestate hashes and Cannon guest/image validation catch changed build inputs; avoid multi-GB context transfers | +| `.github/CODEOWNERS` | Give CI/security owners review of `.rwx` and shared `ops/ci` policy | Both providers now execute these files, so existing CI review ownership must cover them | +| `.gitignore`, `rust/kona/.gitignore` | Ignore generated `.ci` data and offline Cannon output | Keep caches/evidence out of commits; checked-in witness specification remains an input | +| Root `justfile` Go runner | Retain complete package/discovery/settings reports; opt-in fresh Circle tests, default false | Discovery errors, new/no-test packages, duplicates, fresh execution and retry ceilings are covered by `test_go_suite`, `test_go_package_shards`, `test_go_compiled_tests`; no default selection/count reduction | +| Root `justfile` pre-fork recipe | Delegate original fresh Go command to `nut-prefork-test.sh` so originals survive failure | `test_nut_prefork` exercises production Just loops, both forks, fixture paths, cancellation and original failure retention | +| `op-acceptance-tests/justfile` | Provider-neutral shard inputs and retained discovery/assignments/JSON/JUnit; valid empty shards still emit reports; quote checkout paths | `test_acceptance_manifest`, `test_acceptance_runner`, `test_acceptance_report` verify exact selection, errors, empty shards and retries; same-SHA full Fusaka parity retained | +| `op-acceptance-tests/scripts/generate-flaky-tests-report.sh` | Public API may run anonymously; reject HTTP/schema errors, retain each attempt, escape report HTML, preserve acceptance-only interface | `test_flaky_report` / comparer fixtures cover full public response, malformed data, transient/permanent errors and output drift; branch label identifies requesting branch, not an API filter | +| `ops/check-changed/main.py` | Treat `.rwx` and `ops/ci` as CI inputs for existing changed-pattern jobs | `test_check_changed` and real routing fixtures prevent CI-only changes silently skipping validation | +| `ops/scripts/nut-provenance-verify-changed.sh` | Shared selection/report adapter; full inspection remains opt-in and does not alter normal changed-lock selection | `test_nut_provenance` covers missing refs, unchanged/changed locks, failed generation and retained attempts; historical worktree remains authority | +| `ops/scripts/nut-provenance-verify/{main.go,report.go,main_test.go}` | Optional reports copy actual source/tool/submodule and generated bytes before temporary worktree removal; failed generation cannot report an old snapshot as fresh | Real Git tests cover matching/mismatched bytes, failed generator, dual report/generator errors and worktree cleanup; plain verifier wrapper keeps reporting disabled | +| `ops/scripts/test-interop-deposits-diff.sh` | Optional stdout/stderr/exit retention; ordinary invocations still clean temporary files | Existing differential command/result remains authority; Rust extra fixtures reject failed or changed originals | +| `packages/contracts-bedrock/test/{setup/Setup.sol,L1/ResourceMetering.t.sol,L2/L1Block.t.sol}` | Attach reasons to existing `vm.skip` calls; log after skip was unreachable | Conditions, assertions and skip counts unchanged. Suite fixtures verify reason evidence and initial failures. No Solidity production contract is changed | +| `packages/contracts-bedrock/test/kontrol/scripts/make-summary-deployment.sh` | Capture deployment, loader and generated inputs only when report directory is set | `test_kontrol_build` validates real summary/proof phases, corrupt/stale inputs and failures; ordinary generation unchanged | +| `rust/lokahi/tests/cli.rs` | Read Cargo/nextest's runtime executable path so archived tests use the remapped Lokahi binary; assertions and CLI behavior stay intact | The pinned Linux fixture copies the real three CLI tests, reproduces their missing compile-time path without producer targets, then verifies archive-only nextest and ordinary `cargo test` execution | +| `rust/justfile` | Optional cargo-hack command-list reporting, default false, retains actual partitions | Workspace fixtures verify full packages and exactly-once feature partitions; original checks still run | +| `rust/kona/bin/client/scripts/fetch-witness-tar.sh` | Remove a stale ETag when the archive is missing; bounded transfer retries | Otherwise a bodyless 304 left no runtime witness. Cannon fixtures cover actual archive/ELF/image handoff and retained transport failures | +| `docs/ai/ci-ops.md`, `docs/ai/ci-config-review.md`, three RWX guides and checksum index | Describe actual shared routing, required gate ownership and private retrieval | Local links and the 86 exact baseline names are checked; historical source and hashes survive consolidation | + +Removed: the unrelated `Bytes.t.sol` comment, three standalone native package +probe definitions, three isolated Circle replay workflows and their API routing +options. The selector workflow remains because normal pilot pushes require a +private publication target. Historical probes/experiments are reproducible from +the archived source. Offline comparers, timing seeds, bounded captured regression +fixtures and cache diagnostic modes remain: active parity verification and +package placement consume them. They are not generated run evidence. + +## Circle change audit + +| Surface | Retained reason and regression boundary | +| --- | --- | +| `.circleci/config.yml` and continuation parameters | Keep default-false `c-go_fresh_tests`, `c-nut_provenance_full`, with default-false forwarding. These alter explicit verification inputs, not normal Circle test settings. Retired API replay and block-override parameters are no longer forwarded | +| `.circleci/routing.yml`, `scripts/{collect-params.sh,compute-workflow-conditions.sh,workflow-helpers.sh}` | One policy and path authority for both providers; Circle entrypoints translate event/base/branch and preserve schedules, tags and authorized forks. The retired issue-close automation is no longer routed. Real changed-file and Circle-adapter fixtures cover unknown paths and safe gates | +| `continue/main.yml` workload wrappers | Retain original recipes via shared suite runners and complete discovery/settings/failure reports, including dependency/prestate hashes. Gate names and dependency lists remain Circle-owned | +| Main contract matrices | Preserve profile, feature, changed-file selection, timeout and fuzz/invariant settings. Reasons/reporting support strict parity; seeded coverage is opt-in. L2 pilot relay/pinned-block checks retain originals without reloading `BASH_ENV` over runtime overrides | +| Private selector workflow | Pilot pushes only, original publisher against official private service/database; no production context. No API replay dispatch remains. Non-pilot production uploader retains its original branch filtering and destination | +| `continue/rust-ci.yml` | Shared reporters retain original workspace, WASM, registry, Cannon and interop commands; manifests bind complete selection and native artifacts. Original profiles/features and required fan-in remain | +| `continue/rust-e2e.yml` | Original devnet, restart, proof and SP1 guest runners retain complete runtime/compiler originals; profile, feature and suite selection remain. Rust E2E comparer/regressions cover original failures, retries and runtime dependencies | +| `.circleci/scripts/{test-schedule-triggers.js,test-decision-tree.sh}` and shared fixtures | Read the shared routing file, exercise the same Circle entrypoints, and verify retired options cannot dispatch isolated workflows. Setup/merged/activated config validation supplements routing tests | + +Same-SHA workload evidence established the 86-job parity baseline; this cleanup +uses existing regression ownership rather than creating new workload benchmarks. +Cutover, required-check ownership, production identity and full `develop` parity +remain open in the checklist. + +## Migration tooling retirement + +Retire migration tooling only after approved RWX required-gate cutover and the +rollback window closes. First archive final original reports and the matching +source revision in checksum-verified storage outside Git. Replace or retire +Insights reporting, Circle schedule synchronization and the private publication +rehearsal. Then remove `ops/ci/migration`, its mappings/tests, helper-task +invocations and migration-only filters. Finally remove Circle adapters and unused +provider/metadata compatibility modes, and run permanent tests plus native +configuration validation. This PR separates these owners; it does not cut over +required gates or retire these workloads. + +Verification is reported by scenarios: complete/new/unknown package discovery; +omission on either provider; duplicate assignment; stale SHA, toolchain or settings; +corrupt artifacts; real runtime fixture builds; retries; cancellation; retained +failure reports; legitimate safe skips; and altered Circle prerequisites. The +permanent import test and isolated native gate fixture run without Circle or +migration files. Historical reports must be reproduced with their archived +source, not interpreted with the version 4 receipt schema. + +The SP1 guest shadow follows Circle's `test-config-fallback` feature selection. +Both providers record the feature and the `-test` ELF source marker, require the +unsafe-test marker in the super-range guest, and discover guest tests with +`--all-features`. Production publication retains its upstream marker rejection. +SP1 runtime report verification is read-only; only the migration comparer can +recover manifest-declared empty Circle logs, with an audit record. diff --git a/docs/ai/rwx-parity-todos.md b/docs/ai/rwx-parity-todos.md new file mode 100644 index 00000000000..4fc40ca19c9 --- /dev/null +++ b/docs/ai/rwx-parity-todos.md @@ -0,0 +1,354 @@ +# RWX PR coverage checklist + +Maintain this checklist with the [operator guide](rwx-migration.md) and +[evidence retrieval instructions](rwx-evidence-index.md). All work stays in +[draft PR #23151](https://github.com/ethereum-optimism/optimism/pull/23151). + +## Scope and denominator + +The baseline is [Circle pipeline 135411](https://app.circleci.com/pipelines/github/ethereum-optimism/optimism/135411), +SHA `587b4c3a73d3f16f15212b72e9a0ed0e8489a7c4`, October 1, 2026. +It contains 86 expanded PR job occurrences: matrix variants and occurrences in +different workflows count separately; native shards do not. The October 5 +upstream refresh at `b9ae98c8f1a6cef46576f48831a8e51c53f87023` found no upstream +workflow changes since the pilot base. Refresh the inventory when upstream CI +changes. Setup, schedule checking, protected/post-merge and release work are +outside this denominator. + +| Workflow | Implemented and verified occurrences | Baseline | +| --- | ---: | ---: | +| Main | 32 | 32 | +| Contracts | 23 | 23 | +| Rust | 22 | 22 | +| Rust E2E | 9 | 9 | +| Total | 86 | 86 | + +**86 / 86 = 100% workload coverage.** Every occurrence has native execution and +resolved same-SHA original-report parity in the retained evidence. This does not +establish provider speed superiority, current-head readiness or required-gate +ownership. Circle remains responsible for all four required gates. + +## Upstream changes since the baseline + +The October 27 merge of `develop` at `60698d94a5ebfae2df26005f3baf1d358f6c61f5` +changed these PR occurrences. The baseline counts above stay as recorded. A +full inventory refresh must still recount every workflow. + +- Retired: `diff-fetcher-forge-artifacts`. #23527 replaced the forge script with + `eth_call`s and deleted the job and its committed artifacts. The native + fetcher workload and its shadow check were removed with it. +- Added: `go-actions-tests` (`ci-gate`). #21786 moved `op-e2e/actions` into its + own job on `op-reth-test-engine`. The native `actions-verdict` task and its + `main-go` gate mapping are implemented. Hosted same-SHA parity is not yet + verified, so this occurrence has no parity credit. +- Changed inputs: `go-tests`, `check-nut-prefork-states` and + `kona-proof-action-single` now require `op-reth-test-engine` (#23648, + #22632). Both providers supply it from their release producers. Their earlier + parity evidence predates this input. +- Outside the PR denominator: `contracts-bedrock-build-tests-develop` (#23619) + runs only on `develop`. + +The October 28 merge of `develop` at `68335987fb2780078740c22bed83c771161b3b7f` +changed these PR occurrences: + +- Added: the `OP_PRIVATE` contract feature (#23657) in + `contracts-bedrock-tests`, `contracts-bedrock-tests-heavy-fuzz-modified`, + `contracts-bedrock-coverage` and `contracts-bedrock-tests-upgrade op-mainnet` + (`required-contracts-ci`). The four native verdict tasks and their gate + mappings are implemented. Hosted same-SHA parity is not yet verified, so these + occurrences have no parity credit. +- Changed routing: `rust_changes_detected` now also matches `op-core/nuts/` + (#23714). + +The October 28 merge of `develop` at `018f03f82fe7e878d78db344f21306717b45f604` +changed these PR occurrences: + +- Added: `shfmt-check` (`ci-gate`, #23326). The native `shfmt-check` task runs + the same `just shfmt-check` recipe with the pinned `shfmt`, and its + `main-checks` gate mapping is implemented. The pilot's shell scripts are + formatted to pass it. Hosted same-SHA parity is not yet verified, so this + occurrence has no parity credit. + +The October 30 merges of `develop` changed these PR occurrences: + +- Renamed: the `OPTIMISM_PORTAL_INTEROP` dev feature became the `INTEROP` + system feature (#23779) in every contract matrix. The native tasks, gate + mappings and feature environment now use `INTEROP` and + `SYS_FEATURE__INTEROP`. Hosted same-SHA parity is not yet verified for the + renamed occurrences. +- Changed execution: `just test` and `just coverage` split each shard into an + Amsterdam pass and a default-EVM pass (#23788). The native contract suites + run the same two passes and retain each pass's original report. +- Changed inputs: `nut-provenance-verify` compares locks against the PR's + target branch (#23622). The native runner uses the same base. + +The November 3 merge of `develop` at `d4575feeee3f4c1f55879678c21138d4ecae9809` +changed these PR occurrences: + +- Retired: `contracts-bedrock-coverage` (#23879) in every feature. The native + coverage workload, its shadow check, its `required-contracts-ci` mappings and + the go-ffi coverage replay seed were removed with it. + +The November 4 and 5 merges of `develop`, ending at +`9931ba24f0372b384a05c0fc9f803ff324921879`, changed these PR occurrences: + +- Retired: the `ZK_DISPUTE_GAME` and `BRIDGE_HOOK,ZK_DISPUTE_GAME` variants of + `contracts-bedrock-tests`, `contracts-bedrock-tests-heavy-fuzz-modified` and + `contracts-bedrock-tests-upgrade op-mainnet` (#23868). The native verdict + tasks and their `required-contracts-ci` mappings were removed with them. +- Changed execution: `shell-check` runs `find | xargs shellcheck` with the + mise-pinned ShellCheck 0.10.0 in place of the ShellCheck orb (#23905). The + native task runs the same command and pin. Hosted same-SHA parity is not yet + verified for the new command. + +The November 5 merge of `develop` at `50115fa6ff8f205845afc12c652ac2fd7a389854` +changed these PR occurrences: + +- Retired: `rust-binaries-for-sysgo` (#23948). The aggregator only echoed a + message; its consumers now require the three Rust binary jobs directly. It + had no native task or gate mapping, so nothing on the RWX side changed. +- Changed environment: Circle's sccache setup pins `SOURCE_DATE_EPOCH` so + reth-node-core stays cacheable (#23948). RWX does not use that sccache path. + +The November 6 merge of `develop` at `446b187d3f12499a149d2533601caa1e9b2b296d` +changed these PR occurrences: + +- Changed execution: `memory-all-*` runs each top-level test in its own + `go test`, eight at a time, and fails unless every assigned test ran and + passed (#23974). The shared recipe keeps the recorded RWX shard selection and + runs the same per-test commands; the report joins the per-test event logs. + Hosted same-SHA parity is not yet verified for the new execution. + +The completed workload snapshot is `a1aa49aaf3713a8172f3f615f094488fd8e39c3d`; +its 92 summary hashes and complete provider originals are recoverable through the +evidence guide. Historical per-stage percentages and closeouts are archived. +The last three workload comparisons use `f821983dd56cbd7e488ab903d1ac386a330de7f6`: +seven L2 fork cases and 407 runtime relay requests on each provider, 21 exact +Contracts prerequisites, and all 1,120 private selector rows plus API readbacks. +Earlier failures remain retained and receive no additional coverage credit. + +## October 19 develop refresh + +Current implementation includes `rust-deny` in the Rust gate and +`opgeth-ratchet` in Main, for 88 PR occurrences (Main 33, Contracts 23, Rust 23, +Rust E2E 9). This updates selection; the 86-occurrence original-report snapshot +above remains historical. Validate the refreshed source on both providers before +assigning the two additions current parity credit. + +Feature compilation uses source-bound `features-build-0` through +`features-build-9` producers. All ten `features-N` consumers still execute fresh +original Cargo Hack phases and own the gate verdicts; producers add no workload +occurrences. Count their preparation and transfer in performance comparisons. + +## Current Rust execution split + +`rust-tests` is implemented by fresh `tests-unit` and `tests-compiler` workers and +the stable `tests` aggregate. Nextest receives only its verified execution archive; +beacon and doctests retain their compiler baseline and cold fallback. All three +native tasks belong to the same baseline occurrence, so the denominator stays 86. +Circle commands and required gates retain their current ownership. Revalidate the +split on the final hosted SHA; historical parity evidence does not establish its +current runtime or cache-transport performance. + +## Exact baseline occurrences + + +Implement and execute the exact expanded CircleCI jobs below. Shared producers +can serve multiple consumers, but validate every occurrence and dependency edge. +The names come from the baseline pipeline, including CircleCI's expanded build +names and feature suffixes. + +### Main workflow + +CircleCI workflow: `main` (32 jobs). + +- [x] `todo-issues-check` +- [x] `shell-check` +- [x] `semgrep-test` +- [x] `semgrep-scan-local` +- [x] `rust-sp1-super-range-executor` +- [x] `rust-op-reth-binary` +- [x] `rust-kona-binaries` +- [x] `rust-binaries-for-sysgo` +- [x] `prep-superchain` +- [x] `prep-go-modules` +- [x] `op-deployer-forge-version` +- [x] `nut-provenance-verify` +- [x] `l2-chains-sync-check` +- [x] `kona-build-sp1-elfs` +- [x] `go-lint` +- [x] `go-binaries-for-sysgo` +- [x] `generate-flaky-tests-report` +- [x] `contracts-bedrock-build-1` +- [x] `contracts-bedrock-upload` +- [x] `diff-fetcher-forge-artifacts` +- [x] `check-op-geth-version` +- [x] `check-nut-prefork-states` +- [x] `check-nut-locks` +- [x] `check-kontrol-build` +- [x] `check-generated-mocks-op-service` +- [x] `check-generated-mocks-op-node` +- [x] `cannon-prestate` +- [x] `go-tests` +- [x] `memory-all-kona-op-reth-fusaka` +- [x] `memory-all-opn-op-reth-fusaka` +- [x] `cannon-go-lint-and-test` +- [x] `ci-gate` +### Contract workflow + +CircleCI workflow: `contracts-feature-tests` (23 jobs). + +- [x] `prep-go-modules` +- [x] `contracts-bedrock-tests main` +- [x] `contracts-bedrock-tests CUSTOM_GAS_TOKEN` +- [x] `contracts-bedrock-tests OPTIMISM_PORTAL_INTEROP` +- [x] `contracts-bedrock-tests ZK_DISPUTE_GAME` +- [x] `contracts-bedrock-tests-heavy-fuzz-modified main` +- [x] `contracts-bedrock-tests-heavy-fuzz-modified CUSTOM_GAS_TOKEN` +- [x] `contracts-bedrock-tests-heavy-fuzz-modified OPTIMISM_PORTAL_INTEROP` +- [x] `contracts-bedrock-tests-heavy-fuzz-modified ZK_DISPUTE_GAME` +- [x] `contracts-bedrock-coverage main` +- [x] `contracts-bedrock-coverage CUSTOM_GAS_TOKEN` +- [x] `contracts-bedrock-coverage OPTIMISM_PORTAL_INTEROP` +- [x] `contracts-bedrock-coverage ZK_DISPUTE_GAME` +- [x] `contracts-bedrock-tests-upgrade op-mainnet main` +- [x] `contracts-bedrock-tests-upgrade op-mainnet CUSTOM_GAS_TOKEN` +- [x] `contracts-bedrock-tests-upgrade op-mainnet OPTIMISM_PORTAL_INTEROP` +- [x] `contracts-bedrock-tests-upgrade op-mainnet ZK_DISPUTE_GAME` +- [x] `contracts-bedrock-tests-upgrade op-mainnet` +- [x] `contracts-bedrock-tests-upgrade ink-mainnet` +- [x] `contracts-bedrock-tests-upgrade unichain-mainnet` +- [x] `contracts-bedrock-tests-l2-fork op-mainnet` +- [x] `contracts-bedrock-checks-fast-feature-tests` +- [x] `required-contracts-ci` +### Rust workflow + +CircleCI workflow: `rust-ci` (22 jobs). + +- [x] `rust-fmt` +- [x] `rust-zepter` +- [x] `rust-wasm-wasi` +- [x] `rust-wasm-unknown` +- [x] `rust-udeps` +- [x] `rust-typos` +- [x] `rust-tests` +- [x] `rust-doctest` +- [x] `rust-docs` +- [x] `rust-clippy` +- [x] `rust-check-no-std` +- [x] `rust-cargo-hack` +- [x] `rust-build` +- [x] `op-reth-superchain-snapshot-check` +- [x] `op-reth-integration-tests` +- [x] `op-reth-compact-codec` +- [x] `kona-registry-snapshot-check` +- [x] `kona-lint-cannon` +- [x] `kona-host-client-offline-cannon` +- [x] `kona-build-fpvm-cannon-client` +- [x] `interop-deposits-diff` +- [x] `required-rust-ci` +### Rust E2E workflow + +CircleCI workflow: `rust-e2e-ci` (9 jobs). + +- [x] `rust-workspace-release` +- [x] `contracts-bedrock-build-2` +- [x] `cannon-prestate` +- [x] `kona-proof-action-single` +- [x] `op-reth-e2e-sysgo-tests` +- [x] `rust-e2e-restart` +- [x] `rust-e2e-simple-kona` +- [x] `rust-e2e-simple-kona-sequencer` +- [x] `required-rust-e2e` + +## Maintenance and cutover work + +- [x] Chosen 12 Go shards and reusable compile/verdict packages; preserve overlap + with Rust/prestate builds and runtime-only credentials. +- [x] Shared report I/O/process/byte verification; suite selection and verdict + rules remain in their owners; filtered import regression retained. +- [x] Historical documentation/probes archived outside Git; three maintained + guides; non-CI and Circle changes audited in the operator guide. +- [ ] Complete final PR review and exact-head terminal CI before marking ready; + preserve original failures and attribute them before rerunning. +- [ ] Rehearse native internal PR, unknown/mixed paths, docs-only safe skips, + merge-group SHAs, superseded runs and exact check association. +- [ ] Rehearse authorized forks and denial of privileged credentials/cache writes + on unauthorized refs, CLI runs and patched source. +- [ ] Replace Circle setup/continuation and schedule-trigger checking if migrating + provider orchestration. Do not count them as part of the 86 completed jobs. +- [ ] Validate protected `develop` profiles and actual cache-warming events; CLI + warm-only rehearsals are not protected-event evidence. +- [ ] Export current rulesets, provider identities, bypasses and legacy branch + patterns; rehearse safe skips, failed/canceled/missing selected prerequisites + and required-gate rollback before proposing cutover. +- [ ] Audit production credential/context names, GCP federation, bucket ownership + and cache access without exporting values. Assign one writer per destination. +- [ ] Replace Circle flake-history dependency and avoid duplicate notifications. +- [ ] Port schedules, maintenance, tag/manual filters and releases separately; + verify reproducibility, provenance and publishing restrictions before transfer. +- [ ] Retire old provider identities/configuration only after an approved cutover, + rollback window and legacy branch obligations. + +Wall-clock speed remains the optimization target. Keep the chosen configuration; +new tuning needs an identified bottleneck and complete original samples. Include +queueing, setup, transfers and the final verdict, label compiler/cache state, and +leave cost analysis deferred. No speed claim is required for workload completion. + +The Rust cache trial preserves the 86-job selection, feature partitions, profiles +and runner resources. It restores source timestamps per unchanged file and +enables incremental compilation within RWX's existing host check/test profiles. +Circle settings remain unchanged. Retain the effective profile overrides and +compiler/cache-transfer timings; hosted correctness and a runtime improvement +are separate claims. The operator guide documents the CLI baseline switch. + +## Helper separation and retirement prerequisites + +The 86-job denominator and selected workload settings are unchanged by helper +relocation. Permanent execution/policy is in `ops/ci/runtime`; permanent scenario +tests/support are in `ops/ci/tests`. Comparers, Circle alignment/mappings, Insights, +schedule synchronization and the private selector rehearsal are migration-owned. +Separate helper task commands retain existing task keys and workload dependencies. +Native policy version 4 binds `native_policy_sha256`; original report destinations +remain unchanged. + +- [ ] Approve required-gate cutover and close the rollback window. +- [ ] Archive final original comparison evidence and matching source with checksums outside Git. +- [ ] Replace or retire Circle Insights, Circle schedule synchronization and the private publication rehearsal. +- [ ] Remove migration tooling/tests/mappings, workflow invocations and migration-only filters. +- [ ] Remove Circle adapters and unused provider metadata/cache compatibility modes. +- [ ] Run permanent tests and native configuration validation after retirement. + +Pilot readiness additions (2026-10-06): + +- [x] Pin the modified-contract baseline across compilation and verdicts; prove + branch advancement succeeds and mismatched pins fail before tests execute. +- [x] Complete the bounded changed-crate incremental on/off experiment; keep the + selected configuration and record the network-transfer measurement boundary. +- [x] Rehearse patched CLI RPC denial, protected cache-write denial, and an actual + canceled task; retain definitions, terminal states and originals outside Git. +- [ ] Obtain required approving and contract-team reviews after final-head CI. + +These observations do not complete the actual fork/merge-queue event or required +gate cutover items above. + +- [x] Namespace full Rust test target caches by dependency/compiler inputs after + the observed cross-lockfile layer-cap failure; ordinary source edits still reuse + targets. Keep the original failed producer and its successful compilation proof. +- [ ] Measure Rust target-layer transfer separately in future performance work; + the first corrected namespace uploaded 57,315 MiB in 292 seconds. Keep the + selected configuration for this stage. +- [x] Restrict the shared cache vault to `develop` writers; PRs, including the + pilot branch, restore its baseline read-only. Retain the before/after grants. +- [ ] Validate full-test caches with individual target files, excluding the + compressed transfer artifact and test reports from reusable layers. Keep the + immutable producer artifact for empty runtime caches. Retain exact tree sizes, + layer totals, unchanged reuse, source rebuild, failure and fresh-verdict evidence. + Protected warming of the new namespace starts after merge on `develop`. +- [ ] Investigate the filesystem root cause of restored-rmeta `ESTALE` with RWX. + Publish independent metadata files as the pilot workaround; retain both + original failures and label breakpoint observations as diagnostic. Do not + equate successful cold compilation with untouched warm-update proof. +- [x] Size full Rust test build/runtime disks for restored dependencies and RWX's + scratch requirement. The 100 GB warm verdict failed before execution at + `75f51b1427`; use 150 GB while retaining 16 CPU / 32 GiB. diff --git a/justfile b/justfile index 22e08c7b4b1..31af6b6026d 100644 --- a/justfile +++ b/justfile @@ -353,7 +353,31 @@ _go-tests-ci-internal go_test_flags="": build-superchain-go source ./ops/scripts/source-ci-archive-rpcs.sh export NAT_INTEROP_LOADTEST_TARGET=10 export NAT_INTEROP_LOADTEST_TIMEOUT=30s + if [[ -z "{{go_test_flags}}" && "${CIRCLE_NODE_TOTAL:-1}" == 12 ]]; then + export CI_COMMIT_SHA="${CIRCLE_SHA1:-$(git rev-parse HEAD)}" + export CI_BRANCH="${CIRCLE_BRANCH:-$(git branch --show-current)}" + export CI_SHARD_INDEX="${CIRCLE_NODE_INDEX:-0}" CI_SHARD_TOTAL=12 CI_GO_FRESH_TESTS=true + export CI_GO_BUILD_CACHE="$(go env GOCACHE)" CI_GO_MODULE_CACHE="$(go env GOMODCACHE)" + mise exec -- bash ops/ci/runtime/go-full-tests.sh discover + cp .ci/go-tests/{all-packages.txt,go-list.json} tmp/testlogs/ + cp tmp/testlogs/go-list.json tmp/testlogs/discovery.json + python3 ops/ci/runtime/go-suite.py record-circle --flags="{{go_test_flags}}" + mise exec -- bash ops/ci/runtime/go-full-tests.sh build + mise exec -- bash ops/ci/runtime/go-full-tests.sh run + cp tmp/testlogs/packages.txt "tmp/testlogs/packages-${CI_SHARD_INDEX}.txt" + cp tmp/testlogs/log.json "tmp/testlogs/log-${CI_SHARD_INDEX}.json" + exit 0 + fi ALL_PACKAGES="$(just list-test-packages | tr '\n' ' ')" + FRESH_FLAGS=() + case "${CI_GO_FRESH_TESTS:-false}" in + 1|true) FRESH_FLAGS=(-count=1) ;; + 0|false) ;; + *) echo "CI_GO_FRESH_TESTS must be true/false or 1/0" >&2; exit 1 ;; + esac + printf '%s\n' $ALL_PACKAGES >tmp/testlogs/all-packages.txt + go list -e -tags=ci -json $ALL_PACKAGES >tmp/testlogs/discovery.json + python3 ops/ci/runtime/go-suite.py record-circle --flags="{{go_test_flags}}" if [ -n "${CIRCLE_NODE_TOTAL:-}" ] && [ "$CIRCLE_NODE_TOTAL" -gt 1 ]; then NODE_INDEX=${CIRCLE_NODE_INDEX:-0} NODE_TOTAL=${CIRCLE_NODE_TOTAL:-1} @@ -370,6 +394,7 @@ _go-tests-ci-internal go_test_flags="": build-superchain-go PARALLEL_PACKAGES=$(printf '%s\n' $ALL_PACKAGES \ | circleci tests split --split-by=timings --timings-type=classname \ | tr '\n' ' ') + printf '%s\n' $PARALLEL_PACKAGES >"tmp/testlogs/packages-$NODE_INDEX.txt" # An empty share for one node is a legitimate timing-bucketing outcome; # the packages run on the other nodes. Only an empty package list # (checked above) means the job would silently test nothing. @@ -384,15 +409,16 @@ _go-tests-ci-internal go_test_flags="": build-superchain-go --rerun-fails=3 \ --rerun-fails-max-failures=50 \ --packages="$PARALLEL_PACKAGES" \ - -- -p=4 -parallel="$PARALLEL" {{go_test_flags}} -timeout={{TEST_TIMEOUT}} -tags="ci" + -- -p=4 -parallel="$PARALLEL" "${FRESH_FLAGS[@]}" {{go_test_flags}} -timeout={{TEST_TIMEOUT}} -tags="ci" else + printf '%s\n' $ALL_PACKAGES >tmp/testlogs/packages-0.txt ./ops/scripts/gotestsum-split.sh --format=standard-verbose \ --junitfile=./tmp/test-results/results.xml \ --jsonfile=./tmp/testlogs/log.json \ --rerun-fails=3 \ --rerun-fails-max-failures=50 \ --packages="$ALL_PACKAGES" \ - -- -p=4 -parallel="$PARALLEL" {{go_test_flags}} -timeout={{TEST_TIMEOUT}} -tags="ci" + -- -p=4 -parallel="$PARALLEL" "${FRESH_FLAGS[@]}" {{go_test_flags}} -timeout={{TEST_TIMEOUT}} -tags="ci" fi # Runs short Go tests with gotestsum for CI. @@ -495,7 +521,7 @@ nut-provenance-verify fork: # Generates op-core/nuts/state/_state.json (predecessor state + frozen bundle), and # _multichain_state.json from Lagoon onward. _nut-prefork-state-for fork: - OP_E2E_GEN_PREFORK_STATE={{fork}} go test -count=1 -run TestGenerateForkState ./rust/kona/tests/proofs/ + bash ops/ci/runtime/nut-prefork-test.sh {{fork}} # Generates op-core/nuts/state/_state.json (predecessor state + frozen bundle), and # _multichain_state.json from Lagoon onward. diff --git a/op-acceptance-tests/justfile b/op-acceptance-tests/justfile index a2ec5c383c3..ba8507a0c32 100644 --- a/op-acceptance-tests/justfile +++ b/op-acceptance-tests/justfile @@ -11,7 +11,7 @@ build-deps: if [[ -n "${CIRCLECI:-}" ]]; then exit 0; fi echo "Building contracts (local build)..." - cd {{REPO_ROOT}} + cd "{{REPO_ROOT}}" echo " - Installing mise..." mise install cd packages/contracts-bedrock @@ -19,14 +19,14 @@ build-deps: just install echo " - Forge build..." just build-no-tests - cd {{REPO_ROOT}} + cd "{{REPO_ROOT}}" echo "Building cannon dependencies..." - cd {{REPO_ROOT}} + cd "{{REPO_ROOT}}" just cannon-prestates echo "Building Rust binaries (kona-node, kona-host, op-reth)..." - cd {{REPO_ROOT}} + cd "{{REPO_ROOT}}" just build-rust-release # Run specific acceptance tests. Builds dependencies first, then passes all arguments to go test. @@ -40,7 +40,7 @@ build-deps: test *args: build-deps #!/usr/bin/env bash set -euo pipefail - cd {{REPO_ROOT}} + cd "{{REPO_ROOT}}" flags=() case " $* " in *" -count="*|*" -count "*) ;; @@ -95,8 +95,10 @@ acceptance-test: echo "TEST JOBS: $JOBS" echo "TEST PARALLELISM: $TEST_PARALLEL" echo "TEST TIMEOUT: $TEST_TIMEOUT" + export ACCEPTANCE_TEST_JOBS="$JOBS" ACCEPTANCE_TEST_PARALLEL="$TEST_PARALLEL" + export ACCEPTANCE_TEST_TIMEOUT="$TEST_TIMEOUT" LOG_LEVEL - cd {{REPO_ROOT}} + cd "{{REPO_ROOT}}" if ! command -v gotestsum >/dev/null; then echo "error: gotestsum is required for acceptance-test runs." >&2 exit 1 @@ -122,23 +124,29 @@ acceptance-test: # split the test set across CIRCLE_NODE_TOTAL nodes using historical timings # so each node runs a balanced subset. Falls back to running everything when # CIRCLE_NODE_TOTAL is unset (local runs, single-node CI). - export NODE_INDEX=${CIRCLE_NODE_INDEX:-0} - go test -list '^Test' "${TEST_PACKAGES[@]}" | tee "$LOG_DIR/tests_list.txt" \ - | {{REPO_ROOT}}/ops/scripts/shard-tests.sh > "$LOG_DIR/tests_shard.txt" \ - || { grep -v '^Test' "$LOG_DIR/tests_list.txt" >&2; exit 1; } - - # `go test -list` prints a package's tests and then its `ok ` line. - # Anything else could be hiding a test name, as in `setup: TestX` from a TestMain - # that prints with no newline. - awk '/^Test[^[:space:]]*$/ { names[++n] = $0; next } - /^ok \t/ { for (; n > 0; n--) print $2, names[n]; next } - /^\? \t/ { next } - { print "error: unexpected go test -list output: " $0 > "/dev/stderr"; exit 1 }' \ - "$LOG_DIR/tests_list.txt" > "$LOG_DIR/tests_all_pairs.txt" - - SHARD_COUNT=$(wc -l < "$LOG_DIR/tests_shard.txt" | tr -d ' ') - echo "Node $NODE_INDEX/${CIRCLE_NODE_TOTAL:-1} running $SHARD_COUNT tests:" - cat "$LOG_DIR/tests_shard.txt" + export NODE_INDEX=${CI_SHARD_INDEX:-${CIRCLE_NODE_INDEX:-0}} + NODE_TOTAL=${CI_SHARD_TOTAL:-${CIRCLE_NODE_TOTAL:-1}} + DISCOVERY_DIR="$LOG_DIR/discovery" + mkdir -p "$DISCOVERY_DIR" + ASSIGNED="$DISCOVERY_DIR/assigned.txt" + if [[ -n "${CI_ACCEPTANCE_MANIFEST:-}" ]]; then + cp "$CI_ACCEPTANCE_MANIFEST/"{manifest.json,packages.json,listing.json} "$DISCOVERY_DIR/" + python3 ops/ci/runtime/acceptance-manifest.py select --directory "$DISCOVERY_DIR" \ + --total "$NODE_TOTAL" --index "$NODE_INDEX" > "$ASSIGNED" + else + # Retain and reject errors from both commands before invoking a splitter. + go list -e -json "${TEST_PACKAGES[@]}" > "$DISCOVERY_DIR/packages.json" + go test -list '^Test' -json "${TEST_PACKAGES[@]}" > "$DISCOVERY_DIR/listing.json" + python3 ops/ci/runtime/acceptance-manifest.py names --directory "$DISCOVERY_DIR" \ + --total "$NODE_TOTAL" > "$DISCOVERY_DIR/names.txt" + "{{REPO_ROOT}}/ops/scripts/shard-tests.sh" < "$DISCOVERY_DIR/names.txt" > "$ASSIGNED" + fi + python3 ops/ci/runtime/acceptance-manifest.py record --directory "$DISCOVERY_DIR" \ + --total "$NODE_TOTAL" --index "$NODE_INDEX" --assigned "$ASSIGNED" + + SHARD_COUNT=$(wc -l < "$ASSIGNED" | tr -d ' ') + echo "Node $NODE_INDEX/$NODE_TOTAL running $SHARD_COUNT tests:" + cat "$ASSIGNED" # There are far more tests than nodes, so an empty shard means the split failed. if [ "$SHARD_COUNT" -eq 0 ]; then @@ -147,9 +155,9 @@ acceptance-test: fi # Pair each test on this node with the package(s) that have it, in shard order. - while read -r name; do - grep " $name\$" "$LOG_DIR/tests_all_pairs.txt" || { echo "error: no package found for $name" >&2; exit 1; } - done < "$LOG_DIR/tests_shard.txt" > "$LOG_DIR/tests_pairs.txt" + # The pairs come from the recorded selection, which rejects discovery errors. + python3 ops/ci/runtime/acceptance-manifest.py pairs --directory "$DISCOVERY_DIR" \ + --total "$NODE_TOTAL" > "$LOG_DIR/tests_pairs.txt" # Runs one test; passing means a clean exit and the test starting and reporting # a pass or skip, since `go test` also passes when -run matches nothing. Exits @@ -161,6 +169,7 @@ acceptance-test: local failed_log="$LOG_DIR/failed/$id.log" {{REPO_ROOT}}/ops/scripts/gotestsum-split.sh \ --format testname \ + ${SUMMARY_FLAG:+"$SUMMARY_FLAG"} \ --junitfile "$RESULTS_DIR/results-$id.xml" \ --jsonfile "$LOG_DIR/raw_go_events-$id.log" \ -- \ @@ -185,7 +194,11 @@ acceptance-test: rm "$failed_log" } export -f run_test - export LOG_LEVEL RESULTS_DIR LOG_DIR TEST_PARALLEL TEST_TIMEOUT + SUMMARY_FLAG="" + if [[ "${ACCEPTANCE_TEST_HIDE_FAILURE_OUTPUT:-false}" == true ]]; then + SUMMARY_FLAG=--hide-summary=output + fi + export LOG_LEVEL RESULTS_DIR LOG_DIR TEST_PARALLEL TEST_TIMEOUT SUMMARY_FLAG set +e xargs -n 2 -P "$JOBS" bash -c 'run_test "$@" --org --repo --token [--output-dir ]" - echo "Debug information:" - echo "BRANCH: $BRANCH" - echo "ORG_NAME: $ORG_NAME" - echo "REPO_NAME: $REPO_NAME" - echo "CIRCLE_API_TOKEN length: ${#CIRCLE_API_TOKEN}" + echo "Usage: $0 --branch --org --repo [--token ] [--output-dir ]" exit 1 fi @@ -77,8 +73,42 @@ mkdir -p "$OUTPUT_DIR" # Fetch flaky tests data # See: https://circleci.com/docs/api/v2/index.html#tag/Insights/operation/getFlakyTests echo "Fetching flaky tests data for branch: $BRANCH" -API_RESPONSE=$(curl -s -H "Circle-Token: $CIRCLE_API_TOKEN" \ - "https://circleci.com/api/v2/insights/gh/$ORG_NAME/$REPO_NAME/flaky-tests?branch=$BRANCH") +CURL_OPTIONS=(--fail-with-body --show-error --silent --connect-timeout 20 --max-time 90) +if [[ -n "$CIRCLE_API_TOKEN" ]]; then CURL_OPTIONS+=(-H "Circle-Token: $CIRCLE_API_TOKEN"); fi +ORIGINAL_JSON="$OUTPUT_DIR/flaky_tests.original.json" +# Retain each original failure instead of letting curl overwrite earlier bodies +# while retrying. Permanent HTTP authorization/path failures fail immediately. +for attempt in 1 2 3 4 5 6; do + attempt_base="$OUTPUT_DIR/api-attempt-$attempt" + if curl "${CURL_OPTIONS[@]}" --get --data-urlencode "branch=$BRANCH" \ + --output "$attempt_base.json" --write-out '%{http_code}\n' \ + "https://circleci.com/api/v2/insights/gh/$ORG_NAME/$REPO_NAME/flaky-tests" \ + > "$attempt_base.http-status.txt" 2> "$attempt_base.stderr.log"; then + curl_status=0 + else + curl_status=$? + fi + printf '%s\n' "$curl_status" > "$attempt_base.exit-code.txt" + [[ ! -f "$attempt_base.json" ]] || cp "$attempt_base.json" "$ORIGINAL_JSON" + cp "$attempt_base.http-status.txt" "$OUTPUT_DIR/http-status.txt" + cat "$attempt_base.stderr.log" >&2 + http_status=$(cat "$attempt_base.http-status.txt") + if [[ "$curl_status" == 0 && "$http_status" == 200 ]]; then break; fi + case "$http_status" in + 400 | 401 | 403 | 404) + echo "Error: CircleCI API HTTP $http_status" >&2 + exit "$((curl_status == 0 ? 1 : curl_status))" + ;; + esac + if [[ "$attempt" == 6 ]]; then + echo "Error: CircleCI API fetch failed after $attempt attempts" >&2 + exit 1 + fi + sleep "$((2 ** attempt))" +done +REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" +python3 "$REPO_ROOT/ops/ci/migration/flaky-report.py" validate-api "$ORIGINAL_JSON" +API_RESPONSE=$(cat "$ORIGINAL_JSON") # Check if we got a valid response if [ -z "$API_RESPONSE" ]; then @@ -90,9 +120,10 @@ fi echo "Filtering for acceptance tests only..." API_RESPONSE=$(echo "$API_RESPONSE" | jq '.flaky_tests = (.flaky_tests | map(select(.classname | startswith("github.com/ethereum-optimism/optimism/op-acceptance-tests/tests"))))') -# Save the raw response for debugging +# Preserve the existing acceptance-only JSON interface as well as the complete +# unfiltered original above. echo "$API_RESPONSE" > "$OUTPUT_DIR/flaky_tests.json" -echo "Raw API response saved to $OUTPUT_DIR/flaky_tests.json" +echo "Acceptance-test response saved to $OUTPUT_DIR/flaky_tests.json" # Use acceptance-tests fresponse directly echo "Using acceptance-tests filtered response without additional branch verification..." @@ -131,11 +162,12 @@ jq -r '.flaky_tests | sort_by(.times_flaked) | reverse | .[] | [ # Generate HTML report echo "Generating HTML report..." +BRANCH_HTML=$(jq -nr --arg branch "$BRANCH" '$branch | @html') cat > "$OUTPUT_DIR/flaky_tests.html" << EOF - Flaky Tests Report - Branch: $BRANCH + Flaky Tests Report - Branch: $BRANCH_HTML