Skip to content

Commit

Permalink
fix separation of live and development skip ias and filters builds (#95)
Browse files Browse the repository at this point in the history
adjust compiler flag and make live config the default, development tweaks only through feature gate
  • Loading branch information
brenzi authored Nov 22, 2021
1 parent ada0c26 commit c07b6aa
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 23 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 }}
Expand Down Expand Up @@ -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 }}
Expand Down
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down Expand Up @@ -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"]
5 changes: 3 additions & 2 deletions runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -118,4 +120,3 @@ runtime-benchmarks = [
"pallet-utility/runtime-benchmarks",
"pallet-teeracle/runtime-benchmarks",
]
mainnet-launch = []
22 changes: 14 additions & 8 deletions runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -219,27 +219,33 @@ parameter_types! {
}

pub struct BaseFilter;
#[rustfmt::skip]
impl Contains<Call> 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(_)
)
}
}

// 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;
Expand Down
1 change: 1 addition & 0 deletions runtime/src/weights/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit c07b6aa

Please sign in to comment.