From eeb2ff3f296bd03923fd2c55d2517ba9ffc49501 Mon Sep 17 00:00:00 2001 From: Alex Sedighi Date: Fri, 17 Feb 2023 10:56:33 +1300 Subject: [PATCH] feat(nodle-parachain): set the dalek end block to be in future --- .github/workflows/ci.yml | 161 --------------------------------- .github/workflows/doc.yml | 49 ---------- .github/workflows/docker.yml | 10 +- .github/workflows/srtool.yml | 47 ---------- Cargo.lock | 18 ++-- node/Cargo.toml | 2 +- node/src/service.rs | 20 ++++ pallets/allocations/Cargo.toml | 2 +- pallets/grants/Cargo.toml | 2 +- pallets/mandate/Cargo.toml | 2 +- pallets/reserve/Cargo.toml | 2 +- pallets/staking/Cargo.toml | 2 +- primitives/Cargo.toml | 2 +- runtimes/eden/Cargo.toml | 2 +- runtimes/eden/src/version.rs | 4 +- support/Cargo.toml | 2 +- 16 files changed, 45 insertions(+), 282 deletions(-) delete mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/doc.yml delete mode 100644 .github/workflows/srtool.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 1877d7196d5..00000000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,161 +0,0 @@ -name: Test rust code - -on: - push: - branches: - - master - pull_request: - -env: - nightly: nightly-2022-09-20 - target: wasm32-unknown-unknown - tarpaulin-vers: "0.20.0" - try-runtime-chain: dev - try-runtime-uri: wss://eden-rpc.dwellir.com:443 - -jobs: - lints: - runs-on: ubuntu-latest-8-cores - steps: - - uses: actions/checkout@v3 - - uses: actions-rust-lang/setup-rust-toolchain@v1 - with: - toolchain: ${{ env.nightly }} - components: rustfmt, clippy - target: ${{ env.target }} - - name: Rustfmt Check - uses: actions-rust-lang/rustfmt@v1 - - name: Install protobuf-compiler - run: | - sudo apt-get install protobuf-compiler - - name: Clippy - uses: actions-rs/clippy-check@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - args: --all-features -- -A clippy::type_complexity -A clippy::identity_op -A clippy::boxed_local -D dead_code - toolchain: ${{ env.nightly }} - - tests: - runs-on: ubuntu-latest-16-cores - - steps: - - uses: actions/checkout@v3 - - uses: actions-rust-lang/setup-rust-toolchain@v1 - with: - toolchain: ${{ env.nightly }} - target: ${{ env.target }} - - name: Install protobuf-compiler - run: | - sudo apt-get install protobuf-compiler - - name: Cache cargo registry - uses: actions/cache@v3 - with: - path: ~/.cargo/registry - key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - ${{ runner.os }}-cargo-registry- - - - name: Cache cargo index - uses: actions/cache@v3 - with: - path: ~/.cargo/git - key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - ${{ runner.os }}-cargo-index- - - - name: Cache cargo build - uses: actions/cache@v3 - with: - path: target - key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - ${{ runner.os }}-cargo-build-target- - - - name: Build - run: cargo build --release --bin nodle-parachain - - - name: Unit tests - run: cargo test --all-features - - - name: Compare metadata - run: | - target/release/nodle-parachain --ws-external --ws-port=9944 --dev -- --dev & - docker run --net=host jacogr/polkadot-js-tools metadata ${{ env.try-runtime-uri }} ws://localhost:9944 > output.txt - - - name: Save output as artifact - uses: actions/upload-artifact@v3 - with: - name: metadata-comparison - path: | - output.txt - - tarpaulin: - runs-on: ubuntu-latest-16-cores - steps: - - uses: actions/checkout@v3 - - uses: actions-rust-lang/setup-rust-toolchain@v1 - with: - toolchain: ${{ env.nightly }} - target: ${{ env.target }} - - name: Install protobuf-compiler - run: | - sudo apt-get install protobuf-compiler - - name: Run cargo-tarpaulin - uses: actions-rs/tarpaulin@v0.1 - with: - version: ${{ env.tarpaulin-vers }} - args: "--avoid-cfg-tarpaulin --all-features --workspace --timeout 120 --exclude runtimes-eden nodle-parachain --exclude-files **/mock.rs **/weights.rs **/migrations.rs" - - - name: Upload to Codecov - uses: codecov/codecov-action@v3.0.0 - with: - fail_ci_if_error: false - - try-runtime: - runs-on: ubuntu-latest-16-cores - timeout-minutes: 50 - steps: - - uses: actions/checkout@v3 - - name: Check Version - run: | - echo -n "eden_rev=" >> $GITHUB_OUTPUT - curl -s --request POST --url https://nodle-parachain.api.onfinality.io/public --header 'Content-Type: application/json' --data '{ - "jsonrpc": "2.0", - "method": "system_version", - "params": [], - "id": 1 - }' | jq '{"result"}[]' >> $GITHUB_OUTPUT - cat $GITHUB_OUTPUT - id: get_version - - name: Install protobuf-compiler - run: | - sudo apt-get install protobuf-compiler - - name: Install Rust nightly - uses: actions-rust-lang/setup-rust-toolchain@v1 - with: - toolchain: ${{ env.nightly }} - target: ${{ env.target }} - - name: Cache a dir - uses: actions/cache@v3 - id: cachedir - with: - path: snapshots - key: ${{steps.get_version.outputs.eden_rev}} - - name: Cargo build - run: cargo build --release --features=try-runtime --bin nodle-parachain - - name: Fetch snapshot - if: steps.cachedir.outputs.cache-hit != 'true' - continue-on-error: true - run: | - install -d snapshots - date > snapshots/created_at - ./target/release/nodle-parachain try-runtime --runtime existing -lruntime=debug --chain ${{ env.try-runtime-chain }} create-snapshot "snapshots/eden-snapshot-full" -u ${{ env.try-runtime-uri}} - - name: Run Migration on new snapshot - if: steps.cachedir.outputs.cache-hit != 'true' - run: | - ./target/release/nodle-parachain try-runtime --runtime target/release/wbuild/runtime-eden/runtime_eden.wasm -lruntime=debug --chain ${{ env.try-runtime-chain }} on-runtime-upgrade snap -s snapshots/eden-snapshot-full - - name: Try runtime reuse snap - if: steps.cachedir.outputs.cache-hit == 'true' - run: | - cat snapshots/created_at - ./target/release/nodle-parachain try-runtime --runtime target/release/wbuild/runtime-eden/runtime_eden.wasm --chain ${{ env.try-runtime-chain }} on-runtime-upgrade snap --snapshot-path="snapshots/eden-snapshot-full" diff --git a/.github/workflows/doc.yml b/.github/workflows/doc.yml deleted file mode 100644 index ea21a4a4c3c..00000000000 --- a/.github/workflows/doc.yml +++ /dev/null @@ -1,49 +0,0 @@ -name: Rust AutoDoc - -on: - push: - branches: master - -jobs: - - autodoc: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - - name: Cache cargo registry - uses: actions/cache@v3 - with: - path: ~/.cargo/registry - key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - ${{ runner.os }}-cargo-registry- - - - name: Cache cargo index - uses: actions/cache@v3 - with: - path: ~/.cargo/git - key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - ${{ runner.os }}-cargo-index- - - - name: Cache cargo build - uses: actions/cache@v3 - with: - path: target - key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - ${{ runner.os }}-cargo-build-target- - - - name: Setup toolchain - run: ./scripts/init.sh - - - name: Build the docs - run: cargo doc --all --no-deps - - - name: Deploy the docs - uses: peaceiris/actions-gh-pages@v3 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./target/doc \ No newline at end of file diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 3d54a0aed2f..82bb75698ea 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -38,15 +38,13 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 - name: Login to GHCR - if: github.event_name != 'pull_request' uses: docker/login-action@v2 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Login to DockerHub - if: github.event_name != 'pull_request' - uses: docker/login-action@v2 + uses: docker/login-action@v2 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} @@ -55,6 +53,8 @@ jobs: with: context: . file: './Dockerfile' - push: ${{ github.event_name != 'pull_request' }} - tags: ${{ steps.meta.outputs.tags }} + push: true + tags: | + nodlecode/chain:dalek-zebra-rc2 + ghcr.io/nodlecode/chain:dalek-zebra-rc2 labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file diff --git a/.github/workflows/srtool.yml b/.github/workflows/srtool.yml deleted file mode 100644 index 3b4cf1280ba..00000000000 --- a/.github/workflows/srtool.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: Srtool - -on: - push: - branches: - - master - pull_request: - -jobs: - srtool: - runs-on: ubuntu-latest - strategy: - matrix: - runtime: ["eden"] - - steps: - - uses: actions/checkout@v3 - - - name: Srtool build - id: srtool_build - uses: chevdor/srtool-actions@v0.6.0 - with: - chain: ${{ matrix.runtime }} - package: runtime-${{ matrix.runtime }} - runtime_dir: runtimes/${{ matrix.runtime }} - - - name: Summary - run: | - echo '${{ steps.srtool_build.outputs.json }}' | jq > ${{ matrix.runtime }}-srtool-digest.json - cat ${{ matrix.runtime }}-srtool-digest.json - echo "Runtime location: ${{ steps.srtool_build.outputs.wasm }}" - - - name: Archive Metadata - uses: actions/upload-artifact@v3 - with: - name: ${{ matrix.runtime }}-srtool-digest.json - path: | - ${{ matrix.runtime }}-srtool-digest.json - - - name: Archive Runtime - uses: actions/upload-artifact@v3 - with: - name: ${{ matrix.runtime }}-${{ github.sha }} - path: | - ${{ steps.srtool_build.outputs.wasm }} - ${{ steps.srtool_build.outputs.wasm_compressed }} - ${{ matrix.runtime }}-srtool-digest.json diff --git a/Cargo.lock b/Cargo.lock index dab36873e79..ba9466eec83 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4909,7 +4909,7 @@ dependencies = [ [[package]] name = "nodle-parachain" -version = "2.0.25" +version = "2.0.26" dependencies = [ "clap", "cumulus-client-cli", @@ -5223,7 +5223,7 @@ dependencies = [ [[package]] name = "pallet-allocations" -version = "2.0.25" +version = "2.0.26" dependencies = [ "frame-benchmarking", "frame-support", @@ -5645,7 +5645,7 @@ dependencies = [ [[package]] name = "pallet-grants" -version = "2.0.25" +version = "2.0.26" dependencies = [ "frame-benchmarking", "frame-support", @@ -5717,7 +5717,7 @@ dependencies = [ [[package]] name = "pallet-mandate" -version = "2.0.25" +version = "2.0.26" dependencies = [ "frame-benchmarking", "frame-support", @@ -5983,7 +5983,7 @@ dependencies = [ [[package]] name = "pallet-reserve" -version = "2.0.25" +version = "2.0.26" dependencies = [ "frame-benchmarking", "frame-support", @@ -6069,7 +6069,7 @@ dependencies = [ [[package]] name = "pallet-staking" -version = "2.0.25" +version = "2.0.26" dependencies = [ "frame-benchmarking", "frame-support", @@ -7898,7 +7898,7 @@ dependencies = [ [[package]] name = "primitives" -version = "2.0.25" +version = "2.0.26" dependencies = [ "frame-support", "frame-system", @@ -8590,7 +8590,7 @@ dependencies = [ [[package]] name = "runtime-eden" -version = "2.0.25" +version = "2.0.26" dependencies = [ "cumulus-pallet-aura-ext", "cumulus-pallet-dmp-queue", @@ -11314,7 +11314,7 @@ checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" [[package]] name = "support" -version = "2.0.25" +version = "2.0.26" [[package]] name = "syn" diff --git a/node/Cargo.toml b/node/Cargo.toml index b0bed6cfe25..e4734543b10 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -3,7 +3,7 @@ authors = ["Nodle ", "Parity Technologies "] build = "build.rs" edition = "2021" name = "nodle-parachain" -version = "2.0.25" +version = "2.0.26" [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] diff --git a/node/src/service.rs b/node/src/service.rs index 7199b1d663b..dcf07aaf6e1 100644 --- a/node/src/service.rs +++ b/node/src/service.rs @@ -145,6 +145,26 @@ where )?; let client = Arc::new(client); + // Set the block number until which ed25519-dalek should be used for signature verification + // Check out https://github.com/paritytech/substrate/pull/12661 + // TODO https://github.com/NodleCode/chain/issues/703 + const EDEN_BLOCK_NUMBER_UNTIL_DALEK_SHOULD_BE_USED: u32 = 2_500_000; + const PARADIS_BLOCK_NUMBER_UNTIL_DALEK_SHOULD_BE_USED: u32 = 2_000_000; + use sc_client_api::ExecutorProvider; + match config.chain_spec.id() { + "para_eden" => client.execution_extensions().set_extensions_factory( + sc_client_api::execution_extensions::ExtensionBeforeBlock::::new( + EDEN_BLOCK_NUMBER_UNTIL_DALEK_SHOULD_BE_USED, + ), + ), + "para_eden_testing_0510" => client.execution_extensions().set_extensions_factory( + sc_client_api::execution_extensions::ExtensionBeforeBlock::::new( + PARADIS_BLOCK_NUMBER_UNTIL_DALEK_SHOULD_BE_USED, + ), + ), + _ => (), + }; + let telemetry_worker_handle = telemetry.as_ref().map(|(worker, _)| worker.handle()); let telemetry = telemetry.map(|(worker, telemetry)| { diff --git a/pallets/allocations/Cargo.toml b/pallets/allocations/Cargo.toml index 10551d64ba2..7d22932691a 100644 --- a/pallets/allocations/Cargo.toml +++ b/pallets/allocations/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-allocations" -version = "2.0.25" +version = "2.0.26" authors = ['Eliott Teissonniere '] edition = "2021" description = "A pallet to handle the Proof Of Connectivity allocations rewards" diff --git a/pallets/grants/Cargo.toml b/pallets/grants/Cargo.toml index 90dce3b44f4..68658697ceb 100644 --- a/pallets/grants/Cargo.toml +++ b/pallets/grants/Cargo.toml @@ -2,7 +2,7 @@ name = "pallet-grants" description = "Provides scheduled balance locking mechanism, in a *graded vesting* way." license = "Apache-2.0" -version = "2.0.25" +version = "2.0.26" authors = ["Eliott Teissonniere "] edition = "2021" diff --git a/pallets/mandate/Cargo.toml b/pallets/mandate/Cargo.toml index 47a6a50b28c..5d756f75e7f 100644 --- a/pallets/mandate/Cargo.toml +++ b/pallets/mandate/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-mandate" -version = "2.0.25" +version = "2.0.26" authors = ["Eliott Teissonniere "] edition = "2021" diff --git a/pallets/reserve/Cargo.toml b/pallets/reserve/Cargo.toml index 3e8d37ac490..d54fc028b9d 100644 --- a/pallets/reserve/Cargo.toml +++ b/pallets/reserve/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-reserve" -version = "2.0.25" +version = "2.0.26" authors = ["Eliott Teissonniere "] edition = "2021" diff --git a/pallets/staking/Cargo.toml b/pallets/staking/Cargo.toml index 8243756b73a..8edb39410a4 100644 --- a/pallets/staking/Cargo.toml +++ b/pallets/staking/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-staking" -version = "2.0.25" +version = "2.0.26" authors = [ 'Eliott Teissonniere , R.RajeshKumar ', ] diff --git a/primitives/Cargo.toml b/primitives/Cargo.toml index c8bd98ba744..776f2961c0a 100644 --- a/primitives/Cargo.toml +++ b/primitives/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "primitives" -version = "2.0.25" +version = "2.0.26" authors = ["Eliott Teissonniere "] edition = "2021" diff --git a/runtimes/eden/Cargo.toml b/runtimes/eden/Cargo.toml index bdc2b8cacde..75c092630cc 100644 --- a/runtimes/eden/Cargo.toml +++ b/runtimes/eden/Cargo.toml @@ -2,7 +2,7 @@ authors = ["Eliott Teissonniere "] edition = "2021" name = "runtime-eden" -version = "2.0.25" +version = "2.0.26" [features] default = ["std"] diff --git a/runtimes/eden/src/version.rs b/runtimes/eden/src/version.rs index 2586cc1ee00..76862567f46 100644 --- a/runtimes/eden/src/version.rs +++ b/runtimes/eden/src/version.rs @@ -39,7 +39,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { /// Version of the runtime specification. A full-node will not attempt to use its native /// runtime in substitute for the on-chain Wasm runtime unless all of `spec_name`, /// `spec_version` and `authoring_version` are the same between Wasm and native. - spec_version: 16, + spec_version: 17, /// Version of the implementation of the specification. Nodes are free to ignore this; it /// serves only as an indication that the code is different; as long as the other two versions @@ -50,7 +50,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { impl_version: 0, /// Used for hardware wallets. This typically happens when `SignedExtra` changes. - transaction_version: 5, + transaction_version: 6, apis: RUNTIME_API_VERSIONS, state_version: 0, diff --git a/support/Cargo.toml b/support/Cargo.toml index de9bb4e7b44..63cc7e406a7 100644 --- a/support/Cargo.toml +++ b/support/Cargo.toml @@ -2,4 +2,4 @@ authors = ["Eliott Teissonniere "] edition = "2021" name = "support" -version = "2.0.25" +version = "2.0.26"