From 29589407f9fa9982bf58aa6d57325915b0d66bf8 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Tue, 9 Jan 2024 14:05:20 +0300 Subject: [PATCH 001/136] test coverage Signed-off-by: Nikita Zaporozhets --- housekeeping/coverage.sh | 4 ++-- housekeeping/docker/env/Dockerfile | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/housekeeping/coverage.sh b/housekeeping/coverage.sh index 8e2ebc8630..f397fc85b4 100755 --- a/housekeeping/coverage.sh +++ b/housekeeping/coverage.sh @@ -4,7 +4,7 @@ export RUSTFLAGS="-Cinstrument-coverage" export SKIP_WASM_BUILD=1 export LLVM_PROFILE_FILE="sora2-%p-%m.profraw" -cargo test --features private-net +cargo test --features private-net,ready-to-test,wip -grcov . --binary-path ./target/debug -s . -t cobertura --branch -o ./cobertura_report --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" +grcov . --binary-path ./target/debug -s . -t html --branch -o ./cobertura_report --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" find . -type f -name '*.profraw' -delete diff --git a/housekeeping/docker/env/Dockerfile b/housekeeping/docker/env/Dockerfile index d8e32885d2..34f621ec8e 100644 --- a/housekeeping/docker/env/Dockerfile +++ b/housekeeping/docker/env/Dockerfile @@ -44,11 +44,11 @@ RUN add-apt-repository \ rm -rf /var/lib/apt/lists/* # Install rust -ENV RUST_NIGHTLY_VERSION=nightly-2023-03-21 +ENV RUST_VERSION=1.73.0 RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --no-modify-path --default-toolchain stable && \ - rustup toolchain install ${RUST_NIGHTLY_VERSION} && \ + rustup toolchain install ${RUST_VERSION} && \ rustup target add wasm32-unknown-unknown && \ - rustup target add wasm32-unknown-unknown --toolchain ${RUST_NIGHTLY_VERSION} && \ + rustup target add wasm32-unknown-unknown --toolchain ${RUST_VERSION} && \ rm -rf "${CARGO_HOME}/registry" "${CARGO_HOME}/git" RUN curl https://github.com/chevdor/subwasm/releases/download/v0.17.0/subwasm_linux_amd64_v0.17.0.deb -sSL -o subw.deb && \ From 3551dfdb602650d154367e94660a632ed03e34e3 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Tue, 9 Jan 2024 14:07:48 +0300 Subject: [PATCH 002/136] fix nightly Signed-off-by: Nikita Zaporozhets --- housekeeping/docker/env/Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/housekeeping/docker/env/Dockerfile b/housekeeping/docker/env/Dockerfile index 34f621ec8e..dca5bea4a6 100644 --- a/housekeeping/docker/env/Dockerfile +++ b/housekeeping/docker/env/Dockerfile @@ -44,11 +44,11 @@ RUN add-apt-repository \ rm -rf /var/lib/apt/lists/* # Install rust -ENV RUST_VERSION=1.73.0 +ENV RUST_NIGHTLY_VERSION=nightly-2024-01-09 RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --no-modify-path --default-toolchain stable && \ - rustup toolchain install ${RUST_VERSION} && \ + rustup toolchain install ${RUST_NIGHTLY_VERSION} && \ rustup target add wasm32-unknown-unknown && \ - rustup target add wasm32-unknown-unknown --toolchain ${RUST_VERSION} && \ + rustup target add wasm32-unknown-unknown --toolchain ${RUST_NIGHTLY_VERSION} && \ rm -rf "${CARGO_HOME}/registry" "${CARGO_HOME}/git" RUN curl https://github.com/chevdor/subwasm/releases/download/v0.17.0/subwasm_linux_amd64_v0.17.0.deb -sSL -o subw.deb && \ From 6616d62e8c70c19d260c15473090d73554733cb7 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Tue, 9 Jan 2024 14:19:25 +0300 Subject: [PATCH 003/136] fix envs Signed-off-by: Nikita Zaporozhets --- .dockerignore | 1 + .gitignore | 2 ++ bridge-docker/docker-compose.evm.yml | 4 ++-- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.dockerignore b/.dockerignore index 4200b300ab..8e1e035a44 100644 --- a/.dockerignore +++ b/.dockerignore @@ -14,3 +14,4 @@ housekeeping LICENSE rustfmt.toml db* +.env diff --git a/.gitignore b/.gitignore index 13f0ddb37f..88ec5cc2f1 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,5 @@ db? # Generated folder for benchmark results (order book extra benchmarks) benches/ + +.env \ No newline at end of file diff --git a/bridge-docker/docker-compose.evm.yml b/bridge-docker/docker-compose.evm.yml index e43696836c..30896ef3fb 100644 --- a/bridge-docker/docker-compose.evm.yml +++ b/bridge-docker/docker-compose.evm.yml @@ -142,7 +142,7 @@ services: ports: - "8081:8081" environment: - - DATABASE_URL=postgres://postgres:postgres@bridge-postgres:5432/postgres?sslmode=disable + - DATABASE_URL=${DATABASE_URL} depends_on: - postgres networks: @@ -168,7 +168,7 @@ services: ETHEREUM_JSONRPC_VARIANT: 'geth' BLOCK_TRANSFORMER: 'base' ETHEREUM_JSONRPC_HTTP_URL: http://bridge-geth:8545/ - DATABASE_URL: postgresql://postgres:@bridge-postgres:5432/postgres?ssl=false + DATABASE_URL: ${DATABASE_URL} ECTO_USE_SSL: 'false' SECRET_KEY_BASE: '56NtB48ear7+wMSf0IQuWDAAazhpb31qyc7GiyspBP2vh7t5zlCsF5QDv76chXeN' ports: From b2aecd4ca5eec4eb353900af52a24d37dd02c7d3 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Tue, 9 Jan 2024 14:21:33 +0300 Subject: [PATCH 004/136] disable clippy Signed-off-by: Nikita Zaporozhets --- Jenkinsfile-env | 1 + 1 file changed, 1 insertion(+) diff --git a/Jenkinsfile-env b/Jenkinsfile-env index 02e25ee8cd..090426f426 100644 --- a/Jenkinsfile-env +++ b/Jenkinsfile-env @@ -8,5 +8,6 @@ def pipeline = new org.docker.AppPipeline(steps: this, triggerCommonBuildGrepRegex: 'housekeeping', secretScannerExclusion: '.*Cargo.toml', nameCI: 'env-CI', + clippyLinter: false, dockerImageTags: ['substrate-4.0.0':'sub4']) pipeline.runPipeline() From 390c787195b99f16a78c2c79d8e7826fcc5618da Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Tue, 9 Jan 2024 14:37:27 +0300 Subject: [PATCH 005/136] fix Signed-off-by: Nikita Zaporozhets --- Jenkinsfile | 1 + Jenkinsfile-env | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index f8608eaff5..04a8f511e3 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -7,6 +7,7 @@ def pipeline = new org.rust.AppPipeline(steps: this, codeCoverageCommand: './housekeeping/coverage.sh', cargoDoc: true, smartContractScanner: false, + clippyLinter: false, cargoClippyTag: ':substrate', cargoClippyCmds: ['housekeeping/clippy.sh'], buildTestCmds: ['housekeeping/build.sh'], diff --git a/Jenkinsfile-env b/Jenkinsfile-env index 090426f426..02e25ee8cd 100644 --- a/Jenkinsfile-env +++ b/Jenkinsfile-env @@ -8,6 +8,5 @@ def pipeline = new org.docker.AppPipeline(steps: this, triggerCommonBuildGrepRegex: 'housekeeping', secretScannerExclusion: '.*Cargo.toml', nameCI: 'env-CI', - clippyLinter: false, dockerImageTags: ['substrate-4.0.0':'sub4']) pipeline.runPipeline() From b3560f30dfd82c2f284d2fcc462625cc90198dfb Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Thu, 11 Jan 2024 13:37:07 +0300 Subject: [PATCH 006/136] test library Signed-off-by: Nikita Zaporozhets --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 04a8f511e3..f00ab1e185 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,4 +1,4 @@ -@Library('jenkins-library') _ +@Library('jenkins-library@feature/dops-2942') _ def pipeline = new org.rust.AppPipeline(steps: this, initSubmodules: true, From 54ab3e8884016146406061ce98278c30e8107187 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Thu, 11 Jan 2024 13:49:57 +0300 Subject: [PATCH 007/136] make fail when coverage with errors Signed-off-by: Nikita Zaporozhets --- housekeeping/coverage.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/housekeeping/coverage.sh b/housekeeping/coverage.sh index f397fc85b4..88ef6cd49e 100755 --- a/housekeeping/coverage.sh +++ b/housekeeping/coverage.sh @@ -7,4 +7,10 @@ export LLVM_PROFILE_FILE="sora2-%p-%m.profraw" cargo test --features private-net,ready-to-test,wip grcov . --binary-path ./target/debug -s . -t html --branch -o ./cobertura_report --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" + +# Check coverage errors +if [ $? -eq 1 ]; then + exit 1 +fi + find . -type f -name '*.profraw' -delete From 51fa2706a483c2e931074c8ce35ef633273e8399 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Thu, 11 Jan 2024 15:17:18 +0300 Subject: [PATCH 008/136] fix env Signed-off-by: Nikita Zaporozhets --- Jenkinsfile | 2 +- Jenkinsfile-env | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index f00ab1e185..2189353555 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -2,7 +2,7 @@ def pipeline = new org.rust.AppPipeline(steps: this, initSubmodules: true, - envImageName: 'docker.soramitsu.co.jp/sora2/env:sub4', + envImageName: 'docker.soramitsu.co.jp/sora2/env:env', appImageName: 'docker.soramitsu.co.jp/sora2/substrate', codeCoverageCommand: './housekeeping/coverage.sh', cargoDoc: true, diff --git a/Jenkinsfile-env b/Jenkinsfile-env index 02e25ee8cd..5cde599845 100644 --- a/Jenkinsfile-env +++ b/Jenkinsfile-env @@ -4,9 +4,9 @@ def pipeline = new org.docker.AppPipeline(steps: this, dockerImageName: 'sora2/env', dockerRegistryCred: 'bot-sora2-rw', dockerFileName: "housekeeping/docker/env/Dockerfile", - triggerCommonBuildExpression: (env.BRANCH_NAME in ['substrate-4.0.0']), + // triggerCommonBuildExpression: (env.BRANCH_NAME in ['substrate-4.0.0']), triggerCommonBuildGrepRegex: 'housekeeping', secretScannerExclusion: '.*Cargo.toml', nameCI: 'env-CI', - dockerImageTags: ['substrate-4.0.0':'sub4']) + dockerImageTags: ['master': 'env', 'develop': 'env', 'feature/dops-2942': 'env']) pipeline.runPipeline() From f8b05874b0567133d33c2682899239e191098726 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Thu, 11 Jan 2024 15:20:10 +0300 Subject: [PATCH 009/136] fix secrets Signed-off-by: Nikita Zaporozhets --- bridge-docker/docker-compose.evm.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bridge-docker/docker-compose.evm.yml b/bridge-docker/docker-compose.evm.yml index 30896ef3fb..a8fa310702 100644 --- a/bridge-docker/docker-compose.evm.yml +++ b/bridge-docker/docker-compose.evm.yml @@ -170,7 +170,7 @@ services: ETHEREUM_JSONRPC_HTTP_URL: http://bridge-geth:8545/ DATABASE_URL: ${DATABASE_URL} ECTO_USE_SSL: 'false' - SECRET_KEY_BASE: '56NtB48ear7+wMSf0IQuWDAAazhpb31qyc7GiyspBP2vh7t5zlCsF5QDv76chXeN' + SECRET_KEY_BASE: ${SECRET_KEY_BASE} ports: - 4000:4000 networks: From 5194bece7c7f8110f4cce6490c5c7de759bdb791 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Thu, 11 Jan 2024 16:07:28 +0300 Subject: [PATCH 010/136] fix env Signed-off-by: Nikita Zaporozhets --- Jenkinsfile-env | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile-env b/Jenkinsfile-env index 5cde599845..0474074cb5 100644 --- a/Jenkinsfile-env +++ b/Jenkinsfile-env @@ -4,9 +4,9 @@ def pipeline = new org.docker.AppPipeline(steps: this, dockerImageName: 'sora2/env', dockerRegistryCred: 'bot-sora2-rw', dockerFileName: "housekeeping/docker/env/Dockerfile", - // triggerCommonBuildExpression: (env.BRANCH_NAME in ['substrate-4.0.0']), + triggerCommonBuildExpression: (env.BRANCH_NAME in ['develop', 'master']), triggerCommonBuildGrepRegex: 'housekeeping', secretScannerExclusion: '.*Cargo.toml', nameCI: 'env-CI', - dockerImageTags: ['master': 'env', 'develop': 'env', 'feature/dops-2942': 'env']) + dockerImageTags: ['master': 'env', 'develop': 'env']) pipeline.runPipeline() From fc6cb8c1c0993d3996b01d4f2e9003e30d2179e6 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Thu, 11 Jan 2024 17:22:24 +0300 Subject: [PATCH 011/136] test env image Signed-off-by: Nikita Zaporozhets --- Jenkinsfile-env | 4 ++-- housekeeping/docker/env/Dockerfile | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile-env b/Jenkinsfile-env index 0474074cb5..cbae9d88ab 100644 --- a/Jenkinsfile-env +++ b/Jenkinsfile-env @@ -4,9 +4,9 @@ def pipeline = new org.docker.AppPipeline(steps: this, dockerImageName: 'sora2/env', dockerRegistryCred: 'bot-sora2-rw', dockerFileName: "housekeeping/docker/env/Dockerfile", - triggerCommonBuildExpression: (env.BRANCH_NAME in ['develop', 'master']), + // triggerCommonBuildExpression: (env.BRANCH_NAME in ['develop', 'master']), triggerCommonBuildGrepRegex: 'housekeeping', secretScannerExclusion: '.*Cargo.toml', nameCI: 'env-CI', - dockerImageTags: ['master': 'env', 'develop': 'env']) + dockerImageTags: ['master': 'env', 'develop': 'env', 'feature/dops-2942': 'env']) pipeline.runPipeline() diff --git a/housekeeping/docker/env/Dockerfile b/housekeeping/docker/env/Dockerfile index dca5bea4a6..30c4c2ba16 100644 --- a/housekeeping/docker/env/Dockerfile +++ b/housekeeping/docker/env/Dockerfile @@ -45,7 +45,7 @@ RUN add-apt-repository \ # Install rust ENV RUST_NIGHTLY_VERSION=nightly-2024-01-09 -RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --no-modify-path --default-toolchain stable && \ +RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --no-modify-path --default-toolchain ${RUST_NIGHTLY_VERSION} && \ rustup toolchain install ${RUST_NIGHTLY_VERSION} && \ rustup target add wasm32-unknown-unknown && \ rustup target add wasm32-unknown-unknown --toolchain ${RUST_NIGHTLY_VERSION} && \ From 24d4ea8c62998846707c2f1aa4ffd50d9b19c19f Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Thu, 11 Jan 2024 18:42:24 +0300 Subject: [PATCH 012/136] debug Signed-off-by: Nikita Zaporozhets --- housekeeping/coverage.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/housekeeping/coverage.sh b/housekeeping/coverage.sh index 88ef6cd49e..db8b5675d9 100755 --- a/housekeeping/coverage.sh +++ b/housekeeping/coverage.sh @@ -4,6 +4,8 @@ export RUSTFLAGS="-Cinstrument-coverage" export SKIP_WASM_BUILD=1 export LLVM_PROFILE_FILE="sora2-%p-%m.profraw" +rustup component list + cargo test --features private-net,ready-to-test,wip grcov . --binary-path ./target/debug -s . -t html --branch -o ./cobertura_report --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" From 16343755ca16fcf003e8276d4c7bba3c5f086d59 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Thu, 11 Jan 2024 18:44:38 +0300 Subject: [PATCH 013/136] debug2 Signed-off-by: Nikita Zaporozhets --- housekeeping/coverage.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/housekeeping/coverage.sh b/housekeeping/coverage.sh index db8b5675d9..ee6a8f42c3 100755 --- a/housekeeping/coverage.sh +++ b/housekeeping/coverage.sh @@ -4,8 +4,12 @@ export RUSTFLAGS="-Cinstrument-coverage" export SKIP_WASM_BUILD=1 export LLVM_PROFILE_FILE="sora2-%p-%m.profraw" +echo 'component list:' rustup component list +echo 'toolchain list:' +rustup toolchain list + cargo test --features private-net,ready-to-test,wip grcov . --binary-path ./target/debug -s . -t html --branch -o ./cobertura_report --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" From 45685d77d660b91aaae341e8721d9c79443989be Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Thu, 11 Jan 2024 19:46:05 +0300 Subject: [PATCH 014/136] debug3 Signed-off-by: Nikita Zaporozhets --- housekeeping/coverage.sh | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/housekeeping/coverage.sh b/housekeeping/coverage.sh index ee6a8f42c3..cd4b344471 100755 --- a/housekeeping/coverage.sh +++ b/housekeeping/coverage.sh @@ -1,15 +1,9 @@ #!/bin/sh - +pofrw=$(find . -name 'sora2-*.profraw') export RUSTFLAGS="-Cinstrument-coverage" export SKIP_WASM_BUILD=1 -export LLVM_PROFILE_FILE="sora2-%p-%m.profraw" - -echo 'component list:' -rustup component list - -echo 'toolchain list:' -rustup toolchain list - +export LLVM_PROFILE_FILE="$pofrw" +whereis llvm-profdata cargo test --features private-net,ready-to-test,wip grcov . --binary-path ./target/debug -s . -t html --branch -o ./cobertura_report --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" From 2e684ffde47aaffa2303917a06fedc97159547e7 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Thu, 11 Jan 2024 19:51:47 +0300 Subject: [PATCH 015/136] fix debug3 Signed-off-by: Nikita Zaporozhets --- housekeeping/coverage.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/housekeeping/coverage.sh b/housekeeping/coverage.sh index cd4b344471..1206d5ffc8 100755 --- a/housekeeping/coverage.sh +++ b/housekeeping/coverage.sh @@ -1,11 +1,15 @@ #!/bin/sh -pofrw=$(find . -name 'sora2-*.profraw') + export RUSTFLAGS="-Cinstrument-coverage" export SKIP_WASM_BUILD=1 -export LLVM_PROFILE_FILE="$pofrw" + whereis llvm-profdata + cargo test --features private-net,ready-to-test,wip +profraw=$(find . -name 'sora2-*.profraw') +export LLVM_PROFILE_FILE="$profraw" + grcov . --binary-path ./target/debug -s . -t html --branch -o ./cobertura_report --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" # Check coverage errors From 079af82a0e384c03b0afc15c2792b7a1fde173b3 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Fri, 12 Jan 2024 10:20:31 +0300 Subject: [PATCH 016/136] debug4 Signed-off-by: Nikita Zaporozhets --- housekeeping/coverage.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/housekeeping/coverage.sh b/housekeeping/coverage.sh index 1206d5ffc8..c74c26be8f 100755 --- a/housekeeping/coverage.sh +++ b/housekeeping/coverage.sh @@ -2,13 +2,12 @@ export RUSTFLAGS="-Cinstrument-coverage" export SKIP_WASM_BUILD=1 - -whereis llvm-profdata +export LLVM_PROFILE_FILE="sora2-%p-%m.profraw" +profraw=$(find . -name 'sora2-*.profraw' cargo test --features private-net,ready-to-test,wip -profraw=$(find . -name 'sora2-*.profraw') -export LLVM_PROFILE_FILE="$profraw" +echo "Profraw files here: $profraw" grcov . --binary-path ./target/debug -s . -t html --branch -o ./cobertura_report --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" From 225c886713d91f1e858bd7dc9257334feba6764d Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Fri, 12 Jan 2024 10:38:59 +0300 Subject: [PATCH 017/136] revert to old toolchain Signed-off-by: Nikita Zaporozhets --- housekeeping/docker/env/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/housekeeping/docker/env/Dockerfile b/housekeeping/docker/env/Dockerfile index 30c4c2ba16..fadd9dbeb8 100644 --- a/housekeeping/docker/env/Dockerfile +++ b/housekeeping/docker/env/Dockerfile @@ -44,7 +44,7 @@ RUN add-apt-repository \ rm -rf /var/lib/apt/lists/* # Install rust -ENV RUST_NIGHTLY_VERSION=nightly-2024-01-09 +ENV RUST_NIGHTLY_VERSION=nightly-2023-03-21 RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --no-modify-path --default-toolchain ${RUST_NIGHTLY_VERSION} && \ rustup toolchain install ${RUST_NIGHTLY_VERSION} && \ rustup target add wasm32-unknown-unknown && \ From f8ec10cd66f183fa842a5aa7906d35d8887ff2e7 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Fri, 12 Jan 2024 10:57:33 +0300 Subject: [PATCH 018/136] fix debug Signed-off-by: Nikita Zaporozhets --- housekeeping/coverage.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/housekeeping/coverage.sh b/housekeeping/coverage.sh index c74c26be8f..5f16ee6c02 100755 --- a/housekeeping/coverage.sh +++ b/housekeeping/coverage.sh @@ -3,7 +3,7 @@ export RUSTFLAGS="-Cinstrument-coverage" export SKIP_WASM_BUILD=1 export LLVM_PROFILE_FILE="sora2-%p-%m.profraw" -profraw=$(find . -name 'sora2-*.profraw' +profraw=$(find . -name 'sora2-*.profraw') cargo test --features private-net,ready-to-test,wip From f42a4b1fe54eb83ece11f9dcf1b5f77138b0790a Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Fri, 12 Jan 2024 14:39:19 +0300 Subject: [PATCH 019/136] test dockerfile Signed-off-by: Nikita Zaporozhets --- housekeeping/coverage.sh | 2 +- housekeeping/docker/env/Dockerfile | 12 +++++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/housekeeping/coverage.sh b/housekeeping/coverage.sh index 5f16ee6c02..678a7f774c 100755 --- a/housekeeping/coverage.sh +++ b/housekeeping/coverage.sh @@ -3,7 +3,7 @@ export RUSTFLAGS="-Cinstrument-coverage" export SKIP_WASM_BUILD=1 export LLVM_PROFILE_FILE="sora2-%p-%m.profraw" -profraw=$(find . -name 'sora2-*.profraw') +profraw=$(find . -name 'sora2-*.profraw')' cargo test --features private-net,ready-to-test,wip diff --git a/housekeeping/docker/env/Dockerfile b/housekeeping/docker/env/Dockerfile index fadd9dbeb8..cb0bcf22a6 100644 --- a/housekeeping/docker/env/Dockerfile +++ b/housekeeping/docker/env/Dockerfile @@ -7,6 +7,8 @@ ENV PATH="$PATH:$CARGO_HOME/bin" ENV CARGO_BUILD_DEP_INFO_BASEDIR="." ENV CC=clang-13 ENV CXX=clang++-13 +ENV RUST_NIGHTLY_VERSION=nightly-2023-03-21 +ENV DEBIAN_FRONTEND=noninteractive # Install dependencies RUN apt-get update && \ @@ -44,16 +46,12 @@ RUN add-apt-repository \ rm -rf /var/lib/apt/lists/* # Install rust -ENV RUST_NIGHTLY_VERSION=nightly-2023-03-21 RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --no-modify-path --default-toolchain ${RUST_NIGHTLY_VERSION} && \ rustup toolchain install ${RUST_NIGHTLY_VERSION} && \ rustup target add wasm32-unknown-unknown && \ rustup target add wasm32-unknown-unknown --toolchain ${RUST_NIGHTLY_VERSION} && \ - rm -rf "${CARGO_HOME}/registry" "${CARGO_HOME}/git" - -RUN curl https://github.com/chevdor/subwasm/releases/download/v0.17.0/subwasm_linux_amd64_v0.17.0.deb -sSL -o subw.deb && \ - dpkg -i subw.deb && rm subw.deb - -RUN cargo install grcov && \ + curl https://github.com/chevdor/subwasm/releases/download/v0.17.0/subwasm_linux_amd64_v0.17.0.deb -sSL -o subw.deb && \ + dpkg -i subw.deb && rm subw.deb && \ rustup component add llvm-tools-preview && \ + cargo install grcov && \ rm -rf "${CARGO_HOME}/registry" "${CARGO_HOME}/git" From bd44c8ef5404c5c96330f3eda292033a35ab3d6e Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Fri, 12 Jan 2024 15:05:29 +0300 Subject: [PATCH 020/136] test dockerfile Signed-off-by: Nikita Zaporozhets --- housekeeping/coverage.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/housekeeping/coverage.sh b/housekeeping/coverage.sh index 678a7f774c..cb3568380d 100755 --- a/housekeeping/coverage.sh +++ b/housekeeping/coverage.sh @@ -2,8 +2,8 @@ export RUSTFLAGS="-Cinstrument-coverage" export SKIP_WASM_BUILD=1 -export LLVM_PROFILE_FILE="sora2-%p-%m.profraw" -profraw=$(find . -name 'sora2-*.profraw')' +export LLVM_PROFILE_FILE=sora2-%p-%m.profraw +profraw=$(find . -name '*.profraw') cargo test --features private-net,ready-to-test,wip From b50a122d026c2a085cb74576ad7c6a6211da302d Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Fri, 12 Jan 2024 15:35:41 +0300 Subject: [PATCH 021/136] test dockerfile and debug5 Signed-off-by: Nikita Zaporozhets --- housekeeping/coverage.sh | 2 +- housekeeping/docker/env/Dockerfile | 15 +++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/housekeeping/coverage.sh b/housekeeping/coverage.sh index cb3568380d..fff44b07b5 100755 --- a/housekeeping/coverage.sh +++ b/housekeeping/coverage.sh @@ -2,7 +2,7 @@ export RUSTFLAGS="-Cinstrument-coverage" export SKIP_WASM_BUILD=1 -export LLVM_PROFILE_FILE=sora2-%p-%m.profraw +export LLVM_PROFILE_FILE="sora2-%p-%m.profraw" profraw=$(find . -name '*.profraw') cargo test --features private-net,ready-to-test,wip diff --git a/housekeeping/docker/env/Dockerfile b/housekeeping/docker/env/Dockerfile index cb0bcf22a6..fa8a5f1c6d 100644 --- a/housekeeping/docker/env/Dockerfile +++ b/housekeeping/docker/env/Dockerfile @@ -7,8 +7,6 @@ ENV PATH="$PATH:$CARGO_HOME/bin" ENV CARGO_BUILD_DEP_INFO_BASEDIR="." ENV CC=clang-13 ENV CXX=clang++-13 -ENV RUST_NIGHTLY_VERSION=nightly-2023-03-21 -ENV DEBIAN_FRONTEND=noninteractive # Install dependencies RUN apt-get update && \ @@ -46,12 +44,17 @@ RUN add-apt-repository \ rm -rf /var/lib/apt/lists/* # Install rust +ENV RUST_NIGHTLY_VERSION=nightly-2024-01-09 +ENV RUST_GRCOV_VERSION=nightly-2023-03-21 RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --no-modify-path --default-toolchain ${RUST_NIGHTLY_VERSION} && \ rustup toolchain install ${RUST_NIGHTLY_VERSION} && \ rustup target add wasm32-unknown-unknown && \ rustup target add wasm32-unknown-unknown --toolchain ${RUST_NIGHTLY_VERSION} && \ - curl https://github.com/chevdor/subwasm/releases/download/v0.17.0/subwasm_linux_amd64_v0.17.0.deb -sSL -o subw.deb && \ - dpkg -i subw.deb && rm subw.deb && \ - rustup component add llvm-tools-preview && \ - cargo install grcov && \ + rm -rf "${CARGO_HOME}/registry" "${CARGO_HOME}/git" + +RUN curl https://github.com/chevdor/subwasm/releases/download/v0.17.0/subwasm_linux_amd64_v0.17.0.deb -sSL -o subw.deb && \ + dpkg -i subw.deb && rm subw.deb + +RUN cargo install grcov && \ + rustup component add llvm-tools-preview --toolchain ${RUST_GRCOV_VERSION} && \ rm -rf "${CARGO_HOME}/registry" "${CARGO_HOME}/git" From 6888872dae453f9948801877cf328bf0c37f23be Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Fri, 12 Jan 2024 16:09:01 +0300 Subject: [PATCH 022/136] test Signed-off-by: Nikita Zaporozhets --- housekeeping/coverage.sh | 4 +- housekeeping/docker/env/Dockerfile | 20 +++------ housekeeping/docker/env/Dockerfile.old | 59 ++++++++++++++++++++++++++ 3 files changed, 66 insertions(+), 17 deletions(-) create mode 100644 housekeeping/docker/env/Dockerfile.old diff --git a/housekeeping/coverage.sh b/housekeeping/coverage.sh index fff44b07b5..7c22787324 100755 --- a/housekeeping/coverage.sh +++ b/housekeeping/coverage.sh @@ -3,7 +3,7 @@ export RUSTFLAGS="-Cinstrument-coverage" export SKIP_WASM_BUILD=1 export LLVM_PROFILE_FILE="sora2-%p-%m.profraw" -profraw=$(find . -name '*.profraw') +profraw=$(find . -type f -name '*.profraw') cargo test --features private-net,ready-to-test,wip @@ -16,4 +16,4 @@ if [ $? -eq 1 ]; then exit 1 fi -find . -type f -name '*.profraw' -delete +#find . -type f -name '*.profraw' -delete diff --git a/housekeeping/docker/env/Dockerfile b/housekeeping/docker/env/Dockerfile index fa8a5f1c6d..8a11b58361 100644 --- a/housekeeping/docker/env/Dockerfile +++ b/housekeeping/docker/env/Dockerfile @@ -1,9 +1,6 @@ -FROM debian:bullseye-slim +FROM rust:1.75.0-slim-buster # Set environment variables -ENV RUSTUP_HOME="/opt/rustup" -ENV CARGO_HOME="/opt/cargo" -ENV PATH="$PATH:$CARGO_HOME/bin" ENV CARGO_BUILD_DEP_INFO_BASEDIR="." ENV CC=clang-13 ENV CXX=clang++-13 @@ -43,18 +40,11 @@ RUN add-apt-repository \ apt-get clean && \ rm -rf /var/lib/apt/lists/* -# Install rust -ENV RUST_NIGHTLY_VERSION=nightly-2024-01-09 -ENV RUST_GRCOV_VERSION=nightly-2023-03-21 -RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --no-modify-path --default-toolchain ${RUST_NIGHTLY_VERSION} && \ - rustup toolchain install ${RUST_NIGHTLY_VERSION} && \ - rustup target add wasm32-unknown-unknown && \ - rustup target add wasm32-unknown-unknown --toolchain ${RUST_NIGHTLY_VERSION} && \ - rm -rf "${CARGO_HOME}/registry" "${CARGO_HOME}/git" - +# Install subwasm RUN curl https://github.com/chevdor/subwasm/releases/download/v0.17.0/subwasm_linux_amd64_v0.17.0.deb -sSL -o subw.deb && \ dpkg -i subw.deb && rm subw.deb +# Install grcov and llvm-tools-preview component RUN cargo install grcov && \ - rustup component add llvm-tools-preview --toolchain ${RUST_GRCOV_VERSION} && \ - rm -rf "${CARGO_HOME}/registry" "${CARGO_HOME}/git" + rustup component add llvm-tools-preview && \ + rm -rf "${CARGO_HOME}/registry" "${CARGO_HOME}/git" \ No newline at end of file diff --git a/housekeeping/docker/env/Dockerfile.old b/housekeeping/docker/env/Dockerfile.old new file mode 100644 index 0000000000..87e02ea094 --- /dev/null +++ b/housekeeping/docker/env/Dockerfile.old @@ -0,0 +1,59 @@ +FROM debian:bullseye-slim + +# Set environment variables +ENV RUSTUP_HOME="/opt/rustup" +ENV CARGO_HOME="/opt/cargo" +ENV PATH="$PATH:$CARGO_HOME/bin" +ENV CARGO_BUILD_DEP_INFO_BASEDIR="." +ENV CC=clang-13 +ENV CXX=clang++-13 + +# Install dependencies +RUN apt-get update && \ + apt-get install --no-install-recommends -y \ + ca-certificates apt-transport-https gnupg \ + libssl-dev pkg-config \ + curl \ + git binaryen \ + make cmake libssl-dev \ + software-properties-common && \ + apt-get autoremove -y && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* + +RUN curl -s https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - && \ + echo "deb http://apt.llvm.org/bullseye/ llvm-toolchain-bullseye-13 main" >> /etc/apt/sources.list.d/llvm-toochain-bullseye-13.list && \ + echo "deb-src http://apt.llvm.org/bullseye/ llvm-toolchain-bullseye-13 main" >> /etc/apt/sources.list.d/llvm-toochain-bullseye-13.list && \ + apt-get -y update && \ + apt-get install -y --no-install-recommends \ + clang-13 lldb-13 lld-13 libclang-13-dev llvm-13 protobuf-compiler && \ + update-alternatives --install /usr/bin/cc cc /usr/bin/clang-13 100 && \ + apt-get autoremove -y && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* + +# Install docker +RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - +RUN add-apt-repository \ + "deb https://download.docker.com/linux/debian $(lsb_release -cs) stable" && \ + apt-get update && \ + apt-get install --no-install-recommends -y \ + docker-ce docker-ce-cli containerd.io && \ + apt-get autoremove -y && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* + +# Install rust +ENV RUST_NIGHTLY_VERSION=nightly-2023-03-21 +RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --no-modify-path --default-toolchain stable && \ + rustup toolchain install ${RUST_NIGHTLY_VERSION} && \ + rustup target add wasm32-unknown-unknown && \ + rustup target add wasm32-unknown-unknown --toolchain ${RUST_NIGHTLY_VERSION} && \ + rm -rf "${CARGO_HOME}/registry" "${CARGO_HOME}/git" + +RUN curl https://github.com/chevdor/subwasm/releases/download/v0.17.0/subwasm_linux_amd64_v0.17.0.deb -sSL -o subw.deb && \ + dpkg -i subw.deb && rm subw.deb + +RUN cargo install grcov && \ + rustup component add llvm-tools-preview && \ + rm -rf "${CARGO_HOME}/registry" "${CARGO_HOME}/git" \ No newline at end of file From c94d8f179057c482b0e2f7ed8973d27e9e86eccd Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Fri, 12 Jan 2024 17:17:25 +0300 Subject: [PATCH 023/136] test 10 Signed-off-by: Nikita Zaporozhets --- housekeeping/coverage.sh | 12 ++---------- housekeeping/docker/env/Dockerfile | 15 ++++++++++++--- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/housekeeping/coverage.sh b/housekeeping/coverage.sh index 7c22787324..ee1888ccee 100755 --- a/housekeeping/coverage.sh +++ b/housekeeping/coverage.sh @@ -3,17 +3,9 @@ export RUSTFLAGS="-Cinstrument-coverage" export SKIP_WASM_BUILD=1 export LLVM_PROFILE_FILE="sora2-%p-%m.profraw" -profraw=$(find . -type f -name '*.profraw') cargo test --features private-net,ready-to-test,wip -echo "Profraw files here: $profraw" +grcov . --binary-path ./target/debug -s . -t html --branch -o ./cobertura_report --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" --llvm-path /usr/lib/llvm-13/bin -grcov . --binary-path ./target/debug -s . -t html --branch -o ./cobertura_report --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" - -# Check coverage errors -if [ $? -eq 1 ]; then - exit 1 -fi - -#find . -type f -name '*.profraw' -delete +find . -type f -name '*.profraw' -delete diff --git a/housekeeping/docker/env/Dockerfile b/housekeeping/docker/env/Dockerfile index 8a11b58361..67ceea3f2b 100644 --- a/housekeeping/docker/env/Dockerfile +++ b/housekeeping/docker/env/Dockerfile @@ -1,6 +1,9 @@ -FROM rust:1.75.0-slim-buster +FROM debian:bullseye-slim # Set environment variables +ENV RUSTUP_HOME="/opt/rustup" +ENV CARGO_HOME="/opt/cargo" +ENV PATH="$PATH:$CARGO_HOME/bin" ENV CARGO_BUILD_DEP_INFO_BASEDIR="." ENV CC=clang-13 ENV CXX=clang++-13 @@ -40,11 +43,17 @@ RUN add-apt-repository \ apt-get clean && \ rm -rf /var/lib/apt/lists/* -# Install subwasm +# Install rust +ENV RUST_NIGHTLY_VERSION=nightly-2024-01-09 +RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --no-modify-path --default-toolchain ${RUST_NIGHTLY_VERSION} && \ + rustup toolchain install ${RUST_NIGHTLY_VERSION} && \ + rustup target add wasm32-unknown-unknown && \ + rustup target add wasm32-unknown-unknown --toolchain ${RUST_NIGHTLY_VERSION} && \ + rm -rf "${CARGO_HOME}/registry" "${CARGO_HOME}/git" + RUN curl https://github.com/chevdor/subwasm/releases/download/v0.17.0/subwasm_linux_amd64_v0.17.0.deb -sSL -o subw.deb && \ dpkg -i subw.deb && rm subw.deb -# Install grcov and llvm-tools-preview component RUN cargo install grcov && \ rustup component add llvm-tools-preview && \ rm -rf "${CARGO_HOME}/registry" "${CARGO_HOME}/git" \ No newline at end of file From 8440ec094dfc96aaf1d1e56ae442944d94ea12f0 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Mon, 15 Jan 2024 11:19:28 +0300 Subject: [PATCH 024/136] try to revert old env Signed-off-by: Nikita Zaporozhets --- housekeeping/docker/env/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/housekeeping/docker/env/Dockerfile b/housekeeping/docker/env/Dockerfile index 67ceea3f2b..83ed3e16fd 100644 --- a/housekeeping/docker/env/Dockerfile +++ b/housekeeping/docker/env/Dockerfile @@ -45,7 +45,7 @@ RUN add-apt-repository \ # Install rust ENV RUST_NIGHTLY_VERSION=nightly-2024-01-09 -RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --no-modify-path --default-toolchain ${RUST_NIGHTLY_VERSION} && \ +RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --no-modify-path --default-toolchain stable && \ rustup toolchain install ${RUST_NIGHTLY_VERSION} && \ rustup target add wasm32-unknown-unknown && \ rustup target add wasm32-unknown-unknown --toolchain ${RUST_NIGHTLY_VERSION} && \ From f4424b3db0ec190ec5b77f07b571c7bed565d240 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Mon, 15 Jan 2024 12:00:19 +0300 Subject: [PATCH 025/136] try to revert old env Signed-off-by: Nikita Zaporozhets --- housekeeping/docker/env/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/housekeeping/docker/env/Dockerfile b/housekeeping/docker/env/Dockerfile index 83ed3e16fd..87e02ea094 100644 --- a/housekeeping/docker/env/Dockerfile +++ b/housekeeping/docker/env/Dockerfile @@ -44,7 +44,7 @@ RUN add-apt-repository \ rm -rf /var/lib/apt/lists/* # Install rust -ENV RUST_NIGHTLY_VERSION=nightly-2024-01-09 +ENV RUST_NIGHTLY_VERSION=nightly-2023-03-21 RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --no-modify-path --default-toolchain stable && \ rustup toolchain install ${RUST_NIGHTLY_VERSION} && \ rustup target add wasm32-unknown-unknown && \ From c46cdf28afb28ecf1bcc6b97dbcde815a3af951a Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Mon, 15 Jan 2024 13:24:14 +0300 Subject: [PATCH 026/136] test env Signed-off-by: Nikita Zaporozhets --- housekeeping/docker/env/Dockerfile | 63 +++++++++++------------------- 1 file changed, 23 insertions(+), 40 deletions(-) diff --git a/housekeeping/docker/env/Dockerfile b/housekeeping/docker/env/Dockerfile index 87e02ea094..0fc9f2a18f 100644 --- a/housekeeping/docker/env/Dockerfile +++ b/housekeeping/docker/env/Dockerfile @@ -1,59 +1,42 @@ FROM debian:bullseye-slim -# Set environment variables -ENV RUSTUP_HOME="/opt/rustup" -ENV CARGO_HOME="/opt/cargo" -ENV PATH="$PATH:$CARGO_HOME/bin" -ENV CARGO_BUILD_DEP_INFO_BASEDIR="." +ENV RUSTUP_HOME="/opt/rust" +ENV CARGO_HOME="/opt/rust" +ENV PATH="$PATH:$RUSTUP_HOME/bin" +ENV RUST_VERSION=nightly-2024-01-15 +ENV TZ=Europe/Moscow ENV CC=clang-13 ENV CXX=clang++-13 +ENV SUBWASM_VER=v0.17.0 +ARG DEBIAN_FRONTEND=noninteractive -# Install dependencies RUN apt-get update && \ apt-get install --no-install-recommends -y \ ca-certificates apt-transport-https gnupg \ libssl-dev pkg-config \ curl \ git binaryen \ + docker.io \ make cmake libssl-dev \ software-properties-common && \ - apt-get autoremove -y && \ - apt-get clean && \ - rm -rf /var/lib/apt/lists/* - -RUN curl -s https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - && \ + curl https://sh.rustup.rs -sSf | sh -s -- -y --no-modify-path --default-toolchain ${RUST_VERSION} && \ + rustup toolchain install ${RUST_VERSION} && \ + rustup target add wasm32-unknown-unknown && \ + rustup target add wasm32-unknown-unknown --toolchain ${RUST_VERSION} && \ + curl -s https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - && \ echo "deb http://apt.llvm.org/bullseye/ llvm-toolchain-bullseye-13 main" >> /etc/apt/sources.list.d/llvm-toochain-bullseye-13.list && \ echo "deb-src http://apt.llvm.org/bullseye/ llvm-toolchain-bullseye-13 main" >> /etc/apt/sources.list.d/llvm-toochain-bullseye-13.list && \ - apt-get -y update && \ - apt-get install -y --no-install-recommends \ - clang-13 lldb-13 lld-13 libclang-13-dev llvm-13 protobuf-compiler && \ - update-alternatives --install /usr/bin/cc cc /usr/bin/clang-13 100 && \ - apt-get autoremove -y && \ - apt-get clean && \ - rm -rf /var/lib/apt/lists/* - -# Install docker -RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - -RUN add-apt-repository \ - "deb https://download.docker.com/linux/debian $(lsb_release -cs) stable" && \ apt-get update && \ apt-get install --no-install-recommends -y \ - docker-ce docker-ce-cli containerd.io && \ + clang-13 lldb-13 lld-13 libclang-13-dev llvm-13 protobuf-compiler && \ + update-alternatives --install /usr/bin/cc cc /usr/bin/${CC} 100 && \ + curl https://github.com/chevdor/subwasm/releases/download/${SUBWASM_VER}/subwasm_linux_amd64_${SUBWASM_VER}.deb -sSL -o subw.deb && \ + dpkg -i subw.deb && rm subw.deb && \ + rustup update && \ + cargo install grcov && \ + rustup component add llvm-tools-preview && \ apt-get autoremove -y && \ apt-get clean && \ - rm -rf /var/lib/apt/lists/* - -# Install rust -ENV RUST_NIGHTLY_VERSION=nightly-2023-03-21 -RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --no-modify-path --default-toolchain stable && \ - rustup toolchain install ${RUST_NIGHTLY_VERSION} && \ - rustup target add wasm32-unknown-unknown && \ - rustup target add wasm32-unknown-unknown --toolchain ${RUST_NIGHTLY_VERSION} && \ - rm -rf "${CARGO_HOME}/registry" "${CARGO_HOME}/git" - -RUN curl https://github.com/chevdor/subwasm/releases/download/v0.17.0/subwasm_linux_amd64_v0.17.0.deb -sSL -o subw.deb && \ - dpkg -i subw.deb && rm subw.deb - -RUN cargo install grcov && \ - rustup component add llvm-tools-preview && \ - rm -rf "${CARGO_HOME}/registry" "${CARGO_HOME}/git" \ No newline at end of file + rm -rf /var/lib/apt/lists/* && \ + rm -rf "${CARGO_HOME}/registry" "${CARGO_HOME}/git" &&\ + ln -snf /usr/share/zoneinfo/${TZ} /etc/localtime && echo ${TZ} > /etc/timezone \ No newline at end of file From 39c8a9c34c0fe463af648aa1da089277c3fc055e Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Mon, 15 Jan 2024 14:30:10 +0300 Subject: [PATCH 027/136] cobertura report Signed-off-by: Nikita Zaporozhets --- housekeeping/coverage.sh | 2 +- housekeeping/docker/env/Dockerfile | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/housekeeping/coverage.sh b/housekeeping/coverage.sh index ee1888ccee..f661525611 100755 --- a/housekeeping/coverage.sh +++ b/housekeeping/coverage.sh @@ -6,6 +6,6 @@ export LLVM_PROFILE_FILE="sora2-%p-%m.profraw" cargo test --features private-net,ready-to-test,wip -grcov . --binary-path ./target/debug -s . -t html --branch -o ./cobertura_report --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" --llvm-path /usr/lib/llvm-13/bin +grcov . --binary-path ./target/debug -s . -t cobertura --branch -o ./cobertura_report --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" --llvm-path /usr/lib/llvm-13/bin find . -type f -name '*.profraw' -delete diff --git a/housekeeping/docker/env/Dockerfile b/housekeeping/docker/env/Dockerfile index 0fc9f2a18f..79b7160d90 100644 --- a/housekeeping/docker/env/Dockerfile +++ b/housekeeping/docker/env/Dockerfile @@ -21,7 +21,6 @@ RUN apt-get update && \ software-properties-common && \ curl https://sh.rustup.rs -sSf | sh -s -- -y --no-modify-path --default-toolchain ${RUST_VERSION} && \ rustup toolchain install ${RUST_VERSION} && \ - rustup target add wasm32-unknown-unknown && \ rustup target add wasm32-unknown-unknown --toolchain ${RUST_VERSION} && \ curl -s https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - && \ echo "deb http://apt.llvm.org/bullseye/ llvm-toolchain-bullseye-13 main" >> /etc/apt/sources.list.d/llvm-toochain-bullseye-13.list && \ @@ -38,5 +37,5 @@ RUN apt-get update && \ apt-get autoremove -y && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* && \ - rm -rf "${CARGO_HOME}/registry" "${CARGO_HOME}/git" &&\ + rm -rf "${CARGO_HOME}/registry" "${CARGO_HOME}/git" && \ ln -snf /usr/share/zoneinfo/${TZ} /etc/localtime && echo ${TZ} > /etc/timezone \ No newline at end of file From 54c516160067be79edfc511cfc3a9ee37451cbce Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Mon, 15 Jan 2024 15:43:22 +0300 Subject: [PATCH 028/136] decrease grcov Signed-off-by: Nikita Zaporozhets --- housekeeping/docker/env/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/housekeeping/docker/env/Dockerfile b/housekeeping/docker/env/Dockerfile index 79b7160d90..4bc469be7b 100644 --- a/housekeeping/docker/env/Dockerfile +++ b/housekeeping/docker/env/Dockerfile @@ -32,7 +32,7 @@ RUN apt-get update && \ curl https://github.com/chevdor/subwasm/releases/download/${SUBWASM_VER}/subwasm_linux_amd64_${SUBWASM_VER}.deb -sSL -o subw.deb && \ dpkg -i subw.deb && rm subw.deb && \ rustup update && \ - cargo install grcov && \ + cargo install grcov --version 0.6.0 && \ rustup component add llvm-tools-preview && \ apt-get autoremove -y && \ apt-get clean && \ From b9488fec068362863a78b86d6715626f0739e21e Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Mon, 15 Jan 2024 16:43:49 +0300 Subject: [PATCH 029/136] decrease grcov to 0.5.15 and move it to var Signed-off-by: Nikita Zaporozhets --- housekeeping/docker/env/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/housekeeping/docker/env/Dockerfile b/housekeeping/docker/env/Dockerfile index 4bc469be7b..e021d66afb 100644 --- a/housekeeping/docker/env/Dockerfile +++ b/housekeeping/docker/env/Dockerfile @@ -8,6 +8,7 @@ ENV TZ=Europe/Moscow ENV CC=clang-13 ENV CXX=clang++-13 ENV SUBWASM_VER=v0.17.0 +ENV GRCOV_VERSION=0.5.15 ARG DEBIAN_FRONTEND=noninteractive RUN apt-get update && \ @@ -32,7 +33,7 @@ RUN apt-get update && \ curl https://github.com/chevdor/subwasm/releases/download/${SUBWASM_VER}/subwasm_linux_amd64_${SUBWASM_VER}.deb -sSL -o subw.deb && \ dpkg -i subw.deb && rm subw.deb && \ rustup update && \ - cargo install grcov --version 0.6.0 && \ + cargo install grcov --version ${GRCOV_VERSION} && \ rustup component add llvm-tools-preview && \ apt-get autoremove -y && \ apt-get clean && \ From c8e10ed1e47e66ca683dadf28b1c3de04eb84207 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Mon, 15 Jan 2024 18:03:21 +0300 Subject: [PATCH 030/136] decrease grcov to 0.5.15 and move it to var Signed-off-by: Nikita Zaporozhets --- housekeeping/docker/env/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/housekeeping/docker/env/Dockerfile b/housekeeping/docker/env/Dockerfile index e021d66afb..06b98dc5a9 100644 --- a/housekeeping/docker/env/Dockerfile +++ b/housekeeping/docker/env/Dockerfile @@ -8,7 +8,7 @@ ENV TZ=Europe/Moscow ENV CC=clang-13 ENV CXX=clang++-13 ENV SUBWASM_VER=v0.17.0 -ENV GRCOV_VERSION=0.5.15 +ENV GRCOV_VERSION=0.6.0 ARG DEBIAN_FRONTEND=noninteractive RUN apt-get update && \ From 6d1512dbdc41ac3da44a040378ec629c14b24a1b Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Mon, 15 Jan 2024 18:11:34 +0300 Subject: [PATCH 031/136] update clang Signed-off-by: Nikita Zaporozhets --- housekeeping/docker/env/Dockerfile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/housekeeping/docker/env/Dockerfile b/housekeeping/docker/env/Dockerfile index 06b98dc5a9..0710650d90 100644 --- a/housekeeping/docker/env/Dockerfile +++ b/housekeeping/docker/env/Dockerfile @@ -5,8 +5,8 @@ ENV CARGO_HOME="/opt/rust" ENV PATH="$PATH:$RUSTUP_HOME/bin" ENV RUST_VERSION=nightly-2024-01-15 ENV TZ=Europe/Moscow -ENV CC=clang-13 -ENV CXX=clang++-13 +ENV CC=clang-17 +ENV CXX=clang++-17 ENV SUBWASM_VER=v0.17.0 ENV GRCOV_VERSION=0.6.0 ARG DEBIAN_FRONTEND=noninteractive @@ -24,11 +24,11 @@ RUN apt-get update && \ rustup toolchain install ${RUST_VERSION} && \ rustup target add wasm32-unknown-unknown --toolchain ${RUST_VERSION} && \ curl -s https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - && \ - echo "deb http://apt.llvm.org/bullseye/ llvm-toolchain-bullseye-13 main" >> /etc/apt/sources.list.d/llvm-toochain-bullseye-13.list && \ - echo "deb-src http://apt.llvm.org/bullseye/ llvm-toolchain-bullseye-13 main" >> /etc/apt/sources.list.d/llvm-toochain-bullseye-13.list && \ + echo "deb http://apt.llvm.org/bullseye/ llvm-toolchain-bullseye-17 main" >> /etc/apt/sources.list.d/llvm-toochain-bullseye-13.list && \ + echo "deb-src http://apt.llvm.org/bullseye/ llvm-toolchain-bullseye-17 main" >> /etc/apt/sources.list.d/llvm-toochain-bullseye-13.list && \ apt-get update && \ apt-get install --no-install-recommends -y \ - clang-13 lldb-13 lld-13 libclang-13-dev llvm-13 protobuf-compiler && \ + clang-17 lldb-17 lld-17 libclang-17-dev llvm-13 protobuf-compiler && \ update-alternatives --install /usr/bin/cc cc /usr/bin/${CC} 100 && \ curl https://github.com/chevdor/subwasm/releases/download/${SUBWASM_VER}/subwasm_linux_amd64_${SUBWASM_VER}.deb -sSL -o subw.deb && \ dpkg -i subw.deb && rm subw.deb && \ From ea172b6d1032707c5fcaf6cb0b0ee11244d132d1 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Mon, 15 Jan 2024 20:11:26 +0300 Subject: [PATCH 032/136] test grcov Signed-off-by: Nikita Zaporozhets --- housekeeping/coverage.sh | 2 +- housekeeping/docker/env/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/housekeeping/coverage.sh b/housekeeping/coverage.sh index f661525611..589a221ae2 100755 --- a/housekeeping/coverage.sh +++ b/housekeeping/coverage.sh @@ -6,6 +6,6 @@ export LLVM_PROFILE_FILE="sora2-%p-%m.profraw" cargo test --features private-net,ready-to-test,wip -grcov . --binary-path ./target/debug -s . -t cobertura --branch -o ./cobertura_report --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" --llvm-path /usr/lib/llvm-13/bin +grcov . --binary-path ./target/debug -s . -t cobertura --branch -o ./cobertura_report --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" --llvm-path /usr/lib/llvm-17/bin find . -type f -name '*.profraw' -delete diff --git a/housekeeping/docker/env/Dockerfile b/housekeeping/docker/env/Dockerfile index 0710650d90..b76ee49b29 100644 --- a/housekeeping/docker/env/Dockerfile +++ b/housekeeping/docker/env/Dockerfile @@ -8,7 +8,7 @@ ENV TZ=Europe/Moscow ENV CC=clang-17 ENV CXX=clang++-17 ENV SUBWASM_VER=v0.17.0 -ENV GRCOV_VERSION=0.6.0 +ENV GRCOV_VERSION=0.8.19 ARG DEBIAN_FRONTEND=noninteractive RUN apt-get update && \ From 40a6d1b1721b3b33fa025e5723f8633da6f37b35 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Tue, 16 Jan 2024 14:58:11 +0300 Subject: [PATCH 033/136] update Dockerfile Signed-off-by: Nikita Zaporozhets --- housekeeping/docker/env/Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/housekeeping/docker/env/Dockerfile b/housekeeping/docker/env/Dockerfile index b76ee49b29..ecdd4c5330 100644 --- a/housekeeping/docker/env/Dockerfile +++ b/housekeeping/docker/env/Dockerfile @@ -24,11 +24,11 @@ RUN apt-get update && \ rustup toolchain install ${RUST_VERSION} && \ rustup target add wasm32-unknown-unknown --toolchain ${RUST_VERSION} && \ curl -s https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - && \ - echo "deb http://apt.llvm.org/bullseye/ llvm-toolchain-bullseye-17 main" >> /etc/apt/sources.list.d/llvm-toochain-bullseye-13.list && \ - echo "deb-src http://apt.llvm.org/bullseye/ llvm-toolchain-bullseye-17 main" >> /etc/apt/sources.list.d/llvm-toochain-bullseye-13.list && \ + echo "deb http://apt.llvm.org/bullseye/ llvm-toolchain-bullseye-17 main" >> /etc/apt/sources.list.d/llvm-toochain-bullseye-17.list && \ + echo "deb-src http://apt.llvm.org/bullseye/ llvm-toolchain-bullseye-17 main" >> /etc/apt/sources.list.d/llvm-toochain-bullseye-17.list && \ apt-get update && \ apt-get install --no-install-recommends -y \ - clang-17 lldb-17 lld-17 libclang-17-dev llvm-13 protobuf-compiler && \ + clang-17 lldb-17 lld-17 libclang-17-dev llvm-17 protobuf-compiler && \ update-alternatives --install /usr/bin/cc cc /usr/bin/${CC} 100 && \ curl https://github.com/chevdor/subwasm/releases/download/${SUBWASM_VER}/subwasm_linux_amd64_${SUBWASM_VER}.deb -sSL -o subw.deb && \ dpkg -i subw.deb && rm subw.deb && \ From f7c5eaed6abc447aa15b61df27f87e04170104e4 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Tue, 16 Jan 2024 18:04:10 +0300 Subject: [PATCH 034/136] debug Signed-off-by: Nikita Zaporozhets --- housekeeping/coverage.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/housekeeping/coverage.sh b/housekeeping/coverage.sh index 589a221ae2..626f976088 100755 --- a/housekeeping/coverage.sh +++ b/housekeeping/coverage.sh @@ -4,8 +4,10 @@ export RUSTFLAGS="-Cinstrument-coverage" export SKIP_WASM_BUILD=1 export LLVM_PROFILE_FILE="sora2-%p-%m.profraw" +echo 'running tests' cargo test --features private-net,ready-to-test,wip +echo 'running coverage' grcov . --binary-path ./target/debug -s . -t cobertura --branch -o ./cobertura_report --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" --llvm-path /usr/lib/llvm-17/bin find . -type f -name '*.profraw' -delete From 48e3bdd8e2d505493912f384a5ef201d68b372ec Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Tue, 16 Jan 2024 19:10:22 +0300 Subject: [PATCH 035/136] debug Signed-off-by: Nikita Zaporozhets --- housekeeping/coverage.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/housekeeping/coverage.sh b/housekeeping/coverage.sh index 626f976088..b424133268 100755 --- a/housekeeping/coverage.sh +++ b/housekeeping/coverage.sh @@ -8,6 +8,6 @@ echo 'running tests' cargo test --features private-net,ready-to-test,wip echo 'running coverage' -grcov . --binary-path ./target/debug -s . -t cobertura --branch -o ./cobertura_report --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" --llvm-path /usr/lib/llvm-17/bin +grcov . --binary-path ./target/debug -s . -t cobertura --branch -o ./cobertura_report --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" find . -type f -name '*.profraw' -delete From b146ab92ead072c9f34ff74039636fbfba5f8a61 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Wed, 17 Jan 2024 11:20:39 +0300 Subject: [PATCH 036/136] test coverage Signed-off-by: Nikita Zaporozhets --- Cargo.lock | 2 +- housekeeping/coverage.sh | 2 +- housekeeping/docker/env/Dockerfile | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 42b07e51a7..7f5c67cbb3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -15662,4 +15662,4 @@ checksum = "9e16efa8a874a0481a574084d34cc26fdb3b99627480f785888deb6386506656" dependencies = [ "cc", "pkg-config", -] +] \ No newline at end of file diff --git a/housekeeping/coverage.sh b/housekeeping/coverage.sh index b424133268..2b059c69e6 100755 --- a/housekeeping/coverage.sh +++ b/housekeeping/coverage.sh @@ -8,6 +8,6 @@ echo 'running tests' cargo test --features private-net,ready-to-test,wip echo 'running coverage' -grcov . --binary-path ./target/debug -s . -t cobertura --branch -o ./cobertura_report --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" +grcov . --binary-path /home/target/debug -s . -t cobertura --branch -o ./cobertura_report --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" "node/src" --llvm-path /usr/lib/llvm-14/bin find . -type f -name '*.profraw' -delete diff --git a/housekeeping/docker/env/Dockerfile b/housekeeping/docker/env/Dockerfile index ecdd4c5330..39137cb412 100644 --- a/housekeeping/docker/env/Dockerfile +++ b/housekeeping/docker/env/Dockerfile @@ -5,9 +5,9 @@ ENV CARGO_HOME="/opt/rust" ENV PATH="$PATH:$RUSTUP_HOME/bin" ENV RUST_VERSION=nightly-2024-01-15 ENV TZ=Europe/Moscow -ENV CC=clang-17 -ENV CXX=clang++-17 -ENV SUBWASM_VER=v0.17.0 +ENV CC=clang-14 +ENV CXX=clang++-14 +ENV SUBWASM_VER=v0.14.0 ENV GRCOV_VERSION=0.8.19 ARG DEBIAN_FRONTEND=noninteractive @@ -24,11 +24,11 @@ RUN apt-get update && \ rustup toolchain install ${RUST_VERSION} && \ rustup target add wasm32-unknown-unknown --toolchain ${RUST_VERSION} && \ curl -s https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - && \ - echo "deb http://apt.llvm.org/bullseye/ llvm-toolchain-bullseye-17 main" >> /etc/apt/sources.list.d/llvm-toochain-bullseye-17.list && \ - echo "deb-src http://apt.llvm.org/bullseye/ llvm-toolchain-bullseye-17 main" >> /etc/apt/sources.list.d/llvm-toochain-bullseye-17.list && \ + echo "deb http://apt.llvm.org/bullseye/ llvm-toolchain-bullseye-14 main" >> /etc/apt/sources.list.d/llvm-toochain-bullseye-14.list && \ + echo "deb-src http://apt.llvm.org/bullseye/ llvm-toolchain-bullseye-14 main" >> /etc/apt/sources.list.d/llvm-toochain-bullseye-14.list && \ apt-get update && \ apt-get install --no-install-recommends -y \ - clang-17 lldb-17 lld-17 libclang-17-dev llvm-17 protobuf-compiler && \ + clang-14 lldb-14 lld-14 libclang-14-dev llvm-14 protobuf-compiler && \ update-alternatives --install /usr/bin/cc cc /usr/bin/${CC} 100 && \ curl https://github.com/chevdor/subwasm/releases/download/${SUBWASM_VER}/subwasm_linux_amd64_${SUBWASM_VER}.deb -sSL -o subw.deb && \ dpkg -i subw.deb && rm subw.deb && \ From bbe753da0a553d705a90424e29c47085da2a46d8 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Wed, 17 Jan 2024 12:10:55 +0300 Subject: [PATCH 037/136] fix Signed-off-by: Nikita Zaporozhets --- housekeeping/coverage.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/housekeeping/coverage.sh b/housekeeping/coverage.sh index 2b059c69e6..e55009f44a 100755 --- a/housekeeping/coverage.sh +++ b/housekeeping/coverage.sh @@ -8,6 +8,6 @@ echo 'running tests' cargo test --features private-net,ready-to-test,wip echo 'running coverage' -grcov . --binary-path /home/target/debug -s . -t cobertura --branch -o ./cobertura_report --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" "node/src" --llvm-path /usr/lib/llvm-14/bin +grcov . --binary-path ./target/debug -s . -t cobertura --branch -o ./cobertura_report --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" "node/src" --llvm-path /usr/lib/llvm-14/bin find . -type f -name '*.profraw' -delete From 2395333709d403af5fda6ad5de7445026a95eb8e Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Wed, 17 Jan 2024 21:16:08 +0300 Subject: [PATCH 038/136] test Signed-off-by: Nikita Zaporozhets --- housekeeping/coverage.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/housekeeping/coverage.sh b/housekeeping/coverage.sh index e55009f44a..0ff304fe0e 100755 --- a/housekeeping/coverage.sh +++ b/housekeeping/coverage.sh @@ -6,8 +6,8 @@ export LLVM_PROFILE_FILE="sora2-%p-%m.profraw" echo 'running tests' cargo test --features private-net,ready-to-test,wip - +mkdir -p reports echo 'running coverage' -grcov . --binary-path ./target/debug -s . -t cobertura --branch -o ./cobertura_report --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" "node/src" --llvm-path /usr/lib/llvm-14/bin +grcov . --binary-path ./target/debug -s . -t cobertura --branch -o ./reports/cobertura_report --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" "node/src" --llvm-path /usr/lib/llvm-14/bin find . -type f -name '*.profraw' -delete From bee79704f3894f04552057bb9c11da0ede36df9d Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Thu, 18 Jan 2024 15:12:39 +0300 Subject: [PATCH 039/136] change dir Signed-off-by: Nikita Zaporozhets --- housekeeping/coverage.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/housekeeping/coverage.sh b/housekeeping/coverage.sh index 0ff304fe0e..e55009f44a 100755 --- a/housekeeping/coverage.sh +++ b/housekeeping/coverage.sh @@ -6,8 +6,8 @@ export LLVM_PROFILE_FILE="sora2-%p-%m.profraw" echo 'running tests' cargo test --features private-net,ready-to-test,wip -mkdir -p reports + echo 'running coverage' -grcov . --binary-path ./target/debug -s . -t cobertura --branch -o ./reports/cobertura_report --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" "node/src" --llvm-path /usr/lib/llvm-14/bin +grcov . --binary-path ./target/debug -s . -t cobertura --branch -o ./cobertura_report --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" "node/src" --llvm-path /usr/lib/llvm-14/bin find . -type f -name '*.profraw' -delete From 92e28a18be1fcaf4524bb60cece20dba36577caf Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Thu, 18 Jan 2024 16:02:40 +0300 Subject: [PATCH 040/136] debug Signed-off-by: Nikita Zaporozhets --- housekeeping/coverage.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/housekeeping/coverage.sh b/housekeeping/coverage.sh index e55009f44a..59d3c3e2a1 100755 --- a/housekeeping/coverage.sh +++ b/housekeeping/coverage.sh @@ -8,6 +8,10 @@ echo 'running tests' cargo test --features private-net,ready-to-test,wip echo 'running coverage' -grcov . --binary-path ./target/debug -s . -t cobertura --branch -o ./cobertura_report --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" "node/src" --llvm-path /usr/lib/llvm-14/bin +grcov . --binary-path ./target/debug -s . -t cobertura --branch -o cobertura_report --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" "node/src" --llvm-path /usr/lib/llvm-14/bin +ls -la + + +find . -type f -name 'cobertura_report' find . -type f -name '*.profraw' -delete From 8f0747fa79149382796882642a9d605c3911e5ea Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Thu, 18 Jan 2024 17:41:32 +0300 Subject: [PATCH 041/136] disable debug Signed-off-by: Nikita Zaporozhets --- housekeeping/coverage.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/housekeeping/coverage.sh b/housekeeping/coverage.sh index 59d3c3e2a1..87c83e2561 100755 --- a/housekeeping/coverage.sh +++ b/housekeeping/coverage.sh @@ -9,9 +9,9 @@ cargo test --features private-net,ready-to-test,wip echo 'running coverage' grcov . --binary-path ./target/debug -s . -t cobertura --branch -o cobertura_report --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" "node/src" --llvm-path /usr/lib/llvm-14/bin -ls -la +# ls -la -find . -type f -name 'cobertura_report' +# find . -type f -name 'cobertura_report' find . -type f -name '*.profraw' -delete From 5a86c6f6ade0eb606464651b0412137068e5706e Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Fri, 19 Jan 2024 11:09:15 +0300 Subject: [PATCH 042/136] test Signed-off-by: Nikita Zaporozhets --- housekeeping/coverage.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/housekeeping/coverage.sh b/housekeeping/coverage.sh index 87c83e2561..9ac2bb8bba 100755 --- a/housekeeping/coverage.sh +++ b/housekeeping/coverage.sh @@ -8,10 +8,10 @@ echo 'running tests' cargo test --features private-net,ready-to-test,wip echo 'running coverage' -grcov . --binary-path ./target/debug -s . -t cobertura --branch -o cobertura_report --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" "node/src" --llvm-path /usr/lib/llvm-14/bin -# ls -la +grcov . --binary-path ./target/debug -s . -t html --branch -o cobertura_report --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" "node/src" --llvm-path /usr/lib/llvm-14/bin +ls -la -# find . -type f -name 'cobertura_report' +find . -type f -name 'cobertura_report.html' find . -type f -name '*.profraw' -delete From c7c9603fa2b9215dea33885c6a45230ade53c7c4 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Fri, 19 Jan 2024 12:03:40 +0300 Subject: [PATCH 043/136] test Signed-off-by: Nikita Zaporozhets --- Cargo.lock | 15 ++++++++------- housekeeping/coverage.sh | 2 +- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7f5c67cbb3..184d18abfc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -160,9 +160,9 @@ dependencies = [ [[package]] name = "ahash" -version = "0.8.6" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" +checksum = "cd7d5a2cecb58716e47d67d5703a249964b14c7be1ec3cad3affc295b2d1c35d" dependencies = [ "cfg-if 1.0.0", "getrandom 0.2.11", @@ -4475,6 +4475,7 @@ dependencies = [ name = "framenode" version = "3.2.0" dependencies = [ + "ahash 0.8.5", "ansi_term", "assert_cmd", "assets-rpc", @@ -10934,7 +10935,7 @@ name = "sc-finality-grandpa" version = "0.10.0-dev" source = "git+https://github.com/sora-xor/substrate.git?branch=polkadot-v0.9.38#b12c8d200054c92586ec33f5dfc5d0e109958004" dependencies = [ - "ahash 0.8.6", + "ahash 0.8.5", "array-bytes", "async-trait", "dyn-clone", @@ -11117,7 +11118,7 @@ name = "sc-network-gossip" version = "0.10.0-dev" source = "git+https://github.com/sora-xor/substrate.git?branch=polkadot-v0.9.38#b12c8d200054c92586ec33f5dfc5d0e109958004" dependencies = [ - "ahash 0.8.6", + "ahash 0.8.5", "futures 0.3.29", "futures-timer", "libp2p", @@ -11710,7 +11711,7 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "772575a524feeb803e5b0fcbc6dd9f367e579488197c94c6e4023aad2305774d" dependencies = [ - "ahash 0.8.6", + "ahash 0.8.5", "cfg-if 1.0.0", "hashbrown 0.13.2", ] @@ -12839,7 +12840,7 @@ name = "sp-trie" version = "7.0.0" source = "git+https://github.com/sora-xor/substrate.git?branch=polkadot-v0.9.38#b12c8d200054c92586ec33f5dfc5d0e109958004" dependencies = [ - "ahash 0.8.6", + "ahash 0.8.5", "hash-db", "hashbrown 0.12.3", "lazy_static", @@ -15662,4 +15663,4 @@ checksum = "9e16efa8a874a0481a574084d34cc26fdb3b99627480f785888deb6386506656" dependencies = [ "cc", "pkg-config", -] \ No newline at end of file +] diff --git a/housekeeping/coverage.sh b/housekeeping/coverage.sh index 9ac2bb8bba..f7428d8b1b 100755 --- a/housekeeping/coverage.sh +++ b/housekeeping/coverage.sh @@ -8,7 +8,7 @@ echo 'running tests' cargo test --features private-net,ready-to-test,wip echo 'running coverage' -grcov . --binary-path ./target/debug -s . -t html --branch -o cobertura_report --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" "node/src" --llvm-path /usr/lib/llvm-14/bin +grcov . --binary-path ./target/debug -s . -t html --branch -o cobertura_report.html --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" "node/src" --llvm-path /usr/lib/llvm-14/bin ls -la From 0ac46c8c77ca162300d7eae5137d424c86769d80 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Fri, 19 Jan 2024 12:20:18 +0300 Subject: [PATCH 044/136] test lcov Signed-off-by: Nikita Zaporozhets --- housekeeping/coverage.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/housekeeping/coverage.sh b/housekeeping/coverage.sh index f7428d8b1b..177a82abc6 100755 --- a/housekeeping/coverage.sh +++ b/housekeeping/coverage.sh @@ -8,10 +8,10 @@ echo 'running tests' cargo test --features private-net,ready-to-test,wip echo 'running coverage' -grcov . --binary-path ./target/debug -s . -t html --branch -o cobertura_report.html --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" "node/src" --llvm-path /usr/lib/llvm-14/bin +grcov . --binary-path ./target/debug -s . -t lcov --branch -o cobertura_report --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" "node/src" --llvm-path /usr/lib/llvm-14/bin ls -la -find . -type f -name 'cobertura_report.html' +# find . -type f -name 'cobertura_report.html' find . -type f -name '*.profraw' -delete From 64f9236936fb039edce85a11a701d4680669a9d5 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Fri, 19 Jan 2024 14:33:31 +0300 Subject: [PATCH 045/136] revert cobertura Signed-off-by: Nikita Zaporozhets --- housekeeping/coverage.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/housekeeping/coverage.sh b/housekeeping/coverage.sh index 177a82abc6..b6285524ba 100755 --- a/housekeeping/coverage.sh +++ b/housekeeping/coverage.sh @@ -8,7 +8,7 @@ echo 'running tests' cargo test --features private-net,ready-to-test,wip echo 'running coverage' -grcov . --binary-path ./target/debug -s . -t lcov --branch -o cobertura_report --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" "node/src" --llvm-path /usr/lib/llvm-14/bin +grcov . --binary-path ./target/debug -s . -t cobertura --branch -o cobertura_report --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" "node/src" --llvm-path /usr/lib/llvm-14/bin ls -la From 11873e18e416c18e1b9e6f94da9c25d3e6d363e7 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Fri, 19 Jan 2024 15:32:41 +0300 Subject: [PATCH 046/136] revert cobertura Signed-off-by: Nikita Zaporozhets --- housekeeping/coverage.sh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/housekeeping/coverage.sh b/housekeeping/coverage.sh index b6285524ba..6ce1b3446e 100755 --- a/housekeeping/coverage.sh +++ b/housekeeping/coverage.sh @@ -9,9 +9,5 @@ cargo test --features private-net,ready-to-test,wip echo 'running coverage' grcov . --binary-path ./target/debug -s . -t cobertura --branch -o cobertura_report --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" "node/src" --llvm-path /usr/lib/llvm-14/bin -ls -la - - -# find . -type f -name 'cobertura_report.html' find . -type f -name '*.profraw' -delete From 84ff5e8d8ce67f03cdeaec39983013ebc312d89f Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Mon, 22 Jan 2024 08:49:34 +0300 Subject: [PATCH 047/136] fix Signed-off-by: Nikita Zaporozhets --- housekeeping/coverage.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/housekeeping/coverage.sh b/housekeeping/coverage.sh index 6ce1b3446e..4578a08b55 100755 --- a/housekeeping/coverage.sh +++ b/housekeeping/coverage.sh @@ -5,7 +5,7 @@ export SKIP_WASM_BUILD=1 export LLVM_PROFILE_FILE="sora2-%p-%m.profraw" echo 'running tests' -cargo test --features private-net,ready-to-test,wip +cargo test --features private-net echo 'running coverage' grcov . --binary-path ./target/debug -s . -t cobertura --branch -o cobertura_report --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" "node/src" --llvm-path /usr/lib/llvm-14/bin From 154ded2b19022ad76328efd9522165a580faef75 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Mon, 22 Jan 2024 10:56:51 +0300 Subject: [PATCH 048/136] test Signed-off-by: Nikita Zaporozhets --- housekeeping/coverage.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/housekeeping/coverage.sh b/housekeeping/coverage.sh index 4578a08b55..87a4f7e600 100755 --- a/housekeeping/coverage.sh +++ b/housekeeping/coverage.sh @@ -4,8 +4,8 @@ export RUSTFLAGS="-Cinstrument-coverage" export SKIP_WASM_BUILD=1 export LLVM_PROFILE_FILE="sora2-%p-%m.profraw" -echo 'running tests' -cargo test --features private-net +# echo 'running tests' +# cargo test --features private-net echo 'running coverage' grcov . --binary-path ./target/debug -s . -t cobertura --branch -o cobertura_report --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" "node/src" --llvm-path /usr/lib/llvm-14/bin From a54f6a1e395760ead6c228c2ce2f0575575bad47 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Mon, 22 Jan 2024 11:26:01 +0300 Subject: [PATCH 049/136] revert features Signed-off-by: Nikita Zaporozhets --- housekeeping/coverage.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/housekeeping/coverage.sh b/housekeeping/coverage.sh index 87a4f7e600..c297032199 100755 --- a/housekeeping/coverage.sh +++ b/housekeeping/coverage.sh @@ -4,8 +4,8 @@ export RUSTFLAGS="-Cinstrument-coverage" export SKIP_WASM_BUILD=1 export LLVM_PROFILE_FILE="sora2-%p-%m.profraw" -# echo 'running tests' -# cargo test --features private-net +echo 'running tests' +cargo test --features "private-net,ready-to-test,wip" echo 'running coverage' grcov . --binary-path ./target/debug -s . -t cobertura --branch -o cobertura_report --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" "node/src" --llvm-path /usr/lib/llvm-14/bin From d132a1f50dfee2214936c38049eb00e37681eada Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Mon, 22 Jan 2024 12:35:04 +0300 Subject: [PATCH 050/136] try coverage Signed-off-by: Nikita Zaporozhets --- housekeeping/coverage.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/housekeeping/coverage.sh b/housekeeping/coverage.sh index c297032199..5d367d6d58 100755 --- a/housekeeping/coverage.sh +++ b/housekeeping/coverage.sh @@ -8,6 +8,6 @@ echo 'running tests' cargo test --features "private-net,ready-to-test,wip" echo 'running coverage' -grcov . --binary-path ./target/debug -s . -t cobertura --branch -o cobertura_report --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" "node/src" --llvm-path /usr/lib/llvm-14/bin +grcov . --binary-path ./target/debug -s . -t cobertura --branch -o cobertura.xml --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" "node/src" --llvm-path /usr/lib/llvm-14/bin find . -type f -name '*.profraw' -delete From 07e0df2b32a17f37a9286496a5b26967f3f76627 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Mon, 22 Jan 2024 15:44:38 +0300 Subject: [PATCH 051/136] test threads Signed-off-by: Nikita Zaporozhets --- housekeeping/coverage.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/housekeeping/coverage.sh b/housekeeping/coverage.sh index 5d367d6d58..be8ba53de9 100755 --- a/housekeeping/coverage.sh +++ b/housekeeping/coverage.sh @@ -5,9 +5,9 @@ export SKIP_WASM_BUILD=1 export LLVM_PROFILE_FILE="sora2-%p-%m.profraw" echo 'running tests' -cargo test --features "private-net,ready-to-test,wip" +cargo test --features "private-net,ready-to-test,wip" -- --test-threads 3 echo 'running coverage' grcov . --binary-path ./target/debug -s . -t cobertura --branch -o cobertura.xml --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" "node/src" --llvm-path /usr/lib/llvm-14/bin -find . -type f -name '*.profraw' -delete +find . -type f -name '*.profraw' -delete \ No newline at end of file From 93c36b8e20deed72d5aee1951c6befa5a33aaab0 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Tue, 23 Jan 2024 08:56:35 +0300 Subject: [PATCH 052/136] fix tests Signed-off-by: Nikita Zaporozhets --- housekeeping/build.sh | 4 ++-- housekeeping/coverage.sh | 13 +++++++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/housekeeping/build.sh b/housekeeping/build.sh index 5df0165e2d..4c7a190793 100755 --- a/housekeeping/build.sh +++ b/housekeeping/build.sh @@ -52,6 +52,6 @@ else rm -rf ~/.cargo/.package-cache rm Cargo.lock cargo fmt -- --check > /dev/null - cargo test - cargo test --features "private-net wip ready-to-test runtime-benchmarks" + # cargo test + cargo test --features "private-net,wip,ready-to-test,runtime-benchmarks" fi diff --git a/housekeeping/coverage.sh b/housekeeping/coverage.sh index be8ba53de9..da51c7f5a0 100755 --- a/housekeeping/coverage.sh +++ b/housekeeping/coverage.sh @@ -1,13 +1,18 @@ #!/bin/sh -export RUSTFLAGS="-Cinstrument-coverage" +# export RUSTFLAGS="-Cinstrument-coverage" export SKIP_WASM_BUILD=1 export LLVM_PROFILE_FILE="sora2-%p-%m.profraw" +# new params +export CARGO_INCREMENTAL=0 +export RUSTFLAGS="-Cinstrument-coverage -Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort" +export RUSTDOCFLAGS="-Cpanic=abort" -echo 'running tests' -cargo test --features "private-net,ready-to-test,wip" -- --test-threads 3 + +# echo 'running tests' +# cargo test --features "private-net,ready-to-test,wip" -- --test-threads 3 echo 'running coverage' -grcov . --binary-path ./target/debug -s . -t cobertura --branch -o cobertura.xml --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" "node/src" --llvm-path /usr/lib/llvm-14/bin +grcov . --binary-path ./target/debug -s . -t cobertura --branch -o cobertura.xml --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" "node/src" --log-level "ERROR" --llvm-path /usr/lib/llvm-14/bin find . -type f -name '*.profraw' -delete \ No newline at end of file From 424deb7963db1d168e9235c75530be511b76ece9 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Tue, 23 Jan 2024 09:28:31 +0300 Subject: [PATCH 053/136] change tests Signed-off-by: Nikita Zaporozhets --- housekeeping/build.sh | 2 +- housekeeping/coverage.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/housekeeping/build.sh b/housekeeping/build.sh index 4c7a190793..c6194fbf6f 100755 --- a/housekeeping/build.sh +++ b/housekeeping/build.sh @@ -53,5 +53,5 @@ else rm Cargo.lock cargo fmt -- --check > /dev/null # cargo test - cargo test --features "private-net,wip,ready-to-test,runtime-benchmarks" + # cargo test --features "private-net,wip,ready-to-test,runtime-benchmarks" fi diff --git a/housekeeping/coverage.sh b/housekeeping/coverage.sh index da51c7f5a0..c876d56de2 100755 --- a/housekeeping/coverage.sh +++ b/housekeeping/coverage.sh @@ -10,7 +10,7 @@ export RUSTDOCFLAGS="-Cpanic=abort" # echo 'running tests' -# cargo test --features "private-net,ready-to-test,wip" -- --test-threads 3 +cargo test --features "private-net,ready-to-test,wip" -- --test-threads 3 echo 'running coverage' grcov . --binary-path ./target/debug -s . -t cobertura --branch -o cobertura.xml --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" "node/src" --log-level "ERROR" --llvm-path /usr/lib/llvm-14/bin From 970a63cc2122907058f7bb15f2319dad0a1c3f08 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Tue, 23 Jan 2024 09:45:16 +0300 Subject: [PATCH 054/136] change test workflow Signed-off-by: Nikita Zaporozhets --- housekeeping/build.sh | 15 ++++++++++----- housekeeping/coverage.sh | 15 ++++++++------- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/housekeeping/build.sh b/housekeeping/build.sh index c6194fbf6f..85b7677254 100755 --- a/housekeeping/build.sh +++ b/housekeeping/build.sh @@ -30,8 +30,8 @@ if [[ $buildTag != null ]] && [[ ${TAG_NAME} != null || ${TAG_NAME} != '' ]]; th featureList='include-real-files' sudoCheckStatus=101 fi - printf "Building with features: %s\n" "$featureList" - printf "Checking sudo pallet: %s\n" "$sudoCheckStatus" + printf "⚡️ Building with features: %s\n" "$featureList" + printf "⚡️ Checking sudo pallet: %s\n" "$sudoCheckStatus" cargo test --release --features "private-net runtime-benchmarks" rm -rf target cargo build --release --features "$featureList" @@ -48,10 +48,15 @@ else if [[ $prBranch == 'master' ]]; then RUST_LOG="debug cargo test --features try-runtime -- run_migrations" fi - printf "⚡️ only tests run %s\n" + printf "⚡️ Running Tests for code coverage only %s\n" rm -rf ~/.cargo/.package-cache rm Cargo.lock cargo fmt -- --check > /dev/null - # cargo test - # cargo test --features "private-net,wip,ready-to-test,runtime-benchmarks" + export SKIP_WASM_BUILD=1 + export LLVM_PROFILE_FILE="sora2-%p-%m.profraw" + # new params + export CARGO_INCREMENTAL=0 + export RUSTFLAGS="-Cinstrument-coverage -Zprofile -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort" + export RUSTDOCFLAGS="-Cpanic=abort" + cargo test --features "private-net,ready-to-test,wip" fi diff --git a/housekeeping/coverage.sh b/housekeeping/coverage.sh index c876d56de2..832ca20641 100755 --- a/housekeeping/coverage.sh +++ b/housekeeping/coverage.sh @@ -1,18 +1,19 @@ #!/bin/sh +set -e # export RUSTFLAGS="-Cinstrument-coverage" -export SKIP_WASM_BUILD=1 -export LLVM_PROFILE_FILE="sora2-%p-%m.profraw" +# export SKIP_WASM_BUILD=1 +# export LLVM_PROFILE_FILE="sora2-%p-%m.profraw" # new params -export CARGO_INCREMENTAL=0 -export RUSTFLAGS="-Cinstrument-coverage -Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort" -export RUSTDOCFLAGS="-Cpanic=abort" +# export CARGO_INCREMENTAL=0 +# export RUSTFLAGS="-Cinstrument-coverage -Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort" +# export RUSTDOCFLAGS="-Cpanic=abort" # echo 'running tests' -cargo test --features "private-net,ready-to-test,wip" -- --test-threads 3 +# cargo test --features "private-net,ready-to-test,wip" -- --test-threads 3 -echo 'running coverage' +echo '⚡️ Running coverage' grcov . --binary-path ./target/debug -s . -t cobertura --branch -o cobertura.xml --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" "node/src" --log-level "ERROR" --llvm-path /usr/lib/llvm-14/bin find . -type f -name '*.profraw' -delete \ No newline at end of file From 315827c81dff96ecc94e42a8c6251ad22e296683 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Tue, 23 Jan 2024 10:10:41 +0300 Subject: [PATCH 055/136] update tests and coverage Signed-off-by: Nikita Zaporozhets --- housekeeping/build.sh | 43 ++++++++++++++++++++-------------------- housekeeping/coverage.sh | 4 ++-- 2 files changed, 24 insertions(+), 23 deletions(-) diff --git a/housekeeping/build.sh b/housekeeping/build.sh index 85b7677254..99a7bf0cdd 100755 --- a/housekeeping/build.sh +++ b/housekeeping/build.sh @@ -9,9 +9,9 @@ RUSTFLAGS='-Dwarnings' RUNTIME_DIR='runtime' if [[ $buildTag != null ]] && [[ ${TAG_NAME} != null || ${TAG_NAME} != '' ]]; then - printf "Tag is %s\n" $buildTag ${TAG_NAME} + printf "⚡️ Tag is %s\n" $buildTag ${TAG_NAME} else - printf "⚡️ There is no tag here. " + printf "⚡️ There is no tag here. %s\n" fi # build @@ -30,33 +30,34 @@ if [[ $buildTag != null ]] && [[ ${TAG_NAME} != null || ${TAG_NAME} != '' ]]; th featureList='include-real-files' sudoCheckStatus=101 fi - printf "⚡️ Building with features: %s\n" "$featureList" - printf "⚡️ Checking sudo pallet: %s\n" "$sudoCheckStatus" - cargo test --release --features "private-net runtime-benchmarks" - rm -rf target - cargo build --release --features "$featureList" - mv ./target/release/framenode . - mv ./target/release/relayer ./relayer.bin - mv ./target/release/wbuild/framenode-runtime/framenode_runtime.compact.compressed.wasm ./framenode_runtime.compact.compressed.wasm - subwasm --json info framenode_runtime.compact.compressed.wasm > $wasmReportFile - subwasm metadata framenode_runtime.compact.compressed.wasm > $palletListFile - set +e - subwasm metadata -m Sudo framenode_runtime.compact.compressed.wasm - if [[ $(echo $?) -eq $sudoCheckStatus ]]; then echo "✅ sudo check is successful!"; else echo "❌ sudo check is failed!"; exit 1; fi + if [ $test = true ]; then + cargo test --release --features "private-net runtime-benchmarks" + fi + if [ $build = true ]; then + printf "⚡️ Building with features: %s\n" "$featureList" + printf "⚡️ Checking sudo pallet: %s\n" "$sudoCheckStatus" + rm -rf target + cargo build --release --features "$featureList" + mv ./target/release/framenode . + mv ./target/release/relayer ./relayer.bin + mv ./target/release/wbuild/framenode-runtime/framenode_runtime.compact.compressed.wasm ./framenode_runtime.compact.compressed.wasm + subwasm --json info framenode_runtime.compact.compressed.wasm > $wasmReportFile + subwasm metadata framenode_runtime.compact.compressed.wasm > $palletListFile + set +e + subwasm metadata -m Sudo framenode_runtime.compact.compressed.wasm + if [[ $(echo $?) -eq $sudoCheckStatus ]]; then echo "✅ sudo check is successful!"; else echo "❌ sudo check is failed!"; exit 1; fi + fi else # If TAG_NAME is not defined, run tests and checks if [[ $prBranch == 'master' ]]; then RUST_LOG="debug cargo test --features try-runtime -- run_migrations" fi printf "⚡️ Running Tests for code coverage only %s\n" - rm -rf ~/.cargo/.package-cache - rm Cargo.lock + # rm -rf ~/.cargo/.package-cache + # rm Cargo.lock cargo fmt -- --check > /dev/null + export RUSTFLAGS="-Cinstrument-coverage" export SKIP_WASM_BUILD=1 export LLVM_PROFILE_FILE="sora2-%p-%m.profraw" - # new params - export CARGO_INCREMENTAL=0 - export RUSTFLAGS="-Cinstrument-coverage -Zprofile -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort" - export RUSTDOCFLAGS="-Cpanic=abort" cargo test --features "private-net,ready-to-test,wip" fi diff --git a/housekeeping/coverage.sh b/housekeeping/coverage.sh index 832ca20641..4f64e0ec5d 100755 --- a/housekeeping/coverage.sh +++ b/housekeeping/coverage.sh @@ -4,8 +4,8 @@ set -e # export RUSTFLAGS="-Cinstrument-coverage" # export SKIP_WASM_BUILD=1 # export LLVM_PROFILE_FILE="sora2-%p-%m.profraw" -# new params -# export CARGO_INCREMENTAL=0 +# # new params +# # export CARGO_INCREMENTAL=0 # export RUSTFLAGS="-Cinstrument-coverage -Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort" # export RUSTDOCFLAGS="-Cpanic=abort" From 1dafbeb2f694557bab914154619ff83ca1d855c5 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Tue, 23 Jan 2024 10:37:31 +0300 Subject: [PATCH 056/136] update tests and coverage Signed-off-by: Nikita Zaporozhets --- housekeeping/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/housekeeping/build.sh b/housekeeping/build.sh index 99a7bf0cdd..44d4aa059d 100755 --- a/housekeeping/build.sh +++ b/housekeeping/build.sh @@ -11,7 +11,7 @@ RUNTIME_DIR='runtime' if [[ $buildTag != null ]] && [[ ${TAG_NAME} != null || ${TAG_NAME} != '' ]]; then printf "⚡️ Tag is %s\n" $buildTag ${TAG_NAME} else - printf "⚡️ There is no tag here. %s\n" + printf "⚡️ There is no tag here %s\n" fi # build From 9d84348eab6a5091114d31cdcbd52ebed66d3b57 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Tue, 23 Jan 2024 10:45:20 +0300 Subject: [PATCH 057/136] fix Signed-off-by: Nikita Zaporozhets --- housekeeping/build.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/housekeeping/build.sh b/housekeeping/build.sh index 44d4aa059d..2e79bfa191 100755 --- a/housekeeping/build.sh +++ b/housekeeping/build.sh @@ -48,6 +48,8 @@ if [[ $buildTag != null ]] && [[ ${TAG_NAME} != null || ${TAG_NAME} != '' ]]; th if [[ $(echo $?) -eq $sudoCheckStatus ]]; then echo "✅ sudo check is successful!"; else echo "❌ sudo check is failed!"; exit 1; fi fi else + build=false + test=false # If TAG_NAME is not defined, run tests and checks if [[ $prBranch == 'master' ]]; then RUST_LOG="debug cargo test --features try-runtime -- run_migrations" From df0e9e6a1968c407c566abd202b930bf9a3d4b60 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Tue, 23 Jan 2024 11:01:35 +0300 Subject: [PATCH 058/136] fix Signed-off-by: Nikita Zaporozhets --- housekeeping/build.sh | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/housekeeping/build.sh b/housekeeping/build.sh index 2e79bfa191..d9ffeee2ec 100755 --- a/housekeeping/build.sh +++ b/housekeeping/build.sh @@ -30,10 +30,8 @@ if [[ $buildTag != null ]] && [[ ${TAG_NAME} != null || ${TAG_NAME} != '' ]]; th featureList='include-real-files' sudoCheckStatus=101 fi - if [ $test = true ]; then - cargo test --release --features "private-net runtime-benchmarks" - fi - if [ $build = true ]; then + printf "⚡️ Testing with features: %s\n" "$featureList" + cargo test --release --features "$featureList" printf "⚡️ Building with features: %s\n" "$featureList" printf "⚡️ Checking sudo pallet: %s\n" "$sudoCheckStatus" rm -rf target @@ -46,10 +44,7 @@ if [[ $buildTag != null ]] && [[ ${TAG_NAME} != null || ${TAG_NAME} != '' ]]; th set +e subwasm metadata -m Sudo framenode_runtime.compact.compressed.wasm if [[ $(echo $?) -eq $sudoCheckStatus ]]; then echo "✅ sudo check is successful!"; else echo "❌ sudo check is failed!"; exit 1; fi - fi else - build=false - test=false # If TAG_NAME is not defined, run tests and checks if [[ $prBranch == 'master' ]]; then RUST_LOG="debug cargo test --features try-runtime -- run_migrations" From 6620546c163f3f64d861faf146c746653d7eb7db Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Tue, 23 Jan 2024 11:03:21 +0300 Subject: [PATCH 059/136] fix Signed-off-by: Nikita Zaporozhets --- housekeeping/build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/housekeeping/build.sh b/housekeeping/build.sh index d9ffeee2ec..a2912fbc4f 100755 --- a/housekeeping/build.sh +++ b/housekeeping/build.sh @@ -30,8 +30,8 @@ if [[ $buildTag != null ]] && [[ ${TAG_NAME} != null || ${TAG_NAME} != '' ]]; th featureList='include-real-files' sudoCheckStatus=101 fi - printf "⚡️ Testing with features: %s\n" "$featureList" - cargo test --release --features "$featureList" + printf "⚡️ Testing with features: private-net runtime-benchmark \n" + cargo test --release --features "private-net runtime-benchmarks" printf "⚡️ Building with features: %s\n" "$featureList" printf "⚡️ Checking sudo pallet: %s\n" "$sudoCheckStatus" rm -rf target From 8f05211e2ae1979b13e378c92fd526d7cff60eb3 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Tue, 23 Jan 2024 11:20:57 +0300 Subject: [PATCH 060/136] revert Signed-off-by: Nikita Zaporozhets --- housekeeping/build.sh | 8 ++------ housekeeping/coverage.sh | 12 ------------ 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/housekeeping/build.sh b/housekeeping/build.sh index a2912fbc4f..dbfe97102c 100755 --- a/housekeeping/build.sh +++ b/housekeeping/build.sh @@ -8,15 +8,11 @@ PACKAGE='framenode-runtime' RUSTFLAGS='-Dwarnings' RUNTIME_DIR='runtime' -if [[ $buildTag != null ]] && [[ ${TAG_NAME} != null || ${TAG_NAME} != '' ]]; then - printf "⚡️ Tag is %s\n" $buildTag ${TAG_NAME} -else - printf "⚡️ There is no tag here %s\n" -fi - # build # If TAG_NAME is defined, build for a specific tag if [[ $buildTag != null ]] && [[ ${TAG_NAME} != null || ${TAG_NAME} != '' ]]; then + printf "⚡️ Tag is %s\n" $buildTag ${TAG_NAME} + build=true if [[ ${TAG_NAME} =~ 'benchmarking'* ]]; then featureList='private-net runtime-benchmarks' sudoCheckStatus=0 diff --git a/housekeeping/coverage.sh b/housekeeping/coverage.sh index 4f64e0ec5d..fd83f44e49 100755 --- a/housekeeping/coverage.sh +++ b/housekeeping/coverage.sh @@ -1,18 +1,6 @@ #!/bin/sh set -e -# export RUSTFLAGS="-Cinstrument-coverage" -# export SKIP_WASM_BUILD=1 -# export LLVM_PROFILE_FILE="sora2-%p-%m.profraw" -# # new params -# # export CARGO_INCREMENTAL=0 -# export RUSTFLAGS="-Cinstrument-coverage -Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort" -# export RUSTDOCFLAGS="-Cpanic=abort" - - -# echo 'running tests' -# cargo test --features "private-net,ready-to-test,wip" -- --test-threads 3 - echo '⚡️ Running coverage' grcov . --binary-path ./target/debug -s . -t cobertura --branch -o cobertura.xml --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" "node/src" --log-level "ERROR" --llvm-path /usr/lib/llvm-14/bin From a11c9b9b8f770f3667dbb663a354b4838b446915 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Tue, 23 Jan 2024 12:28:22 +0300 Subject: [PATCH 061/136] debug Signed-off-by: Nikita Zaporozhets --- housekeeping/build.sh | 19 ++++++++++--------- housekeeping/coverage.sh | 5 ++--- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/housekeeping/build.sh b/housekeeping/build.sh index dbfe97102c..617623cca1 100755 --- a/housekeeping/build.sh +++ b/housekeeping/build.sh @@ -26,7 +26,8 @@ if [[ $buildTag != null ]] && [[ ${TAG_NAME} != null || ${TAG_NAME} != '' ]]; th featureList='include-real-files' sudoCheckStatus=101 fi - printf "⚡️ Testing with features: private-net runtime-benchmark \n" + printf "⚡️ Testing with features: private-net runtime-benchmark %s\n" + # we should always run these tests for these features cargo test --release --features "private-net runtime-benchmarks" printf "⚡️ Building with features: %s\n" "$featureList" printf "⚡️ Checking sudo pallet: %s\n" "$sudoCheckStatus" @@ -43,14 +44,14 @@ if [[ $buildTag != null ]] && [[ ${TAG_NAME} != null || ${TAG_NAME} != '' ]]; th else # If TAG_NAME is not defined, run tests and checks if [[ $prBranch == 'master' ]]; then + printf "⚡️ Running tests and migrations %s\n" RUST_LOG="debug cargo test --features try-runtime -- run_migrations" + else + printf "⚡️ Running Tests for code coverage only %s\n" + cargo fmt -- --check > /dev/null + export RUSTFLAGS="-Cinstrument-coverage" + export SKIP_WASM_BUILD=1 + export LLVM_PROFILE_FILE="sora2-%p-%m.profraw" + cargo test --features "private-net,ready-to-test,wip" fi - printf "⚡️ Running Tests for code coverage only %s\n" - # rm -rf ~/.cargo/.package-cache - # rm Cargo.lock - cargo fmt -- --check > /dev/null - export RUSTFLAGS="-Cinstrument-coverage" - export SKIP_WASM_BUILD=1 - export LLVM_PROFILE_FILE="sora2-%p-%m.profraw" - cargo test --features "private-net,ready-to-test,wip" fi diff --git a/housekeeping/coverage.sh b/housekeeping/coverage.sh index fd83f44e49..57a87bb1cf 100755 --- a/housekeeping/coverage.sh +++ b/housekeeping/coverage.sh @@ -1,7 +1,6 @@ #!/bin/sh set -e -echo '⚡️ Running coverage' -grcov . --binary-path ./target/debug -s . -t cobertura --branch -o cobertura.xml --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" "node/src" --log-level "ERROR" --llvm-path /usr/lib/llvm-14/bin - +printf '⚡️ Running coverage %s\n' +grcov . --binary-path ./target/debug -s . -t cobertura --branch -o cobertura.xml --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" "node/src" --log-level "DEBUG" --llvm-path /usr/lib/llvm-14/bin find . -type f -name '*.profraw' -delete \ No newline at end of file From 478ef360796f98b918833545038cadfd51aa0de3 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Tue, 23 Jan 2024 13:15:31 +0300 Subject: [PATCH 062/136] fix output Signed-off-by: Nikita Zaporozhets --- housekeeping/coverage.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/housekeeping/coverage.sh b/housekeeping/coverage.sh index 57a87bb1cf..e20399d393 100755 --- a/housekeeping/coverage.sh +++ b/housekeeping/coverage.sh @@ -2,5 +2,5 @@ set -e printf '⚡️ Running coverage %s\n' -grcov . --binary-path ./target/debug -s . -t cobertura --branch -o cobertura.xml --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" "node/src" --log-level "DEBUG" --llvm-path /usr/lib/llvm-14/bin +grcov . --binary-path ./target/debug -s . -t cobertura --branch -o cobertura_report.xml --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" "node/src" --log-level "DEBUG" --llvm-path /usr/lib/llvm-14/bin find . -type f -name '*.profraw' -delete \ No newline at end of file From 53bd361d2ccbc4dd498e358f3f2440b1e6ac4269 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Tue, 23 Jan 2024 14:50:13 +0300 Subject: [PATCH 063/136] fix coverage Signed-off-by: Nikita Zaporozhets --- housekeeping/coverage.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/housekeeping/coverage.sh b/housekeeping/coverage.sh index e20399d393..309fb7467d 100755 --- a/housekeeping/coverage.sh +++ b/housekeeping/coverage.sh @@ -2,5 +2,5 @@ set -e printf '⚡️ Running coverage %s\n' -grcov . --binary-path ./target/debug -s . -t cobertura --branch -o cobertura_report.xml --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" "node/src" --log-level "DEBUG" --llvm-path /usr/lib/llvm-14/bin +grcov . --binary-path ./target/debug -s . -t cobertura --branch -o cobertura_report.xml --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" "node/src" --log-level "ERROR" --llvm-path /usr/lib/llvm-14/bin find . -type f -name '*.profraw' -delete \ No newline at end of file From f3280668b148d12d4c7248bc73c85d4435db356e Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Tue, 23 Jan 2024 17:58:21 +0300 Subject: [PATCH 064/136] test Signed-off-by: Nikita Zaporozhets --- housekeeping/build.sh | 1 + housekeeping/coverage.sh | 1 + 2 files changed, 2 insertions(+) diff --git a/housekeeping/build.sh b/housekeeping/build.sh index 617623cca1..e5b46b6e65 100755 --- a/housekeeping/build.sh +++ b/housekeeping/build.sh @@ -50,6 +50,7 @@ else printf "⚡️ Running Tests for code coverage only %s\n" cargo fmt -- --check > /dev/null export RUSTFLAGS="-Cinstrument-coverage" + export CARGO_INCREMENTAL=0 export SKIP_WASM_BUILD=1 export LLVM_PROFILE_FILE="sora2-%p-%m.profraw" cargo test --features "private-net,ready-to-test,wip" diff --git a/housekeeping/coverage.sh b/housekeeping/coverage.sh index 309fb7467d..6d26c73712 100755 --- a/housekeeping/coverage.sh +++ b/housekeeping/coverage.sh @@ -1,6 +1,7 @@ #!/bin/sh set -e + printf '⚡️ Running coverage %s\n' grcov . --binary-path ./target/debug -s . -t cobertura --branch -o cobertura_report.xml --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" "node/src" --log-level "ERROR" --llvm-path /usr/lib/llvm-14/bin find . -type f -name '*.profraw' -delete \ No newline at end of file From c8c6e0c97cca77cfe9898db7069bb87cb08922b1 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Wed, 24 Jan 2024 14:12:39 +0300 Subject: [PATCH 065/136] rename report Signed-off-by: Nikita Zaporozhets --- housekeeping/coverage.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/housekeeping/coverage.sh b/housekeeping/coverage.sh index 6d26c73712..fcd9c8a71a 100755 --- a/housekeeping/coverage.sh +++ b/housekeeping/coverage.sh @@ -3,5 +3,5 @@ set -e printf '⚡️ Running coverage %s\n' -grcov . --binary-path ./target/debug -s . -t cobertura --branch -o cobertura_report.xml --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" "node/src" --log-level "ERROR" --llvm-path /usr/lib/llvm-14/bin +grcov . --binary-path ./target/debug -s . -t cobertura --branch -o cobertura.xml --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" "node/src" --log-level "ERROR" --llvm-path /usr/lib/llvm-14/bin find . -type f -name '*.profraw' -delete \ No newline at end of file From 1ab0b4f905aa09a4a46426c4435ab3af644ed368 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Wed, 24 Jan 2024 16:25:17 +0300 Subject: [PATCH 066/136] test workflow Signed-off-by: Nikita Zaporozhets --- .github/workflows/coverage.yml | 48 ++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/coverage.yml diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 0000000000..3bd01f28b2 --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,48 @@ +name: Coverage +on: + # pull_request: + push: + branches: + - feature/dops-2942 +jobs: + coverage: + runs-on: ubuntu-latest + container: + image: sora2/substrate:env + env: + CARGO_INCREMENTAL: 0 + SKIP_WASM_BUILD: 1 + LLVM_PROFILE_FILE: "sora2-%p-%m.profraw" + RUST_BACKTRACE: short + RUSTFLAGS: "-Cinstrument-coverage" + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Test + run: cargo test --features kusama,polkadot,rococo,runtime-benchmarks + + - name: Storing cache + uses: actions/cache@v2 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} + + - name: Generate Cobertura report + run: | + cargo tarpaulin --out Xml + grcov . --binary-path ./target/debug -s . -t cobertura --branch -o cobertura.xml --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" + + - name: Upload Cobertura report + uses: actions/upload-artifact@v2 + with: + name: cobertura-report + path: cobertura.xml + + - name: Upload to Codecov + uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file From e9eabe177371f2b1e1c231186b4f47e298354424 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Wed, 24 Jan 2024 16:29:18 +0300 Subject: [PATCH 067/136] fix Signed-off-by: Nikita Zaporozhets --- .github/workflows/coverage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 3bd01f28b2..90c8ab467a 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -20,7 +20,7 @@ jobs: uses: actions/checkout@v2 - name: Test - run: cargo test --features kusama,polkadot,rococo,runtime-benchmarks + run: cargo test --features private-net,ready-to-test,wip - name: Storing cache uses: actions/cache@v2 From 635106d091c532f9189e07063eb8b19d98cf64fd Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Wed, 24 Jan 2024 16:54:19 +0300 Subject: [PATCH 068/136] fix Signed-off-by: Nikita Zaporozhets --- .github/workflows/coverage.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 90c8ab467a..9abc2a78a0 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -33,7 +33,6 @@ jobs: - name: Generate Cobertura report run: | - cargo tarpaulin --out Xml grcov . --binary-path ./target/debug -s . -t cobertura --branch -o cobertura.xml --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" - name: Upload Cobertura report From cbff71acd13737cbd42346d30c55e47baa418aaa Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Wed, 24 Jan 2024 17:32:20 +0300 Subject: [PATCH 069/136] test workflow Signed-off-by: Nikita Zaporozhets --- .github/workflows/coverage.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 9abc2a78a0..5cc139edf2 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -19,6 +19,15 @@ jobs: - name: Checkout code uses: actions/checkout@v2 + - name: Getting cache + uses: actions/cache@v2 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} + - name: Test run: cargo test --features private-net,ready-to-test,wip From b7cb908ceddf61d336f35c6fd9de6da4b225980f Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Wed, 24 Jan 2024 18:07:16 +0300 Subject: [PATCH 070/136] test workflow Signed-off-by: Nikita Zaporozhets --- .github/workflows/coverage.yml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 5cc139edf2..aa9149d929 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -27,7 +27,7 @@ jobs: ~/.cargo/git target key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} - + - name: Test run: cargo test --features private-net,ready-to-test,wip @@ -42,15 +42,13 @@ jobs: - name: Generate Cobertura report run: | + cargo tarpaulin --out Xml grcov . --binary-path ./target/debug -s . -t cobertura --branch -o cobertura.xml --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" - - - name: Upload Cobertura report - uses: actions/upload-artifact@v2 - with: - name: cobertura-report - path: cobertura.xml + find . -type f -name '*.profraw' -delete - name: Upload to Codecov uses: codecov/codecov-action@v3 with: + files: ./cobertura.xml + gcov: true token: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file From bc41c41b85b319404aac1b96eb3f13ae933d07f9 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Wed, 24 Jan 2024 18:35:13 +0300 Subject: [PATCH 071/136] test workflow Signed-off-by: Nikita Zaporozhets --- .github/workflows/coverage.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index aa9149d929..6b3c367447 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -42,7 +42,6 @@ jobs: - name: Generate Cobertura report run: | - cargo tarpaulin --out Xml grcov . --binary-path ./target/debug -s . -t cobertura --branch -o cobertura.xml --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" find . -type f -name '*.profraw' -delete From 00a0a93bf17c6141df7bda7ca5c5df1b85b9e691 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Wed, 24 Jan 2024 19:03:32 +0300 Subject: [PATCH 072/136] test 3 Signed-off-by: Nikita Zaporozhets --- .github/workflows/coverage.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 6b3c367447..11db2ffdd9 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -49,5 +49,4 @@ jobs: uses: codecov/codecov-action@v3 with: files: ./cobertura.xml - gcov: true token: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file From cb1731f2f057d59d3e3a57503aa4453598d72fbe Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Wed, 24 Jan 2024 19:36:15 +0300 Subject: [PATCH 073/136] test 4 Signed-off-by: Nikita Zaporozhets --- .github/workflows/coverage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 11db2ffdd9..436155e5b8 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -42,7 +42,7 @@ jobs: - name: Generate Cobertura report run: | - grcov . --binary-path ./target/debug -s . -t cobertura --branch -o cobertura.xml --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" + grcov . --binary-path ./target/debug -s . -t cobertura --branch -o cobertura.xml --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" --log-level "ERROR" --llvm-path /usr/lib/llvm-14/bin find . -type f -name '*.profraw' -delete - name: Upload to Codecov From 450879d01eb6bb0578d647aef75534aed42989a4 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Thu, 25 Jan 2024 09:26:49 +0300 Subject: [PATCH 074/136] one feature report Signed-off-by: Nikita Zaporozhets --- .github/workflows/coverage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 436155e5b8..c67bde441a 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -29,7 +29,7 @@ jobs: key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} - name: Test - run: cargo test --features private-net,ready-to-test,wip + run: cargo test --features private-net - name: Storing cache uses: actions/cache@v2 From 08daf801b6fd5f7cb454bef4e21707bd693f0314 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Thu, 25 Jan 2024 09:58:46 +0300 Subject: [PATCH 075/136] test lcov format Signed-off-by: Nikita Zaporozhets --- .github/workflows/coverage.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index c67bde441a..d0c0ac4492 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -31,22 +31,22 @@ jobs: - name: Test run: cargo test --features private-net - - name: Storing cache - uses: actions/cache@v2 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - target - key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} + # - name: Storing cache + # uses: actions/cache@v2 + # with: + # path: | + # ~/.cargo/registry + # ~/.cargo/git + # target + # key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} - - name: Generate Cobertura report + - name: Generate coverage report run: | - grcov . --binary-path ./target/debug -s . -t cobertura --branch -o cobertura.xml --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" --log-level "ERROR" --llvm-path /usr/lib/llvm-14/bin + grcov . --binary-path ./target/debug -s . -t lcov --branch -o coverage --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" --log-level "ERROR" --llvm-path /usr/lib/llvm-14/bin find . -type f -name '*.profraw' -delete - name: Upload to Codecov uses: codecov/codecov-action@v3 with: - files: ./cobertura.xml + files: ./coverage token: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file From fa9c88dacce20b5f4aa53d5cd6ba23f07a815f25 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Thu, 25 Jan 2024 13:52:20 +0300 Subject: [PATCH 076/136] sora2-stage-v5 Signed-off-by: Nikita Zaporozhets --- .github/workflows/coverage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index d0c0ac4492..9e35fea05c 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -29,7 +29,7 @@ jobs: key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} - name: Test - run: cargo test --features private-net + run: cargo test --features "private-net,ready-to-test,wip" # - name: Storing cache # uses: actions/cache@v2 From 1f421392d027d3867f67d7d1a93368ab107f5823 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Thu, 25 Jan 2024 14:50:48 +0300 Subject: [PATCH 077/136] reduce steps Signed-off-by: Nikita Zaporozhets --- .github/workflows/coverage.yml | 35 +++++++++++----------------------- 1 file changed, 11 insertions(+), 24 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 9e35fea05c..05a6f0679b 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -1,6 +1,10 @@ name: Coverage + on: # pull_request: + # branches: + # - develop + # - master push: branches: - feature/dops-2942 @@ -16,32 +20,14 @@ jobs: RUST_BACKTRACE: short RUSTFLAGS: "-Cinstrument-coverage" steps: - - name: Checkout code - uses: actions/checkout@v2 - - name: Getting cache - uses: actions/cache@v2 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - target - key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} - - - name: Test - run: cargo test --features "private-net,ready-to-test,wip" - - # - name: Storing cache - # uses: actions/cache@v2 - # with: - # path: | - # ~/.cargo/registry - # ~/.cargo/git - # target - # key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} + - name: Checkout + uses: actions/checkout@v2 - - name: Generate coverage report + - uses: Swatinem/rust-cache@v2 + - name: Run tests, with coverage run: | + run: cargo test --features "private-net,ready-to-test,wip" grcov . --binary-path ./target/debug -s . -t lcov --branch -o coverage --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" --log-level "ERROR" --llvm-path /usr/lib/llvm-14/bin find . -type f -name '*.profraw' -delete @@ -49,4 +35,5 @@ jobs: uses: codecov/codecov-action@v3 with: files: ./coverage - token: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file + token: ${{ secrets.CODECOV_TOKEN }} + fail_ci_if_error: false \ No newline at end of file From ae1c79e49cecec672b076f35495f2726c452ada1 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Thu, 25 Jan 2024 14:53:09 +0300 Subject: [PATCH 078/136] reduce steps Signed-off-by: Nikita Zaporozhets --- .github/workflows/coverage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 05a6f0679b..5fd6002e4b 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -27,7 +27,7 @@ jobs: - uses: Swatinem/rust-cache@v2 - name: Run tests, with coverage run: | - run: cargo test --features "private-net,ready-to-test,wip" + cargo test --features "private-net,ready-to-test,wip" grcov . --binary-path ./target/debug -s . -t lcov --branch -o coverage --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" --log-level "ERROR" --llvm-path /usr/lib/llvm-14/bin find . -type f -name '*.profraw' -delete From b3bf42b147fad1911a6c1014b1078c5d252520b7 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Thu, 25 Jan 2024 18:28:21 +0300 Subject: [PATCH 079/136] reduce steps Signed-off-by: Nikita Zaporozhets --- .github/workflows/coverage.yml | 6 ++++-- housekeeping/build.sh | 8 +++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 5fd6002e4b..0751d05840 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -6,6 +6,8 @@ on: # - develop # - master push: + # tags: + # - '*' branches: - feature/dops-2942 jobs: @@ -19,15 +21,15 @@ jobs: LLVM_PROFILE_FILE: "sora2-%p-%m.profraw" RUST_BACKTRACE: short RUSTFLAGS: "-Cinstrument-coverage" + steps: - - name: Checkout uses: actions/checkout@v2 - uses: Swatinem/rust-cache@v2 - name: Run tests, with coverage run: | - cargo test --features "private-net,ready-to-test,wip" + RUSTFLAGS="-Zproc-macro-backtrace" cargo test --features "private-net,ready-to-test,wip" grcov . --binary-path ./target/debug -s . -t lcov --branch -o coverage --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" --log-level "ERROR" --llvm-path /usr/lib/llvm-14/bin find . -type f -name '*.profraw' -delete diff --git a/housekeeping/build.sh b/housekeeping/build.sh index e5b46b6e65..ab78d0093c 100755 --- a/housekeeping/build.sh +++ b/housekeeping/build.sh @@ -48,11 +48,9 @@ else RUST_LOG="debug cargo test --features try-runtime -- run_migrations" else printf "⚡️ Running Tests for code coverage only %s\n" + rm -rf ~/.cargo/.package-cache + rm Cargo.lock cargo fmt -- --check > /dev/null - export RUSTFLAGS="-Cinstrument-coverage" - export CARGO_INCREMENTAL=0 - export SKIP_WASM_BUILD=1 - export LLVM_PROFILE_FILE="sora2-%p-%m.profraw" - cargo test --features "private-net,ready-to-test,wip" + cargo test --features "private-net wip ready-to-test runtime-benchmarks" fi fi From adc4066ea4c5bc0c5341ef887f3bda0b2451dae3 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Thu, 25 Jan 2024 18:28:45 +0300 Subject: [PATCH 080/136] test Signed-off-by: Nikita Zaporozhets --- .github/workflows/coverage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 0751d05840..69870200ef 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -29,7 +29,7 @@ jobs: - uses: Swatinem/rust-cache@v2 - name: Run tests, with coverage run: | - RUSTFLAGS="-Zproc-macro-backtrace" cargo test --features "private-net,ready-to-test,wip" + cargo test --features "private-net,ready-to-test,wip" grcov . --binary-path ./target/debug -s . -t lcov --branch -o coverage --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" --log-level "ERROR" --llvm-path /usr/lib/llvm-14/bin find . -type f -name '*.profraw' -delete From 2db494459136757771eb620ec0138f80d0c69d0a Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Wed, 7 Feb 2024 14:13:18 +0300 Subject: [PATCH 081/136] test coverage Signed-off-by: Nikita Zaporozhets --- .github/workflows/coverage.yml | 41 -------------------------- housekeeping/build.sh | 6 +++- housekeeping/coverage.sh | 5 ++-- housekeeping/docker/env/Dockerfile | 10 ++++--- housekeeping/docker/release/Dockerfile | 3 +- 5 files changed, 15 insertions(+), 50 deletions(-) delete mode 100644 .github/workflows/coverage.yml diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml deleted file mode 100644 index 69870200ef..0000000000 --- a/.github/workflows/coverage.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: Coverage - -on: - # pull_request: - # branches: - # - develop - # - master - push: - # tags: - # - '*' - branches: - - feature/dops-2942 -jobs: - coverage: - runs-on: ubuntu-latest - container: - image: sora2/substrate:env - env: - CARGO_INCREMENTAL: 0 - SKIP_WASM_BUILD: 1 - LLVM_PROFILE_FILE: "sora2-%p-%m.profraw" - RUST_BACKTRACE: short - RUSTFLAGS: "-Cinstrument-coverage" - - steps: - - name: Checkout - uses: actions/checkout@v2 - - - uses: Swatinem/rust-cache@v2 - - name: Run tests, with coverage - run: | - cargo test --features "private-net,ready-to-test,wip" - grcov . --binary-path ./target/debug -s . -t lcov --branch -o coverage --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" --log-level "ERROR" --llvm-path /usr/lib/llvm-14/bin - find . -type f -name '*.profraw' -delete - - - name: Upload to Codecov - uses: codecov/codecov-action@v3 - with: - files: ./coverage - token: ${{ secrets.CODECOV_TOKEN }} - fail_ci_if_error: false \ No newline at end of file diff --git a/housekeeping/build.sh b/housekeeping/build.sh index ab78d0093c..f50e11539e 100755 --- a/housekeeping/build.sh +++ b/housekeeping/build.sh @@ -7,6 +7,7 @@ wasmReportFile='subwasm_report.json' PACKAGE='framenode-runtime' RUSTFLAGS='-Dwarnings' RUNTIME_DIR='runtime' +allfeatures='private-net,wip,ready-to-test,runtime-benchmarks' # build # If TAG_NAME is defined, build for a specific tag @@ -48,9 +49,12 @@ else RUST_LOG="debug cargo test --features try-runtime -- run_migrations" else printf "⚡️ Running Tests for code coverage only %s\n" + export RUSTFLAGS="-Cinstrument-coverage" + export SKIP_WASM_BUILD=1 + export LLVM_PROFILE_FILE="sora2-%p-%m.profraw" rm -rf ~/.cargo/.package-cache rm Cargo.lock cargo fmt -- --check > /dev/null - cargo test --features "private-net wip ready-to-test runtime-benchmarks" + cargo test --features $allfeatures fi fi diff --git a/housekeeping/coverage.sh b/housekeeping/coverage.sh index fcd9c8a71a..fd4fbc1406 100755 --- a/housekeeping/coverage.sh +++ b/housekeeping/coverage.sh @@ -1,7 +1,8 @@ #!/bin/sh set -e - printf '⚡️ Running coverage %s\n' -grcov . --binary-path ./target/debug -s . -t cobertura --branch -o cobertura.xml --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" "node/src" --log-level "ERROR" --llvm-path /usr/lib/llvm-14/bin +# coverage and generate report +grcov . --binary-path ./target/debug -s . -t lcov --branch -o coverage --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" --log-level "ERROR" --llvm-path /usr/lib/llvm-14/bin +# delete *.profraw find . -type f -name '*.profraw' -delete \ No newline at end of file diff --git a/housekeeping/docker/env/Dockerfile b/housekeeping/docker/env/Dockerfile index 39137cb412..0ac6668c43 100644 --- a/housekeeping/docker/env/Dockerfile +++ b/housekeeping/docker/env/Dockerfile @@ -9,6 +9,8 @@ ENV CC=clang-14 ENV CXX=clang++-14 ENV SUBWASM_VER=v0.14.0 ENV GRCOV_VERSION=0.8.19 +ENV LLVM_TOOLS_VER=14 +ENV CCLANG_VER=14 ARG DEBIAN_FRONTEND=noninteractive RUN apt-get update && \ @@ -24,11 +26,11 @@ RUN apt-get update && \ rustup toolchain install ${RUST_VERSION} && \ rustup target add wasm32-unknown-unknown --toolchain ${RUST_VERSION} && \ curl -s https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - && \ - echo "deb http://apt.llvm.org/bullseye/ llvm-toolchain-bullseye-14 main" >> /etc/apt/sources.list.d/llvm-toochain-bullseye-14.list && \ - echo "deb-src http://apt.llvm.org/bullseye/ llvm-toolchain-bullseye-14 main" >> /etc/apt/sources.list.d/llvm-toochain-bullseye-14.list && \ + echo "deb http://apt.llvm.org/bullseye/ llvm-toolchain-bullseye-${LLVM_TOOLS_VER} main" >> /etc/apt/sources.list.d/llvm-toochain-bullseye-${LLVM_TOOLS_VER}.list && \ + echo "deb-src http://apt.llvm.org/bullseye/ llvm-toolchain-bullseye-${LLVM_TOOLS_VER} main" >> /etc/apt/sources.list.d/llvm-toochain-bullseye-${LLVM_TOOLS_VER}.list && \ apt-get update && \ apt-get install --no-install-recommends -y \ - clang-14 lldb-14 lld-14 libclang-14-dev llvm-14 protobuf-compiler && \ + clang-${CCLANG_VER} lldb-${CCLANG_VER} lld-${CCLANG_VER} libclang-${CCLANG_VER}-dev llvm-${LLVM_TOOLS_VER} protobuf-compiler && \ update-alternatives --install /usr/bin/cc cc /usr/bin/${CC} 100 && \ curl https://github.com/chevdor/subwasm/releases/download/${SUBWASM_VER}/subwasm_linux_amd64_${SUBWASM_VER}.deb -sSL -o subw.deb && \ dpkg -i subw.deb && rm subw.deb && \ @@ -38,5 +40,5 @@ RUN apt-get update && \ apt-get autoremove -y && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* && \ - rm -rf "${CARGO_HOME}/registry" "${CARGO_HOME}/git" && \ + rm -rf "${CARGO_HOME}/git" && \ ln -snf /usr/share/zoneinfo/${TZ} /etc/localtime && echo ${TZ} > /etc/timezone \ No newline at end of file diff --git a/housekeeping/docker/release/Dockerfile b/housekeeping/docker/release/Dockerfile index 44fda7d116..ee9f52354b 100644 --- a/housekeeping/docker/release/Dockerfile +++ b/housekeeping/docker/release/Dockerfile @@ -1,5 +1,5 @@ FROM debian:bullseye -# Install dependencies + RUN apt-get update && \ apt-get install --no-install-recommends -y \ ca-certificates nano curl && \ @@ -13,6 +13,5 @@ RUN mkdir /chain && \ USER substrate COPY ./framenode /usr/local/bin/framenode -COPY ./relayer.bin /usr/local/bin/relayer ENTRYPOINT ["framenode"] \ No newline at end of file From 74d9c659d4aa49446d5441c5c8fd6f9a9138c4e4 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Mon, 12 Feb 2024 13:35:34 +0300 Subject: [PATCH 082/136] update env image Signed-off-by: Nikita Zaporozhets --- housekeeping/coverage.sh | 5 +++-- housekeeping/docker/env/Dockerfile | 19 ++++++++++--------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/housekeeping/coverage.sh b/housekeeping/coverage.sh index fd4fbc1406..05dbccdc2b 100755 --- a/housekeeping/coverage.sh +++ b/housekeeping/coverage.sh @@ -3,6 +3,7 @@ set -e printf '⚡️ Running coverage %s\n' # coverage and generate report -grcov . --binary-path ./target/debug -s . -t lcov --branch -o coverage --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" --log-level "ERROR" --llvm-path /usr/lib/llvm-14/bin -# delete *.profraw +grcov . --binary-path ./target/debug -s . -t cobertura --branch -o coverage --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" --log-level "ERROR" --llvm-path /usr/lib/llvm-14/bin + +# delete generated *.profraw find . -type f -name '*.profraw' -delete \ No newline at end of file diff --git a/housekeeping/docker/env/Dockerfile b/housekeeping/docker/env/Dockerfile index 0ac6668c43..7da1278ffa 100644 --- a/housekeeping/docker/env/Dockerfile +++ b/housekeeping/docker/env/Dockerfile @@ -1,23 +1,24 @@ -FROM debian:bullseye-slim +FROM debian:bullseye-20240130-slim ENV RUSTUP_HOME="/opt/rust" ENV CARGO_HOME="/opt/rust" ENV PATH="$PATH:$RUSTUP_HOME/bin" ENV RUST_VERSION=nightly-2024-01-15 ENV TZ=Europe/Moscow -ENV CC=clang-14 -ENV CXX=clang++-14 +ENV CC=clang-13 +ENV CXX=clang++-13 ENV SUBWASM_VER=v0.14.0 ENV GRCOV_VERSION=0.8.19 -ENV LLVM_TOOLS_VER=14 -ENV CCLANG_VER=14 +ENV LLVM_TOOLS_VER=13 +ENV CCLANG_VER=13 ARG DEBIAN_FRONTEND=noninteractive RUN apt-get update && \ - apt-get install --no-install-recommends -y \ + apt-get install -y \ ca-certificates apt-transport-https gnupg \ libssl-dev pkg-config \ curl \ + wget \ git binaryen \ docker.io \ make cmake libssl-dev \ @@ -25,9 +26,9 @@ RUN apt-get update && \ curl https://sh.rustup.rs -sSf | sh -s -- -y --no-modify-path --default-toolchain ${RUST_VERSION} && \ rustup toolchain install ${RUST_VERSION} && \ rustup target add wasm32-unknown-unknown --toolchain ${RUST_VERSION} && \ - curl -s https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - && \ - echo "deb http://apt.llvm.org/bullseye/ llvm-toolchain-bullseye-${LLVM_TOOLS_VER} main" >> /etc/apt/sources.list.d/llvm-toochain-bullseye-${LLVM_TOOLS_VER}.list && \ - echo "deb-src http://apt.llvm.org/bullseye/ llvm-toolchain-bullseye-${LLVM_TOOLS_VER} main" >> /etc/apt/sources.list.d/llvm-toochain-bullseye-${LLVM_TOOLS_VER}.list && \ + wget https://apt.llvm.org/llvm.sh && \ + chmod +x llvm.sh && \ + ./llvm.sh ${LLVM_TOOLS_VER} && \ apt-get update && \ apt-get install --no-install-recommends -y \ clang-${CCLANG_VER} lldb-${CCLANG_VER} lld-${CCLANG_VER} libclang-${CCLANG_VER}-dev llvm-${LLVM_TOOLS_VER} protobuf-compiler && \ From 187c896db80d187bed87565e97d89e8da21ff2d5 Mon Sep 17 00:00:00 2001 From: C4tWithShell Date: Mon, 12 Feb 2024 22:03:26 +0300 Subject: [PATCH 083/136] Add sonar, dojo --- Jenkinsfile | 5 ++++- housekeeping/clippy.sh | 4 ++-- housekeeping/coverage.sh | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index f8608eaff5..1605f161f2 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -11,6 +11,9 @@ def pipeline = new org.rust.AppPipeline(steps: this, cargoClippyCmds: ['housekeeping/clippy.sh'], buildTestCmds: ['housekeeping/build.sh'], buildArtifacts: 'framenode_runtime.compact.compressed.wasm, subwasm_report.json, pallet_list.txt', - pushToPublicRegistry: true + pushToPublicRegistry: true, + sonarProjectKey: 'sora:sora2-network', + sonarProjectName: 'sora2-network', + dojoProductType: 'sora' ) pipeline.runPipeline() diff --git a/housekeeping/clippy.sh b/housekeeping/clippy.sh index cc72a54bf8..2edb32054b 100755 --- a/housekeeping/clippy.sh +++ b/housekeeping/clippy.sh @@ -4,8 +4,8 @@ set -e if [ "$pr" = true ] && [ "$prBranch" != "master" ]; then printf "👷‍♂️ starting clippy \n" SKIP_WASM_BUILD=1 cargo clippy --features private-net,ready-to-test,runtime-benchmarks -- -D warnings - SKIP_WASM_BUILD=1 cargo clippy --features private-net,ready-to-test,wip,runtime-benchmarks -- -D warnings + SKIP_WASM_BUILD=1 cargo clippy --features private-net,ready-to-test,wip,runtime-benchmarks --message-format=json -- -D warnings > clippy_report.json else printf "👷‍♂️ starting a regular clippy \n" - cargo clippy || exit 0 + cargo clippy --message-format=json > clippy_report.json || exit 0 fi diff --git a/housekeeping/coverage.sh b/housekeeping/coverage.sh index 8e2ebc8630..bb49ed59c2 100755 --- a/housekeeping/coverage.sh +++ b/housekeeping/coverage.sh @@ -6,5 +6,5 @@ export LLVM_PROFILE_FILE="sora2-%p-%m.profraw" cargo test --features private-net -grcov . --binary-path ./target/debug -s . -t cobertura --branch -o ./cobertura_report --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" +grcov . --binary-path ./target/debug -s . -t lcov --branch -o ./lcov_report --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" find . -type f -name '*.profraw' -delete From 9413f53584e2b33baf28fa3d38e2174a3224a054 Mon Sep 17 00:00:00 2001 From: C4tWithShell Date: Tue, 13 Feb 2024 01:08:39 +0300 Subject: [PATCH 084/136] Fix coverage --- housekeeping/coverage.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/housekeeping/coverage.sh b/housekeeping/coverage.sh index bb49ed59c2..0a97f39474 100755 --- a/housekeeping/coverage.sh +++ b/housekeeping/coverage.sh @@ -5,6 +5,6 @@ export SKIP_WASM_BUILD=1 export LLVM_PROFILE_FILE="sora2-%p-%m.profraw" cargo test --features private-net - +rustup component add llvm-tools-preview grcov . --binary-path ./target/debug -s . -t lcov --branch -o ./lcov_report --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" find . -type f -name '*.profraw' -delete From 3eabaa2c1bc11d11b76dd6bd883c2ccc3e22d513 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Tue, 13 Feb 2024 09:24:12 +0300 Subject: [PATCH 085/136] update env Signed-off-by: Nikita Zaporozhets --- housekeeping/docker/env/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/housekeeping/docker/env/Dockerfile b/housekeeping/docker/env/Dockerfile index 7da1278ffa..fcf8178275 100644 --- a/housekeeping/docker/env/Dockerfile +++ b/housekeeping/docker/env/Dockerfile @@ -3,6 +3,7 @@ FROM debian:bullseye-20240130-slim ENV RUSTUP_HOME="/opt/rust" ENV CARGO_HOME="/opt/rust" ENV PATH="$PATH:$RUSTUP_HOME/bin" +ENV CARGO_BUILD_DEP_INFO_BASEDIR="." ENV RUST_VERSION=nightly-2024-01-15 ENV TZ=Europe/Moscow ENV CC=clang-13 From 2e8067719e72c8e3a51101f404363d859cbe2d0d Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Tue, 13 Feb 2024 10:36:56 +0300 Subject: [PATCH 086/136] reduce features for testing Signed-off-by: Nikita Zaporozhets --- housekeeping/build.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/housekeeping/build.sh b/housekeeping/build.sh index f50e11539e..b1492e74d8 100755 --- a/housekeeping/build.sh +++ b/housekeeping/build.sh @@ -55,6 +55,7 @@ else rm -rf ~/.cargo/.package-cache rm Cargo.lock cargo fmt -- --check > /dev/null - cargo test --features $allfeatures + # cargo test --features $allfeatures + cargo test --features private-net fi fi From 536b8d4c3ba297901c14c004f82f9e6149add862 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Tue, 13 Feb 2024 11:34:06 +0300 Subject: [PATCH 087/136] change llvm-tool ver Signed-off-by: Nikita Zaporozhets --- housekeeping/coverage.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/housekeeping/coverage.sh b/housekeeping/coverage.sh index 05dbccdc2b..1fe70c0a1e 100755 --- a/housekeeping/coverage.sh +++ b/housekeeping/coverage.sh @@ -3,7 +3,7 @@ set -e printf '⚡️ Running coverage %s\n' # coverage and generate report -grcov . --binary-path ./target/debug -s . -t cobertura --branch -o coverage --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" --log-level "ERROR" --llvm-path /usr/lib/llvm-14/bin +grcov . --binary-path ./target/debug -s . -t cobertura --branch -o coverage --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" --log-level "ERROR" --llvm-path /usr/lib/llvm-13/bin # delete generated *.profraw find . -type f -name '*.profraw' -delete \ No newline at end of file From 1321b2166b75a8d772f2c9fa1511bda9128d0ea1 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Tue, 13 Feb 2024 15:41:10 +0300 Subject: [PATCH 088/136] test coverage Signed-off-by: Nikita Zaporozhets --- housekeeping/coverage.sh | 2 +- housekeeping/docker/env/Dockerfile | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/housekeeping/coverage.sh b/housekeeping/coverage.sh index 1fe70c0a1e..279031214b 100755 --- a/housekeeping/coverage.sh +++ b/housekeeping/coverage.sh @@ -3,7 +3,7 @@ set -e printf '⚡️ Running coverage %s\n' # coverage and generate report -grcov . --binary-path ./target/debug -s . -t cobertura --branch -o coverage --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" --log-level "ERROR" --llvm-path /usr/lib/llvm-13/bin +grcov . --binary-path ./target/debug -s . -t cobertura --branch -o coverage --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" --log-level="ERROR" --llvm-path='/usr/lib/llvm-14/bin' # delete generated *.profraw find . -type f -name '*.profraw' -delete \ No newline at end of file diff --git a/housekeeping/docker/env/Dockerfile b/housekeeping/docker/env/Dockerfile index fcf8178275..42057912be 100644 --- a/housekeeping/docker/env/Dockerfile +++ b/housekeeping/docker/env/Dockerfile @@ -1,4 +1,4 @@ -FROM debian:bullseye-20240130-slim +FROM debian:bullseye-slim ENV RUSTUP_HOME="/opt/rust" ENV CARGO_HOME="/opt/rust" @@ -6,12 +6,12 @@ ENV PATH="$PATH:$RUSTUP_HOME/bin" ENV CARGO_BUILD_DEP_INFO_BASEDIR="." ENV RUST_VERSION=nightly-2024-01-15 ENV TZ=Europe/Moscow -ENV CC=clang-13 -ENV CXX=clang++-13 +ENV CC=clang-14 +ENV CXX=clang++-14 ENV SUBWASM_VER=v0.14.0 ENV GRCOV_VERSION=0.8.19 -ENV LLVM_TOOLS_VER=13 -ENV CCLANG_VER=13 +ENV LLVM_TOOLS_VER=14 +ENV CCLANG_VER=14 ARG DEBIAN_FRONTEND=noninteractive RUN apt-get update && \ From 92d2a8f2774447bbf41f9fc84749fa228013f8d8 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Tue, 13 Feb 2024 17:40:31 +0300 Subject: [PATCH 089/136] test coverage Signed-off-by: Nikita Zaporozhets --- housekeeping/coverage.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/housekeeping/coverage.sh b/housekeeping/coverage.sh index 279031214b..10f7ab9d0b 100755 --- a/housekeeping/coverage.sh +++ b/housekeeping/coverage.sh @@ -3,7 +3,7 @@ set -e printf '⚡️ Running coverage %s\n' # coverage and generate report -grcov . --binary-path ./target/debug -s . -t cobertura --branch -o coverage --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" --log-level="ERROR" --llvm-path='/usr/lib/llvm-14/bin' +grcov . --binary-path ./target/debug -s . -t cobertura --branch -o ./cobertura_report --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" --log-level="ERROR" --llvm-path='/usr/lib/llvm-14/bin' # delete generated *.profraw find . -type f -name '*.profraw' -delete \ No newline at end of file From 334f47651a1ca4be9a856819fb6668a73018c11c Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Wed, 14 Feb 2024 09:25:55 +0300 Subject: [PATCH 090/136] test coverage name Signed-off-by: Nikita Zaporozhets --- housekeeping/coverage.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/housekeeping/coverage.sh b/housekeeping/coverage.sh index 10f7ab9d0b..886c4a2307 100755 --- a/housekeeping/coverage.sh +++ b/housekeeping/coverage.sh @@ -3,7 +3,7 @@ set -e printf '⚡️ Running coverage %s\n' # coverage and generate report -grcov . --binary-path ./target/debug -s . -t cobertura --branch -o ./cobertura_report --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" --log-level="ERROR" --llvm-path='/usr/lib/llvm-14/bin' +grcov . --binary-path ./target/debug -s . -t cobertura --branch -o ./cobertura.xml --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" --log-level="ERROR" --llvm-path='/usr/lib/llvm-14/bin' # delete generated *.profraw find . -type f -name '*.profraw' -delete \ No newline at end of file From e94d69212eb913a92406667b1c9974b63d3c10e7 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Wed, 14 Feb 2024 11:42:06 +0300 Subject: [PATCH 091/136] small fixes Signed-off-by: Nikita Zaporozhets --- housekeeping/build.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/housekeeping/build.sh b/housekeeping/build.sh index b1492e74d8..28280446be 100755 --- a/housekeeping/build.sh +++ b/housekeeping/build.sh @@ -55,7 +55,9 @@ else rm -rf ~/.cargo/.package-cache rm Cargo.lock cargo fmt -- --check > /dev/null - # cargo test --features $allfeatures - cargo test --features private-net + cargo test --features $allfeatures + if [ $? -ne 1 ]; then + ./coverage.sh + fi fi fi From bfd9510efc3dc629bd5be86d322673990cdd30a3 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Wed, 14 Feb 2024 11:42:51 +0300 Subject: [PATCH 092/136] revert Signed-off-by: Nikita Zaporozhets --- housekeeping/build.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/housekeeping/build.sh b/housekeeping/build.sh index 28280446be..f50e11539e 100755 --- a/housekeeping/build.sh +++ b/housekeeping/build.sh @@ -56,8 +56,5 @@ else rm Cargo.lock cargo fmt -- --check > /dev/null cargo test --features $allfeatures - if [ $? -ne 1 ]; then - ./coverage.sh - fi fi fi From 3b136e677db8c76100a5be74ce97e46f8db810f5 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Wed, 14 Feb 2024 12:37:19 +0300 Subject: [PATCH 093/136] test Signed-off-by: Nikita Zaporozhets --- housekeeping/build.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/housekeeping/build.sh b/housekeeping/build.sh index f50e11539e..e3c11fb9b5 100755 --- a/housekeeping/build.sh +++ b/housekeeping/build.sh @@ -55,6 +55,7 @@ else rm -rf ~/.cargo/.package-cache rm Cargo.lock cargo fmt -- --check > /dev/null - cargo test --features $allfeatures + # cargo test --features $allfeatures + cargo test --features "private-net wip ready-to-test runtime-benchmarks" fi fi From d4d4dde801a325d3bffafa7b82d54a5e1b787fd2 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Wed, 14 Feb 2024 13:07:23 +0300 Subject: [PATCH 094/136] test Signed-off-by: Nikita Zaporozhets --- housekeeping/build.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/housekeeping/build.sh b/housekeeping/build.sh index e3c11fb9b5..b759d03f3b 100755 --- a/housekeeping/build.sh +++ b/housekeeping/build.sh @@ -8,6 +8,7 @@ PACKAGE='framenode-runtime' RUSTFLAGS='-Dwarnings' RUNTIME_DIR='runtime' allfeatures='private-net,wip,ready-to-test,runtime-benchmarks' +buildfeatures=("private-net wip ready-to-test runtime-benchmarks") # build # If TAG_NAME is defined, build for a specific tag @@ -56,6 +57,9 @@ else rm Cargo.lock cargo fmt -- --check > /dev/null # cargo test --features $allfeatures - cargo test --features "private-net wip ready-to-test runtime-benchmarks" + for buildfeature in in "${buildfeatures[@]}"; do + echo '📝 $buildfeature' + cargo test --features $buildfeature + done fi fi From b6662c7f4964a55aeca7a9f5ca533c4f00b5ee7a Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Wed, 14 Feb 2024 13:20:46 +0300 Subject: [PATCH 095/136] test Signed-off-by: Nikita Zaporozhets --- housekeeping/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/housekeeping/build.sh b/housekeeping/build.sh index b759d03f3b..dd9b84d2a5 100755 --- a/housekeeping/build.sh +++ b/housekeeping/build.sh @@ -8,7 +8,7 @@ PACKAGE='framenode-runtime' RUSTFLAGS='-Dwarnings' RUNTIME_DIR='runtime' allfeatures='private-net,wip,ready-to-test,runtime-benchmarks' -buildfeatures=("private-net wip ready-to-test runtime-benchmarks") +buildfeatures=(private-net wip ready-to-test runtime-benchmarks) # build # If TAG_NAME is defined, build for a specific tag From 2ed090ab38e55c9b8a446b75356e4b261bca11f1 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Wed, 14 Feb 2024 13:32:21 +0300 Subject: [PATCH 096/136] fix Signed-off-by: Nikita Zaporozhets --- housekeeping/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/housekeeping/build.sh b/housekeeping/build.sh index dd9b84d2a5..a75eac722f 100755 --- a/housekeeping/build.sh +++ b/housekeeping/build.sh @@ -57,7 +57,7 @@ else rm Cargo.lock cargo fmt -- --check > /dev/null # cargo test --features $allfeatures - for buildfeature in in "${buildfeatures[@]}"; do + for buildfeature in "${buildfeatures[@]}"; do echo '📝 $buildfeature' cargo test --features $buildfeature done From 2ebf6a7164dd295c42301e5633d75e4889245682 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Wed, 14 Feb 2024 13:43:48 +0300 Subject: [PATCH 097/136] fix comments Signed-off-by: Nikita Zaporozhets --- housekeeping/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/housekeeping/build.sh b/housekeeping/build.sh index a75eac722f..594bb57461 100755 --- a/housekeeping/build.sh +++ b/housekeeping/build.sh @@ -58,7 +58,7 @@ else cargo fmt -- --check > /dev/null # cargo test --features $allfeatures for buildfeature in "${buildfeatures[@]}"; do - echo '📝 $buildfeature' + printf "📝 Running tests for "$buildfeature"... \n" cargo test --features $buildfeature done fi From fc1ec1a5424839c6d6483c8e096ffe2121856686 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Wed, 14 Feb 2024 14:08:04 +0300 Subject: [PATCH 098/136] fix comments Signed-off-by: Nikita Zaporozhets --- housekeeping/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/housekeeping/build.sh b/housekeeping/build.sh index 594bb57461..f0c719be11 100755 --- a/housekeeping/build.sh +++ b/housekeeping/build.sh @@ -8,7 +8,7 @@ PACKAGE='framenode-runtime' RUSTFLAGS='-Dwarnings' RUNTIME_DIR='runtime' allfeatures='private-net,wip,ready-to-test,runtime-benchmarks' -buildfeatures=(private-net wip ready-to-test runtime-benchmarks) +buildfeatures=(private-net wip ready-to-test) # build # If TAG_NAME is defined, build for a specific tag From 68624701d2ea4479159010e69bf868867cd8fe21 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Wed, 14 Feb 2024 14:42:38 +0300 Subject: [PATCH 099/136] update build Signed-off-by: Nikita Zaporozhets --- housekeeping/build.sh | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/housekeeping/build.sh b/housekeeping/build.sh index f0c719be11..a912097e26 100755 --- a/housekeeping/build.sh +++ b/housekeeping/build.sh @@ -8,7 +8,6 @@ PACKAGE='framenode-runtime' RUSTFLAGS='-Dwarnings' RUNTIME_DIR='runtime' allfeatures='private-net,wip,ready-to-test,runtime-benchmarks' -buildfeatures=(private-net wip ready-to-test) # build # If TAG_NAME is defined, build for a specific tag @@ -56,10 +55,6 @@ else rm -rf ~/.cargo/.package-cache rm Cargo.lock cargo fmt -- --check > /dev/null - # cargo test --features $allfeatures - for buildfeature in "${buildfeatures[@]}"; do - printf "📝 Running tests for "$buildfeature"... \n" - cargo test --features $buildfeature - done + cargo test --features 'private-net,wip,ready-to-test' fi fi From b72bce36fb302097bc16a65bda7839337b5b30ec Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Wed, 14 Feb 2024 15:22:30 +0300 Subject: [PATCH 100/136] test Signed-off-by: Nikita Zaporozhets --- Jenkinsfile | 1 + housekeeping/build.sh | 3 +++ 2 files changed, 4 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 90a2a3b853..8885524db0 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,6 +4,7 @@ def pipeline = new org.rust.AppPipeline(steps: this, initSubmodules: true, envImageName: 'docker.soramitsu.co.jp/sora2/env:env', appImageName: 'docker.soramitsu.co.jp/sora2/substrate', + codeCoverage: false, codeCoverageCommand: './housekeeping/coverage.sh', cargoDoc: true, smartContractScanner: false, diff --git a/housekeeping/build.sh b/housekeeping/build.sh index a912097e26..f94bcad73a 100755 --- a/housekeeping/build.sh +++ b/housekeeping/build.sh @@ -56,5 +56,8 @@ else rm Cargo.lock cargo fmt -- --check > /dev/null cargo test --features 'private-net,wip,ready-to-test' + if [ $? -ne 1 ]; then + ./coverage.sh + fi fi fi From 0838cf2a13b768ffd536654df621e5cd664f7809 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Wed, 14 Feb 2024 15:51:09 +0300 Subject: [PATCH 101/136] update coverage and env Signed-off-by: Nikita Zaporozhets --- housekeeping/coverage.sh | 4 +++- housekeeping/docker/env/Dockerfile | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/housekeeping/coverage.sh b/housekeeping/coverage.sh index 6a6d5f869a..e680a262ff 100755 --- a/housekeeping/coverage.sh +++ b/housekeeping/coverage.sh @@ -6,4 +6,6 @@ printf '⚡️ Running coverage %s\n' grcov . --binary-path ./target/debug -s . -t lcov --branch -o ./lcov_report --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" --log-level="ERROR" --llvm-path='/usr/lib/llvm-14/bin' # delete generated *.profraw -find . -type f -name '*.profraw' -delete \ No newline at end of file +find . -type f -name '*.profraw' -delete + +lcov_cobertura lcov_report --output coverage \ No newline at end of file diff --git a/housekeeping/docker/env/Dockerfile b/housekeeping/docker/env/Dockerfile index 42057912be..c47e4753ab 100644 --- a/housekeeping/docker/env/Dockerfile +++ b/housekeeping/docker/env/Dockerfile @@ -21,6 +21,7 @@ RUN apt-get update && \ curl \ wget \ git binaryen \ + python3-pip \ docker.io \ make cmake libssl-dev \ software-properties-common && \ @@ -41,6 +42,7 @@ RUN apt-get update && \ rustup component add llvm-tools-preview && \ apt-get autoremove -y && \ apt-get clean && \ + pip install lcov_cobertura && \ rm -rf /var/lib/apt/lists/* && \ rm -rf "${CARGO_HOME}/git" && \ ln -snf /usr/share/zoneinfo/${TZ} /etc/localtime && echo ${TZ} > /etc/timezone \ No newline at end of file From f5997eb8588e776cee23e3570c4618eba7fbedd3 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Wed, 14 Feb 2024 16:17:48 +0300 Subject: [PATCH 102/136] fix path Signed-off-by: Nikita Zaporozhets --- housekeeping/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/housekeeping/build.sh b/housekeeping/build.sh index f94bcad73a..b728cfbcd8 100755 --- a/housekeeping/build.sh +++ b/housekeeping/build.sh @@ -57,7 +57,7 @@ else cargo fmt -- --check > /dev/null cargo test --features 'private-net,wip,ready-to-test' if [ $? -ne 1 ]; then - ./coverage.sh + ./housekeeping/coverage.sh fi fi fi From f52abeb008450d988f32c56a0074f08606f98ebf Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Wed, 14 Feb 2024 16:55:26 +0300 Subject: [PATCH 103/136] update coverage Signed-off-by: Nikita Zaporozhets --- housekeeping/coverage.sh | 2 +- housekeeping/docker/env/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/housekeeping/coverage.sh b/housekeeping/coverage.sh index e680a262ff..34ce07b559 100755 --- a/housekeeping/coverage.sh +++ b/housekeeping/coverage.sh @@ -8,4 +8,4 @@ grcov . --binary-path ./target/debug -s . -t lcov --branch -o ./lcov_report --ig # delete generated *.profraw find . -type f -name '*.profraw' -delete -lcov_cobertura lcov_report --output coverage \ No newline at end of file +lcov_cobertura lcov_report --output coverage.xml \ No newline at end of file diff --git a/housekeeping/docker/env/Dockerfile b/housekeeping/docker/env/Dockerfile index c47e4753ab..5e3886b1da 100644 --- a/housekeeping/docker/env/Dockerfile +++ b/housekeeping/docker/env/Dockerfile @@ -42,7 +42,7 @@ RUN apt-get update && \ rustup component add llvm-tools-preview && \ apt-get autoremove -y && \ apt-get clean && \ - pip install lcov_cobertura && \ + pip3 install lcov_cobertura && \ rm -rf /var/lib/apt/lists/* && \ rm -rf "${CARGO_HOME}/git" && \ ln -snf /usr/share/zoneinfo/${TZ} /etc/localtime && echo ${TZ} > /etc/timezone \ No newline at end of file From 2de3e529212c5937124d5ee4dc8ffc94ba36fe5d Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Wed, 14 Feb 2024 17:31:05 +0300 Subject: [PATCH 104/136] fix Signed-off-by: Nikita Zaporozhets --- housekeeping/coverage.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/housekeeping/coverage.sh b/housekeeping/coverage.sh index 34ce07b559..8a487570e8 100755 --- a/housekeeping/coverage.sh +++ b/housekeeping/coverage.sh @@ -8,4 +8,4 @@ grcov . --binary-path ./target/debug -s . -t lcov --branch -o ./lcov_report --ig # delete generated *.profraw find . -type f -name '*.profraw' -delete -lcov_cobertura lcov_report --output coverage.xml \ No newline at end of file +lcov_cobertura lcov_report --output cobertura.xml \ No newline at end of file From 18cb209d13eb5cf9fd96c88ab0aaea57edcfec41 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Thu, 15 Feb 2024 10:25:12 +0300 Subject: [PATCH 105/136] update env, test lcov Signed-off-by: Nikita Zaporozhets --- housekeeping/build.sh | 2 +- housekeeping/coverage.sh | 3 ++- housekeeping/docker/env/Dockerfile | 6 +++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/housekeeping/build.sh b/housekeeping/build.sh index b728cfbcd8..e4af6df8d3 100755 --- a/housekeeping/build.sh +++ b/housekeeping/build.sh @@ -55,7 +55,7 @@ else rm -rf ~/.cargo/.package-cache rm Cargo.lock cargo fmt -- --check > /dev/null - cargo test --features 'private-net,wip,ready-to-test' + cargo test --features $allfeatures if [ $? -ne 1 ]; then ./housekeeping/coverage.sh fi diff --git a/housekeeping/coverage.sh b/housekeeping/coverage.sh index 8a487570e8..399ada2eb2 100755 --- a/housekeeping/coverage.sh +++ b/housekeeping/coverage.sh @@ -8,4 +8,5 @@ grcov . --binary-path ./target/debug -s . -t lcov --branch -o ./lcov_report --ig # delete generated *.profraw find . -type f -name '*.profraw' -delete -lcov_cobertura lcov_report --output cobertura.xml \ No newline at end of file +# convert lcov to cobertura +# lcov_cobertura lcov_report --output cobertura.xml \ No newline at end of file diff --git a/housekeeping/docker/env/Dockerfile b/housekeeping/docker/env/Dockerfile index 5e3886b1da..74cafe9c56 100644 --- a/housekeeping/docker/env/Dockerfile +++ b/housekeeping/docker/env/Dockerfile @@ -1,4 +1,4 @@ -FROM debian:bullseye-slim +FROM debian:bullseye-20240211-slim ENV RUSTUP_HOME="/opt/rust" ENV CARGO_HOME="/opt/rust" @@ -15,14 +15,13 @@ ENV CCLANG_VER=14 ARG DEBIAN_FRONTEND=noninteractive RUN apt-get update && \ - apt-get install -y \ + apt-get install --no-install-recommends -y \ ca-certificates apt-transport-https gnupg \ libssl-dev pkg-config \ curl \ wget \ git binaryen \ python3-pip \ - docker.io \ make cmake libssl-dev \ software-properties-common && \ curl https://sh.rustup.rs -sSf | sh -s -- -y --no-modify-path --default-toolchain ${RUST_VERSION} && \ @@ -31,6 +30,7 @@ RUN apt-get update && \ wget https://apt.llvm.org/llvm.sh && \ chmod +x llvm.sh && \ ./llvm.sh ${LLVM_TOOLS_VER} && \ + rm llvm.sh && \ apt-get update && \ apt-get install --no-install-recommends -y \ clang-${CCLANG_VER} lldb-${CCLANG_VER} lld-${CCLANG_VER} libclang-${CCLANG_VER}-dev llvm-${LLVM_TOOLS_VER} protobuf-compiler && \ From 72e4f26e0c3a20cb9072749e0fab37d97ef456bf Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Thu, 15 Feb 2024 11:25:54 +0300 Subject: [PATCH 106/136] change build Signed-off-by: Nikita Zaporozhets --- housekeeping/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/housekeeping/build.sh b/housekeeping/build.sh index e4af6df8d3..6b7479c62f 100755 --- a/housekeeping/build.sh +++ b/housekeeping/build.sh @@ -7,7 +7,7 @@ wasmReportFile='subwasm_report.json' PACKAGE='framenode-runtime' RUSTFLAGS='-Dwarnings' RUNTIME_DIR='runtime' -allfeatures='private-net,wip,ready-to-test,runtime-benchmarks' +allfeatures='private-net,wip,ready-to-test' # build # If TAG_NAME is defined, build for a specific tag From 5742cda6f3f4dbe6f97cb2e974feb5cf018eb616 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Thu, 15 Feb 2024 13:45:29 +0300 Subject: [PATCH 107/136] update build Signed-off-by: Nikita Zaporozhets --- housekeeping/build.sh | 7 +-- housekeeping/coverage.sh | 5 +-- housekeeping/docker/env/Dockerfile | 2 - housekeeping/docker/env/Dockerfile.old | 59 -------------------------- 4 files changed, 3 insertions(+), 70 deletions(-) delete mode 100644 housekeeping/docker/env/Dockerfile.old diff --git a/housekeeping/build.sh b/housekeeping/build.sh index 6b7479c62f..140850217d 100755 --- a/housekeeping/build.sh +++ b/housekeeping/build.sh @@ -7,7 +7,7 @@ wasmReportFile='subwasm_report.json' PACKAGE='framenode-runtime' RUSTFLAGS='-Dwarnings' RUNTIME_DIR='runtime' -allfeatures='private-net,wip,ready-to-test' +allfeatures='private-net,wip,ready-to-test,runtime-benchmarks' # build # If TAG_NAME is defined, build for a specific tag @@ -27,7 +27,7 @@ if [[ $buildTag != null ]] && [[ ${TAG_NAME} != null || ${TAG_NAME} != '' ]]; th featureList='include-real-files' sudoCheckStatus=101 fi - printf "⚡️ Testing with features: private-net runtime-benchmark %s\n" + printf "⚡️ Testing with features: private-net runtime-benchmarks %s\n" # we should always run these tests for these features cargo test --release --features "private-net runtime-benchmarks" printf "⚡️ Building with features: %s\n" "$featureList" @@ -56,8 +56,5 @@ else rm Cargo.lock cargo fmt -- --check > /dev/null cargo test --features $allfeatures - if [ $? -ne 1 ]; then - ./housekeeping/coverage.sh - fi fi fi diff --git a/housekeeping/coverage.sh b/housekeeping/coverage.sh index 399ada2eb2..6a6d5f869a 100755 --- a/housekeeping/coverage.sh +++ b/housekeeping/coverage.sh @@ -6,7 +6,4 @@ printf '⚡️ Running coverage %s\n' grcov . --binary-path ./target/debug -s . -t lcov --branch -o ./lcov_report --ignore-not-existing --ignore "/opt/cargo/**" "target/debug" "node/src" --log-level="ERROR" --llvm-path='/usr/lib/llvm-14/bin' # delete generated *.profraw -find . -type f -name '*.profraw' -delete - -# convert lcov to cobertura -# lcov_cobertura lcov_report --output cobertura.xml \ No newline at end of file +find . -type f -name '*.profraw' -delete \ No newline at end of file diff --git a/housekeeping/docker/env/Dockerfile b/housekeeping/docker/env/Dockerfile index 74cafe9c56..c35e2a1663 100644 --- a/housekeeping/docker/env/Dockerfile +++ b/housekeeping/docker/env/Dockerfile @@ -21,7 +21,6 @@ RUN apt-get update && \ curl \ wget \ git binaryen \ - python3-pip \ make cmake libssl-dev \ software-properties-common && \ curl https://sh.rustup.rs -sSf | sh -s -- -y --no-modify-path --default-toolchain ${RUST_VERSION} && \ @@ -42,7 +41,6 @@ RUN apt-get update && \ rustup component add llvm-tools-preview && \ apt-get autoremove -y && \ apt-get clean && \ - pip3 install lcov_cobertura && \ rm -rf /var/lib/apt/lists/* && \ rm -rf "${CARGO_HOME}/git" && \ ln -snf /usr/share/zoneinfo/${TZ} /etc/localtime && echo ${TZ} > /etc/timezone \ No newline at end of file diff --git a/housekeeping/docker/env/Dockerfile.old b/housekeeping/docker/env/Dockerfile.old deleted file mode 100644 index 87e02ea094..0000000000 --- a/housekeeping/docker/env/Dockerfile.old +++ /dev/null @@ -1,59 +0,0 @@ -FROM debian:bullseye-slim - -# Set environment variables -ENV RUSTUP_HOME="/opt/rustup" -ENV CARGO_HOME="/opt/cargo" -ENV PATH="$PATH:$CARGO_HOME/bin" -ENV CARGO_BUILD_DEP_INFO_BASEDIR="." -ENV CC=clang-13 -ENV CXX=clang++-13 - -# Install dependencies -RUN apt-get update && \ - apt-get install --no-install-recommends -y \ - ca-certificates apt-transport-https gnupg \ - libssl-dev pkg-config \ - curl \ - git binaryen \ - make cmake libssl-dev \ - software-properties-common && \ - apt-get autoremove -y && \ - apt-get clean && \ - rm -rf /var/lib/apt/lists/* - -RUN curl -s https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - && \ - echo "deb http://apt.llvm.org/bullseye/ llvm-toolchain-bullseye-13 main" >> /etc/apt/sources.list.d/llvm-toochain-bullseye-13.list && \ - echo "deb-src http://apt.llvm.org/bullseye/ llvm-toolchain-bullseye-13 main" >> /etc/apt/sources.list.d/llvm-toochain-bullseye-13.list && \ - apt-get -y update && \ - apt-get install -y --no-install-recommends \ - clang-13 lldb-13 lld-13 libclang-13-dev llvm-13 protobuf-compiler && \ - update-alternatives --install /usr/bin/cc cc /usr/bin/clang-13 100 && \ - apt-get autoremove -y && \ - apt-get clean && \ - rm -rf /var/lib/apt/lists/* - -# Install docker -RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - -RUN add-apt-repository \ - "deb https://download.docker.com/linux/debian $(lsb_release -cs) stable" && \ - apt-get update && \ - apt-get install --no-install-recommends -y \ - docker-ce docker-ce-cli containerd.io && \ - apt-get autoremove -y && \ - apt-get clean && \ - rm -rf /var/lib/apt/lists/* - -# Install rust -ENV RUST_NIGHTLY_VERSION=nightly-2023-03-21 -RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --no-modify-path --default-toolchain stable && \ - rustup toolchain install ${RUST_NIGHTLY_VERSION} && \ - rustup target add wasm32-unknown-unknown && \ - rustup target add wasm32-unknown-unknown --toolchain ${RUST_NIGHTLY_VERSION} && \ - rm -rf "${CARGO_HOME}/registry" "${CARGO_HOME}/git" - -RUN curl https://github.com/chevdor/subwasm/releases/download/v0.17.0/subwasm_linux_amd64_v0.17.0.deb -sSL -o subw.deb && \ - dpkg -i subw.deb && rm subw.deb - -RUN cargo install grcov && \ - rustup component add llvm-tools-preview && \ - rm -rf "${CARGO_HOME}/registry" "${CARGO_HOME}/git" \ No newline at end of file From cfaac505a517fac7dc6ba6704021ffd79ba2a9d9 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Thu, 15 Feb 2024 13:46:26 +0300 Subject: [PATCH 108/136] update Jenkinsfile Signed-off-by: Nikita Zaporozhets --- Jenkinsfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 8885524db0..90a2a3b853 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,7 +4,6 @@ def pipeline = new org.rust.AppPipeline(steps: this, initSubmodules: true, envImageName: 'docker.soramitsu.co.jp/sora2/env:env', appImageName: 'docker.soramitsu.co.jp/sora2/substrate', - codeCoverage: false, codeCoverageCommand: './housekeeping/coverage.sh', cargoDoc: true, smartContractScanner: false, From 3250dc3e0c08b8433487ea79c0bf84b61910fa5e Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Thu, 15 Feb 2024 14:35:28 +0300 Subject: [PATCH 109/136] update Jenkinsfile Signed-off-by: Nikita Zaporozhets --- housekeeping/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/housekeeping/build.sh b/housekeeping/build.sh index 140850217d..8458ca915e 100755 --- a/housekeeping/build.sh +++ b/housekeeping/build.sh @@ -7,7 +7,7 @@ wasmReportFile='subwasm_report.json' PACKAGE='framenode-runtime' RUSTFLAGS='-Dwarnings' RUNTIME_DIR='runtime' -allfeatures='private-net,wip,ready-to-test,runtime-benchmarks' +allfeatures='private-net,wip,ready-to-test' # build # If TAG_NAME is defined, build for a specific tag From 77b8d49f912bf7451cd01f2a228622e0e1156b8e Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Thu, 15 Feb 2024 14:45:18 +0300 Subject: [PATCH 110/136] test build func Signed-off-by: Nikita Zaporozhets --- housekeeping/build.sh | 54 +++++++++++++++++++++++-------------------- 1 file changed, 29 insertions(+), 25 deletions(-) diff --git a/housekeeping/build.sh b/housekeeping/build.sh index 8458ca915e..8da9d2ca59 100755 --- a/housekeeping/build.sh +++ b/housekeeping/build.sh @@ -9,41 +9,45 @@ RUSTFLAGS='-Dwarnings' RUNTIME_DIR='runtime' allfeatures='private-net,wip,ready-to-test' +# build func +build() { + featureList=$1 + sudoCheckStatus=$2 + printf "⚡️ Testing with features: private-net runtime-benchmarks %s\n" + cargo test --release --features "private-net runtime-benchmarks" + printf "⚡️ Building with features: %s\n" "$featureList" + printf "⚡️ Checking sudo pallet: %s\n" "$sudoCheckStatus" + rm -rf target + cargo build --release --features "$featureList" + mv ./target/release/framenode . + mv ./target/release/relayer ./relayer.bin + mv ./target/release/wbuild/framenode-runtime/framenode_runtime.compact.compressed.wasm ./framenode_runtime.compact.compressed.wasm + subwasm --json info framenode_runtime.compact.compressed.wasm > $wasmReportFile + subwasm metadata framenode_runtime.compact.compressed.wasm > $palletListFile + set +e + subwasm metadata -m Sudo framenode_runtime.compact.compressed.wasm + if [[ $(echo $?) -eq $sudoCheckStatus ]]; then + echo "✅ sudo check is successful!" + else + echo "❌ sudo check is failed!" + exit 1 + fi +} + # build # If TAG_NAME is defined, build for a specific tag if [[ $buildTag != null ]] && [[ ${TAG_NAME} != null || ${TAG_NAME} != '' ]]; then printf "⚡️ Tag is %s\n" $buildTag ${TAG_NAME} - build=true if [[ ${TAG_NAME} =~ 'benchmarking'* ]]; then - featureList='private-net runtime-benchmarks' - sudoCheckStatus=0 + build 'private-net runtime-benchmarks' 0 elif [[ ${TAG_NAME} =~ 'stage'* ]]; then - featureList='private-net include-real-files ready-to-test' - sudoCheckStatus=0 + build 'private-net include-real-files ready-to-test' 0 elif [[ ${TAG_NAME} =~ 'test'* ]]; then - featureList='private-net include-real-files reduced-pswap-reward-periods ready-to-test' - sudoCheckStatus=0 + build 'private-net include-real-files reduced-pswap-reward-periods ready-to-test' 0 elif [[ -n ${TAG_NAME} && ${TAG_NAME} != 'predev' ]]; then - featureList='include-real-files' - sudoCheckStatus=101 + build 'include-real-files' 101 fi - printf "⚡️ Testing with features: private-net runtime-benchmarks %s\n" - # we should always run these tests for these features - cargo test --release --features "private-net runtime-benchmarks" - printf "⚡️ Building with features: %s\n" "$featureList" - printf "⚡️ Checking sudo pallet: %s\n" "$sudoCheckStatus" - rm -rf target - cargo build --release --features "$featureList" - mv ./target/release/framenode . - mv ./target/release/relayer ./relayer.bin - mv ./target/release/wbuild/framenode-runtime/framenode_runtime.compact.compressed.wasm ./framenode_runtime.compact.compressed.wasm - subwasm --json info framenode_runtime.compact.compressed.wasm > $wasmReportFile - subwasm metadata framenode_runtime.compact.compressed.wasm > $palletListFile - set +e - subwasm metadata -m Sudo framenode_runtime.compact.compressed.wasm - if [[ $(echo $?) -eq $sudoCheckStatus ]]; then echo "✅ sudo check is successful!"; else echo "❌ sudo check is failed!"; exit 1; fi else - # If TAG_NAME is not defined, run tests and checks if [[ $prBranch == 'master' ]]; then printf "⚡️ Running tests and migrations %s\n" RUST_LOG="debug cargo test --features try-runtime -- run_migrations" From 10cfff4880b62a5ba0810ace46f755f8c62d6c1f Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Thu, 15 Feb 2024 17:23:10 +0300 Subject: [PATCH 111/136] update build Signed-off-by: Nikita Zaporozhets --- housekeeping/build.sh | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/housekeeping/build.sh b/housekeeping/build.sh index 8da9d2ca59..e89314e511 100755 --- a/housekeeping/build.sh +++ b/housekeeping/build.sh @@ -10,11 +10,25 @@ RUNTIME_DIR='runtime' allfeatures='private-net,wip,ready-to-test' # build func +releasetest(){ + printf "⚡️ Testing with features: private-net runtime-benchmarks %s\n" + cargo test --release --features "private-net runtime-benchmarks" +} + +test(){ + printf "⚡️ Running Tests for code coverage only %s\n" + export RUSTFLAGS="-Cinstrument-coverage" + export SKIP_WASM_BUILD=1 + export LLVM_PROFILE_FILE="sora2-%p-%m.profraw" + rm -rf ~/.cargo/.package-cache + rm Cargo.lock + cargo fmt -- --check > /dev/null + cargo test --features $allfeatures +} + build() { featureList=$1 sudoCheckStatus=$2 - printf "⚡️ Testing with features: private-net runtime-benchmarks %s\n" - cargo test --release --features "private-net runtime-benchmarks" printf "⚡️ Building with features: %s\n" "$featureList" printf "⚡️ Checking sudo pallet: %s\n" "$sudoCheckStatus" rm -rf target @@ -26,7 +40,7 @@ build() { subwasm metadata framenode_runtime.compact.compressed.wasm > $palletListFile set +e subwasm metadata -m Sudo framenode_runtime.compact.compressed.wasm - if [[ $(echo $?) -eq $sudoCheckStatus ]]; then + if [[ $? -eq $sudoCheckStatus ]]; then echo "✅ sudo check is successful!" else echo "❌ sudo check is failed!" @@ -38,6 +52,7 @@ build() { # If TAG_NAME is defined, build for a specific tag if [[ $buildTag != null ]] && [[ ${TAG_NAME} != null || ${TAG_NAME} != '' ]]; then printf "⚡️ Tag is %s\n" $buildTag ${TAG_NAME} + releasetest if [[ ${TAG_NAME} =~ 'benchmarking'* ]]; then build 'private-net runtime-benchmarks' 0 elif [[ ${TAG_NAME} =~ 'stage'* ]]; then @@ -52,13 +67,6 @@ else printf "⚡️ Running tests and migrations %s\n" RUST_LOG="debug cargo test --features try-runtime -- run_migrations" else - printf "⚡️ Running Tests for code coverage only %s\n" - export RUSTFLAGS="-Cinstrument-coverage" - export SKIP_WASM_BUILD=1 - export LLVM_PROFILE_FILE="sora2-%p-%m.profraw" - rm -rf ~/.cargo/.package-cache - rm Cargo.lock - cargo fmt -- --check > /dev/null - cargo test --features $allfeatures + test fi fi From 2ebb7eb4b61937a2157b1e8948df1b8267e33b31 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Wed, 21 Feb 2024 09:17:40 +0300 Subject: [PATCH 112/136] fix comment Signed-off-by: Nikita Zaporozhets --- housekeeping/docker/env/Dockerfile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/housekeeping/docker/env/Dockerfile b/housekeeping/docker/env/Dockerfile index c35e2a1663..f1cd4a73f4 100644 --- a/housekeeping/docker/env/Dockerfile +++ b/housekeeping/docker/env/Dockerfile @@ -18,12 +18,11 @@ RUN apt-get update && \ apt-get install --no-install-recommends -y \ ca-certificates apt-transport-https gnupg \ libssl-dev pkg-config \ - curl \ wget \ git binaryen \ make cmake libssl-dev \ software-properties-common && \ - curl https://sh.rustup.rs -sSf | sh -s -- -y --no-modify-path --default-toolchain ${RUST_VERSION} && \ + wget -O - https://sh.rustup.rs | sh -s -- -y --no-modify-path --default-toolchain ${RUST_VERSION} && \ rustup toolchain install ${RUST_VERSION} && \ rustup target add wasm32-unknown-unknown --toolchain ${RUST_VERSION} && \ wget https://apt.llvm.org/llvm.sh && \ @@ -34,7 +33,7 @@ RUN apt-get update && \ apt-get install --no-install-recommends -y \ clang-${CCLANG_VER} lldb-${CCLANG_VER} lld-${CCLANG_VER} libclang-${CCLANG_VER}-dev llvm-${LLVM_TOOLS_VER} protobuf-compiler && \ update-alternatives --install /usr/bin/cc cc /usr/bin/${CC} 100 && \ - curl https://github.com/chevdor/subwasm/releases/download/${SUBWASM_VER}/subwasm_linux_amd64_${SUBWASM_VER}.deb -sSL -o subw.deb && \ + wget https://github.com/chevdor/subwasm/releases/download/${SUBWASM_VER}/subwasm_linux_amd64_${SUBWASM_VER}.deb -O subw.deb && \ dpkg -i subw.deb && rm subw.deb && \ rustup update && \ cargo install grcov --version ${GRCOV_VERSION} && \ From cbfccb9a30cc86b805089b6d941dc5a92f6156a7 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Fri, 23 Feb 2024 09:53:04 +0300 Subject: [PATCH 113/136] update build Signed-off-by: Nikita Zaporozhets --- housekeeping/build.sh | 77 +++++++++++++++++++++---------------------- 1 file changed, 38 insertions(+), 39 deletions(-) diff --git a/housekeeping/build.sh b/housekeeping/build.sh index e89314e511..fd31e764d9 100755 --- a/housekeeping/build.sh +++ b/housekeeping/build.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -x set -e # environment @@ -10,31 +10,47 @@ RUNTIME_DIR='runtime' allfeatures='private-net,wip,ready-to-test' # build func -releasetest(){ - printf "⚡️ Testing with features: private-net runtime-benchmarks %s\n" - cargo test --release --features "private-net runtime-benchmarks" -} - -test(){ - printf "⚡️ Running Tests for code coverage only %s\n" - export RUSTFLAGS="-Cinstrument-coverage" - export SKIP_WASM_BUILD=1 - export LLVM_PROFILE_FILE="sora2-%p-%m.profraw" - rm -rf ~/.cargo/.package-cache - rm Cargo.lock - cargo fmt -- --check > /dev/null - cargo test --features $allfeatures +test() { + if [[ ${buildTag} != null ]] && [[ ${TAG_NAME} != null || ${TAG_NAME} != '' ]]; then + printf "Tag is %s\n" ${TAG_NAME} ${buildTag} + printf "BuildTag is %s\n" ${buildTag} + printf "⚡️ Testing with features: private-net runtime-benchmarks\n" + cargo test --release --features "private-net runtime-benchmarks" + elif [[ ${prBranch} = 'master' ]]; then + printf "⚡️ This is $prbranch Running tests and migrations %s\n" + RUST_LOG="debug cargo test --features try-runtime -- run_migrations" + else + printf "⚡️ Running Tests for code coverage only\n" + export RUSTFLAGS="-Cinstrument-coverage" + export SKIP_WASM_BUILD=1 + export LLVM_PROFILE_FILE="sora2-%p-%m.profraw" + rm -rf ~/.cargo/.package-cache + cargo fmt -- --check > /dev/null + cargo test --features $allfeatures + fi } build() { - featureList=$1 - sudoCheckStatus=$2 + printf "Tag is %s\n" ${TAG_NAME} + printf "BuildTag is %s\n" ${buildTag} + sudoCheckStatus="0" + if [[ ${TAG_NAME} =~ 'benchmarking'* ]]; then + featureList='private-net runtime-benchmarks' + elif [[ ${TAG_NAME} =~ 'stage'* ]]; then + featureList='private-net include-real-files ready-to-test' + elif [[ ${TAG_NAME} =~ 'test'* || -n ${buildTag} ]]; then + featureList='private-net include-real-files reduced-pswap-reward-periods ready-to-test' + elif [[ -n ${TAG_NAME} && ${TAG_NAME} != 'predev' ]]; then + featureList='include-real-files' + sudoCheckStatus="101" + elif [[ -n ${buildTag} ]]; then + featureList='private-net include-real-files reduced-pswap-reward-periods wip ready-to-test' + fi printf "⚡️ Building with features: %s\n" "$featureList" printf "⚡️ Checking sudo pallet: %s\n" "$sudoCheckStatus" rm -rf target cargo build --release --features "$featureList" mv ./target/release/framenode . - mv ./target/release/relayer ./relayer.bin mv ./target/release/wbuild/framenode-runtime/framenode_runtime.compact.compressed.wasm ./framenode_runtime.compact.compressed.wasm subwasm --json info framenode_runtime.compact.compressed.wasm > $wasmReportFile subwasm metadata framenode_runtime.compact.compressed.wasm > $palletListFile @@ -48,25 +64,8 @@ build() { fi } -# build -# If TAG_NAME is defined, build for a specific tag -if [[ $buildTag != null ]] && [[ ${TAG_NAME} != null || ${TAG_NAME} != '' ]]; then - printf "⚡️ Tag is %s\n" $buildTag ${TAG_NAME} - releasetest - if [[ ${TAG_NAME} =~ 'benchmarking'* ]]; then - build 'private-net runtime-benchmarks' 0 - elif [[ ${TAG_NAME} =~ 'stage'* ]]; then - build 'private-net include-real-files ready-to-test' 0 - elif [[ ${TAG_NAME} =~ 'test'* ]]; then - build 'private-net include-real-files reduced-pswap-reward-periods ready-to-test' 0 - elif [[ -n ${TAG_NAME} && ${TAG_NAME} != 'predev' ]]; then - build 'include-real-files' 101 - fi +if [ "$(type -t $1)" = "function" ]; then + "$1" else - if [[ $prBranch == 'master' ]]; then - printf "⚡️ Running tests and migrations %s\n" - RUST_LOG="debug cargo test --features try-runtime -- run_migrations" - else - test - fi -fi + echo "Func '$1' is not exists in this workflow. Skipped." +fi \ No newline at end of file From a72f4f77a84e960aec70f16802e9368576723156 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Fri, 23 Feb 2024 10:06:49 +0300 Subject: [PATCH 114/136] fix Signed-off-by: Nikita Zaporozhets --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 90a2a3b853..47a85fc81f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -10,7 +10,7 @@ def pipeline = new org.rust.AppPipeline(steps: this, clippyLinter: false, cargoClippyTag: ':substrate', cargoClippyCmds: ['housekeeping/clippy.sh'], - buildTestCmds: ['housekeeping/build.sh'], + buildTestCmds: 'housekeeping/build.sh', buildArtifacts: 'framenode_runtime.compact.compressed.wasm, subwasm_report.json, pallet_list.txt', pushToPublicRegistry: true, sonarProjectKey: 'sora:sora2-network', From 37fbff137d5cd6aae5baece1bfbca452dc76ea75 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Sat, 24 Feb 2024 10:45:41 +0300 Subject: [PATCH 115/136] fix Signed-off-by: Nikita Zaporozhets --- housekeeping/build.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/housekeeping/build.sh b/housekeeping/build.sh index fd31e764d9..ab6fc3a06c 100755 --- a/housekeeping/build.sh +++ b/housekeeping/build.sh @@ -11,13 +11,11 @@ allfeatures='private-net,wip,ready-to-test' # build func test() { - if [[ ${buildTag} != null ]] && [[ ${TAG_NAME} != null || ${TAG_NAME} != '' ]]; then - printf "Tag is %s\n" ${TAG_NAME} ${buildTag} - printf "BuildTag is %s\n" ${buildTag} + if [[ -n ${buildTag} && (${TAG_NAME} != "null" || ${TAG_NAME} != '') ]]; then printf "⚡️ Testing with features: private-net runtime-benchmarks\n" cargo test --release --features "private-net runtime-benchmarks" elif [[ ${prBranch} = 'master' ]]; then - printf "⚡️ This is $prbranch Running tests and migrations %s\n" + printf "⚡️ This is "${prbranch}" Running tests and migrations %s\n" RUST_LOG="debug cargo test --features try-runtime -- run_migrations" else printf "⚡️ Running Tests for code coverage only\n" From 7574c2726a938aeed348712b6b449fff1db9e91c Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Sat, 24 Feb 2024 12:25:00 +0300 Subject: [PATCH 116/136] revert Signed-off-by: Nikita Zaporozhets --- housekeeping/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/housekeeping/build.sh b/housekeeping/build.sh index ab6fc3a06c..c4915911af 100755 --- a/housekeeping/build.sh +++ b/housekeeping/build.sh @@ -11,7 +11,7 @@ allfeatures='private-net,wip,ready-to-test' # build func test() { - if [[ -n ${buildTag} && (${TAG_NAME} != "null" || ${TAG_NAME} != '') ]]; then + [[ $buildTag != null ]] && [[ ${TAG_NAME} != null || ${TAG_NAME} != '' ]]; then printf "⚡️ Testing with features: private-net runtime-benchmarks\n" cargo test --release --features "private-net runtime-benchmarks" elif [[ ${prBranch} = 'master' ]]; then From 8c846d621c5834b10007ba5144c1690183a96114 Mon Sep 17 00:00:00 2001 From: f33r0 <95526886+f33r0@users.noreply.github.com> Date: Sat, 24 Feb 2024 12:41:28 +0300 Subject: [PATCH 117/136] Update build.sh --- housekeeping/build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/housekeeping/build.sh b/housekeeping/build.sh index c4915911af..7f024bf994 100755 --- a/housekeeping/build.sh +++ b/housekeeping/build.sh @@ -11,7 +11,7 @@ allfeatures='private-net,wip,ready-to-test' # build func test() { - [[ $buildTag != null ]] && [[ ${TAG_NAME} != null || ${TAG_NAME} != '' ]]; then + if [[ $buildTag != null ]] && [[ ${TAG_NAME} != null || ${TAG_NAME} != '' ]]; then printf "⚡️ Testing with features: private-net runtime-benchmarks\n" cargo test --release --features "private-net runtime-benchmarks" elif [[ ${prBranch} = 'master' ]]; then @@ -66,4 +66,4 @@ if [ "$(type -t $1)" = "function" ]; then "$1" else echo "Func '$1' is not exists in this workflow. Skipped." -fi \ No newline at end of file +fi From f37751309e2fdb43dd207d4d4a63a68aa676ff08 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Mon, 26 Feb 2024 09:00:12 +0300 Subject: [PATCH 118/136] ready for merge Signed-off-by: Nikita Zaporozhets --- Jenkinsfile | 2 +- Jenkinsfile-env | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 47a85fc81f..2fe6d07fcc 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,4 +1,4 @@ -@Library('jenkins-library@feature/dops-2942-update_rust_lib') _ +@Library('jenkins-library') _ def pipeline = new org.rust.AppPipeline(steps: this, initSubmodules: true, diff --git a/Jenkinsfile-env b/Jenkinsfile-env index ba9c2de24d..0474074cb5 100644 --- a/Jenkinsfile-env +++ b/Jenkinsfile-env @@ -4,9 +4,9 @@ def pipeline = new org.docker.AppPipeline(steps: this, dockerImageName: 'sora2/env', dockerRegistryCred: 'bot-sora2-rw', dockerFileName: "housekeeping/docker/env/Dockerfile", - // triggerCommonBuildExpression: (env.BRANCH_NAME in ['develop', 'master']), + triggerCommonBuildExpression: (env.BRANCH_NAME in ['develop', 'master']), triggerCommonBuildGrepRegex: 'housekeeping', secretScannerExclusion: '.*Cargo.toml', nameCI: 'env-CI', - dockerImageTags: ['master': 'env', 'develop': 'env', 'feature/dops-2942-update-build': 'env']) + dockerImageTags: ['master': 'env', 'develop': 'env']) pipeline.runPipeline() From b2ef4ac6cc42ab6550348a31923a34fdf0ec192b Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Mon, 26 Feb 2024 09:06:01 +0300 Subject: [PATCH 119/136] revert .env Signed-off-by: Nikita Zaporozhets --- .gitignore | 4 +--- bridge-docker/.env | 2 ++ bridge-docker/docker-compose.evm.yml | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) create mode 100644 bridge-docker/.env diff --git a/.gitignore b/.gitignore index 88ec5cc2f1..e842c895ff 100644 --- a/.gitignore +++ b/.gitignore @@ -27,6 +27,4 @@ db? .vscode/launch.json # Generated folder for benchmark results (order book extra benchmarks) -benches/ - -.env \ No newline at end of file +benches/ \ No newline at end of file diff --git a/bridge-docker/.env b/bridge-docker/.env new file mode 100644 index 0000000000..0e86675162 --- /dev/null +++ b/bridge-docker/.env @@ -0,0 +1,2 @@ +DATABASE_URL_PGWEB="postgres://postgres:postgres@bridge-postgres:5432/postgres?sslmode=disable" +DATABASE_URL_BLOCKSCOUT="postgresql://postgres:@bridge-postgres:5432/postgres?ssl=false" diff --git a/bridge-docker/docker-compose.evm.yml b/bridge-docker/docker-compose.evm.yml index a8fa310702..919dc374bc 100644 --- a/bridge-docker/docker-compose.evm.yml +++ b/bridge-docker/docker-compose.evm.yml @@ -142,7 +142,7 @@ services: ports: - "8081:8081" environment: - - DATABASE_URL=${DATABASE_URL} + - DATABASE_URL=${DATABASE_URL_PGWEB} depends_on: - postgres networks: @@ -168,7 +168,7 @@ services: ETHEREUM_JSONRPC_VARIANT: 'geth' BLOCK_TRANSFORMER: 'base' ETHEREUM_JSONRPC_HTTP_URL: http://bridge-geth:8545/ - DATABASE_URL: ${DATABASE_URL} + DATABASE_URL: ${DATABASE_URL_BLOCKSCOUT} ECTO_USE_SSL: 'false' SECRET_KEY_BASE: ${SECRET_KEY_BASE} ports: From a9b2f9eaa29a88356ca5a260ec49fd7d7b5ca954 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Mon, 26 Feb 2024 09:07:44 +0300 Subject: [PATCH 120/136] fix Signed-off-by: Nikita Zaporozhets --- housekeeping/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/housekeeping/build.sh b/housekeeping/build.sh index 7f024bf994..ccdfc48a7e 100755 --- a/housekeeping/build.sh +++ b/housekeeping/build.sh @@ -1,4 +1,4 @@ -#!/bin/bash -x +#!/bin/bash set -e # environment From 0c7044b164e2c2388a9d796a5f56165e8df7344c Mon Sep 17 00:00:00 2001 From: f33r0 <95526886+f33r0@users.noreply.github.com> Date: Mon, 26 Feb 2024 09:14:46 +0300 Subject: [PATCH 121/136] Update .env --- bridge-docker/.env | 1 + 1 file changed, 1 insertion(+) diff --git a/bridge-docker/.env b/bridge-docker/.env index 0e86675162..f79712ebc6 100644 --- a/bridge-docker/.env +++ b/bridge-docker/.env @@ -1,2 +1,3 @@ DATABASE_URL_PGWEB="postgres://postgres:postgres@bridge-postgres:5432/postgres?sslmode=disable" DATABASE_URL_BLOCKSCOUT="postgresql://postgres:@bridge-postgres:5432/postgres?ssl=false" +SECRET_KEY_BASE="56NtB48ear7+wMSf0IQuWDAAazhpb31qyc7GiyspBP2vh7t5zlCsF5QDv76chXeN" From 8d2b12df884a101181a2946326e1846e4affc805 Mon Sep 17 00:00:00 2001 From: f33r0 <95526886+f33r0@users.noreply.github.com> Date: Tue, 27 Feb 2024 09:07:04 +0300 Subject: [PATCH 122/136] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 2fe6d07fcc..47a85fc81f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,4 +1,4 @@ -@Library('jenkins-library') _ +@Library('jenkins-library@feature/dops-2942-update_rust_lib') _ def pipeline = new org.rust.AppPipeline(steps: this, initSubmodules: true, From c6efe50e0d06d3aba9f89b52553b6b067a6bede4 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Tue, 27 Feb 2024 15:53:44 +0300 Subject: [PATCH 123/136] fix Signed-off-by: Nikita Zaporozhets --- bridge-docker/.env | 3 +-- bridge-docker/docker-compose.evm.yml | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/bridge-docker/.env b/bridge-docker/.env index f79712ebc6..f1fc5a952d 100644 --- a/bridge-docker/.env +++ b/bridge-docker/.env @@ -1,3 +1,2 @@ -DATABASE_URL_PGWEB="postgres://postgres:postgres@bridge-postgres:5432/postgres?sslmode=disable" -DATABASE_URL_BLOCKSCOUT="postgresql://postgres:@bridge-postgres:5432/postgres?ssl=false" +DATABASE_URL="postgres://postgres:postgres@bridge-postgres:5432/postgres?sslmode=disable" SECRET_KEY_BASE="56NtB48ear7+wMSf0IQuWDAAazhpb31qyc7GiyspBP2vh7t5zlCsF5QDv76chXeN" diff --git a/bridge-docker/docker-compose.evm.yml b/bridge-docker/docker-compose.evm.yml index 919dc374bc..a8fa310702 100644 --- a/bridge-docker/docker-compose.evm.yml +++ b/bridge-docker/docker-compose.evm.yml @@ -142,7 +142,7 @@ services: ports: - "8081:8081" environment: - - DATABASE_URL=${DATABASE_URL_PGWEB} + - DATABASE_URL=${DATABASE_URL} depends_on: - postgres networks: @@ -168,7 +168,7 @@ services: ETHEREUM_JSONRPC_VARIANT: 'geth' BLOCK_TRANSFORMER: 'base' ETHEREUM_JSONRPC_HTTP_URL: http://bridge-geth:8545/ - DATABASE_URL: ${DATABASE_URL_BLOCKSCOUT} + DATABASE_URL: ${DATABASE_URL} ECTO_USE_SSL: 'false' SECRET_KEY_BASE: ${SECRET_KEY_BASE} ports: From 74eb5eaaae53b6e883a2839be12e073fcd34a21b Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Tue, 27 Feb 2024 16:00:29 +0300 Subject: [PATCH 124/136] fix scanner Signed-off-by: Nikita Zaporozhets --- bridge-docker/.env | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bridge-docker/.env b/bridge-docker/.env index f1fc5a952d..b19f836dd6 100644 --- a/bridge-docker/.env +++ b/bridge-docker/.env @@ -1,2 +1,3 @@ -DATABASE_URL="postgres://postgres:postgres@bridge-postgres:5432/postgres?sslmode=disable" -SECRET_KEY_BASE="56NtB48ear7+wMSf0IQuWDAAazhpb31qyc7GiyspBP2vh7t5zlCsF5QDv76chXeN" +DATABASE_URL="postgres://postgres:${DATABASE_PASSWORD}@bridge-postgres:5432/postgres?sslmode=disable" +DATABASE_PASSWORD="postgres" +SECRET_KEY_BASE="56NtB48ear7+wMSf0IQuWDAAazhpb31qyc7GiyspBP2vh7t5zlCsF5QDv76chXeN" \ No newline at end of file From 14a6d3a2b1a501bb6c0402a4939434baa7d96c77 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Tue, 27 Feb 2024 16:12:52 +0300 Subject: [PATCH 125/136] fix scanner Signed-off-by: Nikita Zaporozhets --- Jenkinsfile-env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile-env b/Jenkinsfile-env index 0474074cb5..a6345276e6 100644 --- a/Jenkinsfile-env +++ b/Jenkinsfile-env @@ -6,7 +6,7 @@ def pipeline = new org.docker.AppPipeline(steps: this, dockerFileName: "housekeeping/docker/env/Dockerfile", triggerCommonBuildExpression: (env.BRANCH_NAME in ['develop', 'master']), triggerCommonBuildGrepRegex: 'housekeeping', - secretScannerExclusion: '.*Cargo.toml', + secretScannerExclusion: '.*Cargo.toml$|.*env\$', nameCI: 'env-CI', dockerImageTags: ['master': 'env', 'develop': 'env']) pipeline.runPipeline() From 23624ffc691708dd77af9e264f0db70760bc0736 Mon Sep 17 00:00:00 2001 From: f33r0 <95526886+f33r0@users.noreply.github.com> Date: Tue, 27 Feb 2024 17:07:08 +0300 Subject: [PATCH 126/136] Update Jenkinsfile-env --- Jenkinsfile-env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile-env b/Jenkinsfile-env index a6345276e6..f22f251113 100644 --- a/Jenkinsfile-env +++ b/Jenkinsfile-env @@ -8,5 +8,5 @@ def pipeline = new org.docker.AppPipeline(steps: this, triggerCommonBuildGrepRegex: 'housekeeping', secretScannerExclusion: '.*Cargo.toml$|.*env\$', nameCI: 'env-CI', - dockerImageTags: ['master': 'env', 'develop': 'env']) + dockerImageTags: ['develop': 'env']) pipeline.runPipeline() From 6fce46443271ca660fc86000ca7595922e8e4944 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Tue, 27 Feb 2024 20:24:21 +0300 Subject: [PATCH 127/136] update subwasm Signed-off-by: Nikita Zaporozhets --- housekeeping/docker/env/Dockerfile | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/housekeeping/docker/env/Dockerfile b/housekeeping/docker/env/Dockerfile index f1cd4a73f4..e323cd00e5 100644 --- a/housekeeping/docker/env/Dockerfile +++ b/housekeeping/docker/env/Dockerfile @@ -8,7 +8,7 @@ ENV RUST_VERSION=nightly-2024-01-15 ENV TZ=Europe/Moscow ENV CC=clang-14 ENV CXX=clang++-14 -ENV SUBWASM_VER=v0.14.0 +ENV SUBWASM_VER=v0.20.0 ENV GRCOV_VERSION=0.8.19 ENV LLVM_TOOLS_VER=14 ENV CCLANG_VER=14 @@ -20,7 +20,7 @@ RUN apt-get update && \ libssl-dev pkg-config \ wget \ git binaryen \ - make cmake libssl-dev \ + make cmake \ software-properties-common && \ wget -O - https://sh.rustup.rs | sh -s -- -y --no-modify-path --default-toolchain ${RUST_VERSION} && \ rustup toolchain install ${RUST_VERSION} && \ @@ -33,9 +33,8 @@ RUN apt-get update && \ apt-get install --no-install-recommends -y \ clang-${CCLANG_VER} lldb-${CCLANG_VER} lld-${CCLANG_VER} libclang-${CCLANG_VER}-dev llvm-${LLVM_TOOLS_VER} protobuf-compiler && \ update-alternatives --install /usr/bin/cc cc /usr/bin/${CC} 100 && \ - wget https://github.com/chevdor/subwasm/releases/download/${SUBWASM_VER}/subwasm_linux_amd64_${SUBWASM_VER}.deb -O subw.deb && \ - dpkg -i subw.deb && rm subw.deb && \ rustup update && \ + cargo install --locked --git https://github.com/chevdor/subwasm --tag ${SUBWASM_VER} && \ cargo install grcov --version ${GRCOV_VERSION} && \ rustup component add llvm-tools-preview && \ apt-get autoremove -y && \ From 3ac2357a60f31d3264d0a2c150e619fee6cff695 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Wed, 28 Feb 2024 09:40:52 +0300 Subject: [PATCH 128/136] update build Signed-off-by: Nikita Zaporozhets --- housekeeping/build.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/housekeeping/build.sh b/housekeeping/build.sh index ccdfc48a7e..f3fe3ca7e3 100755 --- a/housekeeping/build.sh +++ b/housekeeping/build.sh @@ -11,13 +11,13 @@ allfeatures='private-net,wip,ready-to-test' # build func test() { - if [[ $buildTag != null ]] && [[ ${TAG_NAME} != null || ${TAG_NAME} != '' ]]; then + if [[ ${TAG_NAME} != null || ${TAG_NAME} != '' ]]; then printf "⚡️ Testing with features: private-net runtime-benchmarks\n" cargo test --release --features "private-net runtime-benchmarks" - elif [[ ${prBranch} = 'master' ]]; then + elif [[ $prBranch = 'master' ]]; then printf "⚡️ This is "${prbranch}" Running tests and migrations %s\n" RUST_LOG="debug cargo test --features try-runtime -- run_migrations" - else + elif [[ -n $buildTag ]] || [[ $pr = true ]]; then printf "⚡️ Running Tests for code coverage only\n" export RUSTFLAGS="-Cinstrument-coverage" export SKIP_WASM_BUILD=1 @@ -36,12 +36,12 @@ build() { featureList='private-net runtime-benchmarks' elif [[ ${TAG_NAME} =~ 'stage'* ]]; then featureList='private-net include-real-files ready-to-test' - elif [[ ${TAG_NAME} =~ 'test'* || -n ${buildTag} ]]; then + elif [[ ${TAG_NAME} =~ 'test'* ]]; then featureList='private-net include-real-files reduced-pswap-reward-periods ready-to-test' elif [[ -n ${TAG_NAME} && ${TAG_NAME} != 'predev' ]]; then featureList='include-real-files' sudoCheckStatus="101" - elif [[ -n ${buildTag} ]]; then + elif [[ -n $buildTag ]]; then featureList='private-net include-real-files reduced-pswap-reward-periods wip ready-to-test' fi printf "⚡️ Building with features: %s\n" "$featureList" @@ -66,4 +66,4 @@ if [ "$(type -t $1)" = "function" ]; then "$1" else echo "Func '$1' is not exists in this workflow. Skipped." -fi +fi \ No newline at end of file From 62561bf20ec311bdcd7c7d502b86f78ae1d3377e Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Wed, 28 Feb 2024 11:13:26 +0300 Subject: [PATCH 129/136] update workflow Signed-off-by: Nikita Zaporozhets --- housekeeping/build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/housekeeping/build.sh b/housekeeping/build.sh index f3fe3ca7e3..75f81b65b5 100755 --- a/housekeeping/build.sh +++ b/housekeeping/build.sh @@ -11,13 +11,13 @@ allfeatures='private-net,wip,ready-to-test' # build func test() { - if [[ ${TAG_NAME} != null || ${TAG_NAME} != '' ]]; then + if [[ -n ${TAG_NAME} ]]; then printf "⚡️ Testing with features: private-net runtime-benchmarks\n" cargo test --release --features "private-net runtime-benchmarks" elif [[ $prBranch = 'master' ]]; then printf "⚡️ This is "${prbranch}" Running tests and migrations %s\n" RUST_LOG="debug cargo test --features try-runtime -- run_migrations" - elif [[ -n $buildTag ]] || [[ $pr = true ]]; then + elif [[ -n $buildTag || $pr = true ]]; then printf "⚡️ Running Tests for code coverage only\n" export RUSTFLAGS="-Cinstrument-coverage" export SKIP_WASM_BUILD=1 From 84f74926a03791cf58ce71aebec04ba1ac3da8d5 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Wed, 28 Feb 2024 12:46:32 +0300 Subject: [PATCH 130/136] coverage optimization Signed-off-by: Nikita Zaporozhets --- housekeeping/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/housekeeping/build.sh b/housekeeping/build.sh index 75f81b65b5..c1712ab018 100755 --- a/housekeeping/build.sh +++ b/housekeeping/build.sh @@ -24,7 +24,7 @@ test() { export LLVM_PROFILE_FILE="sora2-%p-%m.profraw" rm -rf ~/.cargo/.package-cache cargo fmt -- --check > /dev/null - cargo test --features $allfeatures + cargo test --features $allfeatures -- --test-threads=2 fi } From 38a800bc83d36c60077f89800139d4a61340414b Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Wed, 28 Feb 2024 19:10:29 +0300 Subject: [PATCH 131/136] update build Signed-off-by: Nikita Zaporozhets --- housekeeping/build.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/housekeeping/build.sh b/housekeeping/build.sh index c1712ab018..7b99854ef3 100755 --- a/housekeeping/build.sh +++ b/housekeeping/build.sh @@ -46,7 +46,6 @@ build() { fi printf "⚡️ Building with features: %s\n" "$featureList" printf "⚡️ Checking sudo pallet: %s\n" "$sudoCheckStatus" - rm -rf target cargo build --release --features "$featureList" mv ./target/release/framenode . mv ./target/release/wbuild/framenode-runtime/framenode_runtime.compact.compressed.wasm ./framenode_runtime.compact.compressed.wasm From 84dd72c6281330b45637aa348605e0790dddd2f3 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Thu, 29 Feb 2024 09:01:47 +0300 Subject: [PATCH 132/136] merge lib Signed-off-by: Nikita Zaporozhets --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 47a85fc81f..2fe6d07fcc 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,4 +1,4 @@ -@Library('jenkins-library@feature/dops-2942-update_rust_lib') _ +@Library('jenkins-library') _ def pipeline = new org.rust.AppPipeline(steps: this, initSubmodules: true, From 58755213367cf9d02fab63c96f8bd7bc4fed2891 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Thu, 29 Feb 2024 10:29:04 +0300 Subject: [PATCH 133/136] fix Signed-off-by: Nikita Zaporozhets --- Jenkinsfile-env | 2 +- housekeeping/build.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile-env b/Jenkinsfile-env index f22f251113..9d58eec620 100644 --- a/Jenkinsfile-env +++ b/Jenkinsfile-env @@ -4,7 +4,7 @@ def pipeline = new org.docker.AppPipeline(steps: this, dockerImageName: 'sora2/env', dockerRegistryCred: 'bot-sora2-rw', dockerFileName: "housekeeping/docker/env/Dockerfile", - triggerCommonBuildExpression: (env.BRANCH_NAME in ['develop', 'master']), + triggerCommonBuildExpression: (env.BRANCH_NAME in ['develop']), triggerCommonBuildGrepRegex: 'housekeeping', secretScannerExclusion: '.*Cargo.toml$|.*env\$', nameCI: 'env-CI', diff --git a/housekeeping/build.sh b/housekeeping/build.sh index 7b99854ef3..f38d6147df 100755 --- a/housekeeping/build.sh +++ b/housekeeping/build.sh @@ -15,7 +15,7 @@ test() { printf "⚡️ Testing with features: private-net runtime-benchmarks\n" cargo test --release --features "private-net runtime-benchmarks" elif [[ $prBranch = 'master' ]]; then - printf "⚡️ This is "${prbranch}" Running tests and migrations %s\n" + printf "⚡️ This is "$prbranch" Running tests and migrations %s\n" RUST_LOG="debug cargo test --features try-runtime -- run_migrations" elif [[ -n $buildTag || $pr = true ]]; then printf "⚡️ Running Tests for code coverage only\n" @@ -24,7 +24,7 @@ test() { export LLVM_PROFILE_FILE="sora2-%p-%m.profraw" rm -rf ~/.cargo/.package-cache cargo fmt -- --check > /dev/null - cargo test --features $allfeatures -- --test-threads=2 + cargo test --features $allfeatures -- --test-threads=1 fi } From 7e8fc7419e5cf22491a796c627f18ccc090e7ca0 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Thu, 29 Feb 2024 10:45:07 +0300 Subject: [PATCH 134/136] fix tests Signed-off-by: Nikita Zaporozhets --- housekeeping/build.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/housekeeping/build.sh b/housekeeping/build.sh index f38d6147df..fc0ca70db2 100755 --- a/housekeeping/build.sh +++ b/housekeeping/build.sh @@ -16,7 +16,8 @@ test() { cargo test --release --features "private-net runtime-benchmarks" elif [[ $prBranch = 'master' ]]; then printf "⚡️ This is "$prbranch" Running tests and migrations %s\n" - RUST_LOG="debug cargo test --features try-runtime -- run_migrations" + RUST_LOG="debug" + cargo test --features try-runtime -- run_migrations" elif [[ -n $buildTag || $pr = true ]]; then printf "⚡️ Running Tests for code coverage only\n" export RUSTFLAGS="-Cinstrument-coverage" From b45625f406b427383262f4eb0587135871e58df1 Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Thu, 29 Feb 2024 10:59:25 +0300 Subject: [PATCH 135/136] fix Signed-off-by: Nikita Zaporozhets --- housekeeping/build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/housekeeping/build.sh b/housekeeping/build.sh index fc0ca70db2..5935271db8 100755 --- a/housekeeping/build.sh +++ b/housekeeping/build.sh @@ -16,8 +16,8 @@ test() { cargo test --release --features "private-net runtime-benchmarks" elif [[ $prBranch = 'master' ]]; then printf "⚡️ This is "$prbranch" Running tests and migrations %s\n" - RUST_LOG="debug" - cargo test --features try-runtime -- run_migrations" + export RUST_LOG="debug" + cargo test --features try-runtime -- run_migrations elif [[ -n $buildTag || $pr = true ]]; then printf "⚡️ Running Tests for code coverage only\n" export RUSTFLAGS="-Cinstrument-coverage" From 2c6bd140798a5fafe01407f215d10d0ae0d7186d Mon Sep 17 00:00:00 2001 From: Nikita Zaporozhets Date: Thu, 29 Feb 2024 11:30:42 +0300 Subject: [PATCH 136/136] fix Signed-off-by: Nikita Zaporozhets --- housekeeping/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/housekeeping/build.sh b/housekeeping/build.sh index 5935271db8..573e7186cb 100755 --- a/housekeeping/build.sh +++ b/housekeeping/build.sh @@ -7,7 +7,7 @@ wasmReportFile='subwasm_report.json' PACKAGE='framenode-runtime' RUSTFLAGS='-Dwarnings' RUNTIME_DIR='runtime' -allfeatures='private-net,wip,ready-to-test' +allfeatures='private-net,ready-to-test' # build func test() {