diff --git a/.gitlab/ci/pipelines/before_merging.yml b/.gitlab/ci/pipelines/before_merging.yml index 4c2fcacbbf241b185c76793e87502a329987501c..b82df284a2689ac523a53b8ac835e3527a824903 100644 --- a/.gitlab/ci/pipelines/before_merging.yml +++ b/.gitlab/ci/pipelines/before_merging.yml @@ -5037,6 +5037,186 @@ trigger:debian_repository_partial: trigger: include: .gitlab/ci/pipelines/debian_repository_partial.yml +trigger:feature_flags_multichain: + stage: manual + rules: + - changes: + - .gitlab-ci.yml + - .gitlab/**/* + - CHANGES.rst + - LICENSES/**/* + - Makefile + - brassaia/**/* + - cohttp/**/* + - data-encoding/**/* + - dune + - dune-project + - dune-workspace + - etherlink.mk + - etherlink/**/* + - images/**/* + - irmin/**/* + - kernels.mk + - michelson_test_scripts/**/* + - opam/**/* + - opentelemetry/**/* + - prometheus/**/* + - resto/**/* + - rust-toolchain + - script-inputs/**/* + - scripts/**/* + - scripts/ci/**/* + - src/**/* + - tezt/**/* + - tzt_reference_test_suite/**/* + when: on_success + - when: manual + allow_failure: true + needs: + - job: trigger + - job: sanity_ci + optional: true + - job: docker:hadolint + optional: true + - job: oc.ocaml_fmt + optional: true + - job: oc.semgrep + optional: true + - job: oc.misc_checks + optional: true + - job: check_jsonnet + optional: true + - job: check_rust_fmt + optional: true + - job: documentation:rst-check + optional: true + - job: nix + optional: true + - job: commit_titles + optional: true + trigger: + include: .gitlab/ci/pipelines/feature_flags_multichain.yml + +trigger:feature_flags_te: + stage: manual + rules: + - changes: + - .gitlab-ci.yml + - .gitlab/**/* + - CHANGES.rst + - LICENSES/**/* + - Makefile + - brassaia/**/* + - cohttp/**/* + - data-encoding/**/* + - dune + - dune-project + - dune-workspace + - etherlink.mk + - etherlink/**/* + - images/**/* + - irmin/**/* + - kernels.mk + - michelson_test_scripts/**/* + - opam/**/* + - opentelemetry/**/* + - prometheus/**/* + - resto/**/* + - rust-toolchain + - script-inputs/**/* + - scripts/**/* + - scripts/ci/**/* + - src/**/* + - tezt/**/* + - tzt_reference_test_suite/**/* + when: on_success + - when: manual + allow_failure: true + needs: + - job: trigger + - job: sanity_ci + optional: true + - job: docker:hadolint + optional: true + - job: oc.ocaml_fmt + optional: true + - job: oc.semgrep + optional: true + - job: oc.misc_checks + optional: true + - job: check_jsonnet + optional: true + - job: check_rust_fmt + optional: true + - job: documentation:rst-check + optional: true + - job: nix + optional: true + - job: commit_titles + optional: true + trigger: + include: .gitlab/ci/pipelines/feature_flags_te.yml + +trigger:feature_flags_multichain_te: + stage: manual + rules: + - changes: + - .gitlab-ci.yml + - .gitlab/**/* + - CHANGES.rst + - LICENSES/**/* + - Makefile + - brassaia/**/* + - cohttp/**/* + - data-encoding/**/* + - dune + - dune-project + - dune-workspace + - etherlink.mk + - etherlink/**/* + - images/**/* + - irmin/**/* + - kernels.mk + - michelson_test_scripts/**/* + - opam/**/* + - opentelemetry/**/* + - prometheus/**/* + - resto/**/* + - rust-toolchain + - script-inputs/**/* + - scripts/**/* + - scripts/ci/**/* + - src/**/* + - tezt/**/* + - tzt_reference_test_suite/**/* + when: on_success + - when: manual + allow_failure: true + needs: + - job: trigger + - job: sanity_ci + optional: true + - job: docker:hadolint + optional: true + - job: oc.ocaml_fmt + optional: true + - job: oc.semgrep + optional: true + - job: oc.misc_checks + optional: true + - job: check_jsonnet + optional: true + - job: check_rust_fmt + optional: true + - job: documentation:rst-check + optional: true + - job: nix + optional: true + - job: commit_titles + optional: true + trigger: + include: .gitlab/ci/pipelines/feature_flags_multichain_te.yml + oc.docker:amd64: image: ${GCP_REGISTRY}/tezos/docker-images/ci-docker:v1.12.0 stage: manual diff --git a/.gitlab/ci/pipelines/feature_flags_multichain.yml b/.gitlab/ci/pipelines/feature_flags_multichain.yml new file mode 100644 index 0000000000000000000000000000000000000000..35fe1bc43a5673e7eca760c1940267b391a7e735 --- /dev/null +++ b/.gitlab/ci/pipelines/feature_flags_multichain.yml @@ -0,0 +1,303 @@ +# This file was automatically generated, do not edit. +# Edit file ci/bin/main.ml instead. + +workflow: + rules: + - if: $foo != "bar" || $foo == "bar" + when: always + +variables: + PIPELINE_TYPE: feature_flags_multichain + +stages: +- start +- images +- build +- manual + +oc.docker:ci:amd64: + image: ${GCP_REGISTRY}/tezos/docker-images/ci-docker:v1.12.0 + stage: images + tags: + - gcp + dependencies: [] + timeout: 60 minutes + before_script: [] + script: + - ./images/ci_create_ci_images.sh + services: + - docker:${DOCKER_VERSION}-dind + variables: + DOCKER_VERSION: 24.0.7 + CI_DOCKER_HUB: "false" + ARCH: amd64 + artifacts: + reports: + dotenv: ci_image_tag.env + +oc.docker:rust-toolchain:amd64: + image: ${GCP_REGISTRY}/tezos/docker-images/ci-docker:v1.12.0 + stage: images + tags: + - gcp + dependencies: [] + timeout: 60 minutes + before_script: [] + script: + - ./scripts/ci/docker_rust_toolchain_build.sh + services: + - docker:${DOCKER_VERSION}-dind + variables: + DOCKER_VERSION: 24.0.7 + CI_DOCKER_HUB: "false" + artifacts: + reports: + dotenv: rust_toolchain_image_tag.env + +oc.build_x86_64-released: + image: ${ci_image_name}/build:${ci_image_tag} + stage: build + tags: + - gcp + dependencies: + - oc.docker:ci:amd64 + timeout: 60 minutes + cache: + - key: cargo-$CI_JOB_NAME_SLUG + paths: + - $CI_PROJECT_DIR/.cargo/registry/cache + policy: pull-push + - key: sccache-$CI_JOB_NAME_SLUG + paths: + - $CI_PROJECT_DIR/_sccache + policy: pull-push + - key: rust-deps-target-$CI_JOB_NAME_SLUG + paths: + - $CI_PROJECT_DIR/_target + policy: pull-push + before_script: + - ./scripts/ci/take_ownership.sh + - . ./scripts/version.sh + - eval $(opam env) + - . ./scripts/ci/sccache-start.sh + script: + - ./scripts/ci/build_full_unreleased.sh + after_script: + - ./scripts/ci/sccache-stop.sh + variables: + ARCH: x86_64 + EXECUTABLE_FILES: script-inputs/released-executables + CARGO_NET_OFFLINE: "false" + SCCACHE_DIR: $CI_PROJECT_DIR/_sccache + SCCACHE_CACHE_SIZE: 5G + OCTEZ_RUST_DEPS_TARGET_DIR: $CI_PROJECT_DIR/_target + COVERAGE_OPTIONS: --instrument-with bisect_ppx + artifacts: + name: build-$ARCH-$CI_COMMIT_REF_SLUG + expire_in: 1 day + paths: + - octez-* + - octez-teztale-* + - src/proto_*/parameters/*.json + - _build/default/src/lib_protocol_compiler/bin/main_native.exe + - _build/default/tezt/tests/main.exe + - _build/default/contrib/octez_injector_server/octez_injector_server.exe + - etherlink-governance-observer + when: on_success + +oc.build_x86_64-exp-dev-extra: + image: ${ci_image_name}/build:${ci_image_tag} + stage: build + tags: + - gcp + dependencies: + - oc.docker:ci:amd64 + timeout: 60 minutes + cache: + - key: cargo-$CI_JOB_NAME_SLUG + paths: + - $CI_PROJECT_DIR/.cargo/registry/cache + policy: pull-push + - key: sccache-$CI_JOB_NAME_SLUG + paths: + - $CI_PROJECT_DIR/_sccache + policy: pull-push + - key: rust-deps-target-$CI_JOB_NAME_SLUG + paths: + - $CI_PROJECT_DIR/_target + policy: pull-push + before_script: + - ./scripts/ci/take_ownership.sh + - . ./scripts/version.sh + - eval $(opam env) + - . ./scripts/ci/sccache-start.sh + script: + - ./scripts/ci/build_full_unreleased.sh + after_script: + - ./scripts/ci/sccache-stop.sh + variables: + ARCH: x86_64 + EXECUTABLE_FILES: script-inputs/experimental-executables script-inputs/dev-executables + BUILD_EXTRA: src/bin_tps_evaluation/main_tps_evaluation.exe src/bin_octogram/octogram_main.exe + tezt/tests/main.exe contrib/octez_injector_server/octez_injector_server.exe + CARGO_NET_OFFLINE: "false" + SCCACHE_DIR: $CI_PROJECT_DIR/_sccache + SCCACHE_CACHE_SIZE: 5G + OCTEZ_RUST_DEPS_TARGET_DIR: $CI_PROJECT_DIR/_target + COVERAGE_OPTIONS: --instrument-with bisect_ppx + artifacts: + name: build-$ARCH-$CI_COMMIT_REF_SLUG + expire_in: 1 day + paths: + - octez-* + - octez-teztale-* + - src/proto_*/parameters/*.json + - _build/default/src/lib_protocol_compiler/bin/main_native.exe + - _build/default/tezt/tests/main.exe + - _build/default/contrib/octez_injector_server/octez_injector_server.exe + - etherlink-governance-observer + when: on_success + +oc.build_kernels: + image: ${rust_toolchain_image_name}:${rust_toolchain_image_tag} + stage: build + tags: + - gcp + dependencies: + - oc.docker:rust-toolchain:amd64 + timeout: 60 minutes + cache: + - key: kernels-sccache + paths: + - $CI_PROJECT_DIR/_sccache + policy: pull-push + - key: cargo-$CI_JOB_NAME_SLUG + paths: + - $CI_PROJECT_DIR/.cargo/registry/cache + policy: pull-push + before_script: + - . ./scripts/ci/sccache-start.sh + script: + - make -f kernels.mk build + - make -f etherlink.mk evm_kernel.wasm + - make -C src/riscv riscv-sandbox riscv-dummy.elf + - make -C src/riscv riscv-sandbox riscv-dummy-sdk.elf + - make -C src/riscv/tests/ build + after_script: + - ./scripts/ci/sccache-stop.sh + variables: + CC: clang + NATIVE_TARGET: x86_64-unknown-linux-musl + SCCACHE_DIR: $CI_PROJECT_DIR/_sccache + SCCACHE_CACHE_SIZE: 5G + CARGO_NET_OFFLINE: "false" + artifacts: + name: build-kernels-$CI_COMMIT_REF_SLUG + expire_in: 1 day + paths: + - evm_kernel.wasm + - smart-rollup-installer + - sequenced_kernel.wasm + - tx_kernel.wasm + - tx_kernel_dal.wasm + - dal_echo_kernel.wasm + - src/riscv/riscv-sandbox + - src/riscv/riscv-dummy.elf + - src/riscv/riscv-dummy-sdk.elf + - src/riscv/tests/inline_asm/rv64-inline-asm-tests + when: on_success + +oc.tezt:fetch-records: + image: ${ci_image_name}/build:${ci_image_tag} + stage: build + tags: + - gcp + dependencies: + - oc.docker:ci:amd64 + allow_failure: true + timeout: 60 minutes + before_script: + - ./scripts/ci/take_ownership.sh + - . ./scripts/version.sh + - eval $(opam env) + script: + - dune exec scripts/ci/update_records/update.exe -- --log-file tezt-fetch-records.log + --from last-successful-schedule-extended-test --info + after_script: + - ./scripts/ci/filter_corrupted_records.sh + artifacts: + expire_in: 4 hours + paths: + - tezt-fetch-records.log + - tezt/records/*.json + - tezt/records/*.json.broken + when: always + +datadog_pipeline_trace: + image: datadog/ci:v2.44.0 + stage: start + tags: + - gcp + dependencies: [] + allow_failure: true + timeout: 60 minutes + script: + - CI_MERGE_REQUEST_IID=${CI_MERGE_REQUEST_IID:-none} + - DATADOG_SITE=datadoghq.eu datadog-ci tag --level pipeline --tags pipeline_type:$PIPELINE_TYPE + --tags mr_number:$CI_MERGE_REQUEST_IID + +tezt:feature-flags: + image: ${ci_image_name}/e2etest:${ci_image_tag} + stage: manual + tags: + - gcp_tezt + rules: + - when: manual + allow_failure: true + needs: + - oc.docker:ci:amd64 + - oc.build_x86_64-released + - oc.build_x86_64-exp-dev-extra + - oc.build_kernels + - oc.tezt:fetch-records + dependencies: + - oc.docker:ci:amd64 + - oc.build_x86_64-released + - oc.build_x86_64-exp-dev-extra + - oc.build_kernels + - oc.tezt:fetch-records + timeout: 40 minutes + before_script: + - . ./scripts/version.sh + - eval $(opam env) + script: + - echo "TESTS=\"${TESTS}\" JUNIT=\"${JUNIT}\" CI_NODE_INDEX=\"${CI_NODE_INDEX}\" + CI_NODE_TOTAL=\"${CI_NODE_TOTAL}\" TEZT_PARALLEL=\"${TEZT_PARALLEL}\" TEZT_VARIANT=\"${TEZT_VARIANT}\"" + - ./scripts/ci/tezt.sh --without-select-tezts "${TESTS}" --from-record tezt/records + --job ${CI_NODE_INDEX:-1}/${CI_NODE_TOTAL:-1} --list-tsv > selected_tezts.tsv + - ./scripts/ci/exit_code.sh timeout -k 60 1860 ./scripts/ci/tezt.sh --send-junit + --without-select-tezts "${TESTS}" --color --log-buffer-size 5000 --log-file tezt.log + --global-timeout 1800 --on-unknown-regression-files fail --junit ${JUNIT} --from-record + tezt/records --job ${CI_NODE_INDEX:-1}/${CI_NODE_TOTAL:-1} --record tezt-results-${CI_NODE_INDEX:-1}${TEZT_VARIANT}.json + --job-count ${TEZT_PARALLEL} --retry ${TEZT_RETRY} + variables: + JUNIT: tezt-junit.xml + TEZT_VARIANT: "" + TESTS: /ci_disabled && /memory_3k && /memory_4k && /time_sensitive && /slow && + /cloud && multichain && /te + TEZT_RETRY: "1" + TEZT_PARALLEL: "3" + TEZT_NO_NPX: "true" + artifacts: + expire_in: 7 days + paths: + - selected_tezts.tsv + - tezt.log + - tezt-*.log + - tezt-results-${CI_NODE_INDEX:-1}${TEZT_VARIANT}.json + - $JUNIT + reports: + junit: $JUNIT + when: always + retry: 2 + parallel: 100 diff --git a/.gitlab/ci/pipelines/feature_flags_multichain_te.yml b/.gitlab/ci/pipelines/feature_flags_multichain_te.yml new file mode 100644 index 0000000000000000000000000000000000000000..664c9b40db0f8d2811a1f880d58612cfd6ef5a60 --- /dev/null +++ b/.gitlab/ci/pipelines/feature_flags_multichain_te.yml @@ -0,0 +1,303 @@ +# This file was automatically generated, do not edit. +# Edit file ci/bin/main.ml instead. + +workflow: + rules: + - if: $foo != "bar" || $foo == "bar" + when: always + +variables: + PIPELINE_TYPE: feature_flags_multichain_te + +stages: +- start +- images +- build +- manual + +oc.docker:ci:amd64: + image: ${GCP_REGISTRY}/tezos/docker-images/ci-docker:v1.12.0 + stage: images + tags: + - gcp + dependencies: [] + timeout: 60 minutes + before_script: [] + script: + - ./images/ci_create_ci_images.sh + services: + - docker:${DOCKER_VERSION}-dind + variables: + DOCKER_VERSION: 24.0.7 + CI_DOCKER_HUB: "false" + ARCH: amd64 + artifacts: + reports: + dotenv: ci_image_tag.env + +oc.docker:rust-toolchain:amd64: + image: ${GCP_REGISTRY}/tezos/docker-images/ci-docker:v1.12.0 + stage: images + tags: + - gcp + dependencies: [] + timeout: 60 minutes + before_script: [] + script: + - ./scripts/ci/docker_rust_toolchain_build.sh + services: + - docker:${DOCKER_VERSION}-dind + variables: + DOCKER_VERSION: 24.0.7 + CI_DOCKER_HUB: "false" + artifacts: + reports: + dotenv: rust_toolchain_image_tag.env + +oc.build_x86_64-released: + image: ${ci_image_name}/build:${ci_image_tag} + stage: build + tags: + - gcp + dependencies: + - oc.docker:ci:amd64 + timeout: 60 minutes + cache: + - key: cargo-$CI_JOB_NAME_SLUG + paths: + - $CI_PROJECT_DIR/.cargo/registry/cache + policy: pull-push + - key: sccache-$CI_JOB_NAME_SLUG + paths: + - $CI_PROJECT_DIR/_sccache + policy: pull-push + - key: rust-deps-target-$CI_JOB_NAME_SLUG + paths: + - $CI_PROJECT_DIR/_target + policy: pull-push + before_script: + - ./scripts/ci/take_ownership.sh + - . ./scripts/version.sh + - eval $(opam env) + - . ./scripts/ci/sccache-start.sh + script: + - ./scripts/ci/build_full_unreleased.sh + after_script: + - ./scripts/ci/sccache-stop.sh + variables: + ARCH: x86_64 + EXECUTABLE_FILES: script-inputs/released-executables + CARGO_NET_OFFLINE: "false" + SCCACHE_DIR: $CI_PROJECT_DIR/_sccache + SCCACHE_CACHE_SIZE: 5G + OCTEZ_RUST_DEPS_TARGET_DIR: $CI_PROJECT_DIR/_target + COVERAGE_OPTIONS: --instrument-with bisect_ppx + artifacts: + name: build-$ARCH-$CI_COMMIT_REF_SLUG + expire_in: 1 day + paths: + - octez-* + - octez-teztale-* + - src/proto_*/parameters/*.json + - _build/default/src/lib_protocol_compiler/bin/main_native.exe + - _build/default/tezt/tests/main.exe + - _build/default/contrib/octez_injector_server/octez_injector_server.exe + - etherlink-governance-observer + when: on_success + +oc.build_x86_64-exp-dev-extra: + image: ${ci_image_name}/build:${ci_image_tag} + stage: build + tags: + - gcp + dependencies: + - oc.docker:ci:amd64 + timeout: 60 minutes + cache: + - key: cargo-$CI_JOB_NAME_SLUG + paths: + - $CI_PROJECT_DIR/.cargo/registry/cache + policy: pull-push + - key: sccache-$CI_JOB_NAME_SLUG + paths: + - $CI_PROJECT_DIR/_sccache + policy: pull-push + - key: rust-deps-target-$CI_JOB_NAME_SLUG + paths: + - $CI_PROJECT_DIR/_target + policy: pull-push + before_script: + - ./scripts/ci/take_ownership.sh + - . ./scripts/version.sh + - eval $(opam env) + - . ./scripts/ci/sccache-start.sh + script: + - ./scripts/ci/build_full_unreleased.sh + after_script: + - ./scripts/ci/sccache-stop.sh + variables: + ARCH: x86_64 + EXECUTABLE_FILES: script-inputs/experimental-executables script-inputs/dev-executables + BUILD_EXTRA: src/bin_tps_evaluation/main_tps_evaluation.exe src/bin_octogram/octogram_main.exe + tezt/tests/main.exe contrib/octez_injector_server/octez_injector_server.exe + CARGO_NET_OFFLINE: "false" + SCCACHE_DIR: $CI_PROJECT_DIR/_sccache + SCCACHE_CACHE_SIZE: 5G + OCTEZ_RUST_DEPS_TARGET_DIR: $CI_PROJECT_DIR/_target + COVERAGE_OPTIONS: --instrument-with bisect_ppx + artifacts: + name: build-$ARCH-$CI_COMMIT_REF_SLUG + expire_in: 1 day + paths: + - octez-* + - octez-teztale-* + - src/proto_*/parameters/*.json + - _build/default/src/lib_protocol_compiler/bin/main_native.exe + - _build/default/tezt/tests/main.exe + - _build/default/contrib/octez_injector_server/octez_injector_server.exe + - etherlink-governance-observer + when: on_success + +oc.build_kernels: + image: ${rust_toolchain_image_name}:${rust_toolchain_image_tag} + stage: build + tags: + - gcp + dependencies: + - oc.docker:rust-toolchain:amd64 + timeout: 60 minutes + cache: + - key: kernels-sccache + paths: + - $CI_PROJECT_DIR/_sccache + policy: pull-push + - key: cargo-$CI_JOB_NAME_SLUG + paths: + - $CI_PROJECT_DIR/.cargo/registry/cache + policy: pull-push + before_script: + - . ./scripts/ci/sccache-start.sh + script: + - make -f kernels.mk build + - make -f etherlink.mk evm_kernel.wasm + - make -C src/riscv riscv-sandbox riscv-dummy.elf + - make -C src/riscv riscv-sandbox riscv-dummy-sdk.elf + - make -C src/riscv/tests/ build + after_script: + - ./scripts/ci/sccache-stop.sh + variables: + CC: clang + NATIVE_TARGET: x86_64-unknown-linux-musl + SCCACHE_DIR: $CI_PROJECT_DIR/_sccache + SCCACHE_CACHE_SIZE: 5G + CARGO_NET_OFFLINE: "false" + artifacts: + name: build-kernels-$CI_COMMIT_REF_SLUG + expire_in: 1 day + paths: + - evm_kernel.wasm + - smart-rollup-installer + - sequenced_kernel.wasm + - tx_kernel.wasm + - tx_kernel_dal.wasm + - dal_echo_kernel.wasm + - src/riscv/riscv-sandbox + - src/riscv/riscv-dummy.elf + - src/riscv/riscv-dummy-sdk.elf + - src/riscv/tests/inline_asm/rv64-inline-asm-tests + when: on_success + +oc.tezt:fetch-records: + image: ${ci_image_name}/build:${ci_image_tag} + stage: build + tags: + - gcp + dependencies: + - oc.docker:ci:amd64 + allow_failure: true + timeout: 60 minutes + before_script: + - ./scripts/ci/take_ownership.sh + - . ./scripts/version.sh + - eval $(opam env) + script: + - dune exec scripts/ci/update_records/update.exe -- --log-file tezt-fetch-records.log + --from last-successful-schedule-extended-test --info + after_script: + - ./scripts/ci/filter_corrupted_records.sh + artifacts: + expire_in: 4 hours + paths: + - tezt-fetch-records.log + - tezt/records/*.json + - tezt/records/*.json.broken + when: always + +datadog_pipeline_trace: + image: datadog/ci:v2.44.0 + stage: start + tags: + - gcp + dependencies: [] + allow_failure: true + timeout: 60 minutes + script: + - CI_MERGE_REQUEST_IID=${CI_MERGE_REQUEST_IID:-none} + - DATADOG_SITE=datadoghq.eu datadog-ci tag --level pipeline --tags pipeline_type:$PIPELINE_TYPE + --tags mr_number:$CI_MERGE_REQUEST_IID + +tezt:feature-flags: + image: ${ci_image_name}/e2etest:${ci_image_tag} + stage: manual + tags: + - gcp_tezt + rules: + - when: manual + allow_failure: true + needs: + - oc.docker:ci:amd64 + - oc.build_x86_64-released + - oc.build_x86_64-exp-dev-extra + - oc.build_kernels + - oc.tezt:fetch-records + dependencies: + - oc.docker:ci:amd64 + - oc.build_x86_64-released + - oc.build_x86_64-exp-dev-extra + - oc.build_kernels + - oc.tezt:fetch-records + timeout: 40 minutes + before_script: + - . ./scripts/version.sh + - eval $(opam env) + script: + - echo "TESTS=\"${TESTS}\" JUNIT=\"${JUNIT}\" CI_NODE_INDEX=\"${CI_NODE_INDEX}\" + CI_NODE_TOTAL=\"${CI_NODE_TOTAL}\" TEZT_PARALLEL=\"${TEZT_PARALLEL}\" TEZT_VARIANT=\"${TEZT_VARIANT}\"" + - ./scripts/ci/tezt.sh --without-select-tezts "${TESTS}" --from-record tezt/records + --job ${CI_NODE_INDEX:-1}/${CI_NODE_TOTAL:-1} --list-tsv > selected_tezts.tsv + - ./scripts/ci/exit_code.sh timeout -k 60 1860 ./scripts/ci/tezt.sh --send-junit + --without-select-tezts "${TESTS}" --color --log-buffer-size 5000 --log-file tezt.log + --global-timeout 1800 --on-unknown-regression-files fail --junit ${JUNIT} --from-record + tezt/records --job ${CI_NODE_INDEX:-1}/${CI_NODE_TOTAL:-1} --record tezt-results-${CI_NODE_INDEX:-1}${TEZT_VARIANT}.json + --job-count ${TEZT_PARALLEL} --retry ${TEZT_RETRY} + variables: + JUNIT: tezt-junit.xml + TEZT_VARIANT: "" + TESTS: /ci_disabled && /memory_3k && /memory_4k && /time_sensitive && /slow && + /cloud && (te || multichain) + TEZT_RETRY: "1" + TEZT_PARALLEL: "3" + TEZT_NO_NPX: "true" + artifacts: + expire_in: 7 days + paths: + - selected_tezts.tsv + - tezt.log + - tezt-*.log + - tezt-results-${CI_NODE_INDEX:-1}${TEZT_VARIANT}.json + - $JUNIT + reports: + junit: $JUNIT + when: always + retry: 2 + parallel: 100 diff --git a/.gitlab/ci/pipelines/feature_flags_te.yml b/.gitlab/ci/pipelines/feature_flags_te.yml new file mode 100644 index 0000000000000000000000000000000000000000..7d40d1f1870a94acae5c5723b85b29018b1f82c5 --- /dev/null +++ b/.gitlab/ci/pipelines/feature_flags_te.yml @@ -0,0 +1,303 @@ +# This file was automatically generated, do not edit. +# Edit file ci/bin/main.ml instead. + +workflow: + rules: + - if: $foo != "bar" || $foo == "bar" + when: always + +variables: + PIPELINE_TYPE: feature_flags_te + +stages: +- start +- images +- build +- manual + +oc.docker:ci:amd64: + image: ${GCP_REGISTRY}/tezos/docker-images/ci-docker:v1.12.0 + stage: images + tags: + - gcp + dependencies: [] + timeout: 60 minutes + before_script: [] + script: + - ./images/ci_create_ci_images.sh + services: + - docker:${DOCKER_VERSION}-dind + variables: + DOCKER_VERSION: 24.0.7 + CI_DOCKER_HUB: "false" + ARCH: amd64 + artifacts: + reports: + dotenv: ci_image_tag.env + +oc.docker:rust-toolchain:amd64: + image: ${GCP_REGISTRY}/tezos/docker-images/ci-docker:v1.12.0 + stage: images + tags: + - gcp + dependencies: [] + timeout: 60 minutes + before_script: [] + script: + - ./scripts/ci/docker_rust_toolchain_build.sh + services: + - docker:${DOCKER_VERSION}-dind + variables: + DOCKER_VERSION: 24.0.7 + CI_DOCKER_HUB: "false" + artifacts: + reports: + dotenv: rust_toolchain_image_tag.env + +oc.build_x86_64-released: + image: ${ci_image_name}/build:${ci_image_tag} + stage: build + tags: + - gcp + dependencies: + - oc.docker:ci:amd64 + timeout: 60 minutes + cache: + - key: cargo-$CI_JOB_NAME_SLUG + paths: + - $CI_PROJECT_DIR/.cargo/registry/cache + policy: pull-push + - key: sccache-$CI_JOB_NAME_SLUG + paths: + - $CI_PROJECT_DIR/_sccache + policy: pull-push + - key: rust-deps-target-$CI_JOB_NAME_SLUG + paths: + - $CI_PROJECT_DIR/_target + policy: pull-push + before_script: + - ./scripts/ci/take_ownership.sh + - . ./scripts/version.sh + - eval $(opam env) + - . ./scripts/ci/sccache-start.sh + script: + - ./scripts/ci/build_full_unreleased.sh + after_script: + - ./scripts/ci/sccache-stop.sh + variables: + ARCH: x86_64 + EXECUTABLE_FILES: script-inputs/released-executables + CARGO_NET_OFFLINE: "false" + SCCACHE_DIR: $CI_PROJECT_DIR/_sccache + SCCACHE_CACHE_SIZE: 5G + OCTEZ_RUST_DEPS_TARGET_DIR: $CI_PROJECT_DIR/_target + COVERAGE_OPTIONS: --instrument-with bisect_ppx + artifacts: + name: build-$ARCH-$CI_COMMIT_REF_SLUG + expire_in: 1 day + paths: + - octez-* + - octez-teztale-* + - src/proto_*/parameters/*.json + - _build/default/src/lib_protocol_compiler/bin/main_native.exe + - _build/default/tezt/tests/main.exe + - _build/default/contrib/octez_injector_server/octez_injector_server.exe + - etherlink-governance-observer + when: on_success + +oc.build_x86_64-exp-dev-extra: + image: ${ci_image_name}/build:${ci_image_tag} + stage: build + tags: + - gcp + dependencies: + - oc.docker:ci:amd64 + timeout: 60 minutes + cache: + - key: cargo-$CI_JOB_NAME_SLUG + paths: + - $CI_PROJECT_DIR/.cargo/registry/cache + policy: pull-push + - key: sccache-$CI_JOB_NAME_SLUG + paths: + - $CI_PROJECT_DIR/_sccache + policy: pull-push + - key: rust-deps-target-$CI_JOB_NAME_SLUG + paths: + - $CI_PROJECT_DIR/_target + policy: pull-push + before_script: + - ./scripts/ci/take_ownership.sh + - . ./scripts/version.sh + - eval $(opam env) + - . ./scripts/ci/sccache-start.sh + script: + - ./scripts/ci/build_full_unreleased.sh + after_script: + - ./scripts/ci/sccache-stop.sh + variables: + ARCH: x86_64 + EXECUTABLE_FILES: script-inputs/experimental-executables script-inputs/dev-executables + BUILD_EXTRA: src/bin_tps_evaluation/main_tps_evaluation.exe src/bin_octogram/octogram_main.exe + tezt/tests/main.exe contrib/octez_injector_server/octez_injector_server.exe + CARGO_NET_OFFLINE: "false" + SCCACHE_DIR: $CI_PROJECT_DIR/_sccache + SCCACHE_CACHE_SIZE: 5G + OCTEZ_RUST_DEPS_TARGET_DIR: $CI_PROJECT_DIR/_target + COVERAGE_OPTIONS: --instrument-with bisect_ppx + artifacts: + name: build-$ARCH-$CI_COMMIT_REF_SLUG + expire_in: 1 day + paths: + - octez-* + - octez-teztale-* + - src/proto_*/parameters/*.json + - _build/default/src/lib_protocol_compiler/bin/main_native.exe + - _build/default/tezt/tests/main.exe + - _build/default/contrib/octez_injector_server/octez_injector_server.exe + - etherlink-governance-observer + when: on_success + +oc.build_kernels: + image: ${rust_toolchain_image_name}:${rust_toolchain_image_tag} + stage: build + tags: + - gcp + dependencies: + - oc.docker:rust-toolchain:amd64 + timeout: 60 minutes + cache: + - key: kernels-sccache + paths: + - $CI_PROJECT_DIR/_sccache + policy: pull-push + - key: cargo-$CI_JOB_NAME_SLUG + paths: + - $CI_PROJECT_DIR/.cargo/registry/cache + policy: pull-push + before_script: + - . ./scripts/ci/sccache-start.sh + script: + - make -f kernels.mk build + - make -f etherlink.mk evm_kernel.wasm + - make -C src/riscv riscv-sandbox riscv-dummy.elf + - make -C src/riscv riscv-sandbox riscv-dummy-sdk.elf + - make -C src/riscv/tests/ build + after_script: + - ./scripts/ci/sccache-stop.sh + variables: + CC: clang + NATIVE_TARGET: x86_64-unknown-linux-musl + SCCACHE_DIR: $CI_PROJECT_DIR/_sccache + SCCACHE_CACHE_SIZE: 5G + CARGO_NET_OFFLINE: "false" + artifacts: + name: build-kernels-$CI_COMMIT_REF_SLUG + expire_in: 1 day + paths: + - evm_kernel.wasm + - smart-rollup-installer + - sequenced_kernel.wasm + - tx_kernel.wasm + - tx_kernel_dal.wasm + - dal_echo_kernel.wasm + - src/riscv/riscv-sandbox + - src/riscv/riscv-dummy.elf + - src/riscv/riscv-dummy-sdk.elf + - src/riscv/tests/inline_asm/rv64-inline-asm-tests + when: on_success + +oc.tezt:fetch-records: + image: ${ci_image_name}/build:${ci_image_tag} + stage: build + tags: + - gcp + dependencies: + - oc.docker:ci:amd64 + allow_failure: true + timeout: 60 minutes + before_script: + - ./scripts/ci/take_ownership.sh + - . ./scripts/version.sh + - eval $(opam env) + script: + - dune exec scripts/ci/update_records/update.exe -- --log-file tezt-fetch-records.log + --from last-successful-schedule-extended-test --info + after_script: + - ./scripts/ci/filter_corrupted_records.sh + artifacts: + expire_in: 4 hours + paths: + - tezt-fetch-records.log + - tezt/records/*.json + - tezt/records/*.json.broken + when: always + +datadog_pipeline_trace: + image: datadog/ci:v2.44.0 + stage: start + tags: + - gcp + dependencies: [] + allow_failure: true + timeout: 60 minutes + script: + - CI_MERGE_REQUEST_IID=${CI_MERGE_REQUEST_IID:-none} + - DATADOG_SITE=datadoghq.eu datadog-ci tag --level pipeline --tags pipeline_type:$PIPELINE_TYPE + --tags mr_number:$CI_MERGE_REQUEST_IID + +tezt:feature-flags: + image: ${ci_image_name}/e2etest:${ci_image_tag} + stage: manual + tags: + - gcp_tezt + rules: + - when: manual + allow_failure: true + needs: + - oc.docker:ci:amd64 + - oc.build_x86_64-released + - oc.build_x86_64-exp-dev-extra + - oc.build_kernels + - oc.tezt:fetch-records + dependencies: + - oc.docker:ci:amd64 + - oc.build_x86_64-released + - oc.build_x86_64-exp-dev-extra + - oc.build_kernels + - oc.tezt:fetch-records + timeout: 40 minutes + before_script: + - . ./scripts/version.sh + - eval $(opam env) + script: + - echo "TESTS=\"${TESTS}\" JUNIT=\"${JUNIT}\" CI_NODE_INDEX=\"${CI_NODE_INDEX}\" + CI_NODE_TOTAL=\"${CI_NODE_TOTAL}\" TEZT_PARALLEL=\"${TEZT_PARALLEL}\" TEZT_VARIANT=\"${TEZT_VARIANT}\"" + - ./scripts/ci/tezt.sh --without-select-tezts "${TESTS}" --from-record tezt/records + --job ${CI_NODE_INDEX:-1}/${CI_NODE_TOTAL:-1} --list-tsv > selected_tezts.tsv + - ./scripts/ci/exit_code.sh timeout -k 60 1860 ./scripts/ci/tezt.sh --send-junit + --without-select-tezts "${TESTS}" --color --log-buffer-size 5000 --log-file tezt.log + --global-timeout 1800 --on-unknown-regression-files fail --junit ${JUNIT} --from-record + tezt/records --job ${CI_NODE_INDEX:-1}/${CI_NODE_TOTAL:-1} --record tezt-results-${CI_NODE_INDEX:-1}${TEZT_VARIANT}.json + --job-count ${TEZT_PARALLEL} --retry ${TEZT_RETRY} + variables: + JUNIT: tezt-junit.xml + TEZT_VARIANT: "" + TESTS: /ci_disabled && /memory_3k && /memory_4k && /time_sensitive && /slow && + /cloud && te && /multichain + TEZT_RETRY: "1" + TEZT_PARALLEL: "3" + TEZT_NO_NPX: "true" + artifacts: + expire_in: 7 days + paths: + - selected_tezts.tsv + - tezt.log + - tezt-*.log + - tezt-results-${CI_NODE_INDEX:-1}${TEZT_VARIANT}.json + - $JUNIT + reports: + junit: $JUNIT + when: always + retry: 2 + parallel: 100 diff --git a/ci/bin/code_verification.ml b/ci/bin/code_verification.ml index 19790f57c1b2c78c92d6d263d46dc38badd3ec01..229122046c5532675127168b71b009a429163a13 100644 --- a/ci/bin/code_verification.ml +++ b/ci/bin/code_verification.ml @@ -852,6 +852,7 @@ let jobs pipeline_type = ~dependencies:dependencies_needs_start Homebrew.child_pipeline_full in + (* check that ksy files are still up-to-date with octez *) let job_kaitai_checks : tezos_job = job @@ -1341,6 +1342,8 @@ let jobs pipeline_type = - [tezt-slow]: runs the jobs with tag [slow]. - [tezt-flaky]: runs the jobs with tag [flaky] and none of the tags above. + - [tezt-feature_flags]: manual job to run feature_flags tests + specified by the variable TODO. and a job [tezt] that runs all remaining tests (excepting those that are tagged [ci_disabled], that are disabled in the CI.) @@ -1910,6 +1913,30 @@ let jobs pipeline_type = ~stage:Stages.manual Homebrew.child_pipeline_full in + let job_feature_flag_trigger_multichain = + trigger_job + ~__POS__ + ~rules:(make_rules ~manual:Yes ~changes:changeset_octez_or_kernels ()) + ~stage:Stages.manual + ~dependencies:dependencies_needs_start + Feature_flags.child_pipeline_multichain + in + let job_feature_flag_trigger_te = + trigger_job + ~__POS__ + ~rules:(make_rules ~manual:Yes ~changes:changeset_octez_or_kernels ()) + ~stage:Stages.manual + ~dependencies:dependencies_needs_start + Feature_flags.child_pipeline_te + in + let job_feature_flag_trigger_multichain_te = + trigger_job + ~__POS__ + ~rules:(make_rules ~manual:Yes ~changes:changeset_octez_or_kernels ()) + ~stage:Stages.manual + ~dependencies:dependencies_needs_start + Feature_flags.child_pipeline_multichain_te + in match pipeline_type with | Before_merging | Merge_train -> (* Note: manual jobs in stage [manual] (which is the final @@ -1980,8 +2007,9 @@ let jobs pipeline_type = else job_ocaml4_octez_trigger_auto :: job_homebrew_repository_trigger :: job_rpm_repository_trigger_partial - :: job_debian_repository_trigger_partial :: jobs - (* No manual jobs on the scheduled pipeline *) + :: job_debian_repository_trigger_partial + :: job_feature_flag_trigger_multichain :: job_feature_flag_trigger_te + :: job_feature_flag_trigger_multichain_te :: jobs | Schedule_extended_test -> [] in start_stage @ sanity @ build @ packaging @ test @ coverage @ doc @ manual diff --git a/ci/bin/common.ml b/ci/bin/common.ml index 79cbc0fc5a65e112bcf241aff5a9704fe901b7b5..c79d06b971f27dcfed096fe81197fc2993ed4e87 100644 --- a/ci/bin/common.ml +++ b/ci/bin/common.ml @@ -1067,7 +1067,8 @@ module Tezt = struct ~(tezt_tests : Tezt_core.TSL_AST.t) ?(retry = 2) ?(tezt_retry = 1) ?(tezt_parallel = 1) ?(tezt_variant = "") ?(before_script = before_script ~source_version:true ~eval_opam:true []) - ?timeout ?job_select_tezts ~dependencies ?allow_failure () : tezos_job = + ?timeout ?job_select_tezts ~dependencies ?allow_failure + ?(stage = Stages.test) () : tezos_job = let variables = [ ("JUNIT", "tezt-junit.xml"); @@ -1134,7 +1135,7 @@ module Tezt = struct ~name ?parallel ~tag - ~stage:Stages.test + ~stage ?rules ~artifacts ~variables diff --git a/ci/bin/feature_flags.ml b/ci/bin/feature_flags.ml new file mode 100644 index 0000000000000000000000000000000000000000..359fefb7d374c2c2c3cc7112298f842a81013d8e --- /dev/null +++ b/ci/bin/feature_flags.ml @@ -0,0 +1,86 @@ +(*****************************************************************************) +(* *) +(* SPDX-License-Identifier: MIT *) +(* Copyright (c) 2024 Nomadic Labs. *) +(* *) +(*****************************************************************************) + +open Gitlab_ci.Types +open Gitlab_ci.Util +open Tezos_ci +open Common + +type feature_flags_pipeline = Multichain | TE | Multichain_TE + +let job_build_x86_64_release = + job_build_dynamic_binaries ~__POS__ ~arch:Amd64 ~release:true () + +let job_build_x86_64_exp_dev_extra = + job_build_dynamic_binaries ~__POS__ ~arch:Amd64 ~release:false () + +let job_tezt_fetch_records = Tezt.job_tezt_fetch_records () + +let job_build_kernels = job_build_kernels () + +let jobs pipeline_type : tezos_job = + let dependencies = + Dependent + [ + Artifacts job_build_x86_64_release; + Artifacts job_build_x86_64_exp_dev_extra; + Artifacts job_build_kernels; + Artifacts job_tezt_fetch_records; + ] + in + Tezt.job + ~__POS__ + ~name:"tezt:feature-flags" + ~tezt_tests: + (match pipeline_type with + | Multichain -> + Tezt.tests_tag_selector [Has_tag "multichain"; Not (Has_tag "te")] + | TE -> Tezt.tests_tag_selector [Has_tag "te"; Not (Has_tag "multichain")] + | Multichain_TE -> + Tezt.tests_tag_selector [Or (Has_tag "te", Has_tag "multichain")]) + ~tezt_parallel:3 + ~parallel:(Vector 100) + ~timeout:(Minutes 40) + ~rules:[job_rule ~when_:Manual ()] + ~stage:Stages.manual + ~dependencies + () +(* We cannot include the coverage report as this would create a dependency with this test in the CI *) + +let jobs pipeline_type = + [ + job_build_x86_64_release; + job_build_x86_64_exp_dev_extra; + job_build_kernels; + job_tezt_fetch_records; + job_datadog_pipeline_trace; + jobs pipeline_type; + ] + +let child_pipeline_multichain = + Pipeline.register_child + "feature_flags_multichain" + ~description: + "A child pipeline of 'schedule_extended_test' for turning tezt tests \ + with the feature flag multichain." + ~jobs:(jobs Multichain) + +let child_pipeline_te = + Pipeline.register_child + "feature_flags_te" + ~description: + "A child pipeline of 'schedule_extended_test' for turning tezt tests \ + with the feature flag te." + ~jobs:(jobs TE) + +let child_pipeline_multichain_te = + Pipeline.register_child + "feature_flags_multichain_te" + ~description: + "A child pipeline of 'schedule_extended_test' for turning tezt tests \ + with the feature flag multichain or te." + ~jobs:(jobs Multichain_TE) diff --git a/etherlink/bin_node/lib_dev/kernel_config.ml b/etherlink/bin_node/lib_dev/kernel_config.ml index aecf5c942e8806cc6ffae69f71d456d9ffe453de..7708e28f7a7351c21f7c02d1bc73fa6fc5654bee 100644 --- a/etherlink/bin_node/lib_dev/kernel_config.ml +++ b/etherlink/bin_node/lib_dev/kernel_config.ml @@ -28,8 +28,8 @@ let make ~mainnet_compat ~boostrap_balance ?bootstrap_accounts ?kernel_root_hash ?da_fee_per_byte ?delayed_inbox_timeout ?delayed_inbox_min_levels ?sequencer_pool_address ?maximum_allowed_ticks ?maximum_gas_per_transaction ?max_blueprint_lookahead_in_seconds ?remove_whitelist ?enable_fa_bridge - ?enable_dal ?dal_slots ?set_account_code ?max_delayed_inbox_blueprint_length - ~output () = + ?enable_dal ?dal_slots ?enable_multichain ?set_account_code + ?max_delayed_inbox_blueprint_length ~output () = let bootstrap_accounts = match bootstrap_accounts with | None -> [] @@ -104,6 +104,7 @@ let make ~mainnet_compat ~boostrap_balance ?bootstrap_accounts ?kernel_root_hash @ make_instr ~path_prefix:"/evm/feature_flags/" enable_fa_bridge @ make_instr ~path_prefix:"/evm/feature_flags/" enable_dal @ make_instr ~convert:decimal_list_to_bytes dal_slots + @ make_instr ~path_prefix:"/evm/feature_flags/" enable_multichain @ make_instr ~convert:(fun s -> Ethereum_types.u16_to_bytes (int_of_string s)) max_delayed_inbox_blueprint_length diff --git a/etherlink/bin_node/lib_dev/kernel_config.mli b/etherlink/bin_node/lib_dev/kernel_config.mli index d3875a08f1b84740066bd09279a24967266f9b2f..503151a4a3daf929e856fc636b135aceb3475496 100644 --- a/etherlink/bin_node/lib_dev/kernel_config.mli +++ b/etherlink/bin_node/lib_dev/kernel_config.mli @@ -34,6 +34,7 @@ val make : ?enable_fa_bridge:string * string -> ?enable_dal:string * string -> ?dal_slots:string * string -> + ?enable_multichain:string * string -> ?set_account_code:(string * string) list -> ?max_delayed_inbox_blueprint_length:string * string -> output:string -> diff --git a/etherlink/bin_node/main.ml b/etherlink/bin_node/main.ml index 810f4837129b8d3c57ad6a2205b4853ad2be54f5..e10a342a01947b67129c6282183da014d9eadca6 100644 --- a/etherlink/bin_node/main.ml +++ b/etherlink/bin_node/main.ml @@ -1846,7 +1846,8 @@ let make_kernel_config_command = (config_key_flag ~name:"enable_fa_bridge") (config_key_flag ~name:"enable_dal") (config_key_arg ~name:"dal_slots" ~placeholder:"0,1,4,6,...")) - (args1 + (args2 + (config_key_flag ~name:"enable_multichain") (config_key_arg ~name:"max_delayed_inbox_blueprint_length" ~placeholder:"1000"))) @@ -1881,7 +1882,7 @@ let make_kernel_config_command = enable_fa_bridge, enable_dal, dal_slots ), - max_delayed_inbox_blueprint_length ) + (enable_multichain, max_delayed_inbox_blueprint_length) ) output () -> Evm_node_lib_dev.Kernel_config.make @@ -1909,6 +1910,7 @@ let make_kernel_config_command = ?enable_fa_bridge ?enable_dal ?dal_slots + ?enable_multichain ?set_account_code ?max_delayed_inbox_blueprint_length ~output diff --git a/etherlink/kernel_evm/kernel/src/storage.rs b/etherlink/kernel_evm/kernel/src/storage.rs index 50bfe821a69650048dfdc36d68adf602b3973466..3d6461c89fb31ed1fbe489ba6efadd69d409bd5d 100644 --- a/etherlink/kernel_evm/kernel/src/storage.rs +++ b/etherlink/kernel_evm/kernel/src/storage.rs @@ -107,6 +107,12 @@ pub const EVM_TRANSACTIONS_OBJECTS: RefPath = const EVM_CHAIN_ID: RefPath = RefPath::assert_from(b"/evm/chain_id"); +// Path to the Multichain feature flag. If there is nothing at this path, +// a single chain is used. +#[allow(dead_code)] +pub const ENABLE_MULTICHAIN: RefPath = + RefPath::assert_from(b"/evm/feature_flags/enable_multichain"); + const EVM_MINIMUM_BASE_FEE_PER_GAS: RefPath = RefPath::assert_from(b"/evm/world_state/fees/minimum_base_fee_per_gas"); const EVM_DA_FEE: RefPath = diff --git a/etherlink/tezt/lib/durable_storage_path.ml b/etherlink/tezt/lib/durable_storage_path.ml index a353b90717a434757534133d9cce30e16deb959d..44a44518948550e9346e5b771a44a1074f02941b 100644 --- a/etherlink/tezt/lib/durable_storage_path.ml +++ b/etherlink/tezt/lib/durable_storage_path.ml @@ -89,6 +89,8 @@ let reveal_config = "/__tmp/reveal_config" let enable_fa_bridge = evm "/feature_flags/enable_fa_bridge" +let enable_multichain = evm "/feature_flags/enable_multichain" + module Ticket_table = struct let ticket_table = sf diff --git a/etherlink/tezt/lib/durable_storage_path.mli b/etherlink/tezt/lib/durable_storage_path.mli index a2c7ad98be52bd535d72be6bef6330ab75a6585b..91d66ab4944321dd8ffc3e519afa94e782c06bf3 100644 --- a/etherlink/tezt/lib/durable_storage_path.mli +++ b/etherlink/tezt/lib/durable_storage_path.mli @@ -107,6 +107,9 @@ val reveal_config : path (** [enable_fa_bridge] is the path to the feature flag to activate the FA bridge. *) val enable_fa_bridge : path +(** [enable_multichain] is the path to the feature flag to activate multichain functions *) +val enable_multichain : path + module Ticket_table : sig (** [balance ~ticket_hash ~account] returns the path where the balance of [account] of ticket [ticket_hash] is. *) diff --git a/etherlink/tezt/lib/evm_node.ml b/etherlink/tezt/lib/evm_node.ml index 692008fc803df8846565ca75b4874dd7c11831b1..91bd09217885fe480b0bd69d884e53b65655d8a7 100644 --- a/etherlink/tezt/lib/evm_node.ml +++ b/etherlink/tezt/lib/evm_node.ml @@ -1590,7 +1590,7 @@ let make_kernel_installer_config ?max_delayed_inbox_blueprint_length ?maximum_gas_per_transaction ?(max_blueprint_lookahead_in_seconds = ten_years_in_seconds) ?(set_account_code = []) ?(enable_fa_bridge = false) ?(enable_dal = false) - ?dal_slots ~output () = + ?dal_slots ?(enable_multichain = false) ~output () = let set_account_code = List.flatten @@ List.map @@ -1649,6 +1649,7 @@ let make_kernel_installer_config ?max_delayed_inbox_blueprint_length Int64.to_string max_blueprint_lookahead_in_seconds; ] @ Cli_arg.optional_switch "enable-fa-bridge" enable_fa_bridge + @ Cli_arg.optional_switch "enable-multichain" enable_multichain @ Cli_arg.optional_switch "enable-dal" enable_dal @ Cli_arg.optional_arg "dal-slots" diff --git a/etherlink/tezt/lib/evm_node.mli b/etherlink/tezt/lib/evm_node.mli index 9191bdf6fbcc4c2aca9e5f74513e3b47e6ff228b..561ff06a939ba47d244f0ec4ae08f248aace4fa2 100644 --- a/etherlink/tezt/lib/evm_node.mli +++ b/etherlink/tezt/lib/evm_node.mli @@ -575,6 +575,7 @@ val make_kernel_installer_config : ?enable_fa_bridge:bool -> ?enable_dal:bool -> ?dal_slots:int list -> + ?enable_multichain:bool -> output:string -> unit -> (Process.t, unit) Runnable.t diff --git a/etherlink/tezt/lib/setup.ml b/etherlink/tezt/lib/setup.ml index 081c3fa8dddbf6468592a1a3091bc592a9fde4ca..ea171212c03873f1526111077bff929fffeedefc 100644 --- a/etherlink/tezt/lib/setup.ml +++ b/etherlink/tezt/lib/setup.ml @@ -31,6 +31,7 @@ type sequencer_setup = { boot_sector : string; kernel : Uses.t; enable_dal : bool; + enable_multichain : bool; } let uses _protocol = @@ -198,7 +199,7 @@ let setup_sequencer ?max_delayed_inbox_blueprint_length ?next_wasm_runtime ?max_blueprint_lookahead_in_seconds ?enable_fa_bridge ?(threshold_encryption = false) ?(drop_duplicate_when_injection = true) ?(blueprints_publisher_order_enabled = true) ?history_mode ~enable_dal - ?dal_slots ?rpc_server ?websockets protocol = + ?dal_slots ~enable_multichain ?rpc_server ?websockets protocol = let* node, client = setup_l1 ?commitment_period @@ -251,6 +252,7 @@ let setup_sequencer ?max_delayed_inbox_blueprint_length ?next_wasm_runtime ?maximum_gas_per_transaction ~enable_dal ?dal_slots + ~enable_multichain ?max_blueprint_lookahead_in_seconds ~bootstrap_accounts ~output:output_config @@ -369,6 +371,7 @@ let setup_sequencer ?max_delayed_inbox_blueprint_length ?next_wasm_runtime boot_sector = output; kernel; enable_dal; + enable_multichain; } (* Register a single variant of a test but for all protocols. *) @@ -383,8 +386,8 @@ let register_test ~__FILE__ ?max_delayed_inbox_blueprint_length ?enable_fa_bridge ?commitment_period ?challenge_window ?(threshold_encryption = false) ?(uses = uses) ?(additional_uses = []) ?history_mode ~enable_dal - ?(dal_slots = if enable_dal then Some [0; 1; 2; 3] else None) ?rpc_server - ?websockets body ~title ~tags protocols = + ?(dal_slots = if enable_dal then Some [0; 1; 2; 3] else None) + ~enable_multichain ?rpc_server ?websockets body ~title ~tags protocols = let kernel_tag, kernel_use = Kernel.to_uses_and_tags kernel in let tags = kernel_tag :: tags in let additional_uses = @@ -442,6 +445,7 @@ let register_test ~__FILE__ ?max_delayed_inbox_blueprint_length ?websockets ~enable_dal ?dal_slots + ~enable_multichain ?rpc_server protocol in @@ -453,15 +457,17 @@ let register_test ~__FILE__ ?max_delayed_inbox_blueprint_length (the DAL node) runs and it loads the full DAL SRS which takes non-negligible memory. *) @ (if enable_dal then ["dal"; Tag.memory_3k] else []) + @ (if enable_multichain then ["multichain"] else []) @ tags in let title = sf - "%s (%s, %s, %s)" + "%s (%s, %s, %s, %s)" title (if threshold_encryption then "te_sequencer" else "sequencer") kernel_tag (if enable_dal then "with dal" else "without dal") + (if enable_multichain then "multichain" else "single chain") in (* Only register DAL tests for supporting kernels *) if (not enable_dal) || Kernel.supports_dal kernel then @@ -484,7 +490,8 @@ let register_test_for_kernels ~__FILE__ ?max_delayed_inbox_blueprint_length ?maximum_allowed_ticks ?maximum_gas_per_transaction ?max_blueprint_lookahead_in_seconds ?enable_fa_bridge ?history_mode ?commitment_period ?challenge_window ?additional_uses ~threshold_encryption - ~enable_dal ?dal_slots ?rpc_server ?websockets ~title ~tags body protocols = + ~enable_dal ?dal_slots ~enable_multichain ?rpc_server ?websockets ~title + ~tags body protocols = List.iter (fun kernel -> register_test @@ -522,6 +529,7 @@ let register_test_for_kernels ~__FILE__ ?max_delayed_inbox_blueprint_length ?history_mode ~enable_dal ?dal_slots + ~enable_multichain ~title ~tags body diff --git a/etherlink/tezt/lib/setup.mli b/etherlink/tezt/lib/setup.mli index e01d71eb491089a765bd32390d04f22fee352685..99e4c045be26c09f3a3d44ede4984293b27fd14a 100644 --- a/etherlink/tezt/lib/setup.mli +++ b/etherlink/tezt/lib/setup.mli @@ -28,6 +28,7 @@ type sequencer_setup = { boot_sector : string; kernel : Uses.t; enable_dal : bool; + enable_multichain : bool; } (** [uses protocol] returns the list of dependencies for the tests. *) @@ -89,6 +90,7 @@ val register_test : ?history_mode:Sc_rollup_node.history_mode -> enable_dal:bool -> ?dal_slots:int list option -> + enable_multichain:bool -> ?rpc_server:Evm_node.rpc_server -> ?websockets:bool -> (sequencer_setup -> Protocol.t -> unit Lwt.t) -> @@ -133,6 +135,7 @@ val register_test_for_kernels : threshold_encryption:bool -> enable_dal:bool -> ?dal_slots:int list option -> + enable_multichain:bool -> ?rpc_server:Evm_node.rpc_server -> ?websockets:bool -> title:string -> @@ -176,6 +179,7 @@ val setup_sequencer : ?history_mode:Sc_rollup_node.history_mode -> enable_dal:bool -> ?dal_slots:int list -> + enable_multichain:bool -> ?rpc_server:Evm_node.rpc_server -> ?websockets:bool -> Protocol.t -> diff --git a/etherlink/tezt/tests/dal_sequencer.ml b/etherlink/tezt/tests/dal_sequencer.ml index a90489d2b92260673cbb1c025701830cefde340b..60894c8bc58874f2f5ddb168eba6c8e96a26fb72 100644 --- a/etherlink/tezt/tests/dal_sequencer.ml +++ b/etherlink/tezt/tests/dal_sequencer.ml @@ -27,6 +27,7 @@ let register_test = register_test_for_kernels ~__FILE__ ~enable_dal:true + ~enable_multichain:false ~threshold_encryption:false let count_event ?(get_count_from_event = fun _event -> 1) sequencer event diff --git a/etherlink/tezt/tests/eth_call.ml b/etherlink/tezt/tests/eth_call.ml index fa7955aa8808b12324beb9dbac860f60af419383..1da71e8d559e306f8452e006ff9c33b31c1f7239 100644 --- a/etherlink/tezt/tests/eth_call.ml +++ b/etherlink/tezt/tests/eth_call.ml @@ -35,6 +35,7 @@ let register ?genesis_timestamp ?bootstrap_accounts ?(kernels = Kernel.all) ?additional_uses ?history_mode ~enable_dal:false + ~enable_multichain:false ~threshold_encryption:false ~title ~tags diff --git a/etherlink/tezt/tests/evm_rollup.ml b/etherlink/tezt/tests/evm_rollup.ml index f95d6602ef4677d168dbb6bcf6e16971ac38de0b..9d0b4d13afdac1ec4c685d40a27a26b67aac2de2 100644 --- a/etherlink/tezt/tests/evm_rollup.ml +++ b/etherlink/tezt/tests/evm_rollup.ml @@ -310,7 +310,8 @@ let setup_evm_kernel ?additional_config ?(setup_kernel_root_hash = true) ?tx_pool_timeout_limit ?tx_pool_addr_limit ?tx_pool_tx_per_addr_limit ?max_number_of_chunks ?(setup_mode = Setup_proxy) ?(force_install_kernel = true) ?whitelist ?maximum_allowed_ticks - ?restricted_rpcs ?(enable_dal = false) ?dal_slots ?websockets protocol = + ?restricted_rpcs ?(enable_dal = false) ?dal_slots + ?(enable_multichain = false) ?websockets protocol = let _, kernel_installee = Kernel.to_uses_and_tags kernel in let* node, client = setup_l1 ?commitment_period ?challenge_window ?timestamp protocol @@ -383,6 +384,7 @@ let setup_evm_kernel ?additional_config ?(setup_kernel_root_hash = true) ?maximum_allowed_ticks ~output:output_config ~enable_dal + ~enable_multichain ?dal_slots () in @@ -526,8 +528,8 @@ let register_test ~title ~tags ?(kernels = Kernel.all) ?additional_config ?admin ?(additional_uses = []) ?commitment_period ?challenge_window ?bootstrap_accounts ?whitelist ?da_fee_per_byte ?minimum_base_fee_per_gas ?rollup_operator_key ?maximum_allowed_ticks ?restricted_rpcs ~setup_mode - ~enable_dal ?(dal_slots = if enable_dal then Some [4] else None) ?websockets - f protocols = + ~enable_dal ?(dal_slots = if enable_dal then Some [4] else None) + ~enable_multichain ?websockets f protocols = let extra_tag = match setup_mode with | Setup_proxy -> "proxy" @@ -550,15 +552,17 @@ let register_test ~title ~tags ?(kernels = Kernel.all) ?additional_config ?admin ~__FILE__ ~tags: ((if enable_dal then ["dal"; Tag.ci_disabled] else []) + @ (if enable_multichain then ["multichain"; Tag.ci_disabled] else []) @ (kernel_tag :: extra_tag :: tags)) ~uses ~title: (sf - "%s (%s, %s, %s)" + "%s (%s, %s, %s, %s)" title extra_tag kernel_tag - (if enable_dal then "with dal" else "without dal")) + (if enable_dal then "with dal" else "without dal") + (if enable_multichain then "multichain" else "single chain")) (fun protocol -> let* evm_setup = setup_evm_kernel @@ -577,6 +581,7 @@ let register_test ~title ~tags ?(kernels = Kernel.all) ?additional_config ?admin ~setup_mode ~enable_dal ?dal_slots + ~enable_multichain ?websockets protocol in @@ -588,7 +593,7 @@ let register_proxy ~title ~tags ?kernels ?additional_uses ?additional_config ?admin ?commitment_period ?challenge_window ?bootstrap_accounts ?da_fee_per_byte ?minimum_base_fee_per_gas ?whitelist ?rollup_operator_key ?maximum_allowed_ticks ?restricted_rpcs ?websockets f protocols = - let register ~enable_dal : unit = + let register ~enable_dal ~enable_multichain : unit = register_test ~title ~tags @@ -609,10 +614,13 @@ let register_proxy ~title ~tags ?kernels ?additional_uses ?additional_config f protocols ~enable_dal + ~enable_multichain ~setup_mode:Setup_proxy in - register ~enable_dal:false ; - register ~enable_dal:true + register ~enable_dal:false ~enable_multichain:false ; + register ~enable_dal:true ~enable_multichain:false ; + register ~enable_dal:false ~enable_multichain:true ; + register ~enable_dal:true ~enable_multichain:true let register_sequencer ?(return_sequencer = false) ~title ~tags ?kernels ?additional_uses ?additional_config ?admin ?commitment_period @@ -621,7 +629,7 @@ let register_sequencer ?(return_sequencer = false) ~title ~tags ?kernels ?rollup_operator_key ?maximum_allowed_ticks ?restricted_rpcs ?max_blueprints_ahead ?(block_storage_sqlite3 = false) ?websockets f protocols = - let register ~enable_dal : unit = + let register ~enable_dal ~enable_multichain : unit = register_test ~title ~tags @@ -642,6 +650,7 @@ let register_sequencer ?(return_sequencer = false) ~title ~tags ?kernels f protocols ~enable_dal + ~enable_multichain ~setup_mode: (Setup_sequencer { @@ -652,8 +661,10 @@ let register_sequencer ?(return_sequencer = false) ~title ~tags ?kernels block_storage_sqlite3; }) in - register ~enable_dal:false ; - register ~enable_dal:true + register ~enable_dal:false ~enable_multichain:false ; + register ~enable_dal:true ~enable_multichain:false ; + register ~enable_dal:false ~enable_multichain:true ; + register ~enable_dal:true ~enable_multichain:true let register_both ~title ~tags ?kernels ?additional_uses ?additional_config ?admin ?commitment_period ?challenge_window ?bootstrap_accounts diff --git a/etherlink/tezt/tests/evm_sequencer.ml b/etherlink/tezt/tests/evm_sequencer.ml index fbc844e25741ac687c4bfee4e2a439f82624a840..18bfa8d151455f38a1c740944066523451a8f5c9 100644 --- a/etherlink/tezt/tests/evm_sequencer.ml +++ b/etherlink/tezt/tests/evm_sequencer.ml @@ -209,6 +209,9 @@ let default_dal_registration = let ci_enabled_dal_registration = Register_both {extra_tags_with = []; extra_tags_without = []} +let default_multichain_registration = + Register_both {extra_tags_with = [Tag.slow]; extra_tags_without = []} + let register_sandbox ?tx_pool_tx_per_addr_limit ~title ?set_account_code ?da_fee_per_byte ?minimum_base_fee_per_gas ~tags ?patch_config body = Test.register @@ -248,7 +251,9 @@ let register_all ?max_delayed_inbox_blueprint_length ?block_storage_sqlite3 ?enable_fa_bridge ?history_mode ?commitment_period ?challenge_window ?additional_uses ?rpc_server ?websockets ?(use_threshold_encryption = default_threshold_encryption_registration) - ?(use_dal = default_dal_registration) ~title ~tags body protocols = + ?(use_dal = default_dal_registration) + ?(use_multichain = default_multichain_registration) ~title ~tags body + protocols = let dal_cases = match use_dal with | Register_both {extra_tags_with; extra_tags_without} -> @@ -263,50 +268,61 @@ let register_all ?max_delayed_inbox_blueprint_length ?block_storage_sqlite3 | Register_with_feature -> [(true, [])] | Register_without_feature -> [(false, [])] in + let multichain_cases = + match use_multichain with + | Register_both {extra_tags_with; extra_tags_without} -> + [(false, extra_tags_without); (true, extra_tags_with)] + | Register_with_feature -> [(true, [])] + | Register_without_feature -> [(false, [])] + in (* TODO: https://gitlab.com/tezos/tezos/-/issues/7367 Also register the tests with and without FA bridge feature flag. *) List.iter (fun (threshold_encryption, te_tags) -> List.iter (fun (enable_dal, dal_tags) -> - register_test_for_kernels - ~__FILE__ - ?max_delayed_inbox_blueprint_length - ?block_storage_sqlite3 - ?sequencer_rpc_port - ?sequencer_private_rpc_port - ?commitment_period - ?challenge_window - ?genesis_timestamp - ?time_between_blocks - ?max_blueprints_lag - ?max_blueprints_ahead - ?max_blueprints_catchup - ?catchup_cooldown - ?delayed_inbox_timeout - ?delayed_inbox_min_levels - ?max_number_of_chunks - ?bootstrap_accounts - ?sequencer - ?sequencer_pool_address - ~kernels - ?da_fee - ?minimum_base_fee_per_gas - ?preimages_dir - ?maximum_allowed_ticks - ?maximum_gas_per_transaction - ?max_blueprint_lookahead_in_seconds - ?enable_fa_bridge - ?additional_uses - ?rpc_server - ?websockets - ~threshold_encryption - ?history_mode - ~enable_dal - ~title - ~tags:(te_tags @ dal_tags @ tags) - body - protocols) + List.iter + (fun (enable_multichain, multichain_tags) -> + register_test_for_kernels + ~__FILE__ + ?max_delayed_inbox_blueprint_length + ?block_storage_sqlite3 + ?sequencer_rpc_port + ?sequencer_private_rpc_port + ?commitment_period + ?challenge_window + ?genesis_timestamp + ?time_between_blocks + ?max_blueprints_lag + ?max_blueprints_ahead + ?max_blueprints_catchup + ?catchup_cooldown + ?delayed_inbox_timeout + ?delayed_inbox_min_levels + ?max_number_of_chunks + ?bootstrap_accounts + ?sequencer + ?sequencer_pool_address + ~kernels + ?da_fee + ?minimum_base_fee_per_gas + ?preimages_dir + ?maximum_allowed_ticks + ?maximum_gas_per_transaction + ?max_blueprint_lookahead_in_seconds + ?enable_fa_bridge + ?additional_uses + ?rpc_server + ?websockets + ~threshold_encryption + ?history_mode + ~enable_dal + ~enable_multichain + ~title + ~tags:(te_tags @ dal_tags @ multichain_tags @ tags) + body + protocols) + multichain_cases) dal_cases) threshold_encryption_cases @@ -659,6 +675,7 @@ let test_patch_state = ~__FILE__ ~kernel:Kernel.Latest ~enable_dal:false + ~enable_multichain:false ~tags:["evm"; "patch"; "state"] ~title:"Patch state via command" ~time_between_blocks:Nothing @@ -3279,6 +3296,7 @@ let test_delayed_inbox_flushing_event = ~title:"Flush delayed inbox event" ~use_dal:Register_without_feature ~use_threshold_encryption:Register_without_feature + ~use_multichain:Register_without_feature ~kernels:[Latest] @@ fun { client; @@ -7856,6 +7874,22 @@ let test_fa_bridge_feature_flag = Durable_storage_path.enable_fa_bridge) ; unit +let test_multichain_feature_flag = + register_all + ~tags:["feature_flag"] + ~title:"Check the multichain feature value in storage" + @@ fun {sequencer; enable_multichain; _} _protocol -> + let*@ flag = + Rpc.state_value sequencer Durable_storage_path.enable_multichain + in + Check.is_true + (Option.is_some flag = enable_multichain) + ~error_msg: + (sf + "Expected to have a value at %s" + Durable_storage_path.enable_multichain) ; + unit + let test_trace_call = register_all ~kernels:[Latest] @@ -8774,7 +8808,11 @@ let test_configuration_service = ]) @@ fun protocol -> let* {sequencer; proxy; observer; _} = - Setup.setup_sequencer ~mainnet_compat:false ~enable_dal:false protocol + Setup.setup_sequencer + ~mainnet_compat:false + ~enable_dal:false + ~enable_multichain:false + protocol in let* proxy_config = Rpc.configuration proxy in let* sequencer_config = Rpc.configuration sequencer in @@ -9296,6 +9334,7 @@ let test_node_correctly_uses_batcher_heap = ~__FILE__ ~kernel:Kernel.Latest ~enable_dal:false + ~enable_multichain:false ~max_blueprints_lag ~max_blueprints_catchup ~catchup_cooldown @@ -9771,6 +9810,7 @@ let () = test_trace_transaction_call protocols ; test_miner protocols ; test_fa_bridge_feature_flag protocols ; + test_multichain_feature_flag protocols ; test_trace_call protocols ; test_trace_empty_block protocols ; test_trace_block protocols ; diff --git a/etherlink/tezt/tests/expected/evm_sequencer.ml/EVM Node- man.out b/etherlink/tezt/tests/expected/evm_sequencer.ml/EVM Node- man.out index 0e10a2263fb642d9fbb7ea53a807b21df6850dc2..55a3cd9904298a2dd2a1fe8322d9cafb011679ff 100644 --- a/etherlink/tezt/tests/expected/evm_sequencer.ml/EVM Node- man.out +++ b/etherlink/tezt/tests/expected/evm_sequencer.ml/EVM Node- man.out @@ -411,7 +411,7 @@ Miscellaneous commands: [--bootstrap-balance <9999000000000000000000>] [--bootstrap-account <0x...>] [--set-code <0x...,0x....>] [--enable-fa-bridge] [--enable-dal] [--dal-slots <0,1,4,6,...>] - [--max-delayed-inbox-blueprint-length <1000>] + [--enable-multichain] [--max-delayed-inbox-blueprint-length <1000>] Transforms the JSON list of instructions to a RLP list : file path where the config will be written to --mainnet-compat: Generate a configuration compatible with the first Etherlink Mainnet kernel @@ -439,6 +439,7 @@ Miscellaneous commands: --enable-fa-bridge: enable flag enable_fa_bridge in the installer config --enable-dal: enable flag enable_dal in the installer config --dal-slots <0,1,4,6,...>: value for dal_slots in the installer config + --enable-multichain: enable flag enable_multichain in the installer config --max-delayed-inbox-blueprint-length <1000>: value for max_delayed_inbox_blueprint_length in the installer config patch state at with [--data-dir ]