From c07b6aab6c45123802b994508f65eedfc20bf251 Mon Sep 17 00:00:00 2001 From: brenzi Date: Mon, 22 Nov 2021 21:38:39 +0100 Subject: [PATCH] fix separation of live and development skip ias and filters builds (#95) adjust compiler flag and make live config the default, development tweaks only through feature gate --- .github/workflows/ci.yml | 14 +++++++------- Cargo.lock | 4 ++-- node/Cargo.toml | 8 ++++---- runtime/Cargo.toml | 5 +++-- runtime/src/lib.rs | 22 ++++++++++++++-------- runtime/src/weights/mod.rs | 1 + 6 files changed, 31 insertions(+), 23 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index da8b299..616320b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,8 +44,8 @@ jobs: with: access_token: ${{ secrets.GITHUB_TOKEN }} - build_primary_binaries: - name: Primary build ${{ matrix.binary }} for ${{ matrix.rust-target }} on (${{ matrix.os }}) + build_live_binaries: + name: Live build ${{ matrix.binary }} for ${{ matrix.rust-target }} on (${{ matrix.os }}) runs-on: ${{ matrix.os }} strategy: matrix: @@ -99,8 +99,8 @@ jobs: env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - build-skip-ais-check: - name: Primary build ${{ matrix.binary }} for ${{ matrix.rust-target }} on (${{ matrix.os }}) + build_dev_binaries: + name: Development build ${{ matrix.binary }} for ${{ matrix.rust-target }} on (${{ matrix.os }}) runs-on: ${{ matrix.os }} strategy: matrix: @@ -136,7 +136,7 @@ jobs: if: ${{ matrix.binary == 'release' }} run: | cargo clean -p integritee-node - cargo build --release --features skip-ias-check + cargo build --release --features skip-ias-check,skip-extrinsic-filtering # Upload artifacts - name: Upload integritee-node-dev @@ -276,7 +276,7 @@ jobs: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} create_artifacts: - needs: [ build_primary_binaries, build-runtimes ] + needs: [ build_live_binaries, build-runtimes ] runs-on: ubuntu-20.04 env: CHAIN_SPEC: ${{ matrix.chain }}-${{ matrix.config }} @@ -330,7 +330,7 @@ jobs: name: Draft Release if: startsWith(github.ref, 'refs/tags/') runs-on: ubuntu-latest - needs: [create_artifacts, build_primary_binaries, build-skip-ais-check, check] + needs: [create_artifacts, build_live_binaries, build_dev_binaries, check] outputs: release_url: ${{ steps.create-release.outputs.html_url }} asset_upload_url: ${{ steps.create-release.outputs.upload_url }} diff --git a/Cargo.lock b/Cargo.lock index d130be9..e4a709f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2282,7 +2282,7 @@ dependencies = [ [[package]] name = "integritee-node" -version = "0.9.3" +version = "0.9.4" dependencies = [ "frame-benchmarking", "frame-benchmarking-cli", @@ -2323,7 +2323,7 @@ dependencies = [ [[package]] name = "integritee-node-runtime" -version = "0.9.3" +version = "0.9.4" dependencies = [ "frame-benchmarking", "frame-executive", diff --git a/node/Cargo.toml b/node/Cargo.toml index a866340..0df5563 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -7,7 +7,8 @@ homepage = 'https://integritee.network/' license = 'Apache2' name = 'integritee-node' repository = 'https://github.com/integritee-network/integritee-node' -version = '0.9.3' +#keep with runtime version +version = '0.9.4' [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] @@ -68,6 +69,5 @@ runtime-benchmarks = [ ] # allow workers to register without remote attestation for dev purposes skip-ias-check = ["integritee-node-runtime/skip-ias-check"] - -#valid only for standalone mainnet -mainnet-launch = ["integritee-node-runtime/mainnet-launch"] +# lift filters for development binaries +skip-extrinsic-filtering = ["integritee-node-runtime/skip-extrinsic-filtering"] diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index 25641d3..92f8f2f 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -5,7 +5,8 @@ homepage = 'https://integritee.network/' license = 'Apache2' name = 'integritee-node-runtime' repository = 'https://github.com/integritee-network/integritee-node' -version = '0.9.3' +# keep patch revision with spec_version of runtime +version = '0.9.4' [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] @@ -63,6 +64,7 @@ substrate-wasm-builder = {version = "5.0.0-dev", git = "https://github.com/parit [features] default = ["std"] skip-ias-check = ["pallet-teerex/skip-ias-check"] +skip-extrinsic-filtering = [] std = [ "codec/std", "frame-executive/std", @@ -118,4 +120,3 @@ runtime-benchmarks = [ "pallet-utility/runtime-benchmarks", "pallet-teeracle/runtime-benchmarks", ] -mainnet-launch = [] \ No newline at end of file diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 1c5144b..564fb97 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -125,7 +125,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: 3, + spec_version: 4, /// 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 @@ -219,16 +219,22 @@ parameter_types! { } pub struct BaseFilter; +#[rustfmt::skip] impl Contains for BaseFilter { //Block send extrinsics for mainnent before official token generation event fn contains(call: &Call) -> bool { !matches!( call, Call::Balances(..) | - Call::Treasury(..) | - Call::Vesting(_) | Call::Teerex(_) | - Call::Proxy(_) | Call::Scheduler(_) | - Call::Multisig(_) + Call::Claims(..) | + Call::Multisig(_) | + Call::Proxy(_) | + Call::Teeracle(_) | + Call::Teerex(_) | + Call::Treasury(..) | + Call::Scheduler(_) | + Call::Utility(_) | + Call::Vesting(_) ) } } @@ -236,10 +242,10 @@ impl Contains for BaseFilter { // Configure FRAME pallets to include in runtime. impl frame_system::Config for Runtime { - #[cfg(not(feature = "mainnet-launch"))] + #[cfg(feature = "skip-extrinsic-filtering")] type BaseCallFilter = frame_support::traits::Everything; - //Block send extrinsics for mainnet before official token generation event - #[cfg(feature = "mainnet-launch")] + //Block extrinsics for mainnet before official token generation event + #[cfg(not(feature = "skip-extrinsic-filtering"))] type BaseCallFilter = BaseFilter; /// Block & extrinsics weights: base values and limits. type BlockWeights = BlockWeights; diff --git a/runtime/src/weights/mod.rs b/runtime/src/weights/mod.rs index 48d27d3..48fd618 100644 --- a/runtime/src/weights/mod.rs +++ b/runtime/src/weights/mod.rs @@ -19,6 +19,7 @@ pub mod pallet_claims; pub mod pallet_multisig; pub mod pallet_proxy; pub mod pallet_scheduler; +//pub mod pallet_teeracle; pub mod pallet_teerex; pub mod pallet_timestamp; pub mod pallet_treasury;