From 2f321df375d30adb0b79636b2382afa17fd8bd8e Mon Sep 17 00:00:00 2001 From: Teddy Knox Date: Thu, 29 Oct 2026 12:37:47 -0400 Subject: [PATCH 01/49] ci: import .rwx and ops/ci verbatim from #23151 at 2216cd4069 Baseline for review: later commits on this branch remove what only CircleCI used and decouple RWX from the pilot's CircleCI and product-code hooks. Co-Authored-By: Claude Opus 5.5 --- .rwx/acceptance.yml | 498 +++++++ .rwx/cannon-go.yml | 208 +++ .rwx/contract-coverage.yml | 382 ++++++ .rwx/contract-l2-fork.yml | 215 +++ .rwx/contract-upgrades.yml | 435 ++++++ .rwx/contracts.yml | 586 ++++++++ .rwx/flaky-report.yml | 91 ++ .rwx/go-rollup.yml | 166 +++ .rwx/go-tests.yml | 1121 +++++++++++++++ .rwx/kontrol-build.yml | 211 +++ .rwx/nut-prefork.yml | 243 ++++ .rwx/nut-provenance.yml | 181 +++ .rwx/op-reth.yml | 423 ++++++ .rwx/packages/acceptance-compile.yml | 45 + .rwx/packages/acceptance-verdict.yml | 85 ++ .rwx/packages/contract-coverage-compile.yml | 37 + .rwx/packages/contract-coverage-verdict.yml | 62 + .rwx/packages/contract-upgrades-compile.yml | 37 + .rwx/packages/contract-upgrades-verdict.yml | 55 + .rwx/packages/contracts-compile.yml | 44 + .rwx/packages/contracts-verdict.yml | 54 + .rwx/packages/go-contracts.yml | 29 + .rwx/packages/go-go.yml | 28 + .rwx/packages/go-kona.yml | 28 + .rwx/packages/go-modules.yml | 33 + .rwx/packages/go-op-reth.yml | 30 + .rwx/packages/go-prestate.yml | 29 + .rwx/packages/go-sp1-executor.yml | 27 + .rwx/packages/go-test-compile.yml | 43 + .rwx/packages/go-test-verdict.yml | 86 ++ .rwx/packages/kontrol-contracts.yml | 23 + .rwx/packages/nut-tools.yml | 27 + .rwx/packages/rust-e2e-contracts.yml | 27 + .rwx/packages/rust-e2e-release.yml | 28 + .rwx/packages/toolchain-common.yml | 9 + .rwx/packages/toolchain-foundry.yml | 30 + .rwx/packages/toolchain-go.yml | 14 + .rwx/packages/toolchain-rust.yml | 29 + .rwx/pilot.yml | 192 +++ .rwx/pr-checks.yml | 635 +++++++++ .rwx/pr-gates.yml | 605 +++++++++ .rwx/rust-e2e.yml | 1001 ++++++++++++++ .rwx/rust.yml | 1201 +++++++++++++++++ .rwx/selector-upload.yml | 168 +++ .rwx/sp1-guest.yml | 218 +++ ops/ci/migration/circle-alignment.py | 29 + ops/ci/migration/circle-gates.json | 18 + ops/ci/migration/compare-cannon-go.py | 151 +++ ops/ci/migration/compare-ci.py | 543 ++++++++ .../migration/compare-contract-artifacts.py | 177 +++ ops/ci/migration/compare-contract-coverage.py | 197 +++ ops/ci/migration/compare-contract-l2-fork.py | 311 +++++ ops/ci/migration/compare-contract-suites.py | 169 +++ ops/ci/migration/compare-contract-upgrades.py | 84 ++ ops/ci/migration/compare-flaky-report.py | 166 +++ ops/ci/migration/compare-kontrol-build.py | 267 ++++ ops/ci/migration/compare-main-checks.py | 174 +++ ops/ci/migration/compare-nut-prefork.py | 160 +++ ops/ci/migration/compare-nut-provenance.py | 53 + ops/ci/migration/compare-pr-checks.py | 114 ++ ops/ci/migration/compare-pr-gates.py | 264 ++++ ops/ci/migration/compare-rust-cannon.py | 170 +++ ops/ci/migration/compare-rust-e2e.py | 193 +++ ops/ci/migration/compare-rust-extra.py | 174 +++ ops/ci/migration/compare-selector-upload.py | 388 ++++++ ops/ci/migration/compare-sp1-guest.py | 164 +++ ops/ci/migration/compare-static-checks.py | 122 ++ ops/ci/migration/flaky-report.py | 232 ++++ ops/ci/migration/l2-chains-sync-check.py | 32 + ops/ci/migration/report-evidence.py | 42 + ops/ci/migration/selector-registry.py | 438 ++++++ ops/ci/migration/selector-upload.py | 426 ++++++ .../circleci-contract-cases.json | 30 + .../ci-comparison/circleci-foundry-skips.json | 37 + .../ci-comparison/circleci-go-cases.json | 30 + .../ci-comparison/rwx-foundry-skips.xml | 18 + .../fixtures/flaky-report/provenance.json | 10 + .../flaky-report/public-insights.json | 1031 ++++++++++++++ .../abi-oracle/foundry-config.json | 325 +++++ .../selector-upload/abi-oracle/original.log | 13 + .../project/cache/solidity-files-cache.json | 1 + .../abi-oracle/project/foundry.toml | 4 + .../project/out/Fixture.sol/Empty.json | 1 + .../project/out/Fixture.sol/Fixture.json | 1 + .../out/build-info/28a4e5f671f97142.json | 1 + .../abi-oracle/project/src/Fixture.sol | 7 + .../denied-write/http-0-request.json | 1 + .../denied-write/http-0-response.json | 1 + .../live-import/denied-write/http-0.json | 8 + .../live-import/denied-write/stderr.log | 2 + .../live-import/denied-write/stdout.log | 3 + .../duplicate-upload/http-0-request.json | 1 + .../duplicate-upload/http-0-response.json | 1 + .../live-import/duplicate-upload/http-0.json | 8 + .../live-import/duplicate-upload/stderr.log | 1 + .../live-import/duplicate-upload/stdout.log | 8 + .../first-upload/http-0-request.json | 1 + .../first-upload/http-0-response.json | 1 + .../live-import/first-upload/http-0.json | 8 + .../live-import/first-upload/stderr.log | 1 + .../live-import/first-upload/stdout.log | 8 + .../selector-upload/live-import/fixture.json | 13 + .../multi-profile-oracle/foundry-config.json | 347 +++++ .../multi-profile-oracle/original.log | 9 + .../project/cache/solidity-files-cache.json | 1 + .../multi-profile-oracle/project/foundry.toml | 7 + .../out/AUnrestricted.sol/AUnrestricted.json | 1 + .../out/Shared.sol/Shared.dispute.json | 1 + .../project/out/Shared.sol/Shared.json | 1 + .../out/ZRestricted.sol/ZRestricted.json | 1 + .../out/build-info/bbc87524da30141a.json | 1 + .../out/build-info/df3a523b2f827bc0.json | 1 + .../project/src/AUnrestricted.sol | 4 + .../project/src/Shared.sol | 3 + .../project/src/ZRestricted.sol | 4 + .../fixtures/selector-upload/provenance.json | 18 + .../circleci/execution.json | 14 + .../circleci/isolation.json | 27 + .../circleci/provenance.json | 7 + .../provider-isolation/circleci/stderr.log | 168 +++ .../provider-isolation/circleci/stdout.log | 1122 +++++++++++++++ .../provider-isolation/rwx/execution.json | 14 + .../provider-isolation/rwx/isolation.json | 27 + .../provider-isolation/rwx/provenance.json | 7 + .../provider-isolation/rwx/stderr.log | 168 +++ .../provider-isolation/rwx/stdout.log | 1122 +++++++++++++++ ops/ci/migration/tests/test-circle-adapter.sh | 42 + ops/ci/migration/tests/test_check_changed.py | 75 + .../migration/tests/test_circle_alignment.py | 33 + .../migration/tests/test_compare_cannon_go.py | 169 +++ ops/ci/migration/tests/test_compare_ci.py | 403 ++++++ .../tests/test_compare_contract_artifacts.py | 111 ++ .../tests/test_compare_contract_coverage.py | 170 +++ .../tests/test_compare_contract_l2_fork.py | 194 +++ .../tests/test_compare_contract_suites.py | 178 +++ .../tests/test_compare_contract_upgrades.py | 103 ++ .../tests/test_compare_flaky_report.py | 115 ++ .../tests/test_compare_main_checks.py | 236 ++++ .../migration/tests/test_compare_pr_checks.py | 144 ++ .../tests/test_compare_rust_cannon.py | 144 ++ .../migration/tests/test_compare_rust_e2e.py | 111 ++ .../tests/test_compare_rust_extra.py | 174 +++ .../tests/test_compare_selector_upload.py | 160 +++ .../tests/test_compare_static_checks.py | 123 ++ ops/ci/migration/tests/test_flaky_report.py | 212 +++ .../tests/test_migration_cannon_go.py | 81 ++ .../tests/test_migration_contract_coverage.py | 27 + .../tests/test_migration_contract_suites.py | 25 + .../migration/tests/test_migration_imports.py | 18 + .../tests/test_migration_kontrol_build.py | 176 +++ .../tests/test_migration_main_checks.py | 82 ++ .../tests/test_migration_nut_prefork.py | 69 + .../tests/test_migration_nut_provenance.py | 78 ++ .../tests/test_migration_rust_workspace.py | 58 + .../tests/test_migration_sp1_guest.py | 105 ++ .../tests/test_migration_static_checks.py | 94 ++ ops/ci/migration/tests/test_pr_gate_parity.py | 277 ++++ .../migration/tests/test_report_evidence.py | 35 + .../migration/tests/test_selector_upload.py | 210 +++ ops/ci/runtime/acceptance-manifest.py | 150 ++ ops/ci/runtime/acceptance-report.py | 56 + ops/ci/runtime/acceptance-tests.sh | 71 + ops/ci/runtime/apt-install.sh | 67 + ops/ci/runtime/cannon-go.py | 233 ++++ ops/ci/runtime/cannon-witness.json | 11 + ops/ci/runtime/ci-report.py | 162 +++ ops/ci/runtime/ci-source.py | 67 + ops/ci/runtime/ci-test-results.py | 196 +++ ops/ci/runtime/collect-params.sh | 98 ++ ops/ci/runtime/compute-workflow-conditions.sh | 164 +++ ops/ci/runtime/contract-coverage.py | 443 ++++++ ops/ci/runtime/contract-l2-fork.py | 269 ++++ ops/ci/runtime/contract-suites.py | 335 +++++ ops/ci/runtime/contract-upgrades.py | 389 ++++++ ops/ci/runtime/contracts-test-env.sh | 26 + ops/ci/runtime/contracts-test-report.py | 94 ++ ops/ci/runtime/contracts-tests.sh | 61 + ops/ci/runtime/git-submodule-report.py | 18 + ops/ci/runtime/go-artifacts.py | 137 ++ ops/ci/runtime/go-compiled-tests.py | 382 ++++++ ops/ci/runtime/go-dependencies.sh | 82 ++ ops/ci/runtime/go-dependency-source.py | 65 + ops/ci/runtime/go-full-tests.sh | 81 ++ ops/ci/runtime/go-package-shards.py | 174 +++ ops/ci/runtime/go-report.py | 84 ++ ops/ci/runtime/go-rollup-tests.sh | 70 + ops/ci/runtime/go-rollup-timings.json | 24 + ops/ci/runtime/go-rpc-preflight.py | 38 + ops/ci/runtime/go-suite.py | 131 ++ ops/ci/runtime/go-test-names.go | 65 + ops/ci/runtime/go-tests-timings.json | 494 +++++++ ops/ci/runtime/kontrol-build.py | 190 +++ ops/ci/runtime/kontrol-contracts.py | 112 ++ ops/ci/runtime/kontrol-image.json | 7 + ops/ci/runtime/kontrol-image.py | 103 ++ ops/ci/runtime/l2-rpc-proxy.py | 115 ++ ops/ci/runtime/main-checks.py | 279 ++++ ops/ci/runtime/nut-prefork-test.sh | 10 + ops/ci/runtime/nut-prefork.py | 210 +++ ops/ci/runtime/nut-provenance.py | 318 +++++ ops/ci/runtime/nut-tools.sh | 33 + ops/ci/runtime/op-reth-report.py | 178 +++ ops/ci/runtime/op-reth-shadow.sh | 143 ++ ops/ci/runtime/pilot-l2-fork-block.txt | 1 + ops/ci/runtime/pr-checks.py | 197 +++ ops/ci/runtime/pr-gate.py | 341 +++++ ops/ci/runtime/pr-gates.json | 823 +++++++++++ ops/ci/runtime/routing.yml | 93 ++ ops/ci/runtime/rust-cannon-report.py | 289 ++++ ops/ci/runtime/rust-cannon.sh | 140 ++ ops/ci/runtime/rust-compiler-baseline.py | 41 + ops/ci/runtime/rust-dependencies.py | 43 + ops/ci/runtime/rust-e2e-gate.py | 97 ++ ops/ci/runtime/rust-e2e-release-report.py | 149 ++ ops/ci/runtime/rust-e2e-release.sh | 50 + ops/ci/runtime/rust-e2e-timings.json | 125 ++ ops/ci/runtime/rust-e2e.py | 342 +++++ ops/ci/runtime/rust-e2e.sh | 85 ++ ops/ci/runtime/rust-target-cache.py | 289 ++++ ops/ci/runtime/rust-workspace-report.py | 548 ++++++++ ops/ci/runtime/rust-workspace.sh | 231 ++++ ops/ci/runtime/rwx-contracts-build.py | 93 ++ ops/ci/runtime/rwx-contracts-build.sh | 20 + ops/ci/runtime/rwx-contracts-prepare.sh | 64 + ops/ci/runtime/rwx-materialize-linker.py | 106 ++ ops/ci/runtime/rwx-metadata.sh | 80 ++ ops/ci/runtime/rwx-prepare.sh | 34 + ops/ci/runtime/rwx-rust-prepare.sh | 40 + ops/ci/runtime/rwx-source-archive.sh | 17 + ops/ci/runtime/shellcheck-orb-3.2.0.bash | 72 + ops/ci/runtime/shellcheck-orb-LICENSE | 21 + ops/ci/runtime/sp1-guest-native-build.py | 109 ++ ops/ci/runtime/sp1-guest-toolchain.sh | 68 + ops/ci/runtime/sp1-guest.py | 476 +++++++ ops/ci/runtime/static-checks.py | 228 ++++ ops/ci/runtime/workflow-helpers.sh | 74 + ops/ci/tests/ci_test_fixtures.py | 37 + ops/ci/tests/fixtures/routing/circleci.txt | 1 + ops/ci/tests/fixtures/routing/contracts.txt | 1 + .../fixtures/routing/docs-and-unknown.txt | 2 + ops/ci/tests/fixtures/routing/docs-only.txt | 2 + ops/ci/tests/fixtures/routing/empty.txt | 0 ops/ci/tests/fixtures/routing/rust.txt | 1 + ops/ci/tests/fixtures/routing/rwx.txt | 1 + ops/ci/tests/fixtures/routing/shared-ci.txt | 1 + ops/ci/tests/test-decision-tree.sh | 405 ++++++ ops/ci/tests/test_acceptance_manifest.py | 89 ++ ops/ci/tests/test_acceptance_report.py | 52 + ops/ci/tests/test_acceptance_runner.py | 142 ++ ops/ci/tests/test_cannon_go.py | 190 +++ ops/ci/tests/test_ci_layout.py | 59 + ops/ci/tests/test_ci_report.py | 114 ++ ops/ci/tests/test_ci_source.py | 30 + ops/ci/tests/test_contract_coverage.py | 284 ++++ ops/ci/tests/test_contract_l2_fork.py | 200 +++ ops/ci/tests/test_contract_suites.py | 290 ++++ ops/ci/tests/test_contract_upgrades.py | 340 +++++ ops/ci/tests/test_contracts_shadow.py | 405 ++++++ ops/ci/tests/test_go_artifacts.py | 149 ++ ops/ci/tests/test_go_compiled_tests.py | 311 +++++ ops/ci/tests/test_go_dependencies.py | 83 ++ ops/ci/tests/test_go_native_isolation.py | 70 + ops/ci/tests/test_go_package_shards.py | 206 +++ ops/ci/tests/test_go_report.py | 63 + ops/ci/tests/test_go_reuse_and_splits.py | 181 +++ ops/ci/tests/test_go_rpc_preflight.py | 56 + ops/ci/tests/test_go_suite.py | 61 + ops/ci/tests/test_kontrol_build.py | 231 ++++ ops/ci/tests/test_l2_rpc_proxy.py | 137 ++ ops/ci/tests/test_main_checks.py | 252 ++++ ops/ci/tests/test_nut_prefork.py | 236 ++++ ops/ci/tests/test_nut_provenance.py | 274 ++++ ops/ci/tests/test_op_reth_shadow.py | 306 +++++ ops/ci/tests/test_pr_checks.py | 139 ++ ops/ci/tests/test_pr_gate.py | 372 +++++ ops/ci/tests/test_rust_cannon.py | 349 +++++ ops/ci/tests/test_rust_compiler_baseline.py | 47 + ops/ci/tests/test_rust_dependencies.py | 37 + ops/ci/tests/test_rust_e2e.py | 223 +++ ops/ci/tests/test_rust_e2e_gate.py | 119 ++ ops/ci/tests/test_rust_e2e_release.py | 177 +++ ops/ci/tests/test_rust_target_cache.py | 454 +++++++ ops/ci/tests/test_rust_workspace.py | 864 ++++++++++++ ops/ci/tests/test_rwx_local_packages.py | 170 +++ ops/ci/tests/test_rwx_materialize_linker.py | 124 ++ ops/ci/tests/test_rwx_metadata.py | 181 +++ ops/ci/tests/test_sp1_guest.py | 297 ++++ ops/ci/tests/test_static_checks.py | 138 ++ 288 files changed, 44633 insertions(+) create mode 100644 .rwx/acceptance.yml create mode 100644 .rwx/cannon-go.yml create mode 100644 .rwx/contract-coverage.yml create mode 100644 .rwx/contract-l2-fork.yml create mode 100644 .rwx/contract-upgrades.yml create mode 100644 .rwx/contracts.yml create mode 100644 .rwx/flaky-report.yml create mode 100644 .rwx/go-rollup.yml create mode 100644 .rwx/go-tests.yml create mode 100644 .rwx/kontrol-build.yml create mode 100644 .rwx/nut-prefork.yml create mode 100644 .rwx/nut-provenance.yml create mode 100644 .rwx/op-reth.yml create mode 100644 .rwx/packages/acceptance-compile.yml create mode 100644 .rwx/packages/acceptance-verdict.yml create mode 100644 .rwx/packages/contract-coverage-compile.yml create mode 100644 .rwx/packages/contract-coverage-verdict.yml create mode 100644 .rwx/packages/contract-upgrades-compile.yml create mode 100644 .rwx/packages/contract-upgrades-verdict.yml create mode 100644 .rwx/packages/contracts-compile.yml create mode 100644 .rwx/packages/contracts-verdict.yml create mode 100644 .rwx/packages/go-contracts.yml create mode 100644 .rwx/packages/go-go.yml create mode 100644 .rwx/packages/go-kona.yml create mode 100644 .rwx/packages/go-modules.yml create mode 100644 .rwx/packages/go-op-reth.yml create mode 100644 .rwx/packages/go-prestate.yml create mode 100644 .rwx/packages/go-sp1-executor.yml create mode 100644 .rwx/packages/go-test-compile.yml create mode 100644 .rwx/packages/go-test-verdict.yml create mode 100644 .rwx/packages/kontrol-contracts.yml create mode 100644 .rwx/packages/nut-tools.yml create mode 100644 .rwx/packages/rust-e2e-contracts.yml create mode 100644 .rwx/packages/rust-e2e-release.yml create mode 100644 .rwx/packages/toolchain-common.yml create mode 100644 .rwx/packages/toolchain-foundry.yml create mode 100644 .rwx/packages/toolchain-go.yml create mode 100644 .rwx/packages/toolchain-rust.yml create mode 100644 .rwx/pilot.yml create mode 100644 .rwx/pr-checks.yml create mode 100644 .rwx/pr-gates.yml create mode 100644 .rwx/rust-e2e.yml create mode 100644 .rwx/rust.yml create mode 100644 .rwx/selector-upload.yml create mode 100644 .rwx/sp1-guest.yml create mode 100644 ops/ci/migration/circle-alignment.py create mode 100644 ops/ci/migration/circle-gates.json create mode 100644 ops/ci/migration/compare-cannon-go.py create mode 100644 ops/ci/migration/compare-ci.py create mode 100644 ops/ci/migration/compare-contract-artifacts.py create mode 100644 ops/ci/migration/compare-contract-coverage.py create mode 100644 ops/ci/migration/compare-contract-l2-fork.py create mode 100644 ops/ci/migration/compare-contract-suites.py create mode 100644 ops/ci/migration/compare-contract-upgrades.py create mode 100644 ops/ci/migration/compare-flaky-report.py create mode 100644 ops/ci/migration/compare-kontrol-build.py create mode 100644 ops/ci/migration/compare-main-checks.py create mode 100644 ops/ci/migration/compare-nut-prefork.py create mode 100644 ops/ci/migration/compare-nut-provenance.py create mode 100644 ops/ci/migration/compare-pr-checks.py create mode 100644 ops/ci/migration/compare-pr-gates.py create mode 100644 ops/ci/migration/compare-rust-cannon.py create mode 100644 ops/ci/migration/compare-rust-e2e.py create mode 100644 ops/ci/migration/compare-rust-extra.py create mode 100644 ops/ci/migration/compare-selector-upload.py create mode 100644 ops/ci/migration/compare-sp1-guest.py create mode 100644 ops/ci/migration/compare-static-checks.py create mode 100644 ops/ci/migration/flaky-report.py create mode 100644 ops/ci/migration/l2-chains-sync-check.py create mode 100644 ops/ci/migration/report-evidence.py create mode 100644 ops/ci/migration/selector-registry.py create mode 100644 ops/ci/migration/selector-upload.py create mode 100644 ops/ci/migration/tests/fixtures/ci-comparison/circleci-contract-cases.json create mode 100644 ops/ci/migration/tests/fixtures/ci-comparison/circleci-foundry-skips.json create mode 100644 ops/ci/migration/tests/fixtures/ci-comparison/circleci-go-cases.json create mode 100644 ops/ci/migration/tests/fixtures/ci-comparison/rwx-foundry-skips.xml create mode 100644 ops/ci/migration/tests/fixtures/flaky-report/provenance.json create mode 100644 ops/ci/migration/tests/fixtures/flaky-report/public-insights.json create mode 100644 ops/ci/migration/tests/fixtures/selector-upload/abi-oracle/foundry-config.json create mode 100644 ops/ci/migration/tests/fixtures/selector-upload/abi-oracle/original.log create mode 100644 ops/ci/migration/tests/fixtures/selector-upload/abi-oracle/project/cache/solidity-files-cache.json create mode 100644 ops/ci/migration/tests/fixtures/selector-upload/abi-oracle/project/foundry.toml create mode 100644 ops/ci/migration/tests/fixtures/selector-upload/abi-oracle/project/out/Fixture.sol/Empty.json create mode 100644 ops/ci/migration/tests/fixtures/selector-upload/abi-oracle/project/out/Fixture.sol/Fixture.json create mode 100644 ops/ci/migration/tests/fixtures/selector-upload/abi-oracle/project/out/build-info/28a4e5f671f97142.json create mode 100644 ops/ci/migration/tests/fixtures/selector-upload/abi-oracle/project/src/Fixture.sol create mode 100644 ops/ci/migration/tests/fixtures/selector-upload/live-import/denied-write/http-0-request.json create mode 100644 ops/ci/migration/tests/fixtures/selector-upload/live-import/denied-write/http-0-response.json create mode 100644 ops/ci/migration/tests/fixtures/selector-upload/live-import/denied-write/http-0.json create mode 100644 ops/ci/migration/tests/fixtures/selector-upload/live-import/denied-write/stderr.log create mode 100644 ops/ci/migration/tests/fixtures/selector-upload/live-import/denied-write/stdout.log create mode 100644 ops/ci/migration/tests/fixtures/selector-upload/live-import/duplicate-upload/http-0-request.json create mode 100644 ops/ci/migration/tests/fixtures/selector-upload/live-import/duplicate-upload/http-0-response.json create mode 100644 ops/ci/migration/tests/fixtures/selector-upload/live-import/duplicate-upload/http-0.json create mode 100644 ops/ci/migration/tests/fixtures/selector-upload/live-import/duplicate-upload/stderr.log create mode 100644 ops/ci/migration/tests/fixtures/selector-upload/live-import/duplicate-upload/stdout.log create mode 100644 ops/ci/migration/tests/fixtures/selector-upload/live-import/first-upload/http-0-request.json create mode 100644 ops/ci/migration/tests/fixtures/selector-upload/live-import/first-upload/http-0-response.json create mode 100644 ops/ci/migration/tests/fixtures/selector-upload/live-import/first-upload/http-0.json create mode 100644 ops/ci/migration/tests/fixtures/selector-upload/live-import/first-upload/stderr.log create mode 100644 ops/ci/migration/tests/fixtures/selector-upload/live-import/first-upload/stdout.log create mode 100644 ops/ci/migration/tests/fixtures/selector-upload/live-import/fixture.json create mode 100644 ops/ci/migration/tests/fixtures/selector-upload/multi-profile-oracle/foundry-config.json create mode 100644 ops/ci/migration/tests/fixtures/selector-upload/multi-profile-oracle/original.log create mode 100644 ops/ci/migration/tests/fixtures/selector-upload/multi-profile-oracle/project/cache/solidity-files-cache.json create mode 100644 ops/ci/migration/tests/fixtures/selector-upload/multi-profile-oracle/project/foundry.toml create mode 100644 ops/ci/migration/tests/fixtures/selector-upload/multi-profile-oracle/project/out/AUnrestricted.sol/AUnrestricted.json create mode 100644 ops/ci/migration/tests/fixtures/selector-upload/multi-profile-oracle/project/out/Shared.sol/Shared.dispute.json create mode 100644 ops/ci/migration/tests/fixtures/selector-upload/multi-profile-oracle/project/out/Shared.sol/Shared.json create mode 100644 ops/ci/migration/tests/fixtures/selector-upload/multi-profile-oracle/project/out/ZRestricted.sol/ZRestricted.json create mode 100644 ops/ci/migration/tests/fixtures/selector-upload/multi-profile-oracle/project/out/build-info/bbc87524da30141a.json create mode 100644 ops/ci/migration/tests/fixtures/selector-upload/multi-profile-oracle/project/out/build-info/df3a523b2f827bc0.json create mode 100644 ops/ci/migration/tests/fixtures/selector-upload/multi-profile-oracle/project/src/AUnrestricted.sol create mode 100644 ops/ci/migration/tests/fixtures/selector-upload/multi-profile-oracle/project/src/Shared.sol create mode 100644 ops/ci/migration/tests/fixtures/selector-upload/multi-profile-oracle/project/src/ZRestricted.sol create mode 100644 ops/ci/migration/tests/fixtures/selector-upload/provenance.json create mode 100644 ops/ci/migration/tests/fixtures/selector-upload/provider-isolation/circleci/execution.json create mode 100644 ops/ci/migration/tests/fixtures/selector-upload/provider-isolation/circleci/isolation.json create mode 100644 ops/ci/migration/tests/fixtures/selector-upload/provider-isolation/circleci/provenance.json create mode 100644 ops/ci/migration/tests/fixtures/selector-upload/provider-isolation/circleci/stderr.log create mode 100644 ops/ci/migration/tests/fixtures/selector-upload/provider-isolation/circleci/stdout.log create mode 100644 ops/ci/migration/tests/fixtures/selector-upload/provider-isolation/rwx/execution.json create mode 100644 ops/ci/migration/tests/fixtures/selector-upload/provider-isolation/rwx/isolation.json create mode 100644 ops/ci/migration/tests/fixtures/selector-upload/provider-isolation/rwx/provenance.json create mode 100644 ops/ci/migration/tests/fixtures/selector-upload/provider-isolation/rwx/stderr.log create mode 100644 ops/ci/migration/tests/fixtures/selector-upload/provider-isolation/rwx/stdout.log create mode 100755 ops/ci/migration/tests/test-circle-adapter.sh create mode 100644 ops/ci/migration/tests/test_check_changed.py create mode 100644 ops/ci/migration/tests/test_circle_alignment.py create mode 100644 ops/ci/migration/tests/test_compare_cannon_go.py create mode 100644 ops/ci/migration/tests/test_compare_ci.py create mode 100644 ops/ci/migration/tests/test_compare_contract_artifacts.py create mode 100644 ops/ci/migration/tests/test_compare_contract_coverage.py create mode 100644 ops/ci/migration/tests/test_compare_contract_l2_fork.py create mode 100644 ops/ci/migration/tests/test_compare_contract_suites.py create mode 100644 ops/ci/migration/tests/test_compare_contract_upgrades.py create mode 100644 ops/ci/migration/tests/test_compare_flaky_report.py create mode 100644 ops/ci/migration/tests/test_compare_main_checks.py create mode 100644 ops/ci/migration/tests/test_compare_pr_checks.py create mode 100644 ops/ci/migration/tests/test_compare_rust_cannon.py create mode 100644 ops/ci/migration/tests/test_compare_rust_e2e.py create mode 100644 ops/ci/migration/tests/test_compare_rust_extra.py create mode 100644 ops/ci/migration/tests/test_compare_selector_upload.py create mode 100644 ops/ci/migration/tests/test_compare_static_checks.py create mode 100644 ops/ci/migration/tests/test_flaky_report.py create mode 100644 ops/ci/migration/tests/test_migration_cannon_go.py create mode 100644 ops/ci/migration/tests/test_migration_contract_coverage.py create mode 100644 ops/ci/migration/tests/test_migration_contract_suites.py create mode 100644 ops/ci/migration/tests/test_migration_imports.py create mode 100644 ops/ci/migration/tests/test_migration_kontrol_build.py create mode 100644 ops/ci/migration/tests/test_migration_main_checks.py create mode 100644 ops/ci/migration/tests/test_migration_nut_prefork.py create mode 100644 ops/ci/migration/tests/test_migration_nut_provenance.py create mode 100644 ops/ci/migration/tests/test_migration_rust_workspace.py create mode 100644 ops/ci/migration/tests/test_migration_sp1_guest.py create mode 100644 ops/ci/migration/tests/test_migration_static_checks.py create mode 100644 ops/ci/migration/tests/test_pr_gate_parity.py create mode 100644 ops/ci/migration/tests/test_report_evidence.py create mode 100644 ops/ci/migration/tests/test_selector_upload.py create mode 100644 ops/ci/runtime/acceptance-manifest.py create mode 100644 ops/ci/runtime/acceptance-report.py create mode 100755 ops/ci/runtime/acceptance-tests.sh create mode 100755 ops/ci/runtime/apt-install.sh create mode 100755 ops/ci/runtime/cannon-go.py create mode 100644 ops/ci/runtime/cannon-witness.json create mode 100644 ops/ci/runtime/ci-report.py create mode 100644 ops/ci/runtime/ci-source.py create mode 100644 ops/ci/runtime/ci-test-results.py create mode 100755 ops/ci/runtime/collect-params.sh create mode 100755 ops/ci/runtime/compute-workflow-conditions.sh create mode 100644 ops/ci/runtime/contract-coverage.py create mode 100644 ops/ci/runtime/contract-l2-fork.py create mode 100644 ops/ci/runtime/contract-suites.py create mode 100644 ops/ci/runtime/contract-upgrades.py create mode 100644 ops/ci/runtime/contracts-test-env.sh create mode 100644 ops/ci/runtime/contracts-test-report.py create mode 100644 ops/ci/runtime/contracts-tests.sh create mode 100644 ops/ci/runtime/git-submodule-report.py create mode 100755 ops/ci/runtime/go-artifacts.py create mode 100644 ops/ci/runtime/go-compiled-tests.py create mode 100755 ops/ci/runtime/go-dependencies.sh create mode 100644 ops/ci/runtime/go-dependency-source.py create mode 100755 ops/ci/runtime/go-full-tests.sh create mode 100644 ops/ci/runtime/go-package-shards.py create mode 100644 ops/ci/runtime/go-report.py create mode 100644 ops/ci/runtime/go-rollup-tests.sh create mode 100644 ops/ci/runtime/go-rollup-timings.json create mode 100644 ops/ci/runtime/go-rpc-preflight.py create mode 100644 ops/ci/runtime/go-suite.py create mode 100644 ops/ci/runtime/go-test-names.go create mode 100644 ops/ci/runtime/go-tests-timings.json create mode 100644 ops/ci/runtime/kontrol-build.py create mode 100644 ops/ci/runtime/kontrol-contracts.py create mode 100644 ops/ci/runtime/kontrol-image.json create mode 100644 ops/ci/runtime/kontrol-image.py create mode 100644 ops/ci/runtime/l2-rpc-proxy.py create mode 100644 ops/ci/runtime/main-checks.py create mode 100644 ops/ci/runtime/nut-prefork-test.sh create mode 100644 ops/ci/runtime/nut-prefork.py create mode 100644 ops/ci/runtime/nut-provenance.py create mode 100644 ops/ci/runtime/nut-tools.sh create mode 100644 ops/ci/runtime/op-reth-report.py create mode 100644 ops/ci/runtime/op-reth-shadow.sh create mode 100644 ops/ci/runtime/pilot-l2-fork-block.txt create mode 100644 ops/ci/runtime/pr-checks.py create mode 100644 ops/ci/runtime/pr-gate.py create mode 100644 ops/ci/runtime/pr-gates.json create mode 100644 ops/ci/runtime/routing.yml create mode 100644 ops/ci/runtime/rust-cannon-report.py create mode 100644 ops/ci/runtime/rust-cannon.sh create mode 100644 ops/ci/runtime/rust-compiler-baseline.py create mode 100644 ops/ci/runtime/rust-dependencies.py create mode 100644 ops/ci/runtime/rust-e2e-gate.py create mode 100644 ops/ci/runtime/rust-e2e-release-report.py create mode 100644 ops/ci/runtime/rust-e2e-release.sh create mode 100644 ops/ci/runtime/rust-e2e-timings.json create mode 100644 ops/ci/runtime/rust-e2e.py create mode 100644 ops/ci/runtime/rust-e2e.sh create mode 100755 ops/ci/runtime/rust-target-cache.py create mode 100644 ops/ci/runtime/rust-workspace-report.py create mode 100644 ops/ci/runtime/rust-workspace.sh create mode 100644 ops/ci/runtime/rwx-contracts-build.py create mode 100644 ops/ci/runtime/rwx-contracts-build.sh create mode 100644 ops/ci/runtime/rwx-contracts-prepare.sh create mode 100644 ops/ci/runtime/rwx-materialize-linker.py create mode 100755 ops/ci/runtime/rwx-metadata.sh create mode 100755 ops/ci/runtime/rwx-prepare.sh create mode 100644 ops/ci/runtime/rwx-rust-prepare.sh create mode 100644 ops/ci/runtime/rwx-source-archive.sh create mode 100644 ops/ci/runtime/shellcheck-orb-3.2.0.bash create mode 100644 ops/ci/runtime/shellcheck-orb-LICENSE create mode 100644 ops/ci/runtime/sp1-guest-native-build.py create mode 100644 ops/ci/runtime/sp1-guest-toolchain.sh create mode 100644 ops/ci/runtime/sp1-guest.py create mode 100644 ops/ci/runtime/static-checks.py create mode 100755 ops/ci/runtime/workflow-helpers.sh create mode 100644 ops/ci/tests/ci_test_fixtures.py create mode 100644 ops/ci/tests/fixtures/routing/circleci.txt create mode 100644 ops/ci/tests/fixtures/routing/contracts.txt create mode 100644 ops/ci/tests/fixtures/routing/docs-and-unknown.txt create mode 100644 ops/ci/tests/fixtures/routing/docs-only.txt create mode 100644 ops/ci/tests/fixtures/routing/empty.txt create mode 100644 ops/ci/tests/fixtures/routing/rust.txt create mode 100644 ops/ci/tests/fixtures/routing/rwx.txt create mode 100644 ops/ci/tests/fixtures/routing/shared-ci.txt create mode 100755 ops/ci/tests/test-decision-tree.sh create mode 100644 ops/ci/tests/test_acceptance_manifest.py create mode 100644 ops/ci/tests/test_acceptance_report.py create mode 100644 ops/ci/tests/test_acceptance_runner.py create mode 100644 ops/ci/tests/test_cannon_go.py create mode 100644 ops/ci/tests/test_ci_layout.py create mode 100644 ops/ci/tests/test_ci_report.py create mode 100644 ops/ci/tests/test_ci_source.py create mode 100644 ops/ci/tests/test_contract_coverage.py create mode 100644 ops/ci/tests/test_contract_l2_fork.py create mode 100644 ops/ci/tests/test_contract_suites.py create mode 100644 ops/ci/tests/test_contract_upgrades.py create mode 100644 ops/ci/tests/test_contracts_shadow.py create mode 100644 ops/ci/tests/test_go_artifacts.py create mode 100644 ops/ci/tests/test_go_compiled_tests.py create mode 100644 ops/ci/tests/test_go_dependencies.py create mode 100644 ops/ci/tests/test_go_native_isolation.py create mode 100644 ops/ci/tests/test_go_package_shards.py create mode 100644 ops/ci/tests/test_go_report.py create mode 100644 ops/ci/tests/test_go_reuse_and_splits.py create mode 100644 ops/ci/tests/test_go_rpc_preflight.py create mode 100644 ops/ci/tests/test_go_suite.py create mode 100644 ops/ci/tests/test_kontrol_build.py create mode 100644 ops/ci/tests/test_l2_rpc_proxy.py create mode 100644 ops/ci/tests/test_main_checks.py create mode 100644 ops/ci/tests/test_nut_prefork.py create mode 100644 ops/ci/tests/test_nut_provenance.py create mode 100644 ops/ci/tests/test_op_reth_shadow.py create mode 100644 ops/ci/tests/test_pr_checks.py create mode 100644 ops/ci/tests/test_pr_gate.py create mode 100644 ops/ci/tests/test_rust_cannon.py create mode 100644 ops/ci/tests/test_rust_compiler_baseline.py create mode 100644 ops/ci/tests/test_rust_dependencies.py create mode 100644 ops/ci/tests/test_rust_e2e.py create mode 100644 ops/ci/tests/test_rust_e2e_gate.py create mode 100644 ops/ci/tests/test_rust_e2e_release.py create mode 100644 ops/ci/tests/test_rust_target_cache.py create mode 100644 ops/ci/tests/test_rust_workspace.py create mode 100644 ops/ci/tests/test_rwx_local_packages.py create mode 100644 ops/ci/tests/test_rwx_materialize_linker.py create mode 100644 ops/ci/tests/test_rwx_metadata.py create mode 100644 ops/ci/tests/test_sp1_guest.py create mode 100644 ops/ci/tests/test_static_checks.py 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-coverage.yml b/.rwx/contract-coverage.yml new file mode 100644 index 00000000000..6de02337049 --- /dev/null +++ b/.rwx/contract-coverage.yml @@ -0,0 +1,382 @@ +# Complete contract coverage passes; Circle retains its required gates. +on: + cache-rebuild: + if: ${{ event.git.branch == 'develop' }} + target: [compile-main, compile-CUSTOM_GAS_TOKEN, compile-OPTIMISM_PORTAL_INTEROP, compile-ZK_DISPUTE_GAME, compile-BRIDGE_HOOK, compile-BRIDGE_HOOK_ZK_DISPUTE_GAME, compile-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 + # Match Circle checkout depth: absolute artifact paths affect coverage loop hits. + path: project + + - key: bootstrap-inputs + use: code + # Normalize only tool inputs; coverage source stays at Circle's project path. + run: | + mkdir -p ops/ci/runtime + cp project/mise.toml mise.toml + cp project/ops/ci/runtime/apt-install.sh ops/ci/runtime/apt-install.sh + for script in rwx-prepare.sh rwx-contracts-prepare.sh rwx-rust-prepare.sh op-reth-shadow.sh op-reth-report.py rust-target-cache.py; do + cp "project/ops/ci/runtime/$script" "ops/ci/runtime/$script" + done + filter: [project/mise.toml, project/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: project/mise.toml + - key: ci-scripts + path: project/ops/ci/runtime + - key: apt-script + path: project/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: | + cd project + 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: project/.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: | + cd project + python3 ops/ci/runtime/contract-coverage.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: [project/.ci/contract-coverage/preflight] + system: [] + artifacts: + - key: block + path: project/.ci/contract-coverage/preflight/block.json + - key: reports + path: project/.ci/contract-coverage/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: | + cd project + export GOMODCACHE="$PWD/.ci/go-cache/contract-coverage/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-coverage-modules-${{ init.cache-epoch }} + timeout: 30m + runner: + cpus: 2 + memory: 4gb + outputs: + filesystem: + filter: + workspace: [project/.ci/go-cache/contract-coverage/modules] + system: [] + artifacts: + - key: reports + path: project/.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: | + cd project + RWX_LIVE_CONTRACT_COVERAGE_FIXTURE=1 python3 -m unittest discover -s ops/ci/tests -p 'test_contract_coverage.py' + RWX_LIVE_CONTRACT_COVERAGE_FIXTURE=1 python3 -m unittest discover -s ops/ci/migration/tests -p 'test_migration_contract_coverage.py' + python3 -m unittest discover -s ops/ci/migration/tests -p 'test_compare_contract_coverage.py' + env: + RWX_COVERAGE_FIXTURE_RETAIN_DIR: .ci/coverage-fixture-evidence + cache: false + timeout: 10m + outputs: + filesystem: false + artifacts: + - key: original-failure-fixtures + path: project/.ci/coverage-fixture-evidence + + # Coverage performs its instrumented compilation inside the fresh verdict. + # This producer builds the original source prerequisite and complete signatures. + - key: compile-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-coverage-compile.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + cache-key: contract-coverage-compile-main-${{ init.cache-epoch }} + feature: main + + - key: verdict-main + use: [code, go-tools, contract-tools, go-modules, compile-main, rpc-check] + if: ${{ init.cache-warm != 'true' && tasks.rpc-check.values.ready == 'true' }} + call: ${{ run.dir }}/packages/contract-coverage-verdict.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + compiled: .ci/contract-coverage/main/prepare + archive-preflight: .ci/contract-coverage/preflight + cache-key: contract-coverage-runtime-main-${{ init.cache-epoch }} + feature: main + + - key: compile-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-coverage-compile.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + cache-key: contract-coverage-compile-CUSTOM_GAS_TOKEN-${{ init.cache-epoch }} + feature: CUSTOM_GAS_TOKEN + + - key: verdict-CUSTOM_GAS_TOKEN + use: [code, go-tools, contract-tools, go-modules, compile-CUSTOM_GAS_TOKEN, rpc-check] + if: ${{ init.cache-warm != 'true' && tasks.rpc-check.values.ready == 'true' }} + call: ${{ run.dir }}/packages/contract-coverage-verdict.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + compiled: .ci/contract-coverage/CUSTOM_GAS_TOKEN/prepare + archive-preflight: .ci/contract-coverage/preflight + cache-key: contract-coverage-runtime-CUSTOM_GAS_TOKEN-${{ init.cache-epoch }} + feature: CUSTOM_GAS_TOKEN + + - key: compile-OPTIMISM_PORTAL_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-coverage-compile.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + cache-key: contract-coverage-compile-OPTIMISM_PORTAL_INTEROP-${{ init.cache-epoch }} + feature: OPTIMISM_PORTAL_INTEROP + + - key: verdict-OPTIMISM_PORTAL_INTEROP + use: [code, go-tools, contract-tools, go-modules, compile-OPTIMISM_PORTAL_INTEROP, rpc-check] + if: ${{ init.cache-warm != 'true' && tasks.rpc-check.values.ready == 'true' }} + call: ${{ run.dir }}/packages/contract-coverage-verdict.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + compiled: .ci/contract-coverage/OPTIMISM_PORTAL_INTEROP/prepare + archive-preflight: .ci/contract-coverage/preflight + cache-key: contract-coverage-runtime-OPTIMISM_PORTAL_INTEROP-${{ init.cache-epoch }} + feature: OPTIMISM_PORTAL_INTEROP + + - key: compile-ZK_DISPUTE_GAME + use: [code, go-tools, contract-tools, go-modules] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-contracts == 'true' }} + call: ${{ run.dir }}/packages/contract-coverage-compile.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + cache-key: contract-coverage-compile-ZK_DISPUTE_GAME-${{ init.cache-epoch }} + feature: ZK_DISPUTE_GAME + + - key: compile-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-coverage-compile.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + cache-key: contract-coverage-compile-BRIDGE_HOOK-${{ init.cache-epoch }} + feature: BRIDGE_HOOK + + - key: compile-BRIDGE_HOOK_ZK_DISPUTE_GAME + use: [code, go-tools, contract-tools, go-modules] + if: ${{ init.cache-warm == 'true' || tasks.route.values.run-contracts == 'true' }} + call: ${{ run.dir }}/packages/contract-coverage-compile.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + cache-key: contract-coverage-compile-BRIDGE_HOOK_ZK_DISPUTE_GAME-${{ init.cache-epoch }} + feature: BRIDGE_HOOK,ZK_DISPUTE_GAME + + - key: compile-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-coverage-compile.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + cache-key: contract-coverage-compile-OP_PRIVATE-${{ init.cache-epoch }} + feature: OP_PRIVATE + + - key: verdict-ZK_DISPUTE_GAME + use: [code, go-tools, contract-tools, go-modules, compile-ZK_DISPUTE_GAME, rpc-check] + if: ${{ init.cache-warm != 'true' && tasks.rpc-check.values.ready == 'true' }} + call: ${{ run.dir }}/packages/contract-coverage-verdict.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + compiled: .ci/contract-coverage/ZK_DISPUTE_GAME/prepare + archive-preflight: .ci/contract-coverage/preflight + cache-key: contract-coverage-runtime-ZK_DISPUTE_GAME-${{ init.cache-epoch }} + feature: ZK_DISPUTE_GAME + + - key: verdict-BRIDGE_HOOK + use: [code, go-tools, contract-tools, go-modules, compile-BRIDGE_HOOK, rpc-check] + if: ${{ init.cache-warm != 'true' && tasks.rpc-check.values.ready == 'true' }} + call: ${{ run.dir }}/packages/contract-coverage-verdict.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + compiled: .ci/contract-coverage/BRIDGE_HOOK/prepare + archive-preflight: .ci/contract-coverage/preflight + cache-key: contract-coverage-runtime-BRIDGE_HOOK-${{ init.cache-epoch }} + feature: BRIDGE_HOOK + + - key: verdict-BRIDGE_HOOK_ZK_DISPUTE_GAME + use: [code, go-tools, contract-tools, go-modules, compile-BRIDGE_HOOK_ZK_DISPUTE_GAME, rpc-check] + if: ${{ init.cache-warm != 'true' && tasks.rpc-check.values.ready == 'true' }} + call: ${{ run.dir }}/packages/contract-coverage-verdict.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + compiled: .ci/contract-coverage/BRIDGE_HOOK,ZK_DISPUTE_GAME/prepare + archive-preflight: .ci/contract-coverage/preflight + cache-key: contract-coverage-runtime-BRIDGE_HOOK_ZK_DISPUTE_GAME-${{ init.cache-epoch }} + feature: BRIDGE_HOOK,ZK_DISPUTE_GAME + + - key: verdict-OP_PRIVATE + use: [code, go-tools, contract-tools, go-modules, compile-OP_PRIVATE, rpc-check] + if: ${{ init.cache-warm != 'true' && tasks.rpc-check.values.ready == 'true' }} + call: ${{ run.dir }}/packages/contract-coverage-verdict.yml + with: + commit-sha: ${{ init.commit-sha }} + branch: ${{ init.branch }} + compiled: .ci/contract-coverage/OP_PRIVATE/prepare + archive-preflight: .ci/contract-coverage/preflight + cache-key: contract-coverage-runtime-OP_PRIVATE-${{ init.cache-epoch }} + feature: OP_PRIVATE + + - key: contracts-gate-receipt + use: [code, tools] + after: ${{ (verdict-BRIDGE_HOOK.succeeded || verdict-BRIDGE_HOOK.failed || verdict-BRIDGE_HOOK.skipped) && (verdict-BRIDGE_HOOK_ZK_DISPUTE_GAME.succeeded || verdict-BRIDGE_HOOK_ZK_DISPUTE_GAME.failed || verdict-BRIDGE_HOOK_ZK_DISPUTE_GAME.skipped) && (verdict-CUSTOM_GAS_TOKEN.succeeded || verdict-CUSTOM_GAS_TOKEN.failed || verdict-CUSTOM_GAS_TOKEN.skipped) && (verdict-OPTIMISM_PORTAL_INTEROP.succeeded || verdict-OPTIMISM_PORTAL_INTEROP.failed || verdict-OPTIMISM_PORTAL_INTEROP.skipped) && (verdict-OP_PRIVATE.succeeded || verdict-OP_PRIVATE.failed || verdict-OP_PRIVATE.skipped) && (verdict-ZK_DISPUTE_GAME.succeeded || verdict-ZK_DISPUTE_GAME.failed || verdict-ZK_DISPUTE_GAME.skipped) && (verdict-main.succeeded || verdict-main.failed || verdict-main.skipped) }} + if: ${{ init.cache-warm != 'true' }} + run: | + cd project + python3 ops/ci/runtime/pr-gate.py receipt contracts-coverage + env: + TASK_VERDICT_BRIDGE_HOOK_ZK_DISPUTE_GAME_SUCCEEDED: ${{ tasks.verdict-BRIDGE_HOOK_ZK_DISPUTE_GAME.succeeded }} + TASK_VERDICT_BRIDGE_HOOK_ZK_DISPUTE_GAME_FAILED: ${{ tasks.verdict-BRIDGE_HOOK_ZK_DISPUTE_GAME.failed }} + TASK_VERDICT_BRIDGE_HOOK_ZK_DISPUTE_GAME_SKIPPED: ${{ tasks.verdict-BRIDGE_HOOK_ZK_DISPUTE_GAME.skipped }} + TASK_VERDICT_BRIDGE_HOOK_SUCCEEDED: ${{ tasks.verdict-BRIDGE_HOOK.succeeded }} + TASK_VERDICT_BRIDGE_HOOK_FAILED: ${{ tasks.verdict-BRIDGE_HOOK.failed }} + TASK_VERDICT_BRIDGE_HOOK_SKIPPED: ${{ tasks.verdict-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_CUSTOM_GAS_TOKEN_SUCCEEDED: ${{ tasks.verdict-CUSTOM_GAS_TOKEN.succeeded }} + TASK_VERDICT_CUSTOM_GAS_TOKEN_FAILED: ${{ tasks.verdict-CUSTOM_GAS_TOKEN.failed }} + TASK_VERDICT_CUSTOM_GAS_TOKEN_SKIPPED: ${{ tasks.verdict-CUSTOM_GAS_TOKEN.skipped }} + TASK_VERDICT_OPTIMISM_PORTAL_INTEROP_SUCCEEDED: ${{ tasks.verdict-OPTIMISM_PORTAL_INTEROP.succeeded }} + TASK_VERDICT_OPTIMISM_PORTAL_INTEROP_FAILED: ${{ tasks.verdict-OPTIMISM_PORTAL_INTEROP.failed }} + TASK_VERDICT_OPTIMISM_PORTAL_INTEROP_SKIPPED: ${{ tasks.verdict-OPTIMISM_PORTAL_INTEROP.skipped }} + TASK_VERDICT_OP_PRIVATE_SUCCEEDED: ${{ tasks.verdict-OP_PRIVATE.succeeded }} + TASK_VERDICT_OP_PRIVATE_FAILED: ${{ tasks.verdict-OP_PRIVATE.failed }} + TASK_VERDICT_OP_PRIVATE_SKIPPED: ${{ tasks.verdict-OP_PRIVATE.skipped }} + TASK_VERDICT_ZK_DISPUTE_GAME_SUCCEEDED: ${{ tasks.verdict-ZK_DISPUTE_GAME.succeeded }} + TASK_VERDICT_ZK_DISPUTE_GAME_FAILED: ${{ tasks.verdict-ZK_DISPUTE_GAME.failed }} + TASK_VERDICT_ZK_DISPUTE_GAME_SKIPPED: ${{ tasks.verdict-ZK_DISPUTE_GAME.skipped }} + TASK_VERDICT_MAIN_SUCCEEDED: ${{ tasks.verdict-main.succeeded }} + TASK_VERDICT_MAIN_FAILED: ${{ tasks.verdict-main.failed }} + TASK_VERDICT_MAIN_SKIPPED: ${{ tasks.verdict-main.skipped }} + cache: false + timeout: 10m + outputs: + filesystem: false + artifacts: + - key: receipt + path: project/.ci/pr-gates/groups/contracts-coverage 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..13f3eb06e2d --- /dev/null +++ b/.rwx/contract-upgrades.yml @@ -0,0 +1,435 @@ +# 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-OPTIMISM_PORTAL_INTEROP, compile-feature-ZK_DISPUTE_GAME, compile-chain-op, compile-chain-ink, compile-chain-unichain, compile-feature-BRIDGE_HOOK, compile-feature-BRIDGE_HOOK_ZK_DISPUTE_GAME, 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-OPTIMISM_PORTAL_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-OPTIMISM_PORTAL_INTEROP-${{ init.cache-epoch }} + variant: feature-OPTIMISM_PORTAL_INTEROP + + - key: verdict-feature-OPTIMISM_PORTAL_INTEROP + use: [code, go-tools, contract-tools, go-modules, compile-feature-OPTIMISM_PORTAL_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-OPTIMISM_PORTAL_INTEROP/prepare + pinned-block: .ci/contract-upgrades/preflight/block.json + cache-key: contract-upgrades-rpc-feature-OPTIMISM_PORTAL_INTEROP-${{ init.cache-epoch }} + variant: feature-OPTIMISM_PORTAL_INTEROP + + - key: compile-feature-ZK_DISPUTE_GAME + 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-ZK_DISPUTE_GAME-${{ init.cache-epoch }} + variant: feature-ZK_DISPUTE_GAME + + - 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-BRIDGE_HOOK_ZK_DISPUTE_GAME + 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_ZK_DISPUTE_GAME-${{ init.cache-epoch }} + variant: feature-BRIDGE_HOOK,ZK_DISPUTE_GAME + + - 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-ZK_DISPUTE_GAME + use: [code, go-tools, contract-tools, go-modules, compile-feature-ZK_DISPUTE_GAME, 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-ZK_DISPUTE_GAME/prepare + pinned-block: .ci/contract-upgrades/preflight/block.json + cache-key: contract-upgrades-rpc-feature-ZK_DISPUTE_GAME-${{ init.cache-epoch }} + variant: feature-ZK_DISPUTE_GAME + + - 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-BRIDGE_HOOK_ZK_DISPUTE_GAME + use: [code, go-tools, contract-tools, go-modules, compile-feature-BRIDGE_HOOK_ZK_DISPUTE_GAME, 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,ZK_DISPUTE_GAME/prepare + pinned-block: .ci/contract-upgrades/preflight/block.json + cache-key: contract-upgrades-rpc-feature-BRIDGE_HOOK_ZK_DISPUTE_GAME-${{ init.cache-epoch }} + variant: feature-BRIDGE_HOOK,ZK_DISPUTE_GAME + + - 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-BRIDGE_HOOK_ZK_DISPUTE_GAME.succeeded || verdict-feature-BRIDGE_HOOK_ZK_DISPUTE_GAME.failed || verdict-feature-BRIDGE_HOOK_ZK_DISPUTE_GAME.skipped) && (verdict-feature-CUSTOM_GAS_TOKEN.succeeded || verdict-feature-CUSTOM_GAS_TOKEN.failed || verdict-feature-CUSTOM_GAS_TOKEN.skipped) && (verdict-feature-OPTIMISM_PORTAL_INTEROP.succeeded || verdict-feature-OPTIMISM_PORTAL_INTEROP.failed || verdict-feature-OPTIMISM_PORTAL_INTEROP.skipped) && (verdict-feature-OP_PRIVATE.succeeded || verdict-feature-OP_PRIVATE.failed || verdict-feature-OP_PRIVATE.skipped) && (verdict-feature-ZK_DISPUTE_GAME.succeeded || verdict-feature-ZK_DISPUTE_GAME.failed || verdict-feature-ZK_DISPUTE_GAME.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_ZK_DISPUTE_GAME_SUCCEEDED: ${{ tasks.verdict-feature-BRIDGE_HOOK_ZK_DISPUTE_GAME.succeeded }} + TASK_VERDICT_FEATURE_BRIDGE_HOOK_ZK_DISPUTE_GAME_FAILED: ${{ tasks.verdict-feature-BRIDGE_HOOK_ZK_DISPUTE_GAME.failed }} + TASK_VERDICT_FEATURE_BRIDGE_HOOK_ZK_DISPUTE_GAME_SKIPPED: ${{ tasks.verdict-feature-BRIDGE_HOOK_ZK_DISPUTE_GAME.skipped }} + 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_OPTIMISM_PORTAL_INTEROP_SUCCEEDED: ${{ tasks.verdict-feature-OPTIMISM_PORTAL_INTEROP.succeeded }} + TASK_VERDICT_FEATURE_OPTIMISM_PORTAL_INTEROP_FAILED: ${{ tasks.verdict-feature-OPTIMISM_PORTAL_INTEROP.failed }} + TASK_VERDICT_FEATURE_OPTIMISM_PORTAL_INTEROP_SKIPPED: ${{ tasks.verdict-feature-OPTIMISM_PORTAL_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_ZK_DISPUTE_GAME_SUCCEEDED: ${{ tasks.verdict-feature-ZK_DISPUTE_GAME.succeeded }} + TASK_VERDICT_FEATURE_ZK_DISPUTE_GAME_FAILED: ${{ tasks.verdict-feature-ZK_DISPUTE_GAME.failed }} + TASK_VERDICT_FEATURE_ZK_DISPUTE_GAME_SKIPPED: ${{ tasks.verdict-feature-ZK_DISPUTE_GAME.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..ff93983321c --- /dev/null +++ b/.rwx/contracts.yml @@ -0,0 +1,586 @@ +# 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-OPTIMISM_PORTAL_INTEROP, compile-standard-ZK_DISPUTE_GAME, compile-modified-main, compile-modified-CUSTOM_GAS_TOKEN, compile-modified-OPTIMISM_PORTAL_INTEROP, compile-modified-ZK_DISPUTE_GAME, compile-standard-BRIDGE_HOOK, compile-standard-BRIDGE_HOOK_ZK_DISPUTE_GAME, compile-standard-OP_PRIVATE, compile-modified-BRIDGE_HOOK, compile-modified-BRIDGE_HOOK_ZK_DISPUTE_GAME, 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-OPTIMISM_PORTAL_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-OPTIMISM_PORTAL_INTEROP-${{ init.cache-epoch }} + suite: standard + feature: OPTIMISM_PORTAL_INTEROP + + - key: verdict-standard-OPTIMISM_PORTAL_INTEROP + use: [source, go-tools, contract-tools, go-modules, compile-standard-OPTIMISM_PORTAL_INTEROP] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-contracts == 'true' && tasks.compile-standard-OPTIMISM_PORTAL_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-OPTIMISM_PORTAL_INTEROP/prepare + cache-key: contract-suites-runtime-standard-OPTIMISM_PORTAL_INTEROP-${{ init.cache-epoch }} + suite: standard + feature: OPTIMISM_PORTAL_INTEROP + + - key: compile-standard-ZK_DISPUTE_GAME + 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-ZK_DISPUTE_GAME-${{ init.cache-epoch }} + suite: standard + feature: ZK_DISPUTE_GAME + + - 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-BRIDGE_HOOK_ZK_DISPUTE_GAME + 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_ZK_DISPUTE_GAME-${{ init.cache-epoch }} + suite: standard + feature: BRIDGE_HOOK,ZK_DISPUTE_GAME + + - 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-ZK_DISPUTE_GAME + use: [source, go-tools, contract-tools, go-modules, compile-standard-ZK_DISPUTE_GAME] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-contracts == 'true' && tasks.compile-standard-ZK_DISPUTE_GAME.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-ZK_DISPUTE_GAME/prepare + cache-key: contract-suites-runtime-standard-ZK_DISPUTE_GAME-${{ init.cache-epoch }} + suite: standard + feature: ZK_DISPUTE_GAME + + - 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-BRIDGE_HOOK_ZK_DISPUTE_GAME + use: [source, go-tools, contract-tools, go-modules, compile-standard-BRIDGE_HOOK_ZK_DISPUTE_GAME] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-contracts == 'true' && tasks.compile-standard-BRIDGE_HOOK_ZK_DISPUTE_GAME.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,ZK_DISPUTE_GAME/prepare + cache-key: contract-suites-runtime-standard-BRIDGE_HOOK_ZK_DISPUTE_GAME-${{ init.cache-epoch }} + suite: standard + feature: BRIDGE_HOOK,ZK_DISPUTE_GAME + + - 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-OPTIMISM_PORTAL_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-OPTIMISM_PORTAL_INTEROP-${{ init.cache-epoch }} + target-sha: ${{ tasks.modified-baseline.values.target-sha }} + suite: modified + feature: OPTIMISM_PORTAL_INTEROP + + - key: verdict-modified-OPTIMISM_PORTAL_INTEROP + use: [modified-baseline, go-tools, contract-tools, go-modules, compile-modified-OPTIMISM_PORTAL_INTEROP] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-contracts == 'true' && tasks.compile-modified-OPTIMISM_PORTAL_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-OPTIMISM_PORTAL_INTEROP/prepare + cache-key: contract-suites-runtime-modified-OPTIMISM_PORTAL_INTEROP-${{ init.cache-epoch }} + target-sha: ${{ tasks.modified-baseline.values.target-sha }} + suite: modified + feature: OPTIMISM_PORTAL_INTEROP + + - key: compile-modified-ZK_DISPUTE_GAME + 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-ZK_DISPUTE_GAME-${{ init.cache-epoch }} + target-sha: ${{ tasks.modified-baseline.values.target-sha }} + suite: modified + feature: ZK_DISPUTE_GAME + + - 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-BRIDGE_HOOK_ZK_DISPUTE_GAME + 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_ZK_DISPUTE_GAME-${{ init.cache-epoch }} + target-sha: ${{ tasks.modified-baseline.values.target-sha }} + suite: modified + feature: BRIDGE_HOOK,ZK_DISPUTE_GAME + + - 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-ZK_DISPUTE_GAME + use: [modified-baseline, go-tools, contract-tools, go-modules, compile-modified-ZK_DISPUTE_GAME] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-contracts == 'true' && tasks.compile-modified-ZK_DISPUTE_GAME.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-ZK_DISPUTE_GAME/prepare + cache-key: contract-suites-runtime-modified-ZK_DISPUTE_GAME-${{ init.cache-epoch }} + target-sha: ${{ tasks.modified-baseline.values.target-sha }} + suite: modified + feature: ZK_DISPUTE_GAME + + - 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-BRIDGE_HOOK_ZK_DISPUTE_GAME + use: [modified-baseline, go-tools, contract-tools, go-modules, compile-modified-BRIDGE_HOOK_ZK_DISPUTE_GAME] + if: ${{ init.cache-warm != 'true' && tasks.route.values.run-contracts == 'true' && tasks.compile-modified-BRIDGE_HOOK_ZK_DISPUTE_GAME.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,ZK_DISPUTE_GAME/prepare + cache-key: contract-suites-runtime-modified-BRIDGE_HOOK_ZK_DISPUTE_GAME-${{ init.cache-epoch }} + target-sha: ${{ tasks.modified-baseline.values.target-sha }} + suite: modified + feature: BRIDGE_HOOK,ZK_DISPUTE_GAME + + - 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-BRIDGE_HOOK_ZK_DISPUTE_GAME.succeeded || verdict-modified-BRIDGE_HOOK_ZK_DISPUTE_GAME.failed || verdict-modified-BRIDGE_HOOK_ZK_DISPUTE_GAME.skipped) && (verdict-modified-CUSTOM_GAS_TOKEN.succeeded || verdict-modified-CUSTOM_GAS_TOKEN.failed || verdict-modified-CUSTOM_GAS_TOKEN.skipped) && (verdict-modified-OPTIMISM_PORTAL_INTEROP.succeeded || verdict-modified-OPTIMISM_PORTAL_INTEROP.failed || verdict-modified-OPTIMISM_PORTAL_INTEROP.skipped) && (verdict-modified-OP_PRIVATE.succeeded || verdict-modified-OP_PRIVATE.failed || verdict-modified-OP_PRIVATE.skipped) && (verdict-modified-ZK_DISPUTE_GAME.succeeded || verdict-modified-ZK_DISPUTE_GAME.failed || verdict-modified-ZK_DISPUTE_GAME.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-BRIDGE_HOOK_ZK_DISPUTE_GAME.succeeded || verdict-standard-BRIDGE_HOOK_ZK_DISPUTE_GAME.failed || verdict-standard-BRIDGE_HOOK_ZK_DISPUTE_GAME.skipped) && (verdict-standard-CUSTOM_GAS_TOKEN.succeeded || verdict-standard-CUSTOM_GAS_TOKEN.failed || verdict-standard-CUSTOM_GAS_TOKEN.skipped) && (verdict-standard-OPTIMISM_PORTAL_INTEROP.succeeded || verdict-standard-OPTIMISM_PORTAL_INTEROP.failed || verdict-standard-OPTIMISM_PORTAL_INTEROP.skipped) && (verdict-standard-OP_PRIVATE.succeeded || verdict-standard-OP_PRIVATE.failed || verdict-standard-OP_PRIVATE.skipped) && (verdict-standard-ZK_DISPUTE_GAME.succeeded || verdict-standard-ZK_DISPUTE_GAME.failed || verdict-standard-ZK_DISPUTE_GAME.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_ZK_DISPUTE_GAME_SUCCEEDED: ${{ tasks.verdict-standard-BRIDGE_HOOK_ZK_DISPUTE_GAME.succeeded }} + TASK_VERDICT_STANDARD_BRIDGE_HOOK_ZK_DISPUTE_GAME_FAILED: ${{ tasks.verdict-standard-BRIDGE_HOOK_ZK_DISPUTE_GAME.failed }} + TASK_VERDICT_STANDARD_BRIDGE_HOOK_ZK_DISPUTE_GAME_SKIPPED: ${{ tasks.verdict-standard-BRIDGE_HOOK_ZK_DISPUTE_GAME.skipped }} + 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_ZK_DISPUTE_GAME_SUCCEEDED: ${{ tasks.verdict-modified-BRIDGE_HOOK_ZK_DISPUTE_GAME.succeeded }} + TASK_VERDICT_MODIFIED_BRIDGE_HOOK_ZK_DISPUTE_GAME_FAILED: ${{ tasks.verdict-modified-BRIDGE_HOOK_ZK_DISPUTE_GAME.failed }} + TASK_VERDICT_MODIFIED_BRIDGE_HOOK_ZK_DISPUTE_GAME_SKIPPED: ${{ tasks.verdict-modified-BRIDGE_HOOK_ZK_DISPUTE_GAME.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_OPTIMISM_PORTAL_INTEROP_SUCCEEDED: ${{ tasks.verdict-modified-OPTIMISM_PORTAL_INTEROP.succeeded }} + TASK_VERDICT_MODIFIED_OPTIMISM_PORTAL_INTEROP_FAILED: ${{ tasks.verdict-modified-OPTIMISM_PORTAL_INTEROP.failed }} + TASK_VERDICT_MODIFIED_OPTIMISM_PORTAL_INTEROP_SKIPPED: ${{ tasks.verdict-modified-OPTIMISM_PORTAL_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_ZK_DISPUTE_GAME_SUCCEEDED: ${{ tasks.verdict-modified-ZK_DISPUTE_GAME.succeeded }} + TASK_VERDICT_MODIFIED_ZK_DISPUTE_GAME_FAILED: ${{ tasks.verdict-modified-ZK_DISPUTE_GAME.failed }} + TASK_VERDICT_MODIFIED_ZK_DISPUTE_GAME_SKIPPED: ${{ tasks.verdict-modified-ZK_DISPUTE_GAME.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_OPTIMISM_PORTAL_INTEROP_SUCCEEDED: ${{ tasks.verdict-standard-OPTIMISM_PORTAL_INTEROP.succeeded }} + TASK_VERDICT_STANDARD_OPTIMISM_PORTAL_INTEROP_FAILED: ${{ tasks.verdict-standard-OPTIMISM_PORTAL_INTEROP.failed }} + TASK_VERDICT_STANDARD_OPTIMISM_PORTAL_INTEROP_SKIPPED: ${{ tasks.verdict-standard-OPTIMISM_PORTAL_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_ZK_DISPUTE_GAME_SUCCEEDED: ${{ tasks.verdict-standard-ZK_DISPUTE_GAME.succeeded }} + TASK_VERDICT_STANDARD_ZK_DISPUTE_GAME_FAILED: ${{ tasks.verdict-standard-ZK_DISPUTE_GAME.failed }} + TASK_VERDICT_STANDARD_ZK_DISPUTE_GAME_SKIPPED: ${{ tasks.verdict-standard-ZK_DISPUTE_GAME.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-coverage-compile.yml b/.rwx/packages/contract-coverage-compile.yml new file mode 100644 index 00000000000..74cc7836e15 --- /dev/null +++ b/.rwx/packages/contract-coverage-compile.yml @@ -0,0 +1,37 @@ +package: + parameters: + commit-sha: + required: true + branch: + required: true + cache-key: + required: true + feature: + required: true +tasks: + - key: build + use: package.use + run: | + cd project + export GOMODCACHE="$PWD/.ci/go-cache/contract-coverage/modules" + export GOCACHE="$PWD/.ci/go-cache/contract-coverage/build" + python3 ops/ci/runtime/contract-coverage.py prepare --feature "$CI_CONTRACT_FEATURE" + env: + CI_COMMIT_SHA: ${{ params.commit-sha }} + CI_BRANCH: ${{ params.branch }} + CI_CONTRACT_PROVIDER: rwx + CI_CONTRACT_COVERAGE_REPLAY: 'true' + CI_CONTRACT_FEATURE: ${{ params.feature }} + tool-cache: ${{ params.cache-key }} + timeout: 60m + runner: + cpus: 16 + memory: 64gb + outputs: + filesystem: + filter: + workspace: [project/packages/contracts-bedrock/forge-artifacts, project/packages/contracts-bedrock/cache/solidity-files-cache.json, project/packages/contracts-bedrock/artifacts/build-info, project/packages/contracts-bedrock/scripts/go-ffi/go-ffi, project/.ci/go-cache/contract-coverage/build, 'project/.ci/contract-coverage'] + system: [] + artifacts: + - key: compiled + path: project/.ci/contract-coverage/${{ params.feature }}/prepare diff --git a/.rwx/packages/contract-coverage-verdict.yml b/.rwx/packages/contract-coverage-verdict.yml new file mode 100644 index 00000000000..3e3d878fd6f --- /dev/null +++ b/.rwx/packages/contract-coverage-verdict.yml @@ -0,0 +1,62 @@ +package: + parameters: + commit-sha: + required: true + branch: + required: true + compiled: + required: true + archive-preflight: + required: true + cache-key: + required: true + feature: + required: true +tasks: + - key: run + use: package.use + run: | + cd project + export GOMODCACHE="$PWD/.ci/go-cache/contract-coverage/modules" + export GOCACHE="$PWD/.ci/go-cache/contract-coverage/runtime" + git submodule sync --recursive + git -c protocol.file.allow=never submodule update --init --recursive --jobs 8 + python3 ops/ci/runtime/contract-coverage.py run --feature "$CI_CONTRACT_FEATURE" \ + --prepared "$COMPILED" --block "$ARCHIVE_PREFLIGHT/block.json" + env: + CI_COMMIT_SHA: ${{ params.commit-sha }} + CI_BRANCH: ${{ params.branch }} + CI_CONTRACT_PROVIDER: rwx + CI_CONTRACT_COVERAGE_REPLAY: 'true' + COMPILED: ${{ params.compiled }} + ARCHIVE_PREFLIGHT: ${{ params.archive-preflight }} + OP_CI_MAINNET_L1_ARCHIVE_RPC_URL: ${{ vaults.optimism-go-tests-rpc-shadow.secrets.OP_CI_MAINNET_L1_ARCHIVE_RPC_URL }} + CI_CONTRACT_FEATURE: ${{ params.feature }} + # cache:false also disables tool-cache reads. Bind each verdict attempt + # while preserving the normal protected, read-only fork-state baseline. + RWX_RUN_ID: + cache-key: included + RWX_TASK_ATTEMPT_NUMBER: + cache-key: included + tool-cache: ${{ params.cache-key }} + timeout: 120m + runner: + cpus: 16 + memory: 64gb + outputs: + filesystem: + filter: + workspace: [project/.ci/go-cache/contract-coverage/runtime] + system: [~/.foundry/cache/rpc] + test-results: + - path: project/.ci/contract-coverage/${{ params.feature }}/run/ordinary/derived.junit.xml + options: + language: Solidity + framework: Foundry + - path: project/.ci/contract-coverage/${{ params.feature }}/run/upgrade/derived.junit.xml + options: + language: Solidity + framework: Foundry + artifacts: + - key: reports + path: project/.ci/contract-coverage/${{ params.feature }}/run 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..a08b09e6daf --- /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@0.9.0 shfmt + PATH="$(mise bin-paths | paste -sd: -):$PATH" + export PATH + mise install pipx:semgrep@1.178.0 + mise exec shellcheck@0.9.0 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..e72a4427a69 --- /dev/null +++ b/.rwx/pr-gates.yml @@ -0,0 +1,605 @@ +# 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-coverage-shadow + tasks: native-contract-coverage + - 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-coverage + call: ${{ run.dir }}/contract-coverage.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-coverage.succeeded || native-contract-coverage.failed || native-contract-coverage.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-coverage.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_COVERAGE_REPORT: ${{ tasks.native-contract-coverage.tasks.contracts-gate-receipt.artifacts.receipt }} + GROUP_CONTRACTS_COVERAGE_SUCCEEDED: ${{ tasks.native-contract-coverage.tasks.contracts-gate-receipt.succeeded }} + GROUP_CONTRACTS_COVERAGE_FAILED: ${{ tasks.native-contract-coverage.tasks.contracts-gate-receipt.failed }} + GROUP_CONTRACTS_COVERAGE_SKIPPED: ${{ tasks.native-contract-coverage.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-coverage.succeeded || native-contract-coverage.failed || native-contract-coverage.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-coverage.tasks.contracts-gate-receipt.failed || tasks.native-contract-coverage.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_COVERAGE_SUCCEEDED: ${{ tasks.native-contract-coverage.tasks.contracts-gate-receipt.succeeded }} + GROUP_CONTRACTS_COVERAGE_FAILED: ${{ tasks.native-contract-coverage.tasks.contracts-gate-receipt.failed }} + GROUP_CONTRACTS_COVERAGE_SKIPPED: ${{ tasks.native-contract-coverage.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/ops/ci/migration/circle-alignment.py b/ops/ci/migration/circle-alignment.py new file mode 100644 index 00000000000..1b95dbc87e4 --- /dev/null +++ b/ops/ci/migration/circle-alignment.py @@ -0,0 +1,29 @@ +#!/usr/bin/env python3 +"""Check the current Circle gate prerequisites against permanent native policy.""" +import argparse +import importlib.util +from pathlib import Path + +_SPEC = importlib.util.spec_from_file_location('report_evidence', Path(__file__).with_name('report-evidence.py')) +E=importlib.util.module_from_spec(_SPEC);_SPEC.loader.exec_module(E) +G=E.helper('pr-gate') +MAPPING=Path(__file__).with_name('circle-gates.json') + + +def configuration(gate=None): + manifest,selections=G.configuration(gate) + mapping=G.read(MAPPING) + if mapping['version']!=1 or mapping['repository']!=manifest['repository'] or set(mapping['gates'])!=set(manifest['gates']): + raise ValueError('Wrong Circle gate mapping') + for name,selected in selections.items(): + row=mapping['gates'][name] + jobs=G.yaml(row['circle_config'])['workflows'][row['workflow']]['jobs'] + matches=[job[name] for job in jobs if isinstance(job,dict) and name in job] + if len(matches)!=1 or matches[0].get('always-succeed',False) or matches[0]['requires']!=[{n:'terminal'} for n in selected['requires']]: + raise ValueError('Missing, duplicate, renamed or changed Circle gate dependency') + return manifest,selections + + +if __name__=='__main__': + parser=argparse.ArgumentParser(description=__doc__);parser.add_argument('--gate');args=parser.parse_args() + configuration(args.gate) diff --git a/ops/ci/migration/circle-gates.json b/ops/ci/migration/circle-gates.json new file mode 100644 index 00000000000..90b7e788e51 --- /dev/null +++ b/ops/ci/migration/circle-gates.json @@ -0,0 +1,18 @@ +{ + "version": 1, + "repository": "ethereum-optimism/optimism", + "gates": { + "required-rust-ci": { + "circle_config": ".circleci/continue/rust-ci.yml", + "workflow": "rust-ci" + }, + "ci-gate": { + "circle_config": ".circleci/continue/main.yml", + "workflow": "main" + }, + "required-contracts-ci": { + "circle_config": ".circleci/continue/main.yml", + "workflow": "contracts-feature-tests" + } + } +} diff --git a/ops/ci/migration/compare-cannon-go.py b/ops/ci/migration/compare-cannon-go.py new file mode 100644 index 00000000000..69dc3bb436d --- /dev/null +++ b/ops/ci/migration/compare-cannon-go.py @@ -0,0 +1,151 @@ +#!/usr/bin/env python3 +"""Compare complete original Cannon Go reports on an identical source revision.""" +import argparse +import importlib.util +import json +from pathlib import Path +_SPEC_E = importlib.util.spec_from_file_location('report_evidence', Path(__file__).with_name('report-evidence.py')) +E = importlib.util.module_from_spec(_SPEC_E); _SPEC_E.loader.exec_module(E) +import re +import sys +import tempfile + +SPEC = importlib.util.spec_from_file_location('cannon_go', Path(__file__).resolve().parents[1] / 'runtime' / 'cannon-go.py') +G = importlib.util.module_from_spec(SPEC); SPEC.loader.exec_module(G) +EMPTY = __import__('hashlib').sha256(b'').hexdigest() +REQUIRED = {'settings.json', 'selection.json', 'coverage.json', 'cpus.json', 'cpus.log', 'cpus.stage.json', 'packages.json', 'packages.log', + 'packages.stage.json', 'lint.log', 'lint.stage.json', 'list.json', 'list.log', + 'list.stage.json', 'tests.log', 'tests.stage.json', 'original.json', 'junit.xml', + 'native.json', 'native.metadata.json', 'inputs-after.json'} + + +def originals(directory, provider): + final = G.read(directory / 'final.json'); hashes = final.get('original_sha256', {}) + if final.get('exit_code') != 0 or final.get('report_errors') != [] or not REQUIRED <= hashes.keys(): + raise ValueError('Failed or incomplete original Cannon report') + empty = [] + if 'final.json' in hashes: raise ValueError('Self-sealed original report manifest') + E.verify_files(directory, hashes, required=REQUIRED, + missing_empty=empty if provider == 'circleci' else None, label=None) + actual = {str(p.relative_to(directory)) for p in directory.rglob('*') if p.is_file() and p.name != 'final.json'} + if actual != hashes.keys(): raise ValueError('Unexpected unsealed Cannon report input') + return hashes, empty + + +normalize = E.normalize + + +def verdict(directory, provider, sha): + hashes, empty = originals(directory, provider); settings = G.read(directory / 'settings.json') + if (settings['suite'] != 'cannon-go' or settings['source_sha'] != sha or settings['provider'] != provider + or not settings['branch'] or not settings['input_sha256']): + raise ValueError('Wrong Cannon source, provider, branch or workload') + effective = settings['settings'] + if effective != G.settings(provider, effective['skip_slow_tests'], True, effective['parallel']): + raise ValueError('Cannon benchmark must execute freshly with original settings') + cpus = G.read(directory / 'cpus.json') + if type(cpus) is not int or cpus != effective['parallel']: + raise ValueError('Cannon concurrency differs from original nproc discovery') + if settings['environment']['SKIP_SLOW_TESTS'] != str(effective['skip_slow_tests']).lower(): + raise ValueError('Cannon slow-test environment differs from recorded setting') + if settings['go_environment']['GOFLAGS']: + raise ValueError('Unaccounted Cannon Go flags override original selection') + if provider == 'rwx' and (not settings['rwx_run_id'] or str(settings['rwx_task_attempt']) != '1'): + raise ValueError('Missing native Cannon run identity or unexpected task retry') + root = Path(settings['workspace_root']); selection = G.read(directory / 'selection.json') + packages = G.packages((directory / 'packages.json').read_text(), root, directory / 'source') + for row in packages: + for name, digest in row['files'].items(): + if settings['input_sha256'].get(name) != digest: + raise ValueError('Cannon package source differs from tracked revision inputs') + tests = G.listing(directory / 'list.json', packages) + if selection != {'packages': packages, 'initial_tests': tests, + 'authority': 'go list ./... and go test -list ' + G.LIST_PATTERN}: + raise ValueError('Cannon selection differs from complete original discovery') + expected = {'cpus': ['nproc'], 'lint': ['just', 'lint'], 'packages': ['go', 'list', '-e', '-json', './...'], + 'list': ['go', 'test', '-json', *G.go_flags(effective, list_tests=True)]} + # Reconstruct commands using the bound original absolute workspace and + # report path. Collection directories can differ from execution directories. + report = root / '.ci/cannon-go/run' + expected['tests'] = [str(root / 'ops/scripts/gotestsum-split.sh'), '--format=testname', + '--junitfile=' + str(report / 'junit.xml'), '--jsonfile=' + str(report / 'original.json'), + '--', *G.go_flags(effective)] + stages = {} + for name, argv in expected.items(): + row = G.read(directory / (name + '.stage.json')) + if row['exit_code'] != 0 or row['argv'] != argv or row['cwd'] != str(root / 'cannon') or row.get('stdin') != 'devnull': + raise ValueError('Failed or changed original Cannon stage: ' + name) + if row['log_sha256'] != hashes[name + '.log']: raise ValueError('Cannon stage log seal differs') + stages[name] = normalize({k: row[k] for k in ('argv', 'cwd', 'exit_code')}, str(root)) + coverage = G.observed(directory, packages, tests) + if coverage != G.read(directory / 'coverage.json') or coverage['package_failures'] or coverage['outcomes'].get('fail'): + raise ValueError('Incomplete or unsuccessful original Cannon coverage') + if G.read(directory / 'inputs-after.json') != settings['input_sha256']: + raise ValueError('Cannon execution changed original tracked inputs') + with tempfile.TemporaryDirectory() as tmp: + native = Path(tmp) / 'native.json'; G.PROJECT.project(directory / 'original.json', native) + for path in (native, native.with_suffix('.metadata.json')): + if G.S.digest(path) != hashes[path.name]: raise ValueError('Native Cannon report differs from original projection') + dependencies = {} + if provider == 'rwx': + for kind in ('go-modules', 'contracts'): + record = G.read(directory / 'dependencies' / (kind + '.json')) + if (record['kind'] != kind or record['commit_sha'] != sha or record['settings'] != G.ARTIFACTS.SETTINGS[kind] + or record['mise_sha256'] != settings['input_sha256']['mise.toml'] or not record['files'] + or record['tool_versions']['go'] != settings['tool_versions']['go']): + raise ValueError('Stale or mismatched Cannon dependency artifact') + if kind == 'contracts' and record['tool_versions']['forge'] != settings['tool_versions']['forge']: + raise ValueError('Cannon contract producer used a different Forge toolchain') + dependencies[kind] = record + return settings, selection, coverage, stages, dependencies, hashes, empty + + +def compare(root, sha): + if not re.fullmatch('[0-9a-f]{40}', sha): raise ValueError('Expected full Cannon benchmark SHA') + a = verdict(root / 'circle', 'circleci', sha); b = verdict(root / 'rwx', 'rwx', sha) + settings_a, settings_b = a[0], b[0] + for field in ('source_sha', 'branch', 'input_sha256', 'environment', 'go_environment', 'tool_versions'): + if settings_a[field] != settings_b[field]: raise ValueError('Complete Cannon settings parity differs: ' + field) + # Both providers honor the original nproc rule. Circle exposes the host's + # 32 CPUs inside an 8-vCPU Docker job; RWX exposes the requested 8 CPUs. + # Retain the actual values and argv, and compare every other setting. + if ({k:v for k,v in settings_a['settings'].items() if k != 'parallel'} != + {k:v for k,v in settings_b['settings'].items() if k != 'parallel'}): + raise ValueError('Complete Cannon effective workload settings differ') + def commands(value): + return {k: {**v, 'argv': ['-parallel=' if re.fullmatch(r'-parallel=\d+', arg) else arg + for arg in v['argv']]} for k,v in value.items()} + if a[1] != b[1] or commands(a[3]) != commands(b[3]): raise ValueError('Complete Cannon discovery or invocation parity differs') + differences = [] + if settings_a['settings']['parallel'] != settings_b['settings']['parallel']: + differences.append({'setting': 'parallel', 'rule': 'nproc', + 'circle': settings_a['settings']['parallel'], 'rwx': settings_b['settings']['parallel'], + 'reason': 'Original CPU discovery differs by execution environment; requested workers remain 8 CPU / 16 GiB'}) + def cases(coverage): + return [{k: c[k] for k in ('suite', 'name', 'outcome', 'skip_reason')} | + {'attempts': [{k: h[k] for k in ('outcome', 'skip_reason')} for h in c['attempts']]} + for c in sorted(coverage['cases'], key=lambda c: (c['suite'], c['name']))] + original_a, original_b = cases(a[2]), cases(b[2]) + if original_a != original_b or a[2]['package_attempts'] != b[2]['package_attempts']: + raise ValueError('Original Cannon outcomes, skips or retry histories differ') + return {'source_sha': sha, 'verified_parity': True, 'packages': len(a[1]['packages']), + 'initial_tests': sum(map(len, a[1]['initial_tests'].values())), 'case_identities': len(original_a), + 'outcomes': a[2]['outcomes'], 'settings': {'circle': settings_a['settings'], 'rwx': settings_b['settings']}, + 'settings_differences': differences, 'tool_versions': settings_a['tool_versions'], + 'selection': a[1], 'cases': original_a, 'package_attempts': a[2]['package_attempts'], 'commands': {'circle': a[3], 'rwx': b[3]}, + 'native_dependencies': b[4], 'per_test_logs': {'circle': a[2]['per_test_logs'], 'rwx': b[2]['per_test_logs']}, + 'original_sha256': {'circle': a[5], 'rwx': b[5]}, 'circle_manifest_declared_empty': a[6], + 'providers': {p: {'workspace_root': x[0]['workspace_root'], 'branch': x[0]['branch'], + 'rwx_run_id': x[0]['rwx_run_id'], 'rwx_task_attempt': x[0]['rwx_task_attempt']} + for p, x in (('circle', a), ('rwx', b))}} + + +if __name__ == '__main__': + parser = argparse.ArgumentParser(description=__doc__); parser.add_argument('root', type=Path) + parser.add_argument('--sha', required=True); parser.add_argument('--output', type=Path, required=True) + args = parser.parse_args() + try: + result = compare(args.root, args.sha); G.S.write(args.output, result) + print(json.dumps({k: result[k] for k in ('source_sha', 'verified_parity', 'packages', 'initial_tests', 'case_identities', 'outcomes')})) + except (OSError, ValueError, KeyError) as error: + print('Cannon parity failed: ' + str(error), file=sys.stderr); sys.exit(1) diff --git a/ops/ci/migration/compare-ci.py b/ops/ci/migration/compare-ci.py new file mode 100644 index 00000000000..6dd7cbd7a69 --- /dev/null +++ b/ops/ci/migration/compare-ci.py @@ -0,0 +1,543 @@ +#!/usr/bin/env python3 +"""Normalize retained CI reports and compare exact, same-revision test evidence. + +No network, credentials or provider SDKs are needed. Collection paths are relative +to their JSON file. This compares reported cases; it does not prove that omitted +tests were discovered or that two providers billed the same amount of work. +""" + +import argparse +from collections import Counter +import importlib.util +import json +from pathlib import Path +import re +import sys +import xml.etree.ElementTree as ET + + +SPEC = importlib.util.spec_from_file_location('test_results', Path(__file__).resolve().parents[1] / 'runtime' / 'ci-test-results.py') +RESULTS_REPORT = importlib.util.module_from_spec(SPEC); SPEC.loader.exec_module(RESULTS_REPORT) +OUTCOMES = RESULTS_REPORT.OUTCOMES +RESULTS = RESULTS_REPORT.RESULTS +go_cases = RESULTS_REPORT.go_cases +in_scope = RESULTS_REPORT.in_scope +json_object = RESULTS_REPORT.json_object +junit_cases = RESULTS_REPORT.junit_cases +make_case = RESULTS_REPORT.make_case +no_duplicate_keys = RESULTS_REPORT.no_duplicate_keys +number = RESULTS_REPORT.number +read_json = RESULTS_REPORT.read_json +required_text = RESULTS_REPORT.required_text +skip_reason = RESULTS_REPORT.skip_reason + +COMPARABLE = ("sha", "routing_context", "branch", "workload", "profile", "features", "test_config", "package_prefix") +MEASUREMENT_DEFAULTS = { + "wall_seconds": None, "setup_seconds": None, "longest_shard_seconds": None, + "summed_task_seconds": None, "cpu_seconds": None, "billed_seconds": None, + "cost": None, "cache": None, "resources": None, +} + + +def terminal_status(value): + if value is None or value in ("running", "pending", "queued", "unknown"): + return None + if value in ("success", "succeeded", "passed"): + return "success" + if value in ("fail", "failure", "failed", "error", "timedout", "timed_out"): + return "fail" + if value in ("canceled", "cancelled", "terminated"): + return "canceled" + raise ValueError(f"unsupported source status {value!r}") + + +def unique_list(values, label, *, allow_empty=False): + if not isinstance(values, list) or (not values and not allow_empty): + raise ValueError(f"{label} must be a nonempty list") + for value in values: + required_text(value, label) + if len(values) != len(set(values)): + raise ValueError(f"{label} contains duplicates") + return sorted(values) + + +def validate_metadata(value): + result = dict(json_object(value, "metadata")) + if result.get("provider") not in ("circleci", "rwx"): + raise ValueError("metadata.provider must be circleci or rwx") + if not isinstance(result.get("sha"), str) or not re.fullmatch(r"[0-9a-f]{40}", result["sha"]): + raise ValueError("metadata.sha must be a full lowercase commit SHA") + for key in ("branch", "workload", "profile"): + required_text(result.get(key), f"metadata.{key}") + context = result.get("routing_context") + if context is not None: + json_object(context, "metadata.routing_context") + required_text(context.get("kind"), "routing_context.kind") + result["routing_context"] = context + # Raw trigger provenance is intentionally separate from comparable routing. + # A native push and a PR webhook can share a verified routing context. We + # never infer that context from a webhook name or rewrite trigger evidence. + trigger = result.get("trigger") + if trigger is not None: + json_object(trigger, "metadata.trigger") + if trigger.get("type") is not None: + required_text(trigger["type"], "metadata.trigger.type") + result["trigger"] = trigger + result["features"] = unique_list(result.get("features"), "metadata.features") + if not json_object(result.get("test_config"), "metadata.test_config"): + raise ValueError("metadata.test_config must describe the effective test settings") + prefix = result.get("package_prefix") + if prefix is not None: + required_text(prefix, "metadata.package_prefix") + result["package_prefix"] = prefix + return result + + +def identity(case): + return case["feature"], case["suite"], case["name"] + + +def circleci_cases(path, source, metadata): + data = read_json(path) + if isinstance(data, dict): + if data.get("sha") is not None and data["sha"] != metadata["sha"]: + raise ValueError("CircleCI case file SHA differs from collection SHA") + if data.get("next_page_token"): + raise ValueError("CircleCI test response is incomplete; collect every page first") + fields = [key for key in ("items", "tests", "cases") if key in data] + if len(fields) != 1: + raise ValueError("CircleCI case JSON must have exactly one items/tests/cases list") + data = data[fields[0]] + if not isinstance(data, list): + raise ValueError("CircleCI cases must be a list") + cases = [] + for row in data: + json_object(row, "CircleCI case") + suite = required_text(row.get("classname"), "CircleCI classname") + if not in_scope(suite, metadata): + continue + outcome = RESULTS.get(row.get("result")) + if outcome is None: + raise ValueError(f"unknown CircleCI case result {row.get('result')!r}") + cases.append(make_case(suite, row.get("name"), outcome, row.get("run_time"), + skip_reason(row.get("message")) if outcome == "skip" else None, source)) + return cases + + +def validate_discovery(value): + if value is None: + return None + result = dict(json_object(value, "discovery")) + keys = [key for key in ("packages", "test_files") if key in result] + if not keys: + raise ValueError("discovery must contain packages or test_files") + for key in keys: + result[key] = unique_list(result[key], f"discovery.{key}") + if result.get("complete") is not None and type(result["complete"]) is not bool: + raise ValueError("discovery.complete must be boolean or null") + if result.get("complete") is True: + required_text(result.get("provenance"), "complete discovery provenance") + partition = result.get('partition', 'package') + if partition not in ('package', 'test'): + raise ValueError('unsupported discovery partition') + if partition == 'test': + tests = unique_list(result.get('tests'), 'discovery.tests') + for identity in tests: + parts = identity.split('::') + if len(parts) != 2 or parts[0] not in result.get('packages', []) or not re.fullmatch(r'Test\w*', parts[1]): + raise ValueError('invalid discovered Go test identity') + result['tests'] = tests + total, groups = result.get('total'), result.get('test_shards') + if type(total) is not int or total < 1 or not isinstance(groups, list) or len(groups) != total: + raise ValueError('test discovery shards do not match total') + assigned = [] + for group in groups: + assigned.extend(unique_list(group, 'test shard', allow_empty=True)) + if sorted(assigned) != tests or len(assigned) != len(set(assigned)): + raise ValueError('test discovery shards must cover every identity exactly once') + if "shards" in result: + total = result.get("total") + if type(total) is not int or total < 1 or not isinstance(result["shards"], list) or len(result["shards"]) != total: + raise ValueError("discovery shards do not match total") + flattened = [] + for shard in result["shards"]: + if not isinstance(shard, list) or any(not isinstance(value, str) for value in shard): + raise ValueError("discovery shard must list package strings") + flattened.extend(shard) + if sorted(flattened) != result.get("packages") or len(flattened) != len(set(flattened)): + raise ValueError("discovery shards must cover every package exactly once") + return result + + +def measurements(value): + result = {**MEASUREMENT_DEFAULTS, **json_object({} if value is None else value, "measurements")} + for key in MEASUREMENT_DEFAULTS: + if key.endswith("_seconds"): + number(result[key], f"measurements.{key}") + # Preserve supplied observations without computing CPU or billed time from + # wall time. Units/source/scope belong beside any externally supplied price. + return result + + +def validate_package_coverage(sources, discovery, cases=None): + go_sources = [source for source in sources if source["role"] == "verdict" and source.get("format") == "go-json"] + observed = [] + for source in go_sources: + packages = source.get("observed_packages") + if not isinstance(packages, list) or any(not isinstance(package, str) for package in packages): + raise ValueError("Go source must retain observed terminal packages") + if len(packages) != len(set(packages)): + raise ValueError("duplicated observed package within a source") + observed.extend(packages) + if discovery and discovery.get('partition') == 'test': + # Test-level sharding deliberately invokes every package on each node. + # Validate exact case ownership instead of weakening package partitions. + if not go_sources or cases is None or any(source.get('format') != 'go-json' + for source in sources if source['role'] == 'verdict'): + raise ValueError('test partition coverage requires original Go events') + for source in go_sources: + if sorted(source['observed_packages']) != discovery['packages']: + raise ValueError('test shard does not retain every selected terminal package') + index = source.get('shard_index') + if type(index) is not int or source.get('shard_total') != discovery['total']: + raise ValueError('test source lacks its declared shard identity') + expected = set(discovery['test_shards'][index]) + actual = {case['suite'] + '::' + case['name'] for case in cases + if case['source_id'] == source['id'] and '/' not in case['name']} + if actual != expected: + raise ValueError('test source verdicts differ from its assigned top-level identities') + if any(case['suite'] + '::' + case['name'].split('/')[0] not in expected + for case in cases if case['source_id'] == source['id']): + raise ValueError('subtest belongs to an unassigned top-level identity') + return + if len(observed) != len(set(observed)): + raise ValueError("duplicated package across Go shard sources") + if go_sources and discovery and discovery.get("complete") is True and "packages" in discovery: + if sorted(observed) != discovery["packages"]: + raise ValueError("observed terminal Go packages do not match complete discovery") + + +def validate_shards(sources, metadata): + shards = set() + for source in sources: + if "shard_index" not in source and "shard_total" not in source: + continue + index, total = source.get("shard_index"), source.get("shard_total") + if type(index) is not int or type(total) is not int or not 0 <= index < total: + raise ValueError("invalid source shard index/total") + if source["role"] != "verdict": + continue + shard = (source["feature"], index, total) + if shard in shards: + raise ValueError("duplicated shard input") + shards.add(shard) + for feature in metadata["features"]: + totals = {total for f, _, total in shards if f == feature} + if len(totals) > 1: + raise ValueError("inconsistent source shard totals") + for total in totals: + if {index for f, index, t in shards if f == feature and t == total} != set(range(total)): + raise ValueError("shard inputs do not cover every declared verdict shard") + + +def validate_cases(cases, metadata, sources): + if not isinstance(cases, list) or not cases: + raise ValueError("no cases in selected workload") + seen, executed = set(), Counter() + source_ids = {source["id"]: source for source in sources if source["role"] == "verdict"} + for case in cases: + json_object(case, "normalized case") + for key in ("feature", "suite", "name", "source_id"): + required_text(case.get(key), f"case.{key}") + key = identity(case) + if key in seen: + raise ValueError(f"duplicate verdict case across sources: {key}") + seen.add(key) + if case["feature"] not in metadata["features"] or case["source_id"] not in source_ids: + raise ValueError("case feature/source is outside collection") + if case["feature"] != source_ids[case["source_id"]]["feature"]: + raise ValueError("case feature does not match its source") + if not in_scope(case["suite"], metadata) or case.get("outcome") not in OUTCOMES: + raise ValueError("case suite/outcome is outside collection") + if source_ids[case["source_id"]].get("status") == "success" and case["outcome"] in ("fail", "error"): + raise ValueError("successful source contains failing case verdicts") + number(case.get("duration_seconds"), "case.duration_seconds") + reason = case.get("skip_reason") + if reason is not None: + required_text(reason, "case.skip_reason") + if case["outcome"] != "skip" and reason is not None: + raise ValueError("only skipped cases can have a skip reason") + history = case.get("attempts") + if history is not None: + if not isinstance(history, list) or not history: + raise ValueError("case attempts must be a nonempty list or null") + for attempt in history: + json_object(attempt, "attempt") + if attempt.get("outcome") not in OUTCOMES: + raise ValueError("invalid attempt outcome") + number(attempt.get("duration_seconds"), "attempt.duration_seconds") + if history[-1].get("outcome") != case["outcome"] or history[-1].get("skip_reason") != reason: + raise ValueError("final attempt does not match case verdict") + if case["outcome"] != "skip": + executed[case["feature"]] += 1 + if any(not executed[feature] for feature in metadata["features"]): + raise ValueError("each declared feature must contain executed cases") + + +def normalize(collection, base_path): + if collection.get("version") != 1 or type(collection["version"]) is not int: + raise ValueError("unsupported collection version") + metadata = validate_metadata(collection.get("metadata")) + raw_sources = collection.get("sources") + if not isinstance(raw_sources, list) or not raw_sources: + raise ValueError("sources must be a nonempty list") + sources, cases, failures = [], [], [] + ids, paths = set(), set() + for raw in raw_sources: + source = dict(json_object(raw, "source")) + for key in ("id", "path", "feature"): + required_text(source.get(key), f"source.{key}") + source.setdefault("role", "verdict") + if source["role"] not in ("verdict", "diagnostic") or source["feature"] not in metadata["features"]: + raise ValueError("unknown source role/feature") + path = (base_path / source["path"]).resolve() + if source["id"] in ids or (path, source["feature"]) in paths: + raise ValueError("duplicate source id or report path for a feature") + ids.add(source["id"]) + paths.add((path, source["feature"])) + if source.get("sha", metadata["sha"]) != metadata["sha"]: + raise ValueError("source SHA differs from collection SHA") + source["revision_bound"] = False + source_status = terminal_status(source.get("status")) + if source.get("metadata_path"): + evidence = read_json(base_path / source["metadata_path"]) + if evidence.get("sha") != metadata["sha"] or evidence.get("branch") != metadata["branch"]: + raise ValueError("source job metadata does not match collection SHA/branch") + source["revision_bound"] = True + evidence_status = terminal_status(evidence.get("status")) + if source_status is not None and source_status != evidence_status: + raise ValueError("source status differs from original job metadata") + source_status = evidence_status + elif source.get("format") == "circleci-tests": + evidence = read_json(path) + if isinstance(evidence, dict) and evidence.get("sha") == metadata["sha"]: + source["revision_bound"] = True + source["status"] = source_status + sources.append(source) + if source["format"] == "circleci-tests": + parsed = circleci_cases(path, source, metadata) + elif source["format"] == "junit": + parsed = junit_cases(path, source, metadata) + elif source["format"] == "go-json": + parsed, package_failures = go_cases(path, source, metadata) + if source["role"] == "verdict": + failures.extend({"source_id": source["id"], "suite": suite} for suite in package_failures) + else: + raise ValueError(f"unknown source format {source['format']!r}") + # Aggregate CircleCI Go shards may contain no cases in the selected + # component. Require explicit shard metadata and valid out-of-scope + # evidence before accepting that empty share; the collection itself + # must still have executed cases for every feature. + if not parsed and source['format'] == 'go-json' and (collection.get('discovery') or {}).get('partition') == 'test': + # Exact identity/package checks below reject missing nonempty shares. + pass + elif not parsed and metadata.get("package_prefix") and "shard_index" in source: + unfiltered = {**metadata, "package_prefix": None} + if source["format"] == "go-json": + outside, _ = go_cases(path, dict(source), unfiltered) + elif source["format"] == "circleci-tests": + outside = circleci_cases(path, source, unfiltered) + else: + outside = junit_cases(path, source, unfiltered) + if not outside: + raise ValueError(f"empty report, including outside selected scope: {source['id']}") + elif not parsed: + raise ValueError(f"source contains no cases in selected scope: {source['id']}") + if source["role"] == "verdict": + if source["status"] == "success" and any(case["outcome"] in ("fail", "error") for case in parsed): + raise ValueError("successful source contains failing case verdicts") + cases.extend(parsed) + validate_shards(sources, metadata) + validate_cases(cases, metadata, sources) + discovery = validate_discovery(collection.get("discovery")) + if discovery and "packages" in discovery: + if any(case["suite"] not in discovery["packages"] for case in cases): + raise ValueError("reported case package is absent from discovery") + validate_package_coverage(sources, discovery, cases) + return {"version": 1, "metadata": metadata, "sources": sources, + "cases": sorted(cases, key=identity), "package_failures": failures, + "discovery": discovery, + "measurements": measurements(collection.get("measurements"))} + + +def validate_normalized(data): + json_object(data, "normalized input") + if data.get("version") != 1 or type(data["version"]) is not int: + raise ValueError("unsupported normalized version") + metadata = validate_metadata(data.get("metadata")) + sources = data.get("sources") + if not isinstance(sources, list) or not sources: + raise ValueError("normalized sources must be a nonempty list") + ids = [] + for source in sources: + json_object(source, "source") + ids.append(required_text(source.get("id"), "source.id")) + if source.get("role") not in ("verdict", "diagnostic"): + raise ValueError("invalid normalized source role") + if source.get("feature") not in metadata["features"]: + raise ValueError("invalid normalized source feature") + if type(source.get("revision_bound")) is not bool: + raise ValueError("normalized source revision_bound must be boolean") + if source.get("status") not in (None, "success", "fail", "canceled"): + raise ValueError("invalid normalized source terminal status") + for history in source.get("package_attempts", []): + required_text(history.get("suite"), "package attempt suite") + outcomes = history.get("outcomes") + if not isinstance(outcomes, list) or not outcomes or any(outcome not in ("pass", "fail", "skip", "build-fail") for outcome in outcomes): + raise ValueError("invalid package attempt history") + if len(ids) != len(set(ids)): + raise ValueError("duplicate normalized sources") + validate_shards(sources, metadata) + validate_cases(data.get("cases"), metadata, sources) + validate_discovery(data.get("discovery")) + validate_package_coverage(sources, data.get("discovery"), data['cases']) + measurements(data.get("measurements")) + if not isinstance(data.get("package_failures"), list): + raise ValueError("normalized package_failures must be a list") + return metadata + + +def case_label(key): + return {"feature": key[0], "suite": key[1], "name": key[2]} + + +def retry_summary(data): + known = [case for case in data["cases"] if case.get("attempts") is not None] + retried = [{**case_label(identity(case)), "attempts": case["attempts"]} for case in known if len(case["attempts"]) > 1] + package_retries = [{"source_id": source["id"], **history} for source in data["sources"] if source["role"] == "verdict" + for history in source.get("package_attempts", []) if len(history["outcomes"]) > 1] + return {"cases_with_attempt_evidence": len(known), "cases_without_attempt_evidence": len(data["cases"]) - len(known), + "observed_retry_attempts": sum(len(case["attempts"]) - 1 for case in known), "retried_cases": retried, + "observed_package_retry_attempts": sum(len(history["outcomes"]) - 1 for history in package_retries), + "retried_packages": package_retries} + + +def compare(baseline, candidate): + left_metadata, right_metadata = validate_normalized(baseline), validate_normalized(candidate) + metadata_differences = [{"field": key, "baseline": left_metadata.get(key), "candidate": right_metadata.get(key)} + for key in COMPARABLE if left_metadata.get(key) != right_metadata.get(key)] + if left_metadata["provider"] == right_metadata["provider"]: + metadata_differences.append({"field": "provider", "baseline": left_metadata["provider"], + "candidate": right_metadata["provider"], "reason": "expected different providers"}) + report = {"version": 1, "status": "incomparable" if metadata_differences else "equivalent", + "baseline": left_metadata, "candidate": right_metadata, "metadata_differences": metadata_differences, + "missing_cases": [], "extra_cases": [], "different_cases": [], "unknown_skip_reasons": [], + "incomplete_evidence": [], + "unhealthy_sources": [], + "retries": {"baseline": retry_summary(baseline), "candidate": retry_summary(candidate)}, + "measurements": {"baseline": measurements(baseline.get("measurements")), + "candidate": measurements(candidate.get("measurements"))}, + "package_failures": {"baseline": baseline["package_failures"], "candidate": candidate["package_failures"]}, + "discovery": {"baseline": baseline.get("discovery"), "candidate": candidate.get("discovery")}, + "limitations": ["Case parity compares retained reports, not unreported discovery or execution.", + "Wall time, summed task time, CPU time and billed time are separate observations; unknown values are null."]} + if metadata_differences: + return report + for side, data in (("baseline", baseline), ("candidate", candidate)): + if data["metadata"].get("routing_context") is None: + report["incomplete_evidence"].append({"side": side, "reason": "verified shared routing context unavailable"}) + discovery = data.get("discovery") + if discovery is None or discovery.get("complete") is not True: + report["incomplete_evidence"].append({"side": side, "reason": "authoritative complete discovery unavailable"}) + for source in data["sources"]: + if source["role"] == "verdict" and not source["revision_bound"]: + report["incomplete_evidence"].append({"side": side, "source_id": source["id"], "reason": "report lacks revision-binding evidence"}) + if source["role"] == "verdict" and source.get("status") is None: + report["incomplete_evidence"].append({"side": side, "source_id": source["id"], "reason": "terminal job/task outcome unavailable"}) + elif source["role"] == "verdict" and source["status"] != "success": + report["unhealthy_sources"].append({"side": side, "source_id": source["id"], "status": source["status"]}) + left, right = {identity(case): case for case in baseline["cases"]}, {identity(case): case for case in candidate["cases"]} + report["missing_cases"] = [case_label(key) for key in sorted(left.keys() - right.keys())] + report["extra_cases"] = [case_label(key) for key in sorted(right.keys() - left.keys())] + for key in sorted(left.keys() & right.keys()): + before, after = left[key], right[key] + if before["outcome"] != after["outcome"] or before["skip_reason"] != after["skip_reason"]: + report["different_cases"].append({**case_label(key), "baseline": {k: before[k] for k in ("outcome", "skip_reason")}, + "candidate": {k: after[k] for k in ("outcome", "skip_reason")}}) + if before["outcome"] == "skip" or after["outcome"] == "skip": + if before["skip_reason"] is None or after["skip_reason"] is None: + report["unknown_skip_reasons"].append(case_label(key)) + report["counts"] = {"baseline": dict(Counter(case["outcome"] for case in left.values())), + "candidate": dict(Counter(case["outcome"] for case in right.values()))} + if any(report[key] for key in ("missing_cases", "extra_cases", "different_cases")): + report["status"] = "different" + elif report["unknown_skip_reasons"] or report["incomplete_evidence"]: + report["status"] = "incomplete" + if baseline["package_failures"] or candidate["package_failures"] or report["unhealthy_sources"]: + report["status"] = "different" + if baseline.get("discovery") is not None and candidate.get("discovery") is not None: + # Compare discovered sets, not provider-specific shard packing. + for field in ("packages", "test_files", "tests"): + if baseline["discovery"].get(field) != candidate["discovery"].get(field): + report.setdefault("discovery_differences", []).append(field) + report["status"] = "different" + return report + + +def markdown(report): + def safe(value): + return str(value).replace("`", "'").replace("\n", " ") + lines = [f"CI comparison: **{report['status']}**", "", + f"Revision: `{safe(report['baseline']['sha'])}`", "", + f"Workload: {safe(report['baseline']['workload'])}; profile: {safe(report['baseline']['profile'])}.", "", + f"Missing cases: {len(report['missing_cases'])}; extra cases: {len(report['extra_cases'])}; " + f"different outcomes/reasons: {len(report['different_cases'])}.", ""] + if report["metadata_differences"]: + lines.append("Incomparable metadata: " + ", ".join(safe(item["field"]) for item in report["metadata_differences"]) + ".") + for name, side in report["retries"].items(): + lines.append(f"{name}: {side['observed_retry_attempts']} observed retry attempts; " + f"{side['cases_without_attempt_evidence']} cases without attempt evidence.") + if report["unknown_skip_reasons"]: + lines.append(f"Skip reasons unavailable for {len(report['unknown_skip_reasons'])} matching cases.") + if report["incomplete_evidence"]: + lines.append(f"Incomplete provenance/discovery evidence: {len(report['incomplete_evidence'])} observations.") + if report["unhealthy_sources"]: + lines.append(f"Failed/canceled verdict sources: {len(report['unhealthy_sources'])}.") + lines.extend(["", "Durations, resources, caches and cost are retained as separate observations in the JSON report.", ""]) + lines.extend(report["limitations"]) + return "\n".join(lines) + "\n" + + +def write_json(path, data): + path.write_text(json.dumps(data, indent=2, sort_keys=True, allow_nan=False) + "\n", encoding="utf-8") + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + commands = parser.add_subparsers(dest="command", required=True) + normalize_parser = commands.add_parser("normalize", help="convert local retained reports") + normalize_parser.add_argument("--input", type=Path, required=True) + normalize_parser.add_argument("--output", type=Path, required=True) + compare_parser = commands.add_parser("compare", help="compare two normalized providers") + compare_parser.add_argument("--baseline", type=Path, required=True) + compare_parser.add_argument("--candidate", type=Path, required=True) + compare_parser.add_argument("--output", type=Path, required=True) + compare_parser.add_argument("--markdown", type=Path) + args = parser.parse_args() + try: + if args.command == "normalize": + write_json(args.output, normalize(read_json(args.input), args.input.resolve().parent)) + return 0 + report = compare(read_json(args.baseline), read_json(args.candidate)) + write_json(args.output, report) + if args.markdown: + args.markdown.write_text(markdown(report), encoding="utf-8") + print(f"CI comparison: {report['status']}") + return 0 if report["status"] == "equivalent" else 2 if report["status"] == "incomparable" else 1 + except (KeyError, TypeError, ValueError, OSError, ET.ParseError) as error: + print(f"CI comparison rejected input: {error}", file=sys.stderr) + return 2 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/ops/ci/migration/compare-contract-artifacts.py b/ops/ci/migration/compare-contract-artifacts.py new file mode 100644 index 00000000000..7a7c5ca0318 --- /dev/null +++ b/ops/ci/migration/compare-contract-artifacts.py @@ -0,0 +1,177 @@ +#!/usr/bin/env python3 +"""Compare every bound contract input while retaining compiler metadata differences.""" +from collections import Counter +from contextlib import contextmanager +import hashlib +import importlib.util +import io +import json +from pathlib import Path +_SPEC_E = importlib.util.spec_from_file_location('report_evidence', Path(__file__).with_name('report-evidence.py')) +E = importlib.util.module_from_spec(_SPEC_E); _SPEC_E.loader.exec_module(E) +import re +import subprocess +import tarfile +import tempfile + +AST_IDS = {'id', 'scope', 'referencedDeclaration', 'functionReturnParameters', 'declaration', 'sourceUnit', + 'linearizedBaseContracts', 'usedErrors', 'usedEvents', 'contractDependencies', 'baseFunctions', + 'assignments', 'overloadedDeclarations'} +SOURCE_LOCATIONS = {'src', 'nativeSrc', 'nameLocation', 'nameLocations', 'memberLocation'} + + +def digest(data): return hashlib.sha256(data).hexdigest() + + +normalize = E.normalize + + +def ast_differences(a, b, counts, key='', exported=False): + """Permit only compiler identifiers, retaining every structural/value check.""" + if a == b: return + if type(a) is not type(b): raise ValueError('Contract AST value type differs') + if isinstance(a, dict): + if a.keys() != b.keys(): raise ValueError('Contract AST fields differ') + for name in a: ast_differences(a[name], b[name], counts, name, exported or name == 'exportedSymbols') + elif isinstance(a, list): + if len(a) != len(b): raise ValueError('Contract AST structure differs') + for x, y in zip(a, b): ast_differences(x, y, counts, key, exported) + elif type(a) is int and (key in AST_IDS or exported) and min(a, b) >= 0: + counts['node_identifiers'] += 1 + elif isinstance(a, str) and key in SOURCE_LOCATIONS: + x, y = (re.fullmatch(r'(-?\d+):(\d+):(-?\d+)', v) for v in (a, b)) + if x is None or y is None or x.groups()[:2] != y.groups()[:2]: + raise ValueError('Contract AST source span differs') + counts['source_identifiers'] += 1 + elif isinstance(a, str) and key == 'typeIdentifier' and re.sub(r'_\$\d+', '_$', a) == re.sub(r'_\$\d+', '_$', b): + counts['type_identifiers'] += 1 + else: raise ValueError('Unresolved contract AST difference at ' + key) + + +def contract(a, b, roots, counts): + if a.keys() != b.keys(): raise ValueError('Contract artifact fields differ') + for key in a: + if a[key] == b[key]: continue + if key in ('metadata', 'rawMetadata'): + x, y = (json.loads(v) if key == 'rawMetadata' else v for v in (a[key], b[key])) + if normalize(x, roots[0]) != normalize(y, roots[1]): raise ValueError('Contract compiler input metadata differs') + counts['workspace_path_metadata'] += 1 + elif key == 'ast': ast_differences(a[key], b[key], counts) + elif key == 'id' and type(a[key]) is int and type(b[key]) is int and min(a[key], b[key]) >= 0: + counts['artifact_source_identifiers'] += 1 + else: raise ValueError('Contract runtime artifact differs at ' + key) + + +def archive(path, metadata): + if digest(path.read_bytes()) != metadata['archive_sha256']: raise ValueError('Contract dependency archive changed') + files = {} + with tarfile.open(path, mode='r|*') as stream: + for member in stream: + name = member.name; relative = Path(name) + if relative.is_absolute() or '..' in relative.parts: raise ValueError('Unsafe contract archive member') + if member.isdir(): continue + if not member.isfile() or name in files: raise ValueError('Invalid or duplicate contract archive member') + data = stream.extractfile(member).read() + if metadata['files'].get(name) != digest(data): raise ValueError('Contract input hash differs from original manifest') + files[name] = data + if files.keys() != metadata['files'].keys(): raise ValueError('Incomplete contract dependency archive') + return files + + +def cache_inputs(value): + """Validate content/configuration while preserving provider timestamps/build IDs.""" + if isinstance(value, dict): + return {k: cache_inputs(v) for k, v in value.items() if k not in ('lastModificationDate', 'build_id', 'builds')} + if isinstance(value, list): return [cache_inputs(v) for v in value] + return value + + +def build_info(files, prefix): + result = [] + for name, data in files.items(): + if name.startswith(prefix): + row = json.loads(data) + if set(row) != {'id', 'source_id_to_path', 'language'}: raise ValueError('Unexpected Foundry build-info schema') + result.append({'language': row['language'], 'source_files': sorted(row['source_id_to_path'].values())}) + return sorted(result, key=lambda r: json.dumps(r, sort_keys=True)) + + +@contextmanager +def embedded_stream(data): + # Python 3.12 has no native zstd tar reader. Stream through the same zstd + # tool used to create the deployer archive, without repeatedly seeking it. + if data.startswith(b'\x28\xb5\x2f\xfd'): + with tempfile.NamedTemporaryFile(suffix='.tzst') as source: + source.write(data); source.flush() + with subprocess.Popen(['zstd', '--decompress', '--stdout', source.name], + stdout=subprocess.PIPE, stderr=subprocess.PIPE) as child: + try: + with tarfile.open(fileobj=child.stdout, mode='r|') as stream: yield stream + child.stdout.read(); child.stderr.read() + if child.wait() != 0: raise ValueError('Corrupt embedded zstd archive') + finally: + if child.poll() is None: child.kill() + else: + with tarfile.open(fileobj=io.BytesIO(data), mode='r|*') as stream: yield stream + + +def embedded(data): + files, links = {}, {} + with embedded_stream(data) as stream: + for member in stream: + name = member.name; relative = Path(name) + if relative.is_absolute() or '..' in relative.parts: raise ValueError('Unsafe embedded contract archive') + if not member.isdir() and (name in files or name in links): raise ValueError('Duplicate embedded contract member') + if member.isfile(): + files[name] = digest(stream.extractfile(member).read()) + elif member.issym() or member.islnk(): + links[name] = member.linkname + elif not member.isdir(): raise ValueError('Unexpected embedded contract member') + return files, links + + +def compare(directories, sha): + metadata = {p: json.loads((d / 'metadata.json').read_text()) for p, d in directories.items()} + for field in ('version', 'kind', 'commit_sha', 'settings', 'mise_sha256', 'tool_versions'): + if metadata['circle'][field] != metadata['rwx'][field]: raise ValueError('Contract producer binding differs at ' + field) + if metadata['circle']['commit_sha'] != sha or metadata['circle']['kind'] != 'contracts-e2e': + raise ValueError('Contract producer source or suite differs') + files = {p: archive(d / 'files.tar.gz', metadata[p]) for p, d in directories.items()} + a, b = files['circle'], files['rwx']; counts = Counter() + prefix = 'packages/contracts-bedrock/'; info_prefix = prefix + 'artifacts/build-info/' + if {n for n in a if not n.startswith(info_prefix)} != {n for n in b if not n.startswith(info_prefix)}: + raise ValueError('Contract input file inventories differ') + if build_info(a, info_prefix) != build_info(b, info_prefix): raise ValueError('Complete compiler source graphs differ') + roots = [] + for rows in (a, b): + artifact = json.loads(rows[next(n for n in rows if n.startswith(prefix + 'forge-artifacts/') and n.endswith('.json') and 'metadata' in json.loads(rows[n]))]) + remapping = next(r for r in artifact['metadata']['settings']['remappings'] if '/packages/contracts-bedrock/lib/lib-keccak/' in r) + roots.append(remapping.split('/packages/contracts-bedrock/', 1)[0]) + contract_files = 0 + embedded_name = 'op-deployer/pkg/deployer/artifacts/forge-artifacts/artifacts.tzst' + for name in sorted(a.keys() & b.keys()): + if name.startswith(info_prefix) or name == embedded_name: continue + if name.startswith(prefix + 'forge-artifacts/') and name.endswith('.json'): + contract(json.loads(a[name]), json.loads(b[name]), roots, counts); contract_files += 1 + elif name == prefix + 'cache/solidity-files-cache.json': + if cache_inputs(json.loads(a[name])) != cache_inputs(json.loads(b[name])): + raise ValueError('Foundry compiler content or configuration cache differs') + elif a[name] != b[name]: raise ValueError('Unresolved contract dependency file differs: ' + name) + ea, eb = (embedded(rows[embedded_name]) for rows in (a, b)); fa, la = ea; fb, lb = eb + if la != lb: raise ValueError('Embedded source links differ') + def source_inputs(rows): return {n: h for n, h in rows.items() if not n.startswith(('forge-artifacts/', 'artifacts/build-info/', 'cache/')) and n != '.gitcommit'} + if source_inputs(fa) != source_inputs(fb): raise ValueError('Complete embedded source files differ') + for rows in (fa, fb): + if '.gitcommit' in rows and rows['.gitcommit'] != digest((sha + '\n').encode()): raise ValueError('Embedded revision metadata differs') + # The native source package carries the exact .gitcommit fallback used when + # deployed from a package without Git. All other source bytes must agree. + for rows, outer in ((fa, a), (fb, b)): + expected = {n.removeprefix(prefix): digest(data) for n, data in outer.items() if n.startswith(prefix)} + if any(rows.get(n) != h for n, h in expected.items()): raise ValueError('Embedded compiler outputs differ from producer outputs') + if {n for n in rows if n.startswith(('forge-artifacts/', 'artifacts/build-info/', 'cache/'))} != expected.keys(): + raise ValueError('Embedded compilation inventory differs from producer outputs') + return {'source_sha': sha, 'verified_runtime_input_parity': True, 'contract_artifacts': contract_files, + 'compiler_source_graphs': len(build_info(a, info_prefix)), 'embedded_source_files': len(source_inputs(fa)), + 'resolved_metadata_differences': dict(counts), 'embedded_revision_fallback': {p: '.gitcommit' in rows for p, rows in [('circle', fa), ('rwx', fb)]}, + 'original_metadata': metadata, 'embedded_original_sha256': {'circle': fa, 'rwx': fb}, + 'archive_bytes_equal': metadata['circle']['archive_sha256'] == metadata['rwx']['archive_sha256']} diff --git a/ops/ci/migration/compare-contract-coverage.py b/ops/ci/migration/compare-contract-coverage.py new file mode 100644 index 00000000000..e9dda9f902a --- /dev/null +++ b/ops/ci/migration/compare-contract-coverage.py @@ -0,0 +1,197 @@ +#!/usr/bin/env python3 +"""Compare every coverage case, LCOV entry and per-test attribution item.""" +import argparse +import hashlib +import importlib.util +import json +from pathlib import Path +_SPEC_E = importlib.util.spec_from_file_location('report_evidence', Path(__file__).with_name('report-evidence.py')) +E = importlib.util.module_from_spec(_SPEC_E); _SPEC_E.loader.exec_module(E) +import re +import xml.etree.ElementTree as ET + +SPEC = importlib.util.spec_from_file_location('coverage', Path(__file__).resolve().parents[1] / 'runtime' / 'contract-coverage.py') +C = importlib.util.module_from_spec(SPEC); SPEC.loader.exec_module(C) +UP, CS = C.UP, C.CS + + +def derived(path, phase, cases): + rows = [] + for suite in ET.parse(path).iter('testsuite'): + children = suite.findall('testcase') + if suite.attrib.get('tests') != str(len(children)) or \ + suite.attrib.get('failures') != str(sum(case.find('failure') is not None for case in children)) or \ + suite.attrib.get('skipped') != str(sum(case.find('skipped') is not None for case in children)): + raise ValueError('Derived coverage JUnit totals differ from original cases') + for case in children: + identity = case.attrib['classname']; name = case.attrib['name'] + if not identity.startswith(phase + ':'): raise ValueError('Derived coverage case lacks its phase identity') + identity = identity.removeprefix(phase + ':') + if suite.attrib['name'] != phase + ':' + identity or case.find('error') is not None: + raise ValueError('Invalid derived coverage JUnit identity') + failure, skipped = case.find('failure'), case.find('skipped') + child = failure if failure is not None else skipped + reason = child.get('message') if child is not None else None + if child is not None and (child.attrib != {'message': reason} or ''.join(child.itertext()) != (reason or '')): + raise ValueError('Derived coverage JUnit reason differs from original text') + rows.append({'class': identity, 'name': name, 'outcome': 'fail' if failure is not None else 'skip' if skipped is not None else 'pass', + 'reason': reason or None}) + if sorted(rows, key=lambda r: (r['class'], r['name'])) != cases: + raise ValueError('Derived coverage JUnit differs from original attribution/log verdicts') + + +def report(directory, feature, sha, provider, empty): + required = C.PREPARED | {'block.json', 'source-after-verdict.json', 'runtime-fixtures.json'} + for phase in C.PHASES: + required |= {phase + '/' + name for name in ('tests.log', 'tests.stderr.log', 'tests.stage.json', 'original.lcov.info', + 'original.attribution.json', 'original-cases.json', 'original-events.json', 'derived.junit.xml', 'lcov-records.json', + 'coverage-source-sha256.json', 'coverage.json')} + if provider == 'rwx': required |= {'preparation-manifest.json', 'preparation-settings.json', 'runtime-config.json', + 'runtime-config.stage.json', 'runtime-files.log', 'runtime-files.stage.json'} + sealed_preflight = (directory / 'archive-preflight/preflight-manifest.json').exists() + if sealed_preflight: required |= {'archive-preflight/block.json', 'archive-preflight/pinned-block.log', + 'archive-preflight/pinned-block.stage.json', 'archive-preflight/preflight-manifest.json'} + else: required |= {'pinned-block.log', 'pinned-block.stage.json'} + try: + hashes = E.originals(directory, required, empty, provider + '/coverage-' + feature) + except OSError as error: + raise ValueError('Missing original contract coverage report file') from error + if {str(p.relative_to(directory)) for p in directory.rglob('*') if p.is_file() and p != directory / 'final.json'} != set(hashes): + raise ValueError('Unsealed or missing complete coverage originals') + settings = json.loads((directory / 'settings.json').read_text()); root = settings['workspace_root'] + seed = '0x' + hashlib.sha256((sha + ':' + feature + ':contract-coverage').encode()).hexdigest() + if (settings['source_sha'], settings['feature'], settings['profile'], settings['source_build_profile'], settings['benchmark_seed'], + settings['authority'], settings['phases'], settings['provider'], settings['rpc_input_name']) != \ + (sha, feature, 'cicoverage', 'default', seed, ['just', 'coverage-lcov-all'], list(C.PHASES), 'circleci' if provider == 'circle' else 'rwx', C.RPC_INPUT): + raise ValueError('Wrong coverage source, occurrence, profile or opt-in replay benchmark seed') + if (settings['ffi_replay_seed'], settings['ffi_replay_policy']) != (seed, 'chacha8-arguments-v1'): + raise ValueError('Coverage FFI replay settings differ from the benchmark input') + if provider == 'rwx' and (not settings['rwx_run_id'] or str(settings['rwx_task_attempt']) != '1'): + raise ValueError('Reused coverage verdict or uninvestigated task retry') + before = settings['input_sha256'] + if not before or json.loads((directory / 'source-after-preparation.json').read_text()) != before: + raise ValueError('Coverage preparation changed source inputs') + files = CS.file_selection((directory / 'files.log').read_text()) + expected = sorted(p.removeprefix('packages/contracts-bedrock/') for p in before + if p.startswith('packages/contracts-bedrock/test/') and p.endswith('.t.sol')) + if files != expected or not files or json.loads((directory / 'file-selection.json').read_text()) != \ + {'files': files, 'partitions': [{'index': 0, 'files': files}]}: + raise ValueError('Incomplete or duplicate coverage file selection/assignment') + outputs = CS.runtime_outputs(files) + if settings.get('runtime_output_paths') != outputs: raise ValueError('Undeclared coverage runtime fixture role') + after = json.loads((directory / 'source-after-verdict.json').read_text()) + changes = {name: {'before': before.get(name), 'after': after.get(name)} for name in sorted(set(before) | set(after)) + if before.get(name) != after.get(name)} + if set(changes) - set(outputs) or changes and json.loads((directory / 'source-changes-verdict.json').read_text()) != changes: + raise ValueError('Unexpected or unbound coverage source mutation') + fixtures = {} + for name in outputs: + for phase, wanted in [('before', before.get(name)), ('after', after.get(name))]: + if not isinstance(wanted, str) or UP.digest(directory / 'tracked-fixtures' / phase / name) != wanted: + raise ValueError('Corrupt original coverage tracked fixture') + fixtures[name] = {'before_sha256': before[name], 'after_sha256': after[name]} + if json.loads((directory / 'runtime-fixtures.json').read_text()) != fixtures: raise ValueError('Coverage runtime fixture hashes differ') + config = json.loads((directory / 'foundry-config.json').read_text()); C.validate_config(config, seed) + build_config = json.loads((directory / 'build-config.json').read_text()) + bindings = json.loads((directory / 'signature-bindings.json').read_text()); compiled = json.loads((directory / 'compiled.json').read_text()) + if 'packages/contracts-bedrock/scripts/go-ffi/go-ffi' not in compiled or not any('/forge-artifacts/' in name for name in compiled): + raise ValueError('Missing complete coverage compiler bindings') + for row in bindings.values(): + if not row['artifacts'] or any(compiled.get(name) != value for name, value in row['artifacts'].items()): + raise ValueError('Coverage compiler signatures differ from bound artifacts') + selection = {phase: UP.selection(json.loads((directory / (phase + '-discovery.json')).read_text()), bindings) for phase in C.PHASES} + if selection != {k: [tuple(r) for r in v] for k, v in json.loads((directory / 'selection.json').read_text()).items()} or \ + any(identity.rsplit(':', 1)[0] not in files for rows in selection.values() for identity, _ in rows): + raise ValueError('Coverage selection differs from complete discovery/compiler signatures') + if json.loads((directory / 'compile-only.json').read_text()) != {'tests': 0, 'selected_cases': {phase: len(rows) for phase, rows in selection.items()}}: + raise ValueError('Coverage producer executed tests or omitted its complete selection') + commands = {'files': CS.FILE_COMMANDS['standard'], 'submodules-sync': ['git', '-C', root, 'submodule', 'sync', '--recursive'], + 'submodules-init': ['git', '-C', root, '-c', 'protocol.file.allow=never', 'submodule', 'update', '--init', '--recursive', '--jobs', '8'], + 'build-config': ['forge', 'config', '--json'], 'go-ffi': ['just', 'build-go-ffi'], 'source-build': ['just', 'build-source'], + 'foundry-config': ['forge', 'config', '--json'], 'coverage-build': ['forge', 'build'], + **{phase + '-discovery': argv for phase, argv in C.DISCOVERY.items()}, + **{phase + '/tests': argv for phase, argv in C.COMMANDS.items()}} + if provider == 'rwx': + if json.loads((directory / 'runtime-config.json').read_text()) != config or CS.file_selection((directory / 'runtime-files.log').read_text()) != files: + raise ValueError('Coverage runtime settings or selection differ from preparation') + preparation = json.loads((directory / 'preparation-manifest.json').read_text()) + if preparation['exit_code'] or preparation['report_errors'] or not C.PREPARED <= set(preparation['original_sha256']): + raise ValueError('Failed or incomplete coverage producer') + for name, value in preparation['original_sha256'].items(): + if UP.digest(directory / ('preparation-settings.json' if name == 'settings.json' else name)) != value: + raise ValueError('Corrupt original coverage producer report') + old = json.loads((directory / 'preparation-settings.json').read_text()) + if any(old[k] != settings[k] for k in set(settings) - {'rwx_run_id', 'rwx_task_attempt'}): + raise ValueError('Coverage producer/runtime settings differ') + commands.update({'runtime-files': CS.FILE_COMMANDS['standard'], 'runtime-config': ['forge', 'config', '--json']}) + commands['archive-preflight/pinned-block' if sealed_preflight else 'pinned-block'] = ['just', 'print-pinned-block-number'] + stages = {str(p.relative_to(directory)).removesuffix('.stage.json') for p in directory.rglob('*.stage.json')} + if stages != set(commands): raise ValueError('Missing original coverage command or unexplained retry') + for name, argv in commands.items(): + row = json.loads((directory / (name + '.stage.json')).read_text()) + if (row['argv'], row['cwd'], row['exit_code']) != (argv, root + '/packages/contracts-bedrock', 0): + raise ValueError('Wrong or failed original coverage command') + if UP.digest(directory / (name + ('.json' if name.endswith(('config', 'discovery')) else '.log'))) != row['stdout_sha256'] or \ + UP.digest(directory / (name + '.stderr.log')) != row['stderr_sha256']: + raise ValueError('Coverage stage output hashes differ from originals') + block = json.loads((directory / 'block.json').read_text()) + if block['source_sha'] != sha or block['chain_id'] != 1 or block['policy'] != 'Just current-day 00:00 UTC' or \ + type(block['number']) is not int or block['number'] < 0 or not re.fullmatch('0x[0-9a-f]{64}', block['hash']): + raise ValueError('Wrong or unbound original coverage archive block') + prefix = directory / 'archive-preflight' if sealed_preflight else directory + if (prefix / 'pinned-block.log').read_text().strip() != str(block['number']): + raise ValueError('Original daily block discovery differs from executed archive block') + if sealed_preflight: + preflight = json.loads((prefix / 'preflight-manifest.json').read_text()) + if preflight['exit_code'] or preflight['report_errors'] or json.loads((prefix / 'block.json').read_text()) != block: + raise ValueError('Failed or mismatched coverage archive preflight') + for name, value in preflight['original_sha256'].items(): + if UP.digest(prefix / name) != value: raise ValueError('Corrupt original coverage preflight') + phases = {} + for phase in C.PHASES: + d = directory / phase; attribution = json.loads((d / 'original.attribution.json').read_text()) + events = C.original_evidence((d / 'tests.log').read_text(), attribution); cases = events['cases'] + if events != json.loads((d / 'original-events.json').read_text()): raise ValueError('Coverage event accounting differs from complete originals') + if cases != json.loads((d / 'original-cases.json').read_text()) or any(r['outcome'] == 'fail' for r in cases): + raise ValueError('Coverage verdicts differ from original reports or contain a failure') + derived(d / 'derived.junit.xml', phase, cases) + coverage = C.accounting(d / 'derived.junit.xml', phase, selection[phase], bindings) + if coverage != json.loads((d / 'coverage.json').read_text()): raise ValueError('Coverage case accounting differs from original reports') + records = C.lcov((d / 'original.lcov.info').read_text(), Path(root) / 'packages/contracts-bedrock') + if records != [{'source': r['source'], 'entries': [tuple(v) for v in r['entries']]} for r in json.loads((d / 'lcov-records.json').read_text())]: + raise ValueError('LCOV entry accounting differs from original file') + sources = json.loads((d / 'coverage-source-sha256.json').read_text()); wanted = {r['source'] for r in records} + wanted.update(C.source_name(item['source'], Path(root) / 'packages/contracts-bedrock') for r in attribution['tests'] for item in r['covered']) + if set(sources) != wanted or any(not re.fullmatch('[0-9a-f]{64}', value) or \ + ('packages/contracts-bedrock/' + name in before and sources[name] != before['packages/contracts-bedrock/' + name]) for name, value in sources.items()): + raise ValueError('Coverage source items lack complete original input hashes') + if phase == 'upgrade' and ('Running upgrade tests at block ' + str(block['number'])) not in (d / 'tests.log').read_text(): + raise ValueError('Original upgrade coverage did not confirm the pinned archive block') + phases[phase] = {'coverage': coverage, 'attribution': C.attribution_summary(attribution), 'events': events, + 'lcov': records, 'source_sha256': sources} + methods = {name: {'methods': row['methods'], 'deployable': UP.deployable(row)} for name, row in bindings.items() + if UP.deployable(row) or any(method.startswith(('test', 'invariant')) for method in row['methods'])} + return {'settings': settings, 'files': files, 'selection': selection, 'phases': phases, 'block': block, 'source_after_verdict': after, + 'fixtures': fixtures, 'config': UP.REPORT.normalize(config, root), 'build_config': UP.REPORT.normalize(build_config, root), + 'methods': methods, 'submodules': UP.SUBMODULES.revisions((directory / 'submodules.txt').read_text()), 'original_sha256': hashes} + + +def compare(directories, feature, sha): + if not re.fullmatch('[0-9a-f]{40}', sha): raise ValueError('Expected full coverage benchmark SHA') + empty = []; data = {p: report(d, feature, sha, p, empty) for p, d in directories.items()}; a, b = data['circle'], data['rwx'] + for key in ('source_sha', 'feature', 'branch', 'profile', 'source_build_profile', 'benchmark_seed', 'authority', 'phases', + 'forge', 'go', 'just', 'input_sha256', 'runtime_output_paths', 'rpc_input_name'): + if a['settings'][key] != b['settings'][key]: raise ValueError('Coverage settings differ at ' + key) + for key in ('files', 'selection', 'phases', 'block', 'source_after_verdict', 'fixtures', 'config', 'build_config', 'methods', 'submodules'): + if a[key] != b[key]: raise ValueError('Complete original coverage parity differs at ' + key) + return {'source_sha': sha, 'feature': feature, 'verified_parity': True, 'selection': a['selection'], 'file_selection': a['files'], + 'phases': a['phases'], 'block': a['block'], 'settings': {p: d['settings'] for p, d in data.items()}, + 'original_sha256': {p: d['original_sha256'] for p, d in data.items()}, 'manifest_declared_empty_logs': empty} + + +if __name__ == '__main__': + p = argparse.ArgumentParser(description=__doc__); p.add_argument('--circle', type=Path, required=True); p.add_argument('--rwx', type=Path, required=True) + p.add_argument('--sha', required=True); p.add_argument('--feature', choices=CS.FEATURES, required=True); p.add_argument('--output', type=Path, required=True) + a = p.parse_args(); result = compare({'circle': a.circle, 'rwx': a.rwx}, a.feature, a.sha); UP.write(a.output, result) + print(json.dumps({'source_sha': a.sha, 'feature': a.feature, 'verified_parity': True, + 'outcomes': {phase: r['coverage']['outcomes'] for phase, r in result['phases'].items()}})) diff --git a/ops/ci/migration/compare-contract-l2-fork.py b/ops/ci/migration/compare-contract-l2-fork.py new file mode 100644 index 00000000000..654239056d4 --- /dev/null +++ b/ops/ci/migration/compare-contract-l2-fork.py @@ -0,0 +1,311 @@ +#!/usr/bin/env python3 +"""Verify complete original L2 fork executions and hosted same-SHA parity.""" +import argparse +import hashlib +import json +import math +from pathlib import Path +import re +import subprocess +import tempfile + +import importlib.util + +def helper(name): + spec=importlib.util.spec_from_file_location(name,(Path(__file__).parent if name.startswith('compare-') or name in ('flaky-report','selector-upload','selector-registry') else Path(__file__).resolve().parents[1] / 'runtime') / (name+'.py')) + module=importlib.util.module_from_spec(spec);spec.loader.exec_module(module);return module + +L=helper('contract-l2-fork');G=helper('compare-pr-gates') +read,check=L.read,L.check + + +def authority(settings): + sha=settings['source_sha'];check(re.fullmatch('[0-9a-f]{40}',sha),'Invalid L2 source revision') + expected=G.source_inputs(sha);inputs=settings['inputs'] + for entry in subprocess.check_output(['git','ls-tree','-rz',sha],cwd=G.ROOT).split(b'\0'): + if not entry:continue + header,name=entry.split(b'\t',1);mode,kind,oid=header.decode().split();name=name.decode();row=inputs[name] + check(row['mode']==mode,'Changed L2 source mode') + if kind=='commit': + check(row=={'mode':mode,'gitlink':oid,'checkout':'initialized'} + and any(key.startswith(name+'/') for key in inputs),'Missing initialized L2 submodule') + else: + wanted=hashlib.sha256(expected[name]['symlink'].encode()).hexdigest() if mode=='120000' else expected[name] + check(row=={'mode':mode,'sha256':wanted},'Changed committed L2 source') + modules=[name for name,row in inputs.items() if row.get('mode')=='160000'] + check(set(inputs)-set(expected)=={name for name in inputs if any(name.startswith(m+'/') for m in modules)}, + 'Foreign L2 source outside initialized submodules') + check(settings['implementation']=={name:hashlib.sha256(G.source('ops/ci/runtime/'+name,sha)).hexdigest() + for name in L.IMPLEMENTATION},'Uncommitted L2 implementation') + + +def positive(value):return type(value) in (int,float) and math.isfinite(value) and value>0 + + +def rpc(directory,expected): + """Bind all original request/response IDs before comparing result frames.""" + requests=sorted(directory.glob('rpc-*-request.json'),key=lambda p:int(p.name.split('-')[1])) + check([p.name for p in requests]==['rpc-'+str(i)+'-request.json' for i in range(len(expected))], + 'Missing or extra original L2 RPC request') + wanted_files=set();results=[] + for i,(path,(method,params)) in enumerate(zip(requests,expected)): + request=read(path) + check(request=={'jsonrpc':'2.0','id':i+1,'method':method,'params':params},'Changed original L2 RPC request') + wanted_files.add(path.name);stem='rpc-'+str(i) + attempts=sorted(directory.glob(stem+'-attempt-*.metadata.json'),key=lambda p:int(p.name.split('-')[3].split('.')[0])) + check(1<=len(attempts)<=3 and [p.name for p in attempts]==[stem+'-attempt-'+str(n)+'.metadata.json' for n in range(1,len(attempts)+1)], + 'Missing or excessive original L2 RPC attempt') + history=[] + for n,metadata in enumerate(attempts,1): + body=directory/(stem+'-attempt-'+str(n)+'.json');wanted_files|={body.name,metadata.name} + row=read(metadata) + check(set(row)=={'url','http_status','error','started_at','elapsed_seconds','response_sha256'} + and row['url']==L.RPC and row['response_sha256']==L.digest(body) + and positive(row['started_at']) and positive(row['elapsed_seconds']), 'Changed original L2 RPC frame') + if n==len(attempts): + value=read(body) + check(row['http_status']==200 and row['error'] is None and value.get('jsonrpc')=='2.0' + and type(value.get('id')) is int and value['id']==i+1 and 'result' in value and 'error' not in value, + 'Failed or mismatched original L2 RPC response') + response={key:item for key,item in value.items() if key!='id'} + else: + check(row['http_status'] not in (200,400,401,403,404),'Invalid L2 retry after success or permanent denial') + response={'original_body_hex':body.read_bytes().hex()} + history.append({'http_status':row['http_status'],'error':row['error'],'response':response}) + results.append({'method':method,'params':params,'attempts':history}) + check({p.name for p in directory.glob('rpc-*')}==wanted_files,'Extra original L2 RPC attempt or frame') + return results + + +def preflight(directory,sha): + L.original(directory);block=read(directory/'block.json') + check(block['source_sha']==sha and block['chain_id']==10 and block['rpc_url']==L.RPC + and type(block['number']) is int and block['number']>0 and type(block['timestamp']) is int and block['timestamp']>0 + and re.fullmatch('0x[0-9a-f]{64}',block['hash']) + and block['policy']=='pinned original OP Mainnet L2 fork block' + and block['requested'] in ('latest',str(block['number'])),'Changed L2 preflight identity') + height=hex(block['number']) + expected=[('eth_chainId',[]),('eth_getBlockByNumber',[height,False]),('eth_getCode',[L.ADDRESS,height]), + ('eth_getStorageAt',[L.ADDRESS,L.SLOT,height]),('eth_call',[{'to':L.ADDRESS,'data':'0x54fd4d50'},height])] + latest=block['requested']=='latest' + rows=rpc(directory,([('eth_blockNumber',[])] if latest else [])+expected) + if latest: + check(rows[0]['attempts'][-1]['response']['result']==height,'Unbound latest L2 block discovery');rows=rows[1:] + values=[row['attempts'][-1]['response']['result'] for row in rows] + check(values[0]=='0xa' and values[1]['number']==height and values[1]['hash']==block['hash'] + and int(values[1]['timestamp'],16)==block['timestamp'] + and re.fullmatch('0x(?:[0-9a-f]{2})+',values[2]) and re.fullmatch('0x[0-9a-f]{64}',values[3]) + and int(values[3],16)>0 and re.fullmatch('0x(?:[0-9a-f]{2})+',values[4]),'Missing original L2 preflight state') + return {'block':{k:v for k,v in block.items() if k!='requested'},'common_rpc':rows, + 'latest_discovery':latest,'original_sha256':L.files(directory)} + + +def runtime_transport(directory): + """Validate the sealed policy and every recorded transport frame. + + A fresh Forge verdict can use only cached RPC state. Its relay report then + contains zero requests. The verdict and pinned block checks remain separate. + """ + final=read(directory/'final.json');settings=read(directory/'settings.json') + check(set(final)=={'requests','sha256'} and type(final['requests']) is int and final['requests']>=0 + and final['sha256']==L.files(directory) + and json.dumps(settings,sort_keys=True)==json.dumps({'upstream':L.RPC,'policy':L.P.POLICY},sort_keys=True), + 'Missing or corrupt L2 RPC transport originals') + expected={'settings.json'};attempt_count=0;retry_count=0;statuses={};stable={};previous=None;live_requests=0 + def live(value): + if isinstance(value,str):return value in ('latest','pending','safe','finalized') + if isinstance(value,dict):return any(live(v) for v in value.values()) + if isinstance(value,list):return any(live(v) for v in value) + return False + for number in range(final['requests']): + stem='request-'+str(number);path=directory/(stem+'.json');metadata=directory/(stem+'.metadata.json') + expected|={path.name,metadata.name};request=read(path);identity=read(metadata) + requests=request if isinstance(request,list) else [request] + check(requests and all(isinstance(r,dict) and r.get('jsonrpc')=='2.0' + and type(r.get('id')) in (int,str) and isinstance(r.get('method'),str) + and (r.get('params') is None or isinstance(r['params'],(list,dict))) for r in requests) + and len({r['id'] for r in requests})==len(requests) + and identity=={'upstream':L.RPC,'request_sha256':L.digest(path)},'Changed original runtime RPC request') + live_requests+=sum(live(r.get('params',[])) or r['method'] in ('eth_blockNumber','web3_clientVersion') for r in requests) + attempts=sorted(directory.glob(stem+'-attempt-*.metadata.json'),key=lambda p:int(p.name.split('-')[3].split('.')[0])) + check(1<=len(attempts)<=L.P.POLICY['max_attempts'] + and [p.name for p in attempts]==[stem+'-attempt-'+str(n)+'.metadata.json' for n in range(1,len(attempts)+1)], + 'Missing or excessive runtime RPC attempt') + retry_count+=len(attempts)-1 + for n,metadata in enumerate(attempts,1): + body=directory/(stem+'-attempt-'+str(n)+'.json');expected|={body.name,metadata.name};row=read(metadata) + status=row['http_status'];attempt_count+=1;statuses[str(status)]=statuses.get(str(status),0)+1 + check(set(row)=={'http_status','error','started_at','elapsed_seconds','response_sha256'} + and (status is None or type(status) is int and 100<=status<=599) + and (row['error'] is None or isinstance(row['error'],str)) + and row['response_sha256']==L.digest(body) and positive(row['started_at']) + and positive(row['elapsed_seconds']), 'Changed original runtime RPC attempt') + check(previous is None or row['started_at']-previous>=0.4,'Runtime RPC requests exceeded the shared budget') + previous=row['started_at'] + if n0, 'Missing complete original Circle L2 console') + index=read(circle/'step-index.json') + check([(row['step'],row['action']) for row in index]==[(i,j) for i,step in enumerate(job['steps']) + for j,action in enumerate(step['actions']) if action.get('output_url')],'Missing complete Circle L2 original steps') + for row in index: + check(all(event.get('truncated') is False and isinstance(event['message'],str) for event in read(circle/row['path'])), 'Truncated original Circle L2 console') + github=read(github_path);checks=G.named(github['checks'],'name');optional=checks['RWX: optimism-contract-l2-fork-shadow'] + check(github['sha']==sha and optional['state']=='success' and '/runs/'+run['ID'] in optional['link'] + and (not check_task or '/latest/'+check_task in optional['link']), 'Missing successful same-SHA native L2 check') + return {'circle_pipeline':pipeline['number'],'circle_job':job['build_num'],'native_run':run['ID']} + + +def compare(circle,native,run_path,github_path): + ids=hosted(circle,native,run_path,github_path);c,n=equal(circle/'report',native) + return {'state':'passed','source_sha':c['settings']['source_sha'],'selection':c['selection'],'coverage':c['coverage'], + 'block':c['preflight']['block'],'commands':c['commands'],'hosted':ids, + 'original_sha256':{'circle':L.files(circle),'native':n['original_sha256']}, + 'runtime_rpc_transport':{provider:{k:v for k,v in row['rpc_transport'].items() if k!='stable_results'} + for provider,row in (('circleci',c),('rwx',n))}, + 'block_discovery':'Complete RPC originals retain either native head discovery or the committed pilot snapshot; both providers use the same original height'} + + +if __name__=='__main__': + parser=argparse.ArgumentParser(description=__doc__) + for name in ('circle','native','run_state','github_checks','output'):parser.add_argument(name,type=Path) + args=parser.parse_args();result=compare(args.circle,args.native,args.run_state,args.github_checks) + args.output.parent.mkdir(parents=True,exist_ok=True);L.write(args.output,result) + print(json.dumps({key:result[key] for key in ('state','source_sha','hosted')})) diff --git a/ops/ci/migration/compare-contract-suites.py b/ops/ci/migration/compare-contract-suites.py new file mode 100644 index 00000000000..ff72304be86 --- /dev/null +++ b/ops/ci/migration/compare-contract-suites.py @@ -0,0 +1,169 @@ +#!/usr/bin/env python3 +"""Compare complete standard/changed-file originals, settings and assignments.""" +import argparse +import importlib.util +import json +from pathlib import Path +_SPEC_E = importlib.util.spec_from_file_location('report_evidence', Path(__file__).with_name('report-evidence.py')) +E = importlib.util.module_from_spec(_SPEC_E); _SPEC_E.loader.exec_module(E) +import re + +SPEC = importlib.util.spec_from_file_location('suites', Path(__file__).resolve().parents[1] / 'runtime' / 'contract-suites.py') +CS = importlib.util.module_from_spec(SPEC); SPEC.loader.exec_module(CS) +UP = CS.UP + + +def report(directory, suite, feature, sha, provider, empty): + required = CS.PREPARED | {'original.junit.xml', 'coverage.json', 'tests.stage.json', 'junit-nonempty.stage.json', + 'lint-test-names.stage.json', 'source-after-verdict.json', 'runtime-fixtures.json'} + if provider == 'rwx': required |= {'runtime-config.json', 'runtime-config.stage.json', 'runtime-files.log', 'runtime-files.stage.json', + 'preparation-manifest.json', 'preparation-settings.json'} + else: required |= {'split.log', 'split.stage.json'} + try: + hashes = E.originals(directory, required, empty, provider + '/' + suite + '-' + feature) + except OSError as error: + raise ValueError('Missing original contract suite report file') from error + physical = {str(p.relative_to(directory)) for p in directory.rglob('*') if p.is_file() and p != directory / 'final.json'} + if physical != set(hashes): raise ValueError('Unsealed or missing original contract suite files') + settings = json.loads((directory / 'settings.json').read_text()) + if (settings['source_sha'], settings['suite'], settings['feature'], settings['provider']) != \ + (sha, suite, feature, 'circleci' if provider == 'circle' else 'rwx'): + raise ValueError('Wrong contract suite source, occurrence or provider') + profile = 'ciheavy' if suite == 'modified' else 'ci' if settings['branch'] == 'develop' else 'liteci' + if settings['profile'] != profile or not settings['input_sha256']: raise ValueError('Wrong effective contract branch profile or missing source inputs') + if json.loads((directory / 'source-after-preparation.json').read_text()) != settings['input_sha256']: + raise ValueError('Contract source inputs changed during preparation') + test_list = 'find test -name "*.t.sol"' if suite == 'standard' else CS.FILE_COMMANDS[suite][-1] + if settings['test_list'] != test_list: raise ValueError('Wrong original Circle contract test-list parameter') + if provider == 'rwx' and (not settings['rwx_run_id'] or str(settings['rwx_task_attempt']) != '1'): + raise ValueError('Reused contract verdict or uninvestigated task retry') + files = CS.file_selection((directory / 'files.log').read_text()) + if not files: raise ValueError('Empty original contract selection cannot establish coverage') + chosen = {'files': files, 'partitions': [{'index': 0, 'files': files}], 'match_path': CS.match_path(files)} + outputs = CS.runtime_outputs(files) + if settings.get('runtime_output_paths') != outputs: raise ValueError('Unexpected tracked runtime output role') + after = json.loads((directory / 'source-after-verdict.json').read_text()) + changes = {name: {'before': settings['input_sha256'].get(name), 'after': after.get(name)} + for name in sorted(set(settings['input_sha256']) | set(after)) + if settings['input_sha256'].get(name) != after.get(name)} + if set(changes) - set(outputs): raise ValueError('Contract source inputs changed during verdict') + if changes and json.loads((directory / 'source-changes-verdict.json').read_text()) != changes: + raise ValueError('Tracked runtime fixture change evidence differs') + fixtures = {} + for name in outputs: + for phase, expected in [('before', settings['input_sha256'].get(name)), ('after', after.get(name))]: + if not isinstance(expected, str) or UP.digest(directory / 'tracked-fixtures' / phase / name) != expected: + raise ValueError('Corrupt original tracked runtime fixture') + fixtures[name] = {'before_sha256': settings['input_sha256'][name], 'after_sha256': after[name]} + if json.loads((directory / 'runtime-fixtures.json').read_text()) != fixtures: + raise ValueError('Runtime fixture hashes differ from originals') + if json.loads((directory / 'file-selection.json').read_text()) != chosen: raise ValueError('Missing, duplicate or wrong contract file assignment') + if provider == 'circle' and CS.file_selection((directory / 'split.log').read_text()) != files: + raise ValueError('Original Circle timing split differs from complete file selection') + expected_files = {p.removeprefix('packages/contracts-bedrock/') for p in settings['input_sha256'] + if p.startswith('packages/contracts-bedrock/test/') and p.endswith('.t.sol')} + if (suite == 'standard' and set(files) != expected_files) or not set(files) <= expected_files: + raise ValueError('Incomplete original standard discovery or missing changed-file inputs') + config = json.loads((directory / 'foundry-config.json').read_text()); CS.validate_config(config, suite) + if provider == 'rwx': + if json.loads((directory / 'runtime-config.json').read_text()) != config or \ + CS.file_selection((directory / 'runtime-files.log').read_text()) != files: + raise ValueError('Runtime contract settings or file selection changed') + preparation = json.loads((directory / 'preparation-manifest.json').read_text()) + if preparation['exit_code'] or preparation['report_errors'] or not CS.PREPARED <= set(preparation['original_sha256']): + raise ValueError('Failed or incomplete contract compilation producer') + for name, digest in preparation['original_sha256'].items(): + path = directory / ('preparation-settings.json' if name == 'settings.json' else name) + if UP.digest(path) != digest: raise ValueError('Corrupt original contract preparation') + before = json.loads((directory / 'preparation-settings.json').read_text()) + for key in set(settings) - {'rwx_run_id', 'rwx_task_attempt'}: + if settings[key] != before[key]: raise ValueError('Contract producer settings differ from runtime') + methods = json.loads((directory / 'signature-bindings.json').read_text()) + compiled = json.loads((directory / 'compiled.json').read_text()) + if not compiled or 'packages/contracts-bedrock/scripts/go-ffi/go-ffi' not in compiled: + raise ValueError('Missing complete contract compiler artifact binding') + for row in methods.values(): + if not row['artifacts'] or any(compiled.get(name) != digest for name, digest in row['artifacts'].items()): + raise ValueError('Compiler test signature binding differs from original artifacts') + selected = UP.selection(json.loads((directory / 'discovery.json').read_text()), methods) + if selected != [tuple(row) for row in json.loads((directory / 'selection.json').read_text())] or \ + any(identity.rsplit(':', 1)[0] not in files for identity, _ in selected): + raise ValueError('Contract test selection differs from complete original discovery') + coverage = UP.junit(directory / 'original.junit.xml', selected, methods) + if json.loads((directory / 'coverage.json').read_text()) != coverage: raise ValueError('Contract coverage differs from original JUnit') + if json.loads((directory / 'compile-only.json').read_text()) != {'tests': 0, 'selected_cases': len(selected), 'suite': suite, 'feature': feature}: + raise ValueError('Contract producer did not retain a compile-only observation') + root = settings['workspace_root']; cwd = root + '/packages/contracts-bedrock' + pinned = settings.get('target_binding') == 'run-pinned' + if settings.get('target_binding') not in (None, 'run-pinned') or (pinned and (provider != 'rwx' or suite != 'modified')): + raise ValueError('Invalid contract target binding') + files_argv = CS.file_command(suite, settings['target_sha'] if pinned else None) + commands = {'files': files_argv, 'foundry-config': ['forge', 'config', '--json'], + 'submodules-sync': ['git', '-C', root, 'submodule', 'sync', '--recursive'], + 'submodules-init': ['git', '-C', root, '-c', 'protocol.file.allow=never', 'submodule', + 'update', '--init', '--recursive', '--jobs', '8'], + 'go-ffi': ['just', 'build-go-ffi'], 'contracts-build': ['forge', 'build'], + 'discovery': ['forge', 'test', '--list', '--json', '--match-path', chosen['match_path']], + 'tests': ['forge', 'test', '--match-path', chosen['match_path'], '--junit'], + 'junit-nonempty': ['./scripts/checks/check-junit-tests-ran.sh', str(directory / 'original.junit.xml')], + 'lint-test-names': ['just', 'lint-forge-tests-check-no-build']} + if provider == 'circle': commands['split'] = CS.SPLIT_COMMAND + else: commands.update({'runtime-files': files_argv, 'runtime-config': ['forge', 'config', '--json']}) + if suite == 'modified': + fetch = ['git', 'fetch', '--no-tags', 'origin', '+refs/heads/develop:refs/remotes/origin/develop'] + if not pinned: + commands['fetch-develop'] = fetch + if provider == 'rwx': commands['runtime-fetch-develop'] = fetch + if any(not re.fullmatch('[0-9a-f]{40}', settings[k]) for k in ('target_sha', 'merge_base_sha')): + raise ValueError('Missing original changed-file target revisions') + stages = {p.name.removesuffix('.stage.json') for p in directory.glob('*.stage.json')} + if stages != set(commands): raise ValueError('Missing original contract command or uninvestigated retry') + for name, argv in commands.items(): + row = json.loads((directory / (name + '.stage.json')).read_text()) + # The report location is provider-specific; the original guard's path + # must still refer to this invocation's retained original XML. + if name == 'junit-nonempty': + expected = root + '/.ci/contract-suites/' + suite + '-' + feature + '/run/original.junit.xml' + argv = ['./scripts/checks/check-junit-tests-ran.sh', expected] + if (row['argv'], row['cwd'], row['exit_code']) != (argv, cwd, 0): raise ValueError('Wrong or failed original contract command') + # Foundry leaves obsolete line-numbered VmContractHelper interfaces in a + # restored output directory. They have no creation bytecode and no test or + # invariant selectors. Retain their bindings, but compare all executable + # contracts and every test-bearing abstract declaration as workload inputs. + interfaces = {name: {'methods': row['methods'], 'deployable': False} for name, row in methods.items() + if not UP.deployable(row) and not any(method.startswith(('test', 'invariant')) for method in row['methods'])} + return {'settings': settings, 'files': chosen, 'selection': selected, 'coverage': coverage, + 'config': UP.REPORT.normalize(config, root), 'original_sha256': hashes, 'compiled_sha256': compiled, + 'source_after_verdict': after, 'runtime_fixtures': fixtures, + 'submodules': UP.SUBMODULES.revisions((directory / 'submodules.txt').read_text()), + 'interfaces': interfaces, + 'methods': {name: {'methods': row['methods'], 'deployable': UP.deployable(row)} + for name, row in methods.items() if name not in interfaces}} + + +def compare(directories, suite, feature, sha): + if not re.fullmatch('[0-9a-f]{40}', sha): raise ValueError('Expected full contract suite benchmark SHA') + empty = []; data = {p: report(d, suite, feature, sha, p, empty) for p, d in directories.items()}; a, b = data['circle'], data['rwx'] + for key in ('source_sha', 'suite', 'feature', 'branch', 'profile', 'test_list', 'forge', 'go', 'just', 'input_sha256', + 'runtime_output_paths', 'target_sha', 'merge_base_sha'): + if a['settings'].get(key) != b['settings'].get(key): raise ValueError('Contract settings differ at ' + key) + for key in ('files', 'selection', 'coverage', 'config', 'submodules', 'methods', 'source_after_verdict', 'runtime_fixtures'): + if a[key] != b[key]: raise ValueError('Complete original contract parity differs at ' + key) + interface_differences = {name: {p: d['interfaces'].get(name) for p, d in data.items()} + for name in sorted(set(a['interfaces']) | set(b['interfaces'])) + if a['interfaces'].get(name) != b['interfaces'].get(name)} + return {'source_sha': sha, 'suite': suite, 'feature': feature, 'verified_parity': True, + 'file_selection': a['files'], 'selection': a['selection'], 'coverage': a['coverage'], + 'settings': {p: d['settings'] for p, d in data.items()}, 'original_sha256': {p: d['original_sha256'] for p, d in data.items()}, + 'compiled_sha256': {p: d['compiled_sha256'] for p, d in data.items()}, + 'source_after_verdict': a['source_after_verdict'], 'runtime_fixtures': a['runtime_fixtures'], + 'non_test_interface_differences': interface_differences, + 'manifest_declared_empty_logs': empty} + + +if __name__ == '__main__': + p = argparse.ArgumentParser(description=__doc__); p.add_argument('--circle', type=Path, required=True); p.add_argument('--rwx', type=Path, required=True) + p.add_argument('--sha', required=True); p.add_argument('--suite', choices=CS.SUITES, required=True); p.add_argument('--feature', choices=CS.FEATURES, required=True) + p.add_argument('--output', type=Path, required=True); a = p.parse_args() + result = compare({'circle': a.circle, 'rwx': a.rwx}, a.suite, a.feature, a.sha); UP.write(a.output, result) + print(json.dumps({'source_sha': a.sha, 'suite': a.suite, 'feature': a.feature, 'verified_parity': True, 'outcomes': result['coverage']['outcomes']})) diff --git a/ops/ci/migration/compare-contract-upgrades.py b/ops/ci/migration/compare-contract-upgrades.py new file mode 100644 index 00000000000..234e4bd633a --- /dev/null +++ b/ops/ci/migration/compare-contract-upgrades.py @@ -0,0 +1,84 @@ +#!/usr/bin/env python3 +"""Compare complete L1 upgrade discovery, artifacts and original verdicts.""" +import argparse +import importlib.util +import json +from pathlib import Path +_SPEC_E = importlib.util.spec_from_file_location('report_evidence', Path(__file__).with_name('report-evidence.py')) +E = importlib.util.module_from_spec(_SPEC_E); _SPEC_E.loader.exec_module(E) +import re + +SPEC = importlib.util.spec_from_file_location('upgrade', Path(__file__).resolve().parents[1] / 'runtime' / 'contract-upgrades.py') +UP = importlib.util.module_from_spec(SPEC); SPEC.loader.exec_module(UP) + + +def report(directory, variant, sha, provider, empty): + required = {'settings.json', 'selection.json', 'foundry-config.json', 'foundry-config.stage.json', + 'discovery.json', 'discovery.stage.json', 'go-ffi.stage.json', 'contracts-build.stage.json', 'submodules.txt', + 'compiled.json', 'signature-bindings.json', 'block.json', 'coverage.json', 'tests.stage.json', 'original.junit.xml'} + hashes = E.originals(directory, required, empty, provider + '/' + variant) + settings = json.loads((directory / 'settings.json').read_text()) + if (settings['source_sha'], settings['variant'], settings['provider']) != (sha, variant, 'circleci' if provider == 'circle' else 'rwx'): + raise ValueError('Upgrade source, variant or provider differs') + chain, feature = UP.VARIANTS[variant] + if (settings['chain'], settings['feature'], settings['fuzz_seed'], settings['fuzz_runs']) != (chain, feature, '42424242', 1): + raise ValueError('Unexpected effective upgrade workload') + if settings['profile'] != ('ci' if settings['branch'] == 'develop' else 'liteci'): raise ValueError('Upgrade branch profile differs') + if provider == 'rwx' and (not settings['rwx_run_id'] or str(settings['rwx_task_attempt']) != '1'): + raise ValueError('Missing fresh native upgrade identity or uninvestigated task retry') + methods = json.loads((directory / 'signature-bindings.json').read_text()) + compiled = json.loads((directory / 'compiled.json').read_text()) + for row in methods.values(): + if not row['artifacts'] or any(compiled.get(path) != hashed for path, hashed in row['artifacts'].items()): + raise ValueError('Original compiler signature artifact binding differs') + selected = UP.selection(json.loads((directory / 'discovery.json').read_text()), methods) + if selected != [tuple(r) for r in json.loads((directory / 'selection.json').read_text())]: + raise ValueError('Upgrade selection differs from original discovery and signatures') + original = UP.junit(directory / 'original.junit.xml', selected, methods) + if original != json.loads((directory / 'coverage.json').read_text()): raise ValueError('Upgrade coverage differs from original JUnit') + block = json.loads((directory / 'block.json').read_text()) + if block['source_sha'] != sha or block['chain_id'] != 1 or block['policy'] != 'Just current-day 00:00 UTC' or \ + type(block['number']) is not int or block['number'] <= 0 or not re.fullmatch('0x[0-9a-f]{64}', block['hash']): + raise ValueError('Wrong bound archive block identity') + commands = {} + expected = {'foundry-config': ['forge', 'config', '--json'], 'go-ffi': ['just', 'build-go-ffi'], + 'contracts-build': ['forge', 'build'], + 'discovery': ['forge', 'test', '--list', '--json', '--match-path', UP.MATCH], 'tests': ['just', 'test-upgrade']} + for name, argv in expected.items(): + row = json.loads((directory / (name + '.stage.json')).read_text()) + if row['argv'] != argv or row['exit_code'] != 0 or row['cwd'] != settings['workspace_root'] + '/packages/contracts-bedrock': + raise ValueError('Unexpected original upgrade command, directory or failure') + commands[name] = argv + stages = {p.name.removesuffix('.stage.json') for p in directory.glob('*.stage.json')} + if stages - set(expected) - {'pinned-block'}: raise ValueError('Uninvestigated extra upgrade command or diagnostic retry') + if 'pinned-block' in stages: + row = json.loads((directory / 'pinned-block.stage.json').read_text()) + if row['argv'] != ['just', 'print-pinned-block-number'] or row['exit_code'] != 0 or \ + (directory / 'pinned-block.log').read_text().strip() != str(block['number']): + raise ValueError('Original archive block discovery differs') + return {'settings': settings, 'selection': selected, 'coverage': original, 'block': block, + 'config': UP.REPORT.normalize(json.loads((directory / 'foundry-config.json').read_text()), settings['workspace_root']), + 'submodules': UP.SUBMODULES.revisions((directory / 'submodules.txt').read_text()), + 'methods': {k:{'methods':v['methods'],'deployable':UP.deployable(v)} for k,v in methods.items()}, + 'commands': commands, 'original_sha256': hashes, 'compiled_sha256': compiled} + + +def compare(directories, variant, sha): + if not re.fullmatch('[0-9a-f]{40}', sha): raise ValueError('Expected complete upgrade benchmark SHA') + empty = []; data = {p:report(d, variant, sha, p, empty) for p,d in directories.items()} + a,b = data['circle'],data['rwx'] + for key in ('source_sha','variant','branch','chain','feature','profile','fuzz_seed','fuzz_runs','forge','go','just','input_sha256'): + if a['settings'][key] != b['settings'][key]: raise ValueError('Upgrade settings binding differs at ' + key) + for key in ('selection','coverage','block','config','submodules','methods','commands'): + if a[key] != b[key]: raise ValueError('Original upgrade parity differs at ' + key) + return {'source_sha':sha,'variant':variant,'verified_parity':True,'selection':a['selection'],'coverage':a['coverage'], + 'block':a['block'],'commands':a['commands'],'settings':{p:d['settings'] for p,d in data.items()}, + 'original_sha256':{p:d['original_sha256'] for p,d in data.items()}, + 'compiled_sha256':{p:d['compiled_sha256'] for p,d in data.items()},'manifest_declared_empty_logs':empty} + + +if __name__ == '__main__': + p=argparse.ArgumentParser(description=__doc__);p.add_argument('--circle',type=Path,required=True);p.add_argument('--rwx',type=Path,required=True) + p.add_argument('--sha',required=True);p.add_argument('--variant',choices=UP.VARIANTS,required=True);p.add_argument('--output',type=Path,required=True) + a=p.parse_args();result=compare({'circle':a.circle,'rwx':a.rwx},a.variant,a.sha);UP.write(a.output,result) + print(json.dumps({'source_sha':a.sha,'variant':a.variant,'verified_parity':True,'outcomes':result['coverage']['outcomes']})) diff --git a/ops/ci/migration/compare-flaky-report.py b/ops/ci/migration/compare-flaky-report.py new file mode 100644 index 00000000000..d9e3a88d371 --- /dev/null +++ b/ops/ci/migration/compare-flaky-report.py @@ -0,0 +1,166 @@ +#!/usr/bin/env python3 +"""Verify complete original reporting executions and same-SHA hosted parity.""" +import argparse +import hashlib +import importlib.util +import json +from pathlib import Path +import re + + +def helper(name): + spec = importlib.util.spec_from_file_location(name, (Path(__file__).parent if name.startswith('compare-') or name in ('flaky-report','selector-upload','selector-registry') else Path(__file__).resolve().parents[1] / 'runtime') / (name + '.py')) + module = importlib.util.module_from_spec(spec) + spec.loader.exec_module(module) + return module + + +F = helper('flaky-report') +G = helper('compare-pr-gates') +check, read = F.check, F.read + + +def report(directory, authority=True): + final = read(directory / 'final.json') + check(final['state'] == 'passed' and type(final['exit_code']) is int and final['exit_code'] == 0 + and type(final['tests']) is int and final['tests'] == 0 and type(final['reports']) is int + and final['reports'] == 1 and final['errors'] == [] and final['sha256'] == F.files(directory), + 'Missing, failed or corrupt original report') + settings = read(directory / 'settings.json') + sha, branch, provider = settings['source_sha'], settings['branch'], settings['provider'] + check(re.fullmatch('[0-9a-f]{40}', sha) and branch == 'codex/rwx-ci-pilot' and provider in ('circleci', 'rwx') + and settings['scope'] == 'project-wide branch-agnostic Circle Insights' + and type(settings['authenticated']) is bool + and (provider != 'rwx' or settings['authenticated'] is False), 'Wrong original reporting identity') + check(settings['api_url'] == 'https://circleci.com/api/v2/insights/gh/ethereum-optimism/optimism/flaky-tests?branch=codex%2Frwx-ci-pilot' + and settings['jq'] == 'jq-1.7.1' and settings['curl'].startswith('curl '), 'Changed original API or tools') + if authority: + check(settings['input_sha256'] == {name: hashlib.sha256(G.source(name, sha)).hexdigest() for name in F.INPUTS}, + 'Stale or uncommitted reporting inputs') + execution = read(directory / 'execution.json') + cwd, argv = execution['cwd'], execution['argv'] + # Downloaded evidence has a different local prefix; the original process + # cwd and exact argv identify its actual provider workspace and output. + expected_output = cwd + '/.ci/flaky-report/run/reports' + wanted = ['bash', cwd + '/' + F.SCRIPT, '--branch', branch, '--org', 'ethereum-optimism', + '--repo', 'optimism', '--output-dir', expected_output] + if settings['authenticated']: wanted += ['--token', '[redacted]'] + check(argv == wanted and cwd.startswith('/') and type(execution['exit_code']) is int and execution['exit_code'] == 0 + and execution['signals'] == [] and execution['timed_out'] is False + and type(execution['started_at']) in (int, float) and execution['started_at'] > 0 + and type(execution['elapsed_seconds']) in (int, float) and execution['elapsed_seconds'] > 0 + and execution['stdout_sha256'] == F.digest(directory / 'stdout.log') + and execution['stderr_sha256'] == F.digest(directory / 'stderr.log'), 'Missing real original reporting execution') + value = F.validate_report(directory / 'reports', branch) + check(read(directory / 'coverage.json') == {key: value[key] for key in ('source_rows', 'acceptance_rows', 'scope')} + and value['source_rows'] > 0 and value['acceptance_rows'] > 0, 'Empty or incomplete executed workload') + stdout = (directory / 'stdout.log').read_text() + ordered = list(reversed(sorted(value['filtered']['flaky_tests'], key=lambda row: row['times_flaked']))) + top = '\n'.join(str(row['times_flaked']) + 'x: ' + row['test_name'] for row in ordered[:10]) + check(stdout.endswith(top + '\n'), 'Missing original top-ten text report') + attempts = [] + for path in sorted((directory / 'reports').glob('api-attempt-*.http-status.txt')): + stem = path.name.removesuffix('.http-status.txt') + attempts.append({'number': int(stem.split('-')[2]), 'status': path.read_text().strip(), + 'exit_code': int((path.parent / (stem + '.exit-code.txt')).read_text()), + 'body_sha256': F.digest(path.parent / (stem + '.json')) if (path.parent / (stem + '.json')).exists() else None, + 'stderr_sha256': F.digest(path.parent / (stem + '.stderr.log'))}) + return {'settings': settings, 'original': value['original'], 'filtered': value['filtered'], + 'csv': (directory / 'reports/flaky_tests.csv').read_bytes(), + 'html': (directory / 'reports/flaky_tests.html').read_bytes(), + 'stdout': stdout.replace(expected_output, '$REPORTS'), 'attempts': attempts, + 'rows': {key: value[key] for key in ('source_rows', 'acceptance_rows')}} + + +def equal(circle, native): + for key in ('source_sha', 'branch', 'input_sha256', 'api_url', 'scope', 'jq'): + check(circle['settings'][key] == native['settings'][key], 'Original reporting identity differs: ' + key) + # No row, date, order, count, skip or retry data are normalized away. + for key in ('original', 'filtered', 'csv', 'html', 'stdout', 'rows'): + check(circle[key] == native[key], 'Complete original flaky-report parity differs: ' + key) + check(all(row['status'] == '200' and row['exit_code'] == 0 for row in + (circle['attempts'][-1], native['attempts'][-1])), 'Failed final original API attempt') + return {'rows': circle['rows'], 'attempts': {'circleci': circle['attempts'], 'rwx': native['attempts']}} + + +def hosted(circle, native, run_path, github_path): + settings = read(native / 'settings.json') + sha, branch = settings['source_sha'], settings['branch'] + run = read(run_path) + check(run['ID'] == run['RunID'] == settings['native_run_id'] and run['CommitSha'] == sha + and run['Branch'] == branch and run['Trigger'] == 'github.push' and run['DefinitionPath'] == '.rwx/flaky-report.yml' + and run['TargetedTaskKeys'] is None and settings['native_task_attempt'] == '1', + 'Foreign, targeted or retried native reporter') + tasks = G.named(run['Tasks'], 'Key') + G.fresh(tasks['helper-tests']); G.fresh(tasks['report']) + identity = read(circle / 'settings.json') + check(identity == {'provider': 'circleci', 'source_sha': sha, 'branch': branch, + 'pipeline_id': identity['pipeline_id'], 'workflow_id': identity['workflow_id'], 'job_number': identity['job_number']}, + 'Foreign Circle collection identity') + envelope = read(circle / 'final.json') + check(envelope['source_sha'] == sha and envelope['sha256'] == F.files(circle), 'Missing or corrupt Circle collection') + pipeline, workflow, job = (read(circle / name) for name in ('pipeline.json', 'workflow.json', 'job.json')) + check(pipeline['id'] == identity['pipeline_id'] and not pipeline['errors'] and pipeline['vcs']['revision'] == sha + and pipeline['vcs']['branch'] == branch and workflow['id'] == identity['workflow_id'] + and workflow['pipeline_id'] == identity['pipeline_id'] and workflow['name'] == 'flaky-report-replay' + and workflow['status'] == 'success', 'Foreign or failed Circle reporting workflow') + pages = sorted((circle / 'api-pages').glob('jobs-*.json'), key=lambda p: int(p.stem.split('-')[1])) + check(pages and [p.name for p in pages] == ['jobs-' + str(i) + '.json' for i in range(len(pages))], 'Missing Circle job page') + jobs = [] + for i, path in enumerate(pages): + page = read(path); jobs.extend(page['items']) + check(bool(page.get('next_page_token')) == (i < len(pages) - 1), 'Incomplete Circle pagination') + check(len(jobs) == 1 and jobs[0]['name'] == 'generate-flaky-tests-report' and jobs[0]['status'] == 'success' + and jobs[0]['job_number'] == identity['job_number'] and job['workflows']['job_id'] == jobs[0]['id'] + and job['workflows']['job_name'] == jobs[0]['name'] and job['build_num'] == identity['job_number'] + and job['vcs_revision'] == sha and job['branch'] == branch and job['workflows']['workflow_id'] == identity['workflow_id'] + and job['status'] == job['outcome'] == 'success' and not job['retry_of'] + and all(job[key] is False for key in ('failed', 'timedout', 'canceled', 'infrastructure_fail')), + 'Failed, skipped or retried original Circle report') + config = read(circle / 'pipeline-config.json') + check(config['compiled'] == (circle / 'compiled.yml').read_text() and config['source'] == (circle / 'source.yml').read_text(), + 'Changed Circle compiled originals') + compiled = G.yaml(circle / 'compiled.yml') + selected = compiled['workflows']['flaky-report-replay']['jobs'] + check(len(selected) == 1 and set(selected[0]) == {'generate-flaky-tests-report'}, 'Wrong original reporting workload selection') + commands = [step['run']['command'] for step in compiled['jobs']['generate-flaky-tests-report']['steps'] + if isinstance(step, dict) and isinstance(step.get('run'), dict)] + check(any(command.strip() == 'python3 ops/ci/migration/flaky-report.py run .ci/flaky-report/run' for command in commands), + 'Missing original executed reporting wrapper') + authority = G.source('.circleci/continue/main.yml', sha).decode() + check('generate-flaky-report:' in authority and 'python3 ops/ci/migration/flaky-report.py run .ci/flaky-report/run' in authority, + 'Uncommitted Circle report adapter') + index = read(circle / 'step-index.json') + actions = [(i, j) for i, step in enumerate(job['steps']) for j, action in enumerate(step['actions']) if action.get('output_url')] + check([(row['step'], row['action']) for row in index] == actions, 'Missing complete original Circle logs') + for row in index: + events = read(circle / row['path']) + check(all(event.get('truncated') is False and isinstance(event['message'], str) for event in events), 'Truncated Circle originals') + executed = [row for row in index if row['name'] == 'Generate flaky acceptance tests report'] + check(len(executed) == 1 and executed[0]['status'] == 'success', 'Missing actual Circle report execution') + github = read(github_path) + native_check = G.named(github['checks'], 'name')['RWX: optimism-flaky-report-shadow'] + check(github['sha'] == sha and native_check['state'] == 'success' and '/runs/' + run['ID'] in native_check['link'], + 'Missing successful same-SHA optional reporting check') + return {'circle_pipeline': pipeline['number'], 'circle_job': job['build_num'], 'native_run': run['ID']} + + +def compare(circle, native, run_path, github_path): + ids = hosted(circle, native, run_path, github_path) + c, n = report(circle / 'report'), report(native) + check(c['settings']['provider'] == 'circleci' and n['settings']['provider'] == 'rwx', 'Wrong original providers') + parity = equal(c, n) + return {'verified_parity': True, 'source_sha': c['settings']['source_sha'], **ids, **parity, + 'original_manifest_sha256': {'circleci': F.digest(circle / 'report/final.json'), 'rwx': F.digest(native / 'final.json')}, + 'complete_original_files': {'circleci': len(F.files(circle / 'report')) + 1, 'rwx': len(F.files(native)) + 1}, + 'normalizations': ['provider workspace prefix in report output paths'], + 'provider_differences': ['authenticated Circle API request and anonymous native request to the same public project']} + + +if __name__ == '__main__': + parser = argparse.ArgumentParser(description=__doc__) + for key in ('circle', 'native', 'run', 'github', 'output'): parser.add_argument('--' + key, type=Path, required=True) + args = parser.parse_args() + value = compare(args.circle, args.native, args.run, args.github) + F.write(args.output, value) + print(json.dumps(value)) diff --git a/ops/ci/migration/compare-kontrol-build.py b/ops/ci/migration/compare-kontrol-build.py new file mode 100644 index 00000000000..f1bfb6b5c8a --- /dev/null +++ b/ops/ci/migration/compare-kontrol-build.py @@ -0,0 +1,267 @@ +#!/usr/bin/env python3 +"""Compare every original Kontrol input, summary, generated file and compiler output.""" +import argparse +import importlib.util +from collections import Counter +import copy +import json +from pathlib import Path +_SPEC_E = importlib.util.spec_from_file_location('report_evidence', Path(__file__).with_name('report-evidence.py')) +E = importlib.util.module_from_spec(_SPEC_E); _SPEC_E.loader.exec_module(E) +import re +import tarfile + +import importlib.util + + +def helper(name): + spec = importlib.util.spec_from_file_location(name.replace('-', '_'), (Path(__file__).parent if name.startswith('compare-') or name in ('flaky-report','selector-upload','selector-registry') else Path(__file__).resolve().parents[1] / 'runtime') / (name + '.py')) + value = importlib.util.module_from_spec(spec); spec.loader.exec_module(value) + return value + + +K = helper('kontrol-build'); A = helper('compare-contract-artifacts'); G = K.G +EMPTY = A.digest(b'') +COMPILER_PHASES = ('initial', 'summaries', 'proofs', 'final') + + +def compiler(directory): + manifest = G.read(directory / 'files.json'); files = {} + prefixes = tuple('packages/contracts-bedrock/' + p for p in ('forge-artifacts/', 'cache/', 'artifacts/build-info/')) + with tarfile.open(directory / 'files.tar.gz', 'r|gz') as archive: + for member in archive: + path = Path(member.name) + if (path.is_absolute() or '..' in path.parts or not member.isfile() or member.name in files or not member.name.startswith(prefixes)): + raise ValueError('Unsafe, duplicate or foreign Kontrol compiler output') + data = archive.extractfile(member).read() + if A.digest(data) != manifest.get(member.name): raise ValueError('Corrupt original Kontrol compiler output') + files[member.name] = data + if not files or files.keys() != manifest.keys(): raise ValueError('Incomplete original Kontrol compiler archive') + return files + + +def report(directory, provider, sha): + final = G.read(directory / 'final.json'); hashes = final['original_sha256']; empty = [] + required = {'settings.json','selection.json','coverage.json','inputs-after.json','submodules.txt','runtime-image.json', + 'config.json','config.log','config.stage.json','summaries.log','summaries.stage.json','proofs.log','proofs.stage.json'} + required |= {phase + '-compiler/' + name for phase in COMPILER_PHASES for name in ('files.json','files.tar.gz')} + if final['exit_code'] or final['report_errors'] or not required <= hashes.keys(): raise ValueError('Failed or incomplete original Kontrol workload') + if 'final.json' in hashes: raise ValueError('Self-sealed original report manifest') + E.verify_files(directory, hashes, required=required, + missing_empty=empty if provider == 'circleci' else None, label=None) + if K.seal(directory).keys() != hashes.keys() | {'final.json'}: raise ValueError('Extra or unsealed original Kontrol report') + settings = G.read(directory / 'settings.json'); root = settings['workspace_root'] + if (settings['suite'],settings['source_sha'],settings['provider']) != ('kontrol-build',sha,provider): + raise ValueError('Wrong original Kontrol suite/source/provider') + if (not settings['branch'] or settings['profile'] != 'default' or settings['rerun_fails'] != 0 + or set(settings['environment']) != set(K.ENVIRONMENT) or settings['image'] != K.IMAGE.selection() + or settings['kontrol_version'] != 'Kontrol version: ' + settings['image']['version']): + raise ValueError('Changed original Kontrol settings, retries or image') + if provider == 'rwx' and (not settings['rwx_run_id'] or str(settings['rwx_task_attempt']) != '1'): + raise ValueError('Missing native Kontrol identity or unexpected retry') + if K.SUBMODULES.revisions((directory / 'submodules.txt').read_text()) != settings['submodules']: + raise ValueError('Changed original Kontrol submodule selection') + selected = G.read(directory / 'selection.json'); before = settings['input_sha256'] + proofs = {n:h for n,h in before.items() if n.startswith(K.PROOFS + '/') and n.endswith('.sol')} + expected = {'authority':'just kontrol-summary-full; just forge-build ./test/kontrol/proofs','variants':['default','fault-proofs'], + 'proof_sources':proofs,'generated':K.GENERATED,'tests':0} + if selected != expected or not proofs or not set(sum(K.GENERATED.values(),[])) <= proofs.keys(): + raise ValueError('Missing, extra or changed complete Kontrol proof discovery') + source_names = {str(p.relative_to(directory / 'source')) for p in (directory / 'source').rglob('*') if p.is_file()} + if source_names != set(K.SOURCES) | proofs.keys(): raise ValueError('Incomplete original Kontrol source selection') + for name in source_names: + if K.S.digest(directory / 'source' / name) != before.get(name): raise ValueError('Kontrol source differs from bound revision input') + if {p.name.removesuffix('.stage.json') for p in directory.glob('*.stage.json')} != {'config',*K.COMMANDS}: + raise ValueError('Missing original Kontrol command or extra retry') + for name, argv in {'config':['forge','config','--json'],**K.COMMANDS}.items(): + stage = G.read(directory / (name + '.stage.json')) + if (stage['argv'] != argv or stage['cwd'] != root + '/packages/contracts-bedrock' or stage['exit_code'] != 0 + or stage.get('stdin') != 'devnull' or stage['log_sha256'] != K.S.digest(directory / (name + '.log'))): + raise ValueError('Changed or failed original Kontrol invocation') + for variant in selected['variants']: + base = directory / 'variants' / variant + if sorted(p.name for p in base.iterdir()) != ['deployment','generated','load-inputs']: + raise ValueError('Missing or extra original Kontrol capture phase') + names_file = 'packages/contracts-bedrock/deployments/kontrol' + ('-fp' if variant == 'fault-proofs' else '') + '.json' + summary = 'DeploymentSummary' + ('FaultProofs' if variant == 'fault-proofs' else '') + load = ['kontrol','load-state','--from-state-diff',summary,'snapshots/state-diff/Kontrol-31337.json', + '--contract-names',names_file.removeprefix('packages/contracts-bedrock/') + 'Reversed', + '--output-dir','test/kontrol/proofs/utils','--license','MIT'] + for phase in ('deployment','load-inputs','generated'): + row = G.read(base / phase / 'manifest.json'); names = ['packages/contracts-bedrock/snapshots/state-diff/Kontrol-31337.json',names_file] + if phase != 'deployment': names += [names_file + 'Reversed'] + if phase == 'generated': names += K.GENERATED[variant] + if (row != {'variant':variant,'phase':phase,'source_sha':sha,'profile':'default','load_state_argv':load, + 'files':K.seal(base / phase / 'files')} or set(row['files']) != set(names)): + raise ValueError('Wrong source, settings or original Kontrol phase inventory') + for name in K.GENERATED[variant]: + if (directory / 'generated' / name).read_bytes() != (base / 'generated/files' / name).read_bytes(): + raise ValueError('Final Kontrol summary differs from original generated bytes') + if sorted(p.name for p in (directory / 'variants').iterdir()) != selected['variants']: + raise ValueError('Missing or extra original Kontrol summary variant') + after = G.read(directory / 'inputs-after.json'); generated = set(sum(K.GENERATED.values(),[])) + if after.keys() != before.keys(): raise ValueError('Missing tracked Kontrol input after execution') + changes = {n:{'before':before[n],'after':after[n]} for n in before if before[n] != after[n]} + if set(changes) - generated or any(after[n] != K.S.digest(directory / 'generated' / n) for n in generated): + raise ValueError('Kontrol execution changed unrelated inputs or generated wrong final bytes') + coverage = {'tests':0,'variants':selected['variants'],'proof_sources':len(proofs),'generated_files':4, + 'tracked_generated_changes':changes,'complete_original_commands':True} + if G.read(directory / 'coverage.json') != coverage: raise ValueError('False original Kontrol workload coverage') + image_metadata = G.read(directory / 'image/metadata.json') + if (image_metadata['selection'] != settings['image'] or image_metadata['kontrol_version'] != settings['kontrol_version'] + or image_metadata['input_sha256'] != {n:before[n] for n in ('mise.toml','ops/ci/runtime/kontrol-image.json','ops/ci/runtime/kontrol-image.py')}): + raise ValueError('Stale original Kontrol image producer') + for name, value in image_metadata['original_sha256'].items(): + if name not in ('inputs.json','inspect.json','pull.log','pull-attempts.json') or K.S.digest(directory / 'image' / name) != value: + raise ValueError('Corrupt original Kontrol image producer') + if set(image_metadata['original_sha256']) != {'inputs.json','inspect.json','pull.log','pull-attempts.json'}: + raise ValueError('Incomplete original Kontrol image preparation') + if G.read(directory / 'image/inputs.json') != {'selection':settings['image'],'input_sha256':image_metadata['input_sha256']}: + raise ValueError('Changed original Kontrol image preparation selection') + image = G.read(directory / 'runtime-image.json') + K.IMAGE.validate_inspection(image) + K.IMAGE.validate_inspection(G.read(directory / 'image/inspect.json')) + files = {phase:compiler(directory / (phase + '-compiler')) for phase in COMPILER_PHASES} + if provider == 'rwx': + producer = directory / 'dependencies/contracts-kontrol'; metadata = G.read(producer / 'metadata.json') + if (metadata['version'] != 1 or metadata['kind'] != 'contracts-kontrol' or metadata['commit_sha'] != sha + or metadata['settings'] != G.ARTIFACTS.SETTINGS['contracts-kontrol'] or metadata['mise_sha256'] != before['mise.toml'] + or metadata['tool_versions']['forge'] != settings['tools']['forge']): + raise ValueError('Wrong Kontrol contract producer revision/settings/toolchain') + K.helper('kontrol-contracts').verify(producer,sha,before) + original_inputs = A.archive(producer / 'files.tar.gz',metadata) + if any(original_inputs.get(n) != data for n,data in files['initial'].items()): + raise ValueError('Initial Kontrol compiler inputs differ from verified contract producer') + if files['proofs'] != files['final']: raise ValueError('Kontrol compiler outputs changed after the original build') + graph_paths = {p for prefix in ('packages/contracts-bedrock/artifacts/build-info/','packages/contracts-bedrock/forge-artifacts/build-info/') + for row in A.build_info(files['proofs'],prefix) for p in row['source_files']} + if not {n.removeprefix('packages/contracts-bedrock/') for n in proofs} <= graph_paths: + raise ValueError('Kontrol build did not retain every selected proof source graph') + return {'settings':settings,'selection':selected,'coverage':coverage,'files':files,'image':image[0], + 'hashes':hashes,'declared_empty':empty} + + +def compare_compiler(x,y,roots,history=((),())): + prefixes = ('packages/contracts-bedrock/artifacts/build-info/','packages/contracts-bedrock/forge-artifacts/build-info/') + inventories = [compiler_bindings(files,earlier) for files,earlier in zip((x,y),history)] + if inventories[0]['bindings'].keys() != inventories[1]['bindings'].keys(): + raise ValueError('Complete Kontrol logical compiler inventories differ') + retained = [{(tuple(row['logical_key']),row['bound_phase']):row for row in value['retained']} for value in inventories] + if retained[0].keys() != retained[1].keys(): + raise ValueError('Complete Kontrol retained compiler inventories differ') + artifact_paths = [set(value['bindings'].values()) | {row['path'] for row in value['retained']} for value in inventories] + other = [{n for n in files if not n.startswith(prefixes)} - paths for files,paths in zip((x,y),artifact_paths)] + if other[0] != other[1]: raise ValueError('Complete Kontrol non-artifact compiler inventories differ') + for prefix in prefixes: + if A.build_info(x,prefix) != A.build_info(y,prefix): raise ValueError('Complete Kontrol compiler source graphs differ') + counts = Counter(); contracts = 0; aliases = [] + for key in sorted(inventories[0]['bindings']): + names = [value['bindings'][key] for value in inventories] + A.contract(json.loads(x[names[0]],object_pairs_hook=G.C.no_duplicate_keys), + json.loads(y[names[1]],object_pairs_hook=G.C.no_duplicate_keys),roots,counts) + contracts += 1 + if names[0] != names[1]: aliases.append({'logical_key':list(key),'circle':names[0],'rwx':names[1]}) + for key,phase in sorted(retained[0]): + names = [value[(key,phase)]['path'] for value in retained] + A.contract(json.loads(x[names[0]],object_pairs_hook=G.C.no_duplicate_keys), + json.loads(y[names[1]],object_pairs_hook=G.C.no_duplicate_keys),roots,counts) + contracts += 1 + if names[0] != names[1]: + aliases.append({'logical_key':list(key),'bound_phase':phase,'circle':names[0],'rwx':names[1]}) + for name in sorted(other[0]): + if name.startswith(prefixes): continue + if name == 'packages/contracts-bedrock/cache/solidity-files-cache.json': + if A.normalize(A.cache_inputs(inventories[0]['cache']),roots[0]) != A.normalize(A.cache_inputs(inventories[1]['cache']),roots[1]): + raise ValueError('Kontrol compiler content/configuration cache differs') + elif x[name] != y[name]: raise ValueError('Unresolved original Kontrol compiler file difference: ' + name) + return {'contract_artifacts':contracts,'resolved_metadata_differences':dict(counts), + 'verified_artifact_path_aliases':aliases,'complete_logical_inventory_equal':True, + 'verified_retained_previous_artifacts':{p:value['retained'] for p,value in zip(('circle','rwx'),inventories)}} + + +def compiler_bindings(files,history=()): + """Bind every current or retained artifact to its original cache identity. + + Foundry can keep an unqualified filename when another compiler/profile is + added later. Account for that filename only after checking every complete + payload, compiler graph and cache setting; do not discard any output. + Summary generation invalidates cache references before the final compile. + Such retained outputs must have the exact bytes and a validated identity + from the immediately preceding original phase. A newly compiled payload can + replace that logical identity while the old qualified filename remains. + Its original bound phase distinguishes the two; both payloads stay required. + """ + prefix = 'packages/contracts-bedrock/forge-artifacts/' + cache = copy.deepcopy(json.loads(files['packages/contracts-bedrock/cache/solidity-files-cache.json'], + object_pairs_hook=G.C.no_duplicate_keys)) + selected = {n for n in files if n.startswith(prefix) and n.endswith('.json') and not n.startswith(prefix+'build-info/')} + bindings = {}; paths = set() + for source,row in cache['files'].items(): + if row['sourceName'] != source: raise ValueError('Kontrol compiler cache source identity differs') + for name,versions in row['artifacts'].items(): + for version,profiles in versions.items(): + for profile,artifact in profiles.items(): + key = (source,name,version,profile); relative = Path(artifact['path']) + path = prefix + artifact['path'] + filenames = {name+'.json',name+'.'+version+'.json',name+'.'+profile+'.json',name+'.'+version+'.'+profile+'.json'} + if (relative.is_absolute() or '..' in relative.parts or path not in selected + or relative.name not in filenames or path in paths or key in bindings): + raise ValueError('Missing, duplicate or unsafe Kontrol logical artifact binding') + value = json.loads(files[path],object_pairs_hook=G.C.no_duplicate_keys) + metadata = value.get('metadata') + if metadata is not None: + if (metadata['compiler']['version'].split('+',1)[0] != version + or metadata['settings']['compilationTarget'] != {source:name}): + raise ValueError('Kontrol artifact payload differs from its compiler cache identity') + bindings[key] = path; paths.add(path) + artifact['path'] = {'source':source,'contract':name,'compiler':version,'profile':profile} + retained = [] + if selected - paths: + if not history: raise ValueError('Extra or unbound original Kontrol compiler artifacts') + previous = history[-1] + earlier = compiler_bindings(previous,history[:-1]) + identities = {path:(key,len(history)-1) for key,path in earlier['bindings'].items()} + identities.update({row['path']:(tuple(row['logical_key']),row['bound_phase']) for row in earlier['retained']}) + retained_keys = set() + for path in sorted(selected - paths): + if path not in identities or previous[path] != files[path] or identities[path] in retained_keys: + raise ValueError('Changed, duplicate or unbound retained Kontrol compiler artifact') + key,phase = identities[path]; paths.add(path); retained_keys.add((key,phase)) + retained.append({'path':path,'logical_key':list(key),'bound_phase':phase,'sha256':A.digest(files[path])}) + if not bindings or paths != selected: raise ValueError('Extra or unbound original Kontrol compiler artifacts') + return {'bindings':bindings,'cache':cache,'retained':retained} + + +def compare(directory,sha): + if not re.fullmatch('[0-9a-f]{40}',sha): raise ValueError('Expected full Kontrol benchmark SHA') + a,b = (report(directory / p,provider,sha) for p,provider in [('circle','circleci'),('rwx','rwx')]) + for key in ('source_sha','branch','input_sha256','submodules','profile','environment','rerun_fails','image','kontrol_version','tools'): + if a['settings'][key] != b['settings'][key]: raise ValueError('Original Kontrol settings differ: ' + key) + if a['selection'] != b['selection'] or a['coverage'] != b['coverage']: raise ValueError('Complete Kontrol selection or tracked changes differ') + roots = [r['settings']['workspace_root'] for r in (a,b)] + if A.normalize(G.read(directory / 'circle/config.json'),roots[0]) != A.normalize(G.read(directory / 'rwx/config.json'),roots[1]): + raise ValueError('Complete original Kontrol compiler configuration differs') + for key in ('RootFS','Config','Architecture','Os','Created'): + if a['image'][key] != b['image'][key]: raise ValueError('Original immutable Kontrol image differs: ' + key) + for prefix in ('variants/','generated/','runtime-outputs/'): + x = {n:h for n,h in a['hashes'].items() if n.startswith(prefix)} + y = {n:h for n,h in b['hashes'].items() if n.startswith(prefix)} + if x != y: raise ValueError('Complete original Kontrol generated/state/output files differ: ' + prefix) + counts = {}; history = ([],[]) + for phase in COMPILER_PHASES: + current = (a['files'][phase],b['files'][phase]) + counts[phase] = compare_compiler(*current,roots,history) + for earlier,files in zip(history,current): earlier.append(files) + return {'source_sha':sha,'verified_parity':True,'native_run_id':b['settings']['rwx_run_id'], + 'selection':a['selection'],'coverage':a['coverage'],'compiler_phases':counts, + 'docker_versions':{p:r['settings']['docker_version'] for p,r in [('circle',a),('rwx',b)]}, + 'immutable_image':a['settings']['image'],'docker_image_ids':{p:r['image']['Id'] for p,r in [('circle',a),('rwx',b)]}, + 'original_sha256':{'circle':a['hashes'],'rwx':b['hashes']}, + 'circle_manifest_declared_empty':a['declared_empty']} + + +if __name__ == '__main__': + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument('directory',type=Path); parser.add_argument('--sha',required=True); parser.add_argument('--output',required=True,type=Path) + args = parser.parse_args(); result = compare(args.directory,args.sha); K.S.write(args.output,result) + print({k:result[k] for k in ('source_sha','verified_parity','coverage','compiler_phases')}) diff --git a/ops/ci/migration/compare-main-checks.py b/ops/ci/migration/compare-main-checks.py new file mode 100644 index 00000000000..bfac216c229 --- /dev/null +++ b/ops/ci/migration/compare-main-checks.py @@ -0,0 +1,174 @@ +#!/usr/bin/env python3 +"""Compare complete original Main-validator commands, inputs and discoveries.""" +import argparse +import importlib.util +import json +from pathlib import Path +_SPEC_E = importlib.util.spec_from_file_location('report_evidence', Path(__file__).with_name('report-evidence.py')) +E = importlib.util.module_from_spec(_SPEC_E); _SPEC_E.loader.exec_module(E) +import re +import tomllib +import xml.etree.ElementTree as ET + +def helper(name): + spec = importlib.util.spec_from_file_location(name, (Path(__file__).parent if name.startswith('compare-') or name in ('flaky-report','selector-upload','selector-registry') else Path(__file__).resolve().parents[1] / 'runtime') / (name + '.py')) + module = importlib.util.module_from_spec(spec); spec.loader.exec_module(module) + return module + +MAIN = helper('main-checks') +REPORT = helper('ci-report') + + +def source_files(directory, settings, expected): + root = directory / 'source' + actual = {str(p.relative_to(root)) for p in root.rglob('*') if p.is_file()} + if actual != set(expected): raise ValueError('Missing or extra original Main source bytes') + for name in actual: + p = root / name + if p.is_symlink() or MAIN.STAGES.digest(p) != settings['input_sha256'].get(name): + raise ValueError('Original Main source bytes differ from complete inputs') + return root + + +def superchain(directory, selected, settings, provider): + root = directory / 'dependencies' + bundle = root / 'superchain-configs.zip'; pin = root / 'superchain-configs.zip.sha256' + expected = pin.read_text().split()[0] + if not re.fullmatch('[0-9a-f]{64}', expected) or MAIN.STAGES.digest(bundle) != expected or \ + MAIN.STAGES.digest(pin) != settings['input_sha256'][MAIN.BUNDLE + '.sha256']: + raise ValueError('Missing or corrupt original pinned superchain bundle') + identity = {'source_sha':settings['source_sha'], 'registry_revision':settings['input_sha256']['superchain-registry']['gitlink'], + 'sha256':expected,'expected_sha256':expected, + 'input_sha256':{name:settings['input_sha256'][name] for name in MAIN.BUNDLE_INPUTS}, + 'tools':{name:settings['tools'][name] for name in ('go','just','jq','yq')}} + if selected != identity: raise ValueError('Wrong superchain source, inputs or tools') + if provider == 'rwx': + root = directory / 'producer'; manifest = json.loads((root / 'manifest.json').read_text()) + if manifest['exit_code'] or manifest['report_errors'] or set(manifest['original_sha256']) != \ + {'bundle.json','coverage.json','superchain.log','superchain.stage.json'}: + raise ValueError('Failed or incomplete reusable superchain producer') + for name, value in manifest['original_sha256'].items(): + if MAIN.STAGES.digest(root / name) != value: raise ValueError('Corrupt original superchain producer') + if json.loads((root / 'bundle.json').read_text()) != identity or \ + json.loads((root / 'coverage.json').read_text()) != {'tests':0,'verified_bundle':True}: + raise ValueError('Wrong original reusable superchain binding') + stage = json.loads((root / 'superchain.stage.json').read_text()) + if (stage['argv'],stage['cwd'],stage['exit_code'],stage.get('stdin')) != \ + (['just','build-superchain-go'],settings['workspace_root'],0,'devnull'): + raise ValueError('Wrong original reusable superchain command') + + +def report(directory, job, sha, provider, empty): + required = {'settings.json', 'selection.json', 'coverage.json', 'check.stage.json', 'check.log', 'check.junit.xml', 'inputs-after.json'} + final = REPORT.read(directory / 'final.json') + if final['exit_code'] != 0 or final['report_errors']: + raise ValueError('Failed or incomplete original Main check report') + hashes = E.verify_files(directory, final['original_sha256'], required=required, + missing_empty=empty if provider == 'circle' else None, label=provider + '/' + job) + if {str(p.relative_to(directory)) for p in directory.rglob('*') if p.is_file() and p.name != 'final.json'} != set(hashes): + raise ValueError('Unsealed or missing original Main report files') + settings = json.loads((directory / 'settings.json').read_text()) + if (settings['source_sha'], settings['job'], settings['provider']) != (sha, job, 'circleci' if provider == 'circle' else 'rwx'): + raise ValueError('Wrong Main source, job or provider') + if provider == 'rwx' and (not settings['rwx_run_id'] or str(settings['rwx_task_attempt']) != '1'): + raise ValueError('Main verdict is reused or a retry requires investigation') + if not settings['input_sha256']: raise ValueError('Missing complete Main source inputs') + if json.loads((directory / 'inputs-after.json').read_text()) != settings['input_sha256']: + raise ValueError('Original Main command changed tracked inputs') + if job in MAIN.GO_JOBS and settings['go_environment'] != json.loads((directory / 'go-env.json').read_text()): + raise ValueError('Go environment differs from original') + selected = json.loads((directory / 'selection.json').read_text()) + expected_coverage = {'job': job, 'outcome': 'pass', 'attempts': 1, 'complete_selection': True, 'command': (['bash','.circleci/scripts/check-l2-chains-sync.sh'] if job=='l2-chains-sync-check' else MAIN.COMMANDS[job])} + if json.loads((directory / 'coverage.json').read_text()) != expected_coverage: raise ValueError('Wrong original Main coverage') + suite = ET.parse(directory / 'check.junit.xml').getroot(); junit = list(suite.iter('testcase')) + if suite.attrib != {'name': 'main-checks', 'tests': '1', 'failures': '0'} or len(junit) != 1 or \ + junit[0].attrib != {'name': job, 'classname': 'main-checks'} or list(junit[0]): + raise ValueError('Missing or failed original Main JUnit') + expected = {'check': (['bash','.circleci/scripts/check-l2-chains-sync.sh'] if job=='l2-chains-sync-check' else MAIN.COMMANDS[job])} + if job in MAIN.GO_JOBS: expected['go-env'] = ['go', 'env', '-json', 'GOOS', 'GOARCH', 'CGO_ENABLED', 'GOFLAGS', 'GOTOOLCHAIN'] + if job in MAIN.MOCKS: + expected.update(superchain=['just','build-superchain-go'], packages=['go', 'list', '-tags=generate', '-json', './...'], generators=['go', 'generate', '-n', '-v', './...']) + superchain(directory, selected['superchain'], settings, provider) + component = MAIN.MOCKS[job] + rows = MAIN.PR.objects((directory / 'packages.json').read_text()) + names = {name for name in settings['input_sha256'] if name.startswith(component + '/') and name.endswith('.go')} + root = source_files(directory, settings, names) + discovered = MAIN.packages((directory / 'packages.json').read_text(), component, + settings['workspace_root'], root) + if selected['component'] != component or discovered != selected['packages']: + raise ValueError('Generation selection differs from original packages and source directives') + before = {name: MAIN.STAGES.digest(root / name) for name in names + if re.search(rb'^// Code generated .*DO NOT EDIT\.', (root / name).read_bytes(), re.M)} + if not before or before != selected['generated_before'] or json.loads((directory / 'generated.json').read_text()) != before: + raise ValueError('Original generated mocks changed or selection is incomplete') + elif job == 'opgeth-ratchet': + expected['superchain'] = ['just', 'build-superchain-go'] + superchain(directory, selected['superchain'], settings, provider) + names = {n for n in settings['input_sha256'] if n == 'justfile' or n.startswith('ops/scripts/opgeth-ratchet/')} + root = source_files(directory, settings, names) + if not names or selected['inputs'] != {n: MAIN.STAGES.digest(root/n) for n in names}: + raise ValueError('Incomplete original op-geth ratchet inputs') + elif job == 'check-nut-locks': + expected['fetch-develop'] = ['git', 'fetch', '--no-tags', 'origin', '+refs/heads/develop:refs/remotes/origin/develop'] + if not selected['locks'] or not re.fullmatch('[0-9a-f]{40}', selected['develop_sha']): raise ValueError('Missing original NUT locks or protected ancestry') + names = {name for name in settings['input_sha256'] if re.fullmatch(r'op-core/nuts/(bundles/[^/]+_nut_bundle.json|state/[^/]+_state.json|fork_lock.toml)', name)} + root = source_files(directory, settings, names) + if MAIN.nut_selection(root, selected['develop_sha']) != selected: raise ValueError('NUT selection differs from original complete inputs') + elif job == 'check-op-geth-version': + expected['go-mod'] = ['go', 'mod', 'edit', '-json'] + source_files(directory, settings, ['go.mod']) + if selected != json.loads((directory / 'go-mod.json').read_text()): raise ValueError('Module selection differs from original') + elif job == 'op-deployer-forge-version': + expected['mise-config'] = ['yq', '-o=json', '.', 'mise.toml'] + root = source_files(directory, settings, ['mise.toml', 'op-deployer/pkg/deployer/forge/version.json']) + pin = tomllib.loads((root / 'mise.toml').read_text())['tools']['forge'] + if pin != json.loads((directory / 'mise-config.json').read_text())['tools']['forge'] or \ + selected != {'mise_forge':pin, 'deployer':json.loads((root / 'op-deployer/pkg/deployer/forge/version.json').read_text())}: + raise ValueError('Forge version selection differs from original') + elif job == 'l2-chains-sync-check': + expected['configuration'] = ['yq', '-o=json', '.', '.circleci/continue/main.yml'] + root = source_files(directory, settings, ['.circleci/continue/main.yml', '.circleci/l2-rpcs.json']) + discovery = E.helper('l2-chains-sync-check').l2_selection(json.loads((directory / 'configuration.json').read_text()), + json.loads((root / '.circleci/l2-rpcs.json').read_text())) + if selected != discovery or discovery['rpc_chains'] != discovery['matrix_chains']: + raise ValueError('L2 chain selection differs from original complete configuration') + else: + if not selected['files'] or selected['check_closed'] is not False or selected['near_misses']: raise ValueError('Incomplete or unsuccessful TODO discovery') + if sorted((directory / 'files.log').read_text().splitlines()) != selected['files'] or \ + sorted((directory / 'todos.log').read_text().splitlines()) != selected['todos'] or \ + sorted((directory / 'near-misses.log').read_text().splitlines()) != selected['near_misses']: + raise ValueError('TODO selection differs from complete original scans') + for name in ('files', 'todos', 'near-misses'): + row = json.loads((directory / (name + '.stage.json')).read_text()) + if row['exit_code'] not in (0, 1) or row['cwd'] != settings['workspace_root']: raise ValueError('Failed original TODO discovery') + expected.update(MAIN.TODO_DISCOVERY) + stages = {p.name.removesuffix('.stage.json') for p in directory.glob('*.stage.json')} + if stages != set(expected): raise ValueError('Missing original command or unexplained Main retry') + for name, argv in expected.items(): + row = json.loads((directory / (name + '.stage.json')).read_text()) + allowed = (0, 1) if name in ('todos','near-misses') else (0,) + relative = MAIN.MOCKS[job] if job in MAIN.MOCKS and name in ('packages','generators') else 'op-deployer' if job == 'op-deployer-forge-version' and name == 'check' else '' + cwd = str(Path(settings['workspace_root']) / relative) + if row['argv'] != argv or row['exit_code'] not in allowed or row['cwd'] != cwd or row.get('stdin') != 'devnull': + raise ValueError('Wrong or failed original Main command') + return {'settings':settings, 'selection':selected, 'coverage':expected_coverage, 'original_sha256':hashes, + 'commands':expected, 'generator_plan':(directory/'generators.log').read_text() if job in MAIN.MOCKS else None} + + +def compare(directories, job, sha): + if not re.fullmatch('[0-9a-f]{40}', sha): raise ValueError('Expected full Main benchmark revision') + empty = []; data = {p:report(d,job,sha,p,empty) for p,d in directories.items()}; a,b = data['circle'],data['rwx'] + for key in ('source_sha','job','branch','tools','input_sha256','go_environment'): + if a['settings'].get(key) != b['settings'].get(key): raise ValueError('Main settings differ at ' + key) + for key in ('selection','coverage','commands','generator_plan'): + if a[key] != b[key]: raise ValueError('Complete original Main parity differs at ' + key) + return {'source_sha':sha,'job':job,'verified_parity':True,'selection':a['selection'],'coverage':a['coverage'], + 'settings':{p:d['settings'] for p,d in data.items()},'commands':a['commands'], + 'original_sha256':{p:d['original_sha256'] for p,d in data.items()},'manifest_declared_empty_logs':empty} + + +if __name__ == '__main__': + p=argparse.ArgumentParser(description=__doc__);p.add_argument('--circle',type=Path,required=True);p.add_argument('--rwx',type=Path,required=True) + p.add_argument('--sha',required=True);p.add_argument('--job',choices=MAIN.COMMANDS,required=True);p.add_argument('--output',type=Path,required=True) + a=p.parse_args();result=compare({'circle':a.circle,'rwx':a.rwx},a.job,a.sha);MAIN.STAGES.write(a.output,result) + print(json.dumps({'source_sha':a.sha,'job':a.job,'verified_parity':True})) diff --git a/ops/ci/migration/compare-nut-prefork.py b/ops/ci/migration/compare-nut-prefork.py new file mode 100644 index 00000000000..fcf536a295a --- /dev/null +++ b/ops/ci/migration/compare-nut-prefork.py @@ -0,0 +1,160 @@ +#!/usr/bin/env python3 +"""Verify complete original pre-fork generation parity on one source revision.""" +import argparse +import importlib.util +import json +from pathlib import Path +_SPEC_E = importlib.util.spec_from_file_location('report_evidence', Path(__file__).with_name('report-evidence.py')) +E = importlib.util.module_from_spec(_SPEC_E); _SPEC_E.loader.exec_module(E) +import re +import tempfile + +import importlib.util + +SPEC = importlib.util.spec_from_file_location('nut_prefork', Path(__file__).resolve().parents[1] / 'runtime' / 'nut-prefork.py') +N = importlib.util.module_from_spec(SPEC); SPEC.loader.exec_module(N) +SPEC = importlib.util.spec_from_file_location('cannon_compare', Path(__file__).with_name('compare-cannon-go.py')) +C = importlib.util.module_from_spec(SPEC); SPEC.loader.exec_module(C) +G = N.G +REQUIRED = {'settings.json', 'selection.json', 'coverage.json', 'generated.json', 'inputs-after.json', + 'packages.json', 'packages.log', 'packages.stage.json', 'list.json', 'list.log', 'list.stage.json', + 'check.log', 'check.stage.json', 'native.junit.xml', 'native.metadata.json'} + + +def stage(directory, name, argv, root): + row = G.read(directory / (name + '.stage.json')) + if row['argv'] != argv or row['cwd'] != root or row['exit_code'] != 0 or row.get('stdin') != 'devnull': + raise ValueError('Changed or failed original pre-fork command: ' + name) + if row['log_sha256'] != N.S.digest(directory / (name + '.log')): raise ValueError('Corrupt pre-fork stage log') + return C.normalize({k: row[k] for k in ('argv', 'cwd', 'exit_code')}, root) + + +def report(directory, provider, sha): + final = G.read(directory / 'final.json'); hashes = final['original_sha256']; empty = [] + if final['exit_code'] != 0 or final['report_errors'] or not REQUIRED <= hashes.keys(): + raise ValueError('Failed or incomplete original pre-fork report') + if 'final.json' in hashes: raise ValueError('Self-sealed original report manifest') + E.verify_files(directory, hashes, required=REQUIRED, + missing_empty=empty if provider == 'circleci' else None, label=None) + if {str(p.relative_to(directory)) for p in directory.rglob('*') if p.is_file() and p.name != 'final.json'} != set(hashes): + raise ValueError('Unsealed or missing original pre-fork input') + settings = G.read(directory / 'settings.json'); root = settings['workspace_root'] + if (settings['suite'], settings['source_sha'], settings['provider']) != ('nut-prefork', sha, provider): + raise ValueError('Wrong original pre-fork suite, source or provider') + if not settings['branch'] or settings['go_environment']['GOFLAGS']: raise ValueError('Missing branch or unaccounted Go flags') + if provider == 'rwx' and (not settings['rwx_run_id'] or str(settings['rwx_task_attempt']) != '1'): + raise ValueError('Missing original pre-fork native identity or unexpected retry') + if G.read(directory / 'inputs-after.json') != settings['input_sha256']: raise ValueError('Original pre-fork inputs changed') + selected = N.select_states(directory / 'source') + packages = N.package_selection((directory / 'packages.json').read_text(), root, directory / 'source') + selected['packages'] = packages; selected['initial_tests'] = G.listing(directory / 'list.json', packages) + for row in packages: + if any(settings['input_sha256'].get(k) != v for k, v in row['files'].items()): + raise ValueError('Pre-fork package differs from bound source inputs') + names = {n for row in packages for n in row['files']} | {r['path'] for r in selected['states'].values()} + names |= {'justfile', 'ops/ci/runtime/nut-prefork-test.sh'} + actual_source = {str(p.relative_to(directory / 'source')) for p in (directory / 'source').rglob('*') if p.is_file()} + if actual_source != names: raise ValueError('Incomplete or extra original pre-fork source selection') + for name in names: + if N.S.digest(directory / 'source' / name) != settings['input_sha256'].get(name): + raise ValueError('Pre-fork source bytes differ from complete input seal') + bundle = directory / 'dependencies/superchain-configs.zip' + pin = directory / 'dependencies/superchain-configs.zip.sha256' + digest = pin.read_text().split()[0] + if not re.fullmatch('[0-9a-f]{64}', digest) or N.S.digest(bundle) != digest: + raise ValueError('Corrupt original pre-fork superchain bundle') + if N.S.digest(pin) != settings['input_sha256'][N.MAIN.BUNDLE + '.sha256']: + raise ValueError('Wrong pre-fork superchain checksum input') + original_selected = G.read(directory / 'selection.json') + selected['superchain'] = original_selected['superchain'] + identity = selected['superchain'] + if (identity['source_sha'] != sha or identity['sha256'] != digest or identity['expected_sha256'] != digest + or identity['registry_revision'] != settings['input_sha256']['superchain-registry']['gitlink'] + or identity['input_sha256'] != {k:settings['input_sha256'][k] for k in N.MAIN.BUNDLE_INPUTS} + or identity['tools']['go'] != settings['tool_versions']['go'] + or identity['tools']['just'] != settings['tool_versions']['just']): + raise ValueError('Wrong original pre-fork bundle provenance') + if original_selected != selected or G.read(directory / 'generated.json') != N.select_states(directory / 'source'): + raise ValueError('Pre-fork discovery or generated state bytes differ') + commands = {name: stage(directory, name, argv, root) for name, argv in [ + ('packages', ['go', 'list', '-e', '-json', './' + N.PACKAGE_DIR + '/']), + ('list', ['go', 'test', '-json', '-count=1', '-list', N.PATTERN, './' + N.PACKAGE_DIR + '/']), + ('check', ['just', '_check-nut-prefork-states'])]} + if {p.name.removesuffix('.stage.json') for p in directory.glob('*.stage.json')} != set(commands): + raise ValueError('Missing pre-fork command or unexplained retry') + actual = sorted(p.name for p in (directory / 'forks').iterdir()) + if actual != selected['forks']: raise ValueError('Pre-fork assignment differs from complete original discovery') + coverage = {} + for fork in actual: + child = directory / 'forks' / fork + argv = [str(Path(root) / 'ops/scripts/gotestsum-split.sh'), '--format=testname', + '--junitfile=' + str(Path(root) / '.ci/nut-prefork/run/forks' / fork / 'junit.xml'), + '--jsonfile=' + str(Path(root) / '.ci/nut-prefork/run/forks' / fork / 'original.json'), '--', *N.FLAGS] + commands[fork] = stage(child, 'tests', argv, root) + if {p.name for p in child.glob('*.stage.json')} != {'tests.stage.json'}: raise ValueError('Unexpected pre-fork retry') + coverage[fork] = G.observed(child, packages, selected['initial_tests']) + if coverage[fork]['package_failures'] or coverage[fork]['outcomes'].get('fail') or coverage[fork]['outcomes'].get('skip'): + raise ValueError('Original pre-fork generation failed or skipped') + with tempfile.TemporaryDirectory() as temp: + output = Path(temp) / 'native.json'; G.PROJECT.project(child / 'original.json', output) + for name in ('native.json', 'native.metadata.json'): + if N.S.digest(Path(temp) / name) != N.S.digest(child / name): raise ValueError('Changed pre-fork native projection') + expected = {'forks':coverage, 'attempts_per_fork':1, + 'outcomes':dict(N.Counter(c['outcome'] for body in coverage.values() for c in body['cases']))} + if expected != G.read(directory / 'coverage.json'): raise ValueError('Original pre-fork coverage differs from events') + with tempfile.TemporaryDirectory() as temp: + target = Path(temp); (target / 'forks').symlink_to(directory.resolve() / 'forks', target_is_directory=True) + N.native_junit(target, actual) + for name in ('native.junit.xml', 'native.metadata.json'): + if N.S.digest(target / name) != N.S.digest(directory / name): raise ValueError('Changed native pre-fork grouping') + dependencies = {} + if provider == 'rwx': + for kind in ('go-modules', 'contracts'): + row = G.read(directory / 'dependencies' / (kind + '.json')) + if (row['kind'] != kind or row['commit_sha'] != sha or row['settings'] != G.ARTIFACTS.SETTINGS[kind] + or row['mise_sha256'] != settings['input_sha256']['mise.toml'] or not row['files'] + or any(settings['tool_versions'].get(k) != v for k,v in row['tool_versions'].items())): + raise ValueError('Stale or mismatched pre-fork runtime artifact') + dependencies[kind] = row + producer = directory / 'producer'; final = G.read(producer / 'manifest.json') + if final['exit_code'] != 0 or final['report_errors'] or set(final['original_sha256']) != {'bundle.json','coverage.json','superchain.log','superchain.stage.json'}: + raise ValueError('Incomplete pre-fork superchain producer') + for name, value in final['original_sha256'].items(): + if N.S.digest(producer / name) != value: raise ValueError('Corrupt original pre-fork superchain producer') + if G.read(producer / 'bundle.json') != identity or G.read(producer / 'coverage.json') != {'tests':0,'verified_bundle':True}: + raise ValueError('Wrong pre-fork superchain producer identity') + producer_stage = G.read(producer / 'superchain.stage.json') + if producer_stage['argv'] != ['just','build-superchain-go'] or producer_stage['exit_code'] != 0: + raise ValueError('Wrong original pre-fork superchain producer command') + return {'settings':settings, 'selection':selected, 'coverage':coverage, 'outcomes':expected['outcomes'], + 'commands':commands, 'dependencies':dependencies, 'original_sha256':hashes, 'declared_empty':empty} + + +def compare(directory, sha): + if not re.fullmatch('[0-9a-f]{40}', sha): raise ValueError('Expected full pre-fork benchmark SHA') + a = report(directory / 'circle', 'circleci', sha); b = report(directory / 'rwx', 'rwx', sha) + for field in ('source_sha','branch','input_sha256','environment','go_environment','tool_versions'): + if a['settings'][field] != b['settings'][field]: raise ValueError('Original pre-fork settings differ: ' + field) + if a['selection'] != b['selection'] or a['commands'] != b['commands']: raise ValueError('Complete pre-fork discovery or invocation differs') + def cases(value): + return {fork:[{k:c[k] for k in ('suite','name','outcome','skip_reason')} | + {'attempts':[{k:h[k] for k in ('outcome','skip_reason')} for h in c['attempts']]} + for c in sorted(body['cases'], key=lambda r:(r['suite'],r['name']))] + for fork,body in value.items()} + if cases(a['coverage']) != cases(b['coverage']): raise ValueError('Original pre-fork cases, skips or retry histories differ') + if any(a['coverage'][f]['package_attempts'] != b['coverage'][f]['package_attempts'] for f in a['coverage']): + raise ValueError('Original pre-fork package attempts differ') + return {'source_sha':sha,'verified_parity':True,'forks':a['selection']['forks'], + 'selection':a['selection'],'cases':cases(a['coverage']),'outcomes':a['outcomes'], + 'commands':a['commands'],'tool_versions':a['settings']['tool_versions'], + 'original_sha256':{'circle':a['original_sha256'],'rwx':b['original_sha256']}, + 'native_dependencies':b['dependencies'],'circle_manifest_declared_empty':a['declared_empty'], + 'native_run_id':b['settings']['rwx_run_id']} + + +if __name__ == '__main__': + parser = argparse.ArgumentParser(description=__doc__); parser.add_argument('directory',type=Path) + parser.add_argument('--sha',required=True); parser.add_argument('--output',type=Path,required=True) + args = parser.parse_args() + result = compare(args.directory,args.sha); N.S.write(args.output,result) + print(json.dumps({k:result[k] for k in ('source_sha','verified_parity','forks','outcomes')})) diff --git a/ops/ci/migration/compare-nut-provenance.py b/ops/ci/migration/compare-nut-provenance.py new file mode 100644 index 00000000000..8cd619599d0 --- /dev/null +++ b/ops/ci/migration/compare-nut-provenance.py @@ -0,0 +1,53 @@ +#!/usr/bin/env python3 +"""Compare complete original historical NUT regeneration evidence.""" +import argparse +import importlib.util +from pathlib import Path + +_SPEC = importlib.util.spec_from_file_location('report_evidence', Path(__file__).with_name('report-evidence.py')) +E = importlib.util.module_from_spec(_SPEC); _SPEC.loader.exec_module(E) +N = E.helper('nut-provenance') +G, S = N.G, N.S +originals, full_selection, validate_fork = N.originals, N.full_selection, N.validate_fork + + +def compare(circle,native,output): + result={'passed':False,'errors':[],'full_original_comparison':True,'coverage':{}} + try: + E.verify_files(circle, G.read(circle/'final.json')['original_sha256'], missing_empty=[], label='circle/nut-provenance'); originals(circle);originals(native) + a,b=G.read(circle/'settings.json'),G.read(native/'settings.json') + for key in ('source_sha','branch','input_sha256','environment','go_version','prepare_only'): + if a[key]!=b[key]:raise ValueError('NUT provider settings differ: '+key) + if a['provider']!='circleci' or b['provider']!='rwx' or a['prepare_only']:raise ValueError('Wrong original NUT provider or preparation-only evidence') + selection,base_a=full_selection(circle);other,base_b=full_selection(native) + result['base_discovery']={'circleci':base_a,'rwx':base_b} + if selection!=other: + raise ValueError('Missing or different full NUT workload selection') + if (circle/'fork_lock.toml').read_bytes()!=(native/'fork_lock.toml').read_bytes(): + raise ValueError('Original complete NUT lock inputs differ') + for fork,entry in selection['entries'].items(): + left,right=circle/'forks'/fork,native/'forks'/fork + ca,cb=validate_fork(left,entry,fork),validate_fork(right,entry,fork) + if ca!=cb:raise ValueError('Complete original NUT build selection differs: '+fork) + for name in ('mise.toml','contracts.justfile','foundry.toml','locked-bundle.json','regenerated-bundle.json','tracked-stage.bin','worktree-status.txt','submodule-inventories.json'): + if (left/'originals'/name).read_bytes()!=(right/'originals'/name).read_bytes():raise ValueError('Original NUT input or artifact differs: '+fork+'/'+name) + tools_a,tools_b=G.read(left/'tools.json'),G.read(right/'tools.json') + if tools_a['go']['version']!=a['go_version'] or tools_b['go']['version']!=b['go_version']: + raise ValueError('Original NUT verifier Go differs from settings') + if {k:{n:v for n,v in row.items() if n!='binary_path'} for k,row in tools_a.items()}!={k:{n:v for n,v in row.items() if n!='binary_path'} for k,row in tools_b.items()}: + raise ValueError('Original NUT generator binary or toolchain differs') + compilers_a,compilers_b=G.read(left/'compilers.json'),G.read(right/'compilers.json') + if {k:{n:v for n,v in row.items() if n!='binary_path'} for k,row in compilers_a.items()}!={k:{n:v for n,v in row.items() if n!='binary_path'} for k,row in compilers_b.items()}: + raise ValueError('Original NUT Solidity compiler binaries differ') + result['coverage'][fork]={'recorded_commit':entry['commit'],'bundle_sha256':entry['hash'],'historical_tools':entry['historical_tools'], + 'historical_source_files':len(ca['git_inventory']),'submodules':len(ca['submodules']),'compiler_partitions':ca['compiler_partitions'],'outcome':'passed','tests':0,'retries':0} + result['passed']=True + except Exception as error:result['errors'].append(str(error)) + S.write(output,result);return 0 if result['passed'] else 1 + +if __name__ == '__main__': + parser=argparse.ArgumentParser(description=__doc__) + parser.add_argument('--compare', nargs=2, type=Path, required=True) + parser.add_argument('--output', type=Path, required=True) + args=parser.parse_args() + raise SystemExit(compare(*args.compare, args.output)) diff --git a/ops/ci/migration/compare-pr-checks.py b/ops/ci/migration/compare-pr-checks.py new file mode 100644 index 00000000000..7770fd55ecf --- /dev/null +++ b/ops/ci/migration/compare-pr-checks.py @@ -0,0 +1,114 @@ +#!/usr/bin/env python3 +"""Compare complete original module preparation and contract fast checks.""" +import argparse +import importlib.util +import json +from pathlib import Path +_SPEC_E = importlib.util.spec_from_file_location('report_evidence', Path(__file__).with_name('report-evidence.py')) +E = importlib.util.module_from_spec(_SPEC_E); _SPEC_E.loader.exec_module(E) +import re +import xml.etree.ElementTree as ET + + +def helper(name): + spec = importlib.util.spec_from_file_location(name.replace('-', '_'), (Path(__file__).parent if name.startswith('compare-') or name in ('flaky-report','selector-upload','selector-registry') else Path(__file__).resolve().parents[1] / 'runtime') / (name + '.py')) + module = importlib.util.module_from_spec(spec); spec.loader.exec_module(module); return module + + +CHECKS = helper('pr-checks') +REPORT = helper('ci-report') +SUBMODULES = helper('git-submodule-report') + + +def report(directory, job, sha, provider, empty): + required = {'settings.json', 'coverage.json', 'checks.junit.xml'} + required |= {'discovery.json', 'discovery.stage.json', 'verify.stage.json', 'verify.log', 'download-0.stage.json', 'download-0.log'} if job == 'go-modules' else { + 'checks.log', 'checks.stage.json', 'selection.json', 'submodules.txt', 'foundry-config.json', 'foundry-config.stage.json', 'fetch-target.stage.json'} + final = REPORT.read(directory / 'final.json') + if final['exit_code'] != 0 or final['report_errors']: + raise ValueError('Failed or incomplete original PR check report') + hashes = E.verify_files(directory, final['original_sha256'], required=required, + missing_empty=empty if provider == 'circle' else None, label=provider + '/' + job) + settings = json.loads((directory / 'settings.json').read_text()); coverage = json.loads((directory / 'coverage.json').read_text()) + if settings['source_sha'] != sha or settings['job'] != job or settings['provider'] != {'circle': 'circleci', 'rwx': 'rwx'}[provider]: + raise ValueError('PR check source, job or provider differs') + if provider == 'rwx' and job == 'contracts-fast' and (not settings['rwx_run_id'] or str(settings['rwx_task_attempt']) != '1'): + raise ValueError('Missing fresh native check identity or uninvestigated task retry') + if job == 'contracts-fast' and (not settings.get('target_branch') or any( + not re.fullmatch('[0-9a-f]{40}', settings.get(field, '')) for field in ('target_sha', 'merge_base_sha'))): + raise ValueError('Invalid bound contract target history') + stages = {} + for path in directory.glob('*.stage.json'): + row = json.loads(path.read_text()); name = path.name.removesuffix('.stage.json') + stages[name] = REPORT.normalize({k: row[k] for k in ('argv', 'cwd', 'exit_code')}, settings['workspace_root']) + if row['exit_code'] != 0 and not name.startswith('download-'): raise ValueError('Failed original PR check stage') + if job == 'go-modules': + manifest = CHECKS.modules((directory / 'discovery.json').read_text()) + if manifest != coverage['modules'] or not coverage['verified']: raise ValueError('Module coverage differs from complete original discovery') + downloads = sorted(n for n in stages if n.startswith('download-')) + if downloads != ['download-' + str(i) for i in range(coverage['download_attempts'])] or not 1 <= len(downloads) <= 5: + raise ValueError('Incomplete original download retry history') + if stages[downloads[-1]]['exit_code'] != 0 or any(stages[n]['exit_code'] == 0 for n in downloads[:-1]): + raise ValueError('Invalid original download retry history') + expected = set(downloads) | {'discovery', 'verify'} + if coverage['selected'] != len(manifest): raise ValueError('Incomplete module count') + cases = {job} + else: + expected = {'checks', 'foundry-config', 'fetch-target'} + configuration = json.loads((directory / 'selection.json').read_text()) + if CHECKS.check_verdicts((directory / 'checks.log').read_text(), configuration) != coverage: + raise ValueError('Check coverage differs from original command output') + cases = set(CHECKS.checks(configuration)) + if stages.keys() != expected: raise ValueError('Missing or extra original PR check stages') + for name, row in stages.items(): + command = ['go', 'mod', 'download'] if name.startswith('download-') else { + 'verify': ['go', 'mod', 'verify'], 'discovery': ['go', 'list', '-m', '-json', 'all'], + 'checks': ['just', 'check-fast', '-verbose'], 'foundry-config': ['forge', 'config', '--json'], + 'fetch-target': ['git', 'fetch', '--no-tags', 'origin', '+refs/heads/' + settings.get('target_branch', '') + + ':refs/remotes/origin/' + settings.get('target_branch', '')]}[name] + cwd = '/packages/contracts-bedrock' if job == 'contracts-fast' and name != 'fetch-target' else '' + if row['argv'] != command or row['cwd'] != cwd: raise ValueError('Unexpected original PR check command or directory') + junit = list(ET.parse(directory / 'checks.junit.xml').iter('testcase')) + if len(junit) != len(cases) or {c.attrib['name'] for c in junit} != cases or any( + c.find('failure') is not None or c.find('error') is not None or c.find('skipped') is not None for c in junit): + raise ValueError('Original PR check JUnit differs from complete coverage') + return settings, coverage, stages, hashes + + +def compare(directories, job, sha): + if not re.fullmatch('[0-9a-f]{40}', sha): raise ValueError('Expected the full PR check source SHA') + empty, data = [], {} + for provider, directory in directories.items(): data[provider] = report(directory, job, sha, provider, empty) + a, b = data['circle'], data['rwx'] + settings_fields = ('source_sha', 'job', 'branch', 'go', 'just', 'input_sha256') + ( + ('forge', 'semgrep', 'target_branch', 'target_sha', 'merge_base_sha') if job == 'contracts-fast' else ()) + for field in settings_fields: + if a[0][field] != b[0][field]: raise ValueError('PR check binding differs at ' + field) + if a[2] != b[2]: raise ValueError('PR check original commands or retry history differs') + if job == 'go-modules': + if a[1] != b[1]: raise ValueError('Complete original Go module graph or retries differ') + else: + for provider, directory in directories.items(): + config = json.loads((directory / 'foundry-config.json').read_text()) + data[provider] += (REPORT.normalize(config, data[provider][0]['workspace_root']), + SUBMODULES.revisions((directory / 'submodules.txt').read_text())) + a, b = data['circle'], data['rwx'] + if a[4:] != b[4:]: raise ValueError('PR check Foundry configuration or submodule revisions differ') + def outcomes(coverage): + return {k: v for k, v in coverage.items() if k != 'checks'} | { + 'checks': [{**r, 'attempts': [{k: v for k, v in t.items() if k != 'elapsed_seconds'} for t in r['attempts']]} for r in coverage['checks']]} + if outcomes(a[1]) != outcomes(b[1]): raise ValueError('Full original check outcomes or retry histories differ') + return {'source_sha': sha, 'job': job, 'verified_parity': True, 'coverage': a[1], 'commands': a[2], + 'original_sha256': {p: data[p][3] for p in data}, 'manifest_declared_empty_logs': empty, + 'original_submodule_status': {p: (d / 'submodules.txt').read_text() for p,d in directories.items()} if job == 'contracts-fast' else None, + 'submodule_revisions': a[5] if job == 'contracts-fast' else None} + + +if __name__ == '__main__': + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument('--circle', required=True, type=Path); parser.add_argument('--rwx', required=True, type=Path) + parser.add_argument('--job', required=True, choices=('go-modules', 'contracts-fast')); parser.add_argument('--sha', required=True) + parser.add_argument('--output', required=True, type=Path); args = parser.parse_args() + result = compare({'circle': args.circle, 'rwx': args.rwx}, args.job, args.sha) + args.output.write_text(json.dumps(result, indent=2, sort_keys=True) + '\n') + print(json.dumps({'source_sha': args.sha, 'job': args.job, 'verified_parity': True, 'selected': result['coverage']['selected']})) diff --git a/ops/ci/migration/compare-pr-gates.py b/ops/ci/migration/compare-pr-gates.py new file mode 100644 index 00000000000..b761f8d164f --- /dev/null +++ b/ops/ci/migration/compare-pr-gates.py @@ -0,0 +1,264 @@ +#!/usr/bin/env python3 +"""Compare complete original Circle and native RWX gate evidence on one SHA.""" +import argparse +import hashlib +import importlib.util +import json +from pathlib import Path +import re +import subprocess +import tempfile +from urllib.parse import urlparse + +ROOT = Path(__file__).resolve().parents[3] +SPEC = importlib.util.spec_from_file_location('original_pr_gate', Path(__file__).resolve().parents[1] / 'runtime' / 'pr-gate.py') +G = importlib.util.module_from_spec(SPEC) +SPEC.loader.exec_module(G) +PASS = {'succeeded': True, 'failed': False, 'skipped': False} +SKIP = {'succeeded': False, 'failed': False, 'skipped': True} +TERMINAL = ['success', 'failed', 'canceled', 'unauthorized', 'skipped'] + + +def require(condition, message): + if not condition: + raise ValueError(message) + + +def original(path, expected=None): + final = G.originals(path) + require(type(final['exit_code']) is int and type(final['tests']) is int, + 'Incorrectly typed gate verdict') + if expected is not None: + require(set(final['original_sha256']) == set(expected), 'Missing or extra gate originals') + return final['original_sha256'] | {'final.json': G.S.digest(path / 'final.json')} + + +def source(path, sha): + return subprocess.check_output(['git', 'show', sha + ':' + path], cwd=ROOT) + + +def source_inputs(sha): + """Hash the complete committed tree, including links, without a checkout.""" + tree = subprocess.check_output(['git', 'ls-tree', '-rz', sha], cwd=ROOT) + entries, blobs, result, seen = [], set(), {}, set() + for entry in tree.split(b'\0'): + if not entry: + continue + header, raw_name = entry.split(b'\t', 1) + mode, kind, oid = header.decode().split() + name = raw_name.decode() + require(name not in seen, 'Duplicate source input') + seen.add(name) + if mode == '160000': + require(kind == 'commit', 'Wrong gitlink input') + result[name] = {'gitlink': oid} + else: + require(kind == 'blob' and mode in ('100644', '100755', '120000'), 'Wrong source input mode') + entries.append((name, mode, oid)) + blobs.add(oid) + # A file-backed stdin avoids pipe deadlocks while hashing the complete tree. + contents = {} + with tempfile.TemporaryFile() as requests: + requests.write(('\n'.join(sorted(blobs)) + '\n').encode()) + requests.seek(0) + with subprocess.Popen(['git', 'cat-file', '--batch'], cwd=ROOT, stdin=requests, + stdout=subprocess.PIPE) as process: + for oid in sorted(blobs): + header = process.stdout.readline().decode().split() + require(len(header) == 3 and header[:2] == [oid, 'blob'], 'Missing source blob') + size = int(header[2]) + data = process.stdout.read(size) + require(len(data) == size and process.stdout.read(1) == b'\n', 'Truncated source blob') + contents[oid] = data + require(not process.stdout.read() and process.wait() == 0, 'Source discovery failed') + for name, mode, oid in entries: + result[name] = ({'symlink': contents[oid].decode()} if mode == '120000' + else hashlib.sha256(contents[oid]).hexdigest()) + require(result, 'Empty source discovery') + return result + + +def source_policy(sha, manifest): + names={'ops/ci/runtime/pr-gates.json','ops/ci/runtime/pr-gate.py','ops/ci/runtime/ci-report.py'} + names.update(row['native_config'] for row in manifest['gates'].values()) + names.update(row['config'] for row in manifest['groups'].values()) + tree=subprocess.check_output(['git','ls-tree','-r','--name-only',sha,'.rwx/packages'],cwd=ROOT,text=True) + names.update(name for name in tree.splitlines() if name.endswith('.yml')) + hashes={name:hashlib.sha256(source(name,sha)).hexdigest() for name in sorted(names)} + return hashlib.sha256(json.dumps(hashes,sort_keys=True,separators=(',',':')).encode()).hexdigest() + + +def yaml(path): + return json.loads(subprocess.check_output(['yq', '-o=json', '.', str(path)], text=True), + object_pairs_hook=G.unique) + + +def named(rows, key): + require(isinstance(rows, list) and rows, 'Empty gate task/job discovery') + result = {row[key]: row for row in rows} + require(len(result) == len(rows), 'Duplicate gate task/job identity') + return result + + +def fresh(task): + require(task['Status']['Execution'] == 'finished' and task['Status']['Result'] == 'succeeded' + and task['Status']['FinishedSubStatus'] == 'executed', 'Gate prerequisite did not execute freshly') + + +def states(actual, expected): + require(actual == expected and all(isinstance(row, dict) and set(row) == set(PASS) + and all(type(value) is bool for value in row.values()) for row in actual.values()), + 'Missing, failed or incorrectly typed original gate states') + + +def compare(circle, native, status, run_path, github_path): + circle, native, status = Path(circle), Path(native), Path(status) + originals = {'circle': original(circle), 'native': original(native), 'status': original(status, ['settings.json', 'states.json'])} + settings, published = G.read(native / 'settings.json'), G.read(status / 'settings.json') + c = G.read(circle / 'settings.json') + sha, gate = settings['source_sha'], settings['gate'] + require(re.fullmatch('[0-9a-f]{40}', sha) and c['source_sha'] == sha, 'Different gate source revisions') + require(c['provider'] == 'circleci' and c['gate'] == gate and c['branch'] == settings['branch'], + 'Different gate provider, branch or selection') + require(type(settings['selected']) is bool and settings['selected'], 'Unselected gate adds no coverage') + require(settings['task_attempt'] == '1', 'Uninvestigated native gate retry') + manifest = G.read(native / 'manifest.json') + require(manifest['version'] == 4 and manifest['repository'] == 'ethereum-optimism/optimism', + 'Wrong original gate manifest') + require((native / 'manifest.json').read_bytes() == source('ops/ci/runtime/pr-gates.json', sha) + == (circle / 'source-gates.json').read_bytes(), 'Stale or resealed gate authority') + row = manifest['gates'][gate] + names = [d['name'] for d in row['dependencies']] + groups = sorted({d['group'] for d in row['dependencies']}) + require(names and len(names) == len(set(names)), 'Empty or duplicate required dependency') + selection = row | {'requires': names, 'groups': groups} + require(settings['selection'] == selection and published['selection'] == selection, + 'Changed original gate selection') + identity = {k: settings[k] for k in ('source_sha', 'branch', 'native_policy_sha256', 'native_run_id', 'task_attempt', 'gate')} + require(all(published[k] == value for k, value in identity.items()), 'Foreign native final verdict') + require(settings['native_policy_sha256'] == source_policy(sha, manifest), 'Stale, missing or corrupt committed gate inputs') + mapping=json.loads(source('ops/ci/migration/circle-gates.json', sha))['gates'][gate] + row = row | mapping + require((circle / 'circle-config.yml').read_bytes() == source(row['circle_config'], sha), + 'Stale original Circle gate configuration') + config = yaml(circle / 'circle-config.yml') + authority = [item[gate] for item in config['workflows'][row['workflow']]['jobs'] if isinstance(item, dict) and gate in item] + require(len(authority) == 1 and not authority[0].get('always-succeed', False) + and authority[0]['requires'] == [{name: 'terminal'} for name in names], 'Changed authoritative Circle prerequisites') + compiled_raw = G.read(circle / 'pipeline-config.json') + require(compiled_raw['compiled'] == (circle / 'compiled.yml').read_text() + and compiled_raw['source'] == (circle / 'source.yml').read_text(), 'Changed compiled Circle originals') + compiled = yaml(circle / 'compiled.yml') + gates = [item[gate] for item in compiled['workflows'][row['workflow']]['jobs'] if isinstance(item, dict) and gate in item] + require(len(gates) == 1 and gates[0]['requires'] == names + and gates[0]['upstream'] == {name: TERMINAL for name in names}, 'Changed compiled terminal dependency set') + commands = [step['run']['command'] for step in compiled['jobs'][gate]['steps'] + if isinstance(step, dict) and isinstance(step.get('run'), dict) + and step['run'].get('name') == 'Verify all required jobs passed'] + require(len(commands) == 1 and 'if [ "false" = "true" ]; then' in commands[0] + and 'All required jobs passed.' in commands[0], 'Always-successful or omitted Circle gate verifier') + pipeline, workflow = G.read(circle / 'pipeline.json'), G.read(circle / 'workflow.json') + require(pipeline['id'] == c['pipeline_id'] and not pipeline['errors'] + and pipeline['vcs']['revision'] == sha and pipeline['vcs']['branch'] == settings['branch'] + and workflow['id'] == c['workflow_id'] and workflow['pipeline_id'] == c['pipeline_id'] + and workflow['name'] == c['workflow_name'] == row['workflow'], 'Foreign original Circle workflow') + pages = sorted((circle / 'api-pages').glob('jobs-*.json'), key=lambda p: int(p.stem.split('-')[1])) + require([p.name for p in pages] == ['jobs-' + str(i) + '.json' for i in range(len(pages))], 'Missing Circle job page') + jobs = [] + for i, path in enumerate(pages): + page = G.read(path) + require(bool(page.get('next_page_token')) == (i != len(pages) - 1), 'Incomplete Circle job pagination') + jobs.extend(page['items']) + require(jobs == G.read(circle / 'workflow-jobs.json'), 'Changed original Circle job collection') + by_id, by_name = named(jobs, 'id'), named(jobs, 'name') + circle_gate = by_name[gate] + require(circle_gate['status'] == 'success' and circle_gate['job_number'] == c['job_number'], 'Circle gate failed or never ran') + dependencies = circle_gate['dependencies'] + require(len(dependencies) == len(set(dependencies)) == len(names) + and {by_id[key]['name'] for key in dependencies} == set(names), 'Missing, duplicate or foreign Circle prerequisite') + require(all(by_id[key]['status'] == 'success' for key in dependencies), 'Failed or skipped Circle prerequisite') + job = G.read(circle / 'gate-job.json') + require(job['status'] == job['outcome'] == 'success' and job['vcs_revision'] == sha + and job['branch'] == settings['branch'] and job['build_num'] == c['job_number'] + and job['workflows']['workflow_id'] == c['workflow_id'] + and job['workflows']['job_id'] == circle_gate['id'] + and job['workflows']['job_name'] == gate and not job['retry_of'] + and all(job[key] is False for key in ('failed', 'timedout', 'canceled', 'infrastructure_fail')), + 'Failed, stale or retried original Circle verdict') + steps = [step for step in G.read(circle / 'step-index.json') if step['step'] == 'Verify all required jobs passed'] + actual_steps = [step for step in job['steps'] if step['name'] == 'Verify all required jobs passed'] + require(len(steps) == len(actual_steps) == 1 and len(actual_steps[0]['actions']) == 1 + and actual_steps[0]['actions'][0]['status'] == steps[0]['status'] == 'success' + and actual_steps[0]['actions'][0]['output_url'], 'Missing original executed Circle verifier') + events = G.read(circle / steps[0]['log']) + require(events and all(event.get('truncated') is False and isinstance(event['message'], str) for event in events), + 'Truncated or missing original Circle verdict log') + lines = [line.strip() for line in ''.join(event['message'] for event in events).splitlines() if line.strip()] + require(lines[0] == 'Checking required jobs for ' + gate + '...' and lines[-1] == 'All required jobs passed.' + and sorted(lines[1:-1]) == sorted('ok ' + name + ': success' for name in names), + 'Incomplete, duplicate or bypassed original Circle verification') + states(G.read(status / 'states.json'), {'aggregate': PASS, 'gate-failure': SKIP}) + group_states, verdict = G.read(native / 'states.json'), G.read(native / 'verdict.json') + states(group_states, {group: PASS for group in groups}) + states(verdict['groups'], group_states) + require(verdict['state'] == 'passed' + and verdict['requires'] == names + and verdict['dependencies'] == [d | {'outcome': 'passed'} for d in row['dependencies']], + 'Incomplete original native gate verdict') + run = G.read(run_path) + run_id = settings['native_run_id'] + require(re.fullmatch('[0-9a-f]{32}', run_id) and run['ID'] == run['RunID'] == run_id + and run['CommitSha'] == sha and run['Branch'] == settings['branch'] + and run['Init'] == {'commit-sha': sha, 'branch': settings['branch'], 'tag': ''} + and run['Trigger'] == 'github.push' and run['DefinitionPath'] == row['native_config'] + and run['TargetedTaskKeys'] is None, 'Foreign, manually targeted or unexecuted native gate run') + engine = named(run['Tasks'], 'Key') + observers = row.get('observer_tasks', {'aggregate': 'aggregate', 'failure': 'gate-failure', 'status': 'gate-status'}) + fresh(engine[observers['aggregate']]) + fresh(engine[observers['status']]) + require(engine[observers['failure']]['Status']['Execution'] == 'skipped', 'Unexpected native failure observer') + expected = {'settings.json', 'manifest.json', 'states.json', 'verdict.json'} + for group in groups: + artifact = native / 'groups' / group + original(artifact, ['settings.json', 'states.json']) + expected |= {'groups/' + group + '/' + name for name in ('settings.json', 'states.json', 'final.json')} + group_settings = G.read(artifact / 'settings.json') + require(all(group_settings[k] == settings[k] for k in ('source_sha', 'branch', 'native_policy_sha256', 'native_run_id', 'task_attempt')) + and group_settings['selected'] is True and group_settings['group'] == group + and group_settings['definition'] == manifest['groups'][group], 'Stale or foreign native group receipt') + tasks = G.group_tasks(manifest, group) + states(G.read(artifact / 'states.json'), {task: PASS for task in tasks}) + child = named(engine[manifest['groups'][group]['embedded_task']]['Subtasks'], 'Key') + fresh(child[manifest['groups'][group]['receipt_task']]) + for task in tasks: + fresh(child[task]) + original(native, expected) + github = G.read(github_path) + require(github['sha'] == sha, 'Stale GitHub gate observation') + checks = named(github['checks'], 'name') + native_check = checks['RWX: ' + row['check_name']] + circle_check = checks['ci/circleci: ' + gate] + link = urlparse(native_check['link']) + require(native_check['state'] == circle_check['state'] == 'success' + and link.scheme == 'https' and link.netloc == 'cloud.rwx.com' + and link.path == '/optimism/runs/' + run_id + '/latest/' + observers['status'] + and circle_check['link'] == 'https://circleci.com/gh/ethereum-optimism/optimism/' + str(c['job_number']), + 'Missing, failed or foreign terminal GitHub gate check') + return {'state': 'passed', 'source_sha': sha, 'branch': settings['branch'], 'gate': gate, + 'tests': 0, 'dependencies': names, 'circle': {'pipeline_id': c['pipeline_id'], 'workflow_id': c['workflow_id'], + 'job_number': c['job_number'], 'retry_of': job['retry_of'], 'retry_history': job['retries']}, + 'native': {'run_id': run_id, 'aggregate_task': engine[observers['aggregate']]['ID'], + 'status_task': engine[observers['status']]['ID'], 'task_attempt': settings['task_attempt'], + 'workload_tasks': sum(len(G.group_tasks(manifest, group)) for group in groups)}, + 'original_sha256': originals | {'run_state': G.S.digest(run_path), 'github_checks': G.S.digest(github_path)}} + + +if __name__ == '__main__': + parser = argparse.ArgumentParser(description=__doc__) + for name in ('circle', 'native', 'status', 'run_state', 'github_checks', 'output'): + parser.add_argument(name, type=Path) + args = parser.parse_args() + report = compare(args.circle, args.native, args.status, args.run_state, args.github_checks) + args.output.parent.mkdir(parents=True, exist_ok=True) + G.S.write(args.output, report) + print(json.dumps({key: report[key] for key in ('state', 'source_sha', 'gate', 'tests')})) diff --git a/ops/ci/migration/compare-rust-cannon.py b/ops/ci/migration/compare-rust-cannon.py new file mode 100644 index 00000000000..06b34d66394 --- /dev/null +++ b/ops/ci/migration/compare-rust-cannon.py @@ -0,0 +1,170 @@ +#!/usr/bin/env python3 +"""Compare complete original Cannon lint, build and offline guest reports.""" +import argparse +import gzip +import hashlib +import importlib.util +import json +from pathlib import Path +_SPEC_E=importlib.util.spec_from_file_location('report_evidence',Path(__file__).with_name('report-evidence.py')) +E=importlib.util.module_from_spec(_SPEC_E);_SPEC_E.loader.exec_module(E) +import re + +JOBS = ('lint', 'build', 'offline') +BINDING = ('source_sha', 'input_sha256', 'source_trees', 'stable_rust', 'nightly', + 'go_pin', 'profile', 'target', 'rustflags', 'build_std', 'custom_configs', 'witness') +EMPTY_LOGS = {'guest.log'} +GO_FILES = {'cannon/bin/cannon', 'cannon/bin/cannon64-impl', 'cannon/multicannon/embeds/cannon-8'} + + +def read(path): + return json.loads(path.read_text()) + + +def digest(path): + with path.open('rb') as source: + return hashlib.file_digest(source, 'sha256').hexdigest() + + +def command(stage, root): + return {'argv': [arg.replace(root + '/', '/') for arg in stage['argv']], + 'cwd': stage['cwd'], 'exit_code': stage['exit_code']} + + +def compare(root, sha): + if not re.fullmatch('[0-9a-f]{40}', sha): + raise ValueError('Expected a full source SHA') + evidence = {'source_sha': sha, 'verified_parity': False, 'jobs': {}, + 'original_sha256': {}, 'manifest_declared_empty_logs': []} + for provider in ('circle', 'rwx'): + evidence['original_sha256'][provider] = {} + for job in JOBS: + directory = root / provider / ('cannon-' + job) + settings, final = read(directory / 'settings.json'), read(directory / 'final.json') + if settings['source_sha'] != sha or settings['job'] != job or settings['suite'] != 'rust-cannon': + raise ValueError(f'{provider}/{job}: source or workload mismatch') + if settings['provider'] != {'circle': 'circleci', 'rwx': 'rwx'}[provider]: + raise ValueError('Provider provenance mismatch') + if provider == 'rwx' and (not settings.get('rwx_run_id') or str(settings.get('rwx_task_attempt')) != '1'): + raise ValueError('Missing fresh identity or task retries require investigation') + if final['exit_code'] != 0 or final['report_errors'] or not final['stages']: + raise ValueError('Failed or incomplete Cannon verdict') + required = {'settings.json', 'checks.junit.xml', 'variants.log', 'variants.stage.json', + 'image.json', 'image-elfs.json', job + '.log', job + '.stage.json'} + if provider == 'rwx' and job != 'offline': required.add('verified-env.json') + if job in ('build', 'offline'): required.add('elfs.json') + if job == 'offline': + required.update({'guest.json', 'guest.log', 'guest.stage.json', 'guest-coverage.json', + 'out.bin.gz', 'go-binaries.json', 'witness.json'}) + if provider == 'rwx': required.update('verified-' + kind + '.json' for kind in ('go', 'witness', 'build')) + hashes = final['original_sha256'] + if not required <= hashes.keys(): + raise ValueError('Incomplete original Cannon artifact manifest') + if provider == 'rwx': + kinds = ('go', 'witness', 'build') if job == 'offline' else ('env',) + for kind in kinds: + verified = read(directory / ('verified-' + kind + '.json')) + if verified['producer_source_sha'] != sha or not re.fullmatch('[0-9a-f]{64}', verified['manifest_sha256']): + raise ValueError('Inherited Cannon producer provenance mismatch') + if job == 'offline' and kind == 'build' and verified.get('image_manifest_sha256') != digest(root / provider / 'cannon-build/image.json'): + raise ValueError('Offline Cannon image handoff differs from the counted build producer') + for name, stage in final['stages'].items(): + if stage['exit_code'] != 0 or not {name + '.stage.json', name + '.log'} <= hashes.keys(): + raise ValueError('Unsuccessful or incomplete original Cannon stage') + if stage != read(directory / (name + '.stage.json')): + raise ValueError('Stage summary differs from original Cannon stage') + recovered=[] + try: + E.verify_files(directory, hashes, required=(), + missing_empty=recovered if provider == 'circle' else None, + recoverable=EMPTY_LOGS, label=provider+'/'+job) + except OSError as error: + raise ValueError('Missing nonempty original Cannon artifact: '+str(error)) from error + except ValueError as error: + raise ValueError('Corrupt original Cannon artifact: '+str(error)) from error + evidence['manifest_declared_empty_logs'].extend( + {'job':job,'name':row['path'],'sha256':row['sha256']} for row in recovered) + evidence['original_sha256'][provider][job] = hashes + for job in JOBS: + a, b = (root / provider / ('cannon-' + job) for provider in ('circle', 'rwx')) + sa, sb = read(a / 'settings.json'), read(b / 'settings.json') + for key in BINDING + ('variants', 'rustc', 'cargo'): + if sa[key] != sb[key]: + raise ValueError(f'{job}: settings differ at {key}') + variants = sa['variants'] + selected = {v['binary'] for v in variants} + if not selected or len(selected) != len(variants): + raise ValueError('Empty or duplicate Cannon variant selection') + if (a / 'variants.log').read_bytes() != (b / 'variants.log').read_bytes(): + raise ValueError('Original authoritative Cannon variant discovery differs') + expected_binding = {key: sa[key] for key in BINDING} + ia, ib = read(a / 'image.json'), read(b / 'image.json') + for key in ('binding', 'base', 'base_digests', 'tools'): + if ia[key] != ib[key] or (key == 'binding' and ia[key] != expected_binding): + raise ValueError('Cannon Docker input/toolchain provenance differs') + stages = ('variants', job) + (('guest',) if job == 'offline' else ()) + primary = {} + for name in stages: + ca, cb = command(read(a / (name + '.stage.json')), sa['workspace_root']), command(read(b / (name + '.stage.json')), sb['workspace_root']) + if ca != cb: + raise ValueError('Cannon command, working directory or outcome differs: ' + name) + primary[name] = ca + info = {'variants': variants, 'outcome': 'pass', 'retries': 0, 'stages': primary, + 'images': {'circle': ia, 'rwx': ib}, 'elfs': {}} + for filename, folder in [('image-elfs.json', 'image-elfs')] + ([('elfs.json', 'elfs')] if job in ('build', 'offline') else []): + ma, mb = read(a / filename), read(b / filename) + if ma != mb or ma['binding'] != expected_binding or ma['variants'] != variants or set(ma['files']) != selected: + raise ValueError('Cannon ELF inventories, inputs or binary hashes differ') + for binary, artifact in ma['files'].items(): + for directory in (a, b): + original = directory / folder / binary + header = original.read_bytes()[:20] + if (digest(original) != artifact['sha256'] or original.stat().st_size != artifact['size'] or + len(header) != 20 or header[:7] != b'\x7fELF\x02\x02\x01' or header[18:20] != b'\0\x08'): + raise ValueError('Corrupt or invalid original MIPS ELF') + info['elfs'][filename] = ma + if (a / 'checks.junit.xml').read_bytes() != (b / 'checks.junit.xml').read_bytes(): + raise ValueError('Original Cannon JUnit differs') + if job == 'offline': + wa, wb = read(a / 'witness.json'), read(b / 'witness.json') + if wa != wb or wa['binding'] != expected_binding or wa['sha256'] != sa['witness']['sha256'] or wa['filename'] != sa['witness']['filename']: + raise ValueError('Pinned Cannon witness provenance differs') + ga, gb = read(a / 'go-binaries.json'), read(b / 'go-binaries.json') + if ga['binding'] != expected_binding or gb['binding'] != expected_binding or ga['go'] != gb['go'] or set(ga['files']) != GO_FILES or set(gb['files']) != GO_FILES: + raise ValueError('Native Cannon Go build provenance differs') + info['native_go'] = {'circle': ga, 'rwx': gb, 'byte_identical': ga == gb, + 'comparison': 'Pinned Go, complete source inputs and original build coverage; native host debug paths may differ.'} + ca, cb = read(a / 'guest-coverage.json'), read(b / 'guest-coverage.json') + for key in ('boundary', 'final', 'fresh_execution'): + if ca[key] != cb[key]: raise ValueError('Fresh Cannon guest coverage differs') + final = ca['final'] + if (ca['boundary'] != sa['witness'] or ca['fresh_execution'] is not True or + final != read(a / 'guest.json') or final != read(b / 'guest.json') or + final['exited'] is not True or type(final['exitCode']) is not int or final['exitCode'] != 0 or + type(final['step']) is not int or final['step'] <= 0 or final['stateVersion'] != 8 or + not re.fullmatch('0x[0-9a-f]{64}', final['witnessHash']) or not re.fullmatch('0x(?:[0-9a-f]{2})+', final['witness'])): + raise ValueError('Invalid or unsuccessful original Cannon guest verdict') + for directory, coverage in ((a, ca), (b, cb)): + if coverage['final_state_sha256'] != digest(directory / 'out.bin.gz'): + raise ValueError('Original final-state coverage hash differs') + log = (directory / 'offline.log').read_text() + if 'Successfully validated L2 block' not in log or sa['witness']['l2_claim'] not in log: + raise ValueError('Original output-root validation missing') + if gzip.decompress((a / 'out.bin.gz').read_bytes()) != gzip.decompress((b / 'out.bin.gz').read_bytes()): + raise ValueError('Complete uncompressed final Cannon state differs') + info['guest'] = {'circle': ca, 'rwx': cb, 'complete_state_byte_identical': True, + 'compressed_state_byte_identical': ca['final_state_sha256'] == cb['final_state_sha256']} + evidence['jobs'][job] = info + evidence['verified_parity'] = True + return evidence + + +if __name__ == '__main__': + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument('root', type=Path); parser.add_argument('sha') + parser.add_argument('--output', type=Path, required=True) + args = parser.parse_args() + result = compare(args.root, args.sha) + args.output.parent.mkdir(parents=True, exist_ok=True) + args.output.write_text(json.dumps(result, indent=2, sort_keys=True) + '\n') + print(json.dumps({'verified_parity': True, 'sha': args.sha, 'jobs': list(result['jobs'])})) diff --git a/ops/ci/migration/compare-rust-e2e.py b/ops/ci/migration/compare-rust-e2e.py new file mode 100644 index 00000000000..fbc6264abf6 --- /dev/null +++ b/ops/ci/migration/compare-rust-e2e.py @@ -0,0 +1,193 @@ +#!/usr/bin/env python3 +"""Compare complete original Rust E2E selection, builds and fresh Go verdicts.""" +import argparse +from collections import Counter +from datetime import datetime +import importlib.util +import json +from pathlib import Path +_SPEC_E = importlib.util.spec_from_file_location('report_evidence', Path(__file__).with_name('report-evidence.py')) +E = importlib.util.module_from_spec(_SPEC_E); _SPEC_E.loader.exec_module(E) +import re + + +def helper(name): + spec = importlib.util.spec_from_file_location(name.replace('-', '_'), (Path(__file__).parent if name.startswith('compare-') or name in ('flaky-report','selector-upload','selector-registry') else Path(__file__).resolve().parents[1] / 'runtime') / (name + '.py')) + module = importlib.util.module_from_spec(spec); spec.loader.exec_module(module) + return module + + +E2E = helper('rust-e2e') +COMPARE = helper('compare-ci') +EXTRA = helper('compare-rust-extra') +CONTRACTS = helper('compare-contract-artifacts') +REPORT = helper('ci-report') +EMPTY = REPORT.EMPTY_SHA256 +RELEASE_BINDING = ('source_sha', 'profile', 'features', 'scope', 'input_sha256', 'source_trees', + 'rustc', 'cargo', 'mold', 'rustflags', 'incremental') + + +def originals(directory, required, empty, label): + final = E2E.read(directory / 'final.json') + if final['exit_code'] != 0 or final['report_errors']: + raise ValueError('Failed or incomplete original E2E report: ' + label) + return E.verify_files(directory, final['original_sha256'], required=required, + missing_empty=empty if label.startswith('circle/') else None, label=label) + + +normalize = REPORT.normalize + + +def skip_comparison(job, key, circle, rwx, source=None): + if circle is None or rwx is None: raise ValueError('Unknown original E2E skip reason') + if circle == rwx: return {'package': key[0], 'name': key[1], 'reason': circle, 'comparison': 'strict'} + # Resolve the observed difference only for this unconditional in-tree skip. + # Keep severity, messages, scope and both original reasons; no general log + # or timestamp stripping can conceal a different test outcome or reason. + if (job not in ('simple-kona', 'simple-kona-sequencer') or key[1] != 'TestL2FinalizedSync' + or key[0] != E2E.PREFIX + E2E.JOBS[job]['package']): + raise ValueError('Original E2E skip reason differs: ' + str(key)) + declaration = r'func TestL2FinalizedSync\(gt \*testing\.T\) \{\s+t := devtest\.ParallelT\(gt\)\s+t\.Skip\("Skipping finalized sync test"\)' + if not source or not re.search(declaration, source): raise ValueError('Finalized-sync skip source changed') + timestamp = r'(\d{2}-\d{2}\|\d{2}:\d{2}:\d{2}\.\d{3})' + pattern = r'INFO \[' + timestamp + r'\] Running test in parallel scope=/TestL2FinalizedSync INFO \[' + timestamp + r'\] Skipping finalized sync test scope=/TestL2FinalizedSync' + for value in (circle, rwx): + match = re.fullmatch(pattern, value) + if not match: raise ValueError('Unresolved finalized-sync skip message, severity or scope difference') + for stamp in match.groups(): datetime.strptime('2000-' + stamp, '%Y-%m-%d|%H:%M:%S.%f') + normalized = re.sub(r'(?<=INFO )\[' + timestamp + r'\]', '[]', circle) + return {'package': key[0], 'name': key[1], 'reason': normalized, + 'original_reasons': {'circle': circle, 'rwx': rwx}, 'comparison': 'logger timestamps only', + 'source': 'rust/kona/tests/node/common/sync_test.go', + 'source_sha256': __import__('hashlib').sha256(source.encode()).hexdigest()} + + +def test_report(directory, job, sha, provider, empty, originals_index): + required = {'selection.json', 'coverage.json', 'original.json', 'native.json', 'native.metadata.json', 'assigned.txt', 'environment.nul'} + hashes = originals(directory, required, empty, provider + '/' + directory.name) + originals_index[directory.name] = hashes + record = E2E.read(directory / 'selection.json') + if (record['source_sha'] != sha or record['settings'] != E2E.settings(job) + or record['provider'] != {'circle': 'circleci', 'rwx': 'rwx'}[provider]): + raise ValueError('E2E job, source or effective workload differs') + if provider == 'rwx' and (not record['rwx_run_id'] or str(record['rwx_task_attempt']) != '1'): + raise ValueError('Missing fresh native E2E identity or task retry needs investigation') + metadata = {'package_prefix': E2E.PREFIX + E2E.JOBS[job]['package']} + source = {'feature': job, 'id': directory.name} + cases, failures = COMPARE.go_cases(directory / 'original.json', source, metadata) + if failures or any(c['outcome'] == 'fail' or len(c['attempts']) != 1 for c in cases): + raise ValueError('E2E package/case failure or unexpected retry') + keys = {(c['suite'], c['name']): c for c in cases} + junit = [] + for path in (directory / 'junit').glob('*.xml'): + junit.extend(COMPARE.junit_cases(path, {'feature': job, 'id': directory.name}, metadata)) + jk = {(c['suite'], c['name']): c for c in junit} + if len(jk) != len(junit) or jk.keys() != keys.keys() or any(jk[k]['outcome'] != keys[k]['outcome'] for k in keys): + raise ValueError('E2E original JUnit and JSON verdict identities/outcomes differ') + observed = E2E.read(directory / 'coverage.json') + assigned = set(record['assigned_tests']) + if {c['name'] for c in cases if '/' not in c['name']} != assigned: + raise ValueError('E2E original verdicts differ from complete assigned selection') + if observed['assigned'] != record['assigned_tests'] or observed['missing'] or observed['extra'] or observed['duplicates']: + raise ValueError('Incomplete E2E observed coverage') + E2E.invocations(record, directory) + return record, keys, source['package_attempts'] + + +def compare(root, sha): + if not re.fullmatch('[0-9a-f]{40}', sha): raise ValueError('Expected full E2E source SHA') + result = {'source_sha': sha, 'verified_parity': False, 'jobs': {}, 'original_sha256': {'circle': {}, 'rwx': {}}, + 'manifest_declared_empty_logs': [], 'settings_differences': []} + empty = result['manifest_declared_empty_logs'] + release_dirs = {p: root / p / 'release' for p in ('circle', 'rwx')} + releases = {} + for provider, directory in release_dirs.items(): + hashes = originals(directory, {'settings.json', 'coverage.json', 'workspace.json', 'workspace.stage.json', 'workspace.log', + 'build.json', 'build.log', 'build.stage.json', 'dependency.json', 'checks.junit.xml'}, empty, provider + '/release') + result['original_sha256'][provider]['release'] = hashes + settings, coverage = E2E.read(directory / 'settings.json'), E2E.read(directory / 'coverage.json') + if settings['source_sha'] != sha or settings['suite'] != 'rust-e2e' or settings['job'] != 'release': raise ValueError('Release source or workload differs') + if settings['provider'] != {'circle': 'circleci', 'rwx': 'rwx'}[provider]: raise ValueError('Release provider provenance differs') + if coverage['binding'] != {k: settings[k] for k in RELEASE_BINDING}: raise ValueError('Release build inputs changed') + stages = {} + for name in ('workspace', 'build'): + stage = E2E.read(directory / (name + '.stage.json')) + if stage['exit_code'] != 0: raise ValueError('Failed original release stage') + stages[name] = normalize({k: stage[k] for k in ('argv', 'cwd', 'exit_code')}, settings['workspace_root']) + packages = EXTRA.package_manifest(E2E.read(directory / 'workspace.json')) + targets = [{k: t[k] for k in ('package', 'target', 'kind', 'role', 'features', 'profile')} for t in coverage['targets']] + if not targets or len({json.dumps(t, sort_keys=True) for t in targets}) != len(targets): raise ValueError('Empty or duplicate release target coverage') + dependency = E2E.read(directory / 'dependency.json') + if dependency['commit_sha'] != sha or dependency['kind'] != 'rust-e2e-release': raise ValueError('Release artifact provenance differs') + if set(dependency['files']) != {v['path'] for v in coverage['binaries'].values()}: raise ValueError('Release binary archive coverage differs') + if any(dependency['files'][v['path']] != v['sha256'] for v in coverage['binaries'].values()): raise ValueError('Release binary hashes differ from compiled outputs') + releases[provider] = {'binding': coverage['binding'], 'packages': packages, 'targets': targets, + 'excluded': coverage['excluded_feature_gated_targets'], 'commands': stages, 'dependency': dependency, 'coverage': coverage} + a, b = releases['circle'], releases['rwx'] + for field in ('binding', 'packages', 'targets', 'excluded', 'commands'): + if a[field] != b[field]: raise ValueError('Complete release parity differs at ' + field) + if a['coverage']['binaries'].keys() != b['coverage']['binaries'].keys(): raise ValueError('Full workspace release binary selection differs') + result['jobs']['release'] = {'packages': len(a['packages']), 'targets': len(a['targets']), 'commands': a['commands'], + 'binaries': {name: {p: releases[p]['coverage']['binaries'][name] for p in releases} for name in a['coverage']['binaries']}, + 'comparison': 'Full original Cargo selection, settings and target completion; ELF byte hashes are retained separately.'} + for job, config in E2E.JOBS.items(): + selections, all_cases, histories = {}, {}, {} + for provider in ('circle', 'rwx'): + directories = sorted((root / provider).glob(job + '-[0-9]*')) + if len(directories) != config['shards']: raise ValueError('Missing E2E shard report: ' + provider + '/' + job) + rows, cases, history = [], {}, [] + for directory in directories: + record, current, package_attempts = test_report(directory, job, sha, provider, empty, result['original_sha256'][provider]) + if cases.keys() & current.keys(): raise ValueError('Duplicate E2E case across shards') + cases.update(current); rows.append(record); history.extend(package_attempts) + if sorted(r['shard_index'] for r in rows) != list(range(config['shards'])): raise ValueError('Duplicate or missing E2E initial shard') + names = rows[0]['tests'] + if not names or any(r['tests'] != names or r['excluded_listing'] != rows[0]['excluded_listing'] for r in rows): raise ValueError('E2E complete shard selection differs') + if Counter(n for r in rows for n in r['assigned_tests']) != Counter(names): raise ValueError('E2E initial test assignment is not exactly once') + selections[provider], all_cases[provider], histories[provider] = rows, cases, history + a, b = selections['circle'][0], selections['rwx'][0] + for field in ('source_sha', 'settings', 'tests', 'excluded_listing', 'durations', 'input_sha256', 'go_version', 'go_environment', 'branch'): + if a[field] != b[field]: raise ValueError(job + ': E2E selection or settings differ at ' + field) + if normalize(a['environment'], a['workspace_root']) != normalize(b['environment'], b['workspace_root']): raise ValueError('E2E runtime roles or binaries differ') + # Proofs may deliberately use fewer workers than Circle's host nproc. + # Other recipes retain Go's default; arbitrary flag drift is an error. + if job != 'proof' and (a['parallel_flag'] is not None or b['parallel_flag'] is not None): + raise ValueError('Node/reth E2E must preserve default Go parallelism') + for field in ('effective_parallel', 'go_runtime_defaults'): + if a[field] != b[field]: result['settings_differences'].append({'job': job, 'field': field, 'circle': a[field], 'rwx': b[field]}) + if a['runtime_settings'] != b['runtime_settings']: raise ValueError('E2E runtime setting differences need investigation: ' + job) + ac, bc = all_cases['circle'], all_cases['rwx'] + if ac.keys() != bc.keys(): raise ValueError(job + ': Missing or extra original E2E case identities') + skips = [] + for key in ac: + if ac[key]['outcome'] != bc[key]['outcome']: raise ValueError(job + ': E2E case outcome differs: ' + str(key)) + if ac[key]['outcome'] == 'skip': + sa, sb = (normalize(c[key]['skip_reason'], selections[p][0]['workspace_root']) for p, c in [('circle', ac), ('rwx', bc)]) + source = E2E.subprocess.check_output(['git', 'show', sha + ':rust/kona/tests/node/common/sync_test.go'], + cwd=E2E.ROOT, text=True) if sa != sb and key[1] == 'TestL2FinalizedSync' else None + skips.append(skip_comparison(job, key, sa, sb, source)) + result['jobs'][job] = {'settings': a['settings'], 'top_level_selection': a['tests'], 'cases': len(ac), + 'outcomes': dict(Counter(c['outcome'] for c in ac.values())), 'skips': skips, 'retries': 0, + 'shard_assignments': {p: [{'index': r['shard_index'], 'tests': r['assigned_tests']} for r in rows] for p, rows in selections.items()}, + 'package_invocations': histories} + for kind in ('contracts', 'prestate'): + a, b = (E2E.read(root / p / kind / 'metadata.json') for p in ('circle', 'rwx')) + for field in ('version', 'kind', 'commit_sha', 'settings', 'mise_sha256'): + if a[field] != b[field] or (field == 'commit_sha' and a[field] != sha): raise ValueError(kind + ': dependency input binding differs') + if kind == 'prestate' and a['files'] != b['files']: raise ValueError('Complete reproducible prestate file hashes differ') + result['jobs'][kind] = {'metadata': {'circle': a, 'rwx': b}, 'file_hashes_equal': a['files'] == b['files']} + result['jobs']['contracts']['complete_artifact_comparison'] = CONTRACTS.compare( + {p: root / p / 'contracts' for p in ('circle', 'rwx')}, sha) + # Setting differences remain explicit; they are not textual setting parity. + result['verified_parity'] = True + return result + + +if __name__ == '__main__': + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument('--root', type=Path, required=True); parser.add_argument('--sha', required=True) + parser.add_argument('--output', type=Path, required=True); args = parser.parse_args() + result = compare(args.root, args.sha); args.output.write_text(json.dumps(result, indent=2, sort_keys=True) + '\n') + print(json.dumps({'source_sha': args.sha, 'verified_parity': result['verified_parity'], + 'jobs': {k: {p: v[p] for p in ('cases', 'outcomes', 'packages', 'targets') if p in v} for k, v in result['jobs'].items()}, + 'settings_differences': result['settings_differences']})) diff --git a/ops/ci/migration/compare-rust-extra.py b/ops/ci/migration/compare-rust-extra.py new file mode 100644 index 00000000000..1ab6fb470ce --- /dev/null +++ b/ops/ci/migration/compare-rust-extra.py @@ -0,0 +1,174 @@ +#!/usr/bin/env python3 +"""Compare complete original Circle/RWX reports for the remaining Rust checks.""" +import argparse +import hashlib +import importlib.util +import json +from pathlib import Path +_SPEC_E=importlib.util.spec_from_file_location('report_evidence',Path(__file__).with_name('report-evidence.py')) +E=importlib.util.module_from_spec(_SPEC_E);_SPEC_E.loader.exec_module(E) +import re + +JOBS = ('wasm-unknown', 'wasm-wasi', 'zepter', 'typos', 'deny', 'registry', 'interop') +STAGES = {'wasm-unknown': ('wasm-target', 'wasm-list', 'wasm'), + 'wasm-wasi': ('wasm-target', 'wasm-list', 'wasm'), + 'deny': ('deny',), 'zepter': ('zepter',), 'typos': ('typos',), + 'registry': ('registry-clean', 'registry', 'registry-diff'), + 'interop': ('superchain-go', 'interop')} +EMPTY_LOGS = {'workspace.log', 'typos.log', 'registry-diff.log', + 'interop-go.stderr', 'interop-rust.stderr'} + + +def read(path): + return json.loads(path.read_text()) + + +def digest(path): + with path.open('rb') as source: + return hashlib.file_digest(source, 'sha256').hexdigest() + + +def package_manifest(metadata): + packages = {p['id']: p for p in metadata['packages']} + members = metadata['workspace_members'] + if not members or len(members) != len(set(members)): + raise ValueError('Empty or duplicate workspace membership') + result = {} + for member in members: + p = packages[member] + if p['name'] in result: + raise ValueError('Duplicate workspace package name') + result[p['name']] = {k: p[k] for k in ('version', 'features')} | { + 'targets': [{k: t[k] for k in ('name', 'kind', 'required-features') if k in t} + for t in p['targets']]} + return result + + +def host_linker_report(directory): + report = read(directory / 'host-linker.log') + files = report.get('files', []) + if report.get('schema') != 1 or report.get('success') is not True or not files: + raise ValueError('Unsuccessful host linker preparation') + paths = [row['path'] for row in files] + if len(paths) != len(set(paths)) or not {'crti.o', 'crtbeginS.o', 'libgcc.a'} <= {Path(p).name for p in paths}: + raise ValueError('Incomplete host linker inputs') + for row in files: + path = Path(row['path']) + if (not path.is_absolute() or '..' in path.parts or not path.is_relative_to('/usr/lib') + or row.get('detached') is not True or row['original_inode'] == row['local_inode'] + or not re.fullmatch('[0-9a-f]{64}', row['sha256']) or row['bytes'] <= 0 + or not 1 <= row['read_attempts'] <= 3 + or row['read_timeouts'] != row['read_attempts'] - 1 or row['seconds'] < 0): + raise ValueError('Invalid host linker materialization evidence') + return report + + +def compare(root, sha): + if not re.fullmatch('[0-9a-f]{40}', sha): + raise ValueError('Expected a full source SHA') + result = {'source_sha': sha, 'verified_parity': False, 'jobs': {}, + 'original_sha256': {}, 'manifest_declared_empty_logs': []} + for provider in ('circle', 'rwx'): + result['original_sha256'][provider] = {} + for job in JOBS: + directory = root / provider / job + settings, final = read(directory / 'settings.json'), read(directory / 'final.json') + if settings['source_sha'] != sha or settings['job'] != job: + raise ValueError(f'{provider}/{job}: source or job mismatch') + if final['exit_code'] != 0 or final['report_errors'] or not final['stages']: + raise ValueError(f'{provider}/{job}: unsuccessful or incomplete report') + if provider == 'rwx' and (not settings.get('rwx_run_id') or str(settings.get('rwx_task_attempt')) != '1'): + raise ValueError(f'{provider}/{job}: missing fresh identity or task retries require investigation') + hashes = final['original_sha256'] + required = {'settings.json', 'workspace.json', 'checks.junit.xml'} + stages = ('workspace',) + STAGES[job] + if provider == 'rwx' and job.startswith('wasm-'): + stages += ('host-linker',) + required.update(name + suffix for name in stages for suffix in ('.log', '.stage.json')) + if job.startswith('wasm-'): + required.update({'wasm-coverage.json', 'wasm-artifacts.json'}) + if job == 'registry': + required.add('registry-coverage.json') + required.update(f'registry-{phase}-{name}.json' for phase in ('before', 'after') + for name in ('chainList', 'configs', 'depsets')) + if job == 'interop': + required.add('interop-coverage.json') + required.update(f'interop-{language}.{suffix}' for language in ('go', 'rust') + for suffix in ('stdout', 'stderr', 'exit')) + if not required <= hashes.keys() or set(final['stages']) != set(stages): + raise ValueError(f'{provider}/{job}: incomplete original manifest') + for name in stages: + if final['stages'][name] != read(directory / (name + '.stage.json')): + raise ValueError(f'{provider}/{job}: summary differs from original stage {name}') + recovered=[] + try: + E.verify_files(directory, hashes, required=required, + missing_empty=recovered if provider == 'circle' else None, + recoverable=EMPTY_LOGS, label=provider+'/'+job) + except OSError as error: + raise ValueError('missing original: '+str(error)) from error + except ValueError as error: + raise ValueError('corrupt original: '+str(error)) from error + result['manifest_declared_empty_logs'].extend( + {'job':job,'name':row['path'],'sha256':row['sha256']} for row in recovered) + result['original_sha256'][provider][job] = hashes + for job in JOBS: + a, b = (root / provider / job for provider in ('circle', 'rwx')) + sa, sb = read(a / 'settings.json'), read(b / 'settings.json') + for key in ('job', 'suite', 'source_sha', 'input_sha256', 'rustc', 'cargo', 'nextest', + 'incremental', 'rustflags', 'rustdocflags', 'superchain_revision', 'extra_tool'): + if sa.get(key) != sb.get(key): + raise ValueError(f'{job}: settings differ at {key}') + packages = package_manifest(read(a / 'workspace.json')) + if packages != package_manifest(read(b / 'workspace.json')): + raise ValueError(f'{job}: complete workspace manifests differ') + stages_a, stages_b = read(a / 'final.json')['stages'], read(b / 'final.json')['stages'] + projection = lambda stages: {name: {k: s[k] for k in ('argv', 'cwd', 'exit_code')} + for name, s in stages.items() if name in ('workspace',) + STAGES[job]} + if projection(stages_a) != projection(stages_b) or any(s['exit_code'] != 0 for s in [*stages_a.values(), *stages_b.values()]): + raise ValueError(f'{job}: original commands, working directories or outcomes differ') + info = {'packages': len(packages), 'stages': projection(stages_a), 'outcome': 'pass', 'retries': 0} + filename = {'wasm-unknown': 'wasm-coverage.json', 'wasm-wasi': 'wasm-coverage.json', + 'registry': 'registry-coverage.json', 'interop': 'interop-coverage.json'}.get(job) + if filename: + coverage = read(a / filename) + if coverage != read(b / filename): + raise ValueError(f'{job}: full coverage differs') + info['coverage'] = coverage + if job.startswith('wasm-'): + preparation = stages_b['host-linker'] + argv = preparation['argv'] + if (len(argv) != 3 or argv[:2] != ['sudo', 'python3'] or + not argv[2].endswith('/ops/ci/runtime/rwx-materialize-linker.py') or preparation['cwd'] != '.'): + raise ValueError('Unexpected host linker preparation command') + info['rwx_preparation'] = {'stage': preparation, 'evidence': host_linker_report(b), + 'comparison': 'RWX-only local materialization of unchanged host linker inputs; original Cargo commands remain identical.'} + artifacts_a, artifacts_b = read(a / 'wasm-artifacts.json'), read(b / 'wasm-artifacts.json') + for key in ('source_sha', 'target', 'rustc'): + if artifacts_a[key] != artifacts_b[key]: + raise ValueError('WASM artifact provenance differs') + if artifacts_a['artifacts'].keys() != artifacts_b['artifacts'].keys(): + raise ValueError('WASM artifact inventories differ') + info['library_artifacts'] = {'circle': artifacts_a, 'rwx': artifacts_b, + 'byte_identical': artifacts_a == artifacts_b, + 'comparison': 'Inputs, settings, package execution and successful library production; host archive byte reproducibility is not required.'} + if job == 'interop': + if (a / 'interop-go.stdout').read_bytes() != (b / 'interop-go.stdout').read_bytes(): + raise ValueError('Interop original stdout differs between providers') + if (a / 'checks.junit.xml').read_bytes() != (b / 'checks.junit.xml').read_bytes(): + raise ValueError(f'{job}: original JUnit differs') + result['jobs'][job] = info + result['verified_parity'] = True + return result + + +if __name__ == '__main__': + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument('root', type=Path) + parser.add_argument('sha') + parser.add_argument('--output', type=Path, required=True) + args = parser.parse_args() + evidence = compare(args.root, args.sha) + args.output.parent.mkdir(parents=True, exist_ok=True) + args.output.write_text(json.dumps(evidence, indent=2, sort_keys=True) + '\n') + print(json.dumps({'verified_parity': True, 'sha': args.sha, 'jobs': list(evidence['jobs'])})) diff --git a/ops/ci/migration/compare-selector-upload.py b/ops/ci/migration/compare-selector-upload.py new file mode 100644 index 00000000000..265b1e8b5c2 --- /dev/null +++ b/ops/ci/migration/compare-selector-upload.py @@ -0,0 +1,388 @@ +#!/usr/bin/env python3 +"""Compare complete original private selector publisher executions on one SHA.""" +import argparse +from collections import Counter +import datetime +import hashlib +import importlib.util +import json +from pathlib import Path +import re +import subprocess + + +def helper(name): + spec = importlib.util.spec_from_file_location(name, (Path(__file__).parent if name.startswith('compare-') or name in ('flaky-report','selector-upload','selector-registry') else Path(__file__).resolve().parents[1] / 'runtime') / (name + '.py')) + module = importlib.util.module_from_spec(spec) + spec.loader.exec_module(module) + return module + + +U = helper('selector-upload') +G = helper('compare-pr-gates') +R = U.R +read, check = U.read, R.check + + +def normalized(value, workspace): + """Only an actual workspace path prefix is provider-specific.""" + if isinstance(value, dict): + return {key: normalized(item, workspace) for key, item in value.items()} + if isinstance(value, list): + return [normalized(item, workspace) for item in value] + if isinstance(value, str) and (value == workspace or value.startswith(workspace + '/')): + return '$WORKSPACE' + value[len(workspace):] + return value + + +def fingerprint(value): + return hashlib.sha256(json.dumps(value, sort_keys=True, separators=(',', ':')).encode()).hexdigest() + + +def authority(settings): + sha = settings['source_sha'] + check(re.fullmatch('[0-9a-f]{40}', sha), 'Invalid original source revision') + expected = G.source_inputs(sha) + inputs = settings['inputs'] + # The runtime reader checked every recursive submodule blob against its Git + # object. Independently bind the complete parent tree here, including modes. + tree = subprocess.check_output(['git', 'ls-tree', '-rz', sha], cwd=G.ROOT) + for entry in tree.split(b'\0'): + if not entry: + continue + header, name = entry.split(b'\t', 1) + mode, kind, oid = header.decode().split() + name = name.decode() + row = inputs[name] + check(row['mode'] == mode, 'Changed original source mode: ' + name) + if kind == 'commit': + check(row == {'mode': mode, 'gitlink': oid, 'checkout': 'initialized'} + and any(key.startswith(name + '/') for key in inputs), 'Missing initialized source submodule') + else: + wanted = (hashlib.sha256(expected[name]['symlink'].encode()).hexdigest() + if mode == '120000' else expected[name]) + check(row == {'mode': mode, 'sha256': wanted}, 'Changed committed selector source: ' + name) + modules = [name for name, row in inputs.items() if row.get('mode') == '160000'] + check(set(inputs) - set(expected) == {name for name in inputs if any(name.startswith(m + '/') for m in modules)}, + 'Foreign source inputs outside initialized submodules') + check(settings['implementation'] == {name: hashlib.sha256(G.source(str(Path(U.helper(name[:-3]).__file__).resolve().relative_to(U.ROOT)), sha)).hexdigest() + for name in U.IMPLEMENTATION}, 'Uncommitted selector implementation') + check(settings['version'] == 1 and settings['profile'] == 'default' + and settings['command'] == U.COMMAND and settings['branch'] == 'codex/rwx-ci-pilot' + and set(settings['compilers']) == set(U.COMPILERS), + 'Wrong original selector selection or profile') + + +def compiler(directory, workspace): + cache = read(directory / 'compiler-cache.json') + units = {p.stem: read(p) for p in sorted((directory / 'compiler-units').glob('*.json'))} + artifacts = {str(p.relative_to(directory / 'compiler-artifacts')): read(p) + for p in sorted((directory / 'compiler-artifacts').rglob('*.json'))} + # artifacts/build-info is outside forge-artifacts in this repository. + selection = U.catalog(cache, units, artifacts) + check(selection == read(directory / 'selection.json'), 'Changed original complete ABI selection') + fingerprints = {} + for key, unit in units.items(): + value = normalized({name: data for name, data in unit.items() if name != 'id'}, workspace) + fingerprints[key] = fingerprint(value) + check(len(set(fingerprints.values())) == len(fingerprints), 'Duplicate original compiler unit') + logical = normalized(selection, workspace) + for row in logical['declarations'].values(): + row['build_id'] = fingerprints[row['build_id']] + # Foundry picks an ID from the first completed profile; U.catalog binds + # it to the same source/version and validates the exact unit separately. + row.pop('artifact_source_id') + logical_cache = normalized(cache, workspace) + logical_cache['builds'] = sorted(fingerprints.values()) + logical_cache['mocks'] = sorted(logical_cache['mocks']) + for row in logical_cache['files'].values(): + check(type(row['lastModificationDate']) is int and row['lastModificationDate'] >= 0, + 'Invalid original compiler source mtime') + row.pop('lastModificationDate') + for versions in row['artifacts'].values(): + for profiles in versions.values(): + for artifact in profiles.values(): + artifact['build_id'] = fingerprints[artifact['build_id']] + return {'selection': logical, 'cache': logical_cache, 'units': sorted(fingerprints.values())} + + +def protocol(directory, wanted): + actual = U.imports(directory, wanted) + frames = [] + for i in range(actual['requests']): + request = read(directory / ('http-' + str(i) + '-request.json')) + response = read(directory / ('http-' + str(i) + '-response.json')) + check(sum(len(values) for values in request.values()) > 0, 'Empty publisher POST') + frames.append({'request': {kind: sorted(values) for kind, values in request.items()}, 'response': response}) + return actual, frames + + +def process(directory, argv, cwd): + row = read(directory / 'execution.json') + check(row['argv'] == argv and row['cwd'] == cwd and type(row['exit_code']) is int and row['exit_code'] == 0 + and row['timed_out'] is False and row['signals'] == [] + and isinstance(row['elapsed_seconds'], (int, float)) and row['elapsed_seconds'] > 0 + and isinstance(row['started_at'], (int, float)) and row['started_at'] > 0 + and row['stdout_sha256'] == R.digest(directory / 'stdout.log') + and row['stderr_sha256'] == R.digest(directory / 'stderr.log'), 'Missing, failed or corrupt real execution') + isolation = read(directory / 'isolation.json') + check(type(isolation['uid']) is int and isolation['uid'] > 0 + and type(isolation['gid']) is int and isolation['gid'] > 0 and isolation['pid'] == 1 + and isolation['interfaces'] == [[1, 'lo']] and isolation['no_new_privileges'] is True + and isolation['destination'] == 'https://' + R.HOST + R.IMPORT + and {v['address'] for v in isolation['external_blocked']} == {'1.1.1.1', '2606:4700:4700::1111'} + and all(type(v['errno']) is int and v['errno'] == 101 for v in isolation['external_blocked']), + 'Publisher destination isolation changed') + return row + + +def readback(directory, wanted): + hashes = wanted['hash32'] + expected = {'function': {}, 'event': {}} + for signature, digest in hashes.items(): + check(re.fullmatch('0x[0-9a-f]{64}', digest), 'Invalid full selector digest') + expected['function'].setdefault(digest[:10], []).append(signature) + expected['event'].setdefault(digest, []).append(signature) + observed = read(directory / 'lookup.json') + check(set(observed) == set(expected), 'Incomplete original readback kinds') + for kind, values in expected.items(): + check(set(observed[kind]) == set(values), 'Missing or extra readback digest') + for digest, names in values.items(): + rows = observed[kind][digest] + check(all(set(row) == {'name', 'filtered', 'hasVerifiedContract'} and type(row['filtered']) is bool + and row['hasVerifiedContract'] is False for row in rows) + and sorted(row['name'] for row in rows) == sorted(names), 'Missing, foreign or corrupt readback signature') + # Re-derive the aggregate from every original captured GET and response. + import urllib.parse + combined = {'function': {}, 'event': {}} + metadata = [p for p in (directory / 'registry/lookup').glob('http-*.json') if re.fullmatch(r'http-\d+', p.stem)] + metadata.sort(key=lambda p: int(p.stem.split('-')[1])) + for i, path in enumerate(metadata): + row = read(path) + check(path.stem == 'http-' + str(i) and row['method'] == 'GET' and row['host'] == R.HOST + and row['status'] == 200, 'Missing or failed original lookup request') + request, response = path.with_name(path.stem + '-request.json'), path.with_name(path.stem + '-response.json') + check(request.read_bytes() == b'' and R.digest(request) == row['request_sha256'] + and R.digest(response) == row['response_sha256'], 'Corrupt original lookup payload') + url = urllib.parse.urlsplit(row['path']) + query = urllib.parse.parse_qs(url.query) + kinds = set(query) - {'filter'} + check(url.path == R.LOOKUP and query.get('filter') == ['false'] and len(kinds) == 1 + and kinds <= set(combined), 'Changed real lookup query') + kind = kinds.pop() + check(len(query[kind]) == 1, 'Repeated lookup query') + keys = query[kind][0].split(',') + value = read(response) + other = 'function' if kind == 'event' else 'event' + check(0 < len(keys) <= 50 and len(set(keys)) == len(keys) and not (set(keys) & set(combined[kind])) + and value['ok'] is True and set(value['result']) == set(combined) + and set(value['result'][kind]) == set(keys) and value['result'][other] == {}, + 'Incomplete or repeated original lookup response') + combined[kind].update(value['result'][kind]) + check(combined == observed, 'Derived readback differs from complete original HTTP responses') + return {kind: {key: sorted(value, key=lambda row: row['name']) for key, value in rows.items()} + for kind, rows in observed.items()} + + +def report(directory): + U.original(directory, 'passed') + prepared = directory / 'prepared' + U.original(prepared, 'compiled') + settings = read(directory / 'settings.json') + authority(settings) + check(all(read(prepared / 'settings.json')[key] == settings[key] for key in + ('version', 'source_sha', 'branch', 'profile', 'workspace_root', 'tools', 'compilers', + 'command', 'configuration', 'inputs', 'implementation')), 'Stale preparation identity') + workspace = settings['workspace_root'] + check(isinstance(workspace, str) and Path(workspace).is_absolute(), 'Missing original workspace') + stable, initial = compiler(prepared, workspace), compiler(prepared / 'initial-discovery', workspace) + check(read(prepared / 'foundry-config.json') == settings['configuration'], 'Changed original Foundry settings') + wanted = read(prepared / 'expected.json') + selected = stable['selection'] + groups = {'function': set(), 'event': set()} + for key in selected['selected']: + for row in selected['declarations'][key]['signatures']: + groups['event' if row['kind'] == 'event' else 'function'].add(row['signature']) + check(set(wanted) == {'signatures', 'hash32'} and set(wanted['signatures']) == set(groups) + and set(wanted['hash32']) == set.union(*groups.values()), 'Changed complete selector expectation') + for kind, names in groups.items(): + check(wanted['signatures'][kind] == {name: wanted['hash32'][name] if kind == 'event' + else wanted['hash32'][name][:10] for name in names}, 'Corrupt selected digest binding') + compilers = read(prepared / 'selected-compilers.json') + initial_versions = {read(p)['solcVersion'] for p in (prepared / 'initial-discovery/compiler-units').glob('*.json')} + stable_versions = {read(p)['solcVersion'] for p in (prepared / 'compiler-units').glob('*.json')} + check(compilers == read(prepared / 'initial-discovery/selected-compilers.json') + and set(compilers) == initial_versions and stable_versions <= initial_versions + and all(compilers[key] == settings['compilers'][key] for key in set(compilers) & set(settings['compilers'])), + 'Unstable original compiler resolution') + recipe = read(directory / 'recipe.stage.json') + check(recipe['argv'] == ['just', '--dry-run', 'update-selectors'] and recipe['exit_code'] == 0 + and (directory / 'recipe.log').read_bytes() == b'' + and (directory / 'recipe.stderr.log').read_text().strip() == 'forge selectors up --all', 'Changed original publisher recipe') + upload = directory / 'registry/upload' + execution = process(upload, U.COMMAND, workspace + '/packages/contracts-bedrock') + names = Counter(selected['declarations'][key]['contract'] for key in selected['selected']) + actual_names = Counter(re.findall(r'^Uploading selectors for ([A-Za-z_$][A-Za-z0-9_$]*)\.\.\.$', + (upload / 'stderr.log').read_text(), re.MULTILINE)) + check(names == actual_names and 'Selectors successfully uploaded to OpenChain' in (upload / 'stdout.log').read_text(), + 'Actual publisher omitted declarations or success output') + imports, frames = protocol(upload, wanted) + check(imports == read(directory / 'imports.json') and all(not row['duplicated'] for row in imports['outcomes'].values()), + 'Changed original upload summary or reused destination') + check(read(directory / 'registry/initial-rows.json') == [], 'Destination contains restored results') + rows = read(upload / 'database-rows.json') + check(len(rows) == len(wanted['hash32']) and {row['signature']: row['hash32'] for row in rows} == wanted['hash32'], + 'Missing, duplicate or foreign database signatures') + for row in rows: + check(set(row) == {'signature', 'hash4', 'hash32', 'created_at'} and row['hash4'] == row['hash32'][:10], + 'Corrupt database signature') + when = datetime.datetime.fromisoformat(row['created_at'].replace('Z', '+00:00')).timestamp() + check(execution['started_at'] - 1 <= when <= execution['started_at'] + execution['elapsed_seconds'] + 1, + 'Database row was not created by this fresh upload') + lookup_execution = read(directory / 'registry/lookup/execution.json') + argv = lookup_execution['argv'] + check(len(argv) == 5 and argv[2] == 'lookup-client' + and argv[1] == workspace + '/ops/ci/migration/selector-upload.py' + and argv[4] == workspace + '/.ci/selector-upload/run/lookup.json', 'Changed real readback command') + process(directory / 'registry/lookup', argv, workspace + '/packages/contracts-bedrock') + source = read(directory / 'registry/registry-source.json') + check(source['repository'] == 'https://github.com/argotorg/sourcify' and source['source_sha'] == R.SOURCIFY_SHA + and source['helper_sha256'] == settings['implementation']['selector-registry.py'], 'Wrong actual registry source') + for key, path in [('schema_sha256', R.SCHEMA), ('dockerfile_sha256', 'services/4byte/Dockerfile'), + ('lockfile_sha256', 'package-lock.json')]: + check(source[key] == source['inputs'][path]['sha256'], 'Changed registry build input') + service = read(directory / 'registry/service-content.json') + for name, digest in service.items(): + U.safe_relative(name) + check(re.fullmatch('[0-9a-f]{64}', digest), 'Corrupt running registry byte digest') + committed = source['inputs'].get('services/4byte/' + name) + if committed: + check(committed['sha256'] == digest, 'Running service differs from committed source') + check('dist/cli.js' in service and 'src/cli.ts' in service, 'Missing running service byte inventory') + images = read(directory / 'registry/image-ids.json') + check(set(images) == {R.REGISTRY_IMAGE, R.POSTGRES_IMAGE} + and all(re.fullmatch('sha256:[0-9a-f]{64}', value) for value in images.values()), 'Wrong actual image identities') + containers = read(directory / 'registry/containers.json') + check(len(containers) == 2 and containers[0]['HostConfig']['NetworkMode'] == 'none' + and containers[1]['HostConfig']['NetworkMode'] == 'container:' + containers[0]['Id'] + and all(not row['HostConfig']['PortBindings'] and row['State']['Running'] for row in containers) + and containers[0]['Image'] == images[R.POSTGRES_IMAGE] and containers[1]['Image'] == images[R.REGISTRY_IMAGE] + and containers[1]['Config']['User'] == '1000:1000' and containers[1]['HostConfig']['ReadonlyRootfs'] is True, + 'Actual registry containers differ from isolated producers') + return {'settings': settings, 'initial': initial, 'stable': stable, 'expected': wanted, 'compilers': compilers, + 'imports': imports, 'frames': frames, 'readback': readback(directory, wanted), + 'database': [{key: value for key, value in row.items() if key != 'created_at'} for row in rows], + 'registry_source': source, 'service': service} + + +def circle_replay_job(source, compiled, job_name): + """Bind Circle's generated job alias to the original isolated publisher.""" + original = source['workflows']['selector-upload-replay']['jobs'] + check(len(original) == 1 and set(original[0]) == {'contracts-bedrock-upload'} + and original[0]['contracts-bedrock-upload'].get('selector_shadow') is True, + 'Wrong original Circle replay selection') + selected = compiled['workflows']['selector-upload-replay']['jobs'] + check(re.fullmatch(r'contracts-bedrock-upload(?:-[1-9][0-9]*)?', job_name) + and len(selected) == 1 and set(selected[0]) == {job_name} + and job_name in compiled['jobs'], 'Wrong actual Circle replay selection') + return compiled['jobs'][job_name] + + +def hosted(circle, native, run_path, github_path): + s = read(native / 'settings.json') + run = read(run_path) + check(run['ID'] == run['RunID'] == s['native_run_id'] and run['CommitSha'] == s['source_sha'] + and run['Branch'] == s['branch'] and run['Trigger'] == 'github.push' + and run['DefinitionPath'] == '.rwx/selector-upload.yml' and run['TargetedTaskKeys'] is None, + 'Foreign, prototype or manually targeted native execution') + tasks = G.named(run['Tasks'], 'Key') + G.fresh(tasks['upload']); G.fresh(tasks['helper-tests']) + check(s['native_task_attempt'] == '1', 'Uninvestigated native upload retry') + sha = s['source_sha'] + c = read(circle / 'settings.json') + check(c == {'provider': 'circleci', 'source_sha': sha, 'branch': s['branch'], + 'pipeline_id': c['pipeline_id'], 'workflow_id': c['workflow_id'], 'job_number': c['job_number']}, + 'Changed Circle evidence identity') + envelope = read(circle / 'final.json') + check(envelope['sha256'] == {str(p.relative_to(circle)): R.digest(p) for p in sorted(circle.rglob('*')) + if p.is_file() and p != circle / 'final.json'}, 'Missing or corrupt Circle collection') + pipeline, workflow, job = (read(circle / name) for name in ('pipeline.json', 'workflow.json', 'job.json')) + check(pipeline['id'] == c['pipeline_id'] and pipeline['vcs']['revision'] == sha + and pipeline['vcs']['branch'] == s['branch'] and not pipeline['errors'] + and workflow['id'] == c['workflow_id'] and workflow['pipeline_id'] == c['pipeline_id'] + and workflow['name'] == 'selector-upload-replay' and workflow['status'] == 'success', 'Foreign Circle replay') + pages = sorted((circle / 'api-pages').glob('jobs-*.json'), key=lambda p: int(p.stem.split('-')[1])) + check([p.name for p in pages] == ['jobs-' + str(i) + '.json' for i in range(len(pages))], 'Missing Circle job page') + jobs = [] + for i, p in enumerate(pages): + page = read(p); jobs.extend(page['items']) + check(bool(page.get('next_page_token')) == (i < len(pages) - 1), 'Incomplete Circle pagination') + check(len(jobs) == 1 and jobs[0]['status'] == 'success' + and jobs[0]['job_number'] == c['job_number'] and job['workflows']['job_id'] == jobs[0]['id'] + and job['build_num'] == c['job_number'] and job['vcs_revision'] == sha and job['branch'] == s['branch'] + and job['workflows']['workflow_id'] == c['workflow_id'] and job['status'] == job['outcome'] == 'success' + and not job['retry_of'] and all(job[key] is False for key in ('failed', 'timedout', 'canceled', 'infrastructure_fail')), + 'Failed, skipped or retried original Circle publisher') + config = read(circle / 'pipeline-config.json') + check(config['compiled'] == (circle / 'compiled.yml').read_text() + and config['source'] == (circle / 'source.yml').read_text(), 'Changed original compiled Circle configuration') + compiled = G.yaml(circle / 'compiled.yml') + publisher = circle_replay_job(G.yaml(circle / 'source.yml'), compiled, jobs[0]['name']) + commands = [step['run']['command'] for step in publisher['steps'] + if isinstance(step, dict) and isinstance(step.get('run'), dict)] + check(any('python3 ops/ci/migration/selector-upload.py run .ci/selector-upload/run' in command for command in commands) + and 'just update-selectors' not in commands, 'Actual Circle publisher was not isolated') + preparation = circle / 'archive/prepare.console.log' + check(preparation.is_file() and preparation.stat().st_size > 0 + and any('> .ci/selector-upload/prepare.console.log 2>&1' in command for command in commands), + 'Missing complete original Circle preparation console') + # The preparation artifact and its full stream are retained separately + # from the publisher report; both remain bound by the collection seal. + check((circle / 'selector-registry-originals.tar.gz').is_file(), 'Missing original Circle registry preparation archive') + index = read(circle / 'step-index.json') + actions = [(i, j) for i, step in enumerate(job['steps']) for j, action in enumerate(step['actions']) if action.get('output_url')] + check([(row['step'], row['action']) for row in index] == actions, 'Missing complete original Circle step logs') + for row in index: + events = read(circle / row['path']) + check(all(event.get('truncated') is False and isinstance(event['message'], str) for event in events), 'Truncated Circle originals') + original_steps = [row for row in index if row['name'] == 'Run original selector publisher against private official registry'] + check(len(original_steps) == 1 and original_steps[0]['status'] == 'success', 'Missing executed original Circle publisher') + github = read(github_path) + checks = G.named(github['checks'], 'name') + native_check = checks['RWX: optimism-selector-upload-shadow'] + check(github['sha'] == sha and native_check['state'] == 'success' + and '/runs/' + run['ID'] in native_check['link'], 'Missing successful same-SHA optional native check') + return {'circle_pipeline': pipeline['number'], 'circle_job': job['build_num'], 'native_run': run['ID']} + + +def compare(circle, native, run_path, github_path): + ids = hosted(circle, native, run_path, github_path) + values = {'circleci': report(circle / 'report'), 'rwx': report(native)} + c, n = values['circleci'], values['rwx'] + check(c['settings']['provider'] == 'circleci' and n['settings']['provider'] == 'rwx', 'Wrong original providers') + for key in ('version', 'source_sha', 'branch', 'profile', 'tools', 'compilers', 'command', 'inputs', 'implementation'): + check(c['settings'][key] == n['settings'][key], 'Original publisher identity differs: ' + key) + check(normalized(c['settings']['configuration'], c['settings']['workspace_root']) + == normalized(n['settings']['configuration'], n['settings']['workspace_root']), 'Original Foundry settings differ') + for key in ('initial', 'stable', 'expected', 'compilers', 'imports', 'frames', 'readback', 'database', 'registry_source', 'service'): + check(c[key] == n[key], 'Complete original selector parity differs: ' + key) + return {'verified_parity': True, 'source_sha': c['settings']['source_sha'], **ids, + 'selected_declarations': len(c['stable']['selection']['selected']), + 'compiled_sources': len(c['stable']['selection']['compiled_sources']), + 'signatures': {kind: len(rows) for kind, rows in c['expected']['signatures'].items()}, + 'database_signatures': len(c['database']), 'requests': c['imports']['requests'], + 'original_manifest_sha256': {'circleci': R.digest(circle / 'report/final.json'), 'rwx': R.digest(native / 'final.json')}, + 'complete_original_files': {'circleci': len(U.files(circle / 'report')) + 1, 'rwx': len(U.files(native)) + 1}, + 'normalizations': ['workspace path prefixes', 'compiler source mtimes', + 'profile completion dependent artifact IDs after exact unit validation', + 'POST signature array ordering', 'database insertion timestamps', 'API result array ordering']} + + +if __name__ == '__main__': + parser = argparse.ArgumentParser(description=__doc__) + for key in ('circle', 'native', 'run', 'github', 'output'): + parser.add_argument('--' + key, type=Path, required=True) + args = parser.parse_args() + result = compare(args.circle, args.native, args.run, args.github) + R.write(args.output, result) + print(json.dumps(result)) diff --git a/ops/ci/migration/compare-sp1-guest.py b/ops/ci/migration/compare-sp1-guest.py new file mode 100644 index 00000000000..92deec2b988 --- /dev/null +++ b/ops/ci/migration/compare-sp1-guest.py @@ -0,0 +1,164 @@ +#!/usr/bin/env python3 +"""Verify complete original SP1 guest jobs, including byte-identical ELFs.""" +import argparse +import hashlib +import importlib.util +import json +from pathlib import Path +import re +import xml.etree.ElementTree as ET + +SPEC = importlib.util.spec_from_file_location('sp1_guest', Path(__file__).resolve().parents[1] / 'runtime' / 'sp1-guest.py') +G = importlib.util.module_from_spec(SPEC); SPEC.loader.exec_module(G) +E_SPEC = importlib.util.spec_from_file_location('report_evidence', Path(__file__).with_name('report-evidence.py')) +E = importlib.util.module_from_spec(E_SPEC); E_SPEC.loader.exec_module(E) +COMMON = ('source_sha', 'branch', 'suite', 'input_sha256', 'tools', 'programs', 'features', 'elf_source_sha', + 'build_rustflags', 'check_rustflags', 'vkey_prover', 'incremental', 'rerun_fails') +CACHE = {'sccache-start', 'sccache-zero', 'sccache-stats', 'sccache-stop', 'cache-prepare', 'cache-commit'} + + +def normalized(value, settings, metadata=None): + """Account only for physical checkout, registry and compiler-output locations.""" + aliases = [(settings['cargo_home'], ''), (settings['workspace_root'], '')] + if metadata is not None: aliases.insert(0, (metadata['target_directory'], '')) + if isinstance(value, str): + for old, new in aliases: value = value.replace(old, new) + return value + if isinstance(value, list): return [normalized(v, settings, metadata) for v in value] + if isinstance(value, dict): + return {normalized(k, settings, metadata): normalized(v, settings, metadata) for k,v in value.items()} + return value + + +def stages(directory, settings, phase): + root, rust, sp1 = settings['workspace_root'], settings['workspace_root']+'/rust', settings['workspace_root']+'/rust/kona/sp1' + expected = { 'install': (['bash', 'ops/ci/runtime/sp1-guest-toolchain.sh'], root) } if phase == 'toolchain' else { + 'guest-workspace': (['cargo', 'metadata', '--manifest-path', G.GUEST, '--locked', '--all-features', '--format-version', '1'], rust), + **{'vkey-'+n: (['cargo', 'prove', 'vkey', '--elf', 'elf/'+n+'-elf'], sp1) for n in settings['programs']}} + if phase == 'build': + expected.update({'lock-before': (['just', 'check-sp1-guest-lock'], rust), 'build': (['just', 'build-elfs-native', settings['features']], sp1)}) + elif phase == 'checks': + expected.update({ + 'guest-list': (['cargo', 'test', '--manifest-path', G.GUEST, '--workspace', '--locked', '--all-features', '--', '--list'], rust), + 'guest': (['just', 'test-sp1-guest'], rust), 'lint': (['just', 'lint-sp1-guest'], rust), + 'vkeys': (['just', 'check-vkey-crates'], rust)}) + for name in G.vkey_crates((directory/'toolchain/source/rust/justfile').read_text()): + manifest = 'kona/sp1/crates/'+name+'/Cargo.toml' + expected['vkeys-'+name+'-workspace'] = (['cargo', 'metadata', '--manifest-path', manifest, '--locked', '--format-version', '1'], rust) + expected['vkeys-'+name+'-list'] = (['cargo', 'test', '--manifest-path', manifest, '--locked', '--', '--list'], rust) + actual = {p.name.removesuffix('.stage.json') for p in directory.glob('*.stage.json')} + cache = CACHE if settings['provider'] == 'rwx' and phase != 'toolchain' else set() + if actual != expected.keys() | cache: raise ValueError('Missing, extra or retried original SP1 invocation') + for name, (argv, cwd) in expected.items(): + row = G.read(directory/(name+'.stage.json')) + if (row['argv'] != argv or row['cwd'] != cwd or row['exit_code'] != 0 or row.get('stdin') != 'devnull' + or row['log_sha256'] != G.S.digest(directory/(name+'.log'))): + raise ValueError('Wrong or failed original SP1 command: '+name) + for name in cache: + row = G.read(directory/(name+'.stage.json')) + if row['exit_code'] != 0 or row['log_sha256'] != G.S.digest(directory/(name+'.log')): + raise ValueError('Failed original SP1 compiler-cache operation') + if cache: + record=G.read(directory/'cache-settings.json'); kind='elf' if phase=='build' else 'checks' + identity={'phase':kind,'features':settings['features'],'tools':settings['tools'],'rustflags':'' if kind=='elf' else '-Dwarnings','incremental':'0'} + digest=hashlib.sha256(json.dumps(identity,sort_keys=True).encode()).hexdigest() + target=G.helper('sp1-guest-native-build').POLICY['target_directory'] if kind=='elf' else settings['workspace_root']+'/.ci/sp1-cache/checks-target' + if (record['phase']!=kind or record['target_mode'] not in ('keep','sccache-only') + or record['target_directory']!=target or record['sccache_version']!='sccache 0.18.0' + or record['compiler_inputs']!=identity or record['compiler_input_sha256']!=digest): + raise ValueError('Wrong original SP1 compiler cache identity or configuration') + + +def verify_seals(directory, final, circle, empty): + hashes = final['original_sha256'] + E.verify_files(directory, hashes, missing_empty=empty if circle else None, + recoverable={n for n in hashes if n.endswith('.log')}, label=str(directory)) + G.verify_seals(directory, final) + + +def toolchain(directory, settings, circle, empty): + final = G.read(directory/'final.json') + if final['phase'] != 'toolchain' or final['exit_code'] or final['report_errors']: + raise ValueError('Failed complete SP1 compiler setup') + verify_seals(directory, final, circle, empty) + inputs = G.read(directory/'inputs.json') + files = {str(p.relative_to(directory/'source')):G.S.digest(p) + for p in (directory/'source').rglob('*') if p.is_file()} + if files != inputs or set(files) != set(G.TOOL_INPUTS): raise ValueError('Incomplete original SP1 pin-check inputs') + if any(settings['input_sha256'].get(n) != h for n,h in inputs.items()): raise ValueError('SP1 pins differ from revision inputs') + if G.read(directory/'tools.json') != settings['tools']: raise ValueError('Wrong actual SP1 compiler identity') + if G.programs((directory/'source/rust/kona/sp1/justfile').read_text()) != settings['programs']: + raise ValueError('SP1 ELF selection differs from its authoritative recipe') + stages(directory, settings, 'toolchain') + + +def report(directory, provider, sha): + circle = provider == 'circleci'; empty = [] + final, settings = G.read(directory/'final.json'), G.read(directory/'settings.json') + if (final['phase'] != 'checks' or final['exit_code'] or final['report_errors'] + or (settings['suite'], settings['phase'], settings['source_sha'], settings['provider']) != ('sp1-guest', 'checks', sha, provider)): + raise ValueError('Failed, stale or incorrect original SP1 job') + if not settings['branch'] or settings['incremental'] != '0' or settings['rerun_fails'] != 0: + raise ValueError('Changed SP1 original environment or retry policy') + if provider == 'rwx' and (not settings.get('rwx_run_id') or str(settings.get('rwx_task_attempt')) != '1'): + raise ValueError('Missing native fresh execution identity or uninvestigated retry') + verify_seals(directory, final, circle, empty) + producer = directory/'producer'; pf = G.read(producer/'final.json'); ps = G.read(producer/'settings.json') + if pf['phase'] != 'build' or pf['exit_code'] or pf['report_errors'] or pf['tests'] != 0 or ps['phase'] != 'build': + raise ValueError('Failed or false original SP1 ELF producer') + verify_seals(producer, pf, circle, empty) + if provider=='rwx':G.helper('sp1-guest-native-build').verify(producer,ps,settings['workspace_root']) + if ps['provider'] != provider or any(ps[n] != settings[n] for n in COMMON): + raise ValueError('SP1 producer provenance differs from its consumer') + for path, original, phase in ((directory, settings, 'checks'), (producer, ps, 'build')): + if G.read(path/'inputs-after.json') != original['input_sha256']: raise ValueError('Original SP1 job changed source inputs') + toolchain(path/'toolchain', original, circle, empty) + stages(path, original, phase) + elfs = G.elf_record(settings, producer/'files') + if elfs != G.read(producer/'elfs.json'): raise ValueError('ELF manifest differs from complete actual guest bytes') + for path in (producer, directory): + for name in settings['programs']: + if re.findall('0x[0-9a-fA-F]{64}', (path/('vkey-'+name+'.log')).read_text()) != [elfs[name]['vkey']]: + raise ValueError('Original CPU verification key differs from the guest ELF') + cases, metadata = {}, {} + names = G.vkey_crates((directory/'toolchain/source/rust/justfile').read_text()) + G.vkey_views(directory, emit=False, names=names) + for name in names: + meta = G.read(directory/('vkeys-'+name+'-workspace.json')) + metadata['vkeys-'+name] = normalized(meta, settings, meta) + for phase in ('guest', 'vkeys'): + meta = G.read(directory/(phase+'-workspace.json')) + coverage = G.coverage(directory, phase, meta, settings, emit=False) + if (coverage != G.read(directory/(phase+'-coverage.json')) + or G.junit(coverage) != (directory/(phase+'.junit.xml')).read_bytes()): + raise ValueError('False original SP1 case report') + if any(c['outcome'] == 'fail' or c['retries'] for c in coverage['cases']): raise ValueError('Unresolved original SP1 test failure or retry') + tree = ET.parse(directory/(phase+'.junit.xml')) + if len(list(tree.iter('testcase'))) != len(coverage['cases']): raise ValueError('Incomplete original SP1 JUnit') + cases[phase] = coverage + metadata[phase] = normalized(meta, settings, meta if phase == 'guest' else None) + build_meta = G.read(producer/'guest-workspace.json') + if normalized(build_meta, ps, build_meta) != metadata['guest']: raise ValueError('SP1 build/check dependency graphs differ') + return {'recovered_empty_originals':empty, 'settings': settings, 'elfs': elfs, 'cases': cases, 'metadata': metadata, + 'original_sha256': final['original_sha256'], 'producer_original_sha256': pf['original_sha256']} + + +def compare(directory, sha): + if not re.fullmatch('[0-9a-f]{40}', sha): raise ValueError('Expected full SP1 source SHA') + a, b = (report(directory/p, provider, sha) for p,provider in [('circle','circleci'),('rwx','rwx')]) + if any(a['settings'][n] != b['settings'][n] for n in COMMON): raise ValueError('Original SP1 workload settings differ') + for name in ('elfs', 'cases', 'metadata'): + if a[name] != b[name]: raise ValueError('Complete original SP1 '+name+' differ') + return {'source_sha': sha, 'verified_parity': True, 'native_run_id': b['settings']['rwx_run_id'], + 'recovered_empty_originals':a['recovered_empty_originals'], 'elfs': a['elfs'], 'cases': a['cases'], 'complete_dependency_graphs_equal': True, + 'original_sha256': {p:r['original_sha256'] for p,r in [('circle',a),('rwx',b)]}, + 'producer_original_sha256': {p:r['producer_original_sha256'] for p,r in [('circle',a),('rwx',b)]}} + + +if __name__ == '__main__': + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument('directory', type=Path); parser.add_argument('--sha', required=True) + parser.add_argument('--output', type=Path, required=True) + args = parser.parse_args(); result = compare(args.directory, args.sha); G.S.write(args.output, result) + print({'source_sha': args.sha, 'verified_parity': True, 'elfs': len(result['elfs']), + 'tests': sum(len(c['cases']) for c in result['cases'].values())}) diff --git a/ops/ci/migration/compare-static-checks.py b/ops/ci/migration/compare-static-checks.py new file mode 100644 index 00000000000..d89ffd83ac2 --- /dev/null +++ b/ops/ci/migration/compare-static-checks.py @@ -0,0 +1,122 @@ +#!/usr/bin/env python3 +"""Compare full original static selections, diagnostics, rule tests and findings.""" +import argparse +import importlib.util +import json +from pathlib import Path +_SPEC_E = importlib.util.spec_from_file_location('report_evidence', Path(__file__).with_name('report-evidence.py')) +E = importlib.util.module_from_spec(_SPEC_E); _SPEC_E.loader.exec_module(E) +import re +import xml.etree.ElementTree as ET + + +def helper(name): + spec = importlib.util.spec_from_file_location(name, (Path(__file__).parent if name.startswith('compare-') or name in ('flaky-report','selector-upload','selector-registry') else Path(__file__).resolve().parents[1] / 'runtime') / (name + '.py')) + module = importlib.util.module_from_spec(spec); spec.loader.exec_module(module); return module + + +C = helper('static-checks'); REPORT = helper('ci-report') + + +def report(directory, job, sha, provider, empty): + required = {'settings.json', 'selection.json', 'check.stage.json', 'check.log', 'coverage.json', 'inputs-after.json', 'derived.junit.xml'} + if job == 'shell-check': required |= {'discovery.log', 'discovery.stage.json', 'original.shellcheck.log'} + else: required.add('check.json') + if job == 'semgrep-scan-local': required.add('scanned-source-sha256.json') + final = REPORT.read(directory / 'final.json') + if final['exit_code'] != 0 or final['report_errors']: + raise ValueError('Failed or incomplete original static check report') + hashes = E.verify_files(directory, final['original_sha256'], required=required, + missing_empty=empty if provider == 'circle' else None, label=provider + '/' + job) + if {str(p.relative_to(directory)) for p in directory.rglob('*') if p.is_file() and p.name != 'final.json'} != set(hashes): + raise ValueError('Unsealed or missing complete static originals') + s = json.loads((directory / 'settings.json').read_text()); root = s['workspace_root'] + if (s['source_sha'], s['job'], s['provider'], s['command']) != (sha, job, 'circleci' if provider == 'circle' else 'rwx', C.COMMANDS[job]): + raise ValueError('Wrong static source, job, provider or original command') + if provider == 'rwx' and (not s['rwx_run_id'] or str(s['rwx_task_attempt']) != '1'): + raise ValueError('Reused static verdict or uninvestigated retry') + if not s['input_sha256'] or json.loads((directory / 'inputs-after.json').read_text()) != s['input_sha256']: + raise ValueError('Static verdict changed source inputs') + version = re.findall(r'^version: (\S+)$', s['tool_version'], re.M) if job == 'shell-check' else [s['tool_version']] + if version != [C.VERSIONS[job]]: raise ValueError('Wrong original static tool version') + stages = {p.name.removesuffix('.stage.json') for p in directory.glob('*.stage.json')} + commands = {'check': C.COMMANDS[job]} + if job == 'shell-check': commands['discovery'] = C.SHELL_FIND + if stages != set(commands): raise ValueError('Missing original static command or unexplained retry') + for name, argv in commands.items(): + row = json.loads((directory / (name + '.stage.json')).read_text()) + if (row['argv'], row['cwd'], row['exit_code'], row['stdin']) != (argv, root, 0, 'devnull') or \ + C.digest(directory / (name + '.log')) != row['log_sha256']: + raise ValueError('Wrong or failed original static invocation/output') + selected = json.loads((directory / 'selection.json').read_text()); recorded = json.loads((directory / 'coverage.json').read_text()) + if job == 'shell-check': + if s['baseline'] is not None or s['environment'] != C.SHELL_ENV or selected['orb_command_sha256'] != C.ORB_SHA256 or \ + selected['orb'] != 'circleci/shellcheck@3.2.0' or s['input_sha256'].get(C.ORB) != C.ORB_SHA256: + raise ValueError('Original ShellCheck orb parameters or command changed') + files = C.shell_files((directory / 'discovery.log').read_text()) + log = re.sub(r'\x1b\[[0-9;]*m', '', (directory / 'check.log').read_text()) + actual = C.shell_files('\n'.join(s for s in log.splitlines() if s.startswith('./') and s.endswith('.sh'))) + if files != actual or files != selected['files'] or set(selected['sha256']) != set(files) or \ + any(selected['sha256'][n] != s['input_sha256'].get(n.removeprefix('./')) for n in files): + raise ValueError('Missing, extra or changed original ShellCheck file assignment') + coverage = {'files': files, 'outcome': 'pass'} + if (directory / 'original.shellcheck.log').stat().st_size or 'No ShellCheck Errors Found' not in log: + raise ValueError('Incomplete or failing original ShellCheck verdict') + cases = {(n, None) for n in files} + else: + if s['environment'] != C.semgrep_environment(s['branch'], sha): + raise ValueError('Original Semgrep scan environment changed') + baseline = s['baseline'] + if (s['branch'] == 'develop' and baseline is not None) or (s['branch'] != 'develop' and + (not isinstance(baseline, dict) or set(baseline) != {'ref', 'commit', 'merge_base', 'changed_files'} or baseline.get('ref') != 'develop' or + not all(re.fullmatch('[0-9a-f]{40}', str(baseline.get(k))) for k in ('commit', 'merge_base')) or + not isinstance(baseline.get('changed_files'), dict))): + raise ValueError('Missing original Semgrep baseline provenance') + if baseline is not None and any(status not in ('A','M','D','T') or Path(n).is_absolute() or '..' in Path(n).parts or + ((n in s['input_sha256']) != (status != 'D')) for n,status in baseline['changed_files'].items()): + raise ValueError('Invalid original Semgrep baseline change assignment') + wanted = {'rules': {n:v for n,v in s['input_sha256'].items() if n.startswith('.semgrep/rules/')}, + 'fixtures': {n:v for n,v in s['input_sha256'].items() if n.startswith('.semgrep/tests/')}, + 'ignore': {n:v for n,v in s['input_sha256'].items() if Path(n).name in ('.gitignore', '.semgrepignore')}} + if not wanted['rules'] or not wanted['fixtures'] or selected != wanted: + raise ValueError('Incomplete original Semgrep rule/fixture/ignore selection') + coverage = C.machine_report(job, json.loads((directory / 'check.json').read_text()), root) + if job == 'semgrep-test': + cases = {(config + ':' + name, None) for config,row in coverage['results'].items() for name in row['checks']} + cases |= {(n, 'Original Semgrep config_missing_tests') for n in coverage['config_missing_tests']} + else: cases = {(job, None)} + if job == 'semgrep-scan-local' and json.loads((directory / 'scanned-source-sha256.json').read_text()) != \ + C.scanned_inputs(coverage, s['input_sha256']): + raise ValueError('Original Semgrep scanned different source bytes') + if recorded != coverage: raise ValueError('Static accounting differs from full original reports') + suite = ET.parse(directory / 'derived.junit.xml').getroot(); found = set() + for case in suite.findall('testcase'): + skip = case.find('skipped'); reason = skip.get('message') if skip is not None else None + key = (case.attrib['name'], reason) + if case.attrib != {'name':key[0], 'classname':job} or key in found or \ + case.find('failure') is not None or case.find('error') is not None: + raise ValueError('Duplicate or failing derived static case') + found.add(key) + if found != cases or suite.attrib != {'name':'static-checks/' + job,'tests':str(len(cases)), 'failures':'0', + 'skipped':str(sum(reason is not None for _,reason in cases))}: + raise ValueError('Derived static JUnit differs from complete originals') + return {'settings': s, 'selection': selected, 'coverage': coverage, 'original_sha256': hashes} + + +def compare(directories, job, sha): + if not re.fullmatch('[0-9a-f]{40}', sha): raise ValueError('Expected full static benchmark SHA') + empty = []; data = {p:report(d, job, sha, p, empty) for p,d in directories.items()}; a,b = data['circle'], data['rwx'] + for key in ('source_sha', 'branch', 'job', 'tool_version', 'environment', 'baseline', 'input_sha256', 'command'): + if a['settings'][key] != b['settings'][key]: raise ValueError('Static settings differ at ' + key) + for key in ('selection', 'coverage'): + if a[key] != b[key]: raise ValueError('Complete original static parity differs at ' + key) + return {'source_sha':sha, 'job':job, 'verified_parity':True, 'selection':a['selection'], 'coverage':a['coverage'], + 'settings':{p:d['settings'] for p,d in data.items()}, 'original_sha256':{p:d['original_sha256'] for p,d in data.items()}, + 'manifest_declared_empty_logs':empty} + + +if __name__ == '__main__': + p = argparse.ArgumentParser(description=__doc__); p.add_argument('--circle',type=Path,required=True); p.add_argument('--rwx',type=Path,required=True) + p.add_argument('--job',choices=C.COMMANDS,required=True); p.add_argument('--sha',required=True); p.add_argument('--output',type=Path,required=True) + a=p.parse_args(); result=compare({'circle':a.circle,'rwx':a.rwx},a.job,a.sha); C.S.write(a.output,result) + print(json.dumps({'source_sha':a.sha,'job':a.job,'verified_parity':True})) diff --git a/ops/ci/migration/flaky-report.py b/ops/ci/migration/flaky-report.py new file mode 100644 index 00000000000..23e0ff9ca38 --- /dev/null +++ b/ops/ci/migration/flaky-report.py @@ -0,0 +1,232 @@ +#!/usr/bin/env python3 +"""Retain and verify the complete original Circle Insights reporting workload.""" +import argparse +import csv +import datetime +import hashlib +import html as html_format +from html.parser import HTMLParser +import json +import math +import os +from pathlib import Path +import re +import signal +import subprocess +import time +import urllib.parse + +ROOT = Path(__file__).resolve().parents[3] +SCRIPT = 'op-acceptance-tests/scripts/generate-flaky-tests-report.sh' +INPUTS = (SCRIPT, 'ops/ci/migration/flaky-report.py', 'mise.toml') +PREFIX = 'github.com/ethereum-optimism/optimism/op-acceptance-tests/tests' +COLUMNS = ['times_flaked', 'test_name', 'classname', 'job_name', 'workflow_name', 'job_number', + 'pipeline_number', 'job_url', 'first_flaked_at', 'last_flaked_at'] + + +def check(value, message): + if not value: + raise ValueError(message) + + +def digest(path): + return hashlib.sha256(Path(path).read_bytes()).hexdigest() + + +def write(path, value): + path.parent.mkdir(parents=True, exist_ok=True) + path.write_text(json.dumps(value, indent=2, sort_keys=True) + '\n') + + +def read(path): + def pairs(rows): + value = {} + for key, item in rows: + check(key not in value, 'Duplicate original JSON key') + value[key] = item + return value + return json.loads(Path(path).read_bytes(), object_pairs_hook=pairs, + parse_constant=lambda _: (_ for _ in ()).throw(ValueError('Non-finite original JSON'))) + + +def validate_api(path): + value = read(path) + check(isinstance(value, dict) and set(value) == {'flaky_tests', 'total_flaky_tests'} + and isinstance(value['flaky_tests'], list) and type(value['total_flaky_tests']) is int + and value['total_flaky_tests'] == len(value['flaky_tests']), 'Incomplete original Circle Insights response') + identities = set() + for row in value['flaky_tests']: + check(isinstance(row, dict), 'Invalid original flaky-test row') + for key in ('classname', 'test_name', 'job_name', 'workflow_name', 'workflow_id', 'workflow_created_at', 'file', 'source'): + check(isinstance(row.get(key), str), 'Missing original flaky-test field: ' + key) + for key in ('times_flaked', 'job_number', 'pipeline_number'): + check(type(row.get(key)) is int and row[key] > 0, 'Invalid original flaky-test count: ' + key) + check(type(row.get('time_wasted')) in (int, float) and math.isfinite(row['time_wasted']) and row['time_wasted'] >= 0 + and re.fullmatch('[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}', row['workflow_id']), + 'Invalid original flaky-test provenance') + when = datetime.datetime.fromisoformat(row['workflow_created_at'].replace('Z', '+00:00')) + check(when.tzinfo is not None, 'Missing original observation timezone') + identity = tuple(row[key] for key in ('workflow_id', 'job_number', 'classname', 'test_name', 'source', 'file')) + check(identity not in identities, 'Duplicate original flaky-test identity') + identities.add(identity) + return value + + +class Table(HTMLParser): + def __init__(self): + super().__init__(convert_charrefs=True) + self.rows, self.row, self.cell = [], None, None + self.links, self.link = [], None + + def handle_starttag(self, tag, attrs): + if tag == 'tr': self.row = []; self.links = [] + if tag == 'td': self.cell = '' + if tag == 'a' and self.cell is not None: self.links.append(dict(attrs).get('href')) + + def handle_data(self, data): + if self.cell is not None: self.cell += data + + def handle_endtag(self, tag): + if tag == 'td' and self.row is not None: + self.row.append(self.cell); self.cell = None + if tag == 'tr' and self.row: + self.rows.append((self.row, self.links)); self.row = None + + +def url(row): + return ('https://app.circleci.com/pipelines/github/ethereum-optimism/optimism/' + str(row['pipeline_number']) + + '/workflows/' + row['workflow_id'] + '/jobs/' + str(row['job_number'])) + + +def validate_report(directory, branch): + attempts = sorted(directory.glob('api-attempt-*.http-status.txt'), key=lambda p: int(p.name.split('-')[2].split('.')[0])) + check(0 < len(attempts) <= 6 and [p.name for p in attempts] + == ['api-attempt-' + str(i) + '.http-status.txt' for i in range(1, len(attempts) + 1)], + 'Missing or extra original API attempts') + expected_files = set() + for i, path in enumerate(attempts, 1): + status = path.read_text() + base = directory / ('api-attempt-' + str(i)) + code = base.with_suffix('.exit-code.txt').read_text() + expected_files.update(base.with_suffix(suffix).name for suffix in ('.http-status.txt', '.exit-code.txt', '.stderr.log')) + if status != '000\n' or base.with_suffix('.json').exists(): expected_files.add(base.with_suffix('.json').name) + check(re.fullmatch(r'\d{3}\n', status) and re.fullmatch(r'\d+\n', code) + and base.with_suffix('.stderr.log').is_file(), 'Incomplete original API attempt') + if i == len(attempts): + check(status == '200\n' and code == '0\n' + and base.with_suffix('.json').read_bytes() == (directory / 'flaky_tests.original.json').read_bytes(), + 'Missing successful original API snapshot') + else: + check(status not in ('200\n', '400\n', '401\n', '403\n', '404\n') + and (status == '000\n' or base.with_suffix('.json').is_file()), 'Overwritten or invalid original failure evidence') + check({p.name for p in directory.glob('api-attempt-*')} == expected_files, 'Missing or extra original API attempt files') + original = validate_api(directory / 'flaky_tests.original.json') + filtered = original | {'flaky_tests': [row for row in original['flaky_tests'] if row['classname'].startswith(PREFIX)]} + check(read(directory / 'flaky_tests.json') == read(directory / 'flaky_tests.filtered.json') == filtered, + 'Omitted, extra or changed acceptance-test report rows') + check((directory / 'http-status.txt').read_text() == '200\n', 'Missing successful original HTTP status') + ordered = list(reversed(sorted(filtered['flaky_tests'], key=lambda row: row['times_flaked']))) + with (directory / 'flaky_tests.csv').open(newline='') as file: + csv_rows = list(csv.reader(file)) + check(csv_rows[0] == COLUMNS and len(csv_rows) == len(ordered) + 1, 'Incomplete original CSV report') + for cells, row in zip(csv_rows[1:], ordered): + # The original jq recipe JSON-quotes strings before CSV encoding. + expected = [str(row['times_flaked']), row['test_name'], row['classname'], row['job_name'], row['workflow_name'], + str(row['job_number']), str(row['pipeline_number']), url(row), row['workflow_created_at'], row['workflow_created_at']] + check(len(cells) == len(COLUMNS), 'Malformed CSV report row') + decoded = [json.loads(cell) if i in (1, 2, 3, 4, 7, 8, 9) else cell for i, cell in enumerate(cells)] + check(decoded == expected, 'CSV differs from complete original API response') + html = (directory / 'flaky_tests.html').read_text() + parser = Table(); parser.feed(html); parser.close() + branches = re.findall(r'

Branch: (.*?)

', html) + check(len(parser.rows) == len(ordered) and 'CircleCI\'s flaky-test API is project-wide and branch agnostic.' in html + and len(branches) == 1 and '<' not in branches[0] and html_format.unescape(branches[0]) == branch, + 'Incomplete HTML report or incorrect branch scope') + for (cells, links), row in zip(parser.rows, ordered): + check(cells == [str(row['times_flaked']), row['test_name'], row['classname'], row['job_name'], row['workflow_name'], + str(row['job_number']), str(row['pipeline_number']), 'View Job', row['workflow_created_at'], row['workflow_created_at']] + and links == [url(row)], 'HTML differs from complete original API response') + return {'source_rows': len(original['flaky_tests']), 'acceptance_rows': len(ordered), 'original': original, + 'filtered': filtered, 'branch': branch, 'scope': 'project-wide branch-agnostic Circle Insights'} + + +def files(directory): + value = {} + for path in sorted(directory.rglob('*')): + check(not path.is_symlink(), 'Linked flaky-report evidence') + if path.is_file() and path != directory / 'final.json': value[str(path.relative_to(directory))] = digest(path) + return value + + +def run(directory): + check(not directory.exists(), 'Flaky-report verdict already exists') + directory.mkdir(parents=True) + sha = subprocess.check_output(['git', 'rev-parse', 'HEAD'], cwd=ROOT, text=True).strip() + check(re.fullmatch('[0-9a-f]{40}', sha) and os.environ.get('CI_COMMIT_SHA', os.environ.get('CIRCLE_SHA1', sha)) == sha, + 'Wrong flaky-report source revision') + branch = os.environ.get('CI_BRANCH') or os.environ.get('CIRCLE_BRANCH') + check(branch, 'Missing original reporting branch') + inputs = {} + for name in INPUTS: + raw = subprocess.check_output(['git', 'show', sha + ':' + name], cwd=ROOT) + check((ROOT / name).read_bytes() == raw, 'Uncommitted report implementation') + inputs[name] = hashlib.sha256(raw).hexdigest() + provider = os.environ.get('CI_CHECK_PROVIDER', 'circleci') + check(provider in ('circleci', 'rwx'), 'Unknown flaky-report provider') + token = os.environ.get('CIRCLE_API_TOKEN', '') if provider == 'circleci' else '' + settings = {'source_sha': sha, 'branch': branch, 'provider': provider, 'input_sha256': inputs, + 'authenticated': bool(token), 'api_url': 'https://circleci.com/api/v2/insights/gh/ethereum-optimism/optimism/flaky-tests?' + + urllib.parse.urlencode({'branch': branch}), + 'native_run_id': os.environ.get('RWX_RUN_ID'), 'native_task_attempt': os.environ.get('RWX_TASK_ATTEMPT_NUMBER'), + 'scope': 'project-wide branch-agnostic Circle Insights', + 'jq': subprocess.check_output(['jq', '--version'], text=True).strip(), + 'curl': subprocess.check_output(['curl', '--version'], text=True).splitlines()[0]} + write(directory / 'settings.json', settings) + report = directory / 'reports' + argv = ['bash', str(ROOT / SCRIPT), '--branch', branch, '--org', 'ethereum-optimism', '--repo', 'optimism', '--output-dir', str(report)] + safe_argv = argv.copy() + if token: argv += ['--token', token]; safe_argv += ['--token', '[redacted]'] + status, errors, signals = 1, [], [] + started = time.time() + with (directory / 'stdout.log').open('wb') as stdout, (directory / 'stderr.log').open('wb') as stderr: + process = subprocess.Popen(argv, cwd=ROOT, stdout=stdout, stderr=stderr, start_new_session=True) + def stop(signum, _): + signals.append(signum) + try: os.killpg(process.pid, signum) + except ProcessLookupError: pass + handlers = {sig: signal.signal(sig, stop) for sig in (signal.SIGTERM, signal.SIGINT)} + timed_out = False + try: + try: status = process.wait(timeout=900) + except subprocess.TimeoutExpired: + timed_out = True; stop(signal.SIGTERM, None) + try: status = process.wait(timeout=5) + except subprocess.TimeoutExpired: os.killpg(process.pid, signal.SIGKILL); status = process.wait() + check(status == 0 and not timed_out and not signals, 'Original flaky-report command failed or was cancelled') + value = validate_report(report, branch) + write(directory / 'coverage.json', {key: value[key] for key in ('source_rows', 'acceptance_rows', 'scope')}) + text = (directory / 'stdout.log').read_text() + ordered = list(reversed(sorted(value['filtered']['flaky_tests'], key=lambda row: row['times_flaked']))) + top = '\n'.join(str(row['times_flaked']) + 'x: ' + row['test_name'] for row in ordered[:10]) + check(text.endswith(top + '\n' if top else '==========================================\n'), 'Missing original text report') + except BaseException as error: + errors.append(str(error) or type(error).__name__) + raise + finally: + for sig, handler in handlers.items(): signal.signal(sig, handler) + write(directory / 'execution.json', {'argv': safe_argv, 'cwd': str(ROOT), 'started_at': started, + 'elapsed_seconds': time.time() - started, 'exit_code': status, 'signals': signals, 'timed_out': timed_out, + 'stdout_sha256': digest(directory / 'stdout.log'), 'stderr_sha256': digest(directory / 'stderr.log')}) + write(directory / 'final.json', {'state': 'passed' if status == 0 and not errors else 'failed', + 'exit_code': status or 1 if errors else status, 'tests': 0, 'reports': 1 if status == 0 and not errors else 0, + 'errors': errors, 'sha256': files(directory)}) + + +if __name__ == '__main__': + parser = argparse.ArgumentParser(description=__doc__) + modes = parser.add_subparsers(dest='mode', required=True) + modes.add_parser('validate-api').add_argument('path', type=Path) + modes.add_parser('run').add_argument('directory', type=Path) + args = parser.parse_args() + if args.mode == 'validate-api': validate_api(args.path) + else: run(args.directory.resolve()) diff --git a/ops/ci/migration/l2-chains-sync-check.py b/ops/ci/migration/l2-chains-sync-check.py new file mode 100644 index 00000000000..958c9ea2f02 --- /dev/null +++ b/ops/ci/migration/l2-chains-sync-check.py @@ -0,0 +1,32 @@ +#!/usr/bin/env python3 +"""Transitional verification of Circle schedules against its archive RPC inventory.""" +import importlib.util +import json +from pathlib import Path + +_SPEC=importlib.util.spec_from_file_location('report_evidence',Path(__file__).with_name('report-evidence.py')) +E=importlib.util.module_from_spec(_SPEC);_SPEC.loader.exec_module(E) +M=E.helper('main-checks') +ROOT=M.ROOT +COMMAND=['bash','.circleci/scripts/check-l2-chains-sync.sh'] +stage, retain_sources = M.stage, M.retain_sources + + +def l2_selection(configuration, rpcs): + matrices = [body['contracts-bedrock-tests-l2-fork']['matrix']['parameters']['fork_op_chain'] + for body in configuration['workflows']['scheduled-daily-tests']['jobs'] + if isinstance(body, dict) and 'contracts-bedrock-tests-l2-fork' in body] + if len(matrices) != 1 or not matrices[0] or len(set(matrices[0])) != len(matrices[0]): + raise ValueError('Missing or duplicate complete scheduled L2 fork matrix') + if not isinstance(rpcs, dict) or not rpcs: raise ValueError('Missing complete L2 RPC chain selection') + return {'rpc_chains': sorted(rpcs), 'matrix_chains': sorted(matrices[0])} + +def discovery(directory, job): + stage(directory, 'configuration', ['yq', '-o=json', '.', '.circleci/continue/main.yml'], json_output=True) + configuration = json.loads((directory / 'configuration.json').read_text()) + retain_sources(directory, ['.circleci/continue/main.yml', '.circleci/l2-rpcs.json']) + return l2_selection(configuration, json.loads((ROOT / '.circleci/l2-rpcs.json').read_text())) + + +if __name__=='__main__': + raise SystemExit(M.execute('l2-chains-sync-check', argv=COMMAND, discover=discovery)) diff --git a/ops/ci/migration/report-evidence.py b/ops/ci/migration/report-evidence.py new file mode 100644 index 00000000000..84b9188705d --- /dev/null +++ b/ops/ci/migration/report-evidence.py @@ -0,0 +1,42 @@ +"""Offline report mechanics; runtime verification never repairs inputs.""" +import importlib.util +import json +from pathlib import Path +import re + + +def helper(name): + owner = Path(__file__).parent if name.startswith('compare-') or name in ('report-evidence', 'circle-alignment', 'flaky-report', 'selector-upload', 'selector-registry', 'l2-chains-sync-check') else Path(__file__).parents[1] / 'runtime' + spec = importlib.util.spec_from_file_location(name.replace('-', '_'), owner / (name + '.py')) + module = importlib.util.module_from_spec(spec); spec.loader.exec_module(module) + return module + + +REPORT = helper('ci-report') +normalize = REPORT.normalize + + +def verify_files(directory, hashes, *, required=(), missing_empty=None, recoverable=None, label='report'): + """Recover only explicitly authorized manifest-declared empty originals.""" + directory = Path(directory) + if not isinstance(hashes, dict) or not set(required) <= hashes.keys(): + raise ValueError('Incomplete original file manifest: ' + (label or 'report')) + for name, sha in hashes.items(): + if not isinstance(name, str) or not isinstance(sha, str) or Path(name).is_absolute() or '..' in Path(name).parts or not re.fullmatch('[0-9a-f]{64}', sha): + raise ValueError('Invalid original report path or hash') + target = directory / name + if not target.exists() and sha == REPORT.EMPTY_SHA256 and missing_empty is not None and (recoverable is None or name in recoverable): + # An existing symlink must never authorize an out-of-tree write. + if target.is_symlink() or any(p.is_symlink() for p in target.parents if p.is_relative_to(directory)): + raise ValueError('Linked original report recovery path') + target.parent.mkdir(parents=True, exist_ok=True); target.write_bytes(b'') + missing_empty.append({'path': name, 'sha256': sha} | ({'report': label} if label else {})) + return REPORT.verify_files(directory, hashes, required=required, label=label or 'report') + + +def originals(directory, required, empty, label): + final = REPORT.read(directory / 'final.json') + if final['exit_code'] != 0 or final['report_errors']: + raise ValueError('Failed or incomplete original contract report: ' + label) + return verify_files(directory, final['original_sha256'], required=required, + missing_empty=empty if label.startswith('circle/') else None, label=label) diff --git a/ops/ci/migration/selector-registry.py b/ops/ci/migration/selector-registry.py new file mode 100644 index 00000000000..a61bf50345e --- /dev/null +++ b/ops/ci/migration/selector-registry.py @@ -0,0 +1,438 @@ +#!/usr/bin/env python3 +"""Exercise unmodified Forge uploads against a private official Sourcify service.""" +import argparse +import ctypes +import hashlib +import http.client +from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer +import json +import os +from pathlib import Path +import re +import shutil +import signal +import socket +import ssl +import subprocess +import sys +import tempfile +import threading +import time +import uuid + +SOURCIFY_SHA = '9282528d8c210f22287761c26c4232c15f66585d' +SOURCIFY_TAG = 'sourcify-4byte@1.1.16' +REGISTRY_IMAGE = 'optimism-rwx-selector-registry:9282528' +POSTGRES_IMAGE = 'postgres:15-alpine@sha256:3d0f7584ed7d04e27fa050d6683a74746608faf21f202be78460d679cc56461f' +HOST = 'api.4byte.sourcify.dev' +IMPORT = '/signature-database/v1/import' +LOOKUP = '/signature-database/v1/lookup' +SCHEMA = 'services/database/sourcify-database.sql' + + +def _source_library(): + import importlib.util + path = Path(__file__).resolve().parents[1] / 'runtime' / 'ci-source.py' + spec = importlib.util.spec_from_file_location('ci_source', path) + module = importlib.util.module_from_spec(spec) + spec.loader.exec_module(module) + return module + + +SOURCE = _source_library() +check, digest, write, command = SOURCE.check, SOURCE.digest, SOURCE.write, SOURCE.command + + +def source_inputs(source, revision=SOURCIFY_SHA, allow_gitlinks=False): + return SOURCE.source_inputs(source, revision, allow_gitlinks) + + +def build_images(directory): + """Build unmodified pinned images; never start a writable destination here.""" + directory = Path(directory).resolve() + check(not directory.exists(), 'Registry image preparation already exists') + directory.mkdir(parents=True) + source = directory / 'sourcify' + stages = [] + def retry(name, argv, cleanup=None): + for attempt in range(1, 6): + started = time.time() + stdout, stderr = directory / f'{name}-{attempt}.log', directory / f'{name}-{attempt}.stderr.log' + with stdout.open('wb') as out, stderr.open('wb') as err: + result = subprocess.run(argv, stdout=out, stderr=err) + stages.append({'name': name, 'attempt': attempt, 'argv': argv, 'started_at': started, + 'elapsed_seconds': time.time() - started, 'exit_code': result.returncode, + 'stdout_sha256': digest(stdout), 'stderr_sha256': digest(stderr)}) + write(directory / 'stages.json', stages) + if result.returncode == 0: + return + if cleanup: + cleanup() + check(attempt != 5, 'Test registry dependency failed: ' + name) + time.sleep(2 ** attempt) + try: + retry('source', ['git', 'clone', '--depth', '1', '--branch', SOURCIFY_TAG, + 'https://github.com/argotorg/sourcify.git', str(source)], + lambda: shutil.rmtree(source, ignore_errors=True)) + check(command(['git', '-C', str(source), 'rev-parse', 'HEAD']) == SOURCIFY_SHA, + 'Registry release tag differs from pinned source') + inputs = source_inputs(source) + write(directory / 'source-inputs.json', {'source_sha': SOURCIFY_SHA, 'inputs': inputs}) + retry('registry-image', ['docker', 'build', '-f', str(source / 'services/4byte/Dockerfile'), + '-t', REGISTRY_IMAGE, str(source)]) + retry('postgres-image', ['docker', 'pull', POSTGRES_IMAGE]) + images = {image: command(['docker', 'image', 'inspect', '--format', '{{.Id}}', image]) + for image in (REGISTRY_IMAGE, POSTGRES_IMAGE)} + check(all(re.fullmatch(r'sha256:[0-9a-f]{64}', value) for value in images.values()), + 'Invalid produced image identity') + check(source_inputs(source) == inputs, 'Registry build changed its committed inputs') + write(directory / 'images.json', images) + write(directory / 'final.json', {'state': 'ready', 'tests': 0, 'uploads': 0, 'exit_code': 0}) + except BaseException as error: + write(directory / 'final.json', {'state': 'failed', 'tests': 0, 'uploads': 0, + 'exit_code': 1, 'error': str(error) or type(error).__name__}) + raise + + +class Registry: + """Private containers; the client joins their otherwise unroutable namespace.""" + def __init__(self, source, output, expected_images=None): + self.source, self.output = Path(source).resolve(), Path(output).resolve() + self.output.mkdir(parents=True, exist_ok=True) + self.prefix = 'optimism-selector-shadow-' + uuid.uuid4().hex + self.pg, self.api = self.prefix + '-pg', self.prefix + '-api' + self.containers = [] + self.private = tempfile.TemporaryDirectory(prefix='selector-private-') + self.private_path = Path(self.private.name) + self.closed = False + self.expected_images = expected_images + + def docker(self, *args, **kwargs): + return command(['docker', *args], **kwargs) + + def sql(self, text): + return self.docker('exec', '-i', self.pg, 'psql', '-X', '-v', 'ON_ERROR_STOP=1', + '-U', 'postgres', '-d', 'selector_shadow', '-At', input=text.encode()) + + def rows(self): + text = self.sql("SELECT coalesce(json_agg(row_to_json(t)), '[]'::json) FROM " + "(SELECT signature, '0x'||encode(signature_hash_4,'hex') AS hash4, " + "'0x'||encode(signature_hash_32,'hex') AS hash32, created_at " + "FROM public.signatures ORDER BY signature) t;") + return json.loads(text) + + def start(self): + check(command(['git', '-C', str(self.source), 'rev-parse', 'HEAD']) == SOURCIFY_SHA, + 'Foreign signature registry source') + check((self.source / SCHEMA).read_bytes() == subprocess.check_output( + ['git', '-C', str(self.source), 'show', SOURCIFY_SHA + ':' + SCHEMA]), 'Changed registry schema') + write(self.output / 'registry-source.json', {'repository': 'https://github.com/argotorg/sourcify', + 'source_sha': SOURCIFY_SHA, 'schema_sha256': digest(self.source / SCHEMA), + 'dockerfile_sha256': digest(self.source / 'services/4byte/Dockerfile'), + 'lockfile_sha256': digest(self.source / 'package-lock.json'), 'helper_sha256': digest(__file__), + 'inputs': source_inputs(self.source)}) + image_ids = {image: self.docker('image', 'inspect', '--format', '{{.Id}}', image) + for image in (REGISTRY_IMAGE, POSTGRES_IMAGE)} + write(self.output / 'image-ids.json', image_ids) + check(all(re.fullmatch(r'sha256:[0-9a-f]{64}', value) for value in image_ids.values()), + 'Invalid test registry image identity') + if self.expected_images is not None: + check(image_ids == self.expected_images, 'Restored Docker images differ from their producer') + self.docker('run', '-d', '--name', self.pg, '--network', 'none', + '--tmpfs', '/var/lib/postgresql/data:rw,noexec,nosuid,size=512m', + '-e', 'POSTGRES_DB=selector_shadow', '-e', 'POSTGRES_HOST_AUTH_METHOD=trust', POSTGRES_IMAGE) + self.containers.append(self.pg) + for _ in range(120): + result = subprocess.run(['docker', 'exec', self.pg, 'pg_isready', '-h', '127.0.0.1', + '-U', 'postgres', '-d', 'selector_shadow'], + stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) + if result.returncode == 0: + break + time.sleep(.5) + else: + raise ValueError('Private database never became ready') + # Load the committed schema into this fresh private DB. No migration + # command or repository .env file can select an external destination. + self.sql((self.source / SCHEMA).read_text()) + self.sql("CREATE ROLE selector_writer LOGIN NOSUPERUSER NOCREATEDB NOCREATEROLE NOREPLICATION; " + "GRANT CONNECT ON DATABASE selector_shadow TO selector_writer; " + "GRANT USAGE ON SCHEMA public TO selector_writer; " + "GRANT SELECT,INSERT ON public.signatures TO selector_writer; " + "GRANT SELECT ON public.compiled_contracts_signatures TO selector_writer;") + check(self.rows() == [], 'Test registry contains restored upload results') + write(self.output / 'initial-rows.json', []) + self.docker('run', '-d', '--name', self.api, '--network', 'container:' + self.pg, + '--user', '1000:1000', '--read-only', '--cap-drop', 'ALL', + '--security-opt', 'no-new-privileges', '--tmpfs', '/tmp:rw,noexec,nosuid,size=64m', + '-e', 'PORT=4444', '-e', 'FOURBYTES_POSTGRES_HOST=127.0.0.1', + '-e', 'FOURBYTES_POSTGRES_DB=selector_shadow', '-e', 'FOURBYTES_POSTGRES_USER=selector_writer', + '-e', 'FOURBYTES_POSTGRES_PASSWORD=', REGISTRY_IMAGE) + self.containers.append(self.api) + for _ in range(120): + result = subprocess.run(['docker', 'exec', self.api, 'node', '-e', + "fetch('http://127.0.0.1:4444/health').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))"], + stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) + if result.returncode == 0: + break + time.sleep(.5) + else: + raise ValueError('Official private registry never became ready') + inspect = json.loads(self.docker('inspect', self.pg, self.api)) + check(inspect[0]['HostConfig']['NetworkMode'] == 'none' + and inspect[1]['HostConfig']['NetworkMode'].startswith('container:') + and all(not row['HostConfig']['PortBindings'] for row in inspect), 'Published or routable test registry') + self.pid = inspect[0]['State']['Pid'] + check(type(self.pid) is int and self.pid > 0, 'Missing private database namespace') + write(self.output / 'containers.json', inspect) + # Bind the running service's actual source and generated JavaScript, + # separately from non-reproducible Docker creation timestamps. + script = """const fs=require('fs'),path=require('path'),crypto=require('crypto'); + const root='/home/app/services/4byte',out={}; + function walk(dir){for(const entry of fs.readdirSync(dir,{withFileTypes:true})){ + const p=path.join(dir,entry.name);if(entry.isDirectory()){if(entry.name!=='node_modules')walk(p);} + else if(entry.isFile())out[path.relative(root,p)]=crypto.createHash('sha256').update(fs.readFileSync(p)).digest('hex'); + else throw Error('Unexpected service file type');}} + walk(root);console.log(JSON.stringify(out));""" + write(self.output / 'service-content.json', json.loads(self.docker('exec', self.api, 'node', '-e', script))) + self.certificate() + return self + + def certificate(self): + p = self.private_path + self.hosts = p / 'hosts' + self.hosts.write_text('127.0.0.1 localhost ' + HOST + '\n::1 localhost\n') + self.ca, self.cert, self.key, self.bundle = (p / name for name in ('ca.pem', 'server.pem', 'server.key', 'trust.pem')) + commands = [ + ['openssl', 'req', '-x509', '-newkey', 'rsa:2048', '-nodes', '-days', '1', '-subj', '/CN=RWX selector test root', + '-keyout', str(p / 'ca.key'), '-out', str(self.ca), '-addext', 'basicConstraints=critical,CA:TRUE'], + ['openssl', 'req', '-newkey', 'rsa:2048', '-nodes', '-subj', '/CN=' + HOST, + '-keyout', str(self.key), '-out', str(p / 'server.csr')], + ] + extensions = p / 'extensions' + extensions.write_text('basicConstraints=critical,CA:FALSE\nkeyUsage=critical,digitalSignature,keyEncipherment\n' + 'extendedKeyUsage=serverAuth\nsubjectAltName=DNS:' + HOST + '\n') + commands += [['openssl', 'x509', '-req', '-in', str(p / 'server.csr'), '-CA', str(self.ca), '-CAkey', str(p / 'ca.key'), + '-CAcreateserial', '-days', '1', '-out', str(self.cert), '-extfile', str(extensions)]] + for argv in commands: + subprocess.run(argv, check=True, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) + self.bundle.write_bytes(Path('/etc/ssl/certs/ca-certificates.crt').read_bytes() + b'\n' + self.ca.read_bytes()) + for name, path in [('ca.pem', self.ca), ('server.pem', self.cert)]: + (self.output / name).write_bytes(path.read_bytes()) + + def run(self, name, argv, cwd, timeout=2400): + check(not self.closed and name.replace('-', '').isalnum(), 'Invalid or closed private registry attempt') + output = self.output / name + output.mkdir() + # sudo deliberately resets PATH/HOME. Restore only the caller's build + # environment inside the isolated client; never forward CI credentials. + environment = {key: os.environ[key] for key in ( + 'PATH', 'HOME', 'USER', 'LOGNAME', 'TMPDIR', 'TMP', 'TEMP', 'XDG_CACHE_HOME', + 'XDG_CONFIG_HOME', 'SVM_HOME', 'FOUNDRY_PROFILE', 'FOUNDRY_SOLC', 'FOUNDRY_OFFLINE') + if key in os.environ} + environment_file = self.private_path / (name + '-environment.json') + write(environment_file, environment) + environment_file.chmod(0o600) + executable = shutil.which(argv[0]) + check(executable is not None, 'Selector command is unavailable before isolation') + isolated_argv = [executable, *argv[1:]] + args = ['sudo', '-n', 'nsenter', '--net=/proc/' + str(self.pid) + '/ns/net', + 'unshare', '--mount', '--pid', '--fork', '--mount-proc', sys.executable, str(Path(__file__).resolve()), + 'child', str(output), str(self.hosts), str(self.bundle), str(self.cert), str(self.key), + str(os.getuid()), str(os.getgid()), str(Path(cwd).resolve()), str(environment_file), *isolated_argv] + started, cancelled = time.time(), [] + row = {'argv': argv, 'cwd': str(Path(cwd).resolve()), 'started_at': started, + 'exit_code': None, 'timed_out': False, 'signals': cancelled} + write(output / 'execution.json', row) + with (output / 'stdout.log').open('wb') as stdout, (output / 'stderr.log').open('wb') as stderr: + process = subprocess.Popen(args, stdout=stdout, stderr=stderr, start_new_session=True) + def stop(signum, _): + cancelled.append(signum) + subprocess.run(['sudo', '-n', 'kill', '-' + str(signum), '--', '-' + str(process.pid)], + stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) + previous = {signum: signal.signal(signum, stop) for signum in (signal.SIGTERM, signal.SIGINT)} + try: + try: + status = process.wait(timeout=timeout) + except subprocess.TimeoutExpired: + row['timed_out'] = True + stop(signal.SIGTERM, None) + try: + process.wait(timeout=10) + except subprocess.TimeoutExpired: + stop(signal.SIGKILL, None) + process.wait(timeout=10) + status = 124 + finally: + for signum, handler in previous.items(): + signal.signal(signum, handler) + status = status if status >= 0 else 128 - status + row.update(exit_code=status, elapsed_seconds=time.time() - started, + stdout_sha256=digest(output / 'stdout.log'), stderr_sha256=digest(output / 'stderr.log')) + write(output / 'execution.json', row) + write(output / 'database-rows.json', self.rows()) + return status + + def close(self): + if self.closed: + return + self.closed = True + for name in reversed(self.containers): + with (self.output / ('api.log' if name == self.api else 'postgres.log')).open('wb') as log: + subprocess.run(['docker', 'logs', name], stdout=log, stderr=subprocess.STDOUT) + subprocess.run(['docker', 'rm', '-f', '-v', name], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) + self.private.cleanup() + + +def child(output, hosts, bundle, cert, key, uid, gid, cwd, environment_file, argv): + output = Path(output) + check(os.geteuid() == 0 and os.getpid() == 1, 'Client did not enter a private PID/mount namespace') + subprocess.run(['mount', '--make-rprivate', '/'], check=True) + for source, target in [(hosts, '/etc/hosts'), (bundle, '/etc/ssl/certs/ca-certificates.crt')]: + subprocess.run(['mount', '--bind', source, target], check=True) + check([name for _, name in socket.if_nameindex()] == ['lo'], 'Client has an external network interface') + blocked = [] + for address in ('1.1.1.1', '2606:4700:4700::1111'): + try: + connection = socket.create_connection((address, 443), 2) + connection.close() + raise ValueError('Client can reach an external network') + except OSError as error: + check(error.errno == 101, 'External connection was not blocked by routing') + blocked.append({'address': address, 'errno': error.errno}) + check(socket.gethostbyname(HOST) == '127.0.0.1', 'Client did not resolve the isolated destination') + lock, counter = threading.Lock(), [0] + + class Proxy(BaseHTTPRequestHandler): + def log_message(self, *_): + pass + + def forward(self): + check(self.headers.get('Host') == HOST and (self.path == IMPORT or self.path.startswith(LOOKUP + '?')), + 'Unexpected selector destination') + length = int(self.headers.get('Content-Length', '0')) + check(0 <= length <= 102400, 'Oversized selector import') + body = self.rfile.read(length) + if self.command == 'POST': + check(self.path == IMPORT, 'Unexpected write destination') + data = json.loads(body) + check(set(data) == {'function', 'event'} and all(isinstance(values, list) and len(values) <= 1000 + and all(isinstance(value, str) for value in values) for values in data.values()), 'Invalid selector import schema') + backend = http.client.HTTPConnection('127.0.0.1', 4444, timeout=15) + try: + backend.request(self.command, self.path, body=body, headers={'Content-Type': 'application/json'}) + response = backend.getresponse() + raw = response.read() + with lock: + number = counter[0] + counter[0] += 1 + stem = 'http-' + str(number) + (output / (stem + '-request.json')).write_bytes(body) + (output / (stem + '-response.json')).write_bytes(raw) + write(output / (stem + '.json'), {'method': self.command, 'path': self.path, 'host': self.headers['Host'], + 'status': response.status, 'request_sha256': hashlib.sha256(body).hexdigest(), + 'response_sha256': hashlib.sha256(raw).hexdigest()}) + self.send_response(response.status) + self.send_header('Content-Type', 'application/json') + self.send_header('Content-Length', str(len(raw))) + self.end_headers() + self.wfile.write(raw) + finally: + backend.close() + + do_POST = forward + do_GET = forward + + server = ThreadingHTTPServer(('127.0.0.1', 443), Proxy) + context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER) + context.load_cert_chain(cert, key) + server.socket = context.wrap_socket(server.socket, server_side=True) + env = json.loads(Path(environment_file).read_text()) + check(isinstance(env, dict) and all(isinstance(key, str) and isinstance(value, str) + for key, value in env.items()), 'Invalid isolated build environment') + # Client and proxy have no privilege to add routes or recover setuid powers. + check(ctypes.CDLL(None, use_errno=True).prctl(38, 1, 0, 0, 0) == 0, 'Could not prevent new privileges') + os.setgroups([]) + os.setgid(int(gid)) + os.setuid(int(uid)) + check(os.geteuid() != 0, 'Selector client retained root privilege') + write(output / 'isolation.json', {'pid': os.getpid(), 'uid': os.getuid(), 'gid': os.getgid(), + 'network_namespace': os.readlink('/proc/self/ns/net'), 'mount_namespace': os.readlink('/proc/self/ns/mnt'), + 'interfaces': socket.if_nameindex(), 'external_blocked': blocked, 'no_new_privileges': True, + 'hosts_sha256': digest('/etc/hosts'), 'trust_sha256': digest('/etc/ssl/certs/ca-certificates.crt'), + 'destination': 'https://' + HOST + IMPORT}) + thread = threading.Thread(target=server.serve_forever, daemon=True) + thread.start() + env['SSL_CERT_FILE'] = bundle + try: + process = subprocess.Popen(argv, cwd=cwd, env=env, start_new_session=True) + def stop(signum, _): + try: + os.killpg(process.pid, signum) + except ProcessLookupError: + pass + previous = {signum: signal.signal(signum, stop) for signum in (signal.SIGTERM, signal.SIGINT)} + try: + status = process.wait() + return status if status >= 0 else 128 - status + finally: + for signum, handler in previous.items(): + signal.signal(signum, handler) + finally: + server.shutdown() + server.server_close() + thread.join() + + +def fixture(source, output): + output = Path(output).resolve() + project = output / 'project' + (project / 'src').mkdir(parents=True) + (project / 'foundry.toml').write_text('[profile.default]\nsrc="src"\nsolc_version="0.8.28"\n') + (project / 'src/Fixture.sol').write_text('// SPDX-License-Identifier: MIT\npragma solidity 0.8.28;\n' + 'contract Fixture { struct Pair { uint256 x; address recipient; }\n' + 'error Problem(uint256 value); event Pong(uint256 value);\n' + 'function ping(uint256 value) external pure returns (uint256) { if (value==0) revert Problem(value); return value; }\n' + 'function transform(Pair calldata pair) external pure returns (uint256) { return pair.x; } }\n') + signatures = ['ping(uint256)', 'transform((uint256,address))', 'Problem(uint256)', 'Pong(uint256)'] + expected = {name: command(['cast', 'keccak', name]) for name in signatures} + registry = Registry(source, output / 'registry') + try: + registry.start() + for name in ('first-upload', 'duplicate-upload'): + check(registry.run(name, ['forge', 'selectors', 'up', '--all'], project) == 0, 'Real Forge upload fixture failed') + rows = registry.rows() + check({row['signature']: row['hash32'] for row in rows} == expected, 'Official database lacks complete real Forge signatures') + registry.sql('REVOKE INSERT ON public.signatures FROM selector_writer;') + check(registry.run('denied-write', ['forge', 'selectors', 'up', '--all'], project) != 0, + 'Real Forge ignored denied database writes') + check({row['signature']: row['hash32'] for row in registry.rows()} == expected, 'Denied upload changed test database') + check(registry.run('cancelled-client', ['sleep', '60'], project, timeout=1) == 124, + 'Private client cancellation was not preserved') + check({row['signature']: row['hash32'] for row in registry.rows()} == expected, 'Cancelled client changed test database') + write(output / 'fixture.json', {'state': 'passed', 'coverage_added': 0, 'signatures': expected, + 'real_forge_upload': True, 'real_duplicate_upload': True, 'real_denied_write': True, + 'real_client_timeout': True}) + finally: + registry.close() + + +if __name__ == '__main__': + parser = argparse.ArgumentParser(description=__doc__) + sub = parser.add_subparsers(dest='mode', required=True) + images = sub.add_parser('images') + images.add_argument('directory', type=Path) + live = sub.add_parser('fixture') + live.add_argument('source', type=Path) + live.add_argument('output', type=Path) + private = sub.add_parser('child') + for name in ('output', 'hosts', 'bundle', 'cert', 'key', 'uid', 'gid', 'cwd', 'environment_file'): + private.add_argument(name) + private.add_argument('argv', nargs=argparse.REMAINDER) + args = parser.parse_args() + if args.mode == 'images': + build_images(args.directory) + elif args.mode == 'fixture': + fixture(args.source, args.output) + else: + sys.exit(child(args.output, args.hosts, args.bundle, args.cert, args.key, args.uid, args.gid, + args.cwd, args.environment_file, args.argv)) diff --git a/ops/ci/migration/selector-upload.py b/ops/ci/migration/selector-upload.py new file mode 100644 index 00000000000..e7f7890a9fa --- /dev/null +++ b/ops/ci/migration/selector-upload.py @@ -0,0 +1,426 @@ +#!/usr/bin/env python3 +"""Compile complete ABI evidence and run the real selector publisher privately.""" +import argparse +from collections import Counter +from concurrent.futures import ThreadPoolExecutor +import hashlib +import importlib.util +import json +import os +from pathlib import Path +import re +import shutil +import subprocess +import sys +import time +import urllib.parse +import urllib.request + + +def helper(name): + spec = importlib.util.spec_from_file_location(name, (Path(__file__).parent if name.startswith('compare-') or name in ('flaky-report','selector-upload','selector-registry') else Path(__file__).resolve().parents[1] / 'runtime') / (name + '.py')) + module = importlib.util.module_from_spec(spec) + spec.loader.exec_module(module) + return module + + +R = helper('selector-registry') +UP = helper('contract-upgrades') +ROOT, CONTRACTS = UP.ROOT, UP.CONTRACTS +COMMAND = ['just', 'update-selectors'] +COMPILERS = ('0.8.15', '0.8.19', '0.8.25', '0.8.28', '0.8.30') +IMPLEMENTATION = ('selector-upload.py', 'selector-registry.py', 'contract-upgrades.py', + 'git-submodule-report.py', 'ci-report.py', 'ci-source.py') + + +def read(path): + def pairs(items): + result = {} + for key, value in items: + R.check(key not in result, 'Duplicate original JSON key') + result[key] = value + return result + return json.loads(Path(path).read_bytes(), object_pairs_hook=pairs, + parse_constant=lambda _: (_ for _ in ()).throw(ValueError('Non-finite original JSON'))) + + +def files(directory): + result = {} + for path in sorted(Path(directory).rglob('*')): + R.check(not path.is_symlink(), 'Linked selector evidence') + if path.is_file() and path != Path(directory) / 'final.json': + result[str(path.relative_to(directory))] = R.digest(path) + return result + + +def seal(directory, state, status, errors, uploads=0): + R.write(directory / 'final.json', {'state': state, 'exit_code': status, 'tests': 0, + 'uploads': uploads, 'errors': errors, 'sha256': files(directory)}) + + +def original(directory, state): + final = read(directory / 'final.json') + R.check(final['state'] == state and type(final['exit_code']) is int and final['exit_code'] == 0 + and type(final['tests']) is int and final['tests'] == 0 + and type(final['uploads']) is int and final['uploads'] == (1 if state == 'passed' else 0) + and final['errors'] == [] + and final['sha256'] == files(directory), 'Incomplete or corrupt selector originals') + return final + + +def configuration(): + return json.loads(UP.command('forge', 'config', '--json', cwd=CONTRACTS)) + + +def compiler_tools(versions): + result = {} + for version in sorted(versions): + R.check(re.fullmatch(r'0\.\d+\.\d+', version), 'Invalid selected compiler version') + path = UP.command('svm', 'which', version) + result[version] = {'version': UP.command(path, '--version'), 'sha256': R.digest(path)} + return result + + +def identity(): + R.check(os.environ.get('FOUNDRY_PROFILE', 'default') == 'default', 'Selector publisher requires the default profile') + R.check(not any(key.startswith(('FOUNDRY_', 'DAPP_', 'DEV_FEATURE__', 'SYS_FEATURE__')) + and key != 'FOUNDRY_PROFILE' for key in os.environ), 'Unexpected selector compiler override') + sha = UP.revision() + branch = os.environ.get('CI_BRANCH') or os.environ.get('CIRCLE_BRANCH') + R.check(branch, 'Missing selector branch metadata') + tools = {} + for name in ('forge', 'cast', 'just'): + binary = shutil.which(name) + R.check(binary, 'Missing selector tool: ' + name) + tools[name] = {'version': UP.command(name, '--version'), 'sha256': R.digest(binary)} + compilers = {} + for version in COMPILERS: + path = UP.command('svm', 'which', version) + compilers[version] = {'version': UP.command(path, '--version'), 'sha256': R.digest(path)} + return {'version': 1, 'source_sha': sha, 'branch': branch, 'profile': 'default', + 'provider': os.environ.get('CI_CHECK_PROVIDER', 'circleci'), 'workspace_root': str(ROOT), + 'tools': tools, 'compilers': compilers, 'command': COMMAND, + 'configuration': configuration(), 'inputs': R.source_inputs(ROOT, sha, True), + 'implementation': {name: R.digest(helper(name[:-3]).__file__) for name in IMPLEMENTATION}, + 'native_run_id': os.environ.get('RWX_RUN_ID'), + 'native_task_attempt': os.environ.get('RWX_TASK_ATTEMPT_NUMBER')} + + +def canonical_type(parameter): + kind = parameter.get('type') + R.check(isinstance(kind, str), 'Missing canonical ABI parameter type') + if kind.startswith('tuple'): + suffix = kind.removeprefix('tuple') + R.check(re.fullmatch(r'(?:\[\d*\])*', suffix) is not None + and isinstance(parameter.get('components'), list), 'Invalid ABI tuple') + return '(' + ','.join(canonical_type(p) for p in parameter['components']) + ')' + suffix + R.check(re.fullmatch(r'(?:address|bool|string|bytes\d*|u?int\d+|u?fixed\d+x\d+|function)(?:\[\d*\])*', kind), + 'Noncanonical ABI parameter type') + return kind + + +def signatures(abi): + R.check(isinstance(abi, list), 'Missing compiler ABI') + rows = [] + for item in abi: + kind = item.get('type') + R.check(kind in ('constructor', 'fallback', 'receive', 'function', 'event', 'error'), 'Unknown ABI declaration') + if kind not in ('function', 'event', 'error'): + continue + name, inputs = item.get('name'), item.get('inputs') + R.check(isinstance(name, str) and re.fullmatch(r'[A-Za-z_$][A-Za-z0-9_$]*', name) + and isinstance(inputs, list), 'Invalid ABI signature') + rows.append({'kind': kind, 'signature': name + '(' + ','.join(canonical_type(p) for p in inputs) + ')'}) + R.check(len({(r['kind'], r['signature']) for r in rows}) == len(rows), 'Duplicate compiler ABI signature') + return sorted(rows, key=lambda r: (r['kind'], r['signature'])) + + +def safe_relative(name): + path = Path(name) + R.check(not path.is_absolute() and '..' not in path.parts and path.parts, 'Unsafe compiler source or artifact path') + return path + + +def catalog(cache, build_info, artifacts): + """Use the original compiler cache's source/version/profile assignments.""" + R.check(cache.get('preprocessed') is True and isinstance(cache.get('files'), dict) + and isinstance(cache.get('profiles'), dict) and isinstance(cache.get('builds'), list) + and len(cache['builds']) == len(set(cache['builds'])) == len(build_info), 'Incomplete compiler ABI inventory') + R.check(set(cache['builds']) == set(build_info), 'Missing or extra original compiler unit') + source_ids = {} + for build_id, unit in build_info.items(): + R.check(unit['id'] == build_id and unit['language'] == 'Solidity' + and unit['solcVersion'] == unit['input']['version'], 'Foreign compiler unit identity') + unit_ids = {str(row['id']): source for source, row in unit['output']['sources'].items()} + R.check(len(unit_ids) == len(unit['output']['sources']) and unit_ids == unit['source_id_to_path'], + 'Corrupt compiler unit source map') + for source, row in unit['output']['sources'].items(): + source_ids.setdefault((source, unit['solcVersion']), set()).add(row['id']) + source_prefix = safe_relative(cache['paths']['sources']) + selected, bindings, consumed = [], {}, set() + for source, row in sorted(cache['files'].items()): + source_path = safe_relative(source) + R.check(row['sourceName'] == source and row['seenByCompiler'] is True, 'Uncompiled or foreign ABI source') + in_sources = source_path.is_relative_to(source_prefix) + is_test = source.endswith('.t.sol') + for contract, versions in sorted(row['artifacts'].items()): + for version, profiles in sorted(versions.items()): + for profile, ref in sorted(profiles.items()): + R.check(profile in cache['profiles'] and ref['build_id'] in build_info, 'Foreign ABI compiler profile') + name = str(safe_relative(ref['path'])) + R.check(name in artifacts and name not in consumed, 'Missing or duplicate compiler ABI artifact') + consumed.add(name) + unit = build_info[ref['build_id']] + R.check(unit['solcVersion'] == version and unit['input']['version'] == version + and source in unit['input']['sources'], 'ABI artifact compiler provenance differs') + artifact = artifacts[name] + compiled = unit['output']['contracts'][source][contract] + # Foundry 1.8.3 takes artifact.id from the first SourceFile + # matching path/version, without considering its profile. + # Use the exact build unit's own source map for provenance; + # retain and verify the artifact's separate original ID. + unit_id = unit['output']['sources'][source]['id'] + R.check(artifact['abi'] == compiled['abi'] + and type(artifact['id']) is int + and artifact['id'] in source_ids[(source, version)] + and unit['source_id_to_path'][str(unit_id)] == source, + 'Corrupt compiler ABI binding: ' + source + ':' + contract + ':' + version + ':' + profile) + entries = signatures(artifact['abi']) + reason = 'selected' if in_sources and not is_test and entries else \ + 'outside-source-path' if not in_sources else 'test-source' if is_test else 'empty-selector-abi' + key = source + ':' + contract + ':' + version + ':' + profile + R.check(key not in bindings, 'Duplicate ABI declaration identity') + binding = {'source': source, 'contract': contract, 'compiler': version, 'profile': profile, + 'artifact': name, 'build_id': ref['build_id'], 'abi': artifact['abi'], + 'artifact_source_id': artifact['id'], 'unit_source_id': unit_id, + 'signatures': entries, 'selection': reason} + bindings[key] = binding + if reason == 'selected': + selected.append(key) + R.check(consumed == set(artifacts) and selected, 'Extra artifacts or empty selector workload') + return {'declarations': bindings, 'selected': sorted(selected), + 'compiler_profiles': cache['profiles'], 'compiled_sources': sorted(cache['files'])} + + +def keccak(signature): + value = UP.command('cast', 'keccak', signature) + R.check(re.fullmatch(r'0x[0-9a-f]{64}', value), 'Invalid independent selector digest') + return signature, value + + +def expected(catalogue): + sets = {'function': set(), 'event': set()} + for key in catalogue['selected']: + for row in catalogue['declarations'][key]['signatures']: + sets['event' if row['kind'] == 'event' else 'function'].add(row['signature']) + with ThreadPoolExecutor(max_workers=8) as pool: + hashes = dict(pool.map(keccak, sorted(set.union(*sets.values())))) + return {'signatures': {kind: {sig: hashes[sig] if kind == 'event' else hashes[sig][:10] + for sig in sorted(values)} for kind, values in sets.items()}, 'hash32': hashes} + + +def discover(directory, settings): + directory.mkdir(parents=True, exist_ok=True) + # build_info only persists the ABI compiler's original inputs/outputs. + # The upload below keeps the publisher's original build_info=false. + for name in ('out', 'cache_path'): + path = CONTRACTS / safe_relative(settings['configuration'][name]) + shutil.rmtree(path, ignore_errors=True) + info_path = settings['configuration']['build_info_path'] or settings['configuration']['out'] + '/build-info' + shutil.rmtree(CONTRACTS / safe_relative(info_path), ignore_errors=True) + os.environ['FOUNDRY_BUILD_INFO'] = 'true' + try: + status = UP.stage(directory, 'abi-oracle', ['forge', 'selectors', 'list', '--no-group']) + R.check(status == 0, 'Complete compiler ABI discovery failed') + finally: + os.environ.pop('FOUNDRY_BUILD_INFO', None) + cache_path = CONTRACTS / settings['configuration']['cache_path'] / 'solidity-files-cache.json' + cache = read(cache_path) + info_root = CONTRACTS / cache['paths']['build_infos'] + infos = {p.stem: read(p) for p in sorted(info_root.glob('*.json'))} + artifact_root = CONTRACTS / cache['paths']['artifacts'] + artifacts = {str(p.relative_to(artifact_root)): read(p) for p in sorted(artifact_root.rglob('*.json')) + if not p.is_relative_to(info_root)} + # Preserve original compiler evidence even when validation rejects it. + shutil.copy2(cache_path, directory / 'compiler-cache.json') + shutil.copytree(info_root, directory / 'compiler-units') + shutil.copytree(artifact_root, directory / 'compiler-artifacts') + selection = catalog(cache, infos, artifacts) + R.write(directory / 'selection.json', selection) + return selection, compiler_tools({unit['solcVersion'] for unit in infos.values()}) + + +def prepare_compilers(directory): + # The complete graph requires 0.8.30. Installing it before auto detection + # makes a cold worker choose the same versions as a restored SVM cache. + for version in COMPILERS: + try: UP.command('svm', 'which', version) + except subprocess.CalledProcessError: + for attempt in range(1, 6): + status = UP.stage(directory, 'solc-' + version + '-attempt-' + str(attempt), ['svm', 'install', version]) + if status == 0: break + R.check(attempt < 5, 'Pinned selector compiler installation failed') + time.sleep(2 ** attempt) + + +def prepare(directory): + R.check(not directory.exists(), 'Selector preparation already exists') + directory.mkdir(parents=True) + status, errors = 1, [] + try: + prepare_compilers(directory) + settings = identity() + R.write(directory / 'settings.json', settings) + R.write(directory / 'foundry-config.json', settings['configuration']) + # Auto detection favors installed compatible solc versions. Its first + # complete pass can install a further version required by dependencies. + # Retain that pass, then bind the selection with all those compilers + # already available to both the cached producer and fresh publisher. + _, resolved = discover(directory / 'initial-discovery', settings) + R.write(directory / 'initial-discovery/selected-compilers.json', resolved) + selection, selected = discover(directory, settings) + R.check(set(selected) <= set(resolved) and compiler_tools(resolved) == resolved, + 'Compiler resolution did not stabilize after complete discovery') + R.write(directory / 'selected-compilers.json', resolved) + R.write(directory / 'expected.json', expected(selection)) + R.check(identity() == settings, 'ABI discovery changed effective settings or source inputs') + status = 0 + except BaseException as error: + errors.append(str(error) or type(error).__name__) + if isinstance(error, KeyboardInterrupt): + status = 130 + raise + finally: + seal(directory, 'compiled' if not errors and status == 0 else 'failed', status or 1 if errors else status, errors) + + +def imports(directory, expectation): + result = {kind: {'imported': {}, 'duplicated': {}} for kind in ('function', 'event')} + sent = {kind: {} for kind in result} + metadata = sorted(directory.glob('http-*.json'), key=lambda p: int(p.stem.split('-')[1]) + if re.fullmatch(r'http-\d+', p.stem) else -1) + metadata = [p for p in metadata if re.fullmatch(r'http-\d+', p.stem)] + R.check(metadata, 'No actual selector POSTs') + for number, path in enumerate(metadata): + row = read(path) + R.check(path.stem == 'http-' + str(number) and row['method'] == 'POST' and row['host'] == R.HOST + and row['path'] == R.IMPORT and row['status'] == 200, 'Failed, foreign or incomplete original selector request') + request, response = (directory / (path.stem + suffix) for suffix in ('-request.json', '-response.json')) + R.check(R.digest(request) == row['request_sha256'] and R.digest(response) == row['response_sha256'], + 'Corrupt original selector payload') + payload, verdict = read(request), read(response) + R.check(set(payload) == set(result) and verdict['ok'] is True and set(verdict['result']) == set(result), + 'Invalid original selector protocol') + for kind in result: + values, outcome = payload[kind], verdict['result'][kind] + R.check(isinstance(values, list) and len(values) <= 1000 and len(set(values)) == len(values) + and not (set(values) & set(sent[kind])) and set(outcome) == {'imported', 'duplicated', 'invalid'} + and outcome['invalid'] == [] and not (set(outcome['imported']) & set(outcome['duplicated'])) + and set(outcome['imported']) | set(outcome['duplicated']) == set(values), 'Omitted, repeated or rejected selectors') + for state in ('imported', 'duplicated'): + for signature, digest in outcome[state].items(): + R.check(expectation['signatures'][kind].get(signature) == digest, 'Unexpected selector import digest') + result[kind][state].update(outcome[state]) + sent[kind].update(outcome['imported'] | outcome['duplicated']) + R.check(sent == expectation['signatures'], 'Actual Forge upload differs from complete compiler ABI selection') + return {'requests': len(metadata), 'outcomes': result} + + +def lookup_client(expectation_path, output): + expectation = read(expectation_path) + hashes = expectation['hash32'] + expected_maps = {'function': {}, 'event': {}} + # The official DB is type-independent: include every row sharing a hash, + # including legitimate four-byte collisions and event-only signatures. + for signature, digest in hashes.items(): + expected_maps['function'].setdefault(digest[:10], []).append(signature) + expected_maps['event'].setdefault(digest, []).append(signature) + observed = {'function': {}, 'event': {}} + for kind, wanted in expected_maps.items(): + keys = sorted(wanted) + for start in range(0, len(keys), 50): + query = urllib.parse.urlencode({kind: ','.join(keys[start:start + 50]), 'filter': 'false'}) + with urllib.request.urlopen('https://' + R.HOST + R.LOOKUP + '?' + query, timeout=15) as response: + row = json.loads(response.read()) + R.check(row['ok'] is True and set(row['result']) == set(observed) + and set(row['result'][kind]) == set(keys[start:start + 50]) + and row['result']['event' if kind == 'function' else 'function'] == {}, 'Incomplete registry lookup') + for digest, values in row['result'][kind].items(): + R.check(isinstance(values, list) and all(set(v) == {'name', 'filtered', 'hasVerifiedContract'} + and type(v['filtered']) is bool and v['hasVerifiedContract'] is False for v in values) + and sorted(v['name'] for v in values) == sorted(wanted[digest]), 'Registry lookup omitted or added signatures') + observed[kind][digest] = values + R.write(Path(output), observed) + + +def run(directory, prepared, registry_source, images): + original(prepared, 'compiled') + settings, wanted = read(prepared / 'settings.json'), read(prepared / 'expected.json') + compilers = read(prepared / 'selected-compilers.json') + R.check(compiler_tools(compilers) == compilers, 'Stale selected selector compiler') + current = identity() + for key in ('version', 'source_sha', 'branch', 'profile', 'workspace_root', 'tools', 'compilers', + 'command', 'configuration', 'inputs', 'implementation'): + R.check(current[key] == settings[key], 'Stale selector preparation: ' + key) + R.check(not directory.exists(), 'Selector verdict already exists') + directory.mkdir(parents=True) + R.write(directory / 'settings.json', current) + shutil.copytree(prepared, directory / 'prepared') + status, errors, uploads = 1, [], 0 + registry = R.Registry(registry_source, directory / 'registry', read(images)) + try: + if UP.stage(directory, 'recipe', ['just', '--dry-run', 'update-selectors']): + raise ValueError('Cannot inspect actual publisher recipe') + R.check((directory / 'recipe.stderr.log').read_text().strip() == 'forge selectors up --all' + and (directory / 'recipe.log').read_text().strip() == '', 'Original selector recipe changed') + registry.start() + status = registry.run('upload', COMMAND, CONTRACTS) + R.check(status == 0, 'Real selector publisher failed') + catalogue = read(prepared / 'selection.json') + names = Counter(catalogue['declarations'][key]['contract'] for key in catalogue['selected']) + text = (directory / 'registry/upload/stdout.log').read_text() + statuses = (directory / 'registry/upload/stderr.log').read_text() + observed = Counter(re.findall(r'^Uploading selectors for ([A-Za-z_$][A-Za-z0-9_$]*)\.\.\.$', statuses, re.MULTILINE)) + R.check(observed == names and 'Selectors successfully uploaded to OpenChain' in text, + 'Publisher omitted selected declarations or its real success output') + R.write(directory / 'imports.json', imports(directory / 'registry/upload', wanted)) + rows = registry.rows() + R.check({row['signature']: row['hash32'] for row in rows} == wanted['hash32'] + and all(row['hash4'] == row['hash32'][:10] and isinstance(row['created_at'], str) for row in rows), + 'Real database does not contain exactly the complete uploaded selection') + lookup = directory / 'lookup.json' + status = registry.run('lookup', [sys.executable, str(Path(__file__).resolve()), 'lookup-client', + str(prepared / 'expected.json'), str(lookup)], CONTRACTS) + R.check(status == 0 and lookup.is_file(), 'Real registry readback failed') + after = identity() + R.check(after == current, 'Selector execution changed source inputs or effective settings') + uploads, status = 1, 0 + except BaseException as error: + errors.append(str(error) or type(error).__name__) + if isinstance(error, KeyboardInterrupt): + status = 130 + raise + finally: + registry.close() + seal(directory, 'passed' if not errors and status == 0 and uploads == 1 else 'failed', + status or 1 if errors or uploads != 1 else status, + errors, uploads) + + +if __name__ == '__main__': + parser = argparse.ArgumentParser(description=__doc__) + modes = parser.add_subparsers(dest='mode', required=True) + modes.add_parser('prepare').add_argument('directory', type=Path) + verdict = modes.add_parser('run') + for name in ('directory', 'prepared', 'registry_source', 'images'): + verdict.add_argument(name, type=Path) + lookup = modes.add_parser('lookup-client') + lookup.add_argument('expectation', type=Path) + lookup.add_argument('output', type=Path) + args = parser.parse_args() + if args.mode == 'prepare': + prepare(args.directory.resolve()) + elif args.mode == 'run': + run(args.directory.resolve(), args.prepared.resolve(), args.registry_source.resolve(), args.images.resolve()) + else: + lookup_client(args.expectation, args.output) diff --git a/ops/ci/migration/tests/fixtures/ci-comparison/circleci-contract-cases.json b/ops/ci/migration/tests/fixtures/ci-comparison/circleci-contract-cases.json new file mode 100644 index 00000000000..2db5f83f863 --- /dev/null +++ b/ops/ci/migration/tests/fixtures/ci-comparison/circleci-contract-cases.json @@ -0,0 +1,30 @@ +{ + "sha": "cb48622213e9aa8408de9904baafac784441ecc6", + "provenance": { + "url": "https://circleci.com/gh/ethereum-optimism/optimism/5622529", + "source": "CircleCI test metadata API, selected real records; intentionally incomplete fixture, not a full runtime report" + }, + "cases": [ + { + "classname": "test/L1/DataAvailabilityChallenge.t.sol:DataAvailabilityChallenge_Challenge_Test", + "name": "test_challenge_afterChallengeWindow_reverts()", + "result": "system-out", + "run_time": 0, + "message": "[PASS] test_challenge_afterChallengeWindow_reverts() (gas: 70425)" + }, + { + "classname": "test/L1/L1StandardBridge.t.sol:L1StandardBridge_DepositETHTo_Test", + "name": "testFuzz_depositETHTo_withCustomGasToken_reverts(address,uint256,uint32)", + "result": "skipped", + "run_time": 0.07, + "message": "Skipping test because SYS_FEATURE__CUSTOM_GAS_TOKEN is disabled[SKIP: Skipping test because SYS_FEATURE__CUSTOM_GAS_TOKEN is disabled] testFuzz_depositETHTo_withCustomGasToken_reverts(address,uint256,uint32) (runs: 0, \u03bc: 0, ~: 0)" + }, + { + "classname": "test/L1/L1StandardBridge.t.sol:L1StandardBridge_DepositETH_Test", + "name": "testFuzz_depositETH_fromEOA7702WithCustomGasToken_reverts(uint256,uint32)", + "result": "skipped", + "run_time": 0.079, + "message": "Skipping test because SYS_FEATURE__CUSTOM_GAS_TOKEN is disabled[SKIP: Skipping test because SYS_FEATURE__CUSTOM_GAS_TOKEN is disabled] testFuzz_depositETH_fromEOA7702WithCustomGasToken_reverts(uint256,uint32) (runs: 0, \u03bc: 0, ~: 0)" + } + ] +} diff --git a/ops/ci/migration/tests/fixtures/ci-comparison/circleci-foundry-skips.json b/ops/ci/migration/tests/fixtures/ci-comparison/circleci-foundry-skips.json new file mode 100644 index 00000000000..e932400c37f --- /dev/null +++ b/ops/ci/migration/tests/fixtures/ci-comparison/circleci-foundry-skips.json @@ -0,0 +1,37 @@ +{ + "sha": "cb48622213e9aa8408de9904baafac784441ecc6", + "provenance": { + "url": "https://circleci.com/gh/ethereum-optimism/optimism/5622529", + "source": "Selected original CircleCI API records corresponding to native Foundry fixture identities. Different SHA; parsing fixture only, not a provider equivalence claim." + }, + "cases": [ + { + "classname": "test/L1/L1StandardBridge.t.sol:L1StandardBridge_DepositETHTo_Test", + "name": "testFuzz_depositETHTo_withCustomGasToken_reverts(address,uint256,uint32)", + "result": "skipped", + "run_time": 0.07, + "message": "Skipping test because SYS_FEATURE__CUSTOM_GAS_TOKEN is disabled[SKIP: Skipping test because SYS_FEATURE__CUSTOM_GAS_TOKEN is disabled] testFuzz_depositETHTo_withCustomGasToken_reverts(address,uint256,uint32) (runs: 0, \u03bc: 0, ~: 0)" + }, + { + "classname": "test/L1/OPContractsManagerStandardValidator.t.sol:OPContractsManagerStandardValidator_AnchorStateRegistry_Test", + "name": "setUp()", + "result": "skipped", + "run_time": 0, + "message": "skipped: Skipping: standard configs incompatible with SUPER_ROOT_GAMES_MIGRATION[SKIP: skipped: Skipping: standard configs incompatible with SUPER_ROOT_GAMES_MIGRATION] setUp() (gas: 0)" + }, + { + "classname": "test/L1/ResourceMetering.t.sol:ArtifactResourceMetering_Metered_Test", + "name": "test_meter_generateArtifact_succeeds()", + "result": "skipped", + "run_time": 0, + "message": "[SKIP] test_meter_generateArtifact_succeeds() (gas: 0)" + }, + { + "classname": "test/L1/opcm/OPContractsManagerV2.t.sol:OPContractsManagerV2_UpgradeSuperchain_Test", + "name": "setUp()", + "result": "skipped", + "run_time": 0, + "message": "skipped[SKIP: skipped] setUp() (gas: 0)" + } + ] +} diff --git a/ops/ci/migration/tests/fixtures/ci-comparison/circleci-go-cases.json b/ops/ci/migration/tests/fixtures/ci-comparison/circleci-go-cases.json new file mode 100644 index 00000000000..201cc84bb1b --- /dev/null +++ b/ops/ci/migration/tests/fixtures/ci-comparison/circleci-go-cases.json @@ -0,0 +1,30 @@ +{ + "sha": "cb48622213e9aa8408de9904baafac784441ecc6", + "provenance": { + "url": "https://circleci.com/gh/ethereum-optimism/optimism/5622514", + "source": "CircleCI test metadata API, selected real records; intentionally incomplete fixture, not a full runtime report" + }, + "cases": [ + { + "classname": "github.com/ethereum-optimism/optimism/op-node/rollup", + "name": "TestChainSpec_CanyonForkActivation/Genesis", + "result": "success", + "run_time": 0, + "message": "" + }, + { + "classname": "github.com/ethereum-optimism/optimism/op-node/rollup/derive", + "name": "TestBatchStages/BatchQueue/SingularBatch/OverlappingSpanBatch", + "result": "skipped", + "run_time": 0, + "message": "=== RUN TestBatchStages/BatchQueue/SingularBatch/OverlappingSpanBatch\n batch_queue_test.go:569: only applicable to span batches\n--- SKIP: TestBatchStages/BatchQueue/SingularBatch/OverlappingSpanBatch (0.00s)\n" + }, + { + "classname": "github.com/ethereum-optimism/optimism/op-node/rollup/derive", + "name": "TestBatchStages/BatchStage/SingularBatch/OverlappingSpanBatch", + "result": "skipped", + "run_time": 0, + "message": "=== RUN TestBatchStages/BatchStage/SingularBatch/OverlappingSpanBatch\n batch_queue_test.go:569: only applicable to span batches\n--- SKIP: TestBatchStages/BatchStage/SingularBatch/OverlappingSpanBatch (0.00s)\n" + } + ] +} diff --git a/ops/ci/migration/tests/fixtures/ci-comparison/rwx-foundry-skips.xml b/ops/ci/migration/tests/fixtures/ci-comparison/rwx-foundry-skips.xml new file mode 100644 index 00000000000..55d550c16ed --- /dev/null +++ b/ops/ci/migration/tests/fixtures/ci-comparison/rwx-foundry-skips.xml @@ -0,0 +1,18 @@ + + + + [SKIP: Skipping test because SYS_FEATURE__CUSTOM_GAS_TOKEN is disabled] testFuzz_depositETHTo_withCustomGasToken_reverts(address,uint256,uint32) (runs: 0, μ: 0, ~: 0) + + + + [SKIP: skipped: Skipping: standard configs incompatible with SUPER_ROOT_GAMES_MIGRATION] setUp() (gas: 0) + + + + [SKIP] test_meter_generateArtifact_succeeds() (gas: 0) + + + + [SKIP: skipped] setUp() (gas: 0) + + \ No newline at end of file diff --git a/ops/ci/migration/tests/fixtures/flaky-report/provenance.json b/ops/ci/migration/tests/fixtures/flaky-report/provenance.json new file mode 100644 index 00000000000..897e514bb97 --- /dev/null +++ b/ops/ci/migration/tests/fixtures/flaky-report/provenance.json @@ -0,0 +1,10 @@ +{ + "api_url": "https://circleci.com/api/v2/insights/gh/ethereum-optimism/optimism/flaky-tests?branch=codex%2Frwx-ci-pilot", + "http_status": 200, + "authenticated": false, + "captured_at": "2026-10-05T12:56:50.852261+00:00", + "scope": "project-wide branch-agnostic Circle Insights", + "source_rows": 79, + "acceptance_rows": 12, + "coverage_added": 0 +} diff --git a/ops/ci/migration/tests/fixtures/flaky-report/public-insights.json b/ops/ci/migration/tests/fixtures/flaky-report/public-insights.json new file mode 100644 index 00000000000..ece66b9e060 --- /dev/null +++ b/ops/ci/migration/tests/fixtures/flaky-report/public-insights.json @@ -0,0 +1,1031 @@ +{ + "flaky_tests" : [ { + "workflow_created_at" : "2026-10-02T13:58:17.679Z", + "classname" : "github.com/ethereum-optimism/optimism/op-e2e/system/da", + "job_number" : 5627837, + "times_flaked" : 16, + "source" : "", + "pipeline_number" : 135458, + "file" : "", + "workflow_name" : "main", + "job_name" : "go-tests", + "workflow_id" : "5f99bb59-7710-4b60-be91-ca824c5c09ec", + "time_wasted" : 0, + "test_name" : "TestBatcherAutoDA" + }, { + "workflow_created_at" : "2026-10-01T11:12:25.329Z", + "classname" : "github.com/ethereum-optimism/optimism/op-e2e/system/da", + "job_number" : 5620664, + "times_flaked" : 9, + "source" : "", + "pipeline_number" : 135346, + "file" : "", + "workflow_name" : "main", + "job_name" : "go-tests", + "workflow_id" : "69020490-4f17-4c49-9fe2-4d15f346a83e", + "time_wasted" : 0, + "test_name" : "TestSystem4844E2E_Calldata" + }, { + "workflow_created_at" : "2026-10-01T11:12:25.329Z", + "classname" : "github.com/ethereum-optimism/optimism/op-e2e/system/da", + "job_number" : 5620664, + "times_flaked" : 7, + "source" : "", + "pipeline_number" : 135346, + "file" : "", + "workflow_name" : "main", + "job_name" : "go-tests", + "workflow_id" : "69020490-4f17-4c49-9fe2-4d15f346a83e", + "time_wasted" : 0, + "test_name" : "TestSystem4844E2E_MultiBlob" + }, { + "workflow_created_at" : "2026-10-01T11:12:25.329Z", + "classname" : "github.com/ethereum-optimism/optimism/op-e2e/system/da", + "job_number" : 5620664, + "times_flaked" : 7, + "source" : "", + "pipeline_number" : 135346, + "file" : "", + "workflow_name" : "main", + "job_name" : "go-tests", + "workflow_id" : "69020490-4f17-4c49-9fe2-4d15f346a83e", + "time_wasted" : 0, + "test_name" : "TestSystem4844E2E_SingleBlob" + }, { + "workflow_created_at" : "2026-10-04T17:37:24.259Z", + "classname" : "github.com/ethereum-optimism/optimism/op-e2e/faultproofs", + "job_number" : 5633243, + "times_flaked" : 5, + "source" : "", + "pipeline_number" : 135549, + "file" : "", + "workflow_name" : "main", + "job_name" : "go-tests", + "workflow_id" : "197a605b-9c1a-49a7-af41-d9a0a7b58682", + "time_wasted" : 0, + "test_name" : "TestChallengerCompleteExhaustiveDisputeGame" + }, { + "workflow_created_at" : "2026-10-04T17:37:24.259Z", + "classname" : "github.com/ethereum-optimism/optimism/op-e2e/faultproofs", + "job_number" : 5633243, + "times_flaked" : 5, + "source" : "", + "pipeline_number" : 135549, + "file" : "", + "workflow_name" : "main", + "job_name" : "go-tests", + "workflow_id" : "197a605b-9c1a-49a7-af41-d9a0a7b58682", + "time_wasted" : 0, + "test_name" : "TestChallengerCompleteExhaustiveDisputeGame/RootIncorrect" + }, { + "workflow_created_at" : "2026-10-02T09:09:57.274Z", + "classname" : "github.com/ethereum-optimism/optimism/op-e2e/system/da", + "job_number" : 5626562, + "times_flaked" : 4, + "source" : "", + "pipeline_number" : 135442, + "file" : "", + "workflow_name" : "main", + "job_name" : "go-tests", + "workflow_id" : "3166b82c-5ac1-4a47-8626-70db63776c60", + "time_wasted" : 0, + "test_name" : "TestBatcherMultiTx" + }, { + "workflow_created_at" : "2026-09-30T18:40:45.670Z", + "classname" : "github.com/ethereum-optimism/optimism/op-e2e/actions/sync", + "job_number" : 5619122, + "times_flaked" : 4, + "source" : "", + "pipeline_number" : 135311, + "file" : "", + "workflow_name" : "main", + "job_name" : "go-tests", + "workflow_id" : "bc62f293-bc70-444e-aeab-bfc987ce2700", + "time_wasted" : 0, + "test_name" : "TestELSyncOffsetELSafe" + }, { + "workflow_created_at" : "2026-10-01T13:44:30.096Z", + "classname" : "github.com/ethereum-optimism/optimism/op-e2e/faultproofs", + "job_number" : 5620981, + "times_flaked" : 4, + "source" : "", + "pipeline_number" : 135352, + "file" : "", + "workflow_name" : "develop-fault-proofs", + "job_name" : "op-e2e-cannon-tests", + "workflow_id" : "3ef61a30-57a1-499a-bbca-ae45e6225fe6", + "time_wasted" : 0, + "test_name" : "TestOutputCannonStepWithPreimage_nonExistingBlobPreimage" + }, { + "workflow_created_at" : "2026-09-30T11:06:55.930Z", + "classname" : "github.com/ethereum-optimism/optimism/op-node/p2p", + "job_number" : 5614874, + "times_flaked" : 4, + "source" : "", + "pipeline_number" : 135241, + "file" : "", + "workflow_name" : "main", + "job_name" : "go-tests", + "workflow_id" : "3e83f667-3541-4627-a50c-b136bdd94ba9", + "time_wasted" : 0, + "test_name" : "TestP2PFull" + }, { + "workflow_created_at" : "2026-10-02T09:09:57.274Z", + "classname" : "github.com/ethereum-optimism/optimism/op-e2e/system/da", + "job_number" : 5626562, + "times_flaked" : 4, + "source" : "", + "pipeline_number" : 135442, + "file" : "", + "workflow_name" : "main", + "job_name" : "go-tests", + "workflow_id" : "3166b82c-5ac1-4a47-8626-70db63776c60", + "time_wasted" : 0, + "test_name" : "TestSystemBatchType_SingularBatch" + }, { + "workflow_created_at" : "2026-10-02T09:09:57.274Z", + "classname" : "github.com/ethereum-optimism/optimism/op-e2e/system/da", + "job_number" : 5626562, + "times_flaked" : 4, + "source" : "", + "pipeline_number" : 135442, + "file" : "", + "workflow_name" : "main", + "job_name" : "go-tests", + "workflow_id" : "3166b82c-5ac1-4a47-8626-70db63776c60", + "time_wasted" : 0, + "test_name" : "TestSystemBatchType_SpanBatch" + }, { + "workflow_created_at" : "2026-10-02T09:09:57.274Z", + "classname" : "github.com/ethereum-optimism/optimism/op-e2e/system/da", + "job_number" : 5626562, + "times_flaked" : 4, + "source" : "", + "pipeline_number" : 135442, + "file" : "", + "workflow_name" : "main", + "job_name" : "go-tests", + "workflow_id" : "3166b82c-5ac1-4a47-8626-70db63776c60", + "time_wasted" : 0, + "test_name" : "TestSystemBatchType_SpanBatchMaxBlocks" + }, { + "workflow_created_at" : "2026-10-02T09:09:57.274Z", + "classname" : "github.com/ethereum-optimism/optimism/op-e2e/system/da", + "job_number" : 5626562, + "times_flaked" : 3, + "source" : "", + "pipeline_number" : 135442, + "file" : "", + "workflow_name" : "main", + "job_name" : "go-tests", + "workflow_id" : "3166b82c-5ac1-4a47-8626-70db63776c60", + "time_wasted" : 0, + "test_name" : "TestDABlockThrottling" + }, { + "workflow_created_at" : "2026-10-04T15:21:51.416Z", + "classname" : "github.com/ethereum-optimism/optimism/op-e2e/actions/sync", + "job_number" : 5632975, + "times_flaked" : 3, + "source" : "", + "pipeline_number" : 135545, + "file" : "", + "workflow_name" : "main", + "job_name" : "go-tests", + "workflow_id" : "a87aeb20-11ad-45e8-b99f-1483025da99c", + "time_wasted" : 0, + "test_name" : "TestELSyncTransitionsToCLSyncAfterNodeRestart" + }, { + "workflow_created_at" : "2026-10-01T20:19:30.771Z", + "classname" : "github.com/ethereum-optimism/optimism/op-e2e/system/verifier", + "job_number" : 5624260, + "times_flaked" : 3, + "source" : "", + "pipeline_number" : 135406, + "file" : "", + "workflow_name" : "main", + "job_name" : "go-tests", + "workflow_id" : "1704b13f-c3e6-40e4-9477-2d687570c914", + "time_wasted" : 0, + "test_name" : "TestMissingBatchE2E" + }, { + "workflow_created_at" : "2026-09-30T15:09:59.199Z", + "classname" : "github.com/ethereum-optimism/optimism/op-e2e/system/altda", + "job_number" : 5617101, + "times_flaked" : 2, + "source" : "", + "pipeline_number" : 135279, + "file" : "", + "workflow_name" : "main", + "job_name" : "go-tests", + "workflow_id" : "6926d5bc-9426-4656-a479-87584fd6e655", + "time_wasted" : 0, + "test_name" : "TestBatcherConcurrentAltDARequests" + }, { + "workflow_created_at" : "2026-09-30T15:16:26.453Z", + "classname" : "github.com/ethereum-optimism/optimism/op-e2e/system/da", + "job_number" : 5617238, + "times_flaked" : 2, + "source" : "", + "pipeline_number" : 135280, + "file" : "", + "workflow_name" : "main", + "job_name" : "go-tests", + "workflow_id" : "e482e8b7-f389-4656-be43-a4ea827dbef4", + "time_wasted" : 0, + "test_name" : "TestBrotliBatcherFjord" + }, { + "workflow_created_at" : "2026-10-02T22:00:30.720Z", + "classname" : "github.com/ethereum-optimism/optimism/op-deployer/pkg/deployer/integration_test/cli", + "job_number" : 5631846, + "times_flaked" : 2, + "source" : "", + "pipeline_number" : 135520, + "file" : "", + "workflow_name" : "main", + "job_name" : "go-tests", + "workflow_id" : "ecb00c54-e5ed-4fec-a136-0a7c50380206", + "time_wasted" : 0, + "test_name" : "TestCLIBootstrapForge" + }, { + "workflow_created_at" : "2026-10-02T22:00:30.720Z", + "classname" : "github.com/ethereum-optimism/optimism/op-deployer/pkg/deployer/integration_test/cli", + "job_number" : 5631846, + "times_flaked" : 2, + "source" : "", + "pipeline_number" : 135520, + "file" : "", + "workflow_name" : "main", + "job_name" : "go-tests", + "workflow_id" : "ecb00c54-e5ed-4fec-a136-0a7c50380206", + "time_wasted" : 0, + "test_name" : "TestCLIBootstrapForge/bootstrap_end-to-end_with_forge" + }, { + "workflow_created_at" : "2026-10-02T22:00:30.720Z", + "classname" : "github.com/ethereum-optimism/optimism/op-deployer/pkg/deployer/integration_test/cli", + "job_number" : 5631846, + "times_flaked" : 2, + "source" : "", + "pipeline_number" : 135520, + "file" : "", + "workflow_name" : "main", + "job_name" : "go-tests", + "workflow_id" : "ecb00c54-e5ed-4fec-a136-0a7c50380206", + "time_wasted" : 0, + "test_name" : "TestCLIBootstrapForge/bootstrap_implementations_with_forge" + }, { + "workflow_created_at" : "2026-10-02T22:00:30.720Z", + "classname" : "github.com/ethereum-optimism/optimism/op-deployer/pkg/deployer/integration_test/cli", + "job_number" : 5631846, + "times_flaked" : 2, + "source" : "", + "pipeline_number" : 135520, + "file" : "", + "workflow_name" : "main", + "job_name" : "go-tests", + "workflow_id" : "ecb00c54-e5ed-4fec-a136-0a7c50380206", + "time_wasted" : 0, + "test_name" : "TestCLIBootstrapForge/bootstrap_superchain_with_forge" + }, { + "workflow_created_at" : "2026-10-02T09:09:57.274Z", + "classname" : "github.com/ethereum-optimism/optimism/op-e2e/system/da", + "job_number" : 5626562, + "times_flaked" : 2, + "source" : "", + "pipeline_number" : 135442, + "file" : "", + "workflow_name" : "main", + "job_name" : "go-tests", + "workflow_id" : "3166b82c-5ac1-4a47-8626-70db63776c60", + "time_wasted" : 0, + "test_name" : "TestDATxThrottling" + }, { + "workflow_created_at" : "2026-09-22T13:36:02.415Z", + "classname" : "github.com/ethereum-optimism/optimism/op-e2e/actions/sync", + "job_number" : 5587871, + "times_flaked" : 2, + "source" : "", + "pipeline_number" : 134759, + "file" : "", + "workflow_name" : "main", + "job_name" : "go-tests", + "workflow_id" : "8c2d9d85-95db-4b5e-b33d-330387db85e2", + "time_wasted" : 0, + "test_name" : "TestForcedELSyncCLAfterNodeRestart" + }, { + "workflow_created_at" : "2026-09-30T16:24:06.359Z", + "classname" : "github.com/ethereum-optimism/optimism/op-e2e/faultproofs", + "job_number" : 5618261, + "times_flaked" : 2, + "source" : "", + "pipeline_number" : 135295, + "file" : "", + "workflow_name" : "develop-fault-proofs", + "job_name" : "op-e2e-cannon-tests", + "workflow_id" : "2e764826-a698-4177-b258-57834e5ddb5e", + "time_wasted" : 0, + "test_name" : "TestOutputCannonStepWithLargePreimage" + }, { + "workflow_created_at" : "2026-09-30T16:24:06.359Z", + "classname" : "github.com/ethereum-optimism/optimism/op-e2e/faultproofs", + "job_number" : 5618261, + "times_flaked" : 2, + "source" : "", + "pipeline_number" : 135295, + "file" : "", + "workflow_name" : "develop-fault-proofs", + "job_name" : "op-e2e-cannon-tests", + "workflow_id" : "2e764826-a698-4177-b258-57834e5ddb5e", + "time_wasted" : 0, + "test_name" : "TestOutputCannonStepWithLargePreimage/mt-cannon" + }, { + "workflow_created_at" : "2026-10-01T11:12:25.329Z", + "classname" : "github.com/ethereum-optimism/optimism/op-e2e/system/da", + "job_number" : 5620664, + "times_flaked" : 2, + "source" : "", + "pipeline_number" : 135346, + "file" : "", + "workflow_name" : "main", + "job_name" : "go-tests", + "workflow_id" : "69020490-4f17-4c49-9fe2-4d15f346a83e", + "time_wasted" : 0, + "test_name" : "TestSystemE2EDencunAtGenesisWithBlobs" + }, { + "workflow_created_at" : "2026-10-02T10:28:42.613Z", + "classname" : "github.com/ethereum-optimism/optimism/rust/op-reth/tests/proofs/core", + "job_number" : 5627212, + "times_flaked" : 2, + "source" : "", + "pipeline_number" : 135449, + "file" : "", + "workflow_name" : "rust-e2e-ci", + "job_name" : "op-reth-e2e-sysgo-tests", + "workflow_id" : "abc580fb-7c49-4855-9c84-85456ef5fd19", + "time_wasted" : 0, + "test_name" : "TestTokenVaultStorageProofs" + }, { + "workflow_created_at" : "2026-09-25T18:19:37.383Z", + "classname" : "github.com/ethereum-optimism/optimism/op-service/clock", + "job_number" : 5600141, + "times_flaked" : 1, + "source" : "", + "pipeline_number" : 134986, + "file" : "", + "workflow_name" : "main", + "job_name" : "go-tests", + "workflow_id" : "92d89c68-4ee7-4600-908b-754d25984f16", + "time_wasted" : 0, + "test_name" : "TestAdvancingClock_SleepCtx" + }, { + "workflow_created_at" : "2026-10-04T17:37:24.259Z", + "classname" : "github.com/ethereum-optimism/optimism/op-e2e/faultproofs", + "job_number" : 5633243, + "times_flaked" : 1, + "source" : "", + "pipeline_number" : 135549, + "file" : "", + "workflow_name" : "main", + "job_name" : "go-tests", + "workflow_id" : "197a605b-9c1a-49a7-af41-d9a0a7b58682", + "time_wasted" : 0, + "test_name" : "TestChallengerCompleteExhaustiveDisputeGame/RootCorrect" + }, { + "workflow_created_at" : "2026-10-04T17:37:24.259Z", + "classname" : "github.com/ethereum-optimism/optimism/op-e2e/faultproofs", + "job_number" : 5633243, + "times_flaked" : 1, + "source" : "", + "pipeline_number" : 135549, + "file" : "", + "workflow_name" : "main", + "job_name" : "go-tests", + "workflow_id" : "197a605b-9c1a-49a7-af41-d9a0a7b58682", + "time_wasted" : 0, + "test_name" : "TestChallengerResponseDelay" + }, { + "workflow_created_at" : "2026-10-04T17:37:24.259Z", + "classname" : "github.com/ethereum-optimism/optimism/op-e2e/faultproofs", + "job_number" : 5633243, + "times_flaked" : 1, + "source" : "", + "pipeline_number" : 135549, + "file" : "", + "workflow_name" : "main", + "job_name" : "go-tests", + "workflow_id" : "197a605b-9c1a-49a7-af41-d9a0a7b58682", + "time_wasted" : 0, + "test_name" : "TestChallengerResponseDelay/NoDelay" + }, { + "workflow_created_at" : "2026-09-30T13:41:11.469Z", + "classname" : "github.com/ethereum-optimism/optimism/op-deployer/pkg/deployer/pipeline", + "job_number" : 5616150, + "times_flaked" : 1, + "source" : "", + "pipeline_number" : 135262, + "file" : "", + "workflow_name" : "main", + "job_name" : "go-tests", + "workflow_id" : "5bb6fe7a-0da4-40bb-86f8-61b238896d43", + "time_wasted" : 0, + "test_name" : "TestDeployOPChain_WithForge" + }, { + "workflow_created_at" : "2026-09-25T14:16:50.741Z", + "classname" : "github.com/ethereum-optimism/optimism/op-deployer/pkg/deployer/integration_test/cli", + "job_number" : 5599400, + "times_flaked" : 1, + "source" : "", + "pipeline_number" : 134909, + "file" : "", + "workflow_name" : "main", + "job_name" : "go-tests", + "workflow_id" : "06b8c46d-9621-4bb5-b4df-3617468322cb", + "time_wasted" : 0, + "test_name" : "TestDeployScriptsForge" + }, { + "workflow_created_at" : "2026-09-25T14:16:50.741Z", + "classname" : "github.com/ethereum-optimism/optimism/op-deployer/pkg/deployer/integration_test/cli", + "job_number" : 5599400, + "times_flaked" : 1, + "source" : "", + "pipeline_number" : 134909, + "file" : "", + "workflow_name" : "main", + "job_name" : "go-tests", + "workflow_id" : "06b8c46d-9621-4bb5-b4df-3617468322cb", + "time_wasted" : 0, + "test_name" : "TestDeployScriptsForge/deploy_mips_with_forge" + }, { + "workflow_created_at" : "2026-09-30T17:07:53.171Z", + "classname" : "github.com/ethereum-optimism/optimism/op-acceptance-tests/tests/interop/dispute-mon", + "job_number" : 5618446, + "times_flaked" : 1, + "source" : "", + "pipeline_number" : 135297, + "file" : "", + "workflow_name" : "main", + "job_name" : "memory-all-opn-op-reth-fusaka", + "workflow_id" : "11a43061-68f1-4b0c-910c-b0eb8384702e", + "time_wasted" : 0, + "test_name" : "TestDisputeMonitorReportsClaimTiming" + }, { + "workflow_created_at" : "2026-09-29T08:16:38.208Z", + "classname" : "github.com/ethereum-optimism/optimism/op-acceptance-tests/tests", + "job_number" : 5608957, + "times_flaked" : 1, + "source" : "", + "pipeline_number" : 135133, + "file" : "", + "workflow_name" : "main", + "job_name" : "memory-all-opn-op-reth-fusaka", + "workflow_id" : "c5e0194c-cd15-417f-94a6-5853c50e0c88", + "time_wasted" : 0, + "test_name" : "TestEIP7939CLZ" + }, { + "workflow_created_at" : "2026-09-29T08:16:38.208Z", + "classname" : "github.com/ethereum-optimism/optimism/op-acceptance-tests/tests", + "job_number" : 5608957, + "times_flaked" : 1, + "source" : "", + "pipeline_number" : 135133, + "file" : "", + "workflow_name" : "main", + "job_name" : "memory-all-opn-op-reth-fusaka", + "workflow_id" : "c5e0194c-cd15-417f-94a6-5853c50e0c88", + "time_wasted" : 0, + "test_name" : "TestEIP7939CLZ/post-karst" + }, { + "workflow_created_at" : "2026-09-30T14:14:30.069Z", + "classname" : "github.com/ethereum-optimism/optimism/op-e2e/actions/sync", + "job_number" : 5616606, + "times_flaked" : 1, + "source" : "", + "pipeline_number" : 135272, + "file" : "", + "workflow_name" : "main", + "job_name" : "go-tests", + "workflow_id" : "c425b5fc-b618-4a7c-a6cc-7d8de18440b5", + "time_wasted" : 0, + "test_name" : "TestELSyncTransitionstoCL" + }, { + "workflow_created_at" : "2026-09-28T19:21:17.645Z", + "classname" : "github.com/ethereum-optimism/optimism/op-e2e/system/fees", + "job_number" : 5607171, + "times_flaked" : 1, + "source" : "", + "pipeline_number" : 135102, + "file" : "", + "workflow_name" : "main", + "job_name" : "go-tests", + "workflow_id" : "a4832faa-0f92-4157-8aa8-9c52743a0221", + "time_wasted" : 0, + "test_name" : "TestFees" + }, { + "workflow_created_at" : "2026-09-28T19:21:17.645Z", + "classname" : "github.com/ethereum-optimism/optimism/op-e2e/system/fees", + "job_number" : 5607171, + "times_flaked" : 1, + "source" : "", + "pipeline_number" : 135102, + "file" : "", + "workflow_name" : "main", + "job_name" : "go-tests", + "workflow_id" : "a4832faa-0f92-4157-8aa8-9c52743a0221", + "time_wasted" : 0, + "test_name" : "TestFees/regolith" + }, { + "workflow_created_at" : "2026-09-30T20:54:39.861Z", + "classname" : "github.com/ethereum-optimism/optimism/op-service/github/release", + "job_number" : 5619899, + "times_flaked" : 1, + "source" : "", + "pipeline_number" : 135325, + "file" : "", + "workflow_name" : "main", + "job_name" : "go-tests", + "workflow_id" : "a3215b6f-34bb-4564-a0b5-5b2e476bd8cc", + "time_wasted" : 0, + "test_name" : "TestGithubReleaseDownloader_Forge" + }, { + "workflow_created_at" : "2026-09-30T20:54:39.861Z", + "classname" : "github.com/ethereum-optimism/optimism/op-service/github/release", + "job_number" : 5619899, + "times_flaked" : 1, + "source" : "", + "pipeline_number" : 135325, + "file" : "", + "workflow_name" : "main", + "job_name" : "go-tests", + "workflow_id" : "a3215b6f-34bb-4564-a0b5-5b2e476bd8cc", + "time_wasted" : 0, + "test_name" : "TestGithubReleaseDownloader_Forge/supported_targets" + }, { + "workflow_created_at" : "2026-09-30T20:54:39.861Z", + "classname" : "github.com/ethereum-optimism/optimism/op-service/github/release", + "job_number" : 5619899, + "times_flaked" : 1, + "source" : "", + "pipeline_number" : 135325, + "file" : "", + "workflow_name" : "main", + "job_name" : "go-tests", + "workflow_id" : "a3215b6f-34bb-4564-a0b5-5b2e476bd8cc", + "time_wasted" : 0, + "test_name" : "TestGithubReleaseDownloader_Forge/supported_targets/alpine_amd64" + }, { + "workflow_created_at" : "2026-10-01T11:12:14.049Z", + "classname" : "github.com/ethereum-optimism/optimism/op-acceptance-tests/tests/interop/filter", + "job_number" : 5620571, + "times_flaked" : 1, + "source" : "", + "pipeline_number" : 135345, + "file" : "", + "workflow_name" : "main", + "job_name" : "memory-all-kona-op-reth-fusaka", + "workflow_id" : "4c197280-e1cd-4f0d-9f57-e81856bbf1f6", + "time_wasted" : 0, + "test_name" : "TestInteropFilter_FailsafeLifecycle" + }, { + "workflow_created_at" : "2026-09-30T01:34:46.113Z", + "classname" : "github.com/ethereum-optimism/optimism/rust/op-reth/tests/proofs/core", + "job_number" : 5614252, + "times_flaked" : 1, + "source" : "", + "pipeline_number" : 135230, + "file" : "", + "workflow_name" : "rust-e2e-ci", + "job_name" : "op-reth-e2e-sysgo-tests", + "workflow_id" : "8faff9d7-e698-45f4-8e1f-041a76010e79", + "time_wasted" : 0, + "test_name" : "TestL2MultipleTransactionsInDifferentBlocks" + }, { + "workflow_created_at" : "2026-09-30T02:38:16.772Z", + "classname" : "github.com/ethereum-optimism/optimism/rust/op-reth/tests/proofs/core", + "job_number" : 5614348, + "times_flaked" : 1, + "source" : "", + "pipeline_number" : 135230, + "file" : "", + "workflow_name" : "rust-e2e-ci", + "job_name" : "op-reth-e2e-sysgo-tests", + "workflow_id" : "588d4bf3-8851-446e-b7a9-979090906d36", + "time_wasted" : 0, + "test_name" : "TestL2MultipleTransactionsInSingleBlock" + }, { + "workflow_created_at" : "2026-09-28T15:53:13.992Z", + "classname" : "github.com/ethereum-optimism/optimism/op-acceptance-tests/tests/base/conductor", + "job_number" : 5604511, + "times_flaked" : 1, + "source" : "", + "pipeline_number" : 135066, + "file" : "", + "workflow_name" : "main", + "job_name" : "memory-all-opn-op-reth-fusaka", + "workflow_id" : "bdac4f8a-41c7-474d-860e-308e879a31e0", + "time_wasted" : 0, + "test_name" : "TestLeadershipTransferMovesActiveSequencer" + }, { + "workflow_created_at" : "2026-10-01T13:44:30.096Z", + "classname" : "github.com/ethereum-optimism/optimism/op-e2e/faultproofs", + "job_number" : 5620981, + "times_flaked" : 1, + "source" : "", + "pipeline_number" : 135352, + "file" : "", + "workflow_name" : "develop-fault-proofs", + "job_name" : "op-e2e-cannon-tests", + "workflow_id" : "3ef61a30-57a1-499a-bbca-ae45e6225fe6", + "time_wasted" : 0, + "test_name" : "TestLocalPreimages" + }, { + "workflow_created_at" : "2026-10-01T13:44:30.096Z", + "classname" : "github.com/ethereum-optimism/optimism/op-e2e/faultproofs", + "job_number" : 5620981, + "times_flaked" : 1, + "source" : "", + "pipeline_number" : 135352, + "file" : "", + "workflow_name" : "develop-fault-proofs", + "job_name" : "op-e2e-cannon-tests", + "workflow_id" : "3ef61a30-57a1-499a-bbca-ae45e6225fe6", + "time_wasted" : 0, + "test_name" : "TestLocalPreimages/preimage-1" + }, { + "workflow_created_at" : "2026-10-04T17:37:24.259Z", + "classname" : "github.com/ethereum-optimism/optimism/op-e2e/faultproofs", + "job_number" : 5633243, + "times_flaked" : 1, + "source" : "", + "pipeline_number" : 135549, + "file" : "", + "workflow_name" : "main", + "job_name" : "go-tests", + "workflow_id" : "197a605b-9c1a-49a7-af41-d9a0a7b58682", + "time_wasted" : 0, + "test_name" : "TestOutputAlphabetGame_ChallengerWins" + }, { + "workflow_created_at" : "2026-10-04T17:37:24.259Z", + "classname" : "github.com/ethereum-optimism/optimism/op-e2e/faultproofs", + "job_number" : 5633243, + "times_flaked" : 1, + "source" : "", + "pipeline_number" : 135549, + "file" : "", + "workflow_name" : "main", + "job_name" : "go-tests", + "workflow_id" : "197a605b-9c1a-49a7-af41-d9a0a7b58682", + "time_wasted" : 0, + "test_name" : "TestOutputAlphabetGame_FreeloaderEarnsNothing" + }, { + "workflow_created_at" : "2026-10-04T17:37:24.259Z", + "classname" : "github.com/ethereum-optimism/optimism/op-e2e/faultproofs", + "job_number" : 5633243, + "times_flaked" : 1, + "source" : "", + "pipeline_number" : 135549, + "file" : "", + "workflow_name" : "main", + "job_name" : "go-tests", + "workflow_id" : "197a605b-9c1a-49a7-af41-d9a0a7b58682", + "time_wasted" : 0, + "test_name" : "TestOutputAlphabetGame_ValidOutputRoot" + }, { + "workflow_created_at" : "2026-09-30T12:47:42.726Z", + "classname" : "github.com/ethereum-optimism/optimism/op-e2e/faultproofs", + "job_number" : 5615377, + "times_flaked" : 1, + "source" : "", + "pipeline_number" : 135250, + "file" : "", + "workflow_name" : "develop-fault-proofs", + "job_name" : "op-e2e-cannon-tests", + "workflow_id" : "99647c29-d902-4749-adad-5994a7520f7d", + "time_wasted" : 0, + "test_name" : "TestOutputCannon_PublishCannonRootClaim" + }, { + "workflow_created_at" : "2026-09-30T12:47:42.726Z", + "classname" : "github.com/ethereum-optimism/optimism/op-e2e/faultproofs", + "job_number" : 5615377, + "times_flaked" : 1, + "source" : "", + "pipeline_number" : 135250, + "file" : "", + "workflow_name" : "develop-fault-proofs", + "job_name" : "op-e2e-cannon-tests", + "workflow_id" : "99647c29-d902-4749-adad-5994a7520f7d", + "time_wasted" : 0, + "test_name" : "TestOutputCannon_PublishCannonRootClaim/Dispute_8_mt-cannon" + }, { + "workflow_created_at" : "2026-09-29T17:21:11.080Z", + "classname" : "github.com/ethereum-optimism/optimism/op-e2e/faultproofs", + "job_number" : 5610725, + "times_flaked" : 1, + "source" : "", + "pipeline_number" : 135164, + "file" : "", + "workflow_name" : "develop-fault-proofs", + "job_name" : "op-e2e-cannon-tests", + "workflow_id" : "f65e6905-98b1-4313-8f21-2e9cc130c8c5", + "time_wasted" : 0, + "test_name" : "TestOutputCannonStepWithPreimage_existingPreimage" + }, { + "workflow_created_at" : "2026-09-29T17:21:11.080Z", + "classname" : "github.com/ethereum-optimism/optimism/op-e2e/faultproofs", + "job_number" : 5610725, + "times_flaked" : 1, + "source" : "", + "pipeline_number" : 135164, + "file" : "", + "workflow_name" : "develop-fault-proofs", + "job_name" : "op-e2e-cannon-tests", + "workflow_id" : "f65e6905-98b1-4313-8f21-2e9cc130c8c5", + "time_wasted" : 0, + "test_name" : "TestOutputCannonStepWithPreimage_existingPreimage/mt-cannon" + }, { + "workflow_created_at" : "2026-10-01T13:44:30.096Z", + "classname" : "github.com/ethereum-optimism/optimism/op-e2e/faultproofs", + "job_number" : 5620981, + "times_flaked" : 1, + "source" : "", + "pipeline_number" : 135352, + "file" : "", + "workflow_name" : "develop-fault-proofs", + "job_name" : "op-e2e-cannon-tests", + "workflow_id" : "3ef61a30-57a1-499a-bbca-ae45e6225fe6", + "time_wasted" : 0, + "test_name" : "TestOutputCannonStepWithPreimage_nonExistingBlobPreimage/non-existing_preimage-blob-0_skip-1_[mt-cannon]" + }, { + "workflow_created_at" : "2026-09-28T16:44:36.440Z", + "classname" : "github.com/ethereum-optimism/optimism/op-e2e/faultproofs", + "job_number" : 5605111, + "times_flaked" : 1, + "source" : "", + "pipeline_number" : 135074, + "file" : "", + "workflow_name" : "develop-fault-proofs", + "job_name" : "op-e2e-cannon-tests", + "workflow_id" : "2a41ed07-0214-47c4-8127-cc3c7c9afa6f", + "time_wasted" : 0, + "test_name" : "TestOutputCannonStepWithPreimage_nonExistingBlobPreimage/non-existing_preimage-blob-24_skip-0_[mt-cannon]" + }, { + "workflow_created_at" : "2026-09-24T18:53:30.600Z", + "classname" : "github.com/ethereum-optimism/optimism/op-e2e/faultproofs", + "job_number" : 5598171, + "times_flaked" : 1, + "source" : "", + "pipeline_number" : 134945, + "file" : "", + "workflow_name" : "develop-fault-proofs", + "job_name" : "op-e2e-cannon-tests", + "workflow_id" : "430518ac-7060-4b96-b0cf-3f63bb344881", + "time_wasted" : 0, + "test_name" : "TestOutputCannonStepWithPreimage_nonExistingBlobPreimage/non-existing_preimage-blob-24_skip-1_[mt-cannon]" + }, { + "workflow_created_at" : "2026-09-24T15:48:42.336Z", + "classname" : "github.com/ethereum-optimism/optimism/op-e2e/faultproofs", + "job_number" : 5596838, + "times_flaked" : 1, + "source" : "", + "pipeline_number" : 134922, + "file" : "", + "workflow_name" : "develop-fault-proofs", + "job_name" : "op-e2e-cannon-tests", + "workflow_id" : "71d21b15-8a30-4e7c-b9fa-5dcd84549485", + "time_wasted" : 0, + "test_name" : "TestOutputCannonStepWithPreimage_nonExistingBlobPreimage/non-existing_preimage-blob-8_skip-0_[mt-cannon]" + }, { + "workflow_created_at" : "2026-09-29T12:13:42.639Z", + "classname" : "github.com/ethereum-optimism/optimism/op-acceptance-tests/tests/isthmus/preinterop-singlechain", + "job_number" : 5609774, + "times_flaked" : 1, + "source" : "", + "pipeline_number" : 135146, + "file" : "", + "workflow_name" : "main", + "job_name" : "memory-all-opn-op-reth-fusaka", + "workflow_id" : "837532cb-f750-40c6-b849-6629b4f77eb7", + "time_wasted" : 0, + "test_name" : "TestPreinteropSingleChainFaultProofs" + }, { + "workflow_created_at" : "2026-09-24T12:53:52.205Z", + "classname" : "github.com/ethereum-optimism/optimism/op-acceptance-tests/tests/isthmus/preinterop-singlechain", + "job_number" : 5595750, + "times_flaked" : 1, + "source" : "", + "pipeline_number" : 134906, + "file" : "", + "workflow_name" : "main", + "job_name" : "memory-all-kona-op-reth-fusaka", + "workflow_id" : "21d61e75-dc31-4a09-8fdf-a3a1551d8371", + "time_wasted" : 0, + "test_name" : "TestPreinteropSingleChainFaultProofs" + }, { + "workflow_created_at" : "2026-09-21T17:13:16.976Z", + "classname" : "github.com/ethereum-optimism/optimism/op-acceptance-tests/tests/proofs/zk", + "job_number" : 5585308, + "times_flaked" : 1, + "source" : "", + "pipeline_number" : 134710, + "file" : "", + "workflow_name" : "main", + "job_name" : "memory-all-kona-op-reth-fusaka", + "workflow_id" : "4798b156-f41b-40c6-91db-d0da30bf4b3e", + "time_wasted" : 0, + "test_name" : "TestProposerRejectsValidChildOfInvalidGame" + }, { + "workflow_created_at" : "2026-09-29T08:16:38.208Z", + "classname" : "github.com/ethereum-optimism/optimism/op-acceptance-tests/tests/interop/super-opnode", + "job_number" : 5608957, + "times_flaked" : 1, + "source" : "", + "pipeline_number" : 135133, + "file" : "", + "workflow_name" : "main", + "job_name" : "memory-all-opn-op-reth-fusaka", + "workflow_id" : "c5e0194c-cd15-417f-94a6-5853c50e0c88", + "time_wasted" : 0, + "test_name" : "TestSingleChainSuperFaultProofsFromOpNode" + }, { + "workflow_created_at" : "2026-09-29T08:16:38.208Z", + "classname" : "github.com/ethereum-optimism/optimism/op-acceptance-tests/tests/interop/super-opnode", + "job_number" : 5608957, + "times_flaked" : 1, + "source" : "", + "pipeline_number" : 135133, + "file" : "", + "workflow_name" : "main", + "job_name" : "memory-all-opn-op-reth-fusaka", + "workflow_id" : "c5e0194c-cd15-417f-94a6-5853c50e0c88", + "time_wasted" : 0, + "test_name" : "TestSingleChainSuperFaultProofsFromOpNode/ChainOptimisticBlock-challenger" + }, { + "workflow_created_at" : "2026-09-29T08:16:38.208Z", + "classname" : "github.com/ethereum-optimism/optimism/op-acceptance-tests/tests/interop/super-opnode", + "job_number" : 5608957, + "times_flaked" : 1, + "source" : "", + "pipeline_number" : 135133, + "file" : "", + "workflow_name" : "main", + "job_name" : "memory-all-opn-op-reth-fusaka", + "workflow_id" : "c5e0194c-cd15-417f-94a6-5853c50e0c88", + "time_wasted" : 0, + "test_name" : "TestSingleChainSuperFaultProofsFromOpNode/ClaimDirectToNextTimestamp-challenger" + }, { + "workflow_created_at" : "2026-09-25T13:49:28.289Z", + "classname" : "github.com/ethereum-optimism/optimism/op-e2e/faultproofs", + "job_number" : 5599197, + "times_flaked" : 1, + "source" : "", + "pipeline_number" : 134967, + "file" : "", + "workflow_name" : "develop-fault-proofs", + "job_name" : "op-e2e-cannon-tests", + "workflow_id" : "6cb235c2-3b5f-4a11-b6bc-d84b4af5f1cd", + "time_wasted" : 0, + "test_name" : "TestSuperCannonDisputeGame" + }, { + "workflow_created_at" : "2026-09-25T13:49:28.289Z", + "classname" : "github.com/ethereum-optimism/optimism/op-e2e/faultproofs", + "job_number" : 5599197, + "times_flaked" : 1, + "source" : "", + "pipeline_number" : 134967, + "file" : "", + "workflow_name" : "develop-fault-proofs", + "job_name" : "op-e2e-cannon-tests", + "workflow_id" : "6cb235c2-3b5f-4a11-b6bc-d84b4af5f1cd", + "time_wasted" : 0, + "test_name" : "TestSuperCannonDisputeGame/StepInExtension-mt-cannon-next" + }, { + "workflow_created_at" : "2026-09-25T13:49:28.289Z", + "classname" : "github.com/ethereum-optimism/optimism/op-e2e/faultproofs", + "job_number" : 5599197, + "times_flaked" : 1, + "source" : "", + "pipeline_number" : 134967, + "file" : "", + "workflow_name" : "develop-fault-proofs", + "job_name" : "op-e2e-cannon-tests", + "workflow_id" : "6cb235c2-3b5f-4a11-b6bc-d84b4af5f1cd", + "time_wasted" : 0, + "test_name" : "TestSuperCannonDisputeGame/StepMiddle-mt-cannon-next" + }, { + "workflow_created_at" : "2026-09-25T13:49:28.289Z", + "classname" : "github.com/ethereum-optimism/optimism/op-e2e/faultproofs", + "job_number" : 5599197, + "times_flaked" : 1, + "source" : "", + "pipeline_number" : 134967, + "file" : "", + "workflow_name" : "develop-fault-proofs", + "job_name" : "op-e2e-cannon-tests", + "workflow_id" : "6cb235c2-3b5f-4a11-b6bc-d84b4af5f1cd", + "time_wasted" : 0, + "test_name" : "TestSuperCannonHonestSafeTraceExtensionValidRoot" + }, { + "workflow_created_at" : "2026-09-25T13:49:28.289Z", + "classname" : "github.com/ethereum-optimism/optimism/op-e2e/faultproofs", + "job_number" : 5599197, + "times_flaked" : 1, + "source" : "", + "pipeline_number" : 134967, + "file" : "", + "workflow_name" : "develop-fault-proofs", + "job_name" : "op-e2e-cannon-tests", + "workflow_id" : "6cb235c2-3b5f-4a11-b6bc-d84b4af5f1cd", + "time_wasted" : 0, + "test_name" : "TestSuperCannonHonestSafeTraceExtensionValidRoot/mt-cannon-next" + }, { + "workflow_created_at" : "2026-09-25T13:49:28.289Z", + "classname" : "github.com/ethereum-optimism/optimism/op-e2e/faultproofs", + "job_number" : 5599197, + "times_flaked" : 1, + "source" : "", + "pipeline_number" : 134967, + "file" : "", + "workflow_name" : "develop-fault-proofs", + "job_name" : "op-e2e-cannon-tests", + "workflow_id" : "6cb235c2-3b5f-4a11-b6bc-d84b4af5f1cd", + "time_wasted" : 0, + "test_name" : "TestSuperCannonPoisonedPostState" + }, { + "workflow_created_at" : "2026-09-25T13:49:28.289Z", + "classname" : "github.com/ethereum-optimism/optimism/op-e2e/faultproofs", + "job_number" : 5599197, + "times_flaked" : 1, + "source" : "", + "pipeline_number" : 134967, + "file" : "", + "workflow_name" : "develop-fault-proofs", + "job_name" : "op-e2e-cannon-tests", + "workflow_id" : "6cb235c2-3b5f-4a11-b6bc-d84b4af5f1cd", + "time_wasted" : 0, + "test_name" : "TestSuperCannonPoisonedPostState/mt-cannon-next" + }, { + "workflow_created_at" : "2026-09-25T13:49:28.289Z", + "classname" : "github.com/ethereum-optimism/optimism/op-e2e/faultproofs", + "job_number" : 5599197, + "times_flaked" : 1, + "source" : "", + "pipeline_number" : 134967, + "file" : "", + "workflow_name" : "develop-fault-proofs", + "job_name" : "op-e2e-cannon-tests", + "workflow_id" : "6cb235c2-3b5f-4a11-b6bc-d84b4af5f1cd", + "time_wasted" : 0, + "test_name" : "TestSuperCannonRootBeyondProposedBlock_InvalidRoot" + }, { + "workflow_created_at" : "2026-09-25T13:49:28.289Z", + "classname" : "github.com/ethereum-optimism/optimism/op-e2e/faultproofs", + "job_number" : 5599197, + "times_flaked" : 1, + "source" : "", + "pipeline_number" : 134967, + "file" : "", + "workflow_name" : "develop-fault-proofs", + "job_name" : "op-e2e-cannon-tests", + "workflow_id" : "6cb235c2-3b5f-4a11-b6bc-d84b4af5f1cd", + "time_wasted" : 0, + "test_name" : "TestSuperCannonRootBeyondProposedBlock_InvalidRoot/mt-cannon-next" + }, { + "workflow_created_at" : "2026-09-30T16:17:54.451Z", + "classname" : "github.com/ethereum-optimism/optimism/op-e2e/faultproofs", + "job_number" : 5618076, + "times_flaked" : 1, + "source" : "", + "pipeline_number" : 135293, + "file" : "", + "workflow_name" : "develop-fault-proofs", + "job_name" : "op-e2e-cannon-tests", + "workflow_id" : "d7e810c3-7e3d-45e3-a6a8-3baca61fc5a6", + "time_wasted" : 0, + "test_name" : "TestSuperInvalidateProposalForFutureBlock" + }, { + "workflow_created_at" : "2026-09-30T16:17:54.451Z", + "classname" : "github.com/ethereum-optimism/optimism/op-e2e/faultproofs", + "job_number" : 5618076, + "times_flaked" : 1, + "source" : "", + "pipeline_number" : 135293, + "file" : "", + "workflow_name" : "develop-fault-proofs", + "job_name" : "op-e2e-cannon-tests", + "workflow_id" : "d7e810c3-7e3d-45e3-a6a8-3baca61fc5a6", + "time_wasted" : 0, + "test_name" : "TestSuperInvalidateProposalForFutureBlock/Attack-mt-cannon-next" + }, { + "workflow_created_at" : "2026-09-28T17:50:20.236Z", + "classname" : "github.com/ethereum-optimism/optimism/op-acceptance-tests/tests/supernode/interop", + "job_number" : 5605862, + "times_flaked" : 1, + "source" : "", + "pipeline_number" : 135083, + "file" : "", + "workflow_name" : "main", + "job_name" : "memory-all-kona-op-reth-fusaka", + "workflow_id" : "2301983f-a682-4eab-9c43-a14cb23cc707", + "time_wasted" : 0, + "test_name" : "TestSuperRootMigratorMatchesSupernodeAtSuppliedTimestamp" + } ], + "total_flaky_tests" : 79 +} \ No newline at end of file diff --git a/ops/ci/migration/tests/fixtures/selector-upload/abi-oracle/foundry-config.json b/ops/ci/migration/tests/fixtures/selector-upload/abi-oracle/foundry-config.json new file mode 100644 index 00000000000..684f9757887 --- /dev/null +++ b/ops/ci/migration/tests/fixtures/selector-upload/abi-oracle/foundry-config.json @@ -0,0 +1,325 @@ +{ + "src": "src", + "test": "test", + "script": "script", + "out": "out", + "libs": [ + "lib" + ], + "remappings": [], + "auto_detect_remappings": true, + "libraries": [], + "cache": true, + "cache_path": "cache", + "dynamic_test_linking": true, + "snapshots": "snapshots", + "gas_snapshot_check": false, + "gas_snapshot_emit": true, + "broadcast": "broadcast", + "allow_paths": [], + "include_paths": [], + "skip": [], + "force": false, + "evm_version": "prague", + "hardfork": null, + "gas_reports": [ + "*" + ], + "gas_reports_ignore": [], + "gas_reports_include_tests": false, + "solc": "0.8.28", + "auto_detect_solc": true, + "offline": false, + "optimizer": false, + "optimizer_runs": 200, + "optimizer_details": null, + "model_checker": null, + "verbosity": 0, + "eth_rpc_url": null, + "eth_rpc_accept_invalid_certs": false, + "eth_rpc_no_proxy": false, + "eth_rpc_jwt": null, + "eth_rpc_timeout": null, + "eth_rpc_headers": null, + "eth_rpc_curl": false, + "etherscan_api_key": null, + "ignored_error_codes": [ + "license", + "code-size", + "init-code-size", + "transient-storage", + "transfer-deprecated", + "natspec-memory-safe-assembly-deprecated" + ], + "ignored_error_codes_from": [], + "ignored_warnings_from": [], + "deny": "never", + "match_test": null, + "no_match_test": null, + "match_contract": null, + "no_match_contract": null, + "match_path": null, + "no_match_path": null, + "no_match_coverage": null, + "test_failures_file": "cache/test-failures", + "mutation_dir": "cache/mutation", + "threads": null, + "show_progress": false, + "fuzz": { + "runs": 256, + "run": null, + "worker": null, + "fail_on_revert": true, + "max_test_rejects": 65536, + "seed": null, + "dictionary_weight": 40, + "include_storage": true, + "include_push_bytes": true, + "max_fuzz_dictionary_addresses": 15728640, + "max_fuzz_dictionary_values": 9830400, + "max_fuzz_dictionary_literals": 6553600, + "gas_report_samples": 256, + "corpus_dir": null, + "frontier_dir": null, + "frontier_limit": 256, + "corpus_gzip": true, + "corpus_min_mutations": 5, + "corpus_min_size": 0, + "show_edge_coverage": false, + "evm_edge_coverage_collision_free": true, + "evm_edge_coverage_include_call_depth": false, + "sancov_edges": false, + "sancov_trace_cmp": false, + "corpus_random_sequence_weight": 10, + "payable_value_weight": 0, + "mutation_weight_splice": 1, + "mutation_weight_repeat": 1, + "mutation_weight_interleave": 1, + "mutation_weight_prefix": 1, + "mutation_weight_suffix": 1, + "mutation_weight_abi": 1, + "mutation_weight_cmp": 1, + "failure_persist_dir": "cache/fuzz", + "show_logs": false, + "timeout": null + }, + "invariant": { + "runs": 256, + "depth": 500, + "min_depth": 1, + "depth_mode": "fixed", + "workers": "auto", + "fail_on_revert": false, + "call_override": false, + "dictionary_weight": 80, + "include_storage": true, + "include_push_bytes": true, + "max_fuzz_dictionary_addresses": 15728640, + "max_fuzz_dictionary_values": 9830400, + "max_fuzz_dictionary_literals": 6553600, + "shrink_run_limit": 5000, + "max_assume_rejects": 65536, + "gas_report_samples": 256, + "corpus_dir": null, + "frontier_dir": null, + "frontier_limit": 256, + "corpus_gzip": true, + "corpus_min_mutations": 5, + "corpus_min_size": 0, + "show_edge_coverage": false, + "evm_edge_coverage_collision_free": true, + "evm_edge_coverage_include_call_depth": false, + "sancov_edges": false, + "sancov_trace_cmp": false, + "corpus_random_sequence_weight": 10, + "payable_value_weight": 15, + "mutation_weight_splice": 1, + "mutation_weight_repeat": 1, + "mutation_weight_interleave": 1, + "mutation_weight_prefix": 1, + "mutation_weight_suffix": 1, + "mutation_weight_abi": 1, + "mutation_weight_cmp": 1, + "failure_persist_dir": "cache/invariant", + "show_metrics": true, + "timeout": null, + "show_solidity": false, + "max_time_delay": null, + "max_block_delay": null, + "check_interval": 1 + }, + "symbolic": { + "enabled": false, + "seed_corpus": false, + "use_fuzz_corpus": false, + "corpus_seed_limit": 32, + "use_fuzz_frontiers": false, + "check_invariant_frontiers": false, + "frontier_limit": 256, + "solver": "z3", + "timeout": 30, + "max_depth": 10000, + "max_paths": 1024, + "invariant_depth": 10, + "exploration_order": "bfs", + "max_solver_queries": 10000, + "default_dynamic_length": 2, + "max_dynamic_length": 256, + "array_lengths": [], + "max_calldata_bytes": 4096, + "symbolic_call_targets": false, + "dump_smt": false, + "storage_layout": "solidity" + }, + "coverage": { + "report": [ + "summary" + ], + "lcov_version": "1.0.0", + "ir_minimum": false, + "report_file": null, + "include_libs": false, + "exclude_tests": false, + "skip_files": [] + }, + "mutation": { + "include_operators": [], + "exclude_operators": [], + "timeout": null, + "optimizer_runs": null, + "via_ir": null + }, + "tracing": { + "verbosity": 0, + "disable_labels": false, + "compact_labels": false, + "decode_internal": false, + "external_identification_timeout": 5 + }, + "ffi": false, + "live_logs": false, + "allow_internal_expect_revert": false, + "always_use_create_2_factory": false, + "eip1559_fee_estimate": "market", + "prompt_timeout": 120, + "sender": "0x1804c8ab1f12e6bbf3894d4083f33e07309d1f38", + "tx_origin": "0x1804c8ab1f12e6bbf3894d4083f33e07309d1f38", + "initial_balance": "0xffffffffffffffffffffffff", + "block_number": 1, + "fork_block_number": null, + "chain_id": null, + "gas_limit": 1073741824, + "code_size_limit": null, + "gas_price": null, + "block_base_fee_per_gas": 0, + "block_coinbase": "0x0000000000000000000000000000000000000000", + "block_timestamp": 1, + "block_difficulty": 0, + "block_prevrandao": "0x0000000000000000000000000000000000000000000000000000000000000000", + "block_gas_limit": null, + "memory_limit": 134217728, + "extra_output": [], + "extra_output_files": [], + "names": false, + "sizes": false, + "via_ir": false, + "via_ssa_cfg": false, + "experimental": false, + "ast": false, + "rpc_storage_caching": { + "chains": "all", + "endpoints": "all" + }, + "no_storage_caching": false, + "no_rpc_rate_limit": false, + "use_literal_content": false, + "bytecode_hash": "ipfs", + "cbor_metadata": true, + "revert_strings": null, + "sparse_mode": false, + "build_info": true, + "build_info_path": null, + "fmt": { + "line_length": 120, + "tab_width": 4, + "style": "space", + "bracket_spacing": false, + "int_types": "long", + "multiline_func_header": "attributes_first", + "quote_style": "double", + "number_underscore": "preserve", + "hex_underscore": "remove", + "single_line_statement_blocks": "preserve", + "override_spacing": false, + "wrap_comments": false, + "docs_style": "preserve", + "ignore": [], + "contract_new_lines": false, + "sort_imports": false, + "namespace_import_style": "prefer_plain", + "pow_no_space": false, + "prefer_compact": "all", + "single_line_imports": false + }, + "lint": { + "severity": [ + "high", + "medium", + "low" + ], + "exclude_lints": [], + "ignore": [], + "lint_on_build": true, + "lint_specific": { + "mixed_case_exceptions": [ + "ERC", + "URI", + "ID", + "URL", + "API", + "JSON", + "XML", + "HTML", + "HTTP", + "HTTPS" + ], + "multi_contract_file_exceptions": [] + } + }, + "doc": { + "out": "docs", + "title": "", + "book": "book.toml", + "homepage": "README.md", + "ignore": [] + }, + "bind_json": { + "out": "utils/JsonBindings.sol", + "include": [], + "exclude": [] + }, + "fs_permissions": [ + { + "access": "read", + "path": "out" + } + ], + "isolate": true, + "disable_block_gas_limit": false, + "enable_tx_gas_limit": false, + "unchecked_cheatcode_artifacts": false, + "create2_library_salt": "0x0000000000000000000000000000000000000000000000000000000000000000", + "create2_deployer": "0x4e59b44847b379578588920ca78fbf26c0b4956c", + "vyper": {}, + "dependencies": null, + "soldeer": null, + "assertions_revert": true, + "legacy_assertions": false, + "network": null, + "celo": false, + "bypass_prevrandao": false, + "transaction_timeout": 120, + "additional_compiler_profiles": [], + "compilation_restrictions": [], + "script_execution_protection": true +} diff --git a/ops/ci/migration/tests/fixtures/selector-upload/abi-oracle/original.log b/ops/ci/migration/tests/fixtures/selector-upload/abi-oracle/original.log new file mode 100644 index 00000000000..13bc22f2b8a --- /dev/null +++ b/ops/ci/migration/tests/fixtures/selector-upload/abi-oracle/original.log @@ -0,0 +1,13 @@ +Listing selectors for contracts in the project... + +╭----------+------------------------------+--------------------------------------------------------------------+----------╮ +| Type | Signature | Selector | Contract | ++=========================================================================================================================+ +| Function | ping(uint256) | 0x773acdef | Fixture | +|----------+------------------------------+--------------------------------------------------------------------+----------| +| Function | transform((uint256,address)) | 0x3e46ec18 | Fixture | +|----------+------------------------------+--------------------------------------------------------------------+----------| +| Event | Pong(uint256) | 0x58b69f57828e6962d216502094c54f6562f3bf082ba758966c3454f9e37b1525 | Fixture | +|----------+------------------------------+--------------------------------------------------------------------+----------| +| Error | Problem(uint256) | 0x75e81caa | Fixture | +╰----------+------------------------------+--------------------------------------------------------------------+----------╯ diff --git a/ops/ci/migration/tests/fixtures/selector-upload/abi-oracle/project/cache/solidity-files-cache.json b/ops/ci/migration/tests/fixtures/selector-upload/abi-oracle/project/cache/solidity-files-cache.json new file mode 100644 index 00000000000..7b1ade3fbf4 --- /dev/null +++ b/ops/ci/migration/tests/fixtures/selector-upload/abi-oracle/project/cache/solidity-files-cache.json @@ -0,0 +1 @@ +{"_format":"","paths":{"artifacts":"out","build_infos":"out/build-info","sources":"src","tests":"test","scripts":"script","libraries":["lib"]},"files":{"src/Fixture.sol":{"lastModificationDate":1791203727907,"contentHash":"6ea0c68ffafe96cd","interfaceReprHash":"94202762fafab6fa","sourceName":"src/Fixture.sol","imports":[],"versionRequirement":"=0.8.28","artifacts":{"Empty":{"0.8.28":{"default":{"path":"Fixture.sol/Empty.json","build_id":"28a4e5f671f97142"}}},"Fixture":{"0.8.28":{"default":{"path":"Fixture.sol/Fixture.json","build_id":"28a4e5f671f97142"}}}},"seenByCompiler":true}},"builds":["28a4e5f671f97142"],"profiles":{"default":{"solc":{"optimizer":{"enabled":false,"runs":200},"metadata":{"useLiteralContent":false,"bytecodeHash":"ipfs","appendCBOR":true},"outputSelection":{"*":{"*":["abi"]}},"evmVersion":"prague","viaIR":false,"viaSSACFG":false,"experimental":false,"libraries":{}},"vyper":{"evmVersion":"prague","outputSelection":{"*":{"*":["abi"]}}}}},"preprocessed":true,"mocks":[]} \ No newline at end of file diff --git a/ops/ci/migration/tests/fixtures/selector-upload/abi-oracle/project/foundry.toml b/ops/ci/migration/tests/fixtures/selector-upload/abi-oracle/project/foundry.toml new file mode 100644 index 00000000000..888f46f6987 --- /dev/null +++ b/ops/ci/migration/tests/fixtures/selector-upload/abi-oracle/project/foundry.toml @@ -0,0 +1,4 @@ +[profile.default] +src="src" +solc_version="0.8.28" +build_info=true diff --git a/ops/ci/migration/tests/fixtures/selector-upload/abi-oracle/project/out/Fixture.sol/Empty.json b/ops/ci/migration/tests/fixtures/selector-upload/abi-oracle/project/out/Fixture.sol/Empty.json new file mode 100644 index 00000000000..3fa7b482a0b --- /dev/null +++ b/ops/ci/migration/tests/fixtures/selector-upload/abi-oracle/project/out/Fixture.sol/Empty.json @@ -0,0 +1 @@ +{"abi":[],"id":0} \ No newline at end of file diff --git a/ops/ci/migration/tests/fixtures/selector-upload/abi-oracle/project/out/Fixture.sol/Fixture.json b/ops/ci/migration/tests/fixtures/selector-upload/abi-oracle/project/out/Fixture.sol/Fixture.json new file mode 100644 index 00000000000..4333dc6e76d --- /dev/null +++ b/ops/ci/migration/tests/fixtures/selector-upload/abi-oracle/project/out/Fixture.sol/Fixture.json @@ -0,0 +1 @@ +{"abi":[{"type":"function","name":"ping","inputs":[{"name":"_value","type":"uint256","internalType":"uint256"}],"outputs":[{"name":"","type":"uint256","internalType":"uint256"}],"stateMutability":"pure"},{"type":"function","name":"transform","inputs":[{"name":"_pair","type":"tuple","internalType":"struct Fixture.Pair","components":[{"name":"x","type":"uint256","internalType":"uint256"},{"name":"recipient","type":"address","internalType":"address"}]}],"outputs":[{"name":"","type":"uint256","internalType":"uint256"}],"stateMutability":"pure"},{"type":"event","name":"Pong","inputs":[{"name":"value","type":"uint256","indexed":false,"internalType":"uint256"}],"anonymous":false},{"type":"error","name":"Problem","inputs":[{"name":"value","type":"uint256","internalType":"uint256"}]}],"id":0} \ No newline at end of file diff --git a/ops/ci/migration/tests/fixtures/selector-upload/abi-oracle/project/out/build-info/28a4e5f671f97142.json b/ops/ci/migration/tests/fixtures/selector-upload/abi-oracle/project/out/build-info/28a4e5f671f97142.json new file mode 100644 index 00000000000..5460b91ba1f --- /dev/null +++ b/ops/ci/migration/tests/fixtures/selector-upload/abi-oracle/project/out/build-info/28a4e5f671f97142.json @@ -0,0 +1 @@ +{"id":"28a4e5f671f97142","source_id_to_path":{"0":"src/Fixture.sol"},"language":"Solidity","_format":"ethers-rs-sol-build-info-1","input":{"version":"0.8.28","language":"Solidity","sources":{"src/Fixture.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity 0.8.28;\nlibrary Empty {}\ncontract Fixture { struct Pair { uint256 x; address recipient; }\nerror Problem(uint256 value); event Pong(uint256 value);\nfunction ping(uint256 _value) external pure returns (uint256) { if (_value==0) revert Problem(_value); return _value; }\nfunction transform(Pair calldata _pair) external pure returns (uint256) { return _pair.x; } }\n"}},"settings":{"optimizer":{"enabled":false,"runs":200},"metadata":{"useLiteralContent":false,"bytecodeHash":"ipfs","appendCBOR":true},"outputSelection":{"src/Fixture.sol":{"*":["abi"]}},"evmVersion":"prague","viaIR":false,"libraries":{}},"allowPaths":["/var/mint-workspace/.ci/selector-abi-probe/project","/var/mint-workspace/.ci/selector-abi-probe/project/lib"],"basePath":"/var/mint-workspace/.ci/selector-abi-probe/project","includePaths":["/var/mint-workspace/.ci/selector-abi-probe/project"]},"output":{"contracts":{"src/Fixture.sol":{"Empty":{"abi":[],"userdoc":{},"devdoc":{}},"Fixture":{"abi":[{"type":"function","name":"ping","inputs":[{"name":"_value","type":"uint256","internalType":"uint256"}],"outputs":[{"name":"","type":"uint256","internalType":"uint256"}],"stateMutability":"pure"},{"type":"function","name":"transform","inputs":[{"name":"_pair","type":"tuple","internalType":"struct Fixture.Pair","components":[{"name":"x","type":"uint256","internalType":"uint256"},{"name":"recipient","type":"address","internalType":"address"}]}],"outputs":[{"name":"","type":"uint256","internalType":"uint256"}],"stateMutability":"pure"},{"type":"event","name":"Pong","inputs":[{"name":"value","type":"uint256","indexed":false,"internalType":"uint256"}],"anonymous":false},{"type":"error","name":"Problem","inputs":[{"name":"value","type":"uint256","internalType":"uint256"}]}],"userdoc":{},"devdoc":{}}}},"sources":{"src/Fixture.sol":{"id":0,"ast":{}}}},"solcLongVersion":"0.8.28","solcVersion":"0.8.28"} \ No newline at end of file diff --git a/ops/ci/migration/tests/fixtures/selector-upload/abi-oracle/project/src/Fixture.sol b/ops/ci/migration/tests/fixtures/selector-upload/abi-oracle/project/src/Fixture.sol new file mode 100644 index 00000000000..b96f429b23c --- /dev/null +++ b/ops/ci/migration/tests/fixtures/selector-upload/abi-oracle/project/src/Fixture.sol @@ -0,0 +1,7 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.28; +library Empty {} +contract Fixture { struct Pair { uint256 x; address recipient; } +error Problem(uint256 value); event Pong(uint256 value); +function ping(uint256 _value) external pure returns (uint256) { if (_value==0) revert Problem(_value); return _value; } +function transform(Pair calldata _pair) external pure returns (uint256) { return _pair.x; } } diff --git a/ops/ci/migration/tests/fixtures/selector-upload/live-import/denied-write/http-0-request.json b/ops/ci/migration/tests/fixtures/selector-upload/live-import/denied-write/http-0-request.json new file mode 100644 index 00000000000..cc8aa364449 --- /dev/null +++ b/ops/ci/migration/tests/fixtures/selector-upload/live-import/denied-write/http-0-request.json @@ -0,0 +1 @@ +{"function":["ping(uint256)","transform((uint256,address))","Problem(uint256)"],"event":["Pong(uint256)"]} \ No newline at end of file diff --git a/ops/ci/migration/tests/fixtures/selector-upload/live-import/denied-write/http-0-response.json b/ops/ci/migration/tests/fixtures/selector-upload/live-import/denied-write/http-0-response.json new file mode 100644 index 00000000000..262909208d7 --- /dev/null +++ b/ops/ci/migration/tests/fixtures/selector-upload/live-import/denied-write/http-0-response.json @@ -0,0 +1 @@ +{"ok":false,"error":"Unexpected failure during signature import"} \ No newline at end of file diff --git a/ops/ci/migration/tests/fixtures/selector-upload/live-import/denied-write/http-0.json b/ops/ci/migration/tests/fixtures/selector-upload/live-import/denied-write/http-0.json new file mode 100644 index 00000000000..363a24e9600 --- /dev/null +++ b/ops/ci/migration/tests/fixtures/selector-upload/live-import/denied-write/http-0.json @@ -0,0 +1,8 @@ +{ + "host": "api.4byte.sourcify.dev", + "method": "POST", + "path": "/signature-database/v1/import", + "request_sha256": "043d5b6d8977872d0e19b2235943fb8fc461642eef2428b404c3416c62adfc0d", + "response_sha256": "e157dc940e9cf6ab7cac3ff3b51f4f856fc655bf601c787c8df57c581a34cbe1", + "status": 500 +} diff --git a/ops/ci/migration/tests/fixtures/selector-upload/live-import/denied-write/stderr.log b/ops/ci/migration/tests/fixtures/selector-upload/live-import/denied-write/stderr.log new file mode 100644 index 00000000000..2bce8ea0edf --- /dev/null +++ b/ops/ci/migration/tests/fixtures/selector-upload/live-import/denied-write/stderr.log @@ -0,0 +1,2 @@ +Uploading selectors for Fixture... +Error: HTTP status server error (500 Internal Server Error) for url (https://api.4byte.sourcify.dev/signature-database/v1/import) diff --git a/ops/ci/migration/tests/fixtures/selector-upload/live-import/denied-write/stdout.log b/ops/ci/migration/tests/fixtures/selector-upload/live-import/denied-write/stdout.log new file mode 100644 index 00000000000..72a0b8dac71 --- /dev/null +++ b/ops/ci/migration/tests/fixtures/selector-upload/live-import/denied-write/stdout.log @@ -0,0 +1,3 @@ +Compiling 1 files with Solc 0.8.28 +Solc 0.8.28 finished in 1.85ms +Compiler run successful! diff --git a/ops/ci/migration/tests/fixtures/selector-upload/live-import/duplicate-upload/http-0-request.json b/ops/ci/migration/tests/fixtures/selector-upload/live-import/duplicate-upload/http-0-request.json new file mode 100644 index 00000000000..cc8aa364449 --- /dev/null +++ b/ops/ci/migration/tests/fixtures/selector-upload/live-import/duplicate-upload/http-0-request.json @@ -0,0 +1 @@ +{"function":["ping(uint256)","transform((uint256,address))","Problem(uint256)"],"event":["Pong(uint256)"]} \ No newline at end of file diff --git a/ops/ci/migration/tests/fixtures/selector-upload/live-import/duplicate-upload/http-0-response.json b/ops/ci/migration/tests/fixtures/selector-upload/live-import/duplicate-upload/http-0-response.json new file mode 100644 index 00000000000..1eee038776d --- /dev/null +++ b/ops/ci/migration/tests/fixtures/selector-upload/live-import/duplicate-upload/http-0-response.json @@ -0,0 +1 @@ +{"ok":true,"result":{"function":{"imported":{},"duplicated":{"ping(uint256)":"0x773acdef","transform((uint256,address))":"0x3e46ec18","Problem(uint256)":"0x75e81caa"},"invalid":[]},"event":{"imported":{},"duplicated":{"Pong(uint256)":"0x58b69f57828e6962d216502094c54f6562f3bf082ba758966c3454f9e37b1525"},"invalid":[]}}} \ No newline at end of file diff --git a/ops/ci/migration/tests/fixtures/selector-upload/live-import/duplicate-upload/http-0.json b/ops/ci/migration/tests/fixtures/selector-upload/live-import/duplicate-upload/http-0.json new file mode 100644 index 00000000000..0c72ee7efcf --- /dev/null +++ b/ops/ci/migration/tests/fixtures/selector-upload/live-import/duplicate-upload/http-0.json @@ -0,0 +1,8 @@ +{ + "host": "api.4byte.sourcify.dev", + "method": "POST", + "path": "/signature-database/v1/import", + "request_sha256": "043d5b6d8977872d0e19b2235943fb8fc461642eef2428b404c3416c62adfc0d", + "response_sha256": "5691f24facd5dcb91fe6c3fd0733cb3734b5bf73c3ca11df379cd8f5f1c8c1fa", + "status": 200 +} diff --git a/ops/ci/migration/tests/fixtures/selector-upload/live-import/duplicate-upload/stderr.log b/ops/ci/migration/tests/fixtures/selector-upload/live-import/duplicate-upload/stderr.log new file mode 100644 index 00000000000..acbf3c1bae5 --- /dev/null +++ b/ops/ci/migration/tests/fixtures/selector-upload/live-import/duplicate-upload/stderr.log @@ -0,0 +1 @@ +Uploading selectors for Fixture... diff --git a/ops/ci/migration/tests/fixtures/selector-upload/live-import/duplicate-upload/stdout.log b/ops/ci/migration/tests/fixtures/selector-upload/live-import/duplicate-upload/stdout.log new file mode 100644 index 00000000000..5cef722c14a --- /dev/null +++ b/ops/ci/migration/tests/fixtures/selector-upload/live-import/duplicate-upload/stdout.log @@ -0,0 +1,8 @@ +Compiling 1 files with Solc 0.8.28 +Solc 0.8.28 finished in 1.84ms +Compiler run successful! +Duplicated: Function transform((uint256,address)): 0x3e46ec18 +Duplicated: Function Problem(uint256): 0x75e81caa +Duplicated: Function ping(uint256): 0x773acdef +Duplicated: Event Pong(uint256): 0x58b69f57828e6962d216502094c54f6562f3bf082ba758966c3454f9e37b1525 +Selectors successfully uploaded to OpenChain diff --git a/ops/ci/migration/tests/fixtures/selector-upload/live-import/first-upload/http-0-request.json b/ops/ci/migration/tests/fixtures/selector-upload/live-import/first-upload/http-0-request.json new file mode 100644 index 00000000000..cc8aa364449 --- /dev/null +++ b/ops/ci/migration/tests/fixtures/selector-upload/live-import/first-upload/http-0-request.json @@ -0,0 +1 @@ +{"function":["ping(uint256)","transform((uint256,address))","Problem(uint256)"],"event":["Pong(uint256)"]} \ No newline at end of file diff --git a/ops/ci/migration/tests/fixtures/selector-upload/live-import/first-upload/http-0-response.json b/ops/ci/migration/tests/fixtures/selector-upload/live-import/first-upload/http-0-response.json new file mode 100644 index 00000000000..92174af94de --- /dev/null +++ b/ops/ci/migration/tests/fixtures/selector-upload/live-import/first-upload/http-0-response.json @@ -0,0 +1 @@ +{"ok":true,"result":{"function":{"imported":{"ping(uint256)":"0x773acdef","transform((uint256,address))":"0x3e46ec18","Problem(uint256)":"0x75e81caa"},"duplicated":{},"invalid":[]},"event":{"imported":{"Pong(uint256)":"0x58b69f57828e6962d216502094c54f6562f3bf082ba758966c3454f9e37b1525"},"duplicated":{},"invalid":[]}}} \ No newline at end of file diff --git a/ops/ci/migration/tests/fixtures/selector-upload/live-import/first-upload/http-0.json b/ops/ci/migration/tests/fixtures/selector-upload/live-import/first-upload/http-0.json new file mode 100644 index 00000000000..86b91f723bc --- /dev/null +++ b/ops/ci/migration/tests/fixtures/selector-upload/live-import/first-upload/http-0.json @@ -0,0 +1,8 @@ +{ + "host": "api.4byte.sourcify.dev", + "method": "POST", + "path": "/signature-database/v1/import", + "request_sha256": "043d5b6d8977872d0e19b2235943fb8fc461642eef2428b404c3416c62adfc0d", + "response_sha256": "f52693fca4849bc0b2e0651404c66a21b588912558c4d1fd96a4b2e3ee39ec46", + "status": 200 +} diff --git a/ops/ci/migration/tests/fixtures/selector-upload/live-import/first-upload/stderr.log b/ops/ci/migration/tests/fixtures/selector-upload/live-import/first-upload/stderr.log new file mode 100644 index 00000000000..acbf3c1bae5 --- /dev/null +++ b/ops/ci/migration/tests/fixtures/selector-upload/live-import/first-upload/stderr.log @@ -0,0 +1 @@ +Uploading selectors for Fixture... diff --git a/ops/ci/migration/tests/fixtures/selector-upload/live-import/first-upload/stdout.log b/ops/ci/migration/tests/fixtures/selector-upload/live-import/first-upload/stdout.log new file mode 100644 index 00000000000..40ad86f56e1 --- /dev/null +++ b/ops/ci/migration/tests/fixtures/selector-upload/live-import/first-upload/stdout.log @@ -0,0 +1,8 @@ +Compiling 1 files with Solc 0.8.28 +Solc 0.8.28 finished in 1.86ms +Compiler run successful! +Imported: Function Problem(uint256): 0x75e81caa +Imported: Function ping(uint256): 0x773acdef +Imported: Function transform((uint256,address)): 0x3e46ec18 +Imported: Event Pong(uint256): 0x58b69f57828e6962d216502094c54f6562f3bf082ba758966c3454f9e37b1525 +Selectors successfully uploaded to OpenChain diff --git a/ops/ci/migration/tests/fixtures/selector-upload/live-import/fixture.json b/ops/ci/migration/tests/fixtures/selector-upload/live-import/fixture.json new file mode 100644 index 00000000000..ea26553a7e6 --- /dev/null +++ b/ops/ci/migration/tests/fixtures/selector-upload/live-import/fixture.json @@ -0,0 +1,13 @@ +{ + "coverage_added": 0, + "real_denied_write": true, + "real_duplicate_upload": true, + "real_forge_upload": true, + "signatures": { + "Pong(uint256)": "0x58b69f57828e6962d216502094c54f6562f3bf082ba758966c3454f9e37b1525", + "Problem(uint256)": "0x75e81caa0a77e5adadc3b22c7f7ddde3687f552d3c98fcf637917b018491dfb4", + "ping(uint256)": "0x773acdefa14d0531aef69d486d7c8400e4a8345988e81c39fb5b0177d80ed868", + "transform((uint256,address))": "0x3e46ec18b11f8d1e09ad2a1a34a156f5e1efa2eca41399ccf5107955eb031232" + }, + "state": "passed" +} diff --git a/ops/ci/migration/tests/fixtures/selector-upload/multi-profile-oracle/foundry-config.json b/ops/ci/migration/tests/fixtures/selector-upload/multi-profile-oracle/foundry-config.json new file mode 100644 index 00000000000..3b53068679b --- /dev/null +++ b/ops/ci/migration/tests/fixtures/selector-upload/multi-profile-oracle/foundry-config.json @@ -0,0 +1,347 @@ +{ + "src": "src", + "test": "test", + "script": "script", + "out": "out", + "libs": [ + "lib" + ], + "remappings": [], + "auto_detect_remappings": true, + "libraries": [], + "cache": true, + "cache_path": "cache", + "dynamic_test_linking": true, + "snapshots": "snapshots", + "gas_snapshot_check": false, + "gas_snapshot_emit": true, + "broadcast": "broadcast", + "allow_paths": [], + "include_paths": [], + "skip": [], + "force": false, + "evm_version": "prague", + "hardfork": null, + "gas_reports": [ + "*" + ], + "gas_reports_ignore": [], + "gas_reports_include_tests": false, + "solc": "0.8.28", + "auto_detect_solc": true, + "offline": false, + "optimizer": true, + "optimizer_runs": 200, + "optimizer_details": null, + "model_checker": null, + "verbosity": 0, + "eth_rpc_url": null, + "eth_rpc_accept_invalid_certs": false, + "eth_rpc_no_proxy": false, + "eth_rpc_jwt": null, + "eth_rpc_timeout": null, + "eth_rpc_headers": null, + "eth_rpc_curl": false, + "etherscan_api_key": null, + "ignored_error_codes": [ + "license", + "code-size", + "init-code-size", + "transient-storage", + "transfer-deprecated", + "natspec-memory-safe-assembly-deprecated" + ], + "ignored_error_codes_from": [], + "ignored_warnings_from": [], + "deny": "never", + "match_test": null, + "no_match_test": null, + "match_contract": null, + "no_match_contract": null, + "match_path": null, + "no_match_path": null, + "no_match_coverage": null, + "test_failures_file": "cache/test-failures", + "mutation_dir": "cache/mutation", + "threads": null, + "show_progress": false, + "fuzz": { + "runs": 256, + "run": null, + "worker": null, + "fail_on_revert": true, + "max_test_rejects": 65536, + "seed": null, + "dictionary_weight": 40, + "include_storage": true, + "include_push_bytes": true, + "max_fuzz_dictionary_addresses": 15728640, + "max_fuzz_dictionary_values": 9830400, + "max_fuzz_dictionary_literals": 6553600, + "gas_report_samples": 256, + "corpus_dir": null, + "frontier_dir": null, + "frontier_limit": 256, + "corpus_gzip": true, + "corpus_min_mutations": 5, + "corpus_min_size": 0, + "show_edge_coverage": false, + "evm_edge_coverage_collision_free": true, + "evm_edge_coverage_include_call_depth": false, + "sancov_edges": false, + "sancov_trace_cmp": false, + "corpus_random_sequence_weight": 10, + "payable_value_weight": 0, + "mutation_weight_splice": 1, + "mutation_weight_repeat": 1, + "mutation_weight_interleave": 1, + "mutation_weight_prefix": 1, + "mutation_weight_suffix": 1, + "mutation_weight_abi": 1, + "mutation_weight_cmp": 1, + "failure_persist_dir": "cache/fuzz", + "show_logs": false, + "timeout": null + }, + "invariant": { + "runs": 256, + "depth": 500, + "min_depth": 1, + "depth_mode": "fixed", + "workers": "auto", + "fail_on_revert": false, + "call_override": false, + "dictionary_weight": 80, + "include_storage": true, + "include_push_bytes": true, + "max_fuzz_dictionary_addresses": 15728640, + "max_fuzz_dictionary_values": 9830400, + "max_fuzz_dictionary_literals": 6553600, + "shrink_run_limit": 5000, + "max_assume_rejects": 65536, + "gas_report_samples": 256, + "corpus_dir": null, + "frontier_dir": null, + "frontier_limit": 256, + "corpus_gzip": true, + "corpus_min_mutations": 5, + "corpus_min_size": 0, + "show_edge_coverage": false, + "evm_edge_coverage_collision_free": true, + "evm_edge_coverage_include_call_depth": false, + "sancov_edges": false, + "sancov_trace_cmp": false, + "corpus_random_sequence_weight": 10, + "payable_value_weight": 15, + "mutation_weight_splice": 1, + "mutation_weight_repeat": 1, + "mutation_weight_interleave": 1, + "mutation_weight_prefix": 1, + "mutation_weight_suffix": 1, + "mutation_weight_abi": 1, + "mutation_weight_cmp": 1, + "failure_persist_dir": "cache/invariant", + "show_metrics": true, + "timeout": null, + "show_solidity": false, + "max_time_delay": null, + "max_block_delay": null, + "check_interval": 1 + }, + "symbolic": { + "enabled": false, + "seed_corpus": false, + "use_fuzz_corpus": false, + "corpus_seed_limit": 32, + "use_fuzz_frontiers": false, + "check_invariant_frontiers": false, + "frontier_limit": 256, + "solver": "z3", + "timeout": 30, + "max_depth": 10000, + "max_paths": 1024, + "invariant_depth": 10, + "exploration_order": "bfs", + "max_solver_queries": 10000, + "default_dynamic_length": 2, + "max_dynamic_length": 256, + "array_lengths": [], + "max_calldata_bytes": 4096, + "symbolic_call_targets": false, + "dump_smt": false, + "storage_layout": "solidity" + }, + "coverage": { + "report": [ + "summary" + ], + "lcov_version": "1.0.0", + "ir_minimum": false, + "report_file": null, + "include_libs": false, + "exclude_tests": false, + "skip_files": [] + }, + "mutation": { + "include_operators": [], + "exclude_operators": [], + "timeout": null, + "optimizer_runs": null, + "via_ir": null + }, + "tracing": { + "verbosity": 0, + "disable_labels": false, + "compact_labels": false, + "decode_internal": false, + "external_identification_timeout": 5 + }, + "ffi": false, + "live_logs": false, + "allow_internal_expect_revert": false, + "always_use_create_2_factory": false, + "eip1559_fee_estimate": "market", + "prompt_timeout": 120, + "sender": "0x1804c8ab1f12e6bbf3894d4083f33e07309d1f38", + "tx_origin": "0x1804c8ab1f12e6bbf3894d4083f33e07309d1f38", + "initial_balance": "0xffffffffffffffffffffffff", + "block_number": 1, + "fork_block_number": null, + "chain_id": null, + "gas_limit": 1073741824, + "code_size_limit": null, + "gas_price": null, + "block_base_fee_per_gas": 0, + "block_coinbase": "0x0000000000000000000000000000000000000000", + "block_timestamp": 1, + "block_difficulty": 0, + "block_prevrandao": "0x0000000000000000000000000000000000000000000000000000000000000000", + "block_gas_limit": null, + "memory_limit": 134217728, + "extra_output": [], + "extra_output_files": [], + "names": false, + "sizes": false, + "via_ir": false, + "via_ssa_cfg": false, + "experimental": false, + "ast": false, + "rpc_storage_caching": { + "chains": "all", + "endpoints": "all" + }, + "no_storage_caching": false, + "no_rpc_rate_limit": false, + "use_literal_content": false, + "bytecode_hash": "ipfs", + "cbor_metadata": true, + "revert_strings": null, + "sparse_mode": false, + "build_info": false, + "build_info_path": null, + "fmt": { + "line_length": 120, + "tab_width": 4, + "style": "space", + "bracket_spacing": false, + "int_types": "long", + "multiline_func_header": "attributes_first", + "quote_style": "double", + "number_underscore": "preserve", + "hex_underscore": "remove", + "single_line_statement_blocks": "preserve", + "override_spacing": false, + "wrap_comments": false, + "docs_style": "preserve", + "ignore": [], + "contract_new_lines": false, + "sort_imports": false, + "namespace_import_style": "prefer_plain", + "pow_no_space": false, + "prefer_compact": "all", + "single_line_imports": false + }, + "lint": { + "severity": [ + "high", + "medium", + "low" + ], + "exclude_lints": [], + "ignore": [], + "lint_on_build": true, + "lint_specific": { + "mixed_case_exceptions": [ + "ERC", + "URI", + "ID", + "URL", + "API", + "JSON", + "XML", + "HTML", + "HTTP", + "HTTPS" + ], + "multi_contract_file_exceptions": [] + } + }, + "doc": { + "out": "docs", + "title": "", + "book": "book.toml", + "homepage": "README.md", + "ignore": [] + }, + "bind_json": { + "out": "utils/JsonBindings.sol", + "include": [], + "exclude": [] + }, + "fs_permissions": [ + { + "access": "read", + "path": "out" + } + ], + "isolate": true, + "disable_block_gas_limit": false, + "enable_tx_gas_limit": false, + "unchecked_cheatcode_artifacts": false, + "create2_library_salt": "0x0000000000000000000000000000000000000000000000000000000000000000", + "create2_deployer": "0x4e59b44847b379578588920ca78fbf26c0b4956c", + "vyper": {}, + "dependencies": null, + "soldeer": null, + "assertions_revert": true, + "legacy_assertions": false, + "network": null, + "celo": false, + "bypass_prevrandao": false, + "transaction_timeout": 120, + "additional_compiler_profiles": [ + { + "name": "dispute", + "via_ir": null, + "evm_version": null, + "optimizer": null, + "optimizer_runs": 50, + "bytecode_hash": null + } + ], + "compilation_restrictions": [ + { + "paths": "src/ZRestricted.sol", + "version": null, + "via_ir": null, + "bytecode_hash": null, + "min_optimizer_runs": null, + "optimizer_runs": 50, + "max_optimizer_runs": null, + "min_evm_version": null, + "evm_version": null, + "max_evm_version": null + } + ], + "script_execution_protection": true +} diff --git a/ops/ci/migration/tests/fixtures/selector-upload/multi-profile-oracle/original.log b/ops/ci/migration/tests/fixtures/selector-upload/multi-profile-oracle/original.log new file mode 100644 index 00000000000..afbd669f449 --- /dev/null +++ b/ops/ci/migration/tests/fixtures/selector-upload/multi-profile-oracle/original.log @@ -0,0 +1,9 @@ +Listing selectors for contracts in the project... + +╭----------+------------+------------+---------------╮ +| Type | Signature | Selector | Contract | ++====================================================+ +| Function | a(uint256) | 0xf0fdf834 | AUnrestricted | +|----------+------------+------------+---------------| +| Function | z(uint256) | 0x656ef8d9 | ZRestricted | +╰----------+------------+------------+---------------╯ diff --git a/ops/ci/migration/tests/fixtures/selector-upload/multi-profile-oracle/project/cache/solidity-files-cache.json b/ops/ci/migration/tests/fixtures/selector-upload/multi-profile-oracle/project/cache/solidity-files-cache.json new file mode 100644 index 00000000000..ab1f3de5fba --- /dev/null +++ b/ops/ci/migration/tests/fixtures/selector-upload/multi-profile-oracle/project/cache/solidity-files-cache.json @@ -0,0 +1 @@ +{"_format":"","paths":{"artifacts":"out","build_infos":"out/build-info","sources":"src","tests":"test","scripts":"script","libraries":["lib"]},"files":{"src/AUnrestricted.sol":{"lastModificationDate":1791203722158,"contentHash":"c6cfc5b91173d667","interfaceReprHash":"6bf53fdedbcc2ad7","sourceName":"src/AUnrestricted.sol","imports":["src/Shared.sol"],"versionRequirement":"=0.8.28","artifacts":{"AUnrestricted":{"0.8.28":{"default":{"path":"AUnrestricted.sol/AUnrestricted.json","build_id":"bbc87524da30141a"}}}},"seenByCompiler":true},"src/Shared.sol":{"lastModificationDate":1791203722158,"contentHash":"6658dba65b9ee8c9","interfaceReprHash":"9cc5c03822e112d0","sourceName":"src/Shared.sol","imports":[],"versionRequirement":"=0.8.28","artifacts":{"Shared":{"0.8.28":{"default":{"path":"Shared.sol/Shared.json","build_id":"bbc87524da30141a"},"dispute":{"path":"Shared.sol/Shared.dispute.json","build_id":"df3a523b2f827bc0"}}}},"seenByCompiler":true},"src/ZRestricted.sol":{"lastModificationDate":1791203722159,"contentHash":"4c0ba8ef8322858d","interfaceReprHash":"17328981a62c7944","sourceName":"src/ZRestricted.sol","imports":["src/Shared.sol"],"versionRequirement":"=0.8.28","artifacts":{"ZRestricted":{"0.8.28":{"dispute":{"path":"ZRestricted.sol/ZRestricted.json","build_id":"df3a523b2f827bc0"}}}},"seenByCompiler":true}},"builds":["bbc87524da30141a","df3a523b2f827bc0"],"profiles":{"default":{"solc":{"optimizer":{"enabled":true,"runs":200},"metadata":{"useLiteralContent":false,"bytecodeHash":"ipfs","appendCBOR":true},"outputSelection":{"*":{"*":["abi"]}},"evmVersion":"prague","viaIR":false,"viaSSACFG":false,"experimental":false,"libraries":{}},"vyper":{"evmVersion":"prague","outputSelection":{"*":{"*":["abi"]}}}},"dispute":{"solc":{"optimizer":{"enabled":true,"runs":50},"metadata":{"useLiteralContent":false,"bytecodeHash":"ipfs","appendCBOR":true},"outputSelection":{"*":{"*":["abi"]}},"evmVersion":"prague","viaIR":false,"viaSSACFG":false,"experimental":false,"libraries":{}},"vyper":{"evmVersion":"prague","outputSelection":{"*":{"*":["abi"]}}}}},"preprocessed":true,"mocks":[]} \ No newline at end of file diff --git a/ops/ci/migration/tests/fixtures/selector-upload/multi-profile-oracle/project/foundry.toml b/ops/ci/migration/tests/fixtures/selector-upload/multi-profile-oracle/project/foundry.toml new file mode 100644 index 00000000000..133ac59a218 --- /dev/null +++ b/ops/ci/migration/tests/fixtures/selector-upload/multi-profile-oracle/project/foundry.toml @@ -0,0 +1,7 @@ +[profile.default] +src="src" +solc_version="0.8.28" +optimizer=true +optimizer_runs=200 +additional_compiler_profiles=[{name="dispute",optimizer_runs=50}] +compilation_restrictions=[{paths="src/ZRestricted.sol",optimizer_runs=50}] diff --git a/ops/ci/migration/tests/fixtures/selector-upload/multi-profile-oracle/project/out/AUnrestricted.sol/AUnrestricted.json b/ops/ci/migration/tests/fixtures/selector-upload/multi-profile-oracle/project/out/AUnrestricted.sol/AUnrestricted.json new file mode 100644 index 00000000000..f81a51f14fa --- /dev/null +++ b/ops/ci/migration/tests/fixtures/selector-upload/multi-profile-oracle/project/out/AUnrestricted.sol/AUnrestricted.json @@ -0,0 +1 @@ +{"abi":[{"type":"function","name":"a","inputs":[{"name":"_x","type":"uint256","internalType":"uint256"}],"outputs":[{"name":"","type":"uint256","internalType":"uint256"}],"stateMutability":"pure"}],"id":0} \ No newline at end of file diff --git a/ops/ci/migration/tests/fixtures/selector-upload/multi-profile-oracle/project/out/Shared.sol/Shared.dispute.json b/ops/ci/migration/tests/fixtures/selector-upload/multi-profile-oracle/project/out/Shared.sol/Shared.dispute.json new file mode 100644 index 00000000000..91b040dd0da --- /dev/null +++ b/ops/ci/migration/tests/fixtures/selector-upload/multi-profile-oracle/project/out/Shared.sol/Shared.dispute.json @@ -0,0 +1 @@ +{"abi":[],"id":1} \ No newline at end of file diff --git a/ops/ci/migration/tests/fixtures/selector-upload/multi-profile-oracle/project/out/Shared.sol/Shared.json b/ops/ci/migration/tests/fixtures/selector-upload/multi-profile-oracle/project/out/Shared.sol/Shared.json new file mode 100644 index 00000000000..91b040dd0da --- /dev/null +++ b/ops/ci/migration/tests/fixtures/selector-upload/multi-profile-oracle/project/out/Shared.sol/Shared.json @@ -0,0 +1 @@ +{"abi":[],"id":1} \ No newline at end of file diff --git a/ops/ci/migration/tests/fixtures/selector-upload/multi-profile-oracle/project/out/ZRestricted.sol/ZRestricted.json b/ops/ci/migration/tests/fixtures/selector-upload/multi-profile-oracle/project/out/ZRestricted.sol/ZRestricted.json new file mode 100644 index 00000000000..09fe89ae53a --- /dev/null +++ b/ops/ci/migration/tests/fixtures/selector-upload/multi-profile-oracle/project/out/ZRestricted.sol/ZRestricted.json @@ -0,0 +1 @@ +{"abi":[{"type":"function","name":"z","inputs":[{"name":"_x","type":"uint256","internalType":"uint256"}],"outputs":[{"name":"","type":"uint256","internalType":"uint256"}],"stateMutability":"pure"}],"id":1} \ No newline at end of file diff --git a/ops/ci/migration/tests/fixtures/selector-upload/multi-profile-oracle/project/out/build-info/bbc87524da30141a.json b/ops/ci/migration/tests/fixtures/selector-upload/multi-profile-oracle/project/out/build-info/bbc87524da30141a.json new file mode 100644 index 00000000000..2fbc43772db --- /dev/null +++ b/ops/ci/migration/tests/fixtures/selector-upload/multi-profile-oracle/project/out/build-info/bbc87524da30141a.json @@ -0,0 +1 @@ +{"id":"bbc87524da30141a","source_id_to_path":{"0":"src/AUnrestricted.sol","1":"src/Shared.sol"},"language":"Solidity","_format":"ethers-rs-sol-build-info-1","input":{"version":"0.8.28","language":"Solidity","sources":{"src/AUnrestricted.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity 0.8.28;\nimport {Shared} from \"./Shared.sol\";\ncontract AUnrestricted { function a(uint256 _x) external pure returns (uint256) { return Shared.value(_x); } }\n"},"src/Shared.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity 0.8.28;\nlibrary Shared { function value(uint256 _x) internal pure returns (uint256) { return _x; } }\n"}},"settings":{"optimizer":{"enabled":true,"runs":200},"metadata":{"useLiteralContent":false,"bytecodeHash":"ipfs","appendCBOR":true},"outputSelection":{"src/AUnrestricted.sol":{"*":["abi"]},"src/Shared.sol":{"*":["abi"]}},"evmVersion":"prague","viaIR":false,"libraries":{}},"allowPaths":["/var/mint-workspace/.ci/selector-multi-oracle/project","/var/mint-workspace/.ci/selector-multi-oracle/project/lib"],"basePath":"/var/mint-workspace/.ci/selector-multi-oracle/project","includePaths":["/var/mint-workspace/.ci/selector-multi-oracle/project"]},"output":{"contracts":{"src/AUnrestricted.sol":{"AUnrestricted":{"abi":[{"type":"function","name":"a","inputs":[{"name":"_x","type":"uint256","internalType":"uint256"}],"outputs":[{"name":"","type":"uint256","internalType":"uint256"}],"stateMutability":"pure"}],"userdoc":{},"devdoc":{}}},"src/Shared.sol":{"Shared":{"abi":[],"userdoc":{},"devdoc":{}}}},"sources":{"src/AUnrestricted.sol":{"id":0,"ast":{}},"src/Shared.sol":{"id":1,"ast":{}}}},"solcLongVersion":"0.8.28","solcVersion":"0.8.28"} \ No newline at end of file diff --git a/ops/ci/migration/tests/fixtures/selector-upload/multi-profile-oracle/project/out/build-info/df3a523b2f827bc0.json b/ops/ci/migration/tests/fixtures/selector-upload/multi-profile-oracle/project/out/build-info/df3a523b2f827bc0.json new file mode 100644 index 00000000000..a84995af9cd --- /dev/null +++ b/ops/ci/migration/tests/fixtures/selector-upload/multi-profile-oracle/project/out/build-info/df3a523b2f827bc0.json @@ -0,0 +1 @@ +{"id":"df3a523b2f827bc0","source_id_to_path":{"0":"src/Shared.sol","1":"src/ZRestricted.sol"},"language":"Solidity","_format":"ethers-rs-sol-build-info-1","input":{"version":"0.8.28","language":"Solidity","sources":{"src/Shared.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity 0.8.28;\nlibrary Shared { function value(uint256 _x) internal pure returns (uint256) { return _x; } }\n"},"src/ZRestricted.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity 0.8.28;\nimport {Shared} from \"./Shared.sol\";\ncontract ZRestricted { function z(uint256 _x) external pure returns (uint256) { return Shared.value(_x); } }\n"}},"settings":{"optimizer":{"enabled":true,"runs":50},"metadata":{"useLiteralContent":false,"bytecodeHash":"ipfs","appendCBOR":true},"outputSelection":{"src/Shared.sol":{"*":["abi"]},"src/ZRestricted.sol":{"*":["abi"]}},"evmVersion":"prague","viaIR":false,"libraries":{}},"allowPaths":["/var/mint-workspace/.ci/selector-multi-oracle/project","/var/mint-workspace/.ci/selector-multi-oracle/project/lib"],"basePath":"/var/mint-workspace/.ci/selector-multi-oracle/project","includePaths":["/var/mint-workspace/.ci/selector-multi-oracle/project"]},"output":{"contracts":{"src/Shared.sol":{"Shared":{"abi":[],"userdoc":{},"devdoc":{}}},"src/ZRestricted.sol":{"ZRestricted":{"abi":[{"type":"function","name":"z","inputs":[{"name":"_x","type":"uint256","internalType":"uint256"}],"outputs":[{"name":"","type":"uint256","internalType":"uint256"}],"stateMutability":"pure"}],"userdoc":{},"devdoc":{}}}},"sources":{"src/Shared.sol":{"id":0,"ast":{}},"src/ZRestricted.sol":{"id":1,"ast":{}}}},"solcLongVersion":"0.8.28","solcVersion":"0.8.28"} \ No newline at end of file diff --git a/ops/ci/migration/tests/fixtures/selector-upload/multi-profile-oracle/project/src/AUnrestricted.sol b/ops/ci/migration/tests/fixtures/selector-upload/multi-profile-oracle/project/src/AUnrestricted.sol new file mode 100644 index 00000000000..6617e4e2ed2 --- /dev/null +++ b/ops/ci/migration/tests/fixtures/selector-upload/multi-profile-oracle/project/src/AUnrestricted.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.28; +import {Shared} from "./Shared.sol"; +contract AUnrestricted { function a(uint256 _x) external pure returns (uint256) { return Shared.value(_x); } } diff --git a/ops/ci/migration/tests/fixtures/selector-upload/multi-profile-oracle/project/src/Shared.sol b/ops/ci/migration/tests/fixtures/selector-upload/multi-profile-oracle/project/src/Shared.sol new file mode 100644 index 00000000000..26c6212b4b4 --- /dev/null +++ b/ops/ci/migration/tests/fixtures/selector-upload/multi-profile-oracle/project/src/Shared.sol @@ -0,0 +1,3 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.28; +library Shared { function value(uint256 _x) internal pure returns (uint256) { return _x; } } diff --git a/ops/ci/migration/tests/fixtures/selector-upload/multi-profile-oracle/project/src/ZRestricted.sol b/ops/ci/migration/tests/fixtures/selector-upload/multi-profile-oracle/project/src/ZRestricted.sol new file mode 100644 index 00000000000..d24bda0dc57 --- /dev/null +++ b/ops/ci/migration/tests/fixtures/selector-upload/multi-profile-oracle/project/src/ZRestricted.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.28; +import {Shared} from "./Shared.sol"; +contract ZRestricted { function z(uint256 _x) external pure returns (uint256) { return Shared.value(_x); } } diff --git a/ops/ci/migration/tests/fixtures/selector-upload/provenance.json b/ops/ci/migration/tests/fixtures/selector-upload/provenance.json new file mode 100644 index 00000000000..a11cab2dd8d --- /dev/null +++ b/ops/ci/migration/tests/fixtures/selector-upload/provenance.json @@ -0,0 +1,18 @@ +{ + "abi_oracle": { + "description": "Complete original minimal Forge 1.8.3 ABI oracle; empty library and tuple parameter", + "run_id": "af521751ca5643eab506a89bbce9b8d7", + "task_id": "39a2f5d74fa95fc4a8d5b1e43bf9b2a2" + }, + "coverage_added": 0, + "live_import": { + "description": "Unmodified Forge and real pinned Sourcify/PostgreSQL, isolated network; first, duplicate, denied writes", + "run_id": "72186e2fec614a798acb65a0f53f079e", + "task_id": "d90d05696fd000b27f67707eca629245" + }, + "multi_profile_oracle": { + "description": "Complete original Forge 1.8.3 two-job ABI compilation, shared source with different job-local IDs", + "run_id": "af521751ca5643eab506a89bbce9b8d7", + "task_id": "a879768cf143528b3d8a96485904f211" + } +} diff --git a/ops/ci/migration/tests/fixtures/selector-upload/provider-isolation/circleci/execution.json b/ops/ci/migration/tests/fixtures/selector-upload/provider-isolation/circleci/execution.json new file mode 100644 index 00000000000..c0458a2aa1a --- /dev/null +++ b/ops/ci/migration/tests/fixtures/selector-upload/provider-isolation/circleci/execution.json @@ -0,0 +1,14 @@ +{ + "argv": [ + "just", + "update-selectors" + ], + "cwd": "/home/circleci/project/packages/contracts-bedrock", + "elapsed_seconds": 1.2162649631500244, + "exit_code": 0, + "signals": [], + "started_at": 1791204201.50156, + "stderr_sha256": "58dc85172e1b99bb2fe1843e7b0043e0536ab0a88651a3cf003ca9c04a6f767c", + "stdout_sha256": "e9b4964f339806af6d91529bbc4408d0ec5bda10c97f6808db70274c112af483", + "timed_out": false +} diff --git a/ops/ci/migration/tests/fixtures/selector-upload/provider-isolation/circleci/isolation.json b/ops/ci/migration/tests/fixtures/selector-upload/provider-isolation/circleci/isolation.json new file mode 100644 index 00000000000..a29d7ec0dc3 --- /dev/null +++ b/ops/ci/migration/tests/fixtures/selector-upload/provider-isolation/circleci/isolation.json @@ -0,0 +1,27 @@ +{ + "destination": "https://api.4byte.sourcify.dev/signature-database/v1/import", + "external_blocked": [ + { + "address": "1.1.1.1", + "errno": 101 + }, + { + "address": "2606:4700:4700::1111", + "errno": 101 + } + ], + "gid": 1002, + "hosts_sha256": "e741ad2b57f70e68b4adea9610f9e4b8cf24b14683207f5b27fdd558cb945072", + "interfaces": [ + [ + 1, + "lo" + ] + ], + "mount_namespace": "mnt:[4026532711]", + "network_namespace": "net:[4026532642]", + "no_new_privileges": true, + "pid": 1, + "trust_sha256": "d77c7caabf3b1b2328950861b46423b2e85886a5d0e0bd497a4f69cc5ab35342", + "uid": 1001 +} diff --git a/ops/ci/migration/tests/fixtures/selector-upload/provider-isolation/circleci/provenance.json b/ops/ci/migration/tests/fixtures/selector-upload/provider-isolation/circleci/provenance.json new file mode 100644 index 00000000000..1266fa28f84 --- /dev/null +++ b/ops/ci/migration/tests/fixtures/selector-upload/provider-isolation/circleci/provenance.json @@ -0,0 +1,7 @@ +{ + "circle_job": 5637520, + "coverage_added": 0, + "native_run_id": null, + "provider": "circleci", + "source_sha": "e3fab86e0d63e00b76173c704ae61d5dc316848e" +} diff --git a/ops/ci/migration/tests/fixtures/selector-upload/provider-isolation/circleci/stderr.log b/ops/ci/migration/tests/fixtures/selector-upload/provider-isolation/circleci/stderr.log new file mode 100644 index 00000000000..29f1ee38adc --- /dev/null +++ b/ops/ci/migration/tests/fixtures/selector-upload/provider-isolation/circleci/stderr.log @@ -0,0 +1,168 @@ +forge selectors up --all +Uploading selectors for DataAvailabilityChallenge... +Uploading selectors for DataAvailabilityChallenge... +Uploading selectors for ETHLockbox... +Uploading selectors for L1CrossDomainMessenger... +Uploading selectors for L1ERC721Bridge... +Uploading selectors for L1StandardBridge... +Uploading selectors for OPContractsManagerStandardValidator... +Uploading selectors for OptimismPortal2... +Uploading selectors for ResourceMetering... +Uploading selectors for ResourceMetering... +Uploading selectors for SuperchainConfig... +Uploading selectors for SystemConfig... +Uploading selectors for OPContractsManagerContainer... +Uploading selectors for OPContractsManagerMigrationValidator... +Uploading selectors for OPContractsManagerMigrator... +Uploading selectors for OPContractsManagerUtils... +Uploading selectors for OPContractsManagerUtilsCaller... +Uploading selectors for OPContractsManagerUtilsCaller... +Uploading selectors for OPContractsManagerV2... +Uploading selectors for StandardValidatorUtils... +Uploading selectors for StandardValidatorUtils... +Uploading selectors for StandardValidatorUtils... +Uploading selectors for BaseFeeVault... +Uploading selectors for ConditionalDeployer... +Uploading selectors for ConditionalDeployer... +Uploading selectors for CrossDomainOwnable... +Uploading selectors for CrossDomainOwnable... +Uploading selectors for CrossDomainOwnable2... +Uploading selectors for CrossDomainOwnable2... +Uploading selectors for CrossDomainOwnable3... +Uploading selectors for CrossDomainOwnable3... +Uploading selectors for CrossL2Inbox... +Uploading selectors for ETHLiquidity... +Uploading selectors for FeeVault... +Uploading selectors for GasPriceOracle... +Uploading selectors for L1Block... +Uploading selectors for L1BlockCGT... +Uploading selectors for L1FeeVault... +Uploading selectors for L2ContractsManager... +Uploading selectors for L2CrossDomainMessenger... +Uploading selectors for L2DevFeatureFlags... +Uploading selectors for L2DevFeatureFlags... +Uploading selectors for L2ERC721Bridge... +Uploading selectors for L2ProxyAdmin... +Uploading selectors for L2ProxyAdmin... +Uploading selectors for L2StandardBridge... +Uploading selectors for L2ToL1MessagePasser... +Uploading selectors for L2ToL1MessagePasserCGT... +Uploading selectors for L2ToL2CrossDomainMessenger... +Uploading selectors for LiquidityController... +Uploading selectors for LiquidityController... +Uploading selectors for NativeAssetLiquidity... +Uploading selectors for NativeAssetLiquidity... +Uploading selectors for OperatorFeeVault... +Uploading selectors for OptimismMintableERC721... +Uploading selectors for OptimismMintableERC721... +Uploading selectors for OptimismMintableERC721Factory... +Uploading selectors for OptimismMintableERC721FactoryLegacyMapping... +Uploading selectors for SequencerFeeVault... +Uploading selectors for SuperchainETHBridge... +Uploading selectors for WETH... +Uploading selectors for MIPS64... +Uploading selectors for PreimageOracle... +Uploading selectors for MIPS64Instructions... +Uploading selectors for MIPS64Instructions... +Uploading selectors for AnchorStateRegistry... +Uploading selectors for DelayedWETH... +Uploading selectors for DisputeGameFactory... +Uploading selectors for FaultDisputeGame... +Uploading selectors for PermissionedDisputeGame... +Uploading selectors for SuperFaultDisputeGame... +Uploading selectors for SuperPermissionedDisputeGame... +Uploading selectors for LibGameArgs... +Uploading selectors for LibGameArgs... +Uploading selectors for LibGameArgs... +Uploading selectors for LibGameArgs... +Uploading selectors for SP1PlonkAdapter... +Uploading selectors for ZKDisputeGame... +Uploading selectors for ZKDisputeGame... +Uploading selectors for GovernanceToken... +Uploading selectors for MintManager... +Uploading selectors for EventLogger... +Uploading selectors for EventLogger... +Uploading selectors for GameHelper... +Uploading selectors for AddressManager... +Uploading selectors for DeployerWhitelist... +Uploading selectors for L1BlockNumber... +Uploading selectors for L1ChugSplashProxy... +Uploading selectors for LegacyMessagePasser... +Uploading selectors for LegacyMintableERC20... +Uploading selectors for LegacyMintableERC20... +Uploading selectors for Blueprint... +Uploading selectors for Blueprint... +Uploading selectors for Blueprint... +Uploading selectors for Blueprint... +Uploading selectors for DevFeatures... +Uploading selectors for DevFeatures... +Uploading selectors for DevFeatures... +Uploading selectors for DevFeatures... +Uploading selectors for DevFeatures... +Uploading selectors for DevFeatures... +Uploading selectors for Encoding... +Uploading selectors for Encoding... +Uploading selectors for Encoding... +Uploading selectors for Encoding... +Uploading selectors for IGasToken... +Uploading selectors for IGasToken... +Uploading selectors for L2ContractsManagerUtils... +Uploading selectors for L2ContractsManagerUtils... +Uploading selectors for SemverComp... +Uploading selectors for SemverComp... +Uploading selectors for SemverComp... +Uploading selectors for TransientReentrancyAware... +Uploading selectors for TransientReentrancyAware... +Uploading selectors for AssetReceiver... +Uploading selectors for AssetReceiver... +Uploading selectors for Transactor... +Uploading selectors for Transactor... +Uploading selectors for TransferOnion... +Uploading selectors for Drippie... +Uploading selectors for IDripCheck... +Uploading selectors for IDripCheck... +Uploading selectors for CheckBalanceLow... +Uploading selectors for CheckSecrets... +Uploading selectors for CheckTrue... +Uploading selectors for Faucet... +Uploading selectors for AdminFaucetAuthModule... +Uploading selectors for IFaucetAuthModule... +Uploading selectors for DisputeMonitorHelper... +Uploading selectors for DisputeMonitorHelper... +Uploading selectors for PolicyEngineStaking... +Uploading selectors for PolicyEngineStakingMapping... +Uploading selectors for DeputyPauseModule... +Uploading selectors for LivenessGuard... +Uploading selectors for LivenessModule... +Uploading selectors for LivenessModule2... +Uploading selectors for SaferSafes... +Uploading selectors for TimelockGuard... +Uploading selectors for CrossDomainMessenger... +Uploading selectors for ERC721Bridge... +Uploading selectors for OptimismMintableERC20... +Uploading selectors for OptimismMintableERC20... +Uploading selectors for OptimismMintableERC20Factory... +Uploading selectors for OptimismMintableERC20Factory... +Uploading selectors for Proxy... +Uploading selectors for Proxy... +Uploading selectors for ProxyAdmin... +Uploading selectors for ProxyAdmin... +Uploading selectors for ProxyAdminOwnedBase... +Uploading selectors for ProxyAdminOwnedBase... +Uploading selectors for ProxyAdminOwnedBase... +Uploading selectors for ProxyAdminOwnedBase... +Uploading selectors for ReinitializableBase... +Uploading selectors for ReinitializableBase... +Uploading selectors for StandardBridge... +Uploading selectors for StandardBridge... +Uploading selectors for StorageSetter... +Uploading selectors for WETH98... +Uploading selectors for EAS... +Uploading selectors for IEAS... +Uploading selectors for IEAS... +Uploading selectors for ISchemaRegistry... +Uploading selectors for ISchemaRegistry... +Uploading selectors for SchemaRegistry... +Uploading selectors for EIP1271Verifier... +Uploading selectors for ISchemaResolver... +Uploading selectors for ISchemaResolver... diff --git a/ops/ci/migration/tests/fixtures/selector-upload/provider-isolation/circleci/stdout.log b/ops/ci/migration/tests/fixtures/selector-upload/provider-isolation/circleci/stdout.log new file mode 100644 index 00000000000..8b353126b80 --- /dev/null +++ b/ops/ci/migration/tests/fixtures/selector-upload/provider-isolation/circleci/stdout.log @@ -0,0 +1,1122 @@ +No files changed, compilation skipped +Imported: Function withdrawERC20(address,address): 0x9456fbcc +Imported: Function sentMessages(uint256): 0xbc294d7d +Imported: Function multiAttest((bytes32,(address,uint64,bool,bytes32,bytes,uint256)[])[]): 0x44adc90e +Imported: Function overhead(): 0x0c18c162 +Imported: Function setBytes32((bytes32,bytes32)[]): 0x0528afe2 +Imported: Function getAttestTypeHash(): 0x12b11a17 +Imported: Function OPContractsManagerMigrator_ChainIdsNotAscending(): 0xe5665c6c +Imported: Function LivenessModule2_ModuleNotConfigured(): 0xa0fe939b +Imported: Function preimageOracleVersion(): 0xad7e7e40 +Imported: Function oracle(): 0x7dc0d1d0 +Imported: Function finalizeBridgeERC20(address,address,address,address,uint256,bytes): 0x0166a07a +Imported: Function AnchorStateRegistry_Unauthorized(): 0x2e5321ac +Imported: Function supportsInterface(bytes4): 0x01ffc9a7 +Imported: Function getName(): 0x17d7de7c +Imported: Function delayedWETH(): 0x215b7a1c +Imported: Function setAllowedStaker(address,bool): 0x504c1183 +Imported: Function attack(bytes32,uint256,bytes32): 0x472777c6 +Imported: Function ProxyAdminOwnedBase_NotProxyAdmin(): 0xe818dcc3 +Imported: Function upgrade(address,address,address,bytes,bytes32,uint8): 0x9d3f3edb +Imported: Function normalModeCredit(address): 0x529d6a8c +Imported: Function LivenessModule2_InvalidFallbackOwner(): 0x552dd1b7 +Imported: Function ConditionalDeployer_DeploymentFailed(bytes): 0xcb0fc6f7 +Imported: Function increaseNonce(uint256): 0x79f7573a +Imported: Function readPreimage(bytes32,uint256): 0xe03110e1 +Imported: Function chainIdToBatchInboxAddress(uint256): 0x318b1b80 +Imported: Function contractsContainer(): 0x5a4dab33 +Imported: Function OPContractsManagerUtils_UnsupportedGameType(): 0xddf137d0 +Imported: Function PolicyEngineStaking_InsufficientStake(): 0x5b2fce93 +Imported: Function minimumGasLimit(): 0x4add321d +Imported: Function InvalidBondDistributionMode(): 0x078a3df4 +Imported: Function getChallengeStatus(uint256,bytes): 0x79e8a8b3 +Imported: Function OptimismPortal_ZeroAddress(): 0x70fba0c5 +Imported: Function getTreeRootLPP(address,uint256): 0x0359a563 +Imported: Function isFjord(): 0x960e3a23 +Imported: Function allowlist(address,address): 0xd98c07b7 +Imported: Function implementations(): 0x30e9012c +Imported: Function optimismPortalImpl(): 0xa38d5595 +Imported: Function getL1GasUsed(bytes): 0xde26c4a1 +Imported: Function deauthorizeMinter(address): 0xc6f69fbb +Imported: Function proposals(uint256): 0x013cf08b +Imported: Function closeGame(): 0x786b844b +Imported: Function authorizedLockboxes(address): 0x225ce176 +Imported: Function EmptyInitcode(): 0x028512d4 +Imported: Function resolveClaim(uint256,uint256): 0x03c2924d +Imported: Function ownerOf(uint256): 0x6352211e +Imported: Function getBool(bytes32): 0x7ae1cfca +Imported: Function checkpoints(address,uint32): 0xf1127ed8 +Imported: Function getBytes32(bytes32): 0xa6ed563e +Imported: Function getDripInterval(string): 0x90547c14 +Imported: Function OPContractsManagerMigrator_InvalidAbsolutePrestate(): 0x0eae0411 +Imported: Function hold(address): 0xa7e21e80 +Imported: Function challenge(address): 0x72fb9703 +Imported: Function ETHLockbox_NoWithdrawalTransactions(): 0xd6cbd5f9 +Imported: Function validateMessage((address,uint256,uint256,uint256,uint256),bytes32): 0xab4d6f75 +Imported: Function showLiveness(): 0x4c205d0d +Imported: Function setMinBaseFee(uint64): 0x7616f0e8 +Imported: Function getRevokeOffchain(address,bytes32): 0xb469318d +Imported: Function makeGameArgs(uint256,address,address,(bool,uint256,uint32,bytes)): 0x8e4a6ec7 +Imported: Function setOperatorFeeScalars(uint32,uint64): 0x155b6c6f +Imported: Function OPContractsManagerV2_InvalidUpgradeInstruction(string): 0x09f71494 +Imported: Function shell(): 0xf11d2ff4 +Imported: Function isPermittedMigrateSequence(address): 0x257f19d2 +Imported: Function withdraw(): 0x3ccfd60b +Imported: Function bridgeERC721(address,address,uint256,uint32,bytes): 0x3687011a +Imported: Function getL1Fee(bytes): 0x49948e0e +Imported: Function pause(bytes32,address,bytes): 0x142b53c9 +Imported: Function TimelockGuard_GuardNotEnabled(): 0x3f4b2966 +Imported: Function TimelockGuard_TransactionAlreadyScheduled(): 0x80394de6 +Imported: Function pausable(address): 0x32dfadd9 +Imported: Function Encoding_InvalidSuperRootEncoding(): 0xb11ecfc0 +Imported: Function remoteChainId(): 0xe9518196 +Imported: Function setAddress(bytes32,address): 0xca446dd9 +Imported: Function anchorStateRegistry(): 0x5c0cba33 +Imported: Function getTimestamp(bytes32): 0xd45c4435 +Imported: Function OptimismPortal_InvalidRootClaim(): 0x332a57f8 +Imported: Function maximumGasLimit(): 0x0ae14b1b +Imported: Function MIN_WITHDRAWAL_AMOUNT(): 0xd3e5792b +Imported: Function validateMigratedChain((address,address[],(address,address,address,address)[],(address,address,address),(uint32,uint256)[],(bytes32,uint256),uint32,bytes32,address),bool): 0x3b16016e +Imported: Function move(bytes32,uint256,bytes32,bool): 0x6f034409 +Imported: Function respectedGameTypeUpdatedAt(): 0x4fd0434c +Imported: Function revealedSecrets(bytes32): 0x246167bc +Imported: Function permit(address,address,uint256,uint256,uint8,bytes32,bytes32): 0xd505accf +Imported: Function governanceToken(): 0xf96dae0a +Imported: Function respectedGameType(): 0x3c9f397c +Imported: Function OPContractsManagerUtils_ProxyMustLoad(string): 0x391074c9 +Imported: Function PolicyEngineStaking_NoStake(): 0x7739be10 +Imported: Function attest((bytes32,bytes32,uint64,uint64,uint64,bytes32,address,address,bool,bytes)): 0xe60c3505 +Imported: Function maxCancellationThreshold(address): 0xc9713656 +Imported: Function OwnableUnauthorizedAccount(address): 0x118cdaa7 +Imported: Function unpause(): 0x3f4ba83a +Imported: Function clearLivenessModule(): 0x6092b318 +Imported: Function deploy(((address),(address),(address),(address),(address,uint256),(address,uint256,uint8),(address,uint256,uint8),(address,uint256,uint8),(address,uint256,uint8),(address,string,string),bool,bool)): 0x9300a1ab +Imported: Function loadKeccak256PreimagePart(uint256,bytes): 0xe1592611 +Imported: Function MIN_GAS_CALLDATA_OVERHEAD(): 0x028f85f7 +Imported: Function InsufficientBond(): 0xe92c469f +Imported: Function unlockBond(uint256,bytes): 0x93988233 +Imported: Function ProxyAdminOwnedBase_NotProxyAdminOrProxyAdminOwner(): 0xc4050a26 +Imported: Function ChallengeExists(): 0x9bb6c64e +Imported: Function InvalidGameArgsLength(): 0xbff6e416 +Imported: Function L1_STANDARD_BRIDGE_SLOT(): 0xf8c68de0 +Imported: Function loadSha256PreimagePart(uint256,bytes): 0x8dc4be11 +Imported: Function resolutionCheckpoints(uint256): 0xa445ece6 +Imported: Function passMessageToL1(bytes): 0xcafa81dc +Imported: Function status(string,uint8): 0x9bc94d01 +Imported: Function search(address,uint256,uint8): 0xcb4e6ab1 +Imported: Function AlreadyInitialized(): 0x0dc149f0 +Imported: Function register(string,address,bool): 0x60d7a278 +Imported: Function UNSAFE_BLOCK_SIGNER_SLOT(): 0x4f16540b +Imported: Function L2ProxyAdmin__L2ContractsManagerNotDeployed(address): 0xe1e56d9d +Imported: Function isGameClaimValid(address): 0x6c4f4467 +Imported: Function assertValidNonSuperRootDisputeGames(string,address): 0x50812ec3 +Imported: Function checkWithdrawal(bytes32,address): 0x71c1566e +Imported: Function NativeAssetLiquidity_Unauthorized(): 0x565369fa +Imported: Function l1CrossDomainMessengerImpl(): 0x58256afb +Imported: Function ETHLockbox_InsufficientBalance(): 0xe1ba9227 +Imported: Function l1PAOMultisig(): 0xa4dec37a +Imported: Function ClaimAboveSplit(): 0xb34b5c22 +Imported: Function BytesArrayTooLong(): 0x5623dc1c +Imported: Function thresholdPercentage(): 0x4ed2859e +Imported: Function acceptOwnership(): 0x79ba5097 +Imported: Function MessageDestinationNotRelayChain(): 0x31ac2211 +Imported: Function loadBytes(address,bytes4,string,(string,bytes)[]): 0x1deed3ca +Imported: Function ADMIN(): 0x2a0acc6a +Imported: Function InvalidPC(): 0x3f8200bc +Imported: Function optimismPortal(): 0x0a49cb03 +Imported: Function deployments(address): 0x316b3739 +Imported: Function OptimismPortal_NotAllowedOnCGTMode(): 0xbd58e0a2 +Imported: Function l2TokenBridge(): 0x91c49bf8 +Imported: Function finalizeWithdrawalTransaction((uint256,address,address,uint256,uint256,bytes)): 0x8c3152e9 +Imported: Function setFjord(): 0x8e98b106 +Imported: Function setUint(bytes32,uint256): 0xe2a4853a +Imported: Function initialize(): 0x8129fc1c +Imported: Function deploy(bytes32,bytes): 0xcdcb760a +Imported: Function rootClaimByChainId(uint256): 0x5e234947 +Imported: Function isCustomGasToken(): 0x21326849 +Imported: Function relayMessage((address,uint256,uint256,uint256,uint256),bytes): 0x8d1d298f +Imported: Function upgrade(): 0xd55ec697 +Imported: Function UnknownChainId(): 0x0da789df +Imported: Function baseGas(bytes,uint32): 0xb28ade25 +Imported: Function getAddress(bytes32): 0x21f8a721 +Imported: Function toRpcHexString(uint256): 0x3e7d7733 +Imported: Function getApproved(uint256): 0x081812fc +Imported: Function L2ProxyAdmin__UpgradeFailed(bytes): 0x1c0a89cc +Imported: Function getAddress(string): 0xbf40fac1 +Imported: Function sendMessage(address,bytes,uint32): 0x3dbb202b +Imported: Function l1Token(): 0xc01e1bd6 +Imported: Function standardValidatorUtils(): 0x1094bfad +Imported: Function LivenessModule2_UnauthorizedCaller(): 0xa1f20820 +Imported: Function DeputyPauseModule_NonceAlreadyUsed(): 0x73134565 +Imported: Function InvalidRevocation(): 0xccf3bb27 +Imported: Function Encoding_EmptySuperRoot(): 0x9103e7cd +Imported: Function withdraw(address,uint256): 0xf3fef3a3 +Imported: Function ProxyAdminOwnedBase_ProxyAdminNotFound(): 0x332144db +Imported: Function transferOwnership(address,bool): 0xb242e534 +Imported: Function isGameRegistered(address,address): 0xc376d31f +Imported: Function setUpgrading(bool): 0x07c8f7b0 +Imported: Function withdrawERC20(address,address,uint256): 0x44004cc1 +Imported: Function isPermittedUpgradeSequence(address,address): 0x814258d1 +Imported: Function SENDER(): 0x6050f2f8 +Imported: Function lastUsedOPCM(): 0x8ed95502 +Imported: Function OPContractsManagerMigrator_DisputeGameNotEnabled(): 0xf666433c +Imported: Function proposalBlocks(address,uint256,uint256): 0x882856ef +Imported: Function initialize(address,address,address): 0xc0c53b8b +Imported: Function step(bytes,bytes,bytes32): 0xe14ced32 +Imported: Function gameOver(): 0xbdb337d1 +Imported: Function setImplementation(uint32,address): 0x14f6b1a3 +Imported: Function portal(): 0x6425666b +Imported: Function OPContractsManagerV2_InvalidUpgradeSequence(string,string): 0x9193f97a +Imported: Function safeTransferFrom(address,address,uint256,bytes): 0xb88d4fde +Imported: Function verify((address,bytes,bytes32,uint32),bytes32,bytes): 0xd855814f +Imported: Function InvalidParent(): 0x5f53dd98 +Imported: Function isJovian(): 0x105d0b81 +Imported: Function performMoves(address,(uint256,bytes32,bool)[]): 0xf25792cd +Imported: Function setInitBond(uint32,uint256): 0x1e334240 +Imported: Function getChallengerDuration(uint256): 0xbd8da956 +Imported: Function proposalBranches(address,uint256,uint256): 0xb4801e61 +Imported: Function validateMigratedChainWithOverrides((address,address[],(address,address,address,address)[],(address,address,address),(uint32,uint256)[],(bytes32,uint256),uint32,bytes32,address),bool,(address,address)): 0x495dfd3f +Imported: Function NotInitialized(): 0x87138d5c +Imported: Function createOptimismMintableERC20(address,string,string): 0xce5ac90f +Imported: Function OPContractsManagerV2_OnlyDelegateCall(): 0xccafc377 +Imported: Function OptimismPortal_InvalidProofTimestamp(): 0xb4caa4e5 +Imported: Function enableArbitraryContractDeployment(): 0xbdc7b54f +Imported: Function getGameImpl(uint32): 0xd457c3e0 +Imported: Function unpause(address): 0x57b001f9 +Imported: Function l2SequenceNumber(): 0x99735e32 +Imported: Function multiTimestamp(bytes32[]): 0xe71ff365 +Imported: Function NoImplementation(uint32): 0x031c6de4 +Imported: Function OPTIMISM_PORTAL_INTEROP(): 0x98e15962 +Imported: Function blobBaseFeeScalar(): 0x68d5dca6 +Imported: Function resolve(uint256,bytes,bytes): 0x7ae929d9 +Imported: Function InvalidExitedValue(): 0x0136cc76 +Imported: Function initialize(address,string,string): 0x90657147 +Imported: Function l1StandardBridge(): 0x078f29cf +Imported: Function getProxyAdmin(address): 0xf3b7dead +Imported: Function initialize(address,address): 0x485cc955 +Imported: Function calculateChecksum((address,uint256,uint256,uint256,uint256),bytes32): 0x331b637f +Imported: Function PRECOMPILE_CALL_RESERVED_GAS(): 0xb5e7154c +Imported: Function MINT_PERIOD(): 0x83ea6e97 +Imported: Function InvalidCommitmentLength(uint8,uint256,uint256): 0xfd9a7e5b +Imported: Function l2BlockNumberChallenger(): 0x30dbe570 +Imported: Function EmptyItem(): 0x5ab458fb +Imported: Function isModuleEnabled(address): 0x2d9ad53d +Imported: Function isPermittedUpgradeSequence(address): 0xe7f75229 +Imported: Function fund(): 0xb60d4288 +Imported: Function renounceOwnership(): 0x715018a6 +Imported: Function safeTransferFrom(address,address,uint256): 0x42842e0e +Imported: Function InvalidProof(): 0x09bde339 +Imported: Function implementation(): 0x5c60da1b +Imported: Function getL1FeeUpperBound(uint256): 0xf1c7a58b +Imported: Function SemverComp_InvalidSemverParts(): 0x9eda858c +Imported: Function scheduledTransaction(address,bytes32): 0x12492d97 +Imported: Function OPContractsManagerMigrator_InvalidGameType(): 0xaa32d8b5 +Imported: Function whitelist(address): 0x9b19251a +Imported: Function respond(): 0xdb16aab9 +Imported: Function proposalCount(): 0xda35c664 +Imported: Function AlreadyFinalized(): 0x475a2535 +Imported: Function LivenessModule2_ResponsePeriodActive(): 0x279e3d24 +Imported: Function messageNonce(): 0xecc70428 +Imported: Function operatorFeeScalar(): 0x4d5d9a2a +Imported: Function gameData(): 0xfa24f743 +Imported: Function timestamp(): 0xb80777ea +Imported: Function deputy(): 0xf1c9eed7 +Imported: Function resolverRefundPercentage(): 0x8ecb85e1 +Imported: Function InvalidAttestation(): 0xbd8ba84d +Imported: Function symbol(): 0x95d89b41 +Imported: Function getChallengePeriodEnd(address): 0xe10ffc92 +Imported: Function UnknownCommitmentType(uint8): 0x81ff0713 +Imported: Function numCheckpoints(address): 0x6fcfff45 +Imported: Function created(uint256): 0x82cb6b72 +Imported: Function lastLive(address): 0xe458779b +Imported: Function baseFeeScalar(): 0xc5985918 +Imported: Function squeezeLPP(address,uint256,(uint64[25]),(bytes,uint256,bytes32),bytes32[],(bytes,uint256,bytes32),bytes32[]): 0xd18534b5 +Imported: Function assertValidSuperRootDisputeGames(string,address): 0x14555f43 +Imported: Function changeAdmin(address): 0x8f283970 +Imported: Function L2ContractsManager_InvalidV5Offset(): 0x10415a29 +Imported: Function crossDomainMessageContext(): 0x7936cbee +Imported: Function startingSequenceNumber(): 0x59cebe09 +Imported: Function pendingOwner(): 0xe30c3978 +Imported: Function withdraw(address,uint256,uint32,bytes): 0x32b7006d +Imported: Function InvalidProposalStatus(): 0x7492a269 +Imported: Function resolve(): 0x2810e1d6 +Imported: Function ETHLockbox_Unauthorized(): 0x665a1d1c +Imported: Function hold(address,uint256): 0x977a5ec5 +Imported: Function nonces(address): 0x7ecebe00 +Imported: Function setCode(bytes): 0x6c5d4ad0 +Imported: Function lockETH(): 0x1ee116bf +Imported: Function LivenessModule2_OwnershipTransferFailed(): 0xe330ac05 +Imported: Function isGameRegistered(address): 0xee658e45 +Imported: Function stakingToken(): 0x72f702f3 +Imported: Function PE_DATA_SLOT(): 0xb3999a47 +Imported: Function finalizeBridgeETH(address,address,uint256,bytes): 0x1635f5fd +Imported: Function gameArgs(uint32): 0x74cc86ac +Imported: Function modules(address): 0xa8ee49fe +Imported: Function nonces(bytes32,bytes32): 0x1d5d26bc +Imported: Function EventPayloadNotSentMessage(): 0xdf1eb586 +Imported: Function PolicyEngineStaking_SelfAllowlist(): 0xe541fb4a +Imported: Function computeSalt(uint256,string,string): 0x3bec67a0 +Imported: Function getStartingAnchorRoot(): 0x664ed830 +Imported: Function initialize(address,address,(bytes32,uint256),uint32): 0x47a222c5 +Imported: Function gameAtIndex(uint256): 0xbb8aa1fc +Imported: Function stake(uint128,address): 0xb166dfdd +Imported: Function absolutePrestate(): 0x8d450a95 +Imported: Function SuperFaultDisputeGameInvalidRootClaim(): 0x2cfac082 +Imported: Function initialize(address,address[]): 0x946d9204 +Imported: Function successfulMessages(bytes32): 0xb1b1b209 +Imported: Function checkTransaction(address,uint256,bytes,uint8,uint256,uint256,uint256,address,address,bytes,address): 0x75f0bb52 +Imported: Function livenessSafeConfiguration(address): 0x47c03223 +Imported: Function hash(): 0x09bd5a60 +Imported: Function OPContractsManagerMigrator_CustomGasTokenNotSupported(): 0xfba76236 +Imported: Function OptimismPortal_ProofNotOldEnough(): 0xd9bc01be +Imported: Function StatesNotContiguous(): 0x9a3b1199 +Imported: Function withdrawERC721(address,address,uint256): 0x4025feb2 +Imported: Function opcmMigrator(): 0x01f36d45 +Imported: Function safeMint(address,uint256): 0xa1448194 +Imported: Function deploy((string,address,address,address,address,address,(bytes32,uint256),uint32,uint32,uint32,uint64,uint256,(uint32,uint8,uint8,uint32,uint32,uint128),(bool,uint256,uint32,bytes)[],bool)): 0xd576c5a0 +Imported: Function depositERC20(address,address,uint256,uint32,bytes): 0x58a997f6 +Imported: Function initVersion(): 0x38d38c97 +Imported: Function guardian(): 0x452a9320 +Imported: Function getAddresses(): 0xa39fac12 +Imported: Function OPContractsManagerMigrator_InvalidStartingRespectedGameType(): 0xe08e9618 +Imported: Function challengePeriod(): 0xf3f480d9 +Imported: Function MESSAGE_VERSION(): 0x3f827a5a +Imported: Function L1_CROSS_DOMAIN_MESSENGER_SLOT(): 0x5d73369c +Imported: Function drip((address,bytes,bytes32,uint32),(address,bytes32,bytes)): 0xb1510e43 +Imported: Function TimelockGuard_TransactionNotReady(): 0x503c42c4 +Imported: Function AccessDenied(): 0x4ca88867 +Imported: Function OPCM_SLOT(): 0x2efe2c63 +Imported: Function loadBlobPreimagePart(uint256,uint256,bytes,bytes,uint256): 0x9d7e8769 +Imported: Function setFeature(bytes32): 0x46a4d780 +Imported: Function validateMigration((address,address[],(address,address,address,address)[],(address,address,address),(uint32,uint256)[],(bytes32,uint256),uint32,bytes32,address),bool,(address,address,address,address,address,address,address,address),(address,uint256,address)): 0x3c3c3bcf +Imported: Function OwnerRemovalFailed(string): 0xe94e84e9 +Imported: Function l1Head(): 0x6361506d +Imported: Function ethLockboxImpl(): 0x7b491a98 +Imported: Function finalizedWithdrawals(bytes32): 0xa14238e7 +Imported: Function OPContractsManagerMigrator_ZKDisputeGameNotEnabled(): 0x8cc8cc34 +Imported: Function minWithdrawalAmount(): 0x8312f149 +Imported: Function proposalBlocksLen(address,uint256): 0x9d53a648 +Imported: Function retirementTimestamp(): 0x4086d183 +Imported: Function OPContractsManagerV2_ZeroGameImplementation(uint32): 0x7d46f581 +Imported: Function GameNotFinalized(): 0x4851bd9b +Imported: Function SaferSafes_InsufficientLivenessResponsePeriod(): 0x47dca1ce +Imported: Function ownershipTransferredToFallback(): 0x5b2e9c03 +Imported: Function InvalidOffset(): 0x01da1572 +Imported: Function sendETH(address,uint256): 0x64a197f3 +Imported: Function create(uint32,bytes32,bytes): 0x82ecf2f6 +Imported: Function sp1PlonkAdapterImpl(): 0x36862b0e +Imported: Function getL1BlockNumber(): 0xb9b3efe9 +Imported: Function gasLimit(): 0xf68016b7 +Imported: Function getAttestation(bytes32): 0xa3112a64 +Imported: Function isGameResolved(address): 0xfdbb3dcf +Imported: Function finalizeBridgeERC721(address,address,address,address,uint256,bytes): 0x761f4493 +Imported: Function ChallengeWindowNotOpen(): 0xf9e0d1f3 +Imported: Function validateMigrationWithOverrides((address,address[],(address,address,address,address)[],(address,address,address),(uint32,uint256)[],(bytes32,uint256),uint32,bytes32,address),bool,(address,address),(address,address,address,address,address,address,address,address),(address,uint256,address)): 0x2d3ba474 +Imported: Function version(): 0x54fd4d50 +Imported: Function blacklistDisputeGame(address): 0x7d6be8dc +Imported: Function createStandardL2Token(address,string,string): 0x896f93d1 +Imported: Function OptimismPortal_GasLimitTooLow(): 0x70c8bdbd +Imported: Function isGameFinalized(address): 0x0314d2b3 +Imported: Function InvalidInputSize(): 0x7b1dafd1 +Imported: Function setRespectedGameType(uint32): 0x7fc48504 +Imported: Function OptimismPortal_InvalidDisputeGame(): 0xe29927ed +Imported: Function burn(address,uint256): 0x9dc29fac +Imported: Function initialize(address,uint256,uint8): 0xb49dc741 +Imported: Function DisputeMonitorHelper_InvalidSearchRange(): 0xb22d5a5c +Imported: Function proposalMetadata(address,uint256): 0x6551927b +Imported: Function hasUnlockedCredit(address): 0x222abf45 +Imported: Function NoChainIdNeeded(): 0x223db394 +Imported: Function challengerBond(): 0x68ccdc86 +Imported: Function BlockNumberTooHigh(): 0xd1f79e82 +Imported: Function isPermittedMigrateSequence(address,address): 0x35b27eb2 +Imported: Function TimelockGuard_InvalidTimelockDelay(): 0xa0ce228b +Imported: Function TimelockGuard_InvalidVersion(): 0x9e2f7c4b +Imported: Function PERMIT2(): 0x6afdd850 +Imported: Function OptimismPortal_MigratingToSameRegistry(): 0x785df911 +Imported: Function SUPER_PERMISSIONED_ARGS_LENGTH(): 0x87637c5c +Imported: Function finalizeERC20Withdrawal(address,address,address,address,uint256,bytes): 0xa9f9e675 +Imported: Function L1Block_FeatureAlreadyEnabled(): 0x4f453260 +Imported: Function OPContractsManagerV2_SuperchainConfigNeedsUpgrade(): 0x3afa7308 +Imported: Function RELAY_RESERVED_GAS(): 0x8cbeeef2 +Imported: Function opcmV2(): 0x9106fd38 +Imported: Function name(): 0x06fdde03 +Imported: Function OPContractsManagerV2_InvalidUpgradeInput(): 0x9b506619 +Imported: Function l1BaseFee(): 0x519b4bd3 +Imported: Function withdrawals(address,address): 0xcd47bde1 +Imported: Function provenWithdrawals(bytes32,address): 0xbb2c727e +Imported: Function OptimismPortal_ImproperDisputeGame(): 0xf395240e +Imported: Function VERSION(): 0xffa1ad74 +Imported: Function getNumToResolve(uint256): 0x5a5fa2d9 +Imported: Function startingRootHash(): 0x25fc2ace +Imported: Function anchorGame(): 0xe0a840eb +Imported: Function setOwner(address): 0x13af4035 +Imported: Function setWithdrawalNetwork(uint8): 0x307f2962 +Imported: Function pauseExpiry(): 0xf125af6b +Imported: Function authorizePortal(address): 0xb2db82f5 +Imported: Function ReinitializableBase_ZeroInitVersion(): 0x9b01afed +Imported: Function expiration(address): 0x04dbe3fe +Imported: Function OPContractsManagerUtils_OZv5InitializableUnsupported(): 0xc372c509 +Imported: Function ReservedBitsSet(): 0xb214675a +Imported: Function assertValidOptimismPortal(string,address,address,address): 0x264c0e84 +Imported: Function setImplementationName(address,string): 0x860f7cda +Imported: Function UnexpectedRootClaim(bytes32): 0xf40239db +Imported: Function disputeGameBlacklist(address): 0x45884d32 +Imported: Function DOMAIN_SEPARATOR(): 0x3644e515 +Imported: Function basefeeScalar(): 0xbfb14fb7 +Imported: Function blobbasefeeScalar(): 0xec707517 +Imported: Function burn(): 0x44df8e70 +Imported: Function ZK_ARGS_LENGTH(): 0xeb10e1bb +Imported: Function clearTimelockGuard(): 0x5c3b4510 +Imported: Function OptimismPortal_CalldataTooLarge(): 0x5aa3bac9 +Imported: Function OPContractsManagerMigrator_SystemPaused(): 0x3a81b448 +Imported: Function OPContractsManagerUtils_ExtraTagInProd(address): 0xea91cf73 +Imported: Function L2ContractsManager_FeatureFlagMismatch(): 0xa27dcc88 +Imported: Function PolicyEngineStaking_ZeroAmount(): 0x2a47fdc8 +Imported: Function multiRevokeOffchain(bytes32[]): 0x13893f61 +Imported: Function failedMessages(bytes32): 0xa4e7f8bd +Imported: Function timeouts(address,bytes32): 0x38757bfd +Imported: Function l1CrossDomainMessenger(): 0xa7119869 +Imported: Function challenge(): 0xd2ef7398 +Imported: Function safe(): 0x186f0354 +Imported: Function livenessGuard(): 0xbe81c694 +Imported: Function totalProcessed(): 0x84411d65 +Imported: Function OPContractsManagerV2_InvalidEthLockbox(): 0xc9fc7147 +Imported: Function executable(string): 0xfc3e3eba +Imported: Function mint(uint256): 0xa0712d68 +Imported: Function OTHER_MESSENGER(): 0x9fce812c +Imported: Function stakingData(address): 0xeca51139 +Imported: Function optimismMintableERC20Factory(): 0x9b7d7f0a +Imported: Function l1FeeWallet(): 0xd4ff9218 +Imported: Function loadPrecompilePreimagePart(uint256,address,uint64,bytes): 0xea713950 +Imported: Function step(uint256,bool,bytes,bytes): 0xd8cc1a3c +Imported: Function multiAttestByDelegation((bytes32,(address,uint64,bool,bytes32,bytes,uint256)[],(uint8,bytes32,bytes32)[],address,uint64)[]): 0x95411525 +Imported: Function NotFound(): 0xc5723b51 +Imported: Function challengeRootL2Block((bytes32,bytes32,bytes32,bytes32),bytes): 0x01935130 +Imported: Function InvalidOutputRootProof(): 0x9cc00b5b +Imported: Function l1ERC721BridgeImpl(): 0x7d8bd0d8 +Imported: Function FLOOR_CALLDATA_OVERHEAD(): 0xe46e245a +Imported: Function loadLocalData(uint256,bytes32,bytes32,uint256,uint256): 0x52f0f3ad +Imported: Function L1_ERC_721_BRIDGE_SLOT(): 0x19f5cea8 +Imported: Function credit(address): 0xd5d44d80 +Imported: Function createdAt(): 0xcf09e0d0 +Imported: Function getRevokeTypeHash(): 0xb83010d3 +Imported: Function setBondSize(uint256): 0xd7d04e54 +Imported: Function Encoding_InvalidSuperRootVersion(): 0xc06b5238 +Imported: Function LivenessModule2_InvalidVersion(): 0xda21aed9 +Imported: Function burnFrom(address,uint256): 0x79cc6790 +Imported: Function unlock(address,uint256): 0x7eee288d +Imported: Function defend(bytes32,uint256,bytes32): 0x7b0f0adc +Imported: Function TimelockGuard_GuardStillEnabled(): 0xa4d234cb +Imported: Function authorizedPortals(address): 0x0fd11077 +Imported: Function setAnchorState(address): 0x17cf21a9 +Imported: Function faultDisputeGameImpl(): 0xdea21984 +Imported: Function assertValidAnchorStateRegistry(string,address,address,address,address,address,string): 0xc6a18c83 +Imported: Function getVotes(address): 0x9ab24eb0 +Imported: Function upgrade(address): 0x0900f010 +Imported: Function OptimismPortal_BadTarget(): 0xc5defbad +Imported: Function pause(): 0x8456cb59 +Imported: Function OutOfGas(): 0x77ebef4d +Imported: Function InvalidLength(): 0x947d5a84 +Imported: Function multiAttest((bytes32,bytes32,uint64,uint64,uint64,bytes32,address,address,bool,bytes)[],uint256[]): 0x91db0b7e +Imported: Function prove(bytes): 0x375bfa5d +Imported: Function scheduleTransaction(address,uint256,(address,uint256,bytes,uint8,uint256,uint256,uint256,address,address),bytes): 0x0e40beec +Imported: Function bridgeETHTo(address,uint32,bytes): 0xe11013dd +Imported: Function transferOwnership(address): 0xf2fde38b +Imported: Function setJovian(): 0xb3d72079 +Imported: Function games(uint32,bytes32,bytes): 0x5f0150cb +Imported: Function MIN_GAS_DYNAMIC_OVERHEAD_DENOMINATOR(): 0x0c568498 +Imported: Function OPContractsManagerUtils_ConfigLoadFailed(string): 0x2fa08019 +Imported: Function BadExtraData(): 0x9824bdab +Imported: Function livenessInterval(): 0x38af7c5c +Imported: Function challengeFirstLPP(address,uint256,(bytes,uint256,bytes32),bytes32[]): 0xec5efcbc +Imported: Function depositETH(uint32,bytes): 0xb1a1a882 +Imported: Function unstake(uint128): 0x458a1d6e +Imported: Function reveal(bytes): 0x72f12a5d +Imported: Function zeroHashes(uint256): 0x7ac54767 +Imported: Function upgradeAndCall(address,address,bytes): 0x9623609d +Imported: Function validate((address,bytes32,bytes32,uint256,address),bool): 0xf3edcbe1 +Imported: Function getOwner(): 0x893d20e8 +Imported: Function setAddressManager(address): 0x0652b57a +Imported: Function withdrawETH(address,uint256): 0x4782f779 +Imported: Function OTHER_BRIDGE(): 0x7f46ddb2 +Imported: Function proofSubmitters(bytes32,uint256): 0xa3860f48 +Imported: Function unsafeBlockSigner(): 0x1fd19ee1 +Imported: Function DEPLOY_V2_DISPUTE_GAMES(): 0xe3ffb8ea +Imported: Function deterministicDeploymentProxy(): 0xe0145f5c +Imported: Function GameDepthExceeded(): 0x56f57b2b +Imported: Function NoCreditToClaim(): 0x17bfe5f7 +Imported: Function IdentityPrecompileCallFailed(): 0xf7046f30 +Imported: Function CrossL2Inbox_NoExecutingDeposits(): 0xdc9f4daa +Imported: Function WithdrawalFailed(): 0x27fcd9d1 +Imported: Function RELAY_CONSTANT_OVERHEAD(): 0x83a74074 +Imported: Function OPContractsManagerV2_DuplicateUpgradeInstruction(string): 0xc28097b5 +Imported: Function MAX_LEAF_COUNT(): 0x4d52b4c9 +Imported: Function splitDepth(): 0xec5e6308 +Imported: Function OPContractsManagerMigrator_ZeroL2ChainId(): 0x0a3bb03c +Imported: Function initialize(address,uint32,uint32,bytes32,uint64,address,(uint32,uint8,uint8,uint32,uint32,uint128),(address,address,address,address,address,address,address),uint256,address): 0x4843108d +Imported: Function usedNonces(bytes32): 0xfeb61724 +Imported: Function guardianSafe(): 0x9d786a02 +Imported: Function isDevFeatureEnabled(bytes32): 0x78ecabce +Imported: Function batcherHash(): 0xe81b2c6d +Imported: Function OwnableInvalidOwner(address): 0x1e4fbdf7 +Imported: Function revokeByDelegation((bytes32,(bytes32,uint256),(uint8,bytes32,bytes32),address,uint64)): 0xa6d4dbc7 +Imported: Function isAttestationValid(bytes32): 0xe30bb563 +Imported: Function resolvedSubgames(uint256): 0xfe2bbeb2 +Imported: Function L2ContractsManager_ImplNotFound(string): 0x476852c2 +Imported: Function weth(): 0x3fc8cef3 +Imported: Function changeProxyAdmin(address,address): 0x7eff275e +Imported: Function InvalidInputData(bytes,bytes): 0x1a0bbf9f +Imported: Function BadAuth(): 0xd386ef3e +Imported: Function initLPP(uint256,uint32,uint32): 0xfaf37bc7 +Imported: Function OPContractsManagerUtils_InvalidZKGameArgsLength(uint256): 0xbf33c07a +Imported: Function validateWithOverrides((address,bytes32,uint256,address),bool,(address,address)): 0x0e9d5cb9 +Imported: Function disputeGameFactory(): 0xf2b4e617 +Imported: Function RECIPIENT(): 0x0d9019e1 +Imported: Function superPermissionedDisputeGameImpl(): 0x0af2d917 +Imported: Function decimals(): 0x313ce567 +Imported: Function ClaimAlreadyExists(): 0x80497e3b +Imported: Function transfer(address,uint256): 0xa9059cbb +Imported: Function AnchorRootNotFound(): 0x6a6bc3b2 +Imported: Function bridgeETH(uint32,bytes): 0x09fc8843 +Imported: Function InvalidCrossDomainSender(): 0xbc22e2aa +Imported: Function depositETHTo(address,uint32,bytes): 0x9a2ac6d5 +Imported: Function migrateLiquidity(): 0xbda204bb +Imported: Function OptimismPortal_NotUsingInterop(): 0x4a651100 +Imported: Function check(bytes): 0xc64b3bb5 +Imported: Function variableResolutionCost(): 0x23c30f59 +Imported: Function setUnsafeBlockSigner(address): 0x18d13918 +Imported: Function getUnresolvedGames(address,uint256,uint256): 0xcf8d0f75 +Imported: Function InvalidPreimage(): 0x1968a902 +Imported: Function claimData(): 0x3ec4d4d6 +Imported: Function loadOrDeployProxy(address,bytes4,(address,address,uint256,string),string,(string,bytes)[]): 0x5e498f1d +Imported: Function OPContractsManagerMigrator_ChainAlreadyMigrated(): 0xd4f98c32 +Imported: Function isGameProper(address): 0x496b9c16 +Imported: Function PolicyEngineStaking_NotAllowedToSetBeneficiary(): 0x748e6666 +Imported: Function disputeGameFactoryImpl(): 0xbb98b3f4 +Imported: Function getDripCount(): 0xf1d42b47 +Imported: Function baseFee(): 0x6ef25c3a +Imported: Function remoteToken(): 0xd6c0b2c4 +Imported: Function status(): 0x200d2ed2 +Imported: Function blueprints(): 0xb51f9c2b +Imported: Function ClaimAlreadyResolved(): 0xf1a94581 +Imported: Function L2BlockNumberChallenged(): 0x0ea2e752 +Imported: Function vm(): 0x3a768463 +Imported: Function OptimismPortal_NotUsingLockbox(): 0x90dec371 +Imported: Function addLocalData(uint256,uint256,uint256): 0xf8f43ff6 +Imported: Function assertValidDisputeGameFactory(string,address,address,address,address): 0xcc3a198c +Imported: Function peel((address,uint256,bytes32)[]): 0x43913491 +Imported: Function revoke((bytes32,(bytes32,uint256))): 0x46926267 +Imported: Function MINT_CAP(): 0x98f1312e +Imported: Function AlreadyRevoked(): 0x905e7107 +Imported: Function burn(uint256): 0x42966c68 +Imported: Function tokenByIndex(uint256): 0x4f6ccce7 +Imported: Function OPContractsManagerMigrator_DuplicateL2ChainId(): 0x5b72e01f +Imported: Function deposits(address,address,uint256): 0x5d93a3fc +Imported: Function depositTransaction(address,uint256,uint64,bool,bytes): 0xe9e05c42 +Imported: Function IncorrectBondAmount(): 0x8620aa19 +Imported: Function decreaseAllowance(address,uint256): 0xa457c2d7 +Imported: Function LogIndexTooHigh(): 0x94338eba +Imported: Function removeOwners(address[],address[]): 0xf6ac15c4 +Imported: Function upgradeSuperchain((address,(string,bytes)[])): 0x86fe1c66 +Imported: Function LivenessModule2_ModuleStillEnabled(): 0x70a38094 +Imported: Function authorizeLockbox(address): 0x5ec15d89 +Imported: Function tokenOfOwnerByIndex(address,uint256): 0x2f745c59 +Imported: Function configureLivenessModule((uint256,address)): 0x05ccf606 +Imported: Function bridgeERC20(address,address,uint256,uint32,bytes): 0x87087623 +Imported: Function unlockETH(uint256): 0x8d445bd0 +Imported: Function claims(bytes32): 0xeff0f592 +Imported: Function GamePaused(): 0x379a7ed9 +Imported: Function pauseTimestamps(address): 0x0e3b6d1f +Imported: Function delegate(address): 0x5c19a95c +Imported: Function LivenessModule2_ModuleNotEnabled(): 0x9fdada31 +Imported: Function l2Sender(): 0x9bf62d82 +Imported: Function resolveWindow(): 0x21cf39ee +Imported: Function challengeLPP(address,uint256,(uint64[25]),(bytes,uint256,bytes32),bytes32[],(bytes,uint256,bytes32),bytes32[]): 0x3909af5c +Imported: Function delay(): 0x6a42b8f8 +Imported: Function delayedWETHImpl(): 0x74459cf3 +Imported: Function setDevFeatureBitmap(bytes32): 0x1bec9d65 +Imported: Function revokeOffchain(bytes32): 0xcf190f34 +Imported: Function OptimismPortal_InvalidInteropState(): 0x4425175b +Imported: Function startingProposal(): 0x938d689a +Imported: Function BRIDGE(): 0xee9a31a2 +Imported: Function isEcotone(): 0x4ef6e224 +Imported: Function initialize(address,uint256,uint256,uint256,uint256): 0xf92ad219 +Imported: Function OPContractsManagerMigrator_InvalidStartingAnchorRoot(): 0xccf0a891 +Imported: Function minimumGasLimit(uint64): 0xa35d99df +Imported: Function PolicyEngineStaking_ZeroAddress(): 0x55dc0e9b +Imported: Function LivenessModule2_InvalidResponsePeriod(): 0x74a7e96e +Imported: Function variableResolutionCostPrecision(): 0x4ebaf3ce +Imported: Function PORTAL(): 0x0ff754ea +Imported: Function DECIMALS(): 0x2e0f2625 +Imported: Function getImplementations(): 0x615f64fe +Imported: Function lastUsedOPCMVersion(): 0x9fabcc84 +Imported: Function PERMISSIONED_ARGS_LENGTH(): 0xb0e55afd +Imported: Function getInstructionByKey((string,bytes)[],string): 0xa96c46d6 +Imported: Function isGameBlacklisted(address): 0x34a346ea +Imported: Function InvalidDisputedClaimIndex(): 0x30140332 +Imported: Function upgradeToAndCall(address,bytes): 0x4f1ef286 +Imported: Function NotEntered(): 0xbca35af6 +Imported: Function delegates(address): 0x587cde1e +Imported: Function upgradePredeploys(address): 0x7c36f37e +Imported: Function deposit(): 0xd0e30db0 +Imported: Function stateVersion(): 0x1219a4e4 +Imported: Function ReentrantCall(): 0x37ed32e8 +Imported: Function emitLog(bytes32[],bytes): 0xedebc13b +Imported: Function MESSENGER(): 0x927ede2d +Imported: Function MaxDepthTooLarge(): 0x77dfe332 +Imported: Function peData(address): 0xc24d2c15 +Imported: Function DeputyPauseModule_ExecutionFailed(string): 0x8d1364be +Imported: Function paused(): 0x5c975abb +Imported: Function L2DevFeatureFlags_Unauthorized(): 0xee37fa85 +Imported: Function fixedResolutionCost(): 0x95611852 +Imported: Function ethLockbox(): 0xb682c444 +Imported: Function OPContractsManagerV2_InvalidGameConfigs(): 0x7c165cd6 +Imported: Function maxClockDuration(): 0xdabd396d +Imported: Function withdrawETH(address): 0x690d8320 +Imported: Function LivenessModule2_ChallengeAlreadyExists(): 0x9cd90904 +Imported: Function ClockTimeExceeded(): 0x3381d114 +Imported: Function systemConfigImpl(): 0xbc3f6fd4 +Imported: Function L2ContractsManager_EmptyImplementation(address): 0x1d38e985 +Imported: Function OPContractsManagerUtils_DowngradeNotAllowed(address): 0xbfa4420d +Imported: Function allowance(address,address): 0xdd62ed3e +Imported: Function zkDisputeGameImpl(): 0x35aa1511 +Imported: Function getPastVotes(address,uint256): 0x3a46b1a8 +Imported: Function timestamp(bytes32): 0x4d003070 +Imported: Function l2ChainId(): 0xd6ae3cd5 +Imported: Function crossDomainMessageSource(): 0x24794462 +Imported: Function setBatcherHash(bytes32): 0xc9b26f61 +Imported: Function otherBridge(): 0xc89701a2 +Imported: Function delegateBySig(address,uint256,uint256,uint8,bytes32,bytes32): 0xc3cda520 +Imported: Function START_BLOCK_SLOT(): 0xe0e2016d +Imported: Function setFeature(bytes32,bool): 0xf2c4bc9e +Imported: Function initiateWithdrawal(address,uint256,bytes): 0xc2b3e5ac +Imported: Function WrongStartingBlock(): 0x60f95d5a +Imported: Function remoteChainID(): 0xd2382242 +Imported: Function TimelockGuard_TransactionNotScheduled(): 0x03c85973 +Imported: Function gameType(): 0xbbdc02db +Imported: Function create(string,(bool,uint256,address,bytes,(address,bytes,uint256)[])): 0xe551cdaa +Imported: Function mint(address,uint256): 0x40c10f19 +Imported: Function gameCount(): 0x4d1975b4 +Imported: Function setAllowedStakers(address[],bool): 0x06eea09a +Imported: Function upgrade(address,address): 0x99a88ec4 +Imported: Function cancelTransaction(address,bytes32,uint256,bytes): 0x096e01f7 +Imported: Function ETHLockbox_Paused(): 0x9e729942 +Imported: Function isGameRespected(address): 0x04e50fed +Imported: Function multiRevoke((bytes32,bytes32,uint64,uint64,uint64,bytes32,address,address,bool,bytes)[],uint256[]): 0x88e5b2d9 +Imported: Function gasPayingToken(): 0x4397dfef +Imported: Function GameNotOver(): 0x04643c39 +Imported: Function PolicyEngineStaking_SameBeneficiary(): 0xb69cd213 +Imported: Function canRemove(address): 0xd45996f1 +Imported: Function findLatestGames(uint32,uint256,uint256): 0x254bd683 +Imported: Function getUint(bytes32): 0xbd02d0f5 +Imported: Function OptimismPortal_InvalidOutputRootProof(): 0x426149af +Imported: Function OutOfOrderResolution(): 0x9a076646 +Imported: Function paused(address): 0x2e48152c +Imported: Function isMatchingInstruction((string,bytes),string,bytes): 0x88307bb5 +Imported: Function InvalidHeaderRLP(): 0xd81d583b +Imported: Function setL1BlockValuesJovian(): 0x3db6be2b +Imported: Function ProxyAdminOwnedBase_NotSharedProxyAdminOwner(): 0x075c4314 +Imported: Function InvalidHeader(): 0xbabb01dd +Imported: Function proxyAdmin(): 0x3e47158c +Imported: Function l2BlockNumberChallenged(): 0x3e3ac912 +Imported: Function upgradeTo(address): 0x3659cfe6 +Imported: Function maxGameDepth(): 0xfa315aa9 +Imported: Function recipient(): 0x66d003ac +Imported: Function messenger(): 0x3cb747bf +Imported: Function challengeStartTime(address): 0x96de45a4 +Imported: Function setApprovalForAll(address,bool): 0xa22cb465 +Imported: Function totalSupply(): 0x18160ddd +Imported: Function hasInstruction((string,bytes)[],string,bytes): 0x556dc178 +Imported: Function gameImpls(uint32): 0x1b685b9e +Imported: Function l2Bridge(): 0xae1f6aaf +Imported: Function assertValidSuperPermissionedDisputeGame((string,address,(address,address,address),address,address,string),(address,address)): 0x8e56e820 +Imported: Function setResolverRefundPercentage(uint256): 0x336409fd +Imported: Function pendingTransactions(address): 0xc127fd39 +Imported: Function InvalidMessage(): 0x6eca2e4b +Imported: Function ClockNotExpired(): 0xf2440b53 +Imported: Function foundationSafe(): 0x8851bfbd +Imported: Function MessageAlreadyRelayed(): 0x9ca9480b +Imported: Function TreeSizeOverflow(): 0x62295723 +Imported: Function InvalidSignature(): 0x8baa579f +Imported: Function verifier(): 0x2b7ac3f3 +Imported: Function eip1559Elasticity(): 0xc9ff2d16 +Imported: Function numProofSubmitters(bytes32): 0x513747ab +Imported: Function validateWithOverrides((address,bytes32,bytes32,uint256,address),bool,(address,address)): 0x8970ac44 +Imported: Function mipsImpl(): 0xe303272c +Imported: Function InvalidVerifier(): 0xbaa3de5f +Imported: Function relayETH(address,address,uint256): 0x4f0edcc9 +Imported: Function getOperatorFee(uint256): 0x275aedd2 +Imported: Function StringTooLong(string): 0x305a27a9 +Imported: Function increaseAllowance(address,uint256): 0x39509351 +Imported: Function validateCommitment(bytes): 0x93fb1944 +Imported: Function migrate((address[],(bool,uint256,uint32,bytes)[],(bytes32,uint256),uint32)): 0xba55287c +Imported: Function mintPermittedAfter(): 0x00f8900c +Imported: Function setEIP1559Params(uint32,uint32): 0xc0fd4b41 +Imported: Function InvalidResolverRefundPercentage(uint256): 0x16aa4e80 +Imported: Function l1ERC721Bridge(): 0xc4e8ddfa +Imported: Function crossDomainMessageSender(): 0x38ffde18 +Imported: Function addressManager(): 0x3ab76e9f +Imported: Function L2ToL1MessagePasserCGT_NotAllowedOnCGTMode(): 0xcdfaa111 +Imported: Function ActiveProposal(): 0x55d4cbf9 +Imported: Function OPTIMISM_MINTABLE_ERC20_FACTORY_SLOT(): 0x06c92657 +Imported: Function SUPER_ROOT_GAMES_MIGRATION(): 0x57411566 +Imported: Function createOptimismMintableERC20WithDecimals(address,string,string,uint8): 0x8cf0629c +Imported: Function DELEGATECALL(address,bytes): 0xedee6239 +Imported: Function isGameRetired(address): 0x5958a193 +Imported: Function OptimismPortal_InvalidMerkleProof(): 0x2e57ef3a +Imported: Function l1FeeOverhead(): 0x8b239f73 +Imported: Function PartOffsetOOB(): 0xfe254987 +Imported: Function multiRevokeByDelegation((bytes32,(bytes32,uint256)[],(uint8,bytes32,bytes32)[],address,uint64)[]): 0x0eabf660 +Imported: Function assertValidPreimageOracle(string,address,string): 0x5432987e +Imported: Function l1StandardBridgeImpl(): 0xc34e047a +Imported: Function L2ContractsManager_DowngradeNotAllowed(address): 0xf8ce5d16 +Imported: Function proxyAdminOwner(): 0xdad544e0 +Imported: Function NotInitializing(): 0xd7e6bcf8 +Imported: Function updateRetirementTimestamp(): 0xd5a3e12e +Imported: Function GameNotInProgress(): 0x67fe1950 +Imported: Function extraData(): 0x609d3334 +Imported: Function clockExtension(): 0x6b6716c0 +Imported: Function l1FeeScalar(): 0x9e8c4966 +Imported: Function LiquidityController_Unauthorized(): 0x5fbc4ede +Imported: Function OptimismPortal_InvalidLockboxState(): 0x9c46cd79 +Imported: Function transferFrom(address,address,uint256): 0x23b872dd +Imported: Function TimelockGuard_TransactionAlreadyExecuted(): 0x183ca431 +Imported: Function PERMISSIONLESS_ARGS_LENGTH(): 0x37eb4fa3 +Imported: Function maxProveDuration(): 0xbcbe5094 +Imported: Function assertValidDelayedWETH(string,address,address,address,address,address,uint256,string): 0x360d339f +Imported: Function verifierType(): 0x170227f7 +Imported: Function resendMessage(uint256,uint256,address,address,bytes): 0x6b0c3c5e +Imported: Function MIN_GAS_DYNAMIC_OVERHEAD_NUMERATOR(): 0x2828d7e8 +Imported: Function InvalidAttestations(): 0xe8bee839 +Imported: Function withdraw(uint256): 0x2e1a7d4d +Imported: Function depositERC20To(address,address,address,uint256,uint32,bytes): 0x838b2520 +Imported: Function createGameWithClaims(address,uint32,bytes32,bytes,(uint256,bytes32,bool)[]): 0xfd7cf859 +Imported: Function isApprovedForAll(address,address): 0xe985e9c5 +Imported: Function LivenessModule2_ResponsePeriodEnded(): 0xeb911af0 +Imported: Function TimelockGuard_GuardNotConfigured(): 0x0832dd69 +Imported: Function devFeatureBitmap(): 0x1d8a4e92 +Imported: Function UnsupportedStateVersion(): 0x1f8b02a2 +Imported: Function initialize(address): 0xc4d66de8 +Imported: Function L2ContractsManager_NotUpgradeable(address): 0xc3fe4a66 +Imported: Function DeadlineExpired(): 0x1ab7da6b +Imported: Function OPContractsManagerV2_CannotUpgradeToCustomGasToken(): 0xe9b0e51a +Imported: Function maxChallengeDuration(): 0xd2177bdd +Imported: Function setL1BlockValuesIsthmus(): 0x098999be +Imported: Function pauseMessageTypehash(): 0xda931fe4 +Imported: Function UnexpectedPreambleData(bytes): 0x57a05835 +Imported: Function OptimismPortal_LockboxNotAuthorizedForPortal(): 0x77cc4b2e +Imported: Function claimData(uint256): 0xc6f0308c +Imported: Function ECDSAInvalidSignatureLength(uint256): 0xfce698f7 +Imported: Function getPastTotalSupply(uint256): 0x8e539e8c +Imported: Function authorizeMinter(address): 0x0c984832 +Imported: Function withdrawalNetwork(): 0x82356d8a +Imported: Function isIsthmus(): 0xb54501bc +Imported: Function OPContractsManagerMigrator_SuperchainConfigNeedsUpgrade(): 0x494a0acc +Imported: Function basefee(): 0x5cf24969 +Imported: Function getProxyImplementation(address): 0x204e1c7a +Imported: Function setBool(bytes32,bool): 0xabfdcced +Imported: Function finalizeWithdrawalTransactionExternalProof((uint256,address,address,uint256,uint256,bytes),address): 0x43ca1c50 +Imported: Function addLeavesLPP(uint256,uint256,bytes,bytes32[],bool): 0x7917de1d +Imported: Function KECCAK_TREE_DEPTH(): 0x2055b36b +Imported: Function SuperchainConfig_NotAlreadyPaused(address): 0x335b8695 +Imported: Function getRequiredBond(uint128): 0xc395e1ca +Imported: Function isLocalOrGlobalPaused(address): 0x9956fd9e +Imported: Function otherMessenger(): 0xdb505d80 +Imported: Function OptimismPortal_DisputeGameNotInvalidated(): 0x42102de6 +Imported: Function MessageTargetL2ToL2CrossDomainMessenger(): 0x4faa2509 +Imported: Function preimageParts(bytes32,uint256): 0x61238bde +Imported: Function BlockNumberMatches(): 0xb8ed8830 +Imported: Function bridgeERC721To(address,address,address,uint256,uint32,bytes): 0xaa557452 +Imported: Function ZeroAddress(): 0xd92e233d +Imported: Function OptimismPortal_AlreadyFinalized(): 0x730a1074 +Imported: Function implementationName(address): 0x238181ae +Imported: Function admin(): 0xf851a440 +Imported: Function eip712Domain(): 0x84b0196e +Imported: Function proveWithdrawalTransaction((uint256,address,address,uint256,uint256,bytes),uint256,(bytes32,bytes32,bytes32,bytes32),bytes[]): 0x4870496f +Imported: Function getAnchorRoot(): 0xd83ef267 +Imported: Function setDeputy(address,bytes): 0x183b708b +Imported: Function ECDSAInvalidSignatureS(bytes32): 0xd78bce0c +Imported: Function WrongSchema(): 0x21b8eeb9 +Imported: Function anchors(uint32): 0x7258a807 +Imported: Function DeputyPauseModule_NotFromSafe(): 0x71da2c91 +Imported: Function DeputyPauseModule_Unauthorized(): 0x8d279ab5 +Imported: Function ECDSAInvalidSignature(): 0xf645eedf +Imported: Function setProxyType(address,uint8): 0x8d52d4a0 +Imported: Function changeOwnershipToFallback(address): 0xbceb8eda +Imported: Function OptimismPortal_NoReentrancy(): 0xdfeaaeb8 +Imported: Function getNonce(address): 0x2d0335ab +Imported: Function GameOver(): 0xdf469ccb +Imported: Function InvalidDataRemainder(): 0x5c5537b8 +Imported: Function L2ProxyAdmin__Unauthorized(): 0xcde661e7 +Imported: Function startingBlockNumber(): 0x70872aa5 +Imported: Function refundModeCredit(address): 0xc0d8bb74 +Imported: Function isMatchingInstructionByKey((string,bytes),string): 0xa24a6bf9 +Imported: Function InvalidAmount(): 0x2c5211c6 +Imported: Function number(): 0x8381f58a +Imported: Function CannotDefendRootClaim(): 0xa42637bc +Imported: Function withdrawalDelaySeconds(): 0x71839418 +Imported: Function OPContractsManagerMigrator_ProxyAdminOwnerMismatch(): 0xd6fb21cd +Imported: Function BondTooLow(uint256,uint256): 0x000155b5 +Imported: Function blobBaseFee(): 0xf8206140 +Imported: Function eip1559Denominator(): 0xd220a9e0 +Imported: Function MessageDestinationSameChain(): 0x8ed9a95d +Imported: Function gasPrice(): 0xfe173b97 +Imported: Function InvalidInitialization(): 0xf92ee8a9 +Imported: Function setGasConfigEcotone(uint32,uint32): 0x21d7fde5 +Imported: Function AlreadyRevokedOffchain(): 0xec9d6eeb +Imported: Function SystemConfig_InvalidFeatureState(): 0xf5828b04 +Imported: Function WITHDRAWAL_NETWORK(): 0xd0e12f90 +Imported: Function BondTransferFailed(): 0x83e6cc6b +Imported: Function ValidStep(): 0xfb4e40dd +Imported: Function getSchemaRegistry(): 0xf10b5cc8 +Imported: Function deputyAuthMessageTypehash(): 0xcf2e2379 +Imported: Function NativeAssetLiquidity_InsufficientBalance(): 0x7b7f21e9 +Imported: Function approve(address,uint256): 0x095ea7b3 +Imported: Function assertValidDisputeGame((string,address,(address,uint256,uint256,uint64,uint64,uint32,uint256,bytes32,address,address,address,uint256,address,address),bytes32,uint256,address,uint32,string),(address,address,address,address),(address,uint256)): 0x081932c0 +Imported: Function UnsupportedERCVersion(uint8): 0x1a66c692 +Imported: Function InvalidRMWInstruction(): 0xecf79d0d +Imported: Function minOwners(): 0x4b810d3e +Imported: Function recover(uint256): 0x0ca35682 +Imported: Function bondSize(): 0x7099c581 +Imported: Function OPContractsManagerMigrator_SuperchainConfigMismatch(): 0xb24781a0 +Imported: Function TimestampTooHigh(): 0x596a19a9 +Imported: Function setRecipient(address): 0x3bbed4a0 +Imported: Function sendMessage(uint256,address,bytes): 0x7056f41f +Imported: Function totalBonds(): 0xf263c470 +Imported: Function DeputyPauseModule_InvalidDeputy(): 0x0618de07 +Imported: Function DeploymentFailed(): 0x30116425 +Imported: Function getGameUUID(uint32,bytes32,bytes): 0x96cd9720 +Imported: Function TX_BASE_GAS(): 0x2f7d3922 +Imported: Function configure(address,(string,bool,uint256,uint256)): 0x1cb81b88 +Imported: Function extend(address): 0x82005715 +Imported: Function REMOTE_TOKEN(): 0x033964be +Imported: Function OPContractsManagerMigrator_InteropNotEnabled(): 0x626c40ef +Imported: Function REMOTE_CHAIN_ID(): 0x7d1d0c5b +Imported: Function InvalidSecondMemoryProof(): 0x834c4cd4 +Imported: Function superFaultDisputeGameImpl(): 0x5c122ac1 +Imported: Function proposer(): 0xa8e4fb90 +Imported: Function IdOriginNotL2ToL2CrossDomainMessenger(): 0x7987c157 +Imported: Function OptimismPortal_Unproven(): 0xcca6afda +Imported: Function PolicyEngineStaking_Paused(): 0x4e1a9b55 +Imported: Function setGasLimit(uint64): 0xb40a817c +Imported: Function setWithdrawalRoute(address,uint8): 0xb6c3ffec +Imported: Function setImplementation(uint32,address,bytes): 0xb1070957 +Imported: Function NotPayable(): 0x1574f9f3 +Imported: Function L2ContractsManager_InitializingDuringUpgrade(): 0xc996d784 +Imported: Function DENOMINATOR(): 0x918f8674 +Imported: Function OptimismPortal_GasEstimation(): 0xab581036 +Imported: Function setBatcherHash(address): 0x0a2ca2a9 +Imported: Function finalizeETHWithdrawal(address,address,uint256,bytes): 0x1532ec34 +Imported: Function TOKEN(): 0x82bfefc8 +Imported: Function opcmUtils(): 0xfcd549f5 +Imported: Function minters(address): 0xf46eccc4 +Imported: Function receiveLiquidity(): 0x30f9765d +Imported: Function InvalidNonce(): 0x756688fe +Imported: Function InvalidSplitDepth(): 0xe62ccf39 +Imported: Function signCancellation(bytes32): 0x06d8b7e2 +Imported: Function Unauthorized(): 0x82b42900 +Imported: Function TimelockGuard_TransactionAlreadyCancelled(): 0x3e8b8389 +Imported: Function systemConfig(): 0x33d7e2bd +Imported: Function tokenURI(uint256): 0xc87b56dd +Imported: Function InvalidParentGame(): 0x346119f7 +Imported: Function InvalidMemoryProof(): 0x8e77b2b7 +Imported: Function scalar(): 0xf45e65d8 +Imported: Function attestByDelegation((bytes32,(address,uint64,bool,bytes32,bytes,uint256),(uint8,bytes32,bytes32),address,uint64)): 0x3c042715 +Imported: Function configureTimelockGuard(uint256): 0x65cf50ec +Imported: Function RELAY_CALL_OVERHEAD(): 0x4c1d6a69 +Imported: Function sentMessages(bytes32): 0x82e3702d +Imported: Function isFeatureEnabled(bytes32): 0x47af267b +Imported: Function balanceOf(address): 0x70a08231 +Imported: Function getRequiredThreshold(uint256): 0x86644d1e +Imported: Function drips(string): 0x4d7fba6e +Imported: Function l1TokenBridge(): 0x36c717c1 +Imported: Function wasRespectedGameTypeWhenCreated(): 0x250e69bd +Imported: Function daFootprintGasScalar(): 0xfe3d5710 +Imported: Function checkAfterExecution(bytes32,bool): 0x93271368 +Imported: Function drip(string): 0x67148cd2 +Imported: Function superchainConfig(): 0x35e80ab3 +Imported: Function setMinWithdrawalAmount(uint256): 0x85b5b14d +Imported: Function parentIndex(): 0x7948690a +Imported: Function minBaseFee(): 0xa62611a2 +Imported: Function initBonds(uint32): 0x6593dc6e +Imported: Function claimDataLen(): 0x8980e0cc +Imported: Function GameNotResolved(): 0xc105260a +Imported: Function multiRevoke((bytes32,(bytes32,uint256)[])[]): 0x4cb7e9e5 +Imported: Function sp1Verifier(): 0x52a07fa3 +Imported: Function ChallengeNotActive(): 0xbeb11d3b +Imported: Function SuperchainConfig_OnlyGuardian(): 0xafbe9bc6 +Imported: Function UnexpectedString(): 0x4b9c6abe +Imported: Function revoke((bytes32,bytes32,uint64,uint64,uint64,bytes32,address,address,bool,bytes)): 0xe49617e1 +Imported: Function deleteProvenWithdrawal(bytes32,address): 0xba93107d +Imported: Function UnexpectedList(): 0x1ff9b2e4 +Imported: Function withdrawTo(address,address,uint256,uint32,bytes): 0xa3a79548 +Imported: Function setL1BlockValuesEcotone(): 0x440a5e20 +Imported: Function messageVersion(): 0x52617f3c +Imported: Function pause(address): 0x76a67a51 +Imported: Function proxyType(address): 0x6bd9f516 +Imported: Function l2BlockNumber(): 0x8b85902b +Imported: Function RELAY_GAS_CHECK_BUFFER(): 0x5644cfdf +Imported: Function migrateToSharedDisputeGame(address,address): 0xd36d4274 +Imported: Function isOptimismMintableERC721(address): 0x5572acae +Imported: Function permissionedDisputeGameImpl(): 0x98ccec3e +Imported: Function fallbackOwner(): 0x602b263b +Imported: Function changeBeneficiary(address): 0xdc070657 +Imported: Function NotABlueprint(): 0x31f56e1f +Imported: Function gasPayingTokenName(): 0xd8444715 +Imported: Function AlreadyTimestamped(): 0x2e267946 +Imported: Function donateETH(): 0x8b4c40b0 +Imported: Function startingOutputRoot(): 0x57da950e +Imported: Function operatorFeeConstant(): 0x16d3bc7f +Imported: Function setIsthmus(): 0x291b0383 +Imported: Function gasPayingTokenSymbol(): 0x550fcdc9 +Imported: Function resolvedAt(): 0x19effeb4 +Imported: Function UnexpectedGameType(): 0x86ef0f0b +Imported: Function InvalidExpirationTime(): 0x08e8b937 +Imported: Function ParentGameNotResolved(): 0x92c506ae +Imported: Function assertValidMipsVm(string,address,address,string): 0xcf26abb4 +Imported: Function getSchema(bytes32): 0xa2ea7c6e +Imported: Function deposits(address,address): 0x8f601f66 +Imported: Function challenger(): 0x534db0e2 +Imported: Function NotEOA(): 0xba092d16 +Imported: Function SP1PlonkAdapter_InvalidVerifier(): 0x3c516054 +Imported: Function AlreadyExists(): 0x23369fa6 +Imported: Function upgrade((address,(bool,uint256,uint32,bytes)[],(string,bytes)[])): 0x8a847e2e +Imported: Function ChallengeNotExpired(): 0x151f07fe +Imported: Function AnchorStateRegistry_InvalidAnchorGame(): 0x47ad367a +Imported: Function PROOF_TYPEHASH(): 0x8b3e3bf6 +Imported: Function timelockDelay(address): 0x5698b16a +Imported: Function proposalBonds(address,uint256): 0xddcd58de +Imported: Function Irrevocable(): 0x157bd4c3 +Imported: Function relayMessage(uint256,address,address,uint256,uint256,bytes): 0xd764ad0b +Imported: Function InvalidRegistry(): 0x11a1e697 +Imported: Function ETHLockbox_DifferentSuperchainConfig(): 0x84ab5515 +Imported: Function isPayable(): 0xce46e046 +Imported: Function ProxyAdminOwnedBase_NotProxyAdminOwner(): 0x7f12c64b +Imported: Function GameAlreadyExists(bytes32): 0x014f6fe5 +Imported: Function verify(bytes32,bytes,bytes): 0x5bf48e3a +Imported: Function getImplementation(): 0xaaf10f42 +Imported: Function setBytes32(bytes32,bytes32): 0x4e91db08 +Imported: Function setAddress(string,address): 0x9b2ea4bd +Imported: Function DEPOSITOR_ACCOUNT(): 0xe591b282 +Imported: Function migrateLiquidity(address): 0x438ab5ac +Imported: Function InvalidSchema(): 0xbf37b20e +Imported: Function setL1BlockValues(uint64,uint64,uint256,bytes32,uint64,bytes32,uint256,uint256): 0x015d8eb9 +Imported: Function xDomainMessageSender(): 0x6e296e45 +Imported: Function isUpgrading(): 0xb7947262 +Imported: Function getChallenge(uint256,bytes): 0x848afb3d +Imported: Function OptimismPortal_CallPaused(): 0xb9c3c2ef +Imported: Function initialize(address,uint256): 0xcd6dc687 +Imported: Function sequenceNumber(): 0x64ca23ef +Imported: Function opcmStandardValidator(): 0xba7903db +Imported: Function isDeployerAllowed(address): 0xb1540a01 +Imported: Function OPContractsManagerContainer_DevFeatureInProd(): 0xa3b4e706 +Imported: Function isLocal(): 0x0ee04629 +Imported: Function proposalParts(address,uint256): 0xb2e67ba8 +Imported: Function setWhitelistedDeployer(address,bool): 0x08fd6322 +Imported: Function cancellationThreshold(address): 0xe647dee1 +Imported: Function config(): 0x79502c55 +Imported: Function owner(): 0x8da5cb5b +Imported: Function minProposalSize(): 0xdd24f9bf +Imported: Function SuperchainConfig_AlreadyPaused(address): 0xb7d86894 +Imported: Function InvalidChallengePeriod(): 0xb4e12433 +Imported: Function challengeWindow(): 0x861a1412 +Imported: Function preimageLengths(bytes32): 0xfef2b4ed +Imported: Function PolicyEngineStaking_ZeroBeneficiary(): 0xda8aa8a1 +Imported: Function PostStateMatches(): 0x9843145b +Imported: Function challenge(uint256,bytes): 0xa03aafbf +Imported: Function MIN_BOND_SIZE(): 0x7051472e +Imported: Function L2ContractsManager_OnlyDelegatecall(): 0xada337cf +Imported: Function getDripStatus(string): 0x0d8f4697 +Imported: Function balances(address): 0x27e235e3 +Imported: Function validate((address,bytes32,uint256,address),bool): 0x41fe5385 +Imported: Function disputeGameFinalityDelaySeconds(): 0x952b2797 +Imported: Function InvalidShortString(): 0xb3512b0c +Imported: Function ProxyAdminOwnedBase_NotResolvedDelegateProxy(): 0x54e433cd +Imported: Function OPContractsManagerMigrator_NoChains(): 0x9d11c17e +Imported: Function OPContractsManagerMigrator_InvalidInitBond(): 0x108dabff +Imported: Function assertValidSuperchainConfig(string,address): 0x187f72f3 +Imported: Function anchorStateRegistryImpl(): 0x2aecd35c +Imported: Function L1Block_NotAuthorizedToSetFeature(): 0xbe9d7ca6 +Imported: Function DuplicateStep(): 0x9071e6af +Imported: Function assertValidProxyAdmin(string,address,address): 0xed4c1914 +Imported: Function InsufficientValue(): 0x11011294 +Imported: Function startBlock(): 0x48cd4cb1 +Imported: Function migrationValidator(): 0x0c27322a +Imported: Function setDAFootprintGasScalar(uint16): 0x20f06fdc +Imported: Function gameCreator(): 0x37b1b229 +Imported: Function DeputyPauseModule_SuperchainNotPaused(): 0xeb7171cd +Imported: Function InvalidRevocations(): 0xbf2f3a8b +Imported: Function LivenessModule2_ChallengeDoesNotExist(): 0x09f95920 +Imported: Function TimelockGuard_NotOwner(): 0x5874e94f +Imported: Function setEcotone(): 0x22b90ab3 +Imported: Function proofMaturityDelaySeconds(): 0xbf653a5c +Imported: Function InvalidPrestate(): 0x696550ff +Imported: Function bridgeERC20To(address,address,address,uint256,uint32,bytes): 0x540abf73 +Imported: Function attest((bytes32,(address,uint64,bool,bytes32,bytes,uint256))): 0xf17325e7 +Imported: Function ENCODING_OVERHEAD(): 0xddd5a40f +Imported: Function ZK_DISPUTE_GAME(): 0x7c4e6c3c +Imported: Function createOptimismMintableERC721(address,string,string): 0xd97df652 +Imported: Function DELAYED_WETH_SLOT(): 0x7e54b8ad +Imported: Function ContentLengthMismatch(): 0x66c94485 +Imported: Function ClaimAlreadyChallenged(): 0x85c345b0 +Imported: Function rootClaim(): 0xbcef3b55 +Imported: Function CALL(address,bytes,uint256): 0x6e2d44ae +Imported: Function OPTIMISM_PORTAL_SLOT(): 0xfd32aa0f +Imported: Function preimagePartOk(bytes32,uint256): 0x8542cf50 +Imported: Function getDomainSeparator(): 0xed24911d +Imported: Function claimCredit(address): 0x60e27464 +Imported: Function setStorage(bytes32,bytes32): 0x9b0b0fda +Imported: Function InvalidClockExtension(): 0x8d77ecac +Imported: Function BadProposal(): 0xc334f069 +Imported: Function optimismMintableERC20FactoryImpl(): 0xe3fef4a8 +Imported: Function assertValidOptimismMintableERC20Factory(string,address,address,address): 0xe23567e9 +Imported: Function NotInAccessList(): 0xe3c00816 +Imported: Function baseTokenURI(): 0xd547cfb7 +Imported: Function resourceConfig(): 0xcc731b02 +Imported: Function subgames(uint256,uint256): 0x2ad69aeb +Imported: Function params(): 0xcff0ab96 +Imported: Function bondDistributionMode(): 0x378dd48c +Imported: Function InvalidLocalIdent(): 0xff137e65 +Imported: Function bridge(): 0xe78cea92 +Imported: Event ChallengeCancelled(address): 0xadfa6511c5a9b5ac1adc5e4e0ca637c465f24ab56c1bd255a083e0023e3b7c42 +Imported: Event LiquidityMinted(address,address,uint256): 0xec89d80a36947288037745287dde87d62cd8c141d5323130b3d26d97d84004c7 +Imported: Event MinterAuthorized(address): 0x83b05b6735acd4b85e3bded8e72c851d1a87718f81e3c8e6f0c9d9a2baa88e46 +Imported: Event WithdrawalInitiated(address,address,address,address,uint256,bytes): 0x73d170910aba9e6d50b102db522b1dbcd796216f5128b445aa2135272886497e +Imported: Event RelayETH(address,address,uint256,uint256): 0xe5479bb8ebad3b9ac81f55f424a6289cf0a54ff2641708f41dcb2b26f264d359 +Imported: Event WithdrawalFinalized(bytes32,bool): 0xdb5c7652857aa163daadd670e116628fb42e869d8ac4251ef8971d9e5727df1b +Imported: Event DisputeGameBlacklisted(address): 0x192c289026d59a41a27f5aea08f3969b57931b0589202d14f4368cded95d3cda +Imported: Event LiquidityMinted(address,uint256): 0x85719716ac5bd2744ae7ed3d16702129383049b97123b506320e7a5826ebbbba +Imported: Event ConfigUpdate(uint8,bytes): 0x7b743789cff01dafdeae47739925425aab5dfd02d0c8229e4a508bcd2b9f42bb +Imported: Event Message(string): 0x51a7f65c6325882f237d4aeb43228179cfad48b868511d508e24b4437a819137 +Imported: Event LiquidityBurned(address,uint256): 0x875e07afd7ce17c6531b1a6b7b34829dcd8b7e6639448afbd6a8e29fa1422b82 +Imported: Event Unpaused(address): 0x5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa +Imported: Event BeneficiarySet(address,address): 0x2906d223dc4163733bb374af8641c7e9ae256e2bae53c90e0c9a2be2e611ae44 +Imported: Event SentMessage(uint256,address,uint256,address,bytes): 0x382409ac69001e11931a28435afef442cbfd20d9891907e8fa373ba7d351f320 +Imported: Event WithdrawalProven(bytes32,address,address): 0x67a6208cfcc0801d50f6cbe764733f4fddf66ac0b04442061a8a8c0cb6b63f62 +Imported: Event FeatureSet(bytes32,bool): 0xb876f6594132c89891d2fd198e925e999be741ec809abb58bfe9b966876cc06c +Imported: Event Deposit(address,uint256): 0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c +Imported: Event FailedRelayedMessage(bytes32): 0x99d0e048484baa1b1540b1367cb128acd7ab2946d1ed91ec10e3c85e4bf51b8f +Imported: Event LockboxAuthorized(address): 0x5d2682e700a2146c8e2381e0b407003576a54e96dd08f40f3ea0d2b8706db106 +Imported: Event Proved(address): 0x5e6565d9ca2f5c8501d6418bf563322a7243ba7ace266d75eac99f4adbb30ba7 +Imported: Event DepositFinalized(address,address,address,address,uint256,bytes): 0xb0444523268717a02698be47d0803aa7468c00acbed2f8bd93a0459cde61dd89 +Imported: Event RequiredBondSizeChanged(uint256): 0x4468d695a0389e5f9e8ef0c9aee6d84e74cc0d0e0a28c8413badb54697d1bbae +Imported: Event ImplementationArgsSet(uint32,bytes): 0xa47fcdf075d680d3817bfca7973b373e1a5f6cfc3b444748299cc2b83d8348f9 +Imported: Event Withdrawal(address,uint256): 0x7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65 +Imported: Event LiquidityFunded(address,uint256): 0xbb9e497a5b82d1a37f9496dd70c6efb97ba0d98c66c3422d05010105d0633598 +Imported: Event LiquidityDeposited(address,uint256): 0x7ff07ce9a287649537e4b012e45cf012d90228b12e2b56bb03515a6b5436fcdf +Imported: Event DisputeGameCreated(address,uint32,bytes32): 0x5b565efe82411da98814f356d0e7bcb8f0219b8d970307c5afb4a6903a8b2e35 +Imported: Event ERC721BridgeFinalized(address,address,address,address,uint256,bytes): 0x1f39bf6707b5d608453e0ae4c067b562bcc4c85c0f562ef5d2c774d2e7f131ac +Imported: Event OwnerRecorded(address): 0x833bc129023866d52116d61e94b791eb8be46f05709362e0bcf1fe7c1a8c225c +Imported: Event SentMessageExtension1(address,uint256): 0x8ebb2ec2465bdb2a06a66fc37a0963af8a2a6a1479d81d56fdb8cbb98096d546 +Imported: Event OptimismMintableERC20Created(address,address,address): 0x52fe89dd5930f343d25650b62fd367bae47088bcddffd2a88350a6ecdd620cdb +Imported: Event ETHWithdrawalFinalized(address,address,uint256,bytes): 0x2ac69ee804d9a7a0984249f508dfab7cb2534b465b6ce1580f99a38ba9c5e631 +Imported: Event MinWithdrawalAmountUpdated(uint256,uint256): 0x895a067c78583e800418fabf3da26a9496aab2ff3429cebdf7fefa642b2e4203 +Imported: Event OwnershipTransferStarted(address,address): 0x38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e22700 +Imported: Event InitBondUpdated(uint32,uint256): 0x74d6665c4b26d5596a5aa13d3014e0c06af4d322075a797f87b03cd4c5bc91ca +Imported: Event WithdrawalProvenExtension1(bytes32,address): 0x798f9f13695f8f045aa5f80ed8efebb695f3c7fe65da381969f2f28bf3c60b97 +Imported: Event ERC20WithdrawalFinalized(address,address,address,address,uint256,bytes): 0x3ceee06c1e37648fcbb6ed52e17b3e1f275a1f8c7b22a84b2b84732431e046b3 +Imported: Event WithdrawalProofDeleted(bytes32,address): 0xc52e609801931c8dcad3132b8a92414d2199941e6e09c85b117df31b6bda682a +Imported: Event Drip(string,bytes32,uint256,address): 0x2cebdf1cc706a50e1b28bf2fc5cfbd7204747a3b82439b85721a474df3a355a4 +Imported: Event EffectiveStakeChanged(address,uint256): 0x09cb1cd0133a53d7a23c9cd8ad2d55c03ce5505c752d3dcc6ec6a6e085e2e03d +Imported: Event OwnerChanged(address,address): 0xb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c +Imported: Event TransactionCancelled(address,bytes32): 0xa42fd857b47d3d04f5b29f35cb05343f66b317633d2dc2910726bd4bca1a1625 +Imported: Event MinterDeauthorized(address): 0xdf6bf03dfab5b4ccec3ba95544b98d7ecc9d4b9293d8673e86cb6edb5ac0cb62 +Imported: Event PortalMigrated(address,address,address,address): 0x9e5368471a58d81987e5dc7d6374dd5ed5e756cc95a79ff726903423bce0060d +Imported: Event BalanceChanged(address,uint256): 0xa448afda7ea1e3a7a10fcab0c29fe9a9dd85791503bf0171f281521551c7ec05 +Imported: Event RecipientUpdated(address,address): 0x62e69886a5df0ba8ffcacbfc1388754e7abd9bde24b036354c561f1acd4e4593 +Imported: Event SecretRevealed(bytes32,bytes): 0xbab2b812958b05e36be1f0553f496fa5d27441155d6be0469e1c3fe1e51ad858 +Imported: Event TransactionExecuted(address,bytes32): 0xdd4b9b318b98162cb1e7b52752a3fd110d5b7966f3b50884c1cd3bd04058e5c7 +Imported: Event OptimismMintableERC721Created(address,address,address): 0xe72783bb8e0ca31286b85278da59684dd814df9762a52f0837f89edd1483b299 +Imported: Event LiquidityReceived(address,uint256): 0xb58278ed56aa79ad2e243963b44b165a8f76d629f61c01dd3649d658e0eacca4 +Imported: Event RetirementTimestampSet(uint256): 0x6e5b1ba771e8e484f741ed085f039ff4e5c6e882eaf68f550fb390922d0ae4a7 +Imported: Event ModuleCleared(address): 0x9c6ff02e684f8a81389ed942fea1147c16b8cc5fe79f2bfbc520d44e214aed4b +Imported: Event Transfer(address,address,uint256): 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef +Imported: Event NonceIncreased(uint256,uint256): 0x57b09af877df9068fd60a69d7b21f5576b8b38955812d6ae4ac52942f1e38fb7 +Imported: Event DripStatusUpdated(string,string,uint8): 0x407cb3ad05e60ec498fb39417c7a4f6b82d5ba80f82fe512a37b02c93181a2a1 +Imported: Event StandardL2TokenCreated(address,address): 0xceeb8e7d520d7f3b65fc11a262b91066940193b05d4f93df07cfdced0eb551cf +Imported: Event DripExecuted(string,string,address,uint256): 0xea21435419aad9c54a9d90e2522b6f60bd566401f36fcef661f5f5a28cc0d2c6 +Imported: Event Unpaused(): 0xa45f47fdea8a1efdd9029a5691c7f759c32b7c698632b563573e155625d16933 +Imported: Event ETHLocked(address,uint256): 0x97efc519b9020a140ffe13878e03d340b976676090bc7fe3e33191192df7c72c +Imported: Event ETHUnlocked(address,uint256): 0xe9512d49448b580f3d29031e9243ee81bc8789a93d6f04ec8f03b694d623637b +Imported: Event RelayedMessage(bytes32): 0x4641df4a962071e12719d8c8c8e5ac7fc4d97b927346a3d7a335b1f7517e133c +Imported: Event EIP712DomainChanged(): 0x0a6387c9ea3628b88a633bb4f3b151770f70085117a15f9bf3787cda53f13d31 +Imported: Event TransactionDeposited(address,address,uint256,bytes): 0xb3813568d9991fc951961fcb4c784893574240a28925604d09fc577c55bb7c32 +Imported: Event Move(uint256,bytes32,address): 0x9b3245740ec3b155098a55be84957a4da13eaf7f14a8bc6f53126c0b9350f2be +Imported: Event ApprovalForAll(address,address,bool): 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31 +Imported: Event AddressSet(string,address,address): 0x9416a153a346f93d95f94b064ae3f148b6460473c6e82b3f9fc2521b873fcd6c +Imported: Event SendETH(address,address,uint256,uint256): 0xed98a2ff78833375c368471a747cdf0633024dde3f870feb08a934ac5be83402 +Imported: Event RelayedMessage(uint256,uint256,bytes32,bytes32): 0xc270d73e26d2d39dee7ef92093555927e344e243415547ecc350b2b5385b68a2 +Imported: Event Burn(address,uint256): 0xcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5 +Imported: Event SentMessage(address,address,bytes,uint256,uint256): 0xcb0f7ffd78f9aee47a248fae8db181db6eee833039123e026dcbff529522e52a +Imported: Event DelegateChanged(address,address,address): 0x3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f +Imported: Event WithdrewERC721(address,address,address,uint256): 0x30b478a5e196e55886228aa87ba74a7dfeba655e0a4d7ba275eabfc22aabb7a8 +Imported: Event ImplementationExists(address): 0xfbe57d889a7f75a4e0c7da304cd158fcaddc4b925cdd9f4cfb115c0f9e48009b +Imported: Event RemovedOwner(address): 0xf8d49fc529812e9a7c5c50e69c20f0dccc0db8fa95c98bc58cc9a4f1c1299eaf +Imported: Event CancellationThresholdUpdated(address,uint256,uint256): 0x4eda179760b4e68650058376d4acef78e953221317450d29b4920e6d2836944c +Imported: Event Paused(address): 0x62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258 +Imported: Event BeneficiaryRemoved(address,address): 0x1a6590bd0cabbfcc7c86bef99e1034054e179905cfcc294598fcd426c0922442 +Imported: Event ImplementationSet(address,uint32): 0xff513d80e2c7fa487608f70a618dfbc0cf415699dc69588c747e8c71566c88de +Imported: Event Registered(bytes32,address,(bytes32,address,bool,string)): 0xd0b86852e21f9e5fa4bc3b0cff9757ffe243d50c4b43968a42202153d651ea5e +Imported: Event Upgraded(address): 0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b +Imported: Event ERC721BridgeInitiated(address,address,address,address,uint256,bytes): 0xb7460e2a880f256ebef3406116ff3eee0cee51ebccdc2a40698f87ebb2e9c1a5 +Imported: Event ExecutingMessage(bytes32,(address,uint256,uint256,uint256,uint256)): 0x5c37832d2e8d10e346e55ad62071a6a2f9fa5130614ef2ec6617555c6f467ba7 +Imported: Event Unstaked(address,uint128): 0x23eb338ed2df691870bc931bf6328c55b2708178ecf1f1b3e889afca4418adea +Imported: Event WithdrewETH(address,address,uint256): 0x1f12aa8b6d492dd9b98e2b00b0b20830c2a7ded65afac13b60d169a034ae90bc +Imported: Event PortalAuthorized(address): 0x90a7fac2e56aebe4889351fb04eda5efb28b19dedf288bdbfd3cfd817c79630f +Imported: Event GuardConfigured(address,uint256): 0xa48d13ee8fad9974fa901cfb88a02d39c5361efbab13bb9b3aa7caa3f6d6b786 +Imported: Event ProxyCreation(string,address): 0x2b0807147ac5f5ad7b63c6e9cb89ca7845eb37da447c7f6ecf18ae41fcab8815 +Imported: Event WithdrawalNetworkUpdated(uint8,uint8): 0xf2ec44eb1c3b3acd547b76333eb2c4b27eee311860c57a9fdb04c95f62398fc8 +Imported: Event Challenged(address): 0x98027b38153f995c4b802a5c7e6365bee3addb25af6b29818c0c304684d8052c +Imported: Event OwnerUpdated(address,address): 0x8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d76 +Imported: Event Initialized(uint64): 0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2 +Imported: Event LiquidityWithdrawn(address,uint256): 0xb1cce8684b4ffa8667b4577654e61ee3480d661ee9c27522ac80e211f6bd4d25 +Imported: Event WhitelistDisabled(address): 0xc0e106cf568e50698fdbde1eff56f5a5c966cc7958e37e276918e9e4ccdf8cd4 +Imported: Event Withdrawal(uint256,address,address): 0xc8a211cc64b6ed1b50595a9fcb1932b6d1e5a6e8ef15b60e5b1f988ea9086bba +Imported: Event AdminChanged(address,address): 0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f +Imported: Event WithdrewERC20(address,address,address,uint256): 0x6b00f1c7883f053ba83e907fd1965b22fffe3c4111383e725f04638a566cdbfa +Imported: Event OwnershipTransferred(address,address,bool): 0x7fdc2a4b6eb39ec3363d710d188620bd1e97b3c434161f187b4d0dc0544faa58 +Imported: Event WithdrawerBalanceBurnt(uint256): 0x7967de617a5ac1cc7eba2d6f37570a0135afa950d8bb77cdd35f0d0b4e85a16f +Imported: Event Approval(address,address,uint256): 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925 +Imported: Event ImplementationDeployed(address,bytes32): 0x9b7318127ed899f286ea9ddd7925ed8ad24a682b6a825c3b5b3d88a3f00bc1d2 +Imported: Event ChallengeStatusChanged(uint256,bytes,uint8): 0xc5d8c630ba2fdacb1db24c4599df78c7fb8cf97b5aecde34939597f6697bb1ad +Imported: Event DeputySet(address): 0x6b5500f6cd2cd4a29ab2c706a6c65833d0633a568f7263460775cebcc8e9a99b +Imported: Event PredeploysUpgraded(address): 0x14e22d69ea30aab5b2220164345b33bdb5125e9c77a7d5fe12e23a1c691bd139 +Imported: Event Paused(): 0x9e87fac88ff661f02d44f95383c817fece4bce600a3dab7a54406878b965e752 +Imported: Event ModuleConfigured(address,uint256,address): 0x47e2ddae3ece2c77f60d8e9e5a89a50f1d1374a87fb11956d27a6b4986bba17e +Imported: Event ETHDepositInitiated(address,address,uint256,bytes): 0x35d79ab81f2b2017e19afb5c5571778877782d7a8786f5907f93b0f4702f4f23 +Imported: Event Revoked(address,address,bytes32,bytes32): 0xf930a6e2523c9cc298691873087a740550b8fc85a0680830414c148ed927f615 +Imported: Event OwnershipTransferred(address,address): 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0 +Imported: Event _EventToExposeStructInABI__Params((uint256,bytes32,bytes32)): 0xe696aefa5d73185c96c67a87c9597f9ef8d746736183999616f1e6f5a839b282 +Imported: Event Staked(address,uint128): 0x2eefbcc6809174727cb788be082c392be6c822829c56ab5eb44d528e9d9f37f9 +Imported: Event Attested(address,address,bytes32,bytes32): 0x8bf46bf4cfd674fa735a3d63ec1c9ad4153f033c290341f3a588b75685141b35 +Imported: Event ERC20BridgeFinalized(address,address,address,address,uint256,bytes): 0xd59c65b35445225835c83f50b6ede06a7be047d22e357073e250d9af537518cd +Imported: Event Mint(address,uint256): 0x0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885 +Imported: Event Withdrawal(uint256,address,address,uint8): 0x38e04cbeb8c10f8f568618aa75be0f10b6729b8b4237743b4de20cbcde2839ee +Imported: Event AnchorUpdated(address): 0x474f180d74ea8751955ee261c93ff8270411b180408d1014c49f552c92a4d11e +Imported: Event _EventToExposeStructInABI__Params((address,uint256)): 0xd675e8c1bf2f28f052b74c311412663dd60576c00ce3346b9a6d614df2b0b60b +Imported: Event ChallengeStarted(address,uint256): 0x3eb9241ca06793ab672590e858d0977206f824e7367806f94a90af391d275d33 +Imported: Event ChallengeSucceeded(address,address): 0xdfdecb71eb0580c9263c867bc6de9dd6f859cc6a6ee33d47e505904f1d5601c9 +Imported: Event ETHMigrated(address,uint256): 0xd893f630c6867fa43689da9ae949ebf04cac24aad3b45c759d442ed3c32e3a37 +Imported: Event Initialized(uint8): 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498 +Imported: Event RespectedGameTypeSet(uint32): 0xcee0703b5e4bad4efededab85c9fd1aec17dee7c5f6c584330e0509b677745a2 +Imported: Event RevokedOffchain(address,bytes32,uint64): 0x92a1f7a41a7c585a8b09e25b195e225b1d43248daca46b0faf9e0792777a2229 +Imported: Event Resolved(uint8): 0x5e186f09b9c93491f14e277eea7faa5de6a2d4bda75a79af7a3684fbfb42da60 +Imported: Event PauseTriggered(address,bytes32,address): 0xaa64a95e3acb9db4deaf865d9fcc62a5d47996b643e7fcc799e3b499c9bff2d9 +Imported: Event OwnershipTransferredToFallback(): 0x903af33ae084e750e45a10a53f61a69a4c5444f13a59954f5b3cf96e2862b5f4 +Imported: Event ERC20BridgeInitiated(address,address,address,address,uint256,bytes): 0x7ff126db8024424bbfd9826e8ab82ff59136289ea440b04b39a0df1b03b9cabf +Imported: Event WhitelistStatusChanged(address,bool): 0x8daaf060c3306c38e068a75c054bf96ecd85a3db1252712c4d93632744c42e0d +Imported: Event ResolverRefundPercentageChanged(uint256): 0xbbd8605de8f773fedb355c2fecd4b6b2e16a10a44e6676a63b375ac8f693758d +Imported: Event DripCreated(string,string,(bool,uint256,address,bytes,(address,bytes,uint256)[])): 0xe38d8d98e6cc66f6f520d483c6c5a89289681f897799c4c29d767cf57e76d9a6 +Imported: Event ERC20DepositInitiated(address,address,address,address,uint256,bytes): 0x718594027abd4eaed59f95162563e0cc6d0e8d5b86b1c7be8b1b0ac3343d0396 +Imported: Event GameClosed(uint8): 0x9908eaac0645df9d0704d06adc9e07337c951de2f06b5f2836151d48d5e4722f +Imported: Event TransactionScheduled(address,bytes32,uint256): 0x653f8f6fce2a503b2dfca34e95b3e4902254a11765d2658c0e5af1d64ab276cf +Imported: Event ReceivedETH(address,uint256): 0x4103257eaac983ca79a70d28f90dfc4fa16b619bb0c17ee7cab0d4034c279624 +Imported: Event ETHBridgeFinalized(address,address,uint256,bytes): 0x31b2166ff604fc5672ea5df08a78081d2bc6d746cadce880747f3643d819e83d +Imported: Event DelegateVotesChanged(address,uint256,uint256): 0xdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724 +Imported: Event ConfigUpdate(uint256,uint8,bytes): 0x1d2b0bda21d56b8bd12d4f94ebacffdfb35f5e226f84b461103bb8beab6353be +Imported: Event Timestamped(bytes32,uint64): 0x5aafceeb1c7ad58e4a84898bdee37c02c0fc46e7d24e6b60e8209449f183459f +Imported: Event ETHBridgeInitiated(address,address,uint256,bytes): 0x2849b43074093a05396b6f2a937dee8565b15a48a7b3d4bffb732a5017380af5 +Imported: Event LiquidityMigrated(address,uint256): 0x87eb4064140fbec95a8de570e01b4c650c00ecd677560af9f298a975b636c22d +Imported: Event MessagePassed(uint256,address,address,uint256,uint256,bytes,bytes32): 0x02a52367d10742d8032712c1bb8e0144ff1ec5ffda1ed7d70bb05a2744955054 +Imported: Event BeneficiaryAllowlistUpdated(address,address,bool): 0x8493e706a7e8e8fe92f1276d416d1bf108bf763aa6058953d8bd553b75aef8dc +Selectors successfully uploaded to OpenChain diff --git a/ops/ci/migration/tests/fixtures/selector-upload/provider-isolation/rwx/execution.json b/ops/ci/migration/tests/fixtures/selector-upload/provider-isolation/rwx/execution.json new file mode 100644 index 00000000000..2ff37539cd8 --- /dev/null +++ b/ops/ci/migration/tests/fixtures/selector-upload/provider-isolation/rwx/execution.json @@ -0,0 +1,14 @@ +{ + "argv": [ + "just", + "update-selectors" + ], + "cwd": "/var/mint-workspace/packages/contracts-bedrock", + "elapsed_seconds": 1.0162222385406494, + "exit_code": 0, + "signals": [], + "started_at": 1791203148.2922475, + "stderr_sha256": "58dc85172e1b99bb2fe1843e7b0043e0536ab0a88651a3cf003ca9c04a6f767c", + "stdout_sha256": "e93cbfe0a29b044fcaa6959b5938cc707d7892765877e00daea7a71bff1f7958", + "timed_out": false +} diff --git a/ops/ci/migration/tests/fixtures/selector-upload/provider-isolation/rwx/isolation.json b/ops/ci/migration/tests/fixtures/selector-upload/provider-isolation/rwx/isolation.json new file mode 100644 index 00000000000..3d5d1d59498 --- /dev/null +++ b/ops/ci/migration/tests/fixtures/selector-upload/provider-isolation/rwx/isolation.json @@ -0,0 +1,27 @@ +{ + "destination": "https://api.4byte.sourcify.dev/signature-database/v1/import", + "external_blocked": [ + { + "address": "1.1.1.1", + "errno": 101 + }, + { + "address": "2606:4700:4700::1111", + "errno": 101 + } + ], + "gid": 1000, + "hosts_sha256": "e741ad2b57f70e68b4adea9610f9e4b8cf24b14683207f5b27fdd558cb945072", + "interfaces": [ + [ + 1, + "lo" + ] + ], + "mount_namespace": "mnt:[4026532845]", + "network_namespace": "net:[4026532782]", + "no_new_privileges": true, + "pid": 1, + "trust_sha256": "a49479d75b0d864f81ec17a557cc3c6f8468f73a404204c16163a4773f3dc908", + "uid": 1000 +} diff --git a/ops/ci/migration/tests/fixtures/selector-upload/provider-isolation/rwx/provenance.json b/ops/ci/migration/tests/fixtures/selector-upload/provider-isolation/rwx/provenance.json new file mode 100644 index 00000000000..b4b6f49ecb5 --- /dev/null +++ b/ops/ci/migration/tests/fixtures/selector-upload/provider-isolation/rwx/provenance.json @@ -0,0 +1,7 @@ +{ + "circle_job": null, + "coverage_added": 0, + "native_run_id": "786f16f0e2b14472b8d78403ee40ec01", + "provider": "rwx", + "source_sha": "86f4ba931a0a8a4ef304767b4a802125253d8f7f" +} diff --git a/ops/ci/migration/tests/fixtures/selector-upload/provider-isolation/rwx/stderr.log b/ops/ci/migration/tests/fixtures/selector-upload/provider-isolation/rwx/stderr.log new file mode 100644 index 00000000000..29f1ee38adc --- /dev/null +++ b/ops/ci/migration/tests/fixtures/selector-upload/provider-isolation/rwx/stderr.log @@ -0,0 +1,168 @@ +forge selectors up --all +Uploading selectors for DataAvailabilityChallenge... +Uploading selectors for DataAvailabilityChallenge... +Uploading selectors for ETHLockbox... +Uploading selectors for L1CrossDomainMessenger... +Uploading selectors for L1ERC721Bridge... +Uploading selectors for L1StandardBridge... +Uploading selectors for OPContractsManagerStandardValidator... +Uploading selectors for OptimismPortal2... +Uploading selectors for ResourceMetering... +Uploading selectors for ResourceMetering... +Uploading selectors for SuperchainConfig... +Uploading selectors for SystemConfig... +Uploading selectors for OPContractsManagerContainer... +Uploading selectors for OPContractsManagerMigrationValidator... +Uploading selectors for OPContractsManagerMigrator... +Uploading selectors for OPContractsManagerUtils... +Uploading selectors for OPContractsManagerUtilsCaller... +Uploading selectors for OPContractsManagerUtilsCaller... +Uploading selectors for OPContractsManagerV2... +Uploading selectors for StandardValidatorUtils... +Uploading selectors for StandardValidatorUtils... +Uploading selectors for StandardValidatorUtils... +Uploading selectors for BaseFeeVault... +Uploading selectors for ConditionalDeployer... +Uploading selectors for ConditionalDeployer... +Uploading selectors for CrossDomainOwnable... +Uploading selectors for CrossDomainOwnable... +Uploading selectors for CrossDomainOwnable2... +Uploading selectors for CrossDomainOwnable2... +Uploading selectors for CrossDomainOwnable3... +Uploading selectors for CrossDomainOwnable3... +Uploading selectors for CrossL2Inbox... +Uploading selectors for ETHLiquidity... +Uploading selectors for FeeVault... +Uploading selectors for GasPriceOracle... +Uploading selectors for L1Block... +Uploading selectors for L1BlockCGT... +Uploading selectors for L1FeeVault... +Uploading selectors for L2ContractsManager... +Uploading selectors for L2CrossDomainMessenger... +Uploading selectors for L2DevFeatureFlags... +Uploading selectors for L2DevFeatureFlags... +Uploading selectors for L2ERC721Bridge... +Uploading selectors for L2ProxyAdmin... +Uploading selectors for L2ProxyAdmin... +Uploading selectors for L2StandardBridge... +Uploading selectors for L2ToL1MessagePasser... +Uploading selectors for L2ToL1MessagePasserCGT... +Uploading selectors for L2ToL2CrossDomainMessenger... +Uploading selectors for LiquidityController... +Uploading selectors for LiquidityController... +Uploading selectors for NativeAssetLiquidity... +Uploading selectors for NativeAssetLiquidity... +Uploading selectors for OperatorFeeVault... +Uploading selectors for OptimismMintableERC721... +Uploading selectors for OptimismMintableERC721... +Uploading selectors for OptimismMintableERC721Factory... +Uploading selectors for OptimismMintableERC721FactoryLegacyMapping... +Uploading selectors for SequencerFeeVault... +Uploading selectors for SuperchainETHBridge... +Uploading selectors for WETH... +Uploading selectors for MIPS64... +Uploading selectors for PreimageOracle... +Uploading selectors for MIPS64Instructions... +Uploading selectors for MIPS64Instructions... +Uploading selectors for AnchorStateRegistry... +Uploading selectors for DelayedWETH... +Uploading selectors for DisputeGameFactory... +Uploading selectors for FaultDisputeGame... +Uploading selectors for PermissionedDisputeGame... +Uploading selectors for SuperFaultDisputeGame... +Uploading selectors for SuperPermissionedDisputeGame... +Uploading selectors for LibGameArgs... +Uploading selectors for LibGameArgs... +Uploading selectors for LibGameArgs... +Uploading selectors for LibGameArgs... +Uploading selectors for SP1PlonkAdapter... +Uploading selectors for ZKDisputeGame... +Uploading selectors for ZKDisputeGame... +Uploading selectors for GovernanceToken... +Uploading selectors for MintManager... +Uploading selectors for EventLogger... +Uploading selectors for EventLogger... +Uploading selectors for GameHelper... +Uploading selectors for AddressManager... +Uploading selectors for DeployerWhitelist... +Uploading selectors for L1BlockNumber... +Uploading selectors for L1ChugSplashProxy... +Uploading selectors for LegacyMessagePasser... +Uploading selectors for LegacyMintableERC20... +Uploading selectors for LegacyMintableERC20... +Uploading selectors for Blueprint... +Uploading selectors for Blueprint... +Uploading selectors for Blueprint... +Uploading selectors for Blueprint... +Uploading selectors for DevFeatures... +Uploading selectors for DevFeatures... +Uploading selectors for DevFeatures... +Uploading selectors for DevFeatures... +Uploading selectors for DevFeatures... +Uploading selectors for DevFeatures... +Uploading selectors for Encoding... +Uploading selectors for Encoding... +Uploading selectors for Encoding... +Uploading selectors for Encoding... +Uploading selectors for IGasToken... +Uploading selectors for IGasToken... +Uploading selectors for L2ContractsManagerUtils... +Uploading selectors for L2ContractsManagerUtils... +Uploading selectors for SemverComp... +Uploading selectors for SemverComp... +Uploading selectors for SemverComp... +Uploading selectors for TransientReentrancyAware... +Uploading selectors for TransientReentrancyAware... +Uploading selectors for AssetReceiver... +Uploading selectors for AssetReceiver... +Uploading selectors for Transactor... +Uploading selectors for Transactor... +Uploading selectors for TransferOnion... +Uploading selectors for Drippie... +Uploading selectors for IDripCheck... +Uploading selectors for IDripCheck... +Uploading selectors for CheckBalanceLow... +Uploading selectors for CheckSecrets... +Uploading selectors for CheckTrue... +Uploading selectors for Faucet... +Uploading selectors for AdminFaucetAuthModule... +Uploading selectors for IFaucetAuthModule... +Uploading selectors for DisputeMonitorHelper... +Uploading selectors for DisputeMonitorHelper... +Uploading selectors for PolicyEngineStaking... +Uploading selectors for PolicyEngineStakingMapping... +Uploading selectors for DeputyPauseModule... +Uploading selectors for LivenessGuard... +Uploading selectors for LivenessModule... +Uploading selectors for LivenessModule2... +Uploading selectors for SaferSafes... +Uploading selectors for TimelockGuard... +Uploading selectors for CrossDomainMessenger... +Uploading selectors for ERC721Bridge... +Uploading selectors for OptimismMintableERC20... +Uploading selectors for OptimismMintableERC20... +Uploading selectors for OptimismMintableERC20Factory... +Uploading selectors for OptimismMintableERC20Factory... +Uploading selectors for Proxy... +Uploading selectors for Proxy... +Uploading selectors for ProxyAdmin... +Uploading selectors for ProxyAdmin... +Uploading selectors for ProxyAdminOwnedBase... +Uploading selectors for ProxyAdminOwnedBase... +Uploading selectors for ProxyAdminOwnedBase... +Uploading selectors for ProxyAdminOwnedBase... +Uploading selectors for ReinitializableBase... +Uploading selectors for ReinitializableBase... +Uploading selectors for StandardBridge... +Uploading selectors for StandardBridge... +Uploading selectors for StorageSetter... +Uploading selectors for WETH98... +Uploading selectors for EAS... +Uploading selectors for IEAS... +Uploading selectors for IEAS... +Uploading selectors for ISchemaRegistry... +Uploading selectors for ISchemaRegistry... +Uploading selectors for SchemaRegistry... +Uploading selectors for EIP1271Verifier... +Uploading selectors for ISchemaResolver... +Uploading selectors for ISchemaResolver... diff --git a/ops/ci/migration/tests/fixtures/selector-upload/provider-isolation/rwx/stdout.log b/ops/ci/migration/tests/fixtures/selector-upload/provider-isolation/rwx/stdout.log new file mode 100644 index 00000000000..6fc60800dd6 --- /dev/null +++ b/ops/ci/migration/tests/fixtures/selector-upload/provider-isolation/rwx/stdout.log @@ -0,0 +1,1122 @@ +No files changed, compilation skipped +Imported: Function validate((address,bytes32,bytes32,uint256,address),bool): 0xf3edcbe1 +Imported: Function safeTransferFrom(address,address,uint256): 0x42842e0e +Imported: Function pauseMessageTypehash(): 0xda931fe4 +Imported: Function upgradeToAndCall(address,bytes): 0x4f1ef286 +Imported: Function proposer(): 0xa8e4fb90 +Imported: Function challengeFirstLPP(address,uint256,(bytes,uint256,bytes32),bytes32[]): 0xec5efcbc +Imported: Function assertValidPreimageOracle(string,address,string): 0x5432987e +Imported: Function L2ProxyAdmin__Unauthorized(): 0xcde661e7 +Imported: Function OPContractsManagerMigrator_DisputeGameNotEnabled(): 0xf666433c +Imported: Function fund(): 0xb60d4288 +Imported: Function PolicyEngineStaking_InsufficientStake(): 0x5b2fce93 +Imported: Function hash(): 0x09bd5a60 +Imported: Function findLatestGames(uint32,uint256,uint256): 0x254bd683 +Imported: Function MaxDepthTooLarge(): 0x77dfe332 +Imported: Function NotInitialized(): 0x87138d5c +Imported: Function RELAY_GAS_CHECK_BUFFER(): 0x5644cfdf +Imported: Function NotPayable(): 0x1574f9f3 +Imported: Function delegateBySig(address,uint256,uint256,uint8,bytes32,bytes32): 0xc3cda520 +Imported: Function unpause(): 0x3f4ba83a +Imported: Function opcmUtils(): 0xfcd549f5 +Imported: Function AnchorRootNotFound(): 0x6a6bc3b2 +Imported: Function nonces(bytes32,bytes32): 0x1d5d26bc +Imported: Function REMOTE_CHAIN_ID(): 0x7d1d0c5b +Imported: Function maxGameDepth(): 0xfa315aa9 +Imported: Function SP1PlonkAdapter_InvalidVerifier(): 0x3c516054 +Imported: Function InvalidSchema(): 0xbf37b20e +Imported: Function setCode(bytes): 0x6c5d4ad0 +Imported: Function getTimestamp(bytes32): 0xd45c4435 +Imported: Function PostStateMatches(): 0x9843145b +Imported: Function portal(): 0x6425666b +Imported: Function setProxyType(address,uint8): 0x8d52d4a0 +Imported: Function blueprints(): 0xb51f9c2b +Imported: Function loadBlobPreimagePart(uint256,uint256,bytes,bytes,uint256): 0x9d7e8769 +Imported: Function revoke((bytes32,(bytes32,uint256))): 0x46926267 +Imported: Function config(): 0x79502c55 +Imported: Function InvalidClockExtension(): 0x8d77ecac +Imported: Function RELAY_RESERVED_GAS(): 0x8cbeeef2 +Imported: Function changeBeneficiary(address): 0xdc070657 +Imported: Function initBonds(uint32): 0x6593dc6e +Imported: Function burnFrom(address,uint256): 0x79cc6790 +Imported: Function BlockNumberMatches(): 0xb8ed8830 +Imported: Function drips(string): 0x4d7fba6e +Imported: Function SuperchainConfig_AlreadyPaused(address): 0xb7d86894 +Imported: Function getOwner(): 0x893d20e8 +Imported: Function multiAttestByDelegation((bytes32,(address,uint64,bool,bytes32,bytes,uint256)[],(uint8,bytes32,bytes32)[],address,uint64)[]): 0x95411525 +Imported: Function setInitBond(uint32,uint256): 0x1e334240 +Imported: Function verifier(): 0x2b7ac3f3 +Imported: Function initialize(address,uint32,uint32,bytes32,uint64,address,(uint32,uint8,uint8,uint32,uint32,uint128),(address,address,address,address,address,address,address),uint256,address): 0x4843108d +Imported: Function maxClockDuration(): 0xdabd396d +Imported: Function challenge(uint256,bytes): 0xa03aafbf +Imported: Function ProxyAdminOwnedBase_NotResolvedDelegateProxy(): 0x54e433cd +Imported: Function burn(address,uint256): 0x9dc29fac +Imported: Function MESSAGE_VERSION(): 0x3f827a5a +Imported: Function InvalidSecondMemoryProof(): 0x834c4cd4 +Imported: Function shell(): 0xf11d2ff4 +Imported: Function getBool(bytes32): 0x7ae1cfca +Imported: Function DECIMALS(): 0x2e0f2625 +Imported: Function isUpgrading(): 0xb7947262 +Imported: Function lastUsedOPCM(): 0x8ed95502 +Imported: Function loadPrecompilePreimagePart(uint256,address,uint64,bytes): 0xea713950 +Imported: Function sentMessages(bytes32): 0x82e3702d +Imported: Function ETHLockbox_NoWithdrawalTransactions(): 0xd6cbd5f9 +Imported: Function gameAtIndex(uint256): 0xbb8aa1fc +Imported: Function getAddress(bytes32): 0x21f8a721 +Imported: Function livenessGuard(): 0xbe81c694 +Imported: Function multiAttest((bytes32,(address,uint64,bool,bytes32,bytes,uint256)[])[]): 0x44adc90e +Imported: Function setFeature(bytes32,bool): 0xf2c4bc9e +Imported: Function gasLimit(): 0xf68016b7 +Imported: Function operatorFeeConstant(): 0x16d3bc7f +Imported: Function getL1FeeUpperBound(uint256): 0xf1c7a58b +Imported: Function preimageLengths(bytes32): 0xfef2b4ed +Imported: Function proposalCount(): 0xda35c664 +Imported: Function InvalidInputSize(): 0x7b1dafd1 +Imported: Function batcherHash(): 0xe81b2c6d +Imported: Function PolicyEngineStaking_NotAllowedToSetBeneficiary(): 0x748e6666 +Imported: Function foundationSafe(): 0x8851bfbd +Imported: Function relayETH(address,address,uint256): 0x4f0edcc9 +Imported: Function isGameRegistered(address): 0xee658e45 +Imported: Function createdAt(): 0xcf09e0d0 +Imported: Function assertValidProxyAdmin(string,address,address): 0xed4c1914 +Imported: Function TimelockGuard_NotOwner(): 0x5874e94f +Imported: Function respectedGameType(): 0x3c9f397c +Imported: Function ReentrantCall(): 0x37ed32e8 +Imported: Function withdraw(): 0x3ccfd60b +Imported: Function LivenessModule2_InvalidResponsePeriod(): 0x74a7e96e +Imported: Function checkAfterExecution(bytes32,bool): 0x93271368 +Imported: Function getAttestation(bytes32): 0xa3112a64 +Imported: Function proofMaturityDelaySeconds(): 0xbf653a5c +Imported: Function transferFrom(address,address,uint256): 0x23b872dd +Imported: Function scalar(): 0xf45e65d8 +Imported: Function setL1BlockValuesJovian(): 0x3db6be2b +Imported: Function prove(bytes): 0x375bfa5d +Imported: Function getImplementations(): 0x615f64fe +Imported: Function OptimismPortal_InvalidRootClaim(): 0x332a57f8 +Imported: Function assertValidSuperchainConfig(string,address): 0x187f72f3 +Imported: Function addLocalData(uint256,uint256,uint256): 0xf8f43ff6 +Imported: Function resolvedAt(): 0x19effeb4 +Imported: Function systemConfigImpl(): 0xbc3f6fd4 +Imported: Function setRespectedGameType(uint32): 0x7fc48504 +Imported: Function getRequiredBond(uint128): 0xc395e1ca +Imported: Function allowlist(address,address): 0xd98c07b7 +Imported: Function ECDSAInvalidSignatureLength(uint256): 0xfce698f7 +Imported: Function InvalidInputData(bytes,bytes): 0x1a0bbf9f +Imported: Function TimelockGuard_TransactionNotReady(): 0x503c42c4 +Imported: Function Encoding_EmptySuperRoot(): 0x9103e7cd +Imported: Function preimageParts(bytes32,uint256): 0x61238bde +Imported: Function unstake(uint128): 0x458a1d6e +Imported: Function DeputyPauseModule_NotFromSafe(): 0x71da2c91 +Imported: Function delayedWETH(): 0x215b7a1c +Imported: Function attest((bytes32,bytes32,uint64,uint64,uint64,bytes32,address,address,bool,bytes)): 0xe60c3505 +Imported: Function transfer(address,uint256): 0xa9059cbb +Imported: Function transferOwnership(address): 0xf2fde38b +Imported: Function initialize(address,address[]): 0x946d9204 +Imported: Function InvalidBondDistributionMode(): 0x078a3df4 +Imported: Function OptimismPortal_InvalidOutputRootProof(): 0x426149af +Imported: Function upgradeSuperchain((address,(string,bytes)[])): 0x86fe1c66 +Imported: Function balances(address): 0x27e235e3 +Imported: Function splitDepth(): 0xec5e6308 +Imported: Function setFjord(): 0x8e98b106 +Imported: Function LogIndexTooHigh(): 0x94338eba +Imported: Function CannotDefendRootClaim(): 0xa42637bc +Imported: Function ClockTimeExceeded(): 0x3381d114 +Imported: Function hasInstruction((string,bytes)[],string,bytes): 0x556dc178 +Imported: Function l1CrossDomainMessenger(): 0xa7119869 +Imported: Function OPContractsManagerV2_DuplicateUpgradeInstruction(string): 0xc28097b5 +Imported: Function sendMessage(uint256,address,bytes): 0x7056f41f +Imported: Function minWithdrawalAmount(): 0x8312f149 +Imported: Function wasRespectedGameTypeWhenCreated(): 0x250e69bd +Imported: Function finalizeERC20Withdrawal(address,address,address,address,uint256,bytes): 0xa9f9e675 +Imported: Function disputeGameFinalityDelaySeconds(): 0x952b2797 +Imported: Function assertValidDisputeGameFactory(string,address,address,address,address): 0xcc3a198c +Imported: Function implementationName(address): 0x238181ae +Imported: Function withdrawERC20(address,address): 0x9456fbcc +Imported: Function approve(address,uint256): 0x095ea7b3 +Imported: Function assertValidAnchorStateRegistry(string,address,address,address,address,address,string): 0xc6a18c83 +Imported: Function RECIPIENT(): 0x0d9019e1 +Imported: Function pause(): 0x8456cb59 +Imported: Function isGameRespected(address): 0x04e50fed +Imported: Function InvalidRMWInstruction(): 0xecf79d0d +Imported: Function OPContractsManagerV2_InvalidEthLockbox(): 0xc9fc7147 +Imported: Function MessageDestinationSameChain(): 0x8ed9a95d +Imported: Function assertValidDisputeGame((string,address,(address,uint256,uint256,uint64,uint64,uint32,uint256,bytes32,address,address,address,uint256,address,address),bytes32,uint256,address,uint32,string),(address,address,address,address),(address,uint256)): 0x081932c0 +Imported: Function getL1GasUsed(bytes): 0xde26c4a1 +Imported: Function l1BaseFee(): 0x519b4bd3 +Imported: Function setJovian(): 0xb3d72079 +Imported: Function getRequiredThreshold(uint256): 0x86644d1e +Imported: Function ProxyAdminOwnedBase_NotProxyAdminOwner(): 0x7f12c64b +Imported: Function admin(): 0xf851a440 +Imported: Function TimestampTooHigh(): 0x596a19a9 +Imported: Function OPContractsManagerUtils_InvalidZKGameArgsLength(uint256): 0xbf33c07a +Imported: Function credit(address): 0xd5d44d80 +Imported: Function configureTimelockGuard(uint256): 0x65cf50ec +Imported: Function messenger(): 0x3cb747bf +Imported: Function bridgeERC721To(address,address,address,uint256,uint32,bytes): 0xaa557452 +Imported: Function RELAY_CONSTANT_OVERHEAD(): 0x83a74074 +Imported: Function games(uint32,bytes32,bytes): 0x5f0150cb +Imported: Function DELEGATECALL(address,bytes): 0xedee6239 +Imported: Function InvalidSplitDepth(): 0xe62ccf39 +Imported: Function withdrawETH(address): 0x690d8320 +Imported: Function TimelockGuard_TransactionNotScheduled(): 0x03c85973 +Imported: Function EmptyItem(): 0x5ab458fb +Imported: Function PolicyEngineStaking_Paused(): 0x4e1a9b55 +Imported: Function deposits(address,address): 0x8f601f66 +Imported: Function gasPayingTokenName(): 0xd8444715 +Imported: Function ETHLockbox_InsufficientBalance(): 0xe1ba9227 +Imported: Function ClockNotExpired(): 0xf2440b53 +Imported: Function revokeOffchain(bytes32): 0xcf190f34 +Imported: Function signCancellation(bytes32): 0x06d8b7e2 +Imported: Function pendingOwner(): 0xe30c3978 +Imported: Function L1_STANDARD_BRIDGE_SLOT(): 0xf8c68de0 +Imported: Function otherMessenger(): 0xdb505d80 +Imported: Function created(uint256): 0x82cb6b72 +Imported: Function setAddressManager(address): 0x0652b57a +Imported: Function Encoding_InvalidSuperRootVersion(): 0xc06b5238 +Imported: Function gameOver(): 0xbdb337d1 +Imported: Function FLOOR_CALLDATA_OVERHEAD(): 0xe46e245a +Imported: Function L2ContractsManager_DowngradeNotAllowed(address): 0xf8ce5d16 +Imported: Function NativeAssetLiquidity_InsufficientBalance(): 0x7b7f21e9 +Imported: Function SuperFaultDisputeGameInvalidRootClaim(): 0x2cfac082 +Imported: Function pause(bytes32,address,bytes): 0x142b53c9 +Imported: Function ProxyAdminOwnedBase_NotProxyAdminOrProxyAdminOwner(): 0xc4050a26 +Imported: Function unpause(address): 0x57b001f9 +Imported: Function ownerOf(uint256): 0x6352211e +Imported: Function validate((address,bytes32,uint256,address),bool): 0x41fe5385 +Imported: Function validateWithOverrides((address,bytes32,uint256,address),bool,(address,address)): 0x0e9d5cb9 +Imported: Function respectedGameTypeUpdatedAt(): 0x4fd0434c +Imported: Function unlockBond(uint256,bytes): 0x93988233 +Imported: Function validateMigrationWithOverrides((address,address[],(address,address,address,address)[],(address,address,address),(uint32,uint256)[],(bytes32,uint256),uint32,bytes32,address),bool,(address,address),(address,address,address,address,address,address,address,address),(address,uint256,address)): 0x2d3ba474 +Imported: Function Irrevocable(): 0x157bd4c3 +Imported: Function OPContractsManagerUtils_ExtraTagInProd(address): 0xea91cf73 +Imported: Function MIN_BOND_SIZE(): 0x7051472e +Imported: Function initLPP(uint256,uint32,uint32): 0xfaf37bc7 +Imported: Function MINT_CAP(): 0x98f1312e +Imported: Function L1_ERC_721_BRIDGE_SLOT(): 0x19f5cea8 +Imported: Function OPCM_SLOT(): 0x2efe2c63 +Imported: Function daFootprintGasScalar(): 0xfe3d5710 +Imported: Function l1ERC721Bridge(): 0xc4e8ddfa +Imported: Function withdrawals(address,address): 0xcd47bde1 +Imported: Function TimelockGuard_TransactionAlreadyCancelled(): 0x3e8b8389 +Imported: Function unlockETH(uint256): 0x8d445bd0 +Imported: Function finalizeBridgeERC721(address,address,address,address,uint256,bytes): 0x761f4493 +Imported: Function guardianSafe(): 0x9d786a02 +Imported: Function ReservedBitsSet(): 0xb214675a +Imported: Function isModuleEnabled(address): 0x2d9ad53d +Imported: Function InvalidAmount(): 0x2c5211c6 +Imported: Function optimismPortalImpl(): 0xa38d5595 +Imported: Function NoChainIdNeeded(): 0x223db394 +Imported: Function blobBaseFeeScalar(): 0x68d5dca6 +Imported: Function SaferSafes_InsufficientLivenessResponsePeriod(): 0x47dca1ce +Imported: Function reveal(bytes): 0x72f12a5d +Imported: Function upgradePredeploys(address): 0x7c36f37e +Imported: Function setDevFeatureBitmap(bytes32): 0x1bec9d65 +Imported: Function ProxyAdminOwnedBase_NotSharedProxyAdminOwner(): 0x075c4314 +Imported: Function challenge(): 0xd2ef7398 +Imported: Function ContentLengthMismatch(): 0x66c94485 +Imported: Function NotInitializing(): 0xd7e6bcf8 +Imported: Function setEcotone(): 0x22b90ab3 +Imported: Function InvalidRevocation(): 0xccf3bb27 +Imported: Function gameArgs(uint32): 0x74cc86ac +Imported: Function DeadlineExpired(): 0x1ab7da6b +Imported: Function isDevFeatureEnabled(bytes32): 0x78ecabce +Imported: Function proposalParts(address,uint256): 0xb2e67ba8 +Imported: Function l2Bridge(): 0xae1f6aaf +Imported: Function loadBytes(address,bytes4,string,(string,bytes)[]): 0x1deed3ca +Imported: Function OPContractsManagerUtils_OZv5InitializableUnsupported(): 0xc372c509 +Imported: Function upgradeTo(address): 0x3659cfe6 +Imported: Function validateWithOverrides((address,bytes32,bytes32,uint256,address),bool,(address,address)): 0x8970ac44 +Imported: Function optimismPortal(): 0x0a49cb03 +Imported: Function TimelockGuard_InvalidVersion(): 0x9e2f7c4b +Imported: Function revokeByDelegation((bytes32,(bytes32,uint256),(uint8,bytes32,bytes32),address,uint64)): 0xa6d4dbc7 +Imported: Function pause(address): 0x76a67a51 +Imported: Function finalizeBridgeERC20(address,address,address,address,uint256,bytes): 0x0166a07a +Imported: Function OPContractsManagerUtils_DowngradeNotAllowed(address): 0xbfa4420d +Imported: Function delayedWETHImpl(): 0x74459cf3 +Imported: Function governanceToken(): 0xf96dae0a +Imported: Function minOwners(): 0x4b810d3e +Imported: Function baseTokenURI(): 0xd547cfb7 +Imported: Function AccessDenied(): 0x4ca88867 +Imported: Function InvalidOffset(): 0x01da1572 +Imported: Function optimismMintableERC20FactoryImpl(): 0xe3fef4a8 +Imported: Function OptimismPortal_NoReentrancy(): 0xdfeaaeb8 +Imported: Function clockExtension(): 0x6b6716c0 +Imported: Function removeOwners(address[],address[]): 0xf6ac15c4 +Imported: Function WrongStartingBlock(): 0x60f95d5a +Imported: Function configureLivenessModule((uint256,address)): 0x05ccf606 +Imported: Function status(): 0x200d2ed2 +Imported: Function GameAlreadyExists(bytes32): 0x014f6fe5 +Imported: Function InvalidParent(): 0x5f53dd98 +Imported: Function deposit(): 0xd0e30db0 +Imported: Function devFeatureBitmap(): 0x1d8a4e92 +Imported: Function MIN_GAS_DYNAMIC_OVERHEAD_DENOMINATOR(): 0x0c568498 +Imported: Function oracle(): 0x7dc0d1d0 +Imported: Function setAnchorState(address): 0x17cf21a9 +Imported: Function getImplementation(): 0xaaf10f42 +Imported: Function resolveWindow(): 0x21cf39ee +Imported: Function L2ContractsManager_OnlyDelegatecall(): 0xada337cf +Imported: Function version(): 0x54fd4d50 +Imported: Function getGameImpl(uint32): 0xd457c3e0 +Imported: Function OPContractsManagerMigrator_ChainIdsNotAscending(): 0xe5665c6c +Imported: Function otherBridge(): 0xc89701a2 +Imported: Function OPContractsManagerV2_OnlyDelegateCall(): 0xccafc377 +Imported: Function pausable(address): 0x32dfadd9 +Imported: Function LivenessModule2_ResponsePeriodEnded(): 0xeb911af0 +Imported: Function eip1559Denominator(): 0xd220a9e0 +Imported: Function setUint(bytes32,uint256): 0xe2a4853a +Imported: Function setIsthmus(): 0x291b0383 +Imported: Function proposals(uint256): 0x013cf08b +Imported: Function sentMessages(uint256): 0xbc294d7d +Imported: Function faultDisputeGameImpl(): 0xdea21984 +Imported: Function IdOriginNotL2ToL2CrossDomainMessenger(): 0x7987c157 +Imported: Function ProxyAdminOwnedBase_ProxyAdminNotFound(): 0x332144db +Imported: Function LivenessModule2_ModuleStillEnabled(): 0x70a38094 +Imported: Function getRevokeTypeHash(): 0xb83010d3 +Imported: Function setBytes32(bytes32,bytes32): 0x4e91db08 +Imported: Function OPContractsManagerMigrator_ProxyAdminOwnerMismatch(): 0xd6fb21cd +Imported: Function addressManager(): 0x3ab76e9f +Imported: Function isGameFinalized(address): 0x0314d2b3 +Imported: Function OPContractsManagerMigrator_SuperchainConfigMismatch(): 0xb24781a0 +Imported: Function proposalBranches(address,uint256,uint256): 0xb4801e61 +Imported: Function L2ProxyAdmin__L2ContractsManagerNotDeployed(address): 0xe1e56d9d +Imported: Function anchorGame(): 0xe0a840eb +Imported: Function baseGas(bytes,uint32): 0xb28ade25 +Imported: Function startingBlockNumber(): 0x70872aa5 +Imported: Function MINT_PERIOD(): 0x83ea6e97 +Imported: Function LivenessModule2_UnauthorizedCaller(): 0xa1f20820 +Imported: Function isAttestationValid(bytes32): 0xe30bb563 +Imported: Function minters(address): 0xf46eccc4 +Imported: Function Unauthorized(): 0x82b42900 +Imported: Function isLocalOrGlobalPaused(address): 0x9956fd9e +Imported: Function blobbasefeeScalar(): 0xec707517 +Imported: Function LiquidityController_Unauthorized(): 0x5fbc4ede +Imported: Function checkpoints(address,uint32): 0xf1127ed8 +Imported: Function TimelockGuard_TransactionAlreadyExecuted(): 0x183ca431 +Imported: Function createOptimismMintableERC20(address,string,string): 0xce5ac90f +Imported: Function l2TokenBridge(): 0x91c49bf8 +Imported: Function BondTooLow(uint256,uint256): 0x000155b5 +Imported: Function OPContractsManagerMigrator_InvalidStartingAnchorRoot(): 0xccf0a891 +Imported: Function extraData(): 0x609d3334 +Imported: Function ZK_DISPUTE_GAME(): 0x7c4e6c3c +Imported: Function livenessInterval(): 0x38af7c5c +Imported: Function getAttestTypeHash(): 0x12b11a17 +Imported: Function OutOfOrderResolution(): 0x9a076646 +Imported: Function l2ChainId(): 0xd6ae3cd5 +Imported: Function getDomainSeparator(): 0xed24911d +Imported: Function getStartingAnchorRoot(): 0x664ed830 +Imported: Function SUPER_ROOT_GAMES_MIGRATION(): 0x57411566 +Imported: Function MIN_GAS_DYNAMIC_OVERHEAD_NUMERATOR(): 0x2828d7e8 +Imported: Function eip712Domain(): 0x84b0196e +Imported: Function createOptimismMintableERC20WithDecimals(address,string,string,uint8): 0x8cf0629c +Imported: Function AlreadyExists(): 0x23369fa6 +Imported: Function createStandardL2Token(address,string,string): 0x896f93d1 +Imported: Function zeroHashes(uint256): 0x7ac54767 +Imported: Function gameType(): 0xbbdc02db +Imported: Function loadKeccak256PreimagePart(uint256,bytes): 0xe1592611 +Imported: Function LivenessModule2_ChallengeDoesNotExist(): 0x09f95920 +Imported: Function create(string,(bool,uint256,address,bytes,(address,bytes,uint256)[])): 0xe551cdaa +Imported: Function LivenessModule2_InvalidFallbackOwner(): 0x552dd1b7 +Imported: Function CrossL2Inbox_NoExecutingDeposits(): 0xdc9f4daa +Imported: Function mint(address,uint256): 0x40c10f19 +Imported: Function step(uint256,bool,bytes,bytes): 0xd8cc1a3c +Imported: Function getGameUUID(uint32,bytes32,bytes): 0x96cd9720 +Imported: Function InvalidMessage(): 0x6eca2e4b +Imported: Function getSchemaRegistry(): 0xf10b5cc8 +Imported: Function rootClaim(): 0xbcef3b55 +Imported: Function L2DevFeatureFlags_Unauthorized(): 0xee37fa85 +Imported: Function l2Sender(): 0x9bf62d82 +Imported: Function proxyAdmin(): 0x3e47158c +Imported: Function migrateLiquidity(address): 0x438ab5ac +Imported: Function InvalidInitialization(): 0xf92ee8a9 +Imported: Function l1FeeOverhead(): 0x8b239f73 +Imported: Function setDAFootprintGasScalar(uint16): 0x20f06fdc +Imported: Function anchors(uint32): 0x7258a807 +Imported: Function provenWithdrawals(bytes32,address): 0xbb2c727e +Imported: Function InvalidPreimage(): 0x1968a902 +Imported: Function OPContractsManagerMigrator_CustomGasTokenNotSupported(): 0xfba76236 +Imported: Function PartOffsetOOB(): 0xfe254987 +Imported: Function claimCredit(address): 0x60e27464 +Imported: Function ChallengeNotActive(): 0xbeb11d3b +Imported: Function NoImplementation(uint32): 0x031c6de4 +Imported: Function isOptimismMintableERC721(address): 0x5572acae +Imported: Function SemverComp_InvalidSemverParts(): 0x9eda858c +Imported: Function l2BlockNumberChallenger(): 0x30dbe570 +Imported: Function messageVersion(): 0x52617f3c +Imported: Function PolicyEngineStaking_ZeroBeneficiary(): 0xda8aa8a1 +Imported: Function NotEOA(): 0xba092d16 +Imported: Function TimelockGuard_GuardNotConfigured(): 0x0832dd69 +Imported: Function step(bytes,bytes,bytes32): 0xe14ced32 +Imported: Function finalizeWithdrawalTransactionExternalProof((uint256,address,address,uint256,uint256,bytes),address): 0x43ca1c50 +Imported: Function MIN_GAS_CALLDATA_OVERHEAD(): 0x028f85f7 +Imported: Function proxyAdminOwner(): 0xdad544e0 +Imported: Function OptimismPortal_InvalidDisputeGame(): 0xe29927ed +Imported: Function isPermittedMigrateSequence(address,address): 0x35b27eb2 +Imported: Function l1CrossDomainMessengerImpl(): 0x58256afb +Imported: Function Encoding_InvalidSuperRootEncoding(): 0xb11ecfc0 +Imported: Function parentIndex(): 0x7948690a +Imported: Function BondTransferFailed(): 0x83e6cc6b +Imported: Function delay(): 0x6a42b8f8 +Imported: Function StatesNotContiguous(): 0x9a3b1199 +Imported: Function InvalidShortString(): 0xb3512b0c +Imported: Function absolutePrestate(): 0x8d450a95 +Imported: Function performMoves(address,(uint256,bytes32,bool)[]): 0xf25792cd +Imported: Function opcmV2(): 0x9106fd38 +Imported: Function toRpcHexString(uint256): 0x3e7d7733 +Imported: Function implementations(): 0x30e9012c +Imported: Function deterministicDeploymentProxy(): 0xe0145f5c +Imported: Function scheduledTransaction(address,bytes32): 0x12492d97 +Imported: Function ETHLockbox_DifferentSuperchainConfig(): 0x84ab5515 +Imported: Function modules(address): 0xa8ee49fe +Imported: Function withdrawERC20(address,address,uint256): 0x44004cc1 +Imported: Function isIsthmus(): 0xb54501bc +Imported: Function initialize(address,uint256): 0xcd6dc687 +Imported: Function withdrawalNetwork(): 0x82356d8a +Imported: Function loadLocalData(uint256,bytes32,bytes32,uint256,uint256): 0x52f0f3ad +Imported: Function recipient(): 0x66d003ac +Imported: Function getNonce(address): 0x2d0335ab +Imported: Function sendMessage(address,bytes,uint32): 0x3dbb202b +Imported: Function setMinBaseFee(uint64): 0x7616f0e8 +Imported: Function AlreadyRevoked(): 0x905e7107 +Imported: Function unlock(address,uint256): 0x7eee288d +Imported: Function OptimismPortal_LockboxNotAuthorizedForPortal(): 0x77cc4b2e +Imported: Function withdrawTo(address,address,uint256,uint32,bytes): 0xa3a79548 +Imported: Function AlreadyInitialized(): 0x0dc149f0 +Imported: Function GameDepthExceeded(): 0x56f57b2b +Imported: Function InsufficientValue(): 0x11011294 +Imported: Function thresholdPercentage(): 0x4ed2859e +Imported: Function relayMessage(uint256,address,address,uint256,uint256,bytes): 0xd764ad0b +Imported: Function validateMigratedChain((address,address[],(address,address,address,address)[],(address,address,address),(uint32,uint256)[],(bytes32,uint256),uint32,bytes32,address),bool): 0x3b16016e +Imported: Function WITHDRAWAL_NETWORK(): 0xd0e12f90 +Imported: Function passMessageToL1(bytes): 0xcafa81dc +Imported: Function startingRootHash(): 0x25fc2ace +Imported: Function setBool(bytes32,bool): 0xabfdcced +Imported: Function OptimismPortal_CallPaused(): 0xb9c3c2ef +Imported: Function numProofSubmitters(bytes32): 0x513747ab +Imported: Function finalizeBridgeETH(address,address,uint256,bytes): 0x1635f5fd +Imported: Function refundModeCredit(address): 0xc0d8bb74 +Imported: Function InvalidRegistry(): 0x11a1e697 +Imported: Function L2ContractsManager_InitializingDuringUpgrade(): 0xc996d784 +Imported: Function deploy(bytes32,bytes): 0xcdcb760a +Imported: Function LivenessModule2_InvalidVersion(): 0xda21aed9 +Imported: Function challenger(): 0x534db0e2 +Imported: Function mint(uint256): 0xa0712d68 +Imported: Function InvalidAttestations(): 0xe8bee839 +Imported: Function deposits(address,address,uint256): 0x5d93a3fc +Imported: Function DeploymentFailed(): 0x30116425 +Imported: Function checkTransaction(address,uint256,bytes,uint8,uint256,uint256,uint256,address,address,bytes,address): 0x75f0bb52 +Imported: Function PolicyEngineStaking_SelfAllowlist(): 0xe541fb4a +Imported: Function variableResolutionCostPrecision(): 0x4ebaf3ce +Imported: Function StringTooLong(string): 0x305a27a9 +Imported: Function increaseNonce(uint256): 0x79f7573a +Imported: Function deputyAuthMessageTypehash(): 0xcf2e2379 +Imported: Function initiateWithdrawal(address,uint256,bytes): 0xc2b3e5ac +Imported: Function GameNotFinalized(): 0x4851bd9b +Imported: Function L2ToL1MessagePasserCGT_NotAllowedOnCGTMode(): 0xcdfaa111 +Imported: Function OwnerRemovalFailed(string): 0xe94e84e9 +Imported: Function setWithdrawalRoute(address,uint8): 0xb6c3ffec +Imported: Function createGameWithClaims(address,uint32,bytes32,bytes,(uint256,bytes32,bool)[]): 0xfd7cf859 +Imported: Function verify((address,bytes,bytes32,uint32),bytes32,bytes): 0xd855814f +Imported: Function chainIdToBatchInboxAddress(uint256): 0x318b1b80 +Imported: Function proposalBonds(address,uint256): 0xddcd58de +Imported: Function messageNonce(): 0xecc70428 +Imported: Function PROOF_TYPEHASH(): 0x8b3e3bf6 +Imported: Function isPermittedUpgradeSequence(address): 0xe7f75229 +Imported: Function bondSize(): 0x7099c581 +Imported: Function assertValidSuperPermissionedDisputeGame((string,address,(address,address,address),address,address,string),(address,address)): 0x8e56e820 +Imported: Function sp1PlonkAdapterImpl(): 0x36862b0e +Imported: Function donateETH(): 0x8b4c40b0 +Imported: Function TimelockGuard_InvalidTimelockDelay(): 0xa0ce228b +Imported: Function depositTransaction(address,uint256,uint64,bool,bytes): 0xe9e05c42 +Imported: Function InvalidCrossDomainSender(): 0xbc22e2aa +Imported: Function OptimismPortal_GasLimitTooLow(): 0x70c8bdbd +Imported: Function upgrade(address,address,address,bytes,bytes32,uint8): 0x9d3f3edb +Imported: Function InvalidHeader(): 0xbabb01dd +Imported: Function NotInAccessList(): 0xe3c00816 +Imported: Function setUpgrading(bool): 0x07c8f7b0 +Imported: Function DENOMINATOR(): 0x918f8674 +Imported: Function drip((address,bytes,bytes32,uint32),(address,bytes32,bytes)): 0xb1510e43 +Imported: Function cancellationThreshold(address): 0xe647dee1 +Imported: Function pauseTimestamps(address): 0x0e3b6d1f +Imported: Function totalProcessed(): 0x84411d65 +Imported: Function getOperatorFee(uint256): 0x275aedd2 +Imported: Function depositERC20(address,address,uint256,uint32,bytes): 0x58a997f6 +Imported: Function verifierType(): 0x170227f7 +Imported: Function challengerBond(): 0x68ccdc86 +Imported: Function DOMAIN_SEPARATOR(): 0x3644e515 +Imported: Function L2ProxyAdmin__UpgradeFailed(bytes): 0x1c0a89cc +Imported: Function UnknownCommitmentType(uint8): 0x81ff0713 +Imported: Function sequenceNumber(): 0x64ca23ef +Imported: Function PERMISSIONED_ARGS_LENGTH(): 0xb0e55afd +Imported: Function verify(bytes32,bytes,bytes): 0x5bf48e3a +Imported: Function getInstructionByKey((string,bytes)[],string): 0xa96c46d6 +Imported: Function getChallengePeriodEnd(address): 0xe10ffc92 +Imported: Function BytesArrayTooLong(): 0x5623dc1c +Imported: Function upgrade(): 0xd55ec697 +Imported: Function OptimismPortal_CalldataTooLarge(): 0x5aa3bac9 +Imported: Function authorizeMinter(address): 0x0c984832 +Imported: Function maxChallengeDuration(): 0xd2177bdd +Imported: Function OPContractsManagerMigrator_InvalidStartingRespectedGameType(): 0xe08e9618 +Imported: Function isLocal(): 0x0ee04629 +Imported: Function rootClaimByChainId(uint256): 0x5e234947 +Imported: Function subgames(uint256,uint256): 0x2ad69aeb +Imported: Function peData(address): 0xc24d2c15 +Imported: Function InvalidParentGame(): 0x346119f7 +Imported: Function anchorStateRegistryImpl(): 0x2aecd35c +Imported: Function livenessSafeConfiguration(address): 0x47c03223 +Imported: Function anchorStateRegistry(): 0x5c0cba33 +Imported: Function setResolverRefundPercentage(uint256): 0x336409fd +Imported: Function validateCommitment(bytes): 0x93fb1944 +Imported: Function setL1BlockValues(uint64,uint64,uint256,bytes32,uint64,bytes32,uint256,uint256): 0x015d8eb9 +Imported: Function hasUnlockedCredit(address): 0x222abf45 +Imported: Function assertValidSuperRootDisputeGames(string,address): 0x14555f43 +Imported: Function assertValidNonSuperRootDisputeGames(string,address): 0x50812ec3 +Imported: Function migrationValidator(): 0x0c27322a +Imported: Function upgrade((address,(bool,uint256,uint32,bytes)[],(string,bytes)[])): 0x8a847e2e +Imported: Function challengeLPP(address,uint256,(uint64[25]),(bytes,uint256,bytes32),bytes32[],(bytes,uint256,bytes32),bytes32[]): 0x3909af5c +Imported: Function cancelTransaction(address,bytes32,uint256,bytes): 0x096e01f7 +Imported: Function InvalidSignature(): 0x8baa579f +Imported: Function WrongSchema(): 0x21b8eeb9 +Imported: Function L2ContractsManager_FeatureFlagMismatch(): 0xa27dcc88 +Imported: Function mipsImpl(): 0xe303272c +Imported: Function peel((address,uint256,bytes32)[]): 0x43913491 +Imported: Function KECCAK_TREE_DEPTH(): 0x2055b36b +Imported: Function OPContractsManagerV2_ZeroGameImplementation(uint32): 0x7d46f581 +Imported: Function getBytes32(bytes32): 0xa6ed563e +Imported: Function PolicyEngineStaking_ZeroAmount(): 0x2a47fdc8 +Imported: Function burn(uint256): 0x42966c68 +Imported: Function safeMint(address,uint256): 0xa1448194 +Imported: Function deploy(((address),(address),(address),(address),(address,uint256),(address,uint256,uint8),(address,uint256,uint8),(address,uint256,uint8),(address,uint256,uint8),(address,string,string),bool,bool)): 0x9300a1ab +Imported: Function setBondSize(uint256): 0xd7d04e54 +Imported: Function InvalidProposalStatus(): 0x7492a269 +Imported: Function changeAdmin(address): 0x8f283970 +Imported: Function validateMigratedChainWithOverrides((address,address[],(address,address,address,address)[],(address,address,address),(uint32,uint256)[],(bytes32,uint256),uint32,bytes32,address),bool,(address,address)): 0x495dfd3f +Imported: Function AnchorStateRegistry_InvalidAnchorGame(): 0x47ad367a +Imported: Function MAX_LEAF_COUNT(): 0x4d52b4c9 +Imported: Function PRECOMPILE_CALL_RESERVED_GAS(): 0xb5e7154c +Imported: Function getUnresolvedGames(address,uint256,uint256): 0xcf8d0f75 +Imported: Function getProxyAdmin(address): 0xf3b7dead +Imported: Function DisputeMonitorHelper_InvalidSearchRange(): 0xb22d5a5c +Imported: Function setStorage(bytes32,bytes32): 0x9b0b0fda +Imported: Function initialize(address,address): 0x485cc955 +Imported: Function getDripInterval(string): 0x90547c14 +Imported: Function validateMigration((address,address[],(address,address,address,address)[],(address,address,address),(uint32,uint256)[],(bytes32,uint256),uint32,bytes32,address),bool,(address,address,address,address,address,address,address,address),(address,uint256,address)): 0x3c3c3bcf +Imported: Function UnexpectedString(): 0x4b9c6abe +Imported: Function safeTransferFrom(address,address,uint256,bytes): 0xb88d4fde +Imported: Function ActiveProposal(): 0x55d4cbf9 +Imported: Function startingSequenceNumber(): 0x59cebe09 +Imported: Function multiRevokeByDelegation((bytes32,(bytes32,uint256)[],(uint8,bytes32,bytes32)[],address,uint64)[]): 0x0eabf660 +Imported: Function OTHER_BRIDGE(): 0x7f46ddb2 +Imported: Function OPContractsManagerUtils_ProxyMustLoad(string): 0x391074c9 +Imported: Function InvalidAttestation(): 0xbd8ba84d +Imported: Function resendMessage(uint256,uint256,address,address,bytes): 0x6b0c3c5e +Imported: Function NativeAssetLiquidity_Unauthorized(): 0x565369fa +Imported: Function SystemConfig_InvalidFeatureState(): 0xf5828b04 +Imported: Function OPContractsManagerMigrator_ZeroL2ChainId(): 0x0a3bb03c +Imported: Function computeSalt(uint256,string,string): 0x3bec67a0 +Imported: Function startingOutputRoot(): 0x57da950e +Imported: Function OPTIMISM_PORTAL_INTEROP(): 0x98e15962 +Imported: Function OptimismPortal_AlreadyFinalized(): 0x730a1074 +Imported: Function ValidStep(): 0xfb4e40dd +Imported: Function overhead(): 0x0c18c162 +Imported: Function proposalMetadata(address,uint256): 0x6551927b +Imported: Function challengeWindow(): 0x861a1412 +Imported: Function status(string,uint8): 0x9bc94d01 +Imported: Function increaseAllowance(address,uint256): 0x39509351 +Imported: Function multiRevoke((bytes32,(bytes32,uint256)[])[]): 0x4cb7e9e5 +Imported: Function ClaimAlreadyExists(): 0x80497e3b +Imported: Function makeGameArgs(uint256,address,address,(bool,uint256,uint32,bytes)): 0x8e4a6ec7 +Imported: Function L2ContractsManager_InvalidV5Offset(): 0x10415a29 +Imported: Function lockETH(): 0x1ee116bf +Imported: Function PERMIT2(): 0x6afdd850 +Imported: Function setAddress(bytes32,address): 0xca446dd9 +Imported: Function showLiveness(): 0x4c205d0d +Imported: Function WithdrawalFailed(): 0x27fcd9d1 +Imported: Function l1StandardBridgeImpl(): 0xc34e047a +Imported: Function L2ContractsManager_EmptyImplementation(address): 0x1d38e985 +Imported: Function OwnableInvalidOwner(address): 0x1e4fbdf7 +Imported: Function gameCreator(): 0x37b1b229 +Imported: Function baseFeeScalar(): 0xc5985918 +Imported: Function GameNotInProgress(): 0x67fe1950 +Imported: Function paused(address): 0x2e48152c +Imported: Function setUnsafeBlockSigner(address): 0x18d13918 +Imported: Function pendingTransactions(address): 0xc127fd39 +Imported: Function getName(): 0x17d7de7c +Imported: Function deleteProvenWithdrawal(bytes32,address): 0xba93107d +Imported: Function OptimismPortal_MigratingToSameRegistry(): 0x785df911 +Imported: Function START_BLOCK_SLOT(): 0xe0e2016d +Imported: Function calculateChecksum((address,uint256,uint256,uint256,uint256),bytes32): 0x331b637f +Imported: Function startingProposal(): 0x938d689a +Imported: Function tokenByIndex(uint256): 0x4f6ccce7 +Imported: Function burn(): 0x44df8e70 +Imported: Function totalSupply(): 0x18160ddd +Imported: Function OPContractsManagerMigrator_InvalidGameType(): 0xaa32d8b5 +Imported: Function OPContractsManagerMigrator_DuplicateL2ChainId(): 0x5b72e01f +Imported: Function IncorrectBondAmount(): 0x8620aa19 +Imported: Function setImplementation(uint32,address,bytes): 0xb1070957 +Imported: Function timestamp(): 0xb80777ea +Imported: Function ChallengeNotExpired(): 0x151f07fe +Imported: Function crossDomainMessageSender(): 0x38ffde18 +Imported: Function attestByDelegation((bytes32,(address,uint64,bool,bytes32,bytes,uint256),(uint8,bytes32,bytes32),address,uint64)): 0x3c042715 +Imported: Function claimDataLen(): 0x8980e0cc +Imported: Function AnchorStateRegistry_Unauthorized(): 0x2e5321ac +Imported: Function multiTimestamp(bytes32[]): 0xe71ff365 +Imported: Function changeProxyAdmin(address,address): 0x7eff275e +Imported: Function OutOfGas(): 0x77ebef4d +Imported: Function setL1BlockValuesIsthmus(): 0x098999be +Imported: Function depositETHTo(address,uint32,bytes): 0x9a2ac6d5 +Imported: Function OptimismPortal_InvalidInteropState(): 0x4425175b +Imported: Function getProxyImplementation(address): 0x204e1c7a +Imported: Function migrate((address[],(bool,uint256,uint32,bytes)[],(bytes32,uint256),uint32)): 0xba55287c +Imported: Function bridge(): 0xe78cea92 +Imported: Function minBaseFee(): 0xa62611a2 +Imported: Function isGameProper(address): 0x496b9c16 +Imported: Function getDripCount(): 0xf1d42b47 +Imported: Function bridgeERC20To(address,address,address,uint256,uint32,bytes): 0x540abf73 +Imported: Function UnsupportedStateVersion(): 0x1f8b02a2 +Imported: Function isCustomGasToken(): 0x21326849 +Imported: Function OPContractsManagerUtils_ConfigLoadFailed(string): 0x2fa08019 +Imported: Function setWhitelistedDeployer(address,bool): 0x08fd6322 +Imported: Function setOwner(address): 0x13af4035 +Imported: Function OPContractsManagerV2_InvalidUpgradeInput(): 0x9b506619 +Imported: Function TimelockGuard_GuardStillEnabled(): 0xa4d234cb +Imported: Function DeputyPauseModule_ExecutionFailed(string): 0x8d1364be +Imported: Function OPContractsManagerMigrator_InteropNotEnabled(): 0x626c40ef +Imported: Function owner(): 0x8da5cb5b +Imported: Function MIN_WITHDRAWAL_AMOUNT(): 0xd3e5792b +Imported: Function preimagePartOk(bytes32,uint256): 0x8542cf50 +Imported: Function pauseExpiry(): 0xf125af6b +Imported: Function remoteChainId(): 0xe9518196 +Imported: Function BadProposal(): 0xc334f069 +Imported: Function zkDisputeGameImpl(): 0x35aa1511 +Imported: Function supportsInterface(bytes4): 0x01ffc9a7 +Imported: Function isPermittedMigrateSequence(address): 0x257f19d2 +Imported: Function basefee(): 0x5cf24969 +Imported: Function revoke((bytes32,bytes32,uint64,uint64,uint64,bytes32,address,address,bool,bytes)): 0xe49617e1 +Imported: Function getPastTotalSupply(uint256): 0x8e539e8c +Imported: Function VERSION(): 0xffa1ad74 +Imported: Function OTHER_MESSENGER(): 0x9fce812c +Imported: Function decreaseAllowance(address,uint256): 0xa457c2d7 +Imported: Function getAddresses(): 0xa39fac12 +Imported: Function readPreimage(bytes32,uint256): 0xe03110e1 +Imported: Function crossDomainMessageSource(): 0x24794462 +Imported: Function getPastVotes(address,uint256): 0x3a46b1a8 +Imported: Function setBatcherHash(address): 0x0a2ca2a9 +Imported: Function ethLockbox(): 0xb682c444 +Imported: Function InvalidHeaderRLP(): 0xd81d583b +Imported: Function SuperchainConfig_NotAlreadyPaused(address): 0x335b8695 +Imported: Function DeputyPauseModule_Unauthorized(): 0x8d279ab5 +Imported: Function stakingData(address): 0xeca51139 +Imported: Function setImplementation(uint32,address): 0x14f6b1a3 +Imported: Function ETHLockbox_Paused(): 0x9e729942 +Imported: Function maximumGasLimit(): 0x0ae14b1b +Imported: Function setDeputy(address,bytes): 0x183b708b +Imported: Function receiveLiquidity(): 0x30f9765d +Imported: Function nonces(address): 0x7ecebe00 +Imported: Function setAllowedStaker(address,bool): 0x504c1183 +Imported: Function ADMIN(): 0x2a0acc6a +Imported: Function authorizePortal(address): 0xb2db82f5 +Imported: Function permissionedDisputeGameImpl(): 0x98ccec3e +Imported: Function delegate(address): 0x5c19a95c +Imported: Function failedMessages(bytes32): 0xa4e7f8bd +Imported: Function basefeeScalar(): 0xbfb14fb7 +Imported: Function setApprovalForAll(address,bool): 0xa22cb465 +Imported: Function respond(): 0xdb16aab9 +Imported: Function OptimismPortal_GasEstimation(): 0xab581036 +Imported: Function numCheckpoints(address): 0x6fcfff45 +Imported: Function InvalidResolverRefundPercentage(uint256): 0x16aa4e80 +Imported: Function startBlock(): 0x48cd4cb1 +Imported: Function OPContractsManagerUtils_UnsupportedGameType(): 0xddf137d0 +Imported: Function initialize(address,string,string): 0x90657147 +Imported: Function ZK_ARGS_LENGTH(): 0xeb10e1bb +Imported: Function ethLockboxImpl(): 0x7b491a98 +Imported: Function ChallengeExists(): 0x9bb6c64e +Imported: Function multiRevokeOffchain(bytes32[]): 0x13893f61 +Imported: Function OPContractsManagerV2_InvalidGameConfigs(): 0x7c165cd6 +Imported: Function getVotes(address): 0x9ab24eb0 +Imported: Function superPermissionedDisputeGameImpl(): 0x0af2d917 +Imported: Function gasPayingTokenSymbol(): 0x550fcdc9 +Imported: Function UNSAFE_BLOCK_SIGNER_SLOT(): 0x4f16540b +Imported: Function MessageTargetL2ToL2CrossDomainMessenger(): 0x4faa2509 +Imported: Function attack(bytes32,uint256,bytes32): 0x472777c6 +Imported: Function authorizedLockboxes(address): 0x225ce176 +Imported: Function ParentGameNotResolved(): 0x92c506ae +Imported: Function gameCount(): 0x4d1975b4 +Imported: Function OptimismPortal_ImproperDisputeGame(): 0xf395240e +Imported: Function vm(): 0x3a768463 +Imported: Function OptimismPortal_ZeroAddress(): 0x70fba0c5 +Imported: Function UnsupportedERCVersion(uint8): 0x1a66c692 +Imported: Function params(): 0xcff0ab96 +Imported: Function OPContractsManagerMigrator_ChainAlreadyMigrated(): 0xd4f98c32 +Imported: Function OPContractsManagerV2_CannotUpgradeToCustomGasToken(): 0xe9b0e51a +Imported: Function InvalidPC(): 0x3f8200bc +Imported: Function balanceOf(address): 0x70a08231 +Imported: Function InvalidOutputRootProof(): 0x9cc00b5b +Imported: Function DEPOSITOR_ACCOUNT(): 0xe591b282 +Imported: Function challengeRootL2Block((bytes32,bytes32,bytes32,bytes32),bytes): 0x01935130 +Imported: Function proposalBlocks(address,uint256,uint256): 0x882856ef +Imported: Function deputy(): 0xf1c9eed7 +Imported: Function stakingToken(): 0x72f702f3 +Imported: Function ECDSAInvalidSignatureS(bytes32): 0xd78bce0c +Imported: Function loadSha256PreimagePart(uint256,bytes): 0x8dc4be11 +Imported: Function SENDER(): 0x6050f2f8 +Imported: Function OPContractsManagerMigrator_SuperchainConfigNeedsUpgrade(): 0x494a0acc +Imported: Function optimismMintableERC20Factory(): 0x9b7d7f0a +Imported: Function configure(address,(string,bool,uint256,uint256)): 0x1cb81b88 +Imported: Function sp1Verifier(): 0x52a07fa3 +Imported: Function NotFound(): 0xc5723b51 +Imported: Function L2BlockNumberChallenged(): 0x0ea2e752 +Imported: Function claimData(): 0x3ec4d4d6 +Imported: Function variableResolutionCost(): 0x23c30f59 +Imported: Function LivenessModule2_ModuleNotEnabled(): 0x9fdada31 +Imported: Function PORTAL(): 0x0ff754ea +Imported: Function disputeGameFactory(): 0xf2b4e617 +Imported: Function getAnchorRoot(): 0xd83ef267 +Imported: Function createOptimismMintableERC721(address,string,string): 0xd97df652 +Imported: Function DeputyPauseModule_SuperchainNotPaused(): 0xeb7171cd +Imported: Function eip1559Elasticity(): 0xc9ff2d16 +Imported: Function bridgeERC721(address,address,uint256,uint32,bytes): 0x3687011a +Imported: Function GameNotOver(): 0x04643c39 +Imported: Function executable(string): 0xfc3e3eba +Imported: Function getChallenge(uint256,bytes): 0x848afb3d +Imported: Function getDripStatus(string): 0x0d8f4697 +Imported: Function OPTIMISM_PORTAL_SLOT(): 0xfd32aa0f +Imported: Function tokenOfOwnerByIndex(address,uint256): 0x2f745c59 +Imported: Function gameImpls(uint32): 0x1b685b9e +Imported: Function SuperchainConfig_OnlyGuardian(): 0xafbe9bc6 +Imported: Function lastUsedOPCMVersion(): 0x9fabcc84 +Imported: Function blobBaseFee(): 0xf8206140 +Imported: Function NotEntered(): 0xbca35af6 +Imported: Function migrateLiquidity(): 0xbda204bb +Imported: Function challengePeriod(): 0xf3f480d9 +Imported: Function upgradeAndCall(address,address,bytes): 0x9623609d +Imported: Function OPContractsManagerV2_SuperchainConfigNeedsUpgrade(): 0x3afa7308 +Imported: Function BadExtraData(): 0x9824bdab +Imported: Function OPContractsManagerMigrator_ZKDisputeGameNotEnabled(): 0x8cc8cc34 +Imported: Function validateMessage((address,uint256,uint256,uint256,uint256),bytes32): 0xab4d6f75 +Imported: Function claims(bytes32): 0xeff0f592 +Imported: Function initialize(): 0x8129fc1c +Imported: Function allowance(address,address): 0xdd62ed3e +Imported: Function setBatcherHash(bytes32): 0xc9b26f61 +Imported: Function l1FeeScalar(): 0x9e8c4966 +Imported: Function weth(): 0x3fc8cef3 +Imported: Function OptimismPortal_DisputeGameNotInvalidated(): 0x42102de6 +Imported: Function TimelockGuard_TransactionAlreadyScheduled(): 0x80394de6 +Imported: Function implementation(): 0x5c60da1b +Imported: Function getTreeRootLPP(address,uint256): 0x0359a563 +Imported: Function bridgeETH(uint32,bytes): 0x09fc8843 +Imported: Function OptimismPortal_NotAllowedOnCGTMode(): 0xbd58e0a2 +Imported: Function setGasLimit(uint64): 0xb40a817c +Imported: Function UnexpectedRootClaim(bytes32): 0xf40239db +Imported: Function isGameClaimValid(address): 0x6c4f4467 +Imported: Function L1_CROSS_DOMAIN_MESSENGER_SLOT(): 0x5d73369c +Imported: Function l2BlockNumberChallenged(): 0x3e3ac912 +Imported: Function resolveClaim(uint256,uint256): 0x03c2924d +Imported: Function multiAttest((bytes32,bytes32,uint64,uint64,uint64,bytes32,address,address,bool,bytes)[],uint256[]): 0x91db0b7e +Imported: Function loadOrDeployProxy(address,bytes4,(address,address,uint256,string),string,(string,bytes)[]): 0x5e498f1d +Imported: Function LivenessModule2_ModuleNotConfigured(): 0xa0fe939b +Imported: Function contractsContainer(): 0x5a4dab33 +Imported: Function AlreadyFinalized(): 0x475a2535 +Imported: Function operatorFeeScalar(): 0x4d5d9a2a +Imported: Function baseFee(): 0x6ef25c3a +Imported: Function updateRetirementTimestamp(): 0xd5a3e12e +Imported: Function InvalidExpirationTime(): 0x08e8b937 +Imported: Function finalizedWithdrawals(bytes32): 0xa14238e7 +Imported: Function maxCancellationThreshold(address): 0xc9713656 +Imported: Function AlreadyTimestamped(): 0x2e267946 +Imported: Function bridgeERC20(address,address,uint256,uint32,bytes): 0x87087623 +Imported: Function proveWithdrawalTransaction((uint256,address,address,uint256,uint256,bytes),uint256,(bytes32,bytes32,bytes32,bytes32),bytes[]): 0x4870496f +Imported: Function isMatchingInstructionByKey((string,bytes),string): 0xa24a6bf9 +Imported: Function remoteChainID(): 0xd2382242 +Imported: Function proofSubmitters(bytes32,uint256): 0xa3860f48 +Imported: Function RELAY_CALL_OVERHEAD(): 0x4c1d6a69 +Imported: Function NoCreditToClaim(): 0x17bfe5f7 +Imported: Function GameOver(): 0xdf469ccb +Imported: Function ReinitializableBase_ZeroInitVersion(): 0x9b01afed +Imported: Function ETHLockbox_Unauthorized(): 0x665a1d1c +Imported: Function disputeGameBlacklist(address): 0x45884d32 +Imported: Function isJovian(): 0x105d0b81 +Imported: Function ZeroAddress(): 0xd92e233d +Imported: Function InvalidLength(): 0x947d5a84 +Imported: Function depositETH(uint32,bytes): 0xb1a1a882 +Imported: Function changeOwnershipToFallback(address): 0xbceb8eda +Imported: Function InvalidDisputedClaimIndex(): 0x30140332 +Imported: Function UnexpectedList(): 0x1ff9b2e4 +Imported: Function systemConfig(): 0x33d7e2bd +Imported: Function ConditionalDeployer_DeploymentFailed(bytes): 0xcb0fc6f7 +Imported: Function isGameRegistered(address,address): 0xc376d31f +Imported: Function OptimismPortal_NotUsingLockbox(): 0x90dec371 +Imported: Function EmptyInitcode(): 0x028512d4 +Imported: Function resolverRefundPercentage(): 0x8ecb85e1 +Imported: Function guardian(): 0x452a9320 +Imported: Function getRevokeOffchain(address,bytes32): 0xb469318d +Imported: Function TimelockGuard_GuardNotEnabled(): 0x3f4b2966 +Imported: Function withdraw(address,uint256,uint32,bytes): 0x32b7006d +Imported: Function deauthorizeMinter(address): 0xc6f69fbb +Imported: Function resolve(uint256,bytes,bytes): 0x7ae929d9 +Imported: Function superFaultDisputeGameImpl(): 0x5c122ac1 +Imported: Function migrateToSharedDisputeGame(address,address): 0xd36d4274 +Imported: Function OptimismPortal_BadTarget(): 0xc5defbad +Imported: Function withdraw(uint256): 0x2e1a7d4d +Imported: Function ClaimAlreadyResolved(): 0xf1a94581 +Imported: Function successfulMessages(bytes32): 0xb1b1b209 +Imported: Function l1ERC721BridgeImpl(): 0x7d8bd0d8 +Imported: Function acceptOwnership(): 0x79ba5097 +Imported: Function timestamp(bytes32): 0x4d003070 +Imported: Function l1FeeWallet(): 0xd4ff9218 +Imported: Function initialize(address,address,(bytes32,uint256),uint32): 0x47a222c5 +Imported: Function defend(bytes32,uint256,bytes32): 0x7b0f0adc +Imported: Function assertValidDelayedWETH(string,address,address,address,address,address,uint256,string): 0x360d339f +Imported: Function EventPayloadNotSentMessage(): 0xdf1eb586 +Imported: Function TOKEN(): 0x82bfefc8 +Imported: Function isFjord(): 0x960e3a23 +Imported: Function gameData(): 0xfa24f743 +Imported: Function minimumGasLimit(): 0x4add321d +Imported: Function challengeStartTime(address): 0x96de45a4 +Imported: Function l1Head(): 0x6361506d +Imported: Function getUint(bytes32): 0xbd02d0f5 +Imported: Function getChallengerDuration(uint256): 0xbd8da956 +Imported: Function isGameRetired(address): 0x5958a193 +Imported: Function upgrade(address,address): 0x99a88ec4 +Imported: Function withdrawETH(address,uint256): 0x4782f779 +Imported: Function bridgeETHTo(address,uint32,bytes): 0xe11013dd +Imported: Function fixedResolutionCost(): 0x95611852 +Imported: Function OptimismPortal_InvalidMerkleProof(): 0x2e57ef3a +Imported: Function crossDomainMessageContext(): 0x7936cbee +Imported: Function getNumToResolve(uint256): 0x5a5fa2d9 +Imported: Function DeputyPauseModule_InvalidDeputy(): 0x0618de07 +Imported: Function initialize(address,uint256,uint8): 0xb49dc741 +Imported: Function ownershipTransferredToFallback(): 0x5b2e9c03 +Imported: Function InsufficientBond(): 0xe92c469f +Imported: Function upgrade(address): 0x0900f010 +Imported: Function canRemove(address): 0xd45996f1 +Imported: Function ENCODING_OVERHEAD(): 0xddd5a40f +Imported: Function BlockNumberTooHigh(): 0xd1f79e82 +Imported: Function setImplementationName(address,string): 0x860f7cda +Imported: Function PolicyEngineStaking_ZeroAddress(): 0x55dc0e9b +Imported: Function setMinWithdrawalAmount(uint256): 0x85b5b14d +Imported: Function sendETH(address,uint256): 0x64a197f3 +Imported: Function withdraw(address,uint256): 0xf3fef3a3 +Imported: Function ECDSAInvalidSignature(): 0xf645eedf +Imported: Function setWithdrawalNetwork(uint8): 0x307f2962 +Imported: Function l1Token(): 0xc01e1bd6 +Imported: Function InvalidCommitmentLength(uint8,uint256,uint256): 0xfd9a7e5b +Imported: Function initialize(address): 0xc4d66de8 +Imported: Function withdrawalDelaySeconds(): 0x71839418 +Imported: Function move(bytes32,uint256,bytes32,bool): 0x6f034409 +Imported: Function OptimismPortal_Unproven(): 0xcca6afda +Imported: Function InvalidLocalIdent(): 0xff137e65 +Imported: Function superchainConfig(): 0x35e80ab3 +Imported: Function minProposalSize(): 0xdd24f9bf +Imported: Function bondDistributionMode(): 0x378dd48c +Imported: Function normalModeCredit(address): 0x529d6a8c +Imported: Function symbol(): 0x95d89b41 +Imported: Function xDomainMessageSender(): 0x6e296e45 +Imported: Function getSchema(bytes32): 0xa2ea7c6e +Imported: Function InvalidRevocations(): 0xbf2f3a8b +Imported: Function renounceOwnership(): 0x715018a6 +Imported: Function resolutionCheckpoints(uint256): 0xa445ece6 +Imported: Function PERMISSIONLESS_ARGS_LENGTH(): 0x37eb4fa3 +Imported: Function extend(address): 0x82005715 +Imported: Function squeezeLPP(address,uint256,(uint64[25]),(bytes,uint256,bytes32),bytes32[],(bytes,uint256,bytes32),bytes32[]): 0xd18534b5 +Imported: Function MessageAlreadyRelayed(): 0x9ca9480b +Imported: Function GameNotResolved(): 0xc105260a +Imported: Function DuplicateStep(): 0x9071e6af +Imported: Function IdentityPrecompileCallFailed(): 0xf7046f30 +Imported: Function OwnableUnauthorizedAccount(address): 0x118cdaa7 +Imported: Function OptimismPortal_ProofNotOldEnough(): 0xd9bc01be +Imported: Function L2ContractsManager_ImplNotFound(string): 0x476852c2 +Imported: Function l1TokenBridge(): 0x36c717c1 +Imported: Function ChallengeWindowNotOpen(): 0xf9e0d1f3 +Imported: Function isEcotone(): 0x4ef6e224 +Imported: Function getApproved(uint256): 0x081812fc +Imported: Function authorizeLockbox(address): 0x5ec15d89 +Imported: Function OPTIMISM_MINTABLE_ERC20_FACTORY_SLOT(): 0x06c92657 +Imported: Function delegates(address): 0x587cde1e +Imported: Function setGasConfigEcotone(uint32,uint32): 0x21d7fde5 +Imported: Function setAddress(string,address): 0x9b2ea4bd +Imported: Function isPayable(): 0xce46e046 +Imported: Function check(bytes): 0xc64b3bb5 +Imported: Function deployments(address): 0x316b3739 +Imported: Function OPContractsManagerMigrator_InvalidInitBond(): 0x108dabff +Imported: Function create(uint32,bytes32,bytes): 0x82ecf2f6 +Imported: Function gasPrice(): 0xfe173b97 +Imported: Function BadAuth(): 0xd386ef3e +Imported: Function L2ContractsManager_NotUpgradeable(address): 0xc3fe4a66 +Imported: Function blacklistDisputeGame(address): 0x7d6be8dc +Imported: Function OPContractsManagerV2_InvalidUpgradeInstruction(string): 0x09f71494 +Imported: Function retirementTimestamp(): 0x4086d183 +Imported: Function setAllowedStakers(address[],bool): 0x06eea09a +Imported: Function revealedSecrets(bytes32): 0x246167bc +Imported: Function PolicyEngineStaking_NoStake(): 0x7739be10 +Imported: Function getChallengeStatus(uint256,bytes): 0x79e8a8b3 +Imported: Function addLeavesLPP(uint256,uint256,bytes,bytes32[],bool): 0x7917de1d +Imported: Function L1Block_NotAuthorizedToSetFeature(): 0xbe9d7ca6 +Imported: Function disputeGameFactoryImpl(): 0xbb98b3f4 +Imported: Function setRecipient(address): 0x3bbed4a0 +Imported: Function mintPermittedAfter(): 0x00f8900c +Imported: Function DeputyPauseModule_NonceAlreadyUsed(): 0x73134565 +Imported: Function multiRevoke((bytes32,bytes32,uint64,uint64,uint64,bytes32,address,address,bool,bytes)[],uint256[]): 0x88e5b2d9 +Imported: Function stateVersion(): 0x1219a4e4 +Imported: Function closeGame(): 0x786b844b +Imported: Function name(): 0x06fdde03 +Imported: Function InvalidPrestate(): 0x696550ff +Imported: Function permit(address,address,uint256,uint256,uint8,bytes32,bytes32): 0xd505accf +Imported: Function opcmMigrator(): 0x01f36d45 +Imported: Function challenge(address): 0x72fb9703 +Imported: Function l1PAOMultisig(): 0xa4dec37a +Imported: Function number(): 0x8381f58a +Imported: Function l2BlockNumber(): 0x8b85902b +Imported: Function deploy((string,address,address,address,address,address,(bytes32,uint256),uint32,uint32,uint32,uint64,uint256,(uint32,uint8,uint8,uint32,uint32,uint128),(bool,uint256,uint32,bytes)[],bool)): 0xd576c5a0 +Imported: Function resolvedSubgames(uint256): 0xfe2bbeb2 +Imported: Function l1StandardBridge(): 0x078f29cf +Imported: Function finalizeWithdrawalTransaction((uint256,address,address,uint256,uint256,bytes)): 0x8c3152e9 +Imported: Function transferOwnership(address,bool): 0xb242e534 +Imported: Function InvalidExitedValue(): 0x0136cc76 +Imported: Function setBytes32((bytes32,bytes32)[]): 0x0528afe2 +Imported: Function register(string,address,bool): 0x60d7a278 +Imported: Function clearLivenessModule(): 0x6092b318 +Imported: Function finalizeETHWithdrawal(address,address,uint256,bytes): 0x1532ec34 +Imported: Function hold(address,uint256): 0x977a5ec5 +Imported: Function stake(uint128,address): 0xb166dfdd +Imported: Function OPContractsManagerMigrator_NoChains(): 0x9d11c17e +Imported: Function isMatchingInstruction((string,bytes),string,bytes): 0x88307bb5 +Imported: Function minimumGasLimit(uint64): 0xa35d99df +Imported: Function lastLive(address): 0xe458779b +Imported: Function emitLog(bytes32[],bytes): 0xedebc13b +Imported: Function AlreadyRevokedOffchain(): 0xec9d6eeb +Imported: Function ClaimAboveSplit(): 0xb34b5c22 +Imported: Function setFeature(bytes32): 0x46a4d780 +Imported: Function usedNonces(bytes32): 0xfeb61724 +Imported: Function assertValidOptimismPortal(string,address,address,address): 0x264c0e84 +Imported: Function SUPER_PERMISSIONED_ARGS_LENGTH(): 0x87637c5c +Imported: Function clearTimelockGuard(): 0x5c3b4510 +Imported: Function OPContractsManagerContainer_DevFeatureInProd(): 0xa3b4e706 +Imported: Function remoteToken(): 0xd6c0b2c4 +Imported: Function hold(address): 0xa7e21e80 +Imported: Function resolve(): 0x2810e1d6 +Imported: Function InvalidVerifier(): 0xbaa3de5f +Imported: Function L1Block_FeatureAlreadyEnabled(): 0x4f453260 +Imported: Function DELAYED_WETH_SLOT(): 0x7e54b8ad +Imported: Function LivenessModule2_ChallengeAlreadyExists(): 0x9cd90904 +Imported: Function recover(uint256): 0x0ca35682 +Imported: Function fallbackOwner(): 0x602b263b +Imported: Function initialize(address,uint256,uint256,uint256,uint256): 0xf92ad219 +Imported: Function InvalidChallengePeriod(): 0xb4e12433 +Imported: Function isDeployerAllowed(address): 0xb1540a01 +Imported: Function attest((bytes32,(address,uint64,bool,bytes32,bytes,uint256))): 0xf17325e7 +Imported: Function LivenessModule2_OwnershipTransferFailed(): 0xe330ac05 +Imported: Function ProxyAdminOwnedBase_NotProxyAdmin(): 0xe818dcc3 +Imported: Function authorizedPortals(address): 0x0fd11077 +Imported: Function UnknownChainId(): 0x0da789df +Imported: Function relayMessage((address,uint256,uint256,uint256,uint256),bytes): 0x8d1d298f +Imported: Function tokenURI(uint256): 0xc87b56dd +Imported: Function OPContractsManagerMigrator_InvalidAbsolutePrestate(): 0x0eae0411 +Imported: Function isApprovedForAll(address,address): 0xe985e9c5 +Imported: Function search(address,uint256,uint8): 0xcb4e6ab1 +Imported: Function getL1Fee(bytes): 0x49948e0e +Imported: Function DEPLOY_V2_DISPUTE_GAMES(): 0xe3ffb8ea +Imported: Function ClaimAlreadyChallenged(): 0x85c345b0 +Imported: Function isGameResolved(address): 0xfdbb3dcf +Imported: Function enableArbitraryContractDeployment(): 0xbdc7b54f +Imported: Function preimageOracleVersion(): 0xad7e7e40 +Imported: Function proposalBlocksLen(address,uint256): 0x9d53a648 +Imported: Function getAddress(string): 0xbf40fac1 +Imported: Function REMOTE_TOKEN(): 0x033964be +Imported: Function withdrawERC721(address,address,uint256): 0x4025feb2 +Imported: Function drip(string): 0x67148cd2 +Imported: Function proxyType(address): 0x6bd9f516 +Imported: Function MESSENGER(): 0x927ede2d +Imported: Function expiration(address): 0x04dbe3fe +Imported: Function unsafeBlockSigner(): 0x1fd19ee1 +Imported: Function initialize(address,address,address): 0xc0c53b8b +Imported: Function assertValidMipsVm(string,address,address,string): 0xcf26abb4 +Imported: Function totalBonds(): 0xf263c470 +Imported: Function resourceConfig(): 0xcc731b02 +Imported: Function UnexpectedGameType(): 0x86ef0f0b +Imported: Function depositERC20To(address,address,address,uint256,uint32,bytes): 0x838b2520 +Imported: Function decimals(): 0x313ce567 +Imported: Function opcmStandardValidator(): 0xba7903db +Imported: Function MessageDestinationNotRelayChain(): 0x31ac2211 +Imported: Function gasPayingToken(): 0x4397dfef +Imported: Function PolicyEngineStaking_SameBeneficiary(): 0xb69cd213 +Imported: Function isPermittedUpgradeSequence(address,address): 0x814258d1 +Imported: Function setL1BlockValuesEcotone(): 0x440a5e20 +Imported: Function OptimismPortal_NotUsingInterop(): 0x4a651100 +Imported: Function isFeatureEnabled(bytes32): 0x47af267b +Imported: Function InvalidDataRemainder(): 0x5c5537b8 +Imported: Function UnexpectedPreambleData(bytes): 0x57a05835 +Imported: Function maxProveDuration(): 0xbcbe5094 +Imported: Function timeouts(address,bytes32): 0x38757bfd +Imported: Function InvalidGameArgsLength(): 0xbff6e416 +Imported: Function claimData(uint256): 0xc6f0308c +Imported: Function TreeSizeOverflow(): 0x62295723 +Imported: Function safe(): 0x186f0354 +Imported: Function GamePaused(): 0x379a7ed9 +Imported: Function NotABlueprint(): 0x31f56e1f +Imported: Function paused(): 0x5c975abb +Imported: Function whitelist(address): 0x9b19251a +Imported: Function LivenessModule2_ResponsePeriodActive(): 0x279e3d24 +Imported: Function InvalidMemoryProof(): 0x8e77b2b7 +Imported: Function OPContractsManagerMigrator_SystemPaused(): 0x3a81b448 +Imported: Function timelockDelay(address): 0x5698b16a +Imported: Function assertValidOptimismMintableERC20Factory(string,address,address,address): 0xe23567e9 +Imported: Function OPContractsManagerV2_InvalidUpgradeSequence(string,string): 0x9193f97a +Imported: Function standardValidatorUtils(): 0x1094bfad +Imported: Function initVersion(): 0x38d38c97 +Imported: Function BRIDGE(): 0xee9a31a2 +Imported: Function setOperatorFeeScalars(uint32,uint64): 0x155b6c6f +Imported: Function InvalidProof(): 0x09bde339 +Imported: Function l2SequenceNumber(): 0x99735e32 +Imported: Function getL1BlockNumber(): 0xb9b3efe9 +Imported: Function PE_DATA_SLOT(): 0xb3999a47 +Imported: Function scheduleTransaction(address,uint256,(address,uint256,bytes,uint8,uint256,uint256,uint256,address,address),bytes): 0x0e40beec +Imported: Function CALL(address,bytes,uint256): 0x6e2d44ae +Imported: Function OptimismPortal_InvalidProofTimestamp(): 0xb4caa4e5 +Imported: Function checkWithdrawal(bytes32,address): 0x71c1566e +Imported: Function setEIP1559Params(uint32,uint32): 0xc0fd4b41 +Imported: Function isGameBlacklisted(address): 0x34a346ea +Imported: Function InvalidNonce(): 0x756688fe +Imported: Function OptimismPortal_InvalidLockboxState(): 0x9c46cd79 +Imported: Function TX_BASE_GAS(): 0x2f7d3922 +Imported: Event Proved(address): 0x5e6565d9ca2f5c8501d6418bf563322a7243ba7ace266d75eac99f4adbb30ba7 +Imported: Event Unstaked(address,uint128): 0x23eb338ed2df691870bc931bf6328c55b2708178ecf1f1b3e889afca4418adea +Imported: Event ERC20WithdrawalFinalized(address,address,address,address,uint256,bytes): 0x3ceee06c1e37648fcbb6ed52e17b3e1f275a1f8c7b22a84b2b84732431e046b3 +Imported: Event WithdrawalInitiated(address,address,address,address,uint256,bytes): 0x73d170910aba9e6d50b102db522b1dbcd796216f5128b445aa2135272886497e +Imported: Event RecipientUpdated(address,address): 0x62e69886a5df0ba8ffcacbfc1388754e7abd9bde24b036354c561f1acd4e4593 +Imported: Event PauseTriggered(address,bytes32,address): 0xaa64a95e3acb9db4deaf865d9fcc62a5d47996b643e7fcc799e3b499c9bff2d9 +Imported: Event WhitelistDisabled(address): 0xc0e106cf568e50698fdbde1eff56f5a5c966cc7958e37e276918e9e4ccdf8cd4 +Imported: Event ETHWithdrawalFinalized(address,address,uint256,bytes): 0x2ac69ee804d9a7a0984249f508dfab7cb2534b465b6ce1580f99a38ba9c5e631 +Imported: Event Withdrawal(uint256,address,address): 0xc8a211cc64b6ed1b50595a9fcb1932b6d1e5a6e8ef15b60e5b1f988ea9086bba +Imported: Event LiquidityBurned(address,uint256): 0x875e07afd7ce17c6531b1a6b7b34829dcd8b7e6639448afbd6a8e29fa1422b82 +Imported: Event WhitelistStatusChanged(address,bool): 0x8daaf060c3306c38e068a75c054bf96ecd85a3db1252712c4d93632744c42e0d +Imported: Event RelayedMessage(bytes32): 0x4641df4a962071e12719d8c8c8e5ac7fc4d97b927346a3d7a335b1f7517e133c +Imported: Event NonceIncreased(uint256,uint256): 0x57b09af877df9068fd60a69d7b21f5576b8b38955812d6ae4ac52942f1e38fb7 +Imported: Event RelayedMessage(uint256,uint256,bytes32,bytes32): 0xc270d73e26d2d39dee7ef92093555927e344e243415547ecc350b2b5385b68a2 +Imported: Event AdminChanged(address,address): 0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f +Imported: Event LiquidityMigrated(address,uint256): 0x87eb4064140fbec95a8de570e01b4c650c00ecd677560af9f298a975b636c22d +Imported: Event Resolved(uint8): 0x5e186f09b9c93491f14e277eea7faa5de6a2d4bda75a79af7a3684fbfb42da60 +Imported: Event OwnershipTransferStarted(address,address): 0x38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e22700 +Imported: Event Registered(bytes32,address,(bytes32,address,bool,string)): 0xd0b86852e21f9e5fa4bc3b0cff9757ffe243d50c4b43968a42202153d651ea5e +Imported: Event SendETH(address,address,uint256,uint256): 0xed98a2ff78833375c368471a747cdf0633024dde3f870feb08a934ac5be83402 +Imported: Event WithdrewERC20(address,address,address,uint256): 0x6b00f1c7883f053ba83e907fd1965b22fffe3c4111383e725f04638a566cdbfa +Imported: Event LiquidityDeposited(address,uint256): 0x7ff07ce9a287649537e4b012e45cf012d90228b12e2b56bb03515a6b5436fcdf +Imported: Event TransactionExecuted(address,bytes32): 0xdd4b9b318b98162cb1e7b52752a3fd110d5b7966f3b50884c1cd3bd04058e5c7 +Imported: Event TransactionScheduled(address,bytes32,uint256): 0x653f8f6fce2a503b2dfca34e95b3e4902254a11765d2658c0e5af1d64ab276cf +Imported: Event Mint(address,uint256): 0x0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885 +Imported: Event Paused(): 0x9e87fac88ff661f02d44f95383c817fece4bce600a3dab7a54406878b965e752 +Imported: Event Unpaused(): 0xa45f47fdea8a1efdd9029a5691c7f759c32b7c698632b563573e155625d16933 +Imported: Event ERC20DepositInitiated(address,address,address,address,uint256,bytes): 0x718594027abd4eaed59f95162563e0cc6d0e8d5b86b1c7be8b1b0ac3343d0396 +Imported: Event Upgraded(address): 0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b +Imported: Event Withdrawal(uint256,address,address,uint8): 0x38e04cbeb8c10f8f568618aa75be0f10b6729b8b4237743b4de20cbcde2839ee +Imported: Event RetirementTimestampSet(uint256): 0x6e5b1ba771e8e484f741ed085f039ff4e5c6e882eaf68f550fb390922d0ae4a7 +Imported: Event ReceivedETH(address,uint256): 0x4103257eaac983ca79a70d28f90dfc4fa16b619bb0c17ee7cab0d4034c279624 +Imported: Event ERC20BridgeInitiated(address,address,address,address,uint256,bytes): 0x7ff126db8024424bbfd9826e8ab82ff59136289ea440b04b39a0df1b03b9cabf +Imported: Event ImplementationDeployed(address,bytes32): 0x9b7318127ed899f286ea9ddd7925ed8ad24a682b6a825c3b5b3d88a3f00bc1d2 +Imported: Event RevokedOffchain(address,bytes32,uint64): 0x92a1f7a41a7c585a8b09e25b195e225b1d43248daca46b0faf9e0792777a2229 +Imported: Event OwnerRecorded(address): 0x833bc129023866d52116d61e94b791eb8be46f05709362e0bcf1fe7c1a8c225c +Imported: Event ChallengeStatusChanged(uint256,bytes,uint8): 0xc5d8c630ba2fdacb1db24c4599df78c7fb8cf97b5aecde34939597f6697bb1ad +Imported: Event Initialized(uint8): 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498 +Imported: Event ERC721BridgeInitiated(address,address,address,address,uint256,bytes): 0xb7460e2a880f256ebef3406116ff3eee0cee51ebccdc2a40698f87ebb2e9c1a5 +Imported: Event DripCreated(string,string,(bool,uint256,address,bytes,(address,bytes,uint256)[])): 0xe38d8d98e6cc66f6f520d483c6c5a89289681f897799c4c29d767cf57e76d9a6 +Imported: Event Revoked(address,address,bytes32,bytes32): 0xf930a6e2523c9cc298691873087a740550b8fc85a0680830414c148ed927f615 +Imported: Event LiquidityReceived(address,uint256): 0xb58278ed56aa79ad2e243963b44b165a8f76d629f61c01dd3649d658e0eacca4 +Imported: Event ETHBridgeInitiated(address,address,uint256,bytes): 0x2849b43074093a05396b6f2a937dee8565b15a48a7b3d4bffb732a5017380af5 +Imported: Event BeneficiaryAllowlistUpdated(address,address,bool): 0x8493e706a7e8e8fe92f1276d416d1bf108bf763aa6058953d8bd553b75aef8dc +Imported: Event RequiredBondSizeChanged(uint256): 0x4468d695a0389e5f9e8ef0c9aee6d84e74cc0d0e0a28c8413badb54697d1bbae +Imported: Event Move(uint256,bytes32,address): 0x9b3245740ec3b155098a55be84957a4da13eaf7f14a8bc6f53126c0b9350f2be +Imported: Event Transfer(address,address,uint256): 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef +Imported: Event SentMessage(address,address,bytes,uint256,uint256): 0xcb0f7ffd78f9aee47a248fae8db181db6eee833039123e026dcbff529522e52a +Imported: Event Burn(address,uint256): 0xcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5 +Imported: Event ImplementationExists(address): 0xfbe57d889a7f75a4e0c7da304cd158fcaddc4b925cdd9f4cfb115c0f9e48009b +Imported: Event RelayETH(address,address,uint256,uint256): 0xe5479bb8ebad3b9ac81f55f424a6289cf0a54ff2641708f41dcb2b26f264d359 +Imported: Event DeputySet(address): 0x6b5500f6cd2cd4a29ab2c706a6c65833d0633a568f7263460775cebcc8e9a99b +Imported: Event Challenged(address): 0x98027b38153f995c4b802a5c7e6365bee3addb25af6b29818c0c304684d8052c +Imported: Event Initialized(uint64): 0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2 +Imported: Event MessagePassed(uint256,address,address,uint256,uint256,bytes,bytes32): 0x02a52367d10742d8032712c1bb8e0144ff1ec5ffda1ed7d70bb05a2744955054 +Imported: Event PortalAuthorized(address): 0x90a7fac2e56aebe4889351fb04eda5efb28b19dedf288bdbfd3cfd817c79630f +Imported: Event WithdrawerBalanceBurnt(uint256): 0x7967de617a5ac1cc7eba2d6f37570a0135afa950d8bb77cdd35f0d0b4e85a16f +Imported: Event ExecutingMessage(bytes32,(address,uint256,uint256,uint256,uint256)): 0x5c37832d2e8d10e346e55ad62071a6a2f9fa5130614ef2ec6617555c6f467ba7 +Imported: Event FeatureSet(bytes32,bool): 0xb876f6594132c89891d2fd198e925e999be741ec809abb58bfe9b966876cc06c +Imported: Event ProxyCreation(string,address): 0x2b0807147ac5f5ad7b63c6e9cb89ca7845eb37da447c7f6ecf18ae41fcab8815 +Imported: Event ETHLocked(address,uint256): 0x97efc519b9020a140ffe13878e03d340b976676090bc7fe3e33191192df7c72c +Imported: Event ETHMigrated(address,uint256): 0xd893f630c6867fa43689da9ae949ebf04cac24aad3b45c759d442ed3c32e3a37 +Imported: Event Unpaused(address): 0x5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa +Imported: Event _EventToExposeStructInABI__Params((address,uint256)): 0xd675e8c1bf2f28f052b74c311412663dd60576c00ce3346b9a6d614df2b0b60b +Imported: Event LockboxAuthorized(address): 0x5d2682e700a2146c8e2381e0b407003576a54e96dd08f40f3ea0d2b8706db106 +Imported: Event GameClosed(uint8): 0x9908eaac0645df9d0704d06adc9e07337c951de2f06b5f2836151d48d5e4722f +Imported: Event DisputeGameBlacklisted(address): 0x192c289026d59a41a27f5aea08f3969b57931b0589202d14f4368cded95d3cda +Imported: Event WithdrawalProofDeleted(bytes32,address): 0xc52e609801931c8dcad3132b8a92414d2199941e6e09c85b117df31b6bda682a +Imported: Event WithdrewETH(address,address,uint256): 0x1f12aa8b6d492dd9b98e2b00b0b20830c2a7ded65afac13b60d169a034ae90bc +Imported: Event ModuleCleared(address): 0x9c6ff02e684f8a81389ed942fea1147c16b8cc5fe79f2bfbc520d44e214aed4b +Imported: Event WithdrawalNetworkUpdated(uint8,uint8): 0xf2ec44eb1c3b3acd547b76333eb2c4b27eee311860c57a9fdb04c95f62398fc8 +Imported: Event MinWithdrawalAmountUpdated(uint256,uint256): 0x895a067c78583e800418fabf3da26a9496aab2ff3429cebdf7fefa642b2e4203 +Imported: Event SentMessage(uint256,address,uint256,address,bytes): 0x382409ac69001e11931a28435afef442cbfd20d9891907e8fa373ba7d351f320 +Imported: Event RespectedGameTypeSet(uint32): 0xcee0703b5e4bad4efededab85c9fd1aec17dee7c5f6c584330e0509b677745a2 +Imported: Event ETHBridgeFinalized(address,address,uint256,bytes): 0x31b2166ff604fc5672ea5df08a78081d2bc6d746cadce880747f3643d819e83d +Imported: Event WithdrawalProvenExtension1(bytes32,address): 0x798f9f13695f8f045aa5f80ed8efebb695f3c7fe65da381969f2f28bf3c60b97 +Imported: Event Paused(address): 0x62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258 +Imported: Event CancellationThresholdUpdated(address,uint256,uint256): 0x4eda179760b4e68650058376d4acef78e953221317450d29b4920e6d2836944c +Imported: Event InitBondUpdated(uint32,uint256): 0x74d6665c4b26d5596a5aa13d3014e0c06af4d322075a797f87b03cd4c5bc91ca +Imported: Event SecretRevealed(bytes32,bytes): 0xbab2b812958b05e36be1f0553f496fa5d27441155d6be0469e1c3fe1e51ad858 +Imported: Event Deposit(address,uint256): 0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c +Imported: Event OwnerChanged(address,address): 0xb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c +Imported: Event Attested(address,address,bytes32,bytes32): 0x8bf46bf4cfd674fa735a3d63ec1c9ad4153f033c290341f3a588b75685141b35 +Imported: Event ERC721BridgeFinalized(address,address,address,address,uint256,bytes): 0x1f39bf6707b5d608453e0ae4c067b562bcc4c85c0f562ef5d2c774d2e7f131ac +Imported: Event WithdrewERC721(address,address,address,uint256): 0x30b478a5e196e55886228aa87ba74a7dfeba655e0a4d7ba275eabfc22aabb7a8 +Imported: Event ImplementationSet(address,uint32): 0xff513d80e2c7fa487608f70a618dfbc0cf415699dc69588c747e8c71566c88de +Imported: Event Staked(address,uint128): 0x2eefbcc6809174727cb788be082c392be6c822829c56ab5eb44d528e9d9f37f9 +Imported: Event ChallengeCancelled(address): 0xadfa6511c5a9b5ac1adc5e4e0ca637c465f24ab56c1bd255a083e0023e3b7c42 +Imported: Event ChallengeStarted(address,uint256): 0x3eb9241ca06793ab672590e858d0977206f824e7367806f94a90af391d275d33 +Imported: Event BeneficiarySet(address,address): 0x2906d223dc4163733bb374af8641c7e9ae256e2bae53c90e0c9a2be2e611ae44 +Imported: Event StandardL2TokenCreated(address,address): 0xceeb8e7d520d7f3b65fc11a262b91066940193b05d4f93df07cfdced0eb551cf +Imported: Event Message(string): 0x51a7f65c6325882f237d4aeb43228179cfad48b868511d508e24b4437a819137 +Imported: Event DripStatusUpdated(string,string,uint8): 0x407cb3ad05e60ec498fb39417c7a4f6b82d5ba80f82fe512a37b02c93181a2a1 +Imported: Event WithdrawalFinalized(bytes32,bool): 0xdb5c7652857aa163daadd670e116628fb42e869d8ac4251ef8971d9e5727df1b +Imported: Event LiquidityMinted(address,uint256): 0x85719716ac5bd2744ae7ed3d16702129383049b97123b506320e7a5826ebbbba +Imported: Event MinterDeauthorized(address): 0xdf6bf03dfab5b4ccec3ba95544b98d7ecc9d4b9293d8673e86cb6edb5ac0cb62 +Imported: Event ResolverRefundPercentageChanged(uint256): 0xbbd8605de8f773fedb355c2fecd4b6b2e16a10a44e6676a63b375ac8f693758d +Imported: Event DepositFinalized(address,address,address,address,uint256,bytes): 0xb0444523268717a02698be47d0803aa7468c00acbed2f8bd93a0459cde61dd89 +Imported: Event OptimismMintableERC721Created(address,address,address): 0xe72783bb8e0ca31286b85278da59684dd814df9762a52f0837f89edd1483b299 +Imported: Event LiquidityWithdrawn(address,uint256): 0xb1cce8684b4ffa8667b4577654e61ee3480d661ee9c27522ac80e211f6bd4d25 +Imported: Event DelegateVotesChanged(address,uint256,uint256): 0xdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724 +Imported: Event OwnershipTransferredToFallback(): 0x903af33ae084e750e45a10a53f61a69a4c5444f13a59954f5b3cf96e2862b5f4 +Imported: Event ETHUnlocked(address,uint256): 0xe9512d49448b580f3d29031e9243ee81bc8789a93d6f04ec8f03b694d623637b +Imported: Event _EventToExposeStructInABI__Params((uint256,bytes32,bytes32)): 0xe696aefa5d73185c96c67a87c9597f9ef8d746736183999616f1e6f5a839b282 +Imported: Event Withdrawal(address,uint256): 0x7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65 +Imported: Event ApprovalForAll(address,address,bool): 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31 +Imported: Event ConfigUpdate(uint256,uint8,bytes): 0x1d2b0bda21d56b8bd12d4f94ebacffdfb35f5e226f84b461103bb8beab6353be +Imported: Event ImplementationArgsSet(uint32,bytes): 0xa47fcdf075d680d3817bfca7973b373e1a5f6cfc3b444748299cc2b83d8348f9 +Imported: Event Timestamped(bytes32,uint64): 0x5aafceeb1c7ad58e4a84898bdee37c02c0fc46e7d24e6b60e8209449f183459f +Imported: Event EffectiveStakeChanged(address,uint256): 0x09cb1cd0133a53d7a23c9cd8ad2d55c03ce5505c752d3dcc6ec6a6e085e2e03d +Imported: Event OwnershipTransferred(address,address,bool): 0x7fdc2a4b6eb39ec3363d710d188620bd1e97b3c434161f187b4d0dc0544faa58 +Imported: Event AnchorUpdated(address): 0x474f180d74ea8751955ee261c93ff8270411b180408d1014c49f552c92a4d11e +Imported: Event Approval(address,address,uint256): 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925 +Imported: Event Drip(string,bytes32,uint256,address): 0x2cebdf1cc706a50e1b28bf2fc5cfbd7204747a3b82439b85721a474df3a355a4 +Imported: Event ETHDepositInitiated(address,address,uint256,bytes): 0x35d79ab81f2b2017e19afb5c5571778877782d7a8786f5907f93b0f4702f4f23 +Imported: Event LiquidityMinted(address,address,uint256): 0xec89d80a36947288037745287dde87d62cd8c141d5323130b3d26d97d84004c7 +Imported: Event PortalMigrated(address,address,address,address): 0x9e5368471a58d81987e5dc7d6374dd5ed5e756cc95a79ff726903423bce0060d +Imported: Event WithdrawalProven(bytes32,address,address): 0x67a6208cfcc0801d50f6cbe764733f4fddf66ac0b04442061a8a8c0cb6b63f62 +Imported: Event DripExecuted(string,string,address,uint256): 0xea21435419aad9c54a9d90e2522b6f60bd566401f36fcef661f5f5a28cc0d2c6 +Imported: Event DisputeGameCreated(address,uint32,bytes32): 0x5b565efe82411da98814f356d0e7bcb8f0219b8d970307c5afb4a6903a8b2e35 +Imported: Event OwnershipTransferred(address,address): 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0 +Imported: Event GuardConfigured(address,uint256): 0xa48d13ee8fad9974fa901cfb88a02d39c5361efbab13bb9b3aa7caa3f6d6b786 +Imported: Event FailedRelayedMessage(bytes32): 0x99d0e048484baa1b1540b1367cb128acd7ab2946d1ed91ec10e3c85e4bf51b8f +Imported: Event TransactionCancelled(address,bytes32): 0xa42fd857b47d3d04f5b29f35cb05343f66b317633d2dc2910726bd4bca1a1625 +Imported: Event PredeploysUpgraded(address): 0x14e22d69ea30aab5b2220164345b33bdb5125e9c77a7d5fe12e23a1c691bd139 +Imported: Event OptimismMintableERC20Created(address,address,address): 0x52fe89dd5930f343d25650b62fd367bae47088bcddffd2a88350a6ecdd620cdb +Imported: Event BeneficiaryRemoved(address,address): 0x1a6590bd0cabbfcc7c86bef99e1034054e179905cfcc294598fcd426c0922442 +Imported: Event TransactionDeposited(address,address,uint256,bytes): 0xb3813568d9991fc951961fcb4c784893574240a28925604d09fc577c55bb7c32 +Imported: Event SentMessageExtension1(address,uint256): 0x8ebb2ec2465bdb2a06a66fc37a0963af8a2a6a1479d81d56fdb8cbb98096d546 +Imported: Event DelegateChanged(address,address,address): 0x3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f +Imported: Event BalanceChanged(address,uint256): 0xa448afda7ea1e3a7a10fcab0c29fe9a9dd85791503bf0171f281521551c7ec05 +Imported: Event ERC20BridgeFinalized(address,address,address,address,uint256,bytes): 0xd59c65b35445225835c83f50b6ede06a7be047d22e357073e250d9af537518cd +Imported: Event RemovedOwner(address): 0xf8d49fc529812e9a7c5c50e69c20f0dccc0db8fa95c98bc58cc9a4f1c1299eaf +Imported: Event EIP712DomainChanged(): 0x0a6387c9ea3628b88a633bb4f3b151770f70085117a15f9bf3787cda53f13d31 +Imported: Event LiquidityFunded(address,uint256): 0xbb9e497a5b82d1a37f9496dd70c6efb97ba0d98c66c3422d05010105d0633598 +Imported: Event OwnerUpdated(address,address): 0x8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d76 +Imported: Event MinterAuthorized(address): 0x83b05b6735acd4b85e3bded8e72c851d1a87718f81e3c8e6f0c9d9a2baa88e46 +Imported: Event ChallengeSucceeded(address,address): 0xdfdecb71eb0580c9263c867bc6de9dd6f859cc6a6ee33d47e505904f1d5601c9 +Imported: Event AddressSet(string,address,address): 0x9416a153a346f93d95f94b064ae3f148b6460473c6e82b3f9fc2521b873fcd6c +Imported: Event ModuleConfigured(address,uint256,address): 0x47e2ddae3ece2c77f60d8e9e5a89a50f1d1374a87fb11956d27a6b4986bba17e +Imported: Event ConfigUpdate(uint8,bytes): 0x7b743789cff01dafdeae47739925425aab5dfd02d0c8229e4a508bcd2b9f42bb +Selectors successfully uploaded to OpenChain diff --git a/ops/ci/migration/tests/test-circle-adapter.sh b/ops/ci/migration/tests/test-circle-adapter.sh new file mode 100755 index 00000000000..d35df40d9e5 --- /dev/null +++ b/ops/ci/migration/tests/test-circle-adapter.sh @@ -0,0 +1,42 @@ +#!/usr/bin/env bash +# Temporary provider-alignment extensions to the permanent routing fixtures. +set -euo pipefail +CIRCLECI_SCRIPTS="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../../../.circleci/scripts" && pwd)" +compare_route() { + local trigger="$1" branch="$2" tag="$3" schedule="$4" json_seed="$5" + local repo="${REPO:-ethereum-optimism/optimism}" + local legacy_trigger + case "${trigger}" in + push) legacy_trigger=webhook ;; + schedule) legacy_trigger=scheduled_pipeline ;; + dispatch) legacy_trigger=api ;; + esac + echo "${json_seed}" > "${TEST_DIR}/circleci.json" + if ! OUTPUT="${TEST_DIR}/circleci.json" TRIGGER_SOURCE="${legacy_trigger}" \ + BRANCH="${branch}" TAG="${tag}" SCHEDULE_NAME="${schedule}" \ + CIRCLE_PROJECT_USERNAME="${repo%%/*}" CIRCLE_PROJECT_REPONAME="${repo#*/}" \ + bash "${CIRCLECI_SCRIPTS}/compute-workflow-conditions.sh" > "${TEST_DIR}/circleci.log" 2>&1; then + cat "${TEST_DIR}/circleci.log" + echo " FAIL: CircleCI routing adapter exited unsuccessfully" + return 1 + fi + if [[ "$(jq -S . "${OUTPUT}")" != "$(jq -S . "${TEST_DIR}/circleci.json")" ]]; then + echo " FAIL: CircleCI and shared routing results differ" + return 1 + fi + + return 0 +} +compare_collector() { + local fixture="$1" mode="$2" + if [[ "$mode" == detect ]]; then echo '{}' > "${TEST_DIR}/circleci.json"; fi + OUTPUT="${TEST_DIR}/circleci.json" CHANGED_FILES_FILE="${SCRIPT_DIR}/fixtures/routing/${fixture}.txt" \ + bash "${CIRCLECI_SCRIPTS}/collect-params.sh" "${mode}" > /dev/null + if [[ "$(jq -S . "${OUTPUT}")" != "$(jq -S . "${TEST_DIR}/circleci.json")" ]]; then + echo "FAIL: ${fixture} collector compatibility" + FAIL=$((FAIL + 1)) + fi +} +# The Circle orb checks scripts individually without following sourced files. +# shellcheck disable=SC1091 +source "$(dirname "${BASH_SOURCE[0]}")/../../tests/test-decision-tree.sh" diff --git a/ops/ci/migration/tests/test_check_changed.py b/ops/ci/migration/tests/test_check_changed.py new file mode 100644 index 00000000000..692ff2143b2 --- /dev/null +++ b/ops/ci/migration/tests/test_check_changed.py @@ -0,0 +1,75 @@ +#!/usr/bin/env python3 +"""Exercise the legacy per-job early halt for shared CI changes on stacked PRs.""" + +import importlib.util +import os +from pathlib import Path +import unittest +from unittest import mock + + +SCRIPT = Path(__file__).resolve().parents[3] / "check-changed/main.py" +SPEC = importlib.util.spec_from_file_location("check_changed", SCRIPT) +CHECK_CHANGED = importlib.util.module_from_spec(SPEC) +SPEC.loader.exec_module(CHECK_CHANGED) + + +class CheckChangedTest(unittest.TestCase): + def assert_build_decision(self, paths, build): + base_sha = "a" * 40 + head_sha = "b" * 40 + pr = {"url": "https://api.github.com/repos/fixture/repo/pulls/1", + "base": {"sha": base_sha}, "head": {"sha": head_sha}} + env = {"CIRCLE_PULL_REQUESTS": "https://github.com/fixture/repo/pull/1", + "GITHUB_ACCESS_TOKEN": "fixture-token"} + with mock.patch.dict(os.environ, env, clear=True), \ + mock.patch.object(CHECK_CHANGED.sys, "argv", [str(SCRIPT), "contracts-bedrock"]), \ + mock.patch.object(CHECK_CHANGED, "git_cmd", + side_effect=["codex/stacked-shadow", "\n".join(paths)]) as git, \ + mock.patch.object(CHECK_CHANGED, "fetch_pull_request", return_value=pr) as fetch, \ + mock.patch.object(CHECK_CHANGED.subprocess, "check_call") as halt, \ + mock.patch.object(CHECK_CHANGED, "log"): + with self.assertRaises(SystemExit) as result: + CHECK_CHANGED.main() + self.assertEqual(result.exception.code, 0) + fetch.assert_called_once_with(1, "fixture-token") + self.assertEqual(git.call_args_list[1].args[0], + f"diff --name-only {base_sha}...{head_sha}") + if build: + halt.assert_not_called() + else: + halt.assert_called_once_with(["circleci", "step", "halt"]) + + def test_shared_ci_paths_execute_contracts(self): + for path in (".rwx/contracts.yml", ".rwx/pilot.yml", ".rwx/go-rollup.yml", + "ops/ci/runtime/contracts-tests.sh", "ops/ci/runtime/routing.yml", + "ops/ci/migration/tests/test_check_changed.py"): + with self.subTest(path=path): + self.assert_build_decision([path], build=True) + + def test_existing_ci_and_contract_paths_still_execute(self): + for path in (".circleci/continue/main.yml", ".github/workflows/check.yml", + "packages/contracts-bedrock/test/L1/Example.t.sol", "go.mod"): + with self.subTest(path=path): + self.assert_build_decision([path], build=True) + + def test_docs_and_unrelated_components_still_halt(self): + for path in ("docs/ai/rwx-migration.md", "docs/public-docs/example.md", + "op-node/rollup/example.go", "rust/kona/example.rs"): + with self.subTest(path=path): + self.assert_build_decision([path], build=False) + + def test_ci_patterns_match_only_root_directories(self): + for path in ("nested/.rwx/contracts.yml", ".rwx-other/contracts.yml", + "component/ops/ci/script.sh", "ops/circleci/script.sh", + "ops/ci-script.sh"): + with self.subTest(path=path): + self.assert_build_decision([path], build=False) + + def test_shared_ci_changes_execute_alongside_docs(self): + self.assert_build_decision(["docs/ai/rwx-migration.md", "ops/ci/runtime/contracts-tests.sh"], + build=True) + + +if __name__ == "__main__": + unittest.main() diff --git a/ops/ci/migration/tests/test_circle_alignment.py b/ops/ci/migration/tests/test_circle_alignment.py new file mode 100644 index 00000000000..cb99c60d382 --- /dev/null +++ b/ops/ci/migration/tests/test_circle_alignment.py @@ -0,0 +1,33 @@ +"""Circle alignment is removable; native policy is independently executable.""" +import importlib.util +import json +from pathlib import Path +import sys +import unittest +from unittest.mock import patch +sys.path.insert(0,str(Path(__file__).resolve().parents[2]/'tests')) +import test_pr_gate as fixtures +_SPEC=importlib.util.spec_from_file_location('alignment',Path(__file__).resolve().parents[1]/'circle-alignment.py') +A=importlib.util.module_from_spec(_SPEC);_SPEC.loader.exec_module(A) + + +class AlignmentTests(unittest.TestCase): + def setUp(self): + original=fixtures.G.ROOT + fixtures.GateTests.setUp(self) + mapping=A.G.read(original/'ops/ci/migration/circle-gates.json') + for row in mapping['gates'].values(): + target=self.root/row['circle_config'];target.parent.mkdir(parents=True,exist_ok=True);target.write_bytes((original/row['circle_config']).read_bytes()) + path=self.root/'circle-gates.json';path.write_text(json.dumps(mapping)) + for obj,name,value in [(A,'G',fixtures.G),(A,'MAPPING',path)]: + handle=patch.object(obj,name,value);handle.start();self.addCleanup(handle.stop) + + def test_alignment_rejects_renamed_and_nonterminal_circle_prerequisites(self): + A.configuration() + path=self.root/'.circleci/continue/rust-ci.yml';source=path.read_text() + for before,after in [(' - rust-fmt: terminal',' - future-required-job: terminal'),(' - rust-fmt: terminal',' - rust-fmt: success')]: + path.write_text(source.replace(before,after,1)) + with self.assertRaisesRegex(ValueError,'Circle gate dependency'):A.configuration('required-rust-ci') + fixtures.G.configuration('required-rust-ci') + path.unlink() + fixtures.G.configuration('required-rust-ci') diff --git a/ops/ci/migration/tests/test_compare_cannon_go.py b/ops/ci/migration/tests/test_compare_cannon_go.py new file mode 100644 index 00000000000..d79e0ed8e3d --- /dev/null +++ b/ops/ci/migration/tests/test_compare_cannon_go.py @@ -0,0 +1,169 @@ +"""Reject incomplete, stale, corrupt or deceptively green Cannon comparisons.""" +import copy +import importlib.util +import json +from pathlib import Path +import tempfile +import unittest +import xml.etree.ElementTree as ET + +SPEC = importlib.util.spec_from_file_location('compare_cannon_go', Path(__file__).resolve().parents[2] / 'migration' / 'compare-cannon-go.py') +P = importlib.util.module_from_spec(SPEC); SPEC.loader.exec_module(P) +G = P.G + + +class CompareTests(unittest.TestCase): + def setUp(self): + temp = tempfile.TemporaryDirectory(); self.addCleanup(temp.cleanup); self.root = Path(temp.name) + self.sha = 'a' * 40; self.package = G.PREFIX + '/fixture' + for provider, name in [('circleci', 'circle'), ('rwx', 'rwx')]: self.make(self.root / name, provider) + + def write(self, path, value): G.S.write(path, value) + + def seal(self, d): + self.write(d / 'final.json', {'exit_code': 0, 'report_errors': [], 'original_sha256': + {str(p.relative_to(d)): G.S.digest(p) for p in d.rglob('*') if p.is_file() and p.name != 'final.json'}}) + + def make(self, d, provider): + d.mkdir(); root = Path('/original/' + provider); effective = G.settings(provider, True, True, 16) + self.write(d / 'settings.json', {'suite': 'cannon-go', 'source_sha': self.sha, 'provider': provider, + 'branch': 'codex/rwx-ci-pilot', 'workspace_root': str(root), 'settings': effective, + 'input_sha256': {'mise.toml': 'b' * 64}, 'environment': {'CI': 'true', 'SKIP_SLOW_TESTS': 'true', 'GOMAXPROCS': None}, + 'go_environment': {'GOFLAGS': ''}, 'tool_versions': {'go': 'go fixture', 'forge': 'forge fixture'}, + 'rwx_run_id': 'actual-fixture', 'rwx_task_attempt': '1'}) + raw = {'ImportPath': self.package, 'Dir': str(root / 'cannon/fixture')} + (d / 'packages.json').write_text(json.dumps(raw)) + self.write(d / 'cpus.json', 16) + rows = G.packages(json.dumps(raw), root, d / 'source') + listing = [{'Package': self.package, 'Action': 'start'}, + {'Package': self.package, 'Action': 'output', 'Output': 'TestOne\n'}, + {'Package': self.package, 'Action': 'pass', 'Elapsed': 0}] + original = [{'Package': self.package, 'Action': 'start'}, + {'Package': self.package, 'Test': 'TestOne', 'Action': 'run'}, + {'Package': self.package, 'Test': 'TestOne', 'Action': 'output', 'Output': 'original case output\n'}, + {'Package': self.package, 'Test': 'TestOne', 'Action': 'pass', 'Elapsed': .01}, + {'Package': self.package, 'Action': 'pass', 'Elapsed': .01}] + for name, events in [('list', listing), ('original', original)]: + (d / (name + '.json')).write_text(''.join(json.dumps(e) + '\n' for e in events)) + per_test = d / 'per-test' / self.package.replace('/', '.') / 'TestOne.log' + per_test.parent.mkdir(parents=True); per_test.write_text('original case output\n') + self.write(d / 'selection.json', {'packages': rows, 'initial_tests': {self.package: ['TestOne']}, + 'authority': 'go list ./... and go test -list ' + G.LIST_PATTERN}) + suite = ET.Element('testsuite', name=self.package) + ET.SubElement(suite, 'testcase', classname=self.package, name='TestOne', time='.01') + ET.ElementTree(suite).write(d / 'junit.xml') + report = root / '.ci/cannon-go/run' + args = {'cpus': ['nproc'], 'lint': ['just', 'lint'], 'packages': ['go', 'list', '-e', '-json', './...'], + 'list': ['go', 'test', '-json', *G.go_flags(effective, list_tests=True)], + 'tests': [str(root / 'ops/scripts/gotestsum-split.sh'), '--format=testname', + '--junitfile=' + str(report / 'junit.xml'), '--jsonfile=' + str(report / 'original.json'), '--', *G.go_flags(effective)]} + for name, argv in args.items(): + (d / (name + '.log')).write_text('') + self.write(d / (name + '.stage.json'), {'argv': argv, 'cwd': str(root / 'cannon'), 'exit_code': 0, + 'stdin': 'devnull', 'log_sha256': G.S.digest(d / (name + '.log'))}) + self.write(d / 'inputs-after.json', {'mise.toml': 'b' * 64}) + self.account(d) + if provider == 'rwx': + (d / 'dependencies').mkdir() + for kind in ('go-modules', 'contracts'): + self.write(d / 'dependencies' / (kind + '.json'), {'kind': kind, 'commit_sha': self.sha, + 'settings': G.ARTIFACTS.SETTINGS[kind], 'mise_sha256': 'b' * 64, 'files': {'original': 'c' * 64}, + 'tool_versions': {'go': 'go fixture', 'forge': 'forge fixture'}}) + self.seal(d) + + def account(self, d): + selected = G.read(d / 'selection.json') + self.write(d / 'coverage.json', G.observed(d, selected['packages'], selected['initial_tests'])) + G.PROJECT.project(d / 'original.json', d / 'native.json') + + def compare(self): return P.compare(self.root, self.sha) + + def test_complete_original_report_matches(self): + report = self.compare(); self.assertTrue(report['verified_parity']); self.assertEqual(report['case_identities'], 1) + self.assertEqual(report['outcomes'], {'pass': 1}) + + def test_missing_corrupt_or_unsealed_original_cannot_compare(self): + for name in ('original.json', 'packages.json', 'tests.stage.json', 'junit.xml'): + d = self.root / 'rwx'; path = d / name; original = path.read_bytes() + path.unlink() + with self.subTest(name=name), self.assertRaises((ValueError, OSError)): self.compare() + path.write_bytes(original + b'corrupt') + with self.assertRaises((ValueError, OSError)): self.compare() + path.write_bytes(original) + (self.root / 'rwx/unsealed').write_text('extra') + with self.assertRaisesRegex(ValueError, 'unsealed'): self.compare() + + def test_stale_source_settings_or_dependency_cannot_compare(self): + d = self.root / 'rwx'; original = G.read(d / 'settings.json') + for change in ({'source_sha': 'd' * 40}, {'settings': original['settings'] | {'count': None}}, + {'settings': original['settings'] | {'tags': ['ci']}}, {'rwx_task_attempt': '2'}, + {'go_environment': {'GOFLAGS': '-run=TestOne'}}): + self.write(d / 'settings.json', original | change); self.seal(d) + with self.subTest(change=change), self.assertRaises(ValueError): self.compare() + self.write(d / 'settings.json', original) + path = d / 'dependencies/contracts.json'; value = G.read(path) + self.write(path, value | {'commit_sha': 'f' * 40}); self.seal(d) + with self.assertRaisesRegex(ValueError, 'dependency'): self.compare() + + def test_changed_selection_and_duplicate_initial_execution_cannot_compare(self): + d = self.root / 'rwx'; original = G.read(d / 'selection.json') + for names in ([], ['TestOne', 'TestOne'], ['TestMissing']): + value = copy.deepcopy(original); value['initial_tests'][self.package] = names + self.write(d / 'selection.json', value); self.seal(d) + with self.subTest(names=names), self.assertRaises(ValueError): self.compare() + self.write(d / 'selection.json', original) + path = d / 'original.json'; events = path.read_text(); path.write_text(events + events); self.seal(d) + with self.assertRaisesRegex(ValueError, 'retry'): self.compare() + + def test_foreign_package_and_failed_testmain_cannot_hide_behind_passing_cases(self): + d = self.root / 'rwx'; path = d / 'original.json'; original = path.read_text() + for events in ([{'Package': 'outside/suite', 'Action': 'start'}, {'Package': 'outside/suite', 'Action': 'pass', 'Elapsed': 0}], + [{'Package': self.package, 'Action': 'fail', 'Elapsed': 0}]): + path.write_text(original + ''.join(json.dumps(e) + '\n' for e in events)); self.seal(d) + with self.subTest(events=events), self.assertRaises(ValueError): self.compare() + + def test_fabricated_native_report_or_altered_command_cannot_compare(self): + d = self.root / 'rwx'; path = d / 'native.json'; original = path.read_bytes() + path.write_text(''); self.seal(d) + with self.assertRaisesRegex(ValueError, 'projection'): self.compare() + path.write_bytes(original); path = d / 'tests.stage.json'; value = G.read(path) + value['argv'].insert(-1, '-run=TestOne'); self.write(path, value); self.seal(d) + with self.assertRaisesRegex(ValueError, 'stage'): self.compare() + + def test_circle_manifest_can_restore_only_original_sealed_empty_bytes(self): + d = self.root / 'circle'; (d / 'packages.log').unlink() + result = self.compare() + self.assertEqual(result['circle_manifest_declared_empty'], [{'path': 'packages.log', 'sha256': P.EMPTY}]) + + def test_corrupt_per_test_output_cannot_compare_even_with_a_new_seal(self): + d = self.root / 'rwx' + next((d / 'per-test').rglob('*.log')).write_text('fabricated case output\n'); self.seal(d) + with self.assertRaisesRegex(ValueError, 'per-test'): self.compare() + + def test_different_original_skip_reasons_are_not_normalized_away(self): + for name, reason in [('circle', 'original reason'), ('rwx', 'different reason')]: + d = self.root / name; events = [json.loads(line) for line in (d / 'original.json').read_text().splitlines()] + for event in events: + if event.get('Test') and event['Action'] == 'pass': event['Action'] = 'skip' + if event.get('Test') and event['Action'] == 'output': event['Output'] = ' fixture_test.go:1: ' + reason + '\n' + (d / 'original.json').write_text(''.join(json.dumps(e) + '\n' for e in events)) + next((d / 'per-test').rglob('*.log')).write_text(' fixture_test.go:1: ' + reason + '\n') + tree = ET.parse(d / 'junit.xml'); ET.SubElement(next(tree.iter('testcase')), 'skipped', message=reason) + tree.write(d / 'junit.xml'); self.account(d); self.seal(d) + with self.assertRaisesRegex(ValueError, 'skips'): self.compare() + + def test_actual_nproc_difference_is_retained_without_changing_selection(self): + d = self.root / 'rwx'; path = d / 'settings.json'; value = G.read(path) + value['settings']['parallel'] = 8; self.write(path, value); self.write(d / 'cpus.json', 8) + for name in ('list', 'tests'): + path = d / (name + '.stage.json'); value = G.read(path) + value['argv'] = [arg.replace('-parallel=16', '-parallel=8') for arg in value['argv']] + self.write(path, value) + self.seal(d); result = self.compare() + self.assertEqual(result['settings_differences'][0]['circle'], 16) + self.assertEqual(result['settings_differences'][0]['rwx'], 8) + self.write(d / 'cpus.json', 32); self.seal(d) + with self.assertRaisesRegex(ValueError, 'nproc'): self.compare() + + +if __name__ == '__main__': unittest.main() diff --git a/ops/ci/migration/tests/test_compare_ci.py b/ops/ci/migration/tests/test_compare_ci.py new file mode 100644 index 00000000000..71d30e4a58c --- /dev/null +++ b/ops/ci/migration/tests/test_compare_ci.py @@ -0,0 +1,403 @@ +#!/usr/bin/env python3 +"""Real reporter fixtures plus synthetic corruption/retry tests, never runtime claims.""" + +import copy +import importlib.util +import json +from pathlib import Path +import subprocess +import sys +import tempfile +import unittest +import xml.etree.ElementTree as ET + + +SCRIPTS = Path(__file__).resolve().parents[1] +SPEC = importlib.util.spec_from_file_location("compare_ci", Path(__file__).resolve().parents[2] / 'migration' / 'compare-ci.py') +CI = importlib.util.module_from_spec(SPEC) +SPEC.loader.exec_module(CI) +SHA = "cb48622213e9aa8408de9904baafac784441ecc6" +PREFIX = "github.com/ethereum-optimism/optimism/op-node/rollup" +FEATURES = ["main", "CUSTOM_GAS_TOKEN", "OPTIMISM_PORTAL_INTEROP", "ZK_DISPUTE_GAME"] + + +class ComparisonTest(unittest.TestCase): + def setUp(self): + self.temp = tempfile.TemporaryDirectory() + self.addCleanup(self.temp.cleanup) + self.root = Path(self.temp.name) + self.metadata = { + "provider": "circleci", "sha": SHA, "branch": "codex/rwx-contracts-shadow", + "routing_context": {"kind": "pr-branch", "base_branch": "develop"}, + "trigger": {"type": "webhook", "evidence": "synthetic unit fixture"}, + "workload": "go-rollup", "profile": "ci", "features": ["main"], + "package_prefix": PREFIX, "test_config": {"tags": ["ci"], "short": False, "filter": None}, + } + self.write_json("job.json", {"sha": SHA, "branch": self.metadata["branch"], "status": "success"}) + + def write_json(self, name, data): + path = self.root / name + path.write_text(json.dumps(data) + "\n") + return path + + def source(self, name="cases.json", format="circleci-tests", **fields): + return {"id": name, "path": name, "format": format, "feature": "main", "role": "verdict", + "metadata_path": "job.json", **fields} + + def rows(self): + return [{"classname": PREFIX, "name": "TestSynthetic", "result": "success", "run_time": 1}] + + def collection(self, sources=None, **fields): + if sources is None: + self.write_json("cases.json", {"tests": self.rows()}) + sources = [self.source()] + return {"version": 1, "metadata": copy.deepcopy(self.metadata), "sources": sources, + "discovery": {"packages": [PREFIX], "complete": True, "provenance": "synthetic complete unit fixture"}, **fields} + + def normalized(self): + return CI.normalize(self.collection(), self.root) + + def pair(self): + left = self.normalized() + right = copy.deepcopy(left) + right["metadata"]["provider"] = "rwx" + right["metadata"]["trigger"] = {"type": "push", "evidence": "synthetic unit fixture"} + return left, right + + def partition_collection(self, *, empty=False): + names = ['TestOne', 'TestTwo'] + groups = [names, []] if empty else [[name] for name in names] + sources = [] + for index, assigned in enumerate(groups): + events = [{'Action': 'start', 'Package': PREFIX}] + for name in assigned: + events.extend({'Action': action, 'Package': PREFIX, 'Test': name} for action in ('run', 'pass')) + events.append({'Action': 'pass', 'Package': PREFIX}) + path = self.root / f'go-{index}.json' + path.write_text('\n'.join(json.dumps(event) for event in events)) + sources.append(self.source(path.name, 'go-json', shard_index=index, shard_total=2)) + discovery = {'packages': [PREFIX], 'complete': True, 'provenance': 'synthetic exhaustive test listing', + 'partition': 'test', 'total': 2, 'tests': [PREFIX + '::' + name for name in names], + 'test_shards': [[PREFIX + '::' + name for name in group] for group in groups]} + return self.collection(sources, discovery=discovery) + + def test_test_partitions_allow_shared_packages_but_preserve_exact_case_ownership(self): + collection = self.partition_collection() + normalized = CI.normalize(collection, self.root) + self.assertEqual(len(normalized['cases']), 2) + CI.validate_normalized(normalized) + collection['discovery'] = {'packages': [PREFIX], 'complete': True, 'provenance': 'fixture'} + with self.assertRaisesRegex(ValueError, 'duplicated package'): + CI.normalize(collection, self.root) + + def test_test_partition_rejects_missing_duplicate_or_wrong_source_assignments(self): + original = self.partition_collection() + for kind in ('missing', 'duplicate', 'wrong_source'): + collection = copy.deepcopy(original) + groups = collection['discovery']['test_shards'] + if kind == 'missing': groups[0] = [] + elif kind == 'duplicate': groups[1] += groups[0] + else: groups.reverse() + with self.assertRaises(ValueError): CI.normalize(collection, self.root) + + def test_empty_test_partition_keeps_terminal_package_evidence(self): + normalized = CI.normalize(self.partition_collection(empty=True), self.root) + self.assertEqual(len(normalized['cases']), 2) + CI.validate_normalized(normalized) + normalized['sources'][1]['observed_packages'] = [] + with self.assertRaises(ValueError): CI.validate_normalized(normalized) + + def test_different_discovered_test_sets_are_compared(self): + left = CI.normalize(self.partition_collection(), self.root) + right = copy.deepcopy(left) + right['metadata']['provider'] = 'rwx' + right['cases'][1]['name'] = 'TestThree' + right['discovery']['tests'][1] = PREFIX + '::TestThree' + right['discovery']['test_shards'][1] = [PREFIX + '::TestThree'] + report = CI.compare(left, right) + self.assertEqual(report['status'], 'different') + self.assertIn('tests', report['discovery_differences']) + + def test_real_circleci_go_fixture_preserves_full_subtest_identity_and_skip_reasons(self): + path = Path(__file__).parent / "fixtures/ci-comparison/circleci-go-cases.json" + fixture = CI.read_json(path) + packages = sorted({row["classname"] for row in fixture["cases"]}) + collection = self.collection([self.source(str(path))], discovery={"packages": packages}) + normalized = CI.normalize(collection, self.root) + self.assertEqual(len(normalized["cases"]), 3) + skips = [case for case in normalized["cases"] if case["outcome"] == "skip"] + self.assertEqual({case["skip_reason"] for case in skips}, {"only applicable to span batches"}) + self.assertTrue(all("/" in case["name"] for case in skips)) + self.assertTrue(all(case["attempts"] is None for case in normalized["cases"])) + + def test_real_foundry_api_fixture_matches_junit_without_gas_decoration(self): + path = Path(__file__).parent / "fixtures/ci-comparison/circleci-contract-cases.json" + fixture = CI.read_json(path) + self.metadata.update(workload="contracts-standard", profile="liteci", package_prefix=None) + root = ET.Element("testsuites") + suite = ET.SubElement(root, "testsuite") + for row in fixture["cases"]: + case = ET.SubElement(suite, "testcase", classname=row["classname"], name=row["name"], time="0") + if row["result"] == "skipped": + ET.SubElement(case, "skipped").text = row["message"] + ET.ElementTree(root).write(self.root / "results.xml", encoding="unicode") + left = CI.normalize(self.collection([self.source(str(path))], discovery=None), self.root) + right = CI.normalize(self.collection([self.source("results.xml", "junit")], discovery=None), self.root) + right["metadata"]["provider"] = "rwx" + report = CI.compare(left, right) + self.assertEqual(report["status"], "incomplete") # Fixture is deliberately not a complete test-file inventory. + self.assertFalse(report["different_cases"]) + self.assertFalse(report["missing_cases"]) + self.assertTrue(all("[SKIP:" not in case["skip_reason"] for case in left["cases"] if case["outcome"] == "skip")) + + def test_real_foundry_suite_identity_and_generic_or_prefixed_skips(self): + # These are original reports from different SHAs, compared only at the + # reporter-conversion boundary; no same-revision runtime claim is made. + directory = Path(__file__).parent / "fixtures/ci-comparison" + metadata = {**self.metadata, "package_prefix": None} + source = self.source() + api = CI.circleci_cases(directory / "circleci-foundry-skips.json", source, metadata) + junit = CI.junit_cases(directory / "rwx-foundry-skips.xml", source, metadata) + normalized_api = {CI.identity(case): case["skip_reason"] for case in api} + normalized_junit = {CI.identity(case): case["skip_reason"] for case in junit} + self.assertEqual(normalized_api, normalized_junit) + self.assertEqual(len(normalized_junit), 4) + self.assertEqual(sum(reason is None for reason in normalized_junit.values()), 2) + self.assertIn("Skipping: standard configs incompatible with SUPER_ROOT_GAMES_MIGRATION", normalized_junit.values()) + self.assertTrue(all(suite.startswith("test/") and ":" in suite for _, suite, _ in normalized_junit)) + + def test_canonical_fail_status_is_accepted_from_original_job_metadata(self): + self.write_json("job.json", {"sha": SHA, "branch": self.metadata["branch"], "status": "fail"}) + normalized = CI.normalize(self.collection(), self.root) + self.assertEqual(normalized["sources"][0]["status"], "fail") + + def test_same_count_can_hide_missing_and_extra_case(self): + left, right = self.pair() + right["cases"][0]["name"] = "TestSubstitute" + report = CI.compare(left, right) + self.assertEqual(report["status"], "different") + self.assertEqual(report["missing_cases"][0]["name"], "TestSynthetic") + self.assertEqual(report["extra_cases"][0]["name"], "TestSubstitute") + + def test_sha_profile_scope_and_routing_mismatch_are_incomparable(self): + for field, value in (("sha", "a" * 40), ("profile", "liteci"), ("workload", "another-workload"), + ("routing_context", {"kind": "merge-group"})): + left, right = self.pair() + right["metadata"][field] = value + with self.subTest(field=field): + self.assertEqual(CI.compare(left, right)["status"], "incomparable") + + def test_different_raw_triggers_can_share_verified_routing_context(self): + left, right = self.pair() + report = CI.compare(left, right) + self.assertEqual(report["status"], "equivalent") + self.assertEqual(report["baseline"]["trigger"]["type"], "webhook") + self.assertEqual(report["candidate"]["trigger"]["type"], "push") + + def test_missing_routing_context_discovery_or_revision_binding_is_incomplete(self): + for missing in ("routing_context", "discovery", "revision_bound", "status"): + left, right = self.pair() + if missing == "routing_context": + left["metadata"][missing] = right["metadata"][missing] = None + elif missing == "discovery": + right[missing] = None + else: + right["sources"][0][missing] = False if missing == "revision_bound" else None + with self.subTest(missing=missing): + self.assertEqual(CI.compare(left, right)["status"], "incomplete") + + def test_failed_or_canceled_job_cannot_hide_behind_passing_cases(self): + for status in ("fail", "canceled"): + left, right = self.pair() + left["sources"][0]["status"] = right["sources"][0]["status"] = status + report = CI.compare(left, right) + self.assertEqual(report["status"], "different") + self.assertEqual(len(report["unhealthy_sources"]), 2) + + def test_source_job_sha_branch_and_status_must_match(self): + for change in ({"sha": "b" * 40}, {"branch": "develop"}, {"status": "failure"}): + job = {"sha": SHA, "branch": self.metadata["branch"], "status": "success", **change} + self.write_json("job.json", job) + collection = self.collection() + collection["sources"][0]["status"] = "success" + with self.subTest(change=change), self.assertRaises(ValueError): + CI.normalize(collection, self.root) + + def go_stream(self, name, events): + (self.root / name).write_text("".join(json.dumps(event) + "\n" for event in events)) + return self.source(name, "go-json") + + def test_fail_then_pass_retry_is_separate_from_final_verdict(self): + # Synthetic event stream exercises gotestsum retry behavior, not an observed flake. + events = [{"Action": action, "Package": PREFIX, "Test": "TestSynthetic", "Elapsed": 1} + for action in ("run", "fail", "run", "pass")] + events.insert(2, {"Action": "fail", "Package": PREFIX}) + events.append({"Action": "pass", "Package": PREFIX}) + data = CI.normalize(self.collection([self.go_stream("go.json", events)]), self.root) + self.assertEqual(data["cases"][0]["outcome"], "pass") + self.assertEqual([a["outcome"] for a in data["cases"][0]["attempts"]], ["fail", "pass"]) + self.assertFalse(data["package_failures"]) + left, _ = self.pair() + data["metadata"]["provider"] = "rwx" + report = CI.compare(left, data) + self.assertEqual(report["status"], "equivalent") + self.assertEqual(report["retries"]["candidate"]["observed_retry_attempts"], 1) + self.assertEqual(report["retries"]["candidate"]["observed_package_retry_attempts"], 1) + self.assertEqual(report["retries"]["candidate"]["retried_packages"][0]["outcomes"], ["fail", "pass"]) + self.assertEqual(report["retries"]["baseline"]["cases_without_attempt_evidence"], 1) + + def test_package_failure_outside_passing_case_is_unhealthy(self): + events = [{"Action": "run", "Package": PREFIX, "Test": "TestSynthetic"}, + {"Action": "pass", "Package": PREFIX, "Test": "TestSynthetic"}, + {"Action": "fail", "Package": PREFIX}] + right = CI.normalize(self.collection([self.go_stream("go.json", events)]), self.root) + right["metadata"]["provider"] = "rwx" + left, _ = self.pair() + self.assertEqual(CI.compare(left, right)["status"], "different") + + def test_truncated_or_ambiguous_go_events_are_rejected(self): + streams = [[{"Action": "run", "Package": PREFIX, "Test": "TestSynthetic"}], + [{"Action": "pass", "Package": PREFIX, "Test": "TestSynthetic"}], + [{"Action": "run", "Package": PREFIX, "Test": "TestSynthetic"}] * 2, + [{"Action": "run", "Package": PREFIX, "Test": "TestSynthetic"}, + {"Action": "pass", "Package": PREFIX, "Test": "TestSynthetic"}]] + for events in streams: + with self.subTest(events=events), self.assertRaises(ValueError): + CI.normalize(self.collection([self.go_stream("go.json", events)]), self.root) + + def test_complete_manifest_requires_terminal_no_test_packages_too(self): + events = [{"Action": "run", "Package": PREFIX, "Test": "TestSynthetic"}, + {"Action": "pass", "Package": PREFIX, "Test": "TestSynthetic"}, + {"Action": "pass", "Package": PREFIX}] + source = self.go_stream("go.json", events) + discovery = {"packages": [PREFIX, PREFIX + "/no-tests"], "complete": True, "provenance": "synthetic manifest"} + with self.assertRaisesRegex(ValueError, "do not match complete discovery"): + CI.normalize(self.collection([source], discovery=discovery), self.root) + events.append({"Action": "skip", "Package": PREFIX + "/no-tests"}) + source = self.go_stream("go.json", events) + normalized = CI.normalize(self.collection([source], discovery=discovery), self.root) + self.assertEqual(len(normalized["cases"]), 1) + self.assertEqual(normalized["sources"][0]["observed_packages"], discovery["packages"]) + + def test_empty_discovery_and_repeated_or_omitted_shards_are_rejected(self): + collection = self.collection() + collection["discovery"]["packages"] = [] + with self.assertRaises(ValueError): + CI.normalize(collection, self.root) + collection = self.collection() + collection["sources"][0].update(shard_index=0, shard_total=2) + with self.assertRaises(ValueError): + CI.normalize(collection, self.root) + self.write_json("second.json", {"tests": self.rows()}) + collection["sources"].append(self.source("second.json", shard_index=0, shard_total=2)) + with self.assertRaisesRegex(ValueError, "duplicated shard"): + CI.normalize(collection, self.root) + + def test_duplicate_source_path_id_or_case_cannot_double_count_shards(self): + for duplicate in (self.source(), self.source(id="another-id"), self.source("second.json")): + self.write_json("second.json", {"tests": self.rows()}) + collection = self.collection() + collection["sources"].append(duplicate) + with self.subTest(duplicate=duplicate), self.assertRaises(ValueError): + CI.normalize(collection, self.root) + + def test_diagnostic_shard_cannot_substitute_for_missing_verdict_shard(self): + self.write_json("cases.json", {"tests": self.rows()}) + self.write_json("diagnostic.json", {"tests": self.rows()}) + collection = self.collection([self.source(shard_index=0, shard_total=2), + self.source("diagnostic.json", role="diagnostic", shard_index=1, shard_total=2)]) + with self.assertRaisesRegex(ValueError, "verdict shard"): + CI.normalize(collection, self.root) + + def test_legitimate_empty_component_share_needs_real_outside_scope_cases(self): + self.write_json("outside.json", {"tests": [{**self.rows()[0], "classname": "example.org/another-package"}]}) + collection = self.collection([self.source(shard_index=0, shard_total=2), + self.source("outside.json", shard_index=1, shard_total=2)]) + self.write_json("cases.json", {"tests": self.rows()}) + self.assertEqual(len(CI.normalize(collection, self.root)["cases"]), 1) + self.write_json("outside.json", {"tests": []}) + with self.assertRaises(ValueError): + CI.normalize(collection, self.root) + + def test_all_declared_contract_features_must_have_executed_cases(self): + self.metadata.update(features=FEATURES, workload="contracts-standard", package_prefix=None) + sources = [] + for feature in FEATURES: + path = feature + ".json" + self.write_json(path, {"tests": self.rows()}) + sources.append(self.source(path, feature=feature)) + collection = self.collection(sources) + self.assertEqual(len(CI.normalize(collection, self.root)["cases"]), 4) + collection["sources"].pop() + with self.assertRaisesRegex(ValueError, "each declared feature"): + CI.normalize(collection, self.root) + + def test_foundry_diagnostic_rerun_does_not_replace_failure(self): + self.write_json("job.json", {"sha": SHA, "branch": self.metadata["branch"], "status": "failure"}) + self.write_json("failure.json", {"tests": [{**self.rows()[0], "result": "failure"}]}) + self.write_json("rerun.json", {"tests": self.rows()}) + data = CI.normalize(self.collection([self.source("failure.json"), self.source("rerun.json", role="diagnostic")]), self.root) + self.assertEqual(len(data["cases"]), 1) + self.assertEqual(data["cases"][0]["outcome"], "fail") + + def test_unknown_or_different_skip_reason_does_not_claim_parity(self): + left, right = self.pair() + for data in (left, right): + data["cases"].append({**data["cases"][0], "name": "TestSkipped", "outcome": "skip", "skip_reason": None}) + self.assertEqual(CI.compare(left, right)["status"], "incomplete") + left["cases"][1]["skip_reason"] = "feature disabled" + right["cases"][1]["skip_reason"] = "wrong reason" + self.assertEqual(CI.compare(left, right)["status"], "different") + + def test_malformed_xml_json_outcomes_pagination_and_durations_fail_closed(self): + malformed = [{"tests": []}, {"tests": [{**self.rows()[0], "result": "mystery"}]}, + {"tests": self.rows(), "next_page_token": "still-more"}, + {"tests": [{**self.rows()[0], "run_time": -1}]}, + {"tests": self.rows(), "sha": "a" * 40}] + for payload in malformed: + self.write_json("cases.json", payload) + with self.subTest(payload=payload), self.assertRaises(ValueError): + CI.normalize(self.collection([self.source()]), self.root) + (self.root / "invalid.json").write_text('{"tests":[],"tests":[]}') + with self.assertRaises(ValueError): + CI.read_json(self.root / "invalid.json") + for xml in ('', '', + '', + f''): + (self.root / "results.xml").write_text(xml) + with self.subTest(xml=xml), self.assertRaises(ValueError): + CI.normalize(self.collection([self.source("results.xml", "junit")]), self.root) + + def test_duration_cache_resources_and_cost_remain_separate_unknowns(self): + left, right = self.pair() + right["measurements"] = {"wall_seconds": 10, "resources": [{"cpus": 8}], + "cache": {"state": "warm", "historical_execution_seconds": 90}} + report = CI.compare(left, right) + supplied = report["measurements"]["candidate"] + self.assertEqual(supplied["wall_seconds"], 10) + self.assertIsNone(supplied["cpu_seconds"]) + self.assertIsNone(supplied["billed_seconds"]) + self.assertIsNone(supplied["cost"]) + self.assertEqual(supplied["cache"]["historical_execution_seconds"], 90) + + def test_cli_emits_machine_report_and_honest_nonzero_incomplete_or_incomparable(self): + left, right = self.pair() + baseline = self.write_json("baseline.json", left) + candidate = self.write_json("candidate.json", right) + command = [sys.executable, str(Path(__file__).resolve().parents[2] / 'migration' / 'compare-ci.py'), "compare", "--baseline", str(baseline), + "--candidate", str(candidate), "--output", str(self.root / "report.json"), + "--markdown", str(self.root / "report.md")] + for expected, status in ((0, "equivalent"), (1, "incomplete"), (2, "incomparable")): + if expected == 1: + right["discovery"] = None + if expected == 2: + right["metadata"]["sha"] = "a" * 40 + self.write_json("candidate.json", right) + result = subprocess.run(command, capture_output=True, text=True) + self.assertEqual(result.returncode, expected, result.stderr) + self.assertEqual(CI.read_json(self.root / "report.json")["status"], status) + self.assertIn(status, (self.root / "report.md").read_text()) + + +if __name__ == "__main__": + unittest.main() diff --git a/ops/ci/migration/tests/test_compare_contract_artifacts.py b/ops/ci/migration/tests/test_compare_contract_artifacts.py new file mode 100644 index 00000000000..ae130a30208 --- /dev/null +++ b/ops/ci/migration/tests/test_compare_contract_artifacts.py @@ -0,0 +1,111 @@ +#!/usr/bin/env python3 +"""Reject runtime/source changes while identifying compiler-only metadata drift.""" +from collections import Counter +import copy +import importlib.util +import io +import json +from pathlib import Path +import tarfile +import subprocess +import tempfile +import unittest + +SPEC = importlib.util.spec_from_file_location('contract_compare', Path(__file__).resolve().parents[2] / 'migration' / 'compare-contract-artifacts.py') +COMPARE = importlib.util.module_from_spec(SPEC); SPEC.loader.exec_module(COMPARE) + + +class ContractComparisonTests(unittest.TestCase): + def setUp(self): + self.a = {'abi': [{'type': 'function', 'name': 'correct'}], 'bytecode': {'object': '0x1234', 'sourceMap': '0:4:1'}, + 'deployedBytecode': {'object': '0x4321'}, 'storageLayout': {'storage': []}, + 'metadata': {'settings': {'optimizer': {'enabled': True}, 'remappings': ['/circle/lib/:x/=lib/x/']}}, + 'ast': {'id': 11, 'nodeType': 'SourceUnit', 'src': '0:20:1', + 'nodes': [{'id': 12, 'nodeType': 'ContractDefinition', 'name': 'Correct', 'scope': 11, + 'typeDescriptions': {'typeIdentifier': 't_contract$_Correct_$12'}, + 'src': '3:12:1', 'literal': {'value': '42'}}]}, 'id': 1} + self.b = copy.deepcopy(self.a); self.b['metadata']['settings']['remappings'][0] = '/native/lib/:x/=lib/x/' + self.b['id'] = 3; self.b['ast']['id'] = 31; self.b['ast']['src'] = '0:20:3' + self.b['ast']['nodes'][0].update(id=32, scope=31, src='3:12:3') + self.b['ast']['nodes'][0]['typeDescriptions']['typeIdentifier'] = 't_contract$_Correct_$32' + for row in (self.a, self.b): row['rawMetadata'] = json.dumps(row['metadata']) + + def compare(self): + counts = Counter(); COMPARE.contract(self.a, self.b, ['/circle', '/native'], counts); return counts + + def test_all_runtime_fields_equal_with_explicit_identifier_differences(self): + counts = self.compare() + self.assertEqual(counts['workspace_path_metadata'], 2) + self.assertGreater(counts['node_identifiers'], 0) + self.assertEqual(counts['type_identifiers'], 1) + + def test_bytecode_abi_source_map_and_storage_changes_are_rejected(self): + original = copy.deepcopy(self.b) + for key, value in [('bytecode', {'object': '0xbad'}), ('abi', []), ('storageLayout', {'storage': ['bad']}), + ('bytecode', {'object': '0x1234', 'sourceMap': '1:4:1'})]: + self.b = copy.deepcopy(original); self.b[key] = value + with self.subTest(key=key), self.assertRaisesRegex(ValueError, 'runtime'): self.compare() + + def test_ast_literal_span_structure_and_type_changes_are_rejected(self): + original = copy.deepcopy(self.b) + for key, value in [('name', 'Wrong'), ('src', '4:12:3'), ('literal', {'value': '43'}), + ('typeDescriptions', {'typeIdentifier': 't_array$_Correct_$32_5_storage'})]: + self.b = copy.deepcopy(original); self.b['ast']['nodes'][0][key] = value + with self.subTest(key=key), self.assertRaises(ValueError): self.compare() + self.b = copy.deepcopy(original); self.b['ast']['nodes'].append({'name': 'extra'}) + with self.assertRaisesRegex(ValueError, 'structure'): self.compare() + + def test_effective_optimizer_and_metadata_source_hash_changes_are_rejected(self): + self.b['metadata']['settings']['optimizer']['enabled'] = False + with self.assertRaisesRegex(ValueError, 'input metadata'): self.compare() + + def test_cache_content_is_checked_while_timestamps_and_build_ids_are_retained(self): + a = {'files': {'A.sol': {'contentHash': 'correct', 'lastModificationDate': 10, + 'artifacts': {'A': {'build_id': 'old', 'path': 'A.json'}}}}, 'builds': ['old']} + b = copy.deepcopy(a); b['files']['A.sol']['lastModificationDate'] = 20 + b['files']['A.sol']['artifacts']['A']['build_id'] = 'new'; b['builds'] = ['new'] + self.assertEqual(COMPARE.cache_inputs(a), COMPARE.cache_inputs(b)) + b['files']['A.sol']['contentHash'] = 'wrong' + self.assertNotEqual(COMPARE.cache_inputs(a), COMPARE.cache_inputs(b)) + + def test_archive_corruption_duplicate_missing_and_unsafe_members_rejected(self): + with tempfile.TemporaryDirectory() as tmp: + path = Path(tmp) / 'files.tar.gz'; data = b'compiled' + for mode in ('correct', 'duplicate', 'extra', 'unsafe', 'missing', 'corrupt'): + with tarfile.open(path, 'w:gz') as stream: + for name in ([] if mode == 'missing' else ['A.json', 'A.json'] if mode == 'duplicate' + else ['A.json', 'extra'] if mode == 'extra' else ['../outside'] if mode == 'unsafe' else ['A.json']): + member = tarfile.TarInfo(name); member.size = len(data); stream.addfile(member, io.BytesIO(data)) + metadata = {'archive_sha256': COMPARE.digest(path.read_bytes()), 'files': {'A.json': COMPARE.digest(data)}} + if mode == 'corrupt': metadata['files']['A.json'] = 'wrong' + with self.subTest(mode=mode): + if mode == 'correct': self.assertEqual(COMPARE.archive(path, metadata), {'A.json': data}) + else: + with self.assertRaises(ValueError): COMPARE.archive(path, metadata) + + def test_actual_zstd_archive_works_with_the_pinned_python_reader(self): + raw = io.BytesIO() + with tarfile.open(fileobj=raw, mode='w') as stream: + for name, data in [('src/A.sol', b'pragma solidity 0.8.15;'), + ('forge-artifacts/A.json', b'{"bytecode":"0x1234"}')]: + member = tarfile.TarInfo(name); member.size = len(data) + stream.addfile(member, io.BytesIO(data)) + compressed = subprocess.run(['zstd', '--compress', '--stdout'], input=raw.getvalue(), + capture_output=True, check=True).stdout + files, links = COMPARE.embedded(compressed) + self.assertEqual(files, {'src/A.sol': COMPARE.digest(b'pragma solidity 0.8.15;'), + 'forge-artifacts/A.json': COMPARE.digest(b'{"bytecode":"0x1234"}')}) + self.assertEqual(links, {}) + with self.assertRaises((ValueError, tarfile.ReadError)): + COMPARE.embedded(compressed[:-8]) + + def test_embedded_file_link_aliases_cannot_hide_duplicate_members(self): + raw = io.BytesIO() + with tarfile.open(fileobj=raw, mode='w:gz') as stream: + file = tarfile.TarInfo('src/A.sol'); file.size = 1; stream.addfile(file, io.BytesIO(b'A')) + link = tarfile.TarInfo('src/A.sol'); link.type = tarfile.SYMTYPE; link.linkname = 'elsewhere.sol' + stream.addfile(link) + with self.assertRaisesRegex(ValueError, 'Duplicate'): COMPARE.embedded(raw.getvalue()) + + +if __name__ == '__main__': unittest.main() diff --git a/ops/ci/migration/tests/test_compare_contract_coverage.py b/ops/ci/migration/tests/test_compare_contract_coverage.py new file mode 100644 index 00000000000..e03f5581134 --- /dev/null +++ b/ops/ci/migration/tests/test_compare_contract_coverage.py @@ -0,0 +1,170 @@ +#!/usr/bin/env python3 +"""Reject incomplete coverage, altered instrumentation and mismatched archives.""" +import hashlib +import importlib.util +import json +from pathlib import Path +import tempfile +import unittest +import sys +sys.path.insert(0, str(Path(__file__).resolve().parents[2] / 'tests')) +from ci_test_fixtures import ReportFixtures + +SPEC = importlib.util.spec_from_file_location('compare', Path(__file__).resolve().parents[2] / 'migration' / 'compare-contract-coverage.py') +C = importlib.util.module_from_spec(SPEC); SPEC.loader.exec_module(C) +SHA = 'a'*40 + + +class ComparisonTests(ReportFixtures, unittest.TestCase): + def setUp(self): + self.tmp = tempfile.TemporaryDirectory(); self.addCleanup(self.tmp.cleanup); self.root = Path(self.tmp.name); self.dirs = {} + for provider in ('circle', 'rwx'): + d = self.root / provider; d.mkdir(); self.dirs[provider] = d; root = '/' + provider + source = 'test/L1/Fixture.t.sol'; identity = source + ':OPContractsManagerFixture_Upgrade_Test' + artifact = 'packages/contracts-bedrock/forge-artifacts/Fixture.t.sol/OPContractsManagerFixture_Upgrade_Test.json' + seed = '0x' + hashlib.sha256((SHA + ':main:contract-coverage').encode()).hexdigest() + inputs = {'packages/contracts-bedrock/' + source: 'b'*64, 'packages/contracts-bedrock/src/A.sol': 'e'*64} + settings = {'source_sha': SHA, 'feature': 'main', 'branch': 'pilot', 'profile': 'cicoverage', 'source_build_profile': 'default', + 'benchmark_seed': seed, 'rpc_input_name': C.C.RPC_INPUT, 'authority': ['just', 'coverage-lcov-all'], + 'ffi_replay_seed': seed, 'ffi_replay_policy': 'chacha8-arguments-v1', + 'phases': list(C.C.PHASES), 'provider': 'circleci' if provider == 'circle' else 'rwx', 'workspace_root': root, + 'forge': 'pinned', 'go': 'pinned', 'just': 'pinned', 'input_sha256': inputs, 'runtime_output_paths': [], + 'rwx_run_id': 'c'*32 if provider == 'rwx' else None, 'rwx_task_attempt': '1'} + self.write(d / 'settings.json', settings); self.write(d / 'source-after-preparation.json', inputs) + (d / 'files.log').write_text(source + '\n'); self.write(d / 'file-selection.json', {'files': [source], 'partitions': [{'index': 0, 'files': [source]}]}) + (d / 'submodules.txt').write_text(' ' + 'd'*40 + ' modules/original\n') + config = {'root': root, 'out': 'forge-artifacts', 'optimizer': False, 'threads': 16, 'compilation_restrictions': [], + 'fuzz': {'runs': 1, 'seed': seed}, 'invariant': {'runs': 1, 'depth': 1}} + self.write(d / 'foundry-config.json', config); self.write(d / 'build-config.json', {'root': root, 'optimizer': True}) + bindings = {identity: {'methods': {'test_a()': 'a', 'test_skip()': 'b'}, 'artifacts': {artifact: 'f'*64}, + 'creation_bytecode': {artifact: {'bytes': 1, 'sha256': hashlib.sha256(b'00').hexdigest()}}}} + self.write(d / 'signature-bindings.json', bindings) + self.write(d / 'compiled.json', {artifact: 'f'*64, 'packages/contracts-bedrock/scripts/go-ffi/go-ffi': 'a'*64}) + discovery = {source: {'OPContractsManagerFixture_Upgrade_Test': ['test_a', 'test_skip']}} + selection = C.UP.selection(discovery, bindings) + for phase in C.C.PHASES: self.write(d / (phase + '-discovery.json'), discovery) + self.write(d / 'selection.json', {phase: selection for phase in C.C.PHASES}) + self.write(d / 'compile-only.json', {'tests': 0, 'selected_cases': {phase: 2 for phase in C.C.PHASES}}) + commands = {'files': C.CS.FILE_COMMANDS['standard'], 'submodules-sync': ['git', '-C', root, 'submodule', 'sync', '--recursive'], + 'submodules-init': ['git', '-C', root, '-c', 'protocol.file.allow=never', 'submodule', 'update', '--init', '--recursive', '--jobs', '8'], + 'build-config': ['forge', 'config', '--json'], 'go-ffi': ['just', 'build-go-ffi'], 'source-build': ['just', 'build-source'], + 'coverage-build': ['forge', 'build'], 'foundry-config': ['forge', 'config', '--json'], + **{phase + '-discovery': argv for phase, argv in C.C.DISCOVERY.items()}} + for name, argv in commands.items(): self.stage(d, name, argv, root) + if provider == 'rwx': + self.seal(d); (d / 'preparation-manifest.json').write_bytes((d / 'final.json').read_bytes()) + self.write(d / 'preparation-settings.json', settings); self.write(d / 'runtime-config.json', config) + (d / 'runtime-files.log').write_text(source + '\n') + self.stage(d, 'runtime-config', ['forge', 'config', '--json'], root); self.stage(d, 'runtime-files', C.CS.FILE_COMMANDS['standard'], root) + block = {'source_sha': SHA, 'policy': 'Just current-day 00:00 UTC', 'chain_id': 1, 'number': 42, 'hash': '0x'+'a'*64, 'timestamp': 1234} + self.write(d / 'block.json', block); preflight = d / 'archive-preflight'; preflight.mkdir() + self.write(preflight / 'block.json', block); (preflight / 'pinned-block.log').write_text('42\n') + self.stage(preflight, 'pinned-block', ['just', 'print-pinned-block-number'], root); self.seal(preflight) + (preflight / 'final.json').rename(preflight / 'preflight-manifest.json') + self.write(d / 'source-after-verdict.json', inputs); self.write(d / 'runtime-fixtures.json', {}) + for phase in C.C.PHASES: + p = d / phase; p.mkdir() + text = ('Running upgrade tests at block 42\n' if phase == 'upgrade' else '') + \ + 'Ran 2 tests for ' + identity + '\n[PASS] test_a() (gas: 1)\n[SKIP: original exclusion] test_skip() (gas: 0)\n' + \ + 'Ran 1 test suite in 1ms: 1 tests passed, 0 failed, 1 skipped (2 total tests)\n' + (p / 'tests.log').write_text(text) + attribution = {'version': 1, 'tests': [{'suite': identity, 'test': 'test_' + name + '()', 'status': status, 'kind': 'unit', 'covered': []} + for name, status in [('a', 'success'), ('skip', 'skipped')]]} + self.write(p / 'original.attribution.json', attribution); cases = C.C.original_cases(text, attribution) + self.write(p / 'original-events.json', C.C.original_evidence(text, attribution)) + self.write(p / 'original-cases.json', cases); C.C.derived_junit(p / 'derived.junit.xml', cases, phase) + self.write(p / 'coverage.json', C.C.accounting(p / 'derived.junit.xml', phase, selection, bindings)) + (p / 'original.lcov.info').write_text('TN:\nSF:src/A.sol\nDA:6,4\nFN:6,A.set\nFNDA:4,A.set\n' + 'FNF:1\nFNH:1\nLF:1\nLH:1\nBRF:0\nBRH:0\nend_of_record\n') + self.write(p / 'lcov-records.json', C.C.lcov((p / 'original.lcov.info').read_text())) + self.write(p / 'coverage-source-sha256.json', {'src/A.sol': 'e'*64}) + self.stage(p, 'tests', C.C.COMMANDS[phase], root) + self.seal(d) + + def stage(self, directory, name, argv, root): + stdout = directory / (name + ('.json' if name.endswith(('config', 'discovery')) else '.log')) + if not stdout.exists(): stdout.write_text('') + stderr = directory / (name + '.stderr.log'); stderr.write_text('') + self.write(directory / (name + '.stage.json'), {'argv': argv, 'cwd': root + '/packages/contracts-bedrock', 'exit_code': 0, + 'stdout_sha256': C.UP.digest(stdout), 'stderr_sha256': C.UP.digest(stderr)}) + def compare(self): return C.compare(self.dirs, 'main', SHA) + + def test_all_original_entries_and_both_passes_match(self): self.assertTrue(self.compare()['verified_parity']) + + def test_nested_transport_manifests_are_required_originals(self): + directory=self.dirs['rwx'] + for relative in ('rpc/final.json','archive-preflight/rpc/final.json'): + path=directory/relative;path.parent.mkdir(parents=True,exist_ok=True) + self.write(path,{'requests':0,'sha256':{}}) + C.UP.finish(directory,0,[]) + self.assertTrue(self.compare()['verified_parity']) + (directory/'rpc/final.json').write_text('{}') + with self.assertRaises(ValueError):self.compare() + + def test_missing_pass_or_original_report_is_rejected(self): + d = self.dirs['rwx']; (d / 'upgrade/original.lcov.info').unlink() + with self.assertRaises(ValueError): self.compare() + + def test_matching_reduced_profile_or_unseeded_benchmark_is_rejected(self): + for d in self.dirs.values(): self.mutate(d, 'foundry-config.json', lambda v: v['invariant'].update(depth=0)) + with self.assertRaisesRegex(ValueError, 'settings'): self.compare() + self.setUp() + for d in self.dirs.values(): self.mutate(d, 'settings.json', lambda v: v.update(benchmark_seed=None)) + with self.assertRaisesRegex(ValueError, 'seed'): self.compare() + + def test_matching_noop_command_is_rejected(self): + for d in self.dirs.values(): self.mutate(d, 'ordinary/tests.stage.json', lambda v: v.update(argv=['true'])) + with self.assertRaisesRegex(ValueError, 'command'): self.compare() + + def test_unbound_ffi_replay_corpus_is_rejected(self): + for d in self.dirs.values(): self.mutate(d, 'settings.json', lambda v:v.update(ffi_replay_seed='0x'+'b'*64)) + with self.assertRaisesRegex(ValueError,'FFI replay'):self.compare() + + def test_missing_new_file_and_duplicate_assignments_fail(self): + for d in self.dirs.values(): + self.mutate(d, 'settings.json', lambda v: v['input_sha256'].update({'packages/contracts-bedrock/test/New.t.sol': 'f'*64})) + self.mutate(d, 'source-after-preparation.json', lambda v: v.update({'packages/contracts-bedrock/test/New.t.sol': 'f'*64})) + with self.assertRaisesRegex(ValueError, 'selection'): self.compare() + self.setUp(); d = self.dirs['circle'] + self.mutate(d, 'file-selection.json', lambda v: v['partitions'].append(v['partitions'][0])) + with self.assertRaisesRegex(ValueError, 'assignment'): self.compare() + + def test_changed_archive_hash_or_unavailable_original_pin_fails(self): + d = self.dirs['rwx']; self.mutate(d, 'block.json', lambda v: v.update(hash='0x'+'b'*64)) + with self.assertRaisesRegex(ValueError, 'preflight'): self.compare() + + def test_raw_lcov_hit_difference_is_not_normalized_away(self): + d = self.dirs['circle']; p = d / 'ordinary'; source = p / 'original.lcov.info' + source.write_text(source.read_text().replace('DA:6,4', 'DA:6,5')) + self.write(p / 'lcov-records.json', C.C.lcov(source.read_text())); self.seal(d) + with self.assertRaisesRegex(ValueError, 'differs at phases'): self.compare() + + def test_every_complete_attribution_item_field_and_hit_affects_parity(self): + item={'source':'src/A.sol','contract':'A','kind':'branch','line_start':6,'line_end':7, + 'byte_start':10,'byte_end':30,'hits':4,'branch_id':1,'path_id':0} + for d in self.dirs.values(): + self.mutate(d,'ordinary/original.attribution.json',lambda data:data['tests'][0].update(covered=[item])) + self.assertTrue(self.compare()['verified_parity']) + d=self.dirs['rwx'];original=(d/'ordinary/original.attribution.json').read_text() + for field,value in [('hits',5),('byte_end',31),('branch_id',2),('path_id',1)]: + data=json.loads(original);data['tests'][0]['covered'][0][field]=value + self.write(d/'ordinary/original.attribution.json',data);self.seal(d) + with self.subTest(field=field),self.assertRaisesRegex(ValueError,'differs at phases'):self.compare() + + def test_derived_junit_cannot_invent_or_change_a_skip_reason(self): + d = self.dirs['circle']; p = d / 'ordinary/derived.junit.xml'; p.write_text(p.read_text().replace('original exclusion', 'invented exclusion')) + self.seal(d) + with self.assertRaisesRegex(ValueError, 'Derived coverage JUnit differs'): self.compare() + + def test_reused_verdict_unexplained_retry_source_mutation_and_corrupt_log_fail(self): + d = self.dirs['rwx']; self.mutate(d, 'settings.json', lambda v: v.update(rwx_run_id=None)) + with self.assertRaisesRegex(ValueError, 'Reused'): self.compare() + self.setUp(); d = self.dirs['circle']; self.stage(d, 'rerun', ['just', 'test-rerun'], '/circle'); self.seal(d) + with self.assertRaisesRegex(ValueError, 'retry'): self.compare() + self.setUp(); d = self.dirs['circle']; self.mutate(d, 'source-after-verdict.json', lambda v: v.update({'go.sum': 'f'*64})) + with self.assertRaisesRegex(ValueError, 'source mutation'): self.compare() + self.setUp(); d = self.dirs['circle']; (d / 'ordinary/tests.log').write_text('corrupt'); self.seal(d) + with self.assertRaisesRegex(ValueError, 'output hashes'): self.compare() + + +if __name__ == '__main__': unittest.main() diff --git a/ops/ci/migration/tests/test_compare_contract_l2_fork.py b/ops/ci/migration/tests/test_compare_contract_l2_fork.py new file mode 100644 index 00000000000..cbeea66e23f --- /dev/null +++ b/ops/ci/migration/tests/test_compare_contract_l2_fork.py @@ -0,0 +1,194 @@ +"""Exercise complete L2 original comparisons; synthetic fixtures add no coverage.""" +import importlib.util +from pathlib import Path +import sys +import tempfile +import unittest +from unittest import mock + +sys.path.insert(0, str(Path(__file__).resolve().parents[2] / 'tests')) +import test_contract_l2_fork as fixtures + +SPEC=importlib.util.spec_from_file_location('compare_l2',Path(__file__).resolve().parents[2] / 'migration' / 'compare-contract-l2-fork.py') +C=importlib.util.module_from_spec(SPEC);SPEC.loader.exec_module(C) +L=C.L + + +class L2ParityTests(unittest.TestCase): + server=fixtures.L2Tests.server + + def setUp(self): + temporary=tempfile.TemporaryDirectory(prefix='L2 parity originals ');self.addCleanup(temporary.cleanup) + self.directory=Path(temporary.name) + self.url,_=self.server() + handle=mock.patch.object(L,'RPC',self.url);handle.start();self.addCleanup(handle.stop) + self.circle=self.fixture('circleci');self.native=self.fixture('rwx') + + def fixture(self,provider): + directory=self.directory/provider;directory.mkdir() + sha='a'*40;workspace='/fixture';identity='test/L2/fork/Portal.t.sol:Portal' + settings={'source_sha':sha,'branch':'codex/rwx-ci-pilot','profile':'ci','feature':'main','chain':'op-mainnet', + 'match_path':L.MATCH,'runtime':dict(L.RUNTIME), + 'provider':provider,'workspace_root':workspace,'inputs':{},'implementation':{}, + 'tools':{name:{'sha256':'b'*64,'version':'fixture pinned tool'} for name in ('forge','cast','go','just')}, + 'rwx_run_id':'c'*32 if provider=='rwx' else None,'rwx_task_attempt':'1' if provider=='rwx' else None} + L.write(directory/'settings.json',settings) + config={'fuzz':{'runs':128},'invariant':{'runs':64,'depth':32},'root':workspace+'/packages/contracts-bedrock'} + L.write(directory/'foundry-config.json',config) + L.write(directory/'discovery.json',{'test/L2/fork/Portal.t.sol':{'Portal':['test_prove','test_upgrade']}}) + artifact_name='packages/contracts-bedrock/forge-artifacts/Portal.t.sol/Portal.json' + artifact=directory/'compiler-artifacts'/artifact_name;artifact.parent.mkdir(parents=True) + methods={'test_prove()':'12345678','test_upgrade()':'87654321'} + L.write(artifact,{'metadata':{'settings':{'compilationTarget':{'test/L2/fork/Portal.t.sol':'Portal'}}}, + 'methodIdentifiers':methods,'bytecode':{'object':'0x6000'}}) + previous=L.UP.ROOT + try: + L.UP.ROOT=directory/'compiler-artifacts' + bindings=L.UP.compiler_signatures(directory/'compiler-artifacts/packages/contracts-bedrock/forge-artifacts') + finally:L.UP.ROOT=previous + selected=L.UP.selection(L.read(directory/'discovery.json'),bindings) + L.write(directory/'signature-bindings.json',bindings);L.write(directory/'selection.json',selected) + L.write(directory/'compiled.json',{artifact_name:L.digest(artifact),'packages/contracts-bedrock/scripts/go-ffi/go-ffi':'d'*64}) + (directory/'submodules.txt').write_text(' '+('e'*40)+' packages/contracts-bedrock/lib/forge-std (fixture)\n') + xml=''+''.join('' for _,name in selected)+'' + (directory/'original.junit.xml').write_text(xml) + L.write(directory/'coverage.json',L.UP.junit(directory/'original.junit.xml',selected,bindings)) + commands={'foundry-config':['forge','config','--json'],'go-ffi':['just','build-go-ffi'],'contracts-build':['forge','build'], + 'discovery':['forge','test','--list','--json','--match-path',L.MATCH], + 'nut-bundle-check':['just','nut-bundle-check-no-build'],'tests':['just','test-l2-fork-upgrade'] + L.TEST_ARGS} + for name,argv in commands.items(): + stdout=directory/(name+('.json' if name in ('foundry-config','discovery') else '.log')) + if not stdout.exists():stdout.write_text('fixture original '+name+'\n') + stderr=directory/(name+'.stderr.log');stderr.write_bytes(b'') + L.write(directory/(name+'.stage.json'),{'argv':argv,'cwd':workspace+'/packages/contracts-bedrock','exit_code':0, + 'started_at':1,'elapsed_seconds':1,'stdout_sha256':L.digest(stdout),'stderr_sha256':L.digest(stderr)}) + preflight=directory/'preflight';preflight.mkdir() + with mock.patch.object(L.UP,'revision',return_value=sha): + chosen=L.preflight(preflight,'latest' if provider=='rwx' else '66') + L.seal(preflight,0,[]);L.write(directory/'block.json',chosen);L.block(directory,chosen['number']) + with L.P.serve(directory/'runtime-rpc',self.url) as endpoint: + request=L.urllib.request.Request(endpoint,data=b'{"jsonrpc":"2.0","id":1,"method":"eth_chainId","params":[]}', + headers={'Content-Type':'application/json'}) + with L.urllib.request.urlopen(request,timeout=5) as response:self.assertEqual(response.status,200) + L.seal(directory,0,[],len(selected));return directory + + def equal(self): + with mock.patch.object(C,'authority'):return C.equal(self.circle,self.native) + + def reseal(self,directory=None): + directory=directory or self.native + final=L.read(directory/'final.json');L.seal(directory,final['exit_code'],final['errors'],final['tests']) + + def test_complete_raw_selection_junit_compiler_and_common_rpc_parity(self): + circle,native=self.equal() + self.assertEqual(circle['selection'],native['selection']) + self.assertEqual(circle['coverage']['outcomes'],{'pass':2}) + self.assertFalse(circle['preflight']['latest_discovery']);self.assertTrue(native['preflight']['latest_discovery']) + self.assertEqual(len(native['preflight']['common_rpc']),5) + self.assertEqual(len(list((self.native/'preflight').glob('rpc-*-request.json'))),6) + + def test_complete_fresh_verdict_accepts_a_fully_warm_rpc_state_cache(self): + directory=self.circle/'runtime-rpc' + for path in directory.iterdir():path.unlink() + directory.rmdir() + with L.P.serve(directory,self.url):pass + self.reseal(self.circle) + circle,native=self.equal() + self.assertEqual(circle['rpc_transport']['requests'],0) + self.assertEqual(circle['rpc_transport']['attempts'],0) + self.assertEqual(circle['coverage'],native['coverage']) + self.assertEqual(circle['coverage']['outcomes'],{'pass':2}) + + def test_resealed_missing_original_junit_verdict_cannot_pass(self): + path=self.native/'original.junit.xml';path.write_text('');self.reseal() + with self.assertRaisesRegex(ValueError,'verdict'):self.equal() + + def test_resealed_extra_discovery_cannot_hide_unexecuted_test(self): + value=L.read(self.native/'discovery.json');value['test/L2/fork/Portal.t.sol']['Portal'].append('test_missing') + L.write(self.native/'discovery.json',value);self.reseal() + with self.assertRaisesRegex(ValueError,'signatures'):self.equal() + + def test_resealed_compiler_signature_binding_must_match_raw_artifact(self): + value=L.read(self.native/'signature-bindings.json') + value['test/L2/fork/Portal.t.sol:Portal']['methods']['test_prove()']='00000000' + L.write(self.native/'signature-bindings.json',value);self.reseal() + with self.assertRaisesRegex(ValueError,'compiler signatures'):self.equal() + + def test_resealed_skip_reason_and_outcome_difference_is_rejected(self): + path=self.native/'original.junit.xml' + path.write_text(path.read_text().replace('','')) + L.write(self.native/'coverage.json',L.UP.junit(path,L.read(self.native/'selection.json'),L.read(self.native/'signature-bindings.json'))) + self.reseal() + with self.assertRaisesRegex(ValueError,'parity differs at coverage'):self.equal() + + def test_resealed_missing_extra_wrong_id_and_nonfinite_rpc_frames_fail(self): + for name in ('extra','wrong-id','nonfinite','missing'): + directory=self.directory/name;directory.mkdir() + with mock.patch.object(L.UP,'revision',return_value='a'*40):L.preflight(directory,'66') + L.seal(directory,0,[]) + if name=='extra':(directory/'rpc-5-attempt-1.json').write_text('{}') + elif name=='wrong-id': + path=directory/'rpc-0-attempt-1.json';value=L.read(path);value['id']=2;L.write(path,value) + metadata=directory/'rpc-0-attempt-1.metadata.json';value=L.read(metadata);value['response_sha256']=L.digest(path);L.write(metadata,value) + elif name=='nonfinite': + path=directory/'rpc-0-attempt-1.metadata.json';value=L.read(path);value['elapsed_seconds']=float('inf');L.write(path,value) + else:(directory/'rpc-0-attempt-1.json').unlink() + L.seal(directory,0,[]) + with self.subTest(change=name),self.assertRaises((ValueError,FileNotFoundError)):C.preflight(directory,'a'*40) + + def test_resealed_diagnostic_pass_cannot_replace_original_failing_execution(self): + L.write(self.native/'rerun.stage.json',{'argv':['just','test-l2-fork-upgrade-rerun'],'exit_code':0});self.reseal() + with self.assertRaisesRegex(ValueError,'diagnostic rerun'):self.equal() + + def test_resealed_unbounded_or_changed_rpc_concurrency_is_rejected(self): + settings=L.read(self.native/'settings.json');settings['runtime']['threads']=6 + L.write(self.native/'settings.json',settings);self.reseal() + with self.assertRaisesRegex(ValueError,'RPC concurrency'):self.equal() + + def test_resealed_original_command_cannot_omit_rpc_budget(self): + path=self.native/'tests.stage.json';stage=L.read(path) + stage['argv']=['just','test-l2-fork-upgrade','--threads','1'] + L.write(path,stage);self.reseal() + with self.assertRaisesRegex(ValueError,'original L2 command'):self.equal() + + def test_resealed_missing_proxy_response_and_unbound_response_id_are_rejected(self): + path=self.native/'runtime-rpc/request-0-attempt-1.json' + value=L.read(path);value['id']=2;L.write(path,value) + metadata=path.with_suffix('.metadata.json');value=L.read(metadata);value['response_sha256']=L.digest(path);L.write(metadata,value) + final=self.native/'runtime-rpc/final.json';value=L.read(final);value['sha256']=L.files(final.parent);L.write(final,value);self.reseal() + with self.assertRaisesRegex(ValueError,'response IDs'):self.equal() + + def test_resealed_runtime_rpc_denial_cannot_be_retried_as_success(self): + directory=self.native/'runtime-rpc';path=directory/'request-0-attempt-1.metadata.json' + first=L.read(path);first['http_status']=403;first['error']='HTTP 403';L.write(path,first) + second=directory/'request-0-attempt-2.json';second.write_bytes((directory/'request-0-attempt-1.json').read_bytes()) + L.write(second.with_suffix('.metadata.json'),first|{'http_status':200,'error':None, + 'started_at':first['started_at']+1,'response_sha256':L.digest(second)}) + final=directory/'final.json';value=L.read(final);value['sha256']=L.files(directory);L.write(final,value);self.reseal() + with self.assertRaisesRegex(ValueError,'permanent denial'):self.equal() + + def test_real_forge_null_and_omitted_parameter_forms_are_retained_without_rewriting(self): + directory=self.directory/'client-forms' + requests=[b'{"jsonrpc":"2.0","id":1,"method":"eth_chainId","params":null}', + b'{"jsonrpc":"2.0","id":2,"method":"eth_chainId"}'] + with L.P.serve(directory,self.url) as endpoint: + for body in requests: + request=L.urllib.request.Request(endpoint,data=body,headers={'Content-Type':'application/json'}) + with L.urllib.request.urlopen(request,timeout=5) as response:self.assertEqual(response.status,200) + value=C.runtime_transport(directory);self.assertEqual(value['requests'],2) + self.assertEqual([(directory/('request-'+str(i)+'.json')).read_bytes() for i in range(2)],requests) + + def test_resealed_stable_runtime_archive_result_difference_is_rejected(self): + directory=self.native/'runtime-rpc';path=directory/'request-0-attempt-1.json' + value=L.read(path);value['result']='0x1';L.write(path,value) + metadata=path.with_suffix('.metadata.json');value=L.read(metadata);value['response_sha256']=L.digest(path);L.write(metadata,value) + final=directory/'final.json';value=L.read(final);value['sha256']=L.files(directory);L.write(final,value);self.reseal() + with self.assertRaisesRegex(ValueError,'stable runtime RPC results differ'):self.equal() + + def test_runtime_original_block_and_retry_history_must_match_preflight(self): + path=self.native/'rpc-1-attempt-1.json';value=L.read(path);value['result']['hash']='0x'+'f'*64;L.write(path,value) + metadata=self.native/'rpc-1-attempt-1.metadata.json';value=L.read(metadata);value['response_sha256']=L.digest(path);L.write(metadata,value);self.reseal() + with self.assertRaisesRegex(ValueError,'runtime block'):self.equal() + + +if __name__=='__main__':unittest.main() diff --git a/ops/ci/migration/tests/test_compare_contract_suites.py b/ops/ci/migration/tests/test_compare_contract_suites.py new file mode 100644 index 00000000000..5ebeb0e9ab9 --- /dev/null +++ b/ops/ci/migration/tests/test_compare_contract_suites.py @@ -0,0 +1,178 @@ +#!/usr/bin/env python3 +"""Reject omitted workload, wrong commands and stale or corrupt producer reports.""" +import importlib.util +import json +from pathlib import Path +import tempfile +import unittest +import sys +sys.path.insert(0, str(Path(__file__).resolve().parents[2] / 'tests')) +from ci_test_fixtures import ReportFixtures +from unittest.mock import patch + +SPEC = importlib.util.spec_from_file_location('compare', Path(__file__).resolve().parents[2] / 'migration' / 'compare-contract-suites.py') +C = importlib.util.module_from_spec(SPEC); SPEC.loader.exec_module(C) +SHA = 'a' * 40 + + +class ComparisonTests(ReportFixtures, unittest.TestCase): + def setUp(self): + self.tmp = tempfile.TemporaryDirectory(); self.addCleanup(self.tmp.cleanup); self.root = Path(self.tmp.name); self.dirs = {} + for provider in ('circle', 'rwx'): + d = self.root / provider; d.mkdir(); self.dirs[provider] = d; root = '/' + provider + files = ['test/Fixture.t.sol']; match = C.CS.match_path(files) + settings = {'source_sha': SHA, 'suite': 'standard', 'feature': 'main', 'branch': 'pilot', 'profile': 'liteci', + 'test_list': 'find test -name "*.t.sol"', + 'provider': 'circleci' if provider == 'circle' else 'rwx', 'workspace_root': root, + 'forge': 'pinned', 'go': 'pinned', 'just': 'pinned', + 'input_sha256': {'packages/contracts-bedrock/test/Fixture.t.sol': 'b' * 64}, + 'runtime_output_paths': [], + 'rwx_run_id': 'c' * 32 if provider == 'rwx' else None, 'rwx_task_attempt': '1'} + self.write(d / 'settings.json', settings) + self.write(d / 'source-after-preparation.json', settings['input_sha256']) + config = {'out': 'out', 'root': root, 'fuzz': {'runs': 128}, 'invariant': {'runs': 64, 'depth': 32}} + self.write(d / 'foundry-config.json', config); (d / 'files.log').write_text('test/Fixture.t.sol\n') + self.write(d / 'file-selection.json', {'files': files, 'partitions': [{'index': 0, 'files': files}], 'match_path': match}) + discovery = {'test/Fixture.t.sol': {'Fixture': ['test_a', 'test_skip']}}; self.write(d / 'discovery.json', discovery) + artifact = 'packages/contracts-bedrock/out/Fixture.t.sol/Fixture.json' + methods = {'test/Fixture.t.sol:Fixture': {'methods': {'test_a()': 'a', 'test_skip()': 'b'}, 'artifacts': {artifact: 'bound'}, + 'creation_bytecode': {artifact: {'bytes': 1, 'sha256': C.UP.hashlib.sha256(b'00').hexdigest()}}}} + self.write(d / 'signature-bindings.json', methods); self.write(d / 'compiled.json', {artifact: 'bound', 'packages/contracts-bedrock/scripts/go-ffi/go-ffi': 'ffi'}) + selected = C.UP.selection(discovery, methods); self.write(d / 'selection.json', selected) + self.write(d / 'compile-only.json', {'tests': 0, 'selected_cases': 2, 'suite': 'standard', 'feature': 'main'}) + (d / 'submodules.txt').write_text(' ' + 'd' * 40 + ' original-module\n') + commands = {'files': C.CS.FILE_COMMANDS['standard'], 'foundry-config': ['forge', 'config', '--json'], + 'submodules-sync': ['git', '-C', root, 'submodule', 'sync', '--recursive'], + 'submodules-init': ['git', '-C', root, '-c', 'protocol.file.allow=never', 'submodule', + 'update', '--init', '--recursive', '--jobs', '8'], + 'go-ffi': ['just', 'build-go-ffi'], 'contracts-build': ['forge', 'build'], + 'discovery': ['forge', 'test', '--list', '--json', '--match-path', match]} + for name, argv in commands.items(): self.stage(d, name, argv, root) + if provider == 'rwx': + self.seal(d); (d / 'preparation-manifest.json').write_bytes((d / 'final.json').read_bytes()) + self.write(d / 'preparation-settings.json', settings) + self.write(d / 'runtime-config.json', config); (d / 'runtime-files.log').write_text('test/Fixture.t.sol\n') + self.stage(d, 'runtime-config', ['forge', 'config', '--json'], root) + self.stage(d, 'runtime-files', C.CS.FILE_COMMANDS['standard'], root) + else: + (d / 'split.log').write_text('test/Fixture.t.sol\n'); self.stage(d, 'split', C.CS.SPLIT_COMMAND, root) + (d / 'original.junit.xml').write_text('' + 'original guard') + self.write(d / 'source-after-verdict.json', settings['input_sha256']) + self.write(d / 'runtime-fixtures.json', {}) + self.write(d / 'coverage.json', C.UP.junit(d / 'original.junit.xml', selected, methods)) + self.stage(d, 'tests', ['forge', 'test', '--match-path', match, '--junit'], root) + self.stage(d, 'junit-nonempty', ['./scripts/checks/check-junit-tests-ran.sh', root + '/.ci/contract-suites/standard-main/run/original.junit.xml'], root) + self.stage(d, 'lint-test-names', ['just', 'lint-forge-tests-check-no-build'], root); self.seal(d) + + def stage(self, d, name, argv, root): self.write(d / (name + '.stage.json'), {'argv': argv, 'cwd': root + '/packages/contracts-bedrock', 'exit_code': 0}) + def compare(self): return C.compare(self.dirs, 'standard', 'main', SHA) + + def test_complete_original_settings_assignments_and_verdicts_match(self): + self.assertTrue(self.compare()['verified_parity']) + + def test_only_empty_non_test_interfaces_are_distinct_from_executable_workload(self): + d = self.dirs['rwx']; name = 'test/Fixture.t.sol:VmContractHelper123' + artifact = 'packages/contracts-bedrock/out/Fixture.t.sol/VmContractHelper123.json' + row = {'methods': {'getCode(string)': 'a'}, 'artifacts': {artifact: 'helper'}, + 'creation_bytecode': {artifact: {'bytes': 0, 'sha256': C.UP.hashlib.sha256(b'').hexdigest()}}} + self.mutate(d, 'signature-bindings.json', lambda v: v.update({name: row})) + self.mutate(d, 'compiled.json', lambda v: v.update({artifact: 'helper'})) + def seal_preparation(): + manifest = json.loads((d / 'preparation-manifest.json').read_text()) + for filename in ('signature-bindings.json', 'compiled.json'): + manifest['original_sha256'][filename] = C.UP.digest(d / filename) + self.write(d / 'preparation-manifest.json', manifest); self.seal(d) + seal_preparation() + result = self.compare() + self.assertEqual(result['non_test_interface_differences'][name]['rwx'], + {'methods': {'getCode(string)': 'a'}, 'deployable': False}) + for bytecode, method in [(1, 'getCode(string)'), (0, 'test_removed()'), (0, 'invariant_removed()')]: + row['methods'] = {method: 'a'} + row['creation_bytecode'][artifact] = {'bytes': bytecode, 'sha256': C.UP.hashlib.sha256(b'00' if bytecode else b'').hexdigest()} + self.mutate(d, 'signature-bindings.json', lambda v: v.update({name: row})); seal_preparation() + with self.subTest(bytecode=bytecode, method=method), self.assertRaisesRegex(ValueError, 'differs at methods'): + self.compare() + + def test_omitted_new_file_is_rejected_even_when_both_providers_omit_it(self): + for d in self.dirs.values(): + self.mutate(d, 'settings.json', lambda v: v['input_sha256'].update({'packages/contracts-bedrock/test/New.t.sol': 'f' * 64})) + for phase in ('preparation', 'verdict'): + self.mutate(d, 'source-after-' + phase + '.json', lambda v: v.update({'packages/contracts-bedrock/test/New.t.sol': 'f' * 64})) + with self.assertRaisesRegex(ValueError, 'discovery'): self.compare() + + def test_matching_source_mutations_are_rejected(self): + for d in self.dirs.values(): + self.mutate(d, 'source-after-verdict.json', lambda v: v.update({'go.sum': 'f' * 64})) + with self.assertRaisesRegex(ValueError, 'source inputs changed during verdict'): self.compare() + + def tracked_fixture(self, d, name): + before = d / 'tracked-fixtures/before' / name; before.parent.mkdir(parents=True); before.write_text('original') + after = d / 'tracked-fixtures/after' / name; after.parent.mkdir(parents=True); after.write_text('generated') + settings = json.loads((d / 'settings.json').read_text()) + settings['input_sha256'][name] = C.UP.digest(before); settings['runtime_output_paths'] = [name] + self.write(d / 'settings.json', settings); self.write(d / 'source-after-preparation.json', settings['input_sha256']) + final_inputs = dict(settings['input_sha256'], **{name: C.UP.digest(after)}) + self.write(d / 'source-after-verdict.json', final_inputs) + self.write(d / 'runtime-fixtures.json', {name: {'before_sha256': C.UP.digest(before), 'after_sha256': C.UP.digest(after)}}) + self.write(d / 'source-changes-verdict.json', {name: {'before': C.UP.digest(before), 'after': C.UP.digest(after)}}) + if d == self.dirs['rwx']: + self.write(d / 'preparation-settings.json', settings) + manifest = json.loads((d / 'preparation-manifest.json').read_text()) + for file in ['settings.json', 'source-after-preparation.json', 'tracked-fixtures/before/' + name]: + manifest['original_sha256'][file] = C.UP.digest(d / file) + self.write(d / 'preparation-manifest.json', manifest) + self.seal(d) + + def test_selected_tracked_runtime_fixture_requires_original_payload_hashes(self): + name = 'packages/contracts-bedrock/snapshots/upgrades/current-upgrade-bundle.json' + with patch.dict(C.CS.TRACKED_OUTPUTS, {'test/Fixture.t.sol': name}, clear=True): + for d in self.dirs.values(): self.tracked_fixture(d, name) + result = self.compare(); self.assertIn(name, result['runtime_fixtures']) + d = self.dirs['rwx']; (d / 'tracked-fixtures/after' / name).write_text('corrupt'); self.seal(d) + with self.assertRaisesRegex(ValueError, 'Corrupt original tracked runtime fixture'): self.compare() + + def test_matching_undeclared_runtime_output_role_is_rejected(self): + for d in self.dirs.values(): self.mutate(d, 'settings.json', lambda v: v.update(runtime_output_paths=['go.sum'])) + with self.assertRaisesRegex(ValueError, 'Unexpected tracked runtime output role'): self.compare() + + def test_duplicate_partition_or_missing_original_is_rejected(self): + d = self.dirs['rwx']; self.mutate(d, 'file-selection.json', lambda v: v['partitions'].append(v['partitions'][0])) + with self.assertRaisesRegex(ValueError, 'assignment'): self.compare() + (d / 'original.junit.xml').unlink() + with self.assertRaises(ValueError): self.compare() + + def test_matching_wrong_command_is_not_proof_of_parity(self): + for d in self.dirs.values(): self.mutate(d, 'tests.stage.json', lambda v: v.update(argv=['true'])) + with self.assertRaisesRegex(ValueError, 'command'): self.compare() + + def test_reduced_fuzzing_is_rejected(self): + for d in self.dirs.values(): self.mutate(d, 'foundry-config.json', lambda v: v['fuzz'].update(runs=1)) + with self.assertRaisesRegex(ValueError, 'settings'): self.compare() + + def test_stale_sha_and_uninvestigated_retry_fail(self): + d = self.dirs['rwx']; self.mutate(d, 'settings.json', lambda v: v.update(source_sha='f' * 40)) + with self.assertRaisesRegex(ValueError, 'source'): self.compare() + self.setUp(); d = self.dirs['rwx']; self.stage(d, 'rerun', ['just', 'test-rerun'], '/rwx'); self.seal(d) + with self.assertRaisesRegex(ValueError, 'retry'): self.compare() + + def test_corrupt_original_or_unsealed_extra_is_rejected(self): + d = self.dirs['rwx']; (d / 'original.junit.xml').write_text('corrupt') + with self.assertRaises(ValueError): self.compare() + self.setUp(); d = self.dirs['rwx']; (d / 'extra.txt').write_text('unsealed') + with self.assertRaisesRegex(ValueError, 'Unsealed'): self.compare() + + def test_changed_runtime_config_or_corrupt_preparation_is_rejected(self): + d = self.dirs['rwx']; self.mutate(d, 'runtime-config.json', lambda v: v.update(match_test='partial')) + with self.assertRaisesRegex(ValueError, 'Runtime'): self.compare() + self.setUp(); d = self.dirs['rwx']; self.mutate(d, 'preparation-manifest.json', lambda v: v.update(exit_code=17)) + with self.assertRaisesRegex(ValueError, 'producer'): self.compare() + + def test_native_reused_verdict_and_nonzero_tests_in_producer_are_rejected(self): + d = self.dirs['rwx']; self.mutate(d, 'settings.json', lambda v: v.update(rwx_run_id=None)) + with self.assertRaisesRegex(ValueError, 'Reused'): self.compare() + self.setUp(); d = self.dirs['circle']; self.mutate(d, 'compile-only.json', lambda v: v.update(tests=1)) + with self.assertRaisesRegex(ValueError, 'compile-only'): self.compare() + + +if __name__ == '__main__': unittest.main() diff --git a/ops/ci/migration/tests/test_compare_contract_upgrades.py b/ops/ci/migration/tests/test_compare_contract_upgrades.py new file mode 100644 index 00000000000..5750f10a3a8 --- /dev/null +++ b/ops/ci/migration/tests/test_compare_contract_upgrades.py @@ -0,0 +1,103 @@ +#!/usr/bin/env python3 +"""Reject incomplete or mismatched original L1 upgrade evidence.""" +import hashlib +import importlib.util +import json +from pathlib import Path +import tempfile +import unittest +import sys +sys.path.insert(0, str(Path(__file__).resolve().parents[2] / 'tests')) +from ci_test_fixtures import ReportFixtures + +SPEC=importlib.util.spec_from_file_location('compare',Path(__file__).resolve().parents[2] / 'migration' / 'compare-contract-upgrades.py') +C=importlib.util.module_from_spec(SPEC);SPEC.loader.exec_module(C) +SHA='a'*40 + + +class ComparisonTests(ReportFixtures, unittest.TestCase): + def setUp(self): + self.tmp=tempfile.TemporaryDirectory();self.addCleanup(self.tmp.cleanup) + self.root=Path(self.tmp.name);self.directories={} + for provider in ['circle','rwx']: + d=self.root/provider;d.mkdir();self.directories[provider]=d;workspace='/'+provider + settings={'source_sha':SHA,'variant':'feature-main','chain':'op','feature':'main','branch':'pilot','profile':'liteci', + 'fuzz_seed':'42424242','fuzz_runs':1,'provider':'circleci' if provider=='circle' else 'rwx', + 'workspace_root':workspace,'forge':'pinned','go':'pinned','just':'pinned','input_sha256':{'source':'original'}, + 'rwx_run_id':'c'*32 if provider=='rwx' else None,'rwx_task_attempt':'1'} + self.write(d/'settings.json',settings);self.write(d/'foundry-config.json',{'out':'out','root':workspace}) + discovery={'test/L1/Original.t.sol':{'Original':['test_a','test_skip']}};self.write(d/'discovery.json',discovery) + methods={'test/L1/Original.t.sol:Original':{'methods':{'test_a()':'original','test_skip()':'original'}, + 'creation_bytecode':{'packages/contracts-bedrock/out/Original.t.sol/Original.json': + {'bytes':1,'sha256':hashlib.sha256(b'00').hexdigest()}}, + 'artifacts':{'packages/contracts-bedrock/out/Original.t.sol/Original.json':'artifact-hash'}}} + self.write(d/'signature-bindings.json',methods);self.write(d/'compiled.json',methods['test/L1/Original.t.sol:Original']['artifacts']) + selected=C.UP.selection(discovery,methods);self.write(d/'selection.json',selected) + junit=d/'original.junit.xml';junit.write_text('' + 'feature disabled') + self.write(d/'coverage.json',C.UP.junit(junit,selected,methods));(d/'submodules.txt').write_text(' ' + 'd' * 40 + ' original-submodule\n') + self.write(d/'block.json',{'source_sha':SHA,'chain_id':1,'number':66,'hash':'0x'+'b'*64,'timestamp':100,'policy':'Just current-day 00:00 UTC'}) + for name,argv in {'foundry-config':['forge','config','--json'],'go-ffi':['just','build-go-ffi'], + 'contracts-build':['forge','build'], + 'discovery':['forge','test','--list','--json','--match-path',C.UP.MATCH],'tests':['just','test-upgrade']}.items(): + self.write(d/(name+'.stage.json'),{'argv':argv,'cwd':workspace+'/packages/contracts-bedrock','exit_code':0}) + self.seal(d) + + def compare(self):return C.compare(self.directories,'feature-main',SHA) + + def test_complete_original_selection_signatures_skips_settings_and_block_match(self): + self.assertTrue(self.compare()['verified_parity']) + + def test_stale_revision_failed_original_and_corrupt_file_fail_closed(self): + d=self.directories['rwx'] + for mode in ['stale','failed','corrupt']: + with self.subTest(mode=mode): + self.setUp();d=self.directories['rwx'] + if mode=='stale': + p=d/'settings.json';row=json.loads(p.read_text());row['source_sha']='f'*40;self.write(p,row);self.seal(d) + elif mode=='failed': + p=d/'final.json';row=json.loads(p.read_text());row['exit_code']=1;self.write(p,row) + else:(d/'original.junit.xml').write_text('damaged original') + with self.assertRaises(ValueError):self.compare() + + def test_fork_height_and_hash_drift_require_investigation(self): + for key,value in [('number',67),('hash','0x'+'c'*64)]: + with self.subTest(field=key): + self.setUp();d=self.directories['rwx'];p=d/'block.json';v=json.loads(p.read_text());v[key]=value;self.write(p,v);self.seal(d) + with self.assertRaisesRegex(ValueError,'block'):self.compare() + + def test_matching_wrong_command_is_not_a_valid_workload(self): + for d in self.directories.values(): + p=d/'tests.stage.json';v=json.loads(p.read_text());v['argv']=['true'];self.write(p,v);self.seal(d) + with self.assertRaisesRegex(ValueError,'command'):self.compare() + + def test_compiler_signature_binding_cannot_be_detached_from_artifacts(self): + d=self.directories['rwx'];self.write(d/'compiled.json',{});self.seal(d) + with self.assertRaisesRegex(ValueError,'artifact binding'):self.compare() + + def test_missing_test_extra_original_and_different_skip_are_rejected(self): + for mode in ['missing','extra','skip']: + with self.subTest(mode=mode): + self.setUp();d=self.directories['rwx'];p=d/'original.junit.xml';v=p.read_text() + if mode=='missing':v=v.replace('','') + elif mode=='extra':v=v.replace('test_a()','extra()') + else:v=v.replace('feature disabled','different behavior') + p.write_text(v) + if mode=='skip':self.write(d/'coverage.json',C.UP.junit(p,json.loads((d/'selection.json').read_text()),json.loads((d/'signature-bindings.json').read_text()))) + self.seal(d) + with self.assertRaises(ValueError):self.compare() + + def test_uninvestigated_retry_or_reused_verdict_remains_an_error(self): + d=self.directories['rwx'];self.write(d/'rerun.stage.json',{'argv':['just','test-upgrade-rerun'],'exit_code':0});self.seal(d) + with self.assertRaisesRegex(ValueError,'retry'):self.compare() + (d/'rerun.stage.json').unlink();p=d/'settings.json';v=json.loads(p.read_text());v['rwx_run_id']=None;self.write(p,v);self.seal(d) + with self.assertRaisesRegex(ValueError,'fresh'):self.compare() + + def test_profile_feature_and_submodule_drift_are_not_path_differences(self): + d=self.directories['rwx'];p=d/'settings.json';v=json.loads(p.read_text());v['feature']='ZK_DISPUTE_GAME';self.write(p,v);self.seal(d) + with self.assertRaisesRegex(ValueError,'workload'):self.compare() + v['feature']='main';self.write(p,v);(d/'submodules.txt').write_text(' ' + 'e' * 40 + ' original-submodule\n');self.seal(d) + with self.assertRaisesRegex(ValueError,'submodules'):self.compare() + + +if __name__=='__main__':unittest.main() diff --git a/ops/ci/migration/tests/test_compare_flaky_report.py b/ops/ci/migration/tests/test_compare_flaky_report.py new file mode 100644 index 00000000000..7243bf6edd3 --- /dev/null +++ b/ops/ci/migration/tests/test_compare_flaky_report.py @@ -0,0 +1,115 @@ +#!/usr/bin/env python3 +"""Reject omissions and changed evidence using the complete original API fixture.""" +import copy +import hashlib +import importlib.util +import json +from pathlib import Path +import shutil +import unittest +from unittest import mock + + +def helper(name): + spec = importlib.util.spec_from_file_location(name, Path(__file__).resolve().parents[2] / ('migration' if name.startswith('compare-') else 'migration/tests' if name=='test_flaky_report' else 'tests' if name.startswith('test_') else 'migration' if name=='flaky-report' else 'runtime') / (name + '.py')) + module = importlib.util.module_from_spec(spec); spec.loader.exec_module(module) + return module + + +C = helper('compare-flaky-report') +T = helper('test_flaky_report') + + +class ReportComparisonTests(unittest.TestCase): + def setUp(self): + self.generator = T.FlakyTests(); self.generator.setUp() + self.addCleanup(self.generator.doCleanups) + result, report = self.generator.generate() + self.assertEqual(result.returncode, 0, result.stderr) + self.directory = self.generator.root / 'originals'; self.directory.mkdir() + shutil.copytree(report, self.directory / 'reports') + self.cwd = '/tmp/provider workspace' + self.inputs = {name: b'committed fixture ' + name.encode() for name in C.F.INPUTS} + C.F.write(self.directory / 'settings.json', { + 'source_sha': 'a' * 40, 'branch': 'codex/rwx-ci-pilot', 'provider': 'rwx', + 'scope': 'project-wide branch-agnostic Circle Insights', 'authenticated': False, + 'api_url': 'https://circleci.com/api/v2/insights/gh/ethereum-optimism/optimism/flaky-tests?branch=codex%2Frwx-ci-pilot', + 'input_sha256': {name: hashlib.sha256(raw).hexdigest() for name, raw in self.inputs.items()}, + 'jq': 'jq-1.7.1', 'curl': 'curl fixture version', 'native_run_id': 'b' * 32, 'native_task_attempt': '1'}) + argv = ['bash', self.cwd + '/' + C.F.SCRIPT, '--branch', 'codex/rwx-ci-pilot', '--org', 'ethereum-optimism', + '--repo', 'optimism', '--output-dir', self.cwd + '/.ci/flaky-report/run/reports'] + (self.directory / 'stdout.log').write_text(result.stdout.replace(str(report), argv[-1])) + (self.directory / 'stderr.log').write_text(result.stderr) + C.F.write(self.directory / 'execution.json', {'argv': argv, 'cwd': self.cwd, 'exit_code': 0, + 'signals': [], 'timed_out': False, 'started_at': 1700000000.0, 'elapsed_seconds': 1.0, + 'stdout_sha256': C.F.digest(self.directory / 'stdout.log'), 'stderr_sha256': C.F.digest(self.directory / 'stderr.log')}) + C.F.write(self.directory / 'coverage.json', {'source_rows': 79, 'acceptance_rows': 12, + 'scope': 'project-wide branch-agnostic Circle Insights'}) + self.seal() + + def seal(self): + C.F.write(self.directory / 'final.json', {'state': 'passed', 'exit_code': 0, 'tests': 0, 'reports': 1, + 'errors': [], 'sha256': C.F.files(self.directory)}) + + def read_report(self): + with mock.patch.object(C.G, 'source', side_effect=lambda name, _: self.inputs[name]): + return C.report(self.directory) + + def test_complete_nonempty_report_and_all_source_rows(self): + value = self.read_report() + self.assertEqual(value['rows'], {'source_rows': 79, 'acceptance_rows': 12}) + self.assertEqual(len(value['original']['flaky_tests']), 79) + self.assertEqual(C.equal(value, copy.deepcopy(value))['attempts']['rwx'][0]['status'], '200') + + def test_corrupt_or_missing_originals_fail_even_with_a_new_seal(self): + path = self.directory / 'reports/flaky_tests.csv'; raw = path.read_bytes() + path.write_bytes(raw + b'changed') + with self.assertRaisesRegex(ValueError, 'corrupt original'): self.read_report() + self.seal() + with self.assertRaises((ValueError, IndexError, json.JSONDecodeError)): self.read_report() + path.write_bytes(raw); self.seal() + path = self.directory / 'reports/api-attempt-1.stderr.log'; path.unlink(); self.seal() + with self.assertRaises((ValueError, FileNotFoundError)): self.read_report() + + def test_changed_source_tool_or_process_cannot_be_resealed(self): + path = self.directory / 'settings.json'; original = C.F.read(path) + for key, changed in (('input_sha256', {}), ('jq', 'jq-0'), ('api_url', 'https://example.org'), ('authenticated', True)): + C.F.write(path, original | {key: changed}); self.seal() + with self.subTest(field=key), self.assertRaises(ValueError): self.read_report() + C.F.write(path, original) + path = self.directory / 'execution.json'; original = C.F.read(path) + for key, changed in (('exit_code', 1), ('timed_out', True), ('signals', [15]), ('argv', ['true']), ('elapsed_seconds', 0)): + C.F.write(path, original | {key: changed}); self.seal() + with self.subTest(field=key), self.assertRaises(ValueError): self.read_report() + + def test_full_unfiltered_api_rows_and_dates_must_agree(self): + original = self.read_report() + for key in ('original', 'filtered', 'csv', 'html', 'stdout', 'rows'): + changed = copy.deepcopy(original) + if key in ('original', 'filtered'): changed[key]['flaky_tests'][0]['workflow_created_at'] = '2020-01-01T00:00:00Z' + elif key == 'rows': changed[key]['source_rows'] -= 1 + elif key == 'stdout': changed[key] += 'extra omitted row\n' + else: changed[key] += b'changed' + with self.subTest(component=key), self.assertRaisesRegex(ValueError, 'parity differs'): C.equal(original, changed) + + def test_retry_history_is_retained_as_a_provider_difference(self): + value = self.read_report(); changed = copy.deepcopy(value) + changed['attempts'].insert(0, {'number': 1, 'status': '503', 'exit_code': 22, + 'body_sha256': 'c' * 64, 'stderr_sha256': 'd' * 64}) + changed['attempts'][1]['number'] = 2 + compared = C.equal(value, changed) + self.assertEqual([row['status'] for row in compared['attempts']['rwx']], ['503', '200']) + changed['attempts'][-1]['status'] = '403' + with self.assertRaisesRegex(ValueError, 'final original'): C.equal(value, changed) + + def test_orphan_attempts_and_nonfinite_api_values_fail(self): + path = self.directory / 'reports/api-attempt-9.json'; path.write_text('{}'); self.seal() + with self.assertRaisesRegex(ValueError, 'attempt files'): self.read_report() + path.unlink() + path = self.directory / 'reports/flaky_tests.original.json' + value = C.F.read(path); value['flaky_tests'][0]['time_wasted'] = 987654.321 + path.write_text(json.dumps(value).replace('987654.321', '1e309', 1)) + with self.assertRaisesRegex(ValueError, 'provenance'): C.F.validate_api(path) + + +if __name__ == '__main__': unittest.main() diff --git a/ops/ci/migration/tests/test_compare_main_checks.py b/ops/ci/migration/tests/test_compare_main_checks.py new file mode 100644 index 00000000000..c37538c4ab8 --- /dev/null +++ b/ops/ci/migration/tests/test_compare_main_checks.py @@ -0,0 +1,236 @@ +#!/usr/bin/env python3 +"""Reject matching omissions, wrong commands and corrupt original Main reports.""" +import importlib.util +import json +from pathlib import Path +import tempfile +import unittest +import xml.etree.ElementTree as ET + +SPEC = importlib.util.spec_from_file_location('compare_main', Path(__file__).resolve().parents[2] / 'migration' / 'compare-main-checks.py') +COMPARE = importlib.util.module_from_spec(SPEC); SPEC.loader.exec_module(COMPARE) +SHA = 'a' * 40 + + +class OriginalMainTests(unittest.TestCase): + def setUp(self): + self.tmp = tempfile.TemporaryDirectory(); self.addCleanup(self.tmp.cleanup) + self.root = Path(self.tmp.name); self.directories = {} + + def write(self, path, value): + path.parent.mkdir(parents=True, exist_ok=True) + COMPARE.MAIN.STAGES.write(path, value) + + def seal(self, directory): + self.write(directory / 'final.json', {'exit_code':0,'report_errors':[], + 'original_sha256':{str(p.relative_to(directory)):COMPARE.MAIN.STAGES.digest(p) + for p in directory.rglob('*') if p.is_file() and p.name != 'final.json'}}) + + def fixture(self, job): + self.job = job + for provider in ('circle','rwx'): + directory = self.root / provider; directory.mkdir(); self.directories[provider] = directory + settings = {'source_sha':SHA,'job':job,'provider':'circleci' if provider == 'circle' else 'rwx', + 'branch':'pilot','workspace_root':'/' + provider,'tools':{'go':'go1.26.6','just':'pinned','jq':'pinned','yq':'pinned'}, + 'input_sha256':{'ops/ci/runtime/main-checks.py':'b' * 64}, + 'rwx_run_id':'fresh-original','rwx_task_attempt':'1'} + selection, source, commands = {}, {}, {'check':(['bash','.circleci/scripts/check-l2-chains-sync.sh'] if job=='l2-chains-sync-check' else COMPARE.MAIN.COMMANDS[job])} + def original(name, argv, data=None): + relative = COMPARE.MAIN.MOCKS[job] if job in COMPARE.MAIN.MOCKS and name in ('packages','generators') else 'op-deployer' if job == 'op-deployer-forge-version' and name == 'check' else '' + self.write(directory / (name + '.stage.json'), {'argv':argv, 'exit_code':0,'stdin':'devnull', + 'cwd':str(Path(settings['workspace_root']) / relative)}) + (directory / (name + '.log')).write_text('') + if data is not None: + if isinstance(data, str): (directory / (name + '.json')).write_text(data) + else: self.write(directory / (name + '.json'), data) + if job in COMPARE.MAIN.GO_JOBS: + commands['go-env'] = ['go','env','-json','GOOS','GOARCH','CGO_ENABLED','GOFLAGS','GOTOOLCHAIN'] + settings['go_environment'] = {'GOOS':'linux','GOARCH':'amd64','CGO_ENABLED':'1','GOFLAGS':'','GOTOOLCHAIN':'auto'} + original('go-env', commands['go-env'], settings['go_environment']) + if job == 'opgeth-ratchet': + source = {'justfile': 'opgeth-ratchet:\n go run ./ops/scripts/opgeth-ratchet\n', 'ops/scripts/opgeth-ratchet/allowlist.txt': 'fixture\n'} + if job in COMPARE.MAIN.MOCKS: + component = COMPARE.MAIN.MOCKS[job] + source = {component + '/input.go':'package input\n//go:generate mockery --name Input\n', + component + '/input_test.go':'package input\n//go:generate echo test-input\n', + component + '/mocks/input.go':'// Code generated by mockery. DO NOT EDIT.\npackage mocks\n'} + rows = [{'ImportPath':'fixture/' + component, 'Dir':settings['workspace_root'] + '/' + component, + 'GoFiles':['input.go'],'TestGoFiles':['input_test.go'],'IgnoredGoFiles':['excluded.go']}, + {'ImportPath':'fixture/' + component + '/mocks','Dir':settings['workspace_root'] + '/' + component + '/mocks','GoFiles':['input.go']}] + commands.update(packages=['go','list','-tags=generate','-json','./...'], generators=['go','generate','-n','-v','./...']) + original('packages', commands['packages'], '\n'.join(json.dumps(r) for r in rows)) + original('generators', commands['generators']) + (directory / 'generators.log').write_text('input.go\nmockery --name Input\ninput_test.go\necho test-input\n') + elif job == 'l2-chains-sync-check': + source = {'.circleci/continue/main.yml':'original yaml\n','.circleci/l2-rpcs.json':'{"op-mainnet":{}}\n'} + config = {'workflows':{'scheduled-daily-tests':{'jobs':[{'contracts-bedrock-tests-l2-fork':{'matrix':{'parameters':{'fork_op_chain':['op-mainnet']}}}}]}}} + commands['configuration'] = ['yq','-o=json','.','.circleci/continue/main.yml'] + original('configuration',commands['configuration'],config) + selection = COMPARE.E.helper('l2-chains-sync-check').l2_selection(config, {'op-mainnet':{}}) + elif job == 'op-deployer-forge-version': + source = {'mise.toml':'[tools]\nforge = "1.8.3"\n','op-deployer/pkg/deployer/forge/version.json':'{"forge":"v1.8.3"}\n'} + commands['mise-config'] = ['yq','-o=json','.','mise.toml'] + original('mise-config',commands['mise-config'],{'tools':{'forge':'1.8.3'}}) + selection = {'mise_forge':'1.8.3','deployer':{'forge':'v1.8.3'}} + elif job == 'check-op-geth-version': + source = {'go.mod':'module fixture\n'} + commands['go-mod'] = ['go','mod','edit','-json'] + selection = {'Module':{'Path':'fixture'},'Require':[]} + original('go-mod',commands['go-mod'],selection) + elif job == 'check-nut-locks': + source = {'op-core/nuts/fork_lock.toml':'[fork]\nbundle = "op-core/nuts/bundles/fork_nut_bundle.json"\n', + 'op-core/nuts/bundles/fork_nut_bundle.json':'{}\n','op-core/nuts/state/fork_state.json':'{}\n'} + commands['fetch-develop'] = ['git','fetch','--no-tags','origin','+refs/heads/develop:refs/remotes/origin/develop'] + original('fetch-develop',commands['fetch-develop']) + elif job != 'opgeth-ratchet': + selection = {'files':['complete.txt'],'todos':[],'near_misses':[],'check_closed':False} + commands.update(COMPARE.MAIN.TODO_DISCOVERY) + for name, argv in COMPARE.MAIN.TODO_DISCOVERY.items(): original(name,argv) + (directory / 'files.log').write_text('complete.txt\n') + if job in COMPARE.MAIN.MOCKS or job == 'opgeth-ratchet': + dependencies = directory / 'dependencies'; dependencies.mkdir() + bundle = dependencies / 'superchain-configs.zip'; bundle.write_bytes(b'original pinned bundle') + digest = COMPARE.MAIN.STAGES.digest(bundle); pin = dependencies / 'superchain-configs.zip.sha256' + pin.write_text(digest + ' superchain-configs.zip\n') + settings['input_sha256'].update({name:'d'*64 for name in COMPARE.MAIN.BUNDLE_INPUTS}) + if job == 'opgeth-ratchet': + settings['input_sha256']['justfile'] = __import__('hashlib').sha256(source['justfile'].encode()).hexdigest() + settings['input_sha256'][COMPARE.MAIN.BUNDLE + '.sha256'] = COMPARE.MAIN.STAGES.digest(pin) + settings['input_sha256']['superchain-registry'] = {'gitlink':'e'*40} + binding = {'source_sha':SHA,'registry_revision':'e'*40,'sha256':digest,'expected_sha256':digest, + 'input_sha256':{name:settings['input_sha256'][name] for name in COMPARE.MAIN.BUNDLE_INPUTS}, + 'tools':settings['tools']} + commands['superchain'] = ['just','build-superchain-go']; original('superchain',commands['superchain']) + if provider == 'rwx': + prep = directory / 'producer'; prep.mkdir() + self.write(prep / 'bundle.json', binding); self.write(prep / 'coverage.json', {'tests':0,'verified_bundle':True}) + self.write(prep / 'superchain.stage.json',json.loads((directory / 'superchain.stage.json').read_text())) + (prep / 'superchain.log').write_text('verified bundle') + self.write(prep / 'manifest.json', {'exit_code':0,'report_errors':[], + 'original_sha256':{p.name:COMPARE.MAIN.STAGES.digest(p) for p in prep.iterdir()}}) + for name, text in source.items(): + p = directory / 'source' / name; p.parent.mkdir(parents=True, exist_ok=True); p.write_text(text) + settings['input_sha256'][name] = COMPARE.MAIN.STAGES.digest(p) + if job in COMPARE.MAIN.MOCKS: + selected = COMPARE.MAIN.packages((directory / 'packages.json').read_text(),component,settings['workspace_root'],directory / 'source') + before = {component + '/mocks/input.go':settings['input_sha256'][component + '/mocks/input.go']} + selection = {'component':component,'packages':selected,'generated_before':before,'superchain':binding} + self.write(directory / 'generated.json', before) + elif job == 'opgeth-ratchet': + selection = {'superchain': binding, 'inputs': {n: settings['input_sha256'][n] for n in source}} + elif job == 'check-nut-locks': selection = COMPARE.MAIN.nut_selection(directory / 'source','c' * 40) + original('check',commands['check']) + self.write(directory / 'settings.json',settings); self.write(directory / 'selection.json',selection) + self.write(directory / 'inputs-after.json',settings['input_sha256']) + self.write(directory / 'coverage.json',{'job':job,'outcome':'pass','attempts':1,'complete_selection':True,'command':(['bash','.circleci/scripts/check-l2-chains-sync.sh'] if job=='l2-chains-sync-check' else COMPARE.MAIN.COMMANDS[job])}) + suite = ET.Element('testsuite',name='main-checks',tests='1',failures='0') + ET.SubElement(suite,'testcase',name=job,classname='main-checks'); ET.ElementTree(suite).write(directory / 'check.junit.xml') + self.seal(directory) + + def compare(self): return COMPARE.compare(self.directories,self.job,SHA) + + def test_all_original_main_job_reports_match(self): + for job in COMPARE.MAIN.COMMANDS: + with self.subTest(job=job): + self.root = Path(self.tmp.name) / job; self.root.mkdir(); self.fixture(job) + self.assertTrue(self.compare()['verified_parity']) + + def test_same_wrong_original_command_is_rejected(self): + self.fixture('check-generated-mocks-op-node') + for d in self.directories.values(): + p=d/'check.stage.json';row=json.loads(p.read_text());row['argv']=['true'];self.write(p,row);self.seal(d) + with self.assertRaisesRegex(ValueError,'command'): self.compare() + + def test_missing_test_file_directive_is_rejected_on_both_providers(self): + self.fixture('check-generated-mocks-op-node') + for d in self.directories.values(): + p=d/'selection.json';row=json.loads(p.read_text());row['packages'][0]['directives']=row['packages'][0]['directives'][:1];self.write(p,row);self.seal(d) + with self.assertRaisesRegex(ValueError,'directives'): self.compare() + + def test_original_generation_source_corruption_cannot_be_resealed_as_success(self): + self.fixture('check-generated-mocks-op-node') + d=self.directories['rwx'];(d/'source/op-node/input.go').write_text('changed input');self.seal(d) + with self.assertRaisesRegex(ValueError,'source bytes'): self.compare() + + def test_duplicate_or_failed_original_package_discovery_is_rejected(self): + self.fixture('check-generated-mocks-op-node') + d=self.directories['rwx'];p=d/'packages.json';p.write_text(p.read_text() + '\n' + p.read_text());self.seal(d) + with self.assertRaisesRegex(ValueError,'duplicate'): self.compare() + + def test_missing_input_or_changed_generated_mock_is_rejected(self): + self.fixture('check-generated-mocks-op-service') + d=self.directories['rwx'];self.write(d/'generated.json',{});self.seal(d) + with self.assertRaisesRegex(ValueError,'mocks changed'): self.compare() + + def test_corrupt_or_missing_nonempty_originals_are_rejected(self): + self.fixture('check-op-geth-version') + (self.directories['rwx']/'go-mod.json').write_text('{}') + with self.assertRaisesRegex(ValueError,'corrupt'): self.compare() + + def test_only_manifest_declared_empty_circle_logs_can_be_restored(self): + self.fixture('op-deployer-forge-version') + (self.directories['circle']/'check.log').unlink() + self.assertEqual(len(self.compare()['manifest_declared_empty_logs']),1) + (self.directories['rwx']/'check.log').unlink() + with self.assertRaises(OSError): self.compare() + + def test_stale_sha_reused_native_verdict_and_different_tool_are_rejected(self): + self.fixture('check-op-geth-version') + d=self.directories['rwx'];p=d/'settings.json';original=json.loads(p.read_text()) + for key,value in [('source_sha','b'*40),('rwx_run_id',None),('rwx_task_attempt','2'),('tools',{'go':'different'})]: + row={**original,key:value};self.write(p,row);self.seal(d) + with self.subTest(key=key), self.assertRaises(ValueError): self.compare() + + def test_matching_omitted_nut_bundle_is_rejected(self): + self.fixture('check-nut-locks') + for d in self.directories.values(): + p=d/'selection.json';row=json.loads(p.read_text());row['bundles']={};self.write(p,row);self.seal(d) + with self.assertRaisesRegex(ValueError,'NUT selection'): self.compare() + + def test_matching_omitted_l2_chain_is_rejected(self): + self.fixture('l2-chains-sync-check') + for d in self.directories.values(): + p=d/'selection.json';row=json.loads(p.read_text());row['matrix_chains']=[];self.write(p,row);self.seal(d) + with self.assertRaisesRegex(ValueError,'L2 chain'): self.compare() + + def test_forge_pin_and_protected_develop_drift_require_investigation(self): + self.fixture('op-deployer-forge-version') + d=self.directories['rwx'];p=d/'selection.json';row=json.loads(p.read_text());row['mise_forge']='changed';self.write(p,row);self.seal(d) + with self.assertRaisesRegex(ValueError,'Forge version'): self.compare() + self.root = Path(self.tmp.name) / 'nuts';self.root.mkdir();self.fixture('check-nut-locks') + d=self.directories['rwx'];p=d/'selection.json';row=json.loads(p.read_text());row['develop_sha']='d'*40;self.write(p,row);self.seal(d) + with self.assertRaisesRegex(ValueError,'parity'): self.compare() + + def test_failed_or_cancelled_original_is_not_replaced_by_passing_wrapper(self): + self.fixture('check-op-geth-version') + d=self.directories['rwx'];p=d/'check.stage.json';row=json.loads(p.read_text());row['exit_code']=-15;self.write(p,row);self.seal(d) + with self.assertRaisesRegex(ValueError,'failed original'): self.compare() + p=d/'final.json';row=json.loads(p.read_text());row['exit_code']=143;self.write(p,row) + with self.assertRaisesRegex(ValueError,'Failed'): self.compare() + + def test_missing_stages_unexplained_retry_and_wrong_nested_cwd_are_rejected(self): + self.fixture('op-deployer-forge-version') + d=self.directories['rwx'];p=d/'check.stage.json';row=json.loads(p.read_text());row['cwd']='/rwx';self.write(p,row);self.seal(d) + with self.assertRaisesRegex(ValueError,'command'): self.compare() + row['cwd']='/rwx/op-deployer';self.write(p,row) + self.write(d/'retry.stage.json',row);self.seal(d) + with self.assertRaisesRegex(ValueError,'retry'): self.compare() + + def test_corrupt_original_superchain_cannot_be_resealed_as_passing(self): + self.fixture('check-generated-mocks-op-node') + d=self.directories['rwx'];(d/'dependencies/superchain-configs.zip').write_bytes(b'corrupt bundle');self.seal(d) + with self.assertRaisesRegex(ValueError,'pinned superchain'):self.compare() + + def test_stale_producer_binding_and_nonzero_warm_tests_are_rejected(self): + self.fixture('check-generated-mocks-op-node') + d=self.directories['rwx'];p=d/'producer/bundle.json';row=json.loads(p.read_text());row['source_sha']='b'*40;self.write(p,row) + manifest=json.loads((d/'producer/manifest.json').read_text());manifest['original_sha256']['bundle.json']=COMPARE.MAIN.STAGES.digest(p) + self.write(d/'producer/manifest.json',manifest);self.seal(d) + with self.assertRaisesRegex(ValueError,'reusable superchain binding'):self.compare() + row['source_sha']=SHA;self.write(p,row);manifest['original_sha256']['bundle.json']=COMPARE.MAIN.STAGES.digest(p) + p=d/'producer/coverage.json';self.write(p,{'tests':1,'verified_bundle':True});manifest['original_sha256']['coverage.json']=COMPARE.MAIN.STAGES.digest(p) + self.write(d/'producer/manifest.json',manifest);self.seal(d) + with self.assertRaisesRegex(ValueError,'reusable superchain binding'):self.compare() + + +if __name__ == '__main__': unittest.main() diff --git a/ops/ci/migration/tests/test_compare_pr_checks.py b/ops/ci/migration/tests/test_compare_pr_checks.py new file mode 100644 index 00000000000..adb4fef8cbb --- /dev/null +++ b/ops/ci/migration/tests/test_compare_pr_checks.py @@ -0,0 +1,144 @@ +#!/usr/bin/env python3 +"""Fail closed for stale, damaged, incomplete and mismatched original checks.""" +import hashlib +import importlib.util +import json +from pathlib import Path +import tempfile +import unittest +import xml.etree.ElementTree as ET + +SPEC = importlib.util.spec_from_file_location('compare_checks', Path(__file__).resolve().parents[2] / 'migration' / 'compare-pr-checks.py') +COMPARE = importlib.util.module_from_spec(SPEC); SPEC.loader.exec_module(COMPARE) +SHA = 'a' * 40 + + +class OriginalCheckTests(unittest.TestCase): + def setUp(self): + self.tmp = tempfile.TemporaryDirectory(); self.addCleanup(self.tmp.cleanup) + self.root = Path(self.tmp.name); self.directories = {} + for provider in ('circle', 'rwx'): + directory = self.root / provider; directory.mkdir(); self.directories[provider] = directory + workspace = '/' + provider + self.write(directory / 'settings.json', {'source_sha': SHA, 'job': 'go-modules', + 'provider': 'circleci' if provider == 'circle' else 'rwx', 'workspace_root': workspace, + 'branch': 'pilot', 'go': 'go1.26.6', 'just': 'pinned', 'input_sha256': {'go.mod': 'original'}}) + (directory / 'discovery.json').write_text('{"Path":"main","Main":true}\n{"Path":"dependency","Version":"v1.0.0","Sum":"h1:original"}\n') + self.write(directory / 'coverage.json', {'modules': COMPARE.CHECKS.modules((directory / 'discovery.json').read_text()), + 'selected': 2, 'verified': True, 'download_attempts': 1}) + commands = {'download-0': ['go', 'mod', 'download'], 'verify': ['go', 'mod', 'verify'], + 'discovery': ['go', 'list', '-m', '-json', 'all']} + for name, argv in commands.items(): + self.write(directory / (name + '.stage.json'), {'argv': argv, 'cwd': workspace, 'exit_code': 0}) + (directory / (name + '.log')).write_text('') + suite = ET.Element('testsuite'); ET.SubElement(suite, 'testcase', name='go-modules', classname='go-modules') + ET.ElementTree(suite).write(directory / 'checks.junit.xml') + self.seal(directory) + + def write(self, path, value): path.write_text(json.dumps(value)) + + def seal(self, directory): + self.write(directory / 'final.json', {'exit_code': 0, 'report_errors': [], 'original_sha256': { + p.name: hashlib.sha256(p.read_bytes()).hexdigest() for p in directory.iterdir() if p.name != 'final.json'}}) + + def compare(self): return COMPARE.compare(self.directories, 'go-modules', SHA) + + def fast(self): + configuration = {'phases': [{'name': 'original', 'checks': [ + {'name': 'first', 'command': 'original first'}, {'name': 'second', 'command': 'original second'}]}]} + for provider, d in self.directories.items(): + settings = json.loads((d / 'settings.json').read_text()) + for p in d.iterdir(): p.unlink() + settings.update(job='contracts-fast', forge='pinned Forge', semgrep='1.137.0', + rwx_run_id='c' * 32 if provider == 'rwx' else None, rwx_task_attempt='1', + target_branch='develop', target_sha='d' * 40, merge_base_sha='e' * 40) + self.write(d / 'settings.json', settings); self.write(d / 'selection.json', configuration) + (d / 'checks.log').write_text('✓ first 1.0s\n✓ second 2.0s\n✓ All checks passed (2/2)\n') + self.write(d / 'coverage.json', COMPARE.CHECKS.check_verdicts((d / 'checks.log').read_text(), configuration)) + (d / 'submodules.txt').write_text(' ' + 'd' * 40 + ' contract-library (original-description)\n') + self.write(d / 'foundry-config.json', {'optimizer': True, 'root': settings['workspace_root']}) + for name, argv in [('checks', ['just', 'check-fast', '-verbose']), ('foundry-config', ['forge', 'config', '--json']), + ('fetch-target', ['git', 'fetch', '--no-tags', 'origin', '+refs/heads/develop:refs/remotes/origin/develop'])]: + self.write(d / (name + '.stage.json'), {'argv': argv, 'cwd': settings['workspace_root'] + ('/packages/contracts-bedrock' if name != 'fetch-target' else ''), 'exit_code': 0}) + suite = ET.Element('testsuite') + for name in ('first', 'second'): ET.SubElement(suite, 'testcase', name=name, classname='contracts-fast') + ET.ElementTree(suite).write(d / 'checks.junit.xml'); self.seal(d) + + def compare_fast(self): return COMPARE.compare(self.directories, 'contracts-fast', SHA) + + def test_complete_modules_and_original_commands_match(self): + self.assertTrue(self.compare()['verified_parity']) + + def test_only_manifest_declared_empty_circle_logs_can_be_restored(self): + (self.directories['circle'] / 'verify.log').unlink() + self.assertEqual(len(self.compare()['manifest_declared_empty_logs']), 1) + (self.directories['rwx'] / 'verify.log').unlink() + with self.assertRaises(OSError): self.compare() + + def test_corrupt_or_missing_nonempty_originals_fail_validation(self): + (self.directories['rwx'] / 'discovery.json').write_text('{}') + with self.assertRaisesRegex(ValueError, 'corrupt'): self.compare() + + def test_stale_sha_does_not_become_matching_success(self): + p = self.directories['rwx'] / 'settings.json'; value = json.loads(p.read_text()); value['source_sha'] = 'b' * 40 + self.write(p, value); self.seal(p.parent) + with self.assertRaisesRegex(ValueError, 'source'): self.compare() + + def test_different_module_version_remains_a_parity_error(self): + d = self.directories['rwx']; p = d / 'discovery.json'; p.write_text(p.read_text().replace('v1.0.0', 'v1.0.1')) + coverage = json.loads((d / 'coverage.json').read_text()); coverage['modules'] = COMPARE.CHECKS.modules(p.read_text()) + self.write(d / 'coverage.json', coverage); self.seal(d) + with self.assertRaisesRegex(ValueError, 'graph'): self.compare() + + def test_same_wrong_command_on_both_providers_is_rejected(self): + for d in self.directories.values(): + p = d / 'verify.stage.json'; row = json.loads(p.read_text()); row['argv'] = ['true']; self.write(p, row); self.seal(d) + with self.assertRaisesRegex(ValueError, 'command'): self.compare() + + def test_failed_original_cannot_be_hidden_by_passing_junit(self): + d = self.directories['rwx']; p = d / 'final.json'; row = json.loads(p.read_text()); row['exit_code'] = 17; self.write(p, row) + with self.assertRaisesRegex(ValueError, 'Failed'): self.compare() + + def test_missing_verification_or_extra_stage_is_rejected(self): + d = self.directories['rwx']; (d / 'verify.stage.json').unlink(); self.seal(d) + with self.assertRaisesRegex(ValueError, 'Incomplete'): self.compare() + + def test_complete_check_phases_commands_and_native_identity_match(self): + self.fast(); self.assertTrue(self.compare_fast()['verified_parity']) + + def test_check_source_configuration_changes_are_not_path_normalization(self): + self.fast(); d = self.directories['rwx']; self.write(d / 'foundry-config.json', {'optimizer': False, 'root': '/rwx'}); self.seal(d) + with self.assertRaisesRegex(ValueError, 'Foundry'): self.compare_fast() + + def test_check_retry_history_difference_requires_investigation(self): + self.fast(); d = self.directories['rwx']; p = d / 'checks.log' + p.write_text('↻ first 1.0s (will retry with clean build)\n✓ first (retry) 0.3s\n✓ second 2.0s\n✓ All checks passed (2/2)\n') + self.write(d / 'coverage.json', COMPARE.CHECKS.check_verdicts(p.read_text(), json.loads((d / 'selection.json').read_text()))) + self.seal(d) + with self.assertRaisesRegex(ValueError, 'retry'): self.compare_fast() + + def test_descriptive_git_refs_may_differ_only_with_identical_complete_pointers(self): + self.fast(); d = self.directories['rwx']; p = d / 'submodules.txt' + p.write_text(p.read_text().replace('original-description', 'other-tag-description')); self.seal(d) + result = self.compare_fast(); self.assertTrue(result['verified_parity']) + self.assertEqual(result['submodule_revisions'], [{'path': 'contract-library', 'sha': 'd' * 40}]) + for text in ['+' + 'd' * 40 + ' contract-library\n', ' ' + 'e' * 40 + ' contract-library\n', + ' ' + 'd' * 40 + ' different-path\n', ' ' + 'd' * 40 + ' contract-library\n ' + 'd' * 40 + ' contract-library\n']: + p.write_text(text); self.seal(d) + with self.subTest(original=text), self.assertRaises(ValueError): self.compare_fast() + + def test_target_revision_drift_remains_a_parity_error(self): + self.fast(); d = self.directories['rwx']; p = d / 'settings.json' + row = json.loads(p.read_text()); row['target_sha'] = 'f' * 40; self.write(p, row); self.seal(d) + with self.assertRaisesRegex(ValueError, 'target_sha'): self.compare_fast() + + def test_reused_native_verdict_or_different_submodule_is_rejected(self): + self.fast(); d = self.directories['rwx']; p = d / 'settings.json'; settings = json.loads(p.read_text()); settings['rwx_run_id'] = None + self.write(p, settings); self.seal(d) + with self.assertRaisesRegex(ValueError, 'fresh'): self.compare_fast() + settings['rwx_run_id'] = 'c' * 32; self.write(p, settings) + (d / 'submodules.txt').write_text(' stale-revision contract-library\n'); self.seal(d) + with self.assertRaisesRegex(ValueError, 'submodule'): self.compare_fast() + + +if __name__ == '__main__': unittest.main() diff --git a/ops/ci/migration/tests/test_compare_rust_cannon.py b/ops/ci/migration/tests/test_compare_rust_cannon.py new file mode 100644 index 00000000000..0297235ba37 --- /dev/null +++ b/ops/ci/migration/tests/test_compare_rust_cannon.py @@ -0,0 +1,144 @@ +"""Reject incomplete or mismatched Cannon provider evidence.""" +import gzip +import importlib.util +import json +from pathlib import Path +import tempfile +import unittest + +SPEC = importlib.util.spec_from_file_location('compare_cannon', Path(__file__).resolve().parents[2] / 'migration' / 'compare-rust-cannon.py') +COMPARE = importlib.util.module_from_spec(SPEC); SPEC.loader.exec_module(COMPARE) +SHA = 'a' * 40 +ELF = b'\x7fELF\x02\x02\x01' + b'\0' * 11 + b'\0\x08' + b'compiled fixture' + + +class ComparisonTests(unittest.TestCase): + def setUp(self): + temp = tempfile.TemporaryDirectory(); self.addCleanup(temp.cleanup) + self.root = Path(temp.name) + witness = {'filename': 'fixture.tar.zst', 'sha256': 'b' * 64, 'l2_claim': '0x' + 'c' * 64} + bound = dict.fromkeys(COMPARE.BINDING, 'pinned') | {'source_sha': SHA, 'witness': witness} + variants = [{'binary': 'kona-client', 'prestate_directory': 'prestate-artifacts-cannon'}] + for provider in ('circle', 'rwx'): + for job in COMPARE.JOBS: + d = self.root / provider / ('cannon-' + job); d.mkdir(parents=True) + workdir = '/' + provider + settings = bound | {'job': job, 'suite': 'rust-cannon', 'provider': 'circleci' if provider == 'circle' else 'rwx', + 'workspace_root': workdir, 'variants': variants, 'rustc': 'pinned', 'cargo': 'pinned', + 'rwx_run_id': 'd' * 32, 'rwx_task_attempt': '1'} + self.write(d / 'settings.json', settings) + if provider == 'rwx' and job != 'offline': self.write(d / 'verified-env.json', {'producer_source_sha': SHA, 'manifest_sha256': '1' * 64}) + (d / 'checks.junit.xml').write_text('') + stages = {} + for name in ('variants', job) + (('guest',) if job == 'offline' else ()): + argv = [workdir + '/cannon/bin/cannon', 'witness'] if name == 'guest' else ['just', name] + stages[name] = {'argv': argv, 'cwd': 'rust', 'exit_code': 0} + self.write(d / (name + '.stage.json'), stages[name]) + (d / (name + '.log')).write_text('kona-client prestate-artifacts-cannon\n' if name == 'variants' else 'original') + self.write(d / 'image.json', {'binding': bound, 'image_id': provider, 'base': 'pinned', 'base_digests': ['digest'], 'tools': 'pinned'}) + for folder in ('image-elfs',) + (('elfs',) if job != 'lint' else ()): + (d / folder).mkdir(); (d / folder / 'kona-client').write_bytes(ELF) + self.write(d / (folder + '.json'), {'binding': bound, 'variants': variants, + 'files': {'kona-client': {'sha256': COMPARE.digest(d / folder / 'kona-client'), 'size': len(ELF)}}}) + if job == 'offline': + state = {'exited': True, 'exitCode': 0, 'step': 100, 'stateVersion': 8, + 'witnessHash': '0x' + 'f' * 64, 'witness': '0x0011'} + self.write(d / 'guest.json', state) + (d / 'offline.log').write_text('Successfully validated L2 block ' + witness['l2_claim']) + (d / 'out.bin.gz').write_bytes(gzip.compress(b'complete final state')) + self.write(d / 'guest-coverage.json', {'boundary': witness, 'final': state, 'fresh_execution': True, + 'final_state_sha256': COMPARE.digest(d / 'out.bin.gz')}) + self.write(d / 'go-binaries.json', {'binding': bound, 'go': 'pinned', + 'files': {name: {'sha256': 'e' * 64} for name in COMPARE.GO_FILES}}) + self.write(d / 'witness.json', {'binding': bound, 'filename': witness['filename'], 'sha256': witness['sha256'], 'size': 123}) + if provider == 'rwx': + for kind in ('go', 'witness', 'build'): + verified = {'producer_source_sha': SHA, 'manifest_sha256': '1' * 64} + if kind == 'build': verified['image_manifest_sha256'] = COMPARE.digest(self.root / provider / 'cannon-build/image.json') + self.write(d / ('verified-' + kind + '.json'), verified) + self.write(d / 'final.json', {'exit_code': 0, 'report_errors': [], 'stages': stages}) + self.rehash(d) + + def write(self, path, data): path.write_text(json.dumps(data) + '\n') + + def rehash(self, directory): + final = COMPARE.read(directory / 'final.json') + final['original_sha256'] = {str(p.relative_to(directory)): COMPARE.digest(p) + for p in directory.rglob('*') if p.is_file() and p.name != 'final.json'} + self.write(directory / 'final.json', final) + + def directory(self, provider='rwx', job='offline'): return self.root / provider / ('cannon-' + job) + + def update(self, filename, change, provider='rwx', job='offline'): + d = self.directory(provider, job); data = COMPARE.read(d / filename); change(data) + self.write(d / filename, data) + if filename != 'final.json': self.rehash(d) + + def test_complete_reports_with_distinct_host_paths_and_image_ids(self): + result = COMPARE.compare(self.root, SHA) + self.assertTrue(result['verified_parity']) + self.assertTrue(result['jobs']['offline']['guest']['complete_state_byte_identical']) + + def test_corrupt_missing_or_unmanifested_original_rejected(self): + d = self.directory(); (d / 'offline.log').write_text('corrupt') + with self.assertRaisesRegex(ValueError, 'Corrupt original'): COMPARE.compare(self.root, SHA) + (d / 'offline.log').unlink() + with self.assertRaisesRegex(ValueError, 'Missing nonempty'): COMPARE.compare(self.root, SHA) + self.update('final.json', lambda f: f['original_sha256'].pop('offline.log')) + with self.assertRaisesRegex(ValueError, 'Incomplete original'): COMPARE.compare(self.root, SHA) + + def test_only_manifest_declared_empty_circle_guest_stream_may_be_absent(self): + d = self.directory('circle'); (d / 'guest.log').write_text(''); self.rehash(d); (d / 'guest.log').unlink() + self.assertEqual(COMPARE.compare(self.root, SHA)['manifest_declared_empty_logs'][0]['name'], 'guest.log') + (d / 'guest.json').unlink() + with self.assertRaisesRegex(ValueError, 'Missing nonempty'): COMPARE.compare(self.root, SHA) + + def test_failed_guest_report_and_unresolved_retries_rejected(self): + self.update('settings.json', lambda s: s.update(rwx_task_attempt='2')) + with self.assertRaisesRegex(ValueError, 'retries require investigation'): COMPARE.compare(self.root, SHA) + self.update('settings.json', lambda s: s.update(rwx_task_attempt='1')) + self.update('final.json', lambda f: f.update(report_errors=['failed guest'])) + with self.assertRaisesRegex(ValueError, 'Failed or incomplete'): COMPARE.compare(self.root, SHA) + + def test_mismatched_source_settings_or_variant_selection_rejected(self): + self.update('settings.json', lambda s: s.update(source_sha='9' * 40)) + with self.assertRaisesRegex(ValueError, 'source or workload'): COMPARE.compare(self.root, SHA) + self.update('settings.json', lambda s: s.update(source_sha=SHA, variants=[])) + with self.assertRaisesRegex(ValueError, 'settings differ'): COMPARE.compare(self.root, SHA) + + def test_original_command_and_summary_drift_rejected(self): + self.update('guest.stage.json', lambda s: s.update(argv=['wrong', 'guest'])) + with self.assertRaisesRegex(ValueError, 'summary differs'): COMPARE.compare(self.root, SHA) + self.update('final.json', lambda f: f['stages']['guest'].update(argv=['wrong', 'guest'])) + with self.assertRaisesRegex(ValueError, 'command, working directory'): COMPARE.compare(self.root, SHA) + + def test_altered_elf_binding_or_binary_inventory_rejected(self): + self.update('elfs.json', lambda m: m['files']['kona-client'].update(sha256='9' * 64)) + with self.assertRaisesRegex(ValueError, 'ELF inventories'): COMPARE.compare(self.root, SHA) + + def test_stale_inherited_producer_and_missing_go_implementation_rejected(self): + self.update('verified-go.json', lambda m: m.update(producer_source_sha='9' * 40)) + with self.assertRaisesRegex(ValueError, 'producer provenance'): COMPARE.compare(self.root, SHA) + self.update('verified-go.json', lambda m: m.update(producer_source_sha=SHA)) + self.update('go-binaries.json', lambda m: m['files'].pop('cannon/bin/cannon64-impl')) + with self.assertRaisesRegex(ValueError, 'Go build provenance'): COMPARE.compare(self.root, SHA) + + def test_offline_image_is_bound_to_the_counted_build_producer(self): + self.update('verified-build.json', lambda m: m.update(image_manifest_sha256='9' * 64)) + with self.assertRaisesRegex(ValueError, 'image handoff'): + COMPARE.compare(self.root, SHA) + self.update('verified-build.json', lambda m: m.pop('image_manifest_sha256')) + with self.assertRaisesRegex(ValueError, 'image handoff'): + COMPARE.compare(self.root, SHA) + + def test_guest_state_drift_even_with_equal_coverage_summaries_rejected(self): + self.update('guest.json', lambda s: s.update(exitCode=1)) + with self.assertRaisesRegex(ValueError, 'unsuccessful original'): COMPARE.compare(self.root, SHA) + + def test_full_state_drift_despite_identical_witness_summary_rejected(self): + d = self.directory(); (d / 'out.bin.gz').write_bytes(gzip.compress(b'different full state')) + self.update('guest-coverage.json', lambda g: g.update(final_state_sha256=COMPARE.digest(d / 'out.bin.gz'))) + with self.assertRaisesRegex(ValueError, 'Complete uncompressed'): COMPARE.compare(self.root, SHA) + + +if __name__ == '__main__': unittest.main() diff --git a/ops/ci/migration/tests/test_compare_rust_e2e.py b/ops/ci/migration/tests/test_compare_rust_e2e.py new file mode 100644 index 00000000000..ab80037b1b9 --- /dev/null +++ b/ops/ci/migration/tests/test_compare_rust_e2e.py @@ -0,0 +1,111 @@ +#!/usr/bin/env python3 +"""Reject missing originals, divergent skips, duplicate cases and incomplete invocations.""" +import importlib.util +import json +from pathlib import Path +import tempfile +import unittest + +SPEC = importlib.util.spec_from_file_location('compare_e2e', Path(__file__).resolve().parents[2] / 'migration' / 'compare-rust-e2e.py') +COMPARE = importlib.util.module_from_spec(SPEC); SPEC.loader.exec_module(COMPARE) +E2E = COMPARE.E2E + + +class CompareTests(unittest.TestCase): + def setUp(self): + self.tmp = tempfile.TemporaryDirectory(); self.addCleanup(self.tmp.cleanup) + self.root = Path(self.tmp.name); self.sha = 'a' * 40 + self.directory = self.root / 'simple-kona-0'; self.directory.mkdir() + self.names = ['TestPass', 'TestSkip']; self.package = E2E.PREFIX + E2E.JOBS['simple-kona']['package'] + record = {'source_sha': self.sha, 'settings': E2E.settings('simple-kona'), 'provider': 'rwx', + 'workspace_root': '/workspace', 'assigned_tests': self.names, 'rwx_run_id': 'native', 'rwx_task_attempt': '1', 'parallel_flag': None, + 'binaries_sha256': {'suite.test': 'b' * 64, 'test2json': 'c' * 64}} + E2E.write(self.directory / 'selection.json', record) + E2E.write(self.directory / 'coverage.json', {'assigned': self.names, 'missing': [], 'extra': [], 'duplicates': []}) + (self.directory / 'assigned.txt').write_text('\n'.join(self.names) + '\n') + (self.directory / 'environment.nul').write_bytes(b'key\0value\0') + events = [{'Package': self.package, 'Action': 'start'}] + for name, action in [('TestPass', 'pass'), ('TestSkip', 'skip')]: + events.extend([{'Package': self.package, 'Action': 'run', 'Test': name}, + {'Package': self.package, 'Action': 'output', 'Test': name, 'Output': 'fixture_test.go:7: original reason\n'}, + {'Package': self.package, 'Action': action, 'Test': name, 'Elapsed': 0}]) + events.append({'Package': self.package, 'Action': 'pass', 'Elapsed': 0}) + (self.directory / 'original.json').write_text('\n'.join(json.dumps(e) for e in events) + '\n') + E2E.PROJECT.project(self.directory / 'original.json', self.directory / 'native.json') + (self.directory / 'junit').mkdir() + (self.directory / 'junit/package.xml').write_text(f'') + (self.directory / 'invocations').mkdir() + argv = E2E.GO.binary_command('/compiled/test2json', '/compiled/suite.test', self.package, None, '40m', '^(TestPass|TestSkip)$') + E2E.write(self.directory / 'invocations/package.json', {'source_sha': self.sha, 'assigned_tests': self.names, + 'argv': argv, 'cwd': '/workspace/' + E2E.JOBS['simple-kona']['package'], 'exit_code': 0, + 'binary_sha256': 'b' * 64, 'reporter_sha256': 'c' * 64}) + self.seal() + + def seal(self): + E2E.write(self.directory / 'final.json', {'exit_code': 0, 'report_errors': [], + 'original_sha256': {str(p.relative_to(self.directory)): E2E.GO.digest(p) for p in self.directory.rglob('*') + if p.is_file() and p.name != 'final.json'}}) + + def validate(self): return COMPARE.test_report(self.directory, 'simple-kona', self.sha, 'rwx', [], {}) + + def test_complete_original_verdicts_skips_and_invocation(self): + record, cases, history = self.validate() + self.assertEqual(cases[(self.package, 'TestSkip')]['skip_reason'], 'original reason') + self.assertEqual(record['assigned_tests'], self.names) + self.assertEqual(history[0]['outcomes'], ['pass']) + + def test_corrupt_original_or_missing_junit_rejected(self): + (self.directory / 'original.json').write_text('corrupt') + with self.assertRaises((ValueError, OSError)): self.validate() + + def test_junit_different_outcome_cannot_pass(self): + p = self.directory / 'junit/package.xml'; p.write_text(p.read_text().replace('', '')) + self.seal() + with self.assertRaisesRegex(ValueError, 'JUnit'): self.validate() + + def test_missing_or_failed_invocation_cannot_pass(self): + path = self.directory / 'invocations/package.json'; original = E2E.read(path) + for data in (original | {'exit_code': 1}, original | {'assigned_tests': ['TestPass']}): + E2E.write(path, data); self.seal() + with self.assertRaises(ValueError): self.validate() + path.unlink(); self.seal() + with self.assertRaisesRegex(ValueError, 'invocation'): self.validate() + + def test_stale_source_and_task_retries_need_investigation(self): + path = self.directory / 'selection.json'; original = E2E.read(path) + for data in (original | {'source_sha': 'stale'}, original | {'rwx_task_attempt': '2'}): + E2E.write(path, data); self.seal() + with self.assertRaises(ValueError): self.validate() + + def test_original_package_failure_is_not_hidden_by_passing_cases(self): + p = self.directory / 'original.json'; rows = [json.loads(line) for line in p.read_text().splitlines()] + rows[-1]['Action'] = 'fail'; p.write_text('\n'.join(json.dumps(e) for e in rows) + '\n'); self.seal() + with self.assertRaisesRegex(ValueError, 'package/case failure'): self.validate() + + def test_circle_empty_logs_are_explicit_not_missing_verdicts(self): + path = self.directory / 'empty.log'; path.write_bytes(b''); self.seal(); path.unlink() + empty = [] + COMPARE.originals(self.directory, {'empty.log'}, empty, 'circle/report') + self.assertEqual(empty, [{'report': 'circle/report', 'path': 'empty.log', 'sha256': COMPARE.EMPTY}]) + (self.directory / 'original.json').unlink() + with self.assertRaises(OSError): COMPARE.originals(self.directory, {'original.json'}, [], 'circle/report') + + def test_observed_finalized_skip_preserves_both_reasons_and_only_resolves_logger_time(self): + source = 'func TestL2FinalizedSync(gt *testing.T) {\n t := devtest.ParallelT(gt)\n t.Skip("Skipping finalized sync test")\n}' + circle = 'INFO [10-04|19:54:11.285] Running test in parallel scope=/TestL2FinalizedSync INFO [10-04|19:55:06.892] Skipping finalized sync test scope=/TestL2FinalizedSync' + rwx = circle.replace('19:54:11.285', '19:45:45.854').replace('19:55:06.892', '19:47:03.335') + key = (self.package, 'TestL2FinalizedSync') + result = COMPARE.skip_comparison('simple-kona', key, circle, rwx, source) + self.assertEqual(result['original_reasons'], {'circle': circle, 'rwx': rwx}) + self.assertEqual(result['comparison'], 'logger timestamps only') + for invalid in (rwx.replace('INFO', 'WARN'), rwx.replace('Skipping finalized sync test', 'Different skip'), + rwx.replace('scope=/TestL2FinalizedSync', 'scope=/OtherTest'), rwx.replace('10-04', '99-99')): + with self.subTest(invalid=invalid), self.assertRaises(ValueError): + COMPARE.skip_comparison('simple-kona', key, circle, invalid, source) + with self.assertRaisesRegex(ValueError, 'source'): + COMPARE.skip_comparison('simple-kona', key, circle, rwx, source.replace('t.Skip(', 'if changed { t.Skip(')) + with self.assertRaises(ValueError): COMPARE.skip_comparison('proof', key, circle, rwx, source) + with self.assertRaises(ValueError): COMPARE.skip_comparison('simple-kona', (self.package, 'OtherTest'), circle, rwx, source) + + +if __name__ == '__main__': unittest.main() diff --git a/ops/ci/migration/tests/test_compare_rust_extra.py b/ops/ci/migration/tests/test_compare_rust_extra.py new file mode 100644 index 00000000000..085895c2cf8 --- /dev/null +++ b/ops/ci/migration/tests/test_compare_rust_extra.py @@ -0,0 +1,174 @@ +#!/usr/bin/env python3 +"""Reject damaged, stale, incomplete or mismatched provider evidence.""" +import importlib.util +import json +from pathlib import Path +import tempfile +import unittest + +SPEC = importlib.util.spec_from_file_location('compare_rust_extra', Path(__file__).resolve().parents[2] / 'migration' / 'compare-rust-extra.py') +COMPARE = importlib.util.module_from_spec(SPEC) +SPEC.loader.exec_module(COMPARE) +SHA = 'a' * 40 + + +class ComparisonTests(unittest.TestCase): + def setUp(self): + self.temp = tempfile.TemporaryDirectory() + self.addCleanup(self.temp.cleanup) + self.root = Path(self.temp.name) + for provider in ('circle', 'rwx'): + for job in COMPARE.JOBS: + d = self.root / provider / job + d.mkdir(parents=True) + settings = {'job': job, 'source_sha': SHA, 'suite': 'rust-workspace', + 'rwx_run_id': 'b' * 32, 'rwx_task_attempt': '1', 'input_sha256': {'Cargo.lock': 'c' * 64}} + self.write(d / 'settings.json', settings) + self.write(d / 'workspace.json', {'workspace_members': ['crate'], 'packages': [ + {'id': 'crate', 'name': 'crate', 'version': '1', 'features': {}, 'targets': []}]}) + (d / 'checks.junit.xml').write_text('\n') + stages = {} + for name in ('workspace',) + COMPARE.STAGES[job]: + stages[name] = {'argv': ['real', name], 'cwd': 'rust', 'exit_code': 0} + self.write(d / (name + '.stage.json'), stages[name]) + (d / (name + '.log')).write_text('original\n') + if job.startswith('wasm-'): + if provider == 'rwx': + stages['host-linker'] = {'argv': ['sudo', 'python3', '/workspace/ops/ci/runtime/rwx-materialize-linker.py'], + 'cwd': '.', 'exit_code': 0} + self.write(d / 'host-linker.stage.json', stages['host-linker']) + self.write(d / 'host-linker.log', {'schema': 1, 'success': True, 'files': [ + {'path': '/usr/lib/' + name, 'sha256': 'e' * 64, 'bytes': 100, + 'original_inode': 10, 'local_inode': 11, 'detached': True, + 'read_attempts': 1, 'read_timeouts': 0, 'seconds': 0.01} + for name in ('crti.o', 'crtbeginS.o', 'libgcc.a')]}) + self.write(d / 'wasm-coverage.json', {'selected': ['crate'], 'executed': ['crate']}) + self.write(d / 'wasm-artifacts.json', {'source_sha': SHA, 'target': job, 'rustc': 'pinned', + 'artifacts': {'libcrate.rlib': {'sha256': 'd' * 64}}}) + if job == 'registry': + self.write(d / 'registry-coverage.json', {'snapshots': ['chainList', 'configs', 'depsets']}) + for phase in ('before', 'after'): + for name in ('chainList', 'configs', 'depsets'): + self.write(d / f'registry-{phase}-{name}.json', [1]) + if job == 'interop': + self.write(d / 'interop-coverage.json', {'cases': ['false', 'true']}) + for language in ('go', 'rust'): + for suffix in ('stdout', 'stderr', 'exit'): + (d / f'interop-{language}.{suffix}').write_text('original\n') + self.write(d / 'final.json', {'exit_code': 0, 'report_errors': [], 'stages': stages, + 'original_sha256': {p.name: COMPARE.digest(p) for p in d.iterdir()}}) + + def write(self, path, data): + path.write_text(json.dumps(data) + '\n') + + def update(self, provider, job, filename, edit): + d = self.root / provider / job + data = COMPARE.read(d / filename) + edit(data) + self.write(d / filename, data) + if filename != 'final.json': + final = COMPARE.read(d / 'final.json') + final['original_sha256'][filename] = COMPARE.digest(d / filename) + self.write(d / 'final.json', final) + + def test_complete_reports_compare(self): + result = COMPARE.compare(self.root, SHA) + self.assertTrue(result['verified_parity']) + self.assertTrue(result['jobs']['wasm-unknown']['rwx_preparation']['evidence']['success']) + + def test_missing_or_corrupt_host_preparation_is_rejected(self): + path = self.root / 'rwx/wasm-unknown/host-linker.log' + original = path.read_bytes() + path.unlink() + with self.assertRaisesRegex(ValueError, 'missing original'): + COMPARE.compare(self.root, SHA) + path.write_bytes(original + b'corrupt') + with self.assertRaisesRegex(ValueError, 'corrupt original'): + COMPARE.compare(self.root, SHA) + path.write_bytes(original) + self.update('rwx', 'wasm-unknown', 'final.json', lambda f: f['stages'].pop('host-linker')) + with self.assertRaisesRegex(ValueError, 'incomplete original manifest'): + COMPARE.compare(self.root, SHA) + + def test_failed_preparation_cannot_compare_as_a_pass(self): + self.update('rwx', 'wasm-unknown', 'final.json', lambda f: f['stages']['host-linker'].update(exit_code=7)) + self.update('rwx', 'wasm-unknown', 'host-linker.stage.json', lambda s: s.update(exit_code=7)) + with self.assertRaisesRegex(ValueError, 'outcomes differ'): + COMPARE.compare(self.root, SHA) + + def test_materialization_evidence_must_prove_success_and_detachment(self): + path = self.root / 'rwx/wasm-unknown/host-linker.log' + original = json.loads(path.read_text()) + for edit in (lambda r: r.update(success=False), + lambda r: r['files'][0].update(local_inode=10), + lambda r: r['files'][0].update(read_attempts=4), + lambda r: r['files'].pop()): + self.write(path, original) + self.update('rwx', 'wasm-unknown', 'host-linker.log', edit) + with self.assertRaises(ValueError): + COMPARE.compare(self.root, SHA) + + def test_corrupt_or_missing_nonempty_original_rejected(self): + path = self.root / 'rwx/interop/interop-go.stderr' + path.write_text('corrupt\n') + with self.assertRaisesRegex(ValueError, 'corrupt original'): + COMPARE.compare(self.root, SHA) + path.unlink() + with self.assertRaisesRegex(ValueError, 'missing original'): + COMPARE.compare(self.root, SHA) + + def test_only_declared_empty_circle_streams_may_be_absent(self): + d = self.root / 'circle/typos' + path = d / 'typos.log' + path.write_text('') + self.update('circle', 'typos', 'final.json', lambda f: f['original_sha256'].update({'typos.log': COMPARE.digest(path)})) + path.unlink() + evidence = COMPARE.compare(self.root, SHA) + self.assertEqual(evidence['manifest_declared_empty_logs'][0]['name'], 'typos.log') + self.update('circle', 'typos', 'final.json', lambda f: f['original_sha256'].pop('typos.log')) + with self.assertRaisesRegex(ValueError, 'incomplete original manifest'): + COMPARE.compare(self.root, SHA) + + def test_stale_source_and_settings_drift_rejected(self): + self.update('rwx', 'registry', 'settings.json', lambda s: s.update(source_sha='e' * 40)) + with self.assertRaisesRegex(ValueError, 'source or job mismatch'): + COMPARE.compare(self.root, SHA) + self.update('rwx', 'registry', 'settings.json', lambda s: s.update(source_sha=SHA, rustc='wrong')) + with self.assertRaisesRegex(ValueError, 'settings differ'): + COMPARE.compare(self.root, SHA) + + def test_missing_fresh_identity_or_unresolved_retry_rejected(self): + self.update('rwx', 'typos', 'settings.json', lambda s: s.pop('rwx_run_id')) + with self.assertRaisesRegex(ValueError, 'fresh identity'): + COMPARE.compare(self.root, SHA) + self.update('rwx', 'typos', 'settings.json', lambda s: s.update(rwx_run_id='b' * 32, rwx_task_attempt='2')) + with self.assertRaisesRegex(ValueError, 'retries require investigation'): + COMPARE.compare(self.root, SHA) + + def test_missing_manifest_stage_cannot_be_hidden(self): + self.update('rwx', 'registry', 'final.json', lambda f: f['stages'].pop('registry-clean')) + with self.assertRaisesRegex(ValueError, 'incomplete original manifest'): + COMPARE.compare(self.root, SHA) + + def test_complete_package_manifest_and_coverage_must_agree(self): + self.update('rwx', 'zepter', 'workspace.json', lambda m: m['packages'][0].update(features={'new': []})) + with self.assertRaisesRegex(ValueError, 'workspace manifests differ'): + COMPARE.compare(self.root, SHA) + self.update('rwx', 'zepter', 'workspace.json', lambda m: m['packages'][0].update(features={})) + self.update('rwx', 'interop', 'interop-coverage.json', lambda c: c.update(cases=['false'])) + with self.assertRaisesRegex(ValueError, 'full coverage differs'): + COMPARE.compare(self.root, SHA) + + def test_failing_stage_or_changed_command_is_not_parity(self): + self.update('rwx', 'zepter', 'final.json', lambda f: f['stages']['zepter'].update(exit_code=7)) + self.update('rwx', 'zepter', 'zepter.stage.json', lambda s: s.update(exit_code=7)) + with self.assertRaisesRegex(ValueError, 'outcomes differ'): + COMPARE.compare(self.root, SHA) + self.update('rwx', 'zepter', 'final.json', lambda f: f['stages']['zepter'].update(exit_code=0, argv=['no-op'])) + self.update('rwx', 'zepter', 'zepter.stage.json', lambda s: s.update(exit_code=0, argv=['no-op'])) + with self.assertRaisesRegex(ValueError, 'original commands'): + COMPARE.compare(self.root, SHA) + + +if __name__ == '__main__': + unittest.main() diff --git a/ops/ci/migration/tests/test_compare_selector_upload.py b/ops/ci/migration/tests/test_compare_selector_upload.py new file mode 100644 index 00000000000..21cf335af47 --- /dev/null +++ b/ops/ci/migration/tests/test_compare_selector_upload.py @@ -0,0 +1,160 @@ +#!/usr/bin/env python3 +"""Exercise selector comparison boundaries using retained real tool originals.""" +import importlib.util +import json +from pathlib import Path +import shutil +import tempfile +import unittest + +SPEC = importlib.util.spec_from_file_location('compare_selectors', Path(__file__).resolve().parents[2] / 'migration' / 'compare-selector-upload.py') +C = importlib.util.module_from_spec(SPEC) +SPEC.loader.exec_module(C) +GOLD = Path(__file__).parent / 'fixtures/selector-upload' + + +class ComparisonTests(unittest.TestCase): + def setUp(self): + self.tmp = tempfile.TemporaryDirectory() + self.addCleanup(self.tmp.cleanup) + self.root = Path(self.tmp.name) + + def original(self, name='multi-profile-oracle'): + source = GOLD / name / 'project' + root = self.root / name + root.mkdir() + shutil.copy2(source / 'cache/solidity-files-cache.json', root / 'compiler-cache.json') + shutil.copytree(source / 'out/build-info', root / 'compiler-units') + shutil.copytree(source / 'out', root / 'compiler-artifacts', ignore=shutil.ignore_patterns('build-info')) + self.selection(root) + return root + + def selection(self, root): + cache = C.read(root / 'compiler-cache.json') + units = {p.stem: C.read(p) for p in (root / 'compiler-units').glob('*.json')} + artifacts = {str(p.relative_to(root / 'compiler-artifacts')): C.read(p) + for p in (root / 'compiler-artifacts').rglob('*.json')} + C.R.write(root / 'selection.json', C.U.catalog(cache, units, artifacts)) + + def test_actual_multiple_compilers_keep_every_source_abi_and_profile(self): + root = self.original() + value = C.compiler(root, '/var/mint-workspace') + self.assertEqual(len(value['units']), 2) + self.assertEqual(len(value['selection']['declarations']), 4) + self.assertEqual(len(value['selection']['selected']), 2) + self.assertEqual(value['selection']['compiled_sources'], ['src/AUnrestricted.sol', 'src/Shared.sol', 'src/ZRestricted.sol']) + + def test_original_mtimes_and_valid_profile_completion_order_are_not_outcomes(self): + root = self.original() + before = C.compiler(root, '/var/mint-workspace') + cache = C.read(root / 'compiler-cache.json') + for row in cache['files'].values(): row['lastModificationDate'] += 100000 + C.R.write(root / 'compiler-cache.json', cache) + for path in (root / 'compiler-artifacts/Shared.sol').glob('*.json'): + value = C.read(path); value['id'] = 0 + C.R.write(path, value) + self.selection(root) + self.assertEqual(before, C.compiler(root, '/var/mint-workspace')) + path = root / 'compiler-artifacts/Shared.sol/Shared.json' + value = C.read(path); value['id'] = 99; C.R.write(path, value) + with self.assertRaisesRegex(ValueError, 'Corrupt compiler ABI binding'): + C.compiler(root, '/var/mint-workspace') + + def test_complete_compiler_inputs_and_unselected_outputs_affect_comparison(self): + root = self.original('abi-oracle') + original = C.compiler(root, '/var/mint-workspace') + path = next((root / 'compiler-units').glob('*.json')) + value = C.read(path) + value['input']['sources']['src/Fixture.sol']['content'] += '\n// changed input\n' + C.R.write(path, value) + self.selection(root) + self.assertNotEqual(original, C.compiler(root, '/var/mint-workspace')) + value['output']['contracts']['src/Fixture.sol']['Empty']['abi'] = [{'type': 'fallback', 'stateMutability': 'nonpayable'}] + C.R.write(path, value) + with self.assertRaisesRegex(ValueError, 'Corrupt compiler ABI binding'): + C.compiler(root, '/var/mint-workspace') + + def test_missing_unit_or_resealed_derived_selection_is_rejected(self): + root = self.original() + path = root / 'selection.json'; value = C.read(path); value['selected'].pop() + C.R.write(path, value) + with self.assertRaisesRegex(ValueError, 'Changed original complete ABI selection'): + C.compiler(root, '/var/mint-workspace') + self.selection(root) + next((root / 'compiler-units').glob('*.json')).unlink() + with self.assertRaisesRegex(ValueError, 'Incomplete compiler ABI inventory'): + C.compiler(root, '/var/mint-workspace') + + def test_only_actual_workspace_path_prefixes_are_normalized(self): + value = {'path': '/provider/source.sol', 'root': '/provider', 'other': '/provider-extra/source.sol', + 'message': 'unchanged /provider/source.sol', 'url': 'https://example.invalid/provider', + 'nested': ['/provider/lib', {'name': 'provider'}]} + self.assertEqual(C.normalized(value, '/provider'), value | {'path': '$WORKSPACE/source.sol', + 'root': '$WORKSPACE', 'nested': ['$WORKSPACE/lib', {'name': 'provider'}]}) + + def test_circle_alias_is_bound_to_the_isolated_original_workflow(self): + source = {'workflows': {'selector-upload-replay': {'jobs': [ + {'contracts-bedrock-upload': {'selector_shadow': True}}]}}} + for alias in ('contracts-bedrock-upload', 'contracts-bedrock-upload-1'): + publisher = {'steps': [{'run': {'command': 'original isolated publisher'}}]} + compiled = {'workflows': {'selector-upload-replay': {'jobs': [{alias: {}}]}}, + 'jobs': {alias: publisher}} + self.assertEqual(C.circle_replay_job(source, compiled, alias), publisher) + with self.assertRaisesRegex(ValueError, 'actual Circle replay selection'): + C.circle_replay_job(source, compiled, 'contracts-bedrock-upload-2') + with self.assertRaisesRegex(ValueError, 'original Circle replay selection'): + C.circle_replay_job({'workflows': {'selector-upload-replay': {'jobs': [ + {'contracts-bedrock-upload': {'selector_shadow': False}}]}}}, compiled, alias) + for alias in ('production-upload', 'contracts-bedrock-upload-0', 'contracts-bedrock-upload-extra'): + compiled = {'workflows': {'selector-upload-replay': {'jobs': [{alias: {}}]}}, + 'jobs': {alias: {'steps': []}}} + with self.subTest(alias=alias), self.assertRaisesRegex(ValueError, 'actual Circle replay selection'): + C.circle_replay_job(source, compiled, alias) + + def test_real_provider_users_are_unprivileged_and_failure_evidence_is_required(self): + users = [] + for provider in ('circleci', 'rwx'): + original = GOLD / 'provider-isolation' / provider + execution = C.read(original / 'execution.json') + C.process(original, ['just', 'update-selectors'], execution['cwd']) + users.append(C.read(original / 'isolation.json')['uid']) + root = self.root / provider; shutil.copytree(original, root) + isolation = C.read(root / 'isolation.json'); isolation['uid'] = 0 + C.R.write(root / 'isolation.json', isolation) + with self.assertRaisesRegex(ValueError, 'destination isolation'): + C.process(root, ['just', 'update-selectors'], execution['cwd']) + shutil.copy2(original / 'isolation.json', root / 'isolation.json') + for key, value in [('exit_code', 1), ('timed_out', True), ('signals', [15])]: + changed = execution | {key: value}; C.R.write(root / 'execution.json', changed) + with self.subTest(provider=provider, field=key), self.assertRaisesRegex(ValueError, 'real execution'): + C.process(root, ['just', 'update-selectors'], execution['cwd']) + C.R.write(root / 'execution.json', execution) + (root / 'stdout.log').write_text('altered original') + with self.assertRaisesRegex(ValueError, 'real execution'): + C.process(root, ['just', 'update-selectors'], execution['cwd']) + self.assertEqual(users, [1001, 1000]) + + def test_original_posts_are_compared_completely_despite_array_order(self): + root = self.root / 'post' + shutil.copytree(GOLD / 'live-import/first-upload', root) + fixture = C.read(GOLD / 'live-import/fixture.json')['signatures'] + wanted = {'hash32': fixture, 'signatures': { + 'function': {key: value[:10] for key, value in fixture.items() if key != 'Pong(uint256)'}, + 'event': {'Pong(uint256)': fixture['Pong(uint256)']}}} + before = C.protocol(root, wanted) + request = root / 'http-0-request.json' + value = C.read(request) + for rows in value.values(): rows.reverse() + C.R.write(request, value) + metadata = root / 'http-0.json'; value = C.read(metadata); value['request_sha256'] = C.R.digest(request) + C.R.write(metadata, value) + self.assertEqual(before, C.protocol(root, wanted)) + value = C.read(request); value['function'].pop(); C.R.write(request, value) + metadata_value = C.read(metadata); metadata_value['request_sha256'] = C.R.digest(request) + C.R.write(metadata, metadata_value) + with self.assertRaisesRegex(ValueError, 'Omitted, repeated or rejected'): + C.protocol(root, wanted) + + +if __name__ == '__main__': + unittest.main() diff --git a/ops/ci/migration/tests/test_compare_static_checks.py b/ops/ci/migration/tests/test_compare_static_checks.py new file mode 100644 index 00000000000..c44ab2daec5 --- /dev/null +++ b/ops/ci/migration/tests/test_compare_static_checks.py @@ -0,0 +1,123 @@ +#!/usr/bin/env python3 +"""Reject stale sources, altered selections and fabricated static-check parity.""" +import importlib.util +import json +from pathlib import Path +import tempfile +import unittest +import xml.etree.ElementTree as ET + +SPEC=importlib.util.spec_from_file_location('compare_static',Path(__file__).resolve().parents[2] / 'migration' / 'compare-static-checks.py') +P=importlib.util.module_from_spec(SPEC);SPEC.loader.exec_module(P) +C=P.C;SHA='a'*40;JOB='semgrep-scan-local' + + +class CompleteOriginals(unittest.TestCase): + def setUp(self): + tmp=tempfile.TemporaryDirectory();self.addCleanup(tmp.cleanup);self.directories={} + for provider in ('circle','rwx'): + d=Path(tmp.name)/provider;d.mkdir();self.directories[provider]=d;root='/'+provider + source={'source.py':'1'*64,'.semgrep/rules/original.yaml':'2'*64,'.semgrep/tests/original.py':'3'*64,'.semgrepignore':'4'*64} + settings={'source_sha':SHA,'branch':'pilot','job':JOB,'provider':'circleci' if provider=='circle' else 'rwx', + 'command':C.COMMANDS[JOB],'workspace_root':root,'tool_version':C.VERSIONS[JOB], + 'environment':C.semgrep_environment('pilot',SHA),'input_sha256':source, + 'baseline':{'ref':'develop','commit':'b'*40,'merge_base':'b'*40,'changed_files':{'source.py':'M'}}, + 'rwx_run_id':'c'*32 if provider=='rwx' else None,'rwx_task_attempt':'1'} + self.write(d/'settings.json',settings);self.write(d/'inputs-after.json',source) + self.write(d/'selection.json',{'rules':{'.semgrep/rules/original.yaml':'2'*64}, + 'fixtures':{'.semgrep/tests/original.py':'3'*64},'ignore':{'.semgrepignore':'4'*64}}) + self.write(d/'check.json',{'version':C.VERSIONS[JOB],'results':[], + 'errors':[{'code':3,'level':'warn','type':'PartialParsing','path':'source.py','message':'original warning'}], + 'paths':{'scanned':[root+'/source.py'],'skipped':[{'path':'ignored.py','reason':'semgrepignore_patterns_match'}]}, + 'time':{'profiling_times':{provider:1}},'engine_requested':'OSS','skipped_rules':[], + 'profiling_results':{'provider':provider}}) + (d/'check.log').write_text('') + self.write(d/'check.stage.json',{'argv':C.COMMANDS[JOB],'cwd':root,'exit_code':0,'stdin':'devnull', + 'log_sha256':C.digest(d/'check.log')}) + suite=ET.Element('testsuite',name='static-checks/'+JOB,tests='1',failures='0',skipped='0') + ET.SubElement(suite,'testcase',name=JOB,classname=JOB);ET.ElementTree(suite).write(d/'derived.junit.xml') + self.account(d);self.seal(d) + + def write(self,p,data):p.write_text(json.dumps(data)) + def account(self,d): + settings=json.loads((d/'settings.json').read_text()) + coverage=C.machine_report(JOB,json.loads((d/'check.json').read_text()),settings['workspace_root']) + self.write(d/'coverage.json',coverage);self.write(d/'scanned-source-sha256.json',C.scanned_inputs(coverage,settings['input_sha256'])) + def seal(self,d): + self.write(d/'final.json',{'exit_code':0,'report_errors':[],'original_sha256':{ + p.name:C.digest(p) for p in d.iterdir() if p.name!='final.json'}}) + def edit(self,provider,name,action): + d=self.directories[provider];p=d/name;data=json.loads(p.read_text());action(data);self.write(p,data) + if name!='final.json':self.seal(d) + def compare(self):return P.compare(self.directories,JOB,SHA) + + def test_complete_original_diagnostics_exclusions_and_bound_paths_survive(self): + result=self.compare();self.assertTrue(result['verified_parity']) + self.assertEqual(result['coverage']['errors'][0]['message'],'original warning') + self.assertEqual(result['coverage']['paths']['scanned'],['/source.py']) + self.assertEqual(result['coverage']['paths']['skipped'][0]['reason'],'semgrepignore_patterns_match') + + def test_missing_original_or_corruption_is_not_a_success(self): + p=self.directories['rwx']/'check.json';p.write_text('{}') + with self.assertRaisesRegex(ValueError,'corrupt'):self.compare() + p.unlink() + with self.assertRaises(OSError):self.compare() + + def test_only_original_manifest_declared_empty_circle_log_is_restored(self): + (self.directories['circle']/'check.log').unlink();self.assertEqual(len(self.compare()['manifest_declared_empty_logs']),1) + (self.directories['rwx']/'check.log').unlink() + with self.assertRaises(OSError):self.compare() + + def test_same_stale_sha_on_both_providers_is_rejected(self): + for provider in self.directories:self.edit(provider,'settings.json',lambda row:row.update(source_sha='d'*40)) + with self.assertRaisesRegex(ValueError,'source'):self.compare() + + def test_same_noop_command_on_both_providers_is_rejected(self): + for provider in self.directories:self.edit(provider,'settings.json',lambda row:row.update(command=['true'])) + with self.assertRaisesRegex(ValueError,'command'):self.compare() + + def test_baseline_revision_drift_is_a_parity_error(self): + self.edit('rwx','settings.json',lambda row:row['baseline'].update(commit='e'*40)) + with self.assertRaisesRegex(ValueError,'baseline'):self.compare() + + def test_missing_or_invalid_original_baseline_is_rejected(self): + for value in (None,{'ref':'develop','commit':'b'*40,'merge_base':'b'*40,'changed_files':{'missing.py':'M'}}): + for provider in self.directories:self.edit(provider,'settings.json',lambda row:row.update(baseline=value)) + with self.subTest(value=value),self.assertRaisesRegex(ValueError,'baseline'):self.compare() + + def test_disabling_incremental_scan_on_both_providers_is_rejected(self): + for provider in self.directories:self.edit(provider,'settings.json',lambda row:row['environment'].pop('SEMGREP_BASELINE_REF')) + with self.assertRaisesRegex(ValueError,'environment'):self.compare() + + def test_reused_native_verdict_or_unexplained_retry_is_rejected(self): + self.edit('rwx','settings.json',lambda row:row.update(rwx_task_attempt='2')) + with self.assertRaisesRegex(ValueError,'retry'):self.compare() + + def test_changed_exclusion_or_warning_requires_investigation(self): + original=(self.directories['rwx']/'check.json').read_text() + for field in ('paths','errors'): + d=self.directories['rwx'];row=json.loads(original) + if field=='paths':row['paths']['skipped'][0]['reason']='different exclusion' + else:row['errors'][0]['message']='different warning' + self.write(d/'check.json',row);self.account(d);self.seal(d) + with self.subTest(field=field),self.assertRaisesRegex(ValueError,'coverage'):self.compare() + + def test_unbound_or_duplicate_scanned_source_cannot_be_hidden(self): + d=self.directories['rwx'];row=json.loads((d/'check.json').read_text()) + row['paths']['scanned']=['source.py','source.py'] + with self.assertRaisesRegex(ValueError,'Duplicate'):C.machine_report(JOB,row,'/rwx') + row['paths']['scanned']=['unbound.py'];self.write(d/'check.json',row);self.seal(d) + with self.assertRaisesRegex(ValueError,'unbound'):self.compare() + + def test_original_failure_cannot_be_replaced_by_passing_junit(self): + self.edit('rwx','final.json',lambda row:row.update(exit_code=2)) + with self.assertRaisesRegex(ValueError,'Failed'):self.compare() + + def test_empty_original_baseline_selection_remains_explicit_and_complete(self): + for d in self.directories.values(): + row=json.loads((d/'check.json').read_text());row['paths']['scanned']=[];self.write(d/'check.json',row) + self.account(d);self.seal(d) + self.assertEqual(self.compare()['coverage']['paths']['scanned'],[]) + + +if __name__=='__main__':unittest.main() diff --git a/ops/ci/migration/tests/test_flaky_report.py b/ops/ci/migration/tests/test_flaky_report.py new file mode 100644 index 00000000000..9aa483f8a16 --- /dev/null +++ b/ops/ci/migration/tests/test_flaky_report.py @@ -0,0 +1,212 @@ +#!/usr/bin/env python3 +"""Verify reporting and failure handling against a complete real API capture.""" +import copy +import importlib.util +import json +import os +from pathlib import Path +import shutil +import signal +import subprocess +import tempfile +import time +import unittest + +SPEC = importlib.util.spec_from_file_location('flaky', Path(__file__).resolve().parents[2] / 'migration' / 'flaky-report.py') +F = importlib.util.module_from_spec(SPEC) +SPEC.loader.exec_module(F) +GOLD = Path(__file__).parent / 'fixtures/flaky-report/public-insights.json' + + +class FlakyTests(unittest.TestCase): + def setUp(self): + self.tmp = tempfile.TemporaryDirectory(prefix='original flaky ') + self.addCleanup(self.tmp.cleanup) + self.root = Path(self.tmp.name) + self.bin = self.root / 'bin'; self.bin.mkdir() + self.capture = self.root / 'capture.json'; shutil.copyfile(GOLD, self.capture) + curl = self.bin / 'curl' + curl.write_text('''#!/usr/bin/env python3 +import json,os,sys +from pathlib import Path +args=sys.argv[1:] +if args==['--version']: + print('curl original fixture version'); sys.exit(0) +counter=Path(os.environ['RWX_FLAKY_REQUEST']+'.count') +number=int(counter.read_text()) if counter.exists() else 0 +counter.write_text(str(number+1)) +sequence=os.environ.get('RWX_FLAKY_STATUS_SEQUENCE',os.environ.get('RWX_FLAKY_STATUS','200')).split(',') +status=sequence[min(number,len(sequence)-1)] +body=Path(os.environ['RWX_FLAKY_FIXTURE']).read_bytes() if status=='200' else b'{"message":"original HTTP failure"}' +Path(args[args.index('--output')+1]).write_bytes(body) +Path(os.environ['RWX_FLAKY_REQUEST']).write_text(json.dumps({'authenticated':'-H' in args, + 'branch':args[args.index('--data-urlencode')+1], 'url':args[-1]})) +print(status) +sys.exit(22 if status != '200' else 0) +''') + curl.chmod(0o755) + self.env = os.environ | {'PATH': str(self.bin) + os.pathsep + os.environ['PATH'], + 'RWX_FLAKY_FIXTURE': str(self.capture), 'RWX_FLAKY_REQUEST': str(self.root / 'request.json')} + + def generate(self, branch='codex/rwx-ci-pilot', token=None): + report = self.root / 'report with spaces' + args = ['bash', str(F.ROOT / F.SCRIPT), '--branch', branch, '--output-dir', str(report)] + if token: args += ['--token', token] + result = subprocess.run(args, env=self.env, capture_output=True, text=True) + return result, report + + def test_complete_original_capture_and_all_real_derived_rows(self): + self.assertEqual(len(F.validate_api(GOLD)['flaky_tests']), 79) + result, report = self.generate() + self.assertEqual(result.returncode, 0, result.stderr) + self.assertEqual((report / 'flaky_tests.original.json').read_bytes(), GOLD.read_bytes()) + value = F.validate_report(report, 'codex/rwx-ci-pilot') + self.assertEqual((value['source_rows'], value['acceptance_rows']), (79, 12)) + request = F.read(self.root / 'request.json') + self.assertEqual(request, {'authenticated': False, 'branch': 'branch=codex/rwx-ci-pilot', + 'url': 'https://circleci.com/api/v2/insights/gh/ethereum-optimism/optimism/flaky-tests'}) + self.assertIn('Top 10 Flaky Tests for branch codex/rwx-ci-pilot', result.stdout) + + def test_authenticated_mode_preserves_the_same_reporting_workload(self): + result, report = self.generate(token='fixture-token') + self.assertEqual(result.returncode, 0, result.stderr) + self.assertTrue(F.read(self.root / 'request.json')['authenticated']) + self.assertNotIn('fixture-token', result.stdout + result.stderr) + self.assertEqual(F.validate_report(report, 'codex/rwx-ci-pilot')['acceptance_rows'], 12) + + def test_http_failure_retains_the_original_body_and_status(self): + self.capture.write_text('{"message":"original HTTP failure"}') + self.env['RWX_FLAKY_STATUS'] = '403' + result, report = self.generate() + self.assertEqual(result.returncode, 22) + self.assertEqual((report / 'http-status.txt').read_text(), '403\n') + self.assertEqual((report / 'flaky_tests.original.json').read_bytes(), self.capture.read_bytes()) + self.assertFalse((report / 'flaky_tests.html').exists()) + + def test_transient_retry_preserves_the_first_failure_and_final_original(self): + self.env['RWX_FLAKY_STATUS_SEQUENCE'] = '503,200' + result, report = self.generate() + self.assertEqual(result.returncode, 0, result.stderr) + self.assertEqual((report / 'api-attempt-1.http-status.txt').read_text(), '503\n') + self.assertEqual(F.read(report / 'api-attempt-1.json'), {'message': 'original HTTP failure'}) + self.assertEqual((report / 'api-attempt-2.json').read_bytes(), GOLD.read_bytes()) + self.assertEqual(F.validate_report(report, 'codex/rwx-ci-pilot')['acceptance_rows'], 12) + (report / 'api-attempt-1.http-status.txt').unlink() + with self.assertRaisesRegex(ValueError, 'API attempts'): F.validate_report(report, 'codex/rwx-ci-pilot') + + def test_incomplete_corrupt_duplicate_or_untyped_originals_fail(self): + original = F.read(GOLD) + mutations = [] + value = copy.deepcopy(original); value['total_flaky_tests'] += 1; mutations.append(value) + value = copy.deepcopy(original); value['total_flaky_tests'] = True; mutations.append(value) + value = copy.deepcopy(original); value['flaky_tests'][0]['times_flaked'] = False; mutations.append(value) + value = copy.deepcopy(original); value['flaky_tests'][0].pop('classname'); mutations.append(value) + value = copy.deepcopy(original); value['flaky_tests'].append(value['flaky_tests'][0]); value['total_flaky_tests'] += 1; mutations.append(value) + for i, value in enumerate(mutations): + self.capture.write_text(json.dumps(value)) + with self.subTest(mutation=i), self.assertRaises((ValueError, KeyError)): + F.validate_api(self.capture) + for text in ('{"flaky_tests":[],"flaky_tests":[],"total_flaky_tests":0}', + '{"flaky_tests":[],"total_flaky_tests":NaN}', '{}', 'original non-JSON failure'): + self.capture.write_text(text) + with self.subTest(text=text), self.assertRaises(ValueError): F.validate_api(self.capture) + self.capture.write_text('{}') + result, report = self.generate() + self.assertNotEqual(result.returncode, 0) + self.assertFalse((report / 'flaky_tests.csv').exists()) + + def test_csv_html_and_filtered_json_omissions_are_rejected(self): + result, report = self.generate(); self.assertEqual(result.returncode, 0) + path = report / 'flaky_tests.csv'; original = path.read_text() + path.write_text('\n'.join(original.splitlines()[:-1]) + '\n') + with self.assertRaisesRegex(ValueError, 'CSV'): F.validate_report(report, 'codex/rwx-ci-pilot') + path.write_text(original) + path = report / 'flaky_tests.html'; original = path.read_text(); path.write_text(original.replace('View Job', 'wrong link text', 1)) + with self.assertRaisesRegex(ValueError, 'HTML'): F.validate_report(report, 'codex/rwx-ci-pilot') + path.write_text(original) + path = report / 'flaky_tests.filtered.json'; value = F.read(path); value['flaky_tests'].pop(); F.write(path, value) + with self.assertRaisesRegex(ValueError, 'report rows'): F.validate_report(report, 'codex/rwx-ci-pilot') + + def test_html_escapes_original_text_without_changing_csv_or_source(self): + value = F.read(GOLD) + row = next(row for row in value['flaky_tests'] if row['classname'].startswith(F.PREFIX)) + row['test_name'] = 'Test/