From fa5b50503af475ef6847a3b5a62439c71707e8e0 Mon Sep 17 00:00:00 2001 From: brenzi Date: Mon, 8 Apr 2024 16:53:06 +0200 Subject: [PATCH] bump sdk version to 0.13.0. add handy REDME docs (#1596) --- Cargo.lock | 38 +++++------ app-libs/sgx-runtime/Cargo.toml | 2 +- app-libs/stf/Cargo.toml | 2 +- cli/Cargo.toml | 14 ++-- core-primitives/enclave-api/Cargo.toml | 2 +- core-primitives/types/Cargo.toml | 8 +-- docker/README.md | 89 ++++++++++++++++++++++---- enclave-runtime/Cargo.lock | 24 +++---- enclave-runtime/Cargo.toml | 6 +- service/Cargo.toml | 8 +-- 10 files changed, 128 insertions(+), 65 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3b79ad05a6..3eb3ba8ca3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -15,7 +15,7 @@ dependencies = [ [[package]] name = "ac-compose-macros" version = "0.4.2" -source = "git+https://github.com/brenzi/substrate-api-client.git?branch=polkadot-v0.9.42-tag-v0.14.0-retracted#480823e6a82236c4d6eb3a488a56f4bce2c4be2c" +source = "git+https://github.com/brenzi/substrate-api-client.git?branch=polkadot-v0.9.42-tag-v0.14.0-retracted#d01bc07fe0c8a8db1451d0d5c8bf82493b274d80" dependencies = [ "ac-primitives", "log 0.4.20", @@ -25,7 +25,7 @@ dependencies = [ [[package]] name = "ac-node-api" version = "0.5.1" -source = "git+https://github.com/brenzi/substrate-api-client.git?branch=polkadot-v0.9.42-tag-v0.14.0-retracted#480823e6a82236c4d6eb3a488a56f4bce2c4be2c" +source = "git+https://github.com/brenzi/substrate-api-client.git?branch=polkadot-v0.9.42-tag-v0.14.0-retracted#d01bc07fe0c8a8db1451d0d5c8bf82493b274d80" dependencies = [ "ac-primitives", "bitvec", @@ -50,7 +50,7 @@ dependencies = [ [[package]] name = "ac-primitives" version = "0.9.0" -source = "git+https://github.com/brenzi/substrate-api-client.git?branch=polkadot-v0.9.42-tag-v0.14.0-retracted#480823e6a82236c4d6eb3a488a56f4bce2c4be2c" +source = "git+https://github.com/brenzi/substrate-api-client.git?branch=polkadot-v0.9.42-tag-v0.14.0-retracted#d01bc07fe0c8a8db1451d0d5c8bf82493b274d80" dependencies = [ "frame-system", "impl-serde", @@ -740,7 +740,7 @@ dependencies = [ [[package]] name = "common-primitives" version = "0.1.0" -source = "git+https://github.com/integritee-network/pallets.git?branch=sdk-v0.12.11-polkadot-v0.9.42#094b1e982b4637ebfbf5afb985100417215d49a0" +source = "git+https://github.com/integritee-network/pallets.git?branch=sdk-v0.13.0-polkadot-v0.9.42#abf29acd41a0fca9cd7025b297b6a9fa272a122f" dependencies = [ "derive_more", "parity-scale-codec", @@ -1216,7 +1216,7 @@ dependencies = [ [[package]] name = "enclave-bridge-primitives" version = "0.1.0" -source = "git+https://github.com/integritee-network/pallets.git?branch=sdk-v0.12.11-polkadot-v0.9.42#094b1e982b4637ebfbf5afb985100417215d49a0" +source = "git+https://github.com/integritee-network/pallets.git?branch=sdk-v0.13.0-polkadot-v0.9.42#abf29acd41a0fca9cd7025b297b6a9fa272a122f" dependencies = [ "common-primitives", "log 0.4.20", @@ -2557,7 +2557,7 @@ dependencies = [ [[package]] name = "integritee-cli" -version = "0.12.12" +version = "0.13.0" dependencies = [ "array-bytes 6.1.0", "base58", @@ -2607,7 +2607,7 @@ dependencies = [ [[package]] name = "integritee-service" -version = "0.12.12" +version = "0.13.0" dependencies = [ "anyhow", "async-trait", @@ -5110,7 +5110,7 @@ dependencies = [ [[package]] name = "pallet-enclave-bridge" version = "0.12.0" -source = "git+https://github.com/integritee-network/pallets.git?branch=sdk-v0.12.11-polkadot-v0.9.42#094b1e982b4637ebfbf5afb985100417215d49a0" +source = "git+https://github.com/integritee-network/pallets.git?branch=sdk-v0.13.0-polkadot-v0.9.42#abf29acd41a0fca9cd7025b297b6a9fa272a122f" dependencies = [ "enclave-bridge-primitives", "frame-support", @@ -5155,7 +5155,7 @@ dependencies = [ [[package]] name = "pallet-parentchain" version = "0.11.0" -source = "git+https://github.com/integritee-network/pallets.git?branch=sdk-v0.12.11-polkadot-v0.9.42#094b1e982b4637ebfbf5afb985100417215d49a0" +source = "git+https://github.com/integritee-network/pallets.git?branch=sdk-v0.13.0-polkadot-v0.9.42#abf29acd41a0fca9cd7025b297b6a9fa272a122f" dependencies = [ "frame-support", "frame-system", @@ -5173,7 +5173,7 @@ dependencies = [ [[package]] name = "pallet-sidechain" version = "0.11.0" -source = "git+https://github.com/integritee-network/pallets.git?branch=sdk-v0.12.11-polkadot-v0.9.42#094b1e982b4637ebfbf5afb985100417215d49a0" +source = "git+https://github.com/integritee-network/pallets.git?branch=sdk-v0.13.0-polkadot-v0.9.42#abf29acd41a0fca9cd7025b297b6a9fa272a122f" dependencies = [ "enclave-bridge-primitives", "frame-support", @@ -5210,7 +5210,7 @@ dependencies = [ [[package]] name = "pallet-teeracle" version = "0.1.0" -source = "git+https://github.com/integritee-network/pallets.git?branch=sdk-v0.12.11-polkadot-v0.9.42#094b1e982b4637ebfbf5afb985100417215d49a0" +source = "git+https://github.com/integritee-network/pallets.git?branch=sdk-v0.13.0-polkadot-v0.9.42#abf29acd41a0fca9cd7025b297b6a9fa272a122f" dependencies = [ "frame-support", "frame-system", @@ -5230,7 +5230,7 @@ dependencies = [ [[package]] name = "pallet-teerex" version = "0.10.0" -source = "git+https://github.com/integritee-network/pallets.git?branch=sdk-v0.12.11-polkadot-v0.9.42#094b1e982b4637ebfbf5afb985100417215d49a0" +source = "git+https://github.com/integritee-network/pallets.git?branch=sdk-v0.13.0-polkadot-v0.9.42#abf29acd41a0fca9cd7025b297b6a9fa272a122f" dependencies = [ "frame-support", "frame-system", @@ -6710,7 +6710,7 @@ dependencies = [ [[package]] name = "sgx-verify" version = "0.1.4" -source = "git+https://github.com/integritee-network/pallets.git?branch=sdk-v0.12.11-polkadot-v0.9.42#094b1e982b4637ebfbf5afb985100417215d49a0" +source = "git+https://github.com/integritee-network/pallets.git?branch=sdk-v0.13.0-polkadot-v0.9.42#abf29acd41a0fca9cd7025b297b6a9fa272a122f" dependencies = [ "base64 0.13.1", "chrono 0.4.26", @@ -6985,7 +6985,7 @@ checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3" [[package]] name = "sidechain-primitives" version = "0.1.0" -source = "git+https://github.com/integritee-network/pallets.git?branch=sdk-v0.12.11-polkadot-v0.9.42#094b1e982b4637ebfbf5afb985100417215d49a0" +source = "git+https://github.com/integritee-network/pallets.git?branch=sdk-v0.13.0-polkadot-v0.9.42#abf29acd41a0fca9cd7025b297b6a9fa272a122f" dependencies = [ "parity-scale-codec", "scale-info", @@ -7709,7 +7709,7 @@ dependencies = [ [[package]] name = "substrate-api-client" version = "0.14.0" -source = "git+https://github.com/brenzi/substrate-api-client.git?branch=polkadot-v0.9.42-tag-v0.14.0-retracted#480823e6a82236c4d6eb3a488a56f4bce2c4be2c" +source = "git+https://github.com/brenzi/substrate-api-client.git?branch=polkadot-v0.9.42-tag-v0.14.0-retracted#d01bc07fe0c8a8db1451d0d5c8bf82493b274d80" dependencies = [ "ac-compose-macros", "ac-node-api", @@ -7747,7 +7747,7 @@ dependencies = [ [[package]] name = "substrate-client-keystore" version = "0.9.1" -source = "git+https://github.com/brenzi/substrate-api-client.git?branch=polkadot-v0.9.42-tag-v0.14.0-retracted#480823e6a82236c4d6eb3a488a56f4bce2c4be2c" +source = "git+https://github.com/brenzi/substrate-api-client.git?branch=polkadot-v0.9.42-tag-v0.14.0-retracted#d01bc07fe0c8a8db1451d0d5c8bf82493b274d80" dependencies = [ "array-bytes 4.2.0", "async-trait", @@ -7826,7 +7826,7 @@ checksum = "1d2faeef5759ab89935255b1a4cd98e0baf99d1085e37d36599c625dac49ae8e" [[package]] name = "teeracle-primitives" version = "0.1.0" -source = "git+https://github.com/integritee-network/pallets.git?branch=sdk-v0.12.11-polkadot-v0.9.42#094b1e982b4637ebfbf5afb985100417215d49a0" +source = "git+https://github.com/integritee-network/pallets.git?branch=sdk-v0.13.0-polkadot-v0.9.42#abf29acd41a0fca9cd7025b297b6a9fa272a122f" dependencies = [ "common-primitives", "sp-std", @@ -7836,7 +7836,7 @@ dependencies = [ [[package]] name = "teerex-primitives" version = "0.1.0" -source = "git+https://github.com/integritee-network/pallets.git?branch=sdk-v0.12.11-polkadot-v0.9.42#094b1e982b4637ebfbf5afb985100417215d49a0" +source = "git+https://github.com/integritee-network/pallets.git?branch=sdk-v0.13.0-polkadot-v0.9.42#abf29acd41a0fca9cd7025b297b6a9fa272a122f" dependencies = [ "common-primitives", "derive_more", @@ -8319,7 +8319,7 @@ version = "1.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" dependencies = [ - "cfg-if 1.0.0", + "cfg-if 0.1.10", "digest 0.10.7", "rand 0.8.5", "static_assertions", diff --git a/app-libs/sgx-runtime/Cargo.toml b/app-libs/sgx-runtime/Cargo.toml index d42d2df59e..6760c60535 100644 --- a/app-libs/sgx-runtime/Cargo.toml +++ b/app-libs/sgx-runtime/Cargo.toml @@ -30,7 +30,7 @@ sp-version = { default-features = false, git = "https://github.com/paritytech/su # Integritee dependencies pallet-evm = { default-features = false, optional = true, git = "https://github.com/integritee-network/frontier.git", branch = "bar/polkadot-v0.9.42" } -pallet-parentchain = { default-features = false, git = "https://github.com/integritee-network/pallets.git", branch = "sdk-v0.12.11-polkadot-v0.9.42" } +pallet-parentchain = { default-features = false, git = "https://github.com/integritee-network/pallets.git", branch = "sdk-v0.13.0-polkadot-v0.9.42" } [features] default = ["std"] diff --git a/app-libs/stf/Cargo.toml b/app-libs/stf/Cargo.toml index 6a76e9b352..b0d19567be 100644 --- a/app-libs/stf/Cargo.toml +++ b/app-libs/stf/Cargo.toml @@ -32,7 +32,7 @@ sp-io = { default-features = false, features = ["disable_oom", "disable_panic_ha frame-support = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } frame-system = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } pallet-balances = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } -pallet-parentchain = { default-features = false, git = "https://github.com/integritee-network/pallets.git", branch = "sdk-v0.12.11-polkadot-v0.9.42" } +pallet-parentchain = { default-features = false, git = "https://github.com/integritee-network/pallets.git", branch = "sdk-v0.13.0-polkadot-v0.9.42" } pallet-sudo = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } sp-core = { default-features = false, features = ["full_crypto"], git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 0aa111a0c0..318b105d98 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "integritee-cli" -version = "0.12.12" +version = "0.13.0" authors = ["Integritee AG "] edition = "2021" @@ -25,14 +25,14 @@ thiserror = "1.0" urlencoding = "2.1.3" # scs / integritee -enclave-bridge-primitives = { git = "https://github.com/integritee-network/pallets.git", branch = "sdk-v0.12.11-polkadot-v0.9.42" } +enclave-bridge-primitives = { git = "https://github.com/integritee-network/pallets.git", branch = "sdk-v0.13.0-polkadot-v0.9.42" } ita-parentchain-interface = { path = "../app-libs/parentchain-interface" } -pallet-enclave-bridge = { git = "https://github.com/integritee-network/pallets.git", branch = "sdk-v0.12.11-polkadot-v0.9.42" } +pallet-enclave-bridge = { git = "https://github.com/integritee-network/pallets.git", branch = "sdk-v0.13.0-polkadot-v0.9.42" } pallet-evm = { optional = true, git = "https://github.com/integritee-network/frontier.git", branch = "bar/polkadot-v0.9.42" } -pallet-sidechain = { git = "https://github.com/integritee-network/pallets.git", branch = "sdk-v0.12.11-polkadot-v0.9.42" } -pallet-teeracle = { git = "https://github.com/integritee-network/pallets.git", branch = "sdk-v0.12.11-polkadot-v0.9.42" } -pallet-teerex = { git = "https://github.com/integritee-network/pallets.git", branch = "sdk-v0.12.11-polkadot-v0.9.42" } -teeracle-primitives = { git = "https://github.com/integritee-network/pallets.git", branch = "sdk-v0.12.11-polkadot-v0.9.42" } +pallet-sidechain = { git = "https://github.com/integritee-network/pallets.git", branch = "sdk-v0.13.0-polkadot-v0.9.42" } +pallet-teeracle = { git = "https://github.com/integritee-network/pallets.git", branch = "sdk-v0.13.0-polkadot-v0.9.42" } +pallet-teerex = { git = "https://github.com/integritee-network/pallets.git", branch = "sdk-v0.13.0-polkadot-v0.9.42" } +teeracle-primitives = { git = "https://github.com/integritee-network/pallets.git", branch = "sdk-v0.13.0-polkadot-v0.9.42" } # `default-features = false` to remove the jsonrpsee dependency. # disable unsupported jsonrpcsee diff --git a/core-primitives/enclave-api/Cargo.toml b/core-primitives/enclave-api/Cargo.toml index f639f9d7e8..762506c442 100644 --- a/core-primitives/enclave-api/Cargo.toml +++ b/core-primitives/enclave-api/Cargo.toml @@ -19,7 +19,7 @@ frame-support = { git = "https://github.com/paritytech/substrate.git", branch = sp-core = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } sp-runtime = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } -teerex-primitives = { git = "https://github.com/integritee-network/pallets.git", branch = "sdk-v0.12.11-polkadot-v0.9.42" } +teerex-primitives = { git = "https://github.com/integritee-network/pallets.git", branch = "sdk-v0.13.0-polkadot-v0.9.42" } itc-parentchain = { path = "../../core/parentchain/parentchain-crate" } itp-enclave-api-ffi = { path = "ffi" } diff --git a/core-primitives/types/Cargo.toml b/core-primitives/types/Cargo.toml index 1669cec114..aecb7c4626 100644 --- a/core-primitives/types/Cargo.toml +++ b/core-primitives/types/Cargo.toml @@ -27,10 +27,10 @@ sp-runtime = { default-features = false, git = "https://github.com/paritytech/su sp-std = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } # integritee-node -enclave-bridge-primitives = { default-features = false, git = "https://github.com/integritee-network/pallets.git", branch = "sdk-v0.12.11-polkadot-v0.9.42" } -sidechain-primitives = { default-features = false, git = "https://github.com/integritee-network/pallets.git", branch = "sdk-v0.12.11-polkadot-v0.9.42" } -teeracle-primitives = { default-features = false, git = "https://github.com/integritee-network/pallets.git", branch = "sdk-v0.12.11-polkadot-v0.9.42" } -teerex-primitives = { default-features = false, git = "https://github.com/integritee-network/pallets.git", branch = "sdk-v0.12.11-polkadot-v0.9.42" } +enclave-bridge-primitives = { default-features = false, git = "https://github.com/integritee-network/pallets.git", branch = "sdk-v0.13.0-polkadot-v0.9.42" } +sidechain-primitives = { default-features = false, git = "https://github.com/integritee-network/pallets.git", branch = "sdk-v0.13.0-polkadot-v0.9.42" } +teeracle-primitives = { default-features = false, git = "https://github.com/integritee-network/pallets.git", branch = "sdk-v0.13.0-polkadot-v0.9.42" } +teerex-primitives = { default-features = false, git = "https://github.com/integritee-network/pallets.git", branch = "sdk-v0.13.0-polkadot-v0.9.42" } [features] default = ["std"] diff --git a/docker/README.md b/docker/README.md index 7f9ddb7a86..ff58343449 100644 --- a/docker/README.md +++ b/docker/README.md @@ -1,84 +1,131 @@ -# How to run the multi-validateer docker setup +# Building and Running workers in docker ## Prerequisite -* Make sure you have installed Docker (version >= `2.0.0`) with [Docker Compose](https://docs.docker.com/compose/install/). On Windows, this can be Docker Desktop with WSL 2 integration. -* In case you also build the worker directly, without docker (e.g. on a dev machine, running `make`), you should run `make clean` before running the docker build. Otherwise, it can occasionally lead to build errors. -* The node image version that is loaded in the `docker-compose.yml`, (e.g. `image: "integritee/integritee-node:1.1.3"`) needs to be compatible with the worker you're trying to build. +* Make sure you have installed Docker (version >= `2.0.0`) + with [Docker Compose](https://docs.docker.com/compose/install/). On Windows, this can be Docker Desktop with WSL 2 + integration. +* In case you also build the worker directly, without docker (e.g. on a dev machine, running `make`), you should + run `make clean` before running the docker build. Otherwise, it can occasionally lead to build errors. +* The node image version that is loaded in the `docker-compose.yml`, (e.g. `image: "integritee/integritee-node:1.1.3"`) + needs to be compatible with the worker you're trying to build. * Set export VERSION=dev -* `envsubst` should be installed, it is needed to replace the $VERSION in yaml files as docker compose doesn't support variables on service names. +* `envsubst` should be installed, it is needed to replace the $VERSION in yaml files as docker compose doesn't support + variables on service names. + +## Development Environment + +Start worker in docker to build and test in SW mode without requiring an SGX machine + +```bash +docker run --name integritee-dev-worker -it --expose 9944-9999 -v $(pwd):/home/ubuntu/worker -e MYUID=$(id -u) -e MYGUID=$(id -g) integritee/integritee-dev:0.2.2 /bin/bash +# restart later with: +docker start -a -i integritee-dev-worker +# i.e. build sidechain worker +ubuntu@593a446ac6cf:~/worker$ SGX_MODE=SW WORKER_MODE=sidechain WORKER_FEATURES=dcap make +``` + +In this setup, chain nodes can be run on the host and expose rpc on any port in the range 9944-9999 + +# How to run the multi-validateer docker setup ## Building the Docker containers Run + ``` COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker compose -f <(envsubst < docker-compose.yml) build ``` -in this folder to build the worker image. This will build the worker from source and tag it in an image called `integritee-worker:dev`. + +in this folder to build the worker image. This will build the worker from source and tag it in an image +called `integritee-worker:dev`. ## Running the docker setup ``` docker compose -f <(envsubst < docker-compose.yml) up ``` + Starts all services (node and workers), using the `integritee-worker:dev` images you've built in the previous step. ## Run the demos ### Demo indirect invocation (M6) + Build + ``` COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker compose -f <(envsubst < docker-compose.yml) -f <(envsubst < demo-shielding-unshielding-multiworker.yml) build --build-arg WORKER_MODE_ARG=offchain-worker ``` + Run + ``` FLAVOR_ID=offchain-worker docker compose -f <(envsubst < docker-compose.yml) -f <(envsubst < demo-shielding-unshielding-multiworker.yml) up demo-shielding-unshielding-multiworker --exit-code-from demo-shielding-unshielding-multiworker ``` + ### Demo direct call (M8) Build + ``` COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker compose -f <(envsubst < docker-compose.yml) -f <(envsubst < demo-direct-call.yml) build --build-arg WORKER_MODE_ARG=sidechain ``` + Run + ``` docker compose -f <(envsubst < docker-compose.yml) -f <(envsubst < demo-direct-call.yml) up demo-direct-call --exit-code-from demo-direct-call ``` ### Demo sidechain + Build + ``` COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker compose -f <(envsubst < docker-compose.yml) -f <(envsubst < demo-sidechain.yml) build --build-arg WORKER_MODE_ARG=sidechain ``` + Run + ``` docker compose -f <(envsubst < docker-compose.yml) -f <(envsubst < demo-sidechain.yml) up demo-sidechain --exit-code-from demo-sidechain ``` ### Demo Teeracle + Build + ``` COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker compose -f <(envsubst < docker-compose.yml) -f <(envsubst < demo-teeracle.yml) build --build-arg WORKER_MODE_ARG=teeracle ``` + Run + ``` docker compose -f <(envsubst < docker-compose.yml) -f <(envsubst < demo-teeracle.yml) up demo-teeracle --exit-code-from demo-teeracle ``` - ## Run the benchmarks + Build with + ``` COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker compose -f <(envsubst < docker-compose.yml) -f <(envsubst < sidechain-benchmark.yml) build ``` + and then run with + ``` docker compose -f <(envsubst < docker-compose.yml) -f <(envsubst < sidechain-benchmark.yml) up sidechain-benchmark --exit-code-from sidechain-benchmark ``` ## Run the fork simulator -The fork simulation uses `pumba` which in turn uses the Linux traffic control (TC). This is only available on Linux hosts, not on Windows with WSL unfortunately. + +The fork simulation uses `pumba` which in turn uses the Linux traffic control (TC). This is only available on Linux +hosts, not on Windows with WSL unfortunately. Build the docker compose setup with + ``` COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker compose -f <(envsubst < docker-compose.yml) -f <(envsubst < fork-inducer.yml) -f <(envsubst < demo-sidechain.yml) build --build-arg WORKER_MODE_ARG=sidechain ``` @@ -86,31 +133,47 @@ COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker compose -f <(envsubst < dock This requires the docker BuildKit (docker version >= 18.09) and support for it in docker compose (version >= 1.25.0) Run the 2-worker setup with a fork inducer (pumba) that delays the traffic on worker 2 + ``` docker compose -f <(envsubst < docker-compose.yml) -f <(envsubst < fork-inducer.yml) -f <(envsubst < integration-test.yml) up --exit-code-from demo-sidechain ``` -This should show that the integration test fails, because we had an unhandled fork in the sidechain. Clean up the containers after each run with: +This should show that the integration test fails, because we had an unhandled fork in the sidechain. Clean up the +containers after each run with: + ``` docker compose -f <(envsubst < docker-compose.yml) -f <(envsubst < fork-inducer.yml) -f <(envsubst < demo-sidechain.yml) down ``` -We need these different compose files to separate the services that we're using. E.g. we want the integration test and fork simulator to be optional. The same could be solved using `profiles` - but that requires a more up-to-date version of `docker compose`. +We need these different compose files to separate the services that we're using. E.g. we want the integration test and +fork simulator to be optional. The same could be solved using `profiles` - but that requires a more up-to-date version +of `docker compose`. ## FAQ + ### What do I have to do to stop everything properly? -With `Ctrl-C` you stop the containers and with `docker compose down` you clean up/remove the containers. Note that `docker compose down` will also remove any logs docker has saved, since it will remove all the container context. + +With `Ctrl-C` you stop the containers and with `docker compose down` you clean up/remove the containers. Note +that `docker compose down` will also remove any logs docker has saved, since it will remove all the container context. ### What do I have to do if I make changes to the code? + You need to re-build the worker image, using `docker compose build`. ### How can I change the log level? + You can change the environment variable `RUST_LOG=` in the `docker-compose.yml` for each worker individually. ### The log from the node are quite a nuisance. Why are they all together. -You can suppress the log output for a container by setting the logging driver. This can be set to either `none` (completely disables all logs), or `local` (docker will record the logs, depending on your docker compose version, it will also log to `stdout`) in the `docker-compose.yml`: + +You can suppress the log output for a container by setting the logging driver. This can be set to either `none` ( +completely disables all logs), or `local` (docker will record the logs, depending on your docker compose version, it +will also log to `stdout`) in the `docker-compose.yml`: + ``` logging: driver: local ``` -Mind the indent. Explanations for all the logging drivers in `docker compose` can be found [here](https://docs.docker.com/config/containers/logging/local/). + +Mind the indent. Explanations for all the logging drivers in `docker compose` can be +found [here](https://docs.docker.com/config/containers/logging/local/). diff --git a/enclave-runtime/Cargo.lock b/enclave-runtime/Cargo.lock index 7623ffda8f..c703addb65 100644 --- a/enclave-runtime/Cargo.lock +++ b/enclave-runtime/Cargo.lock @@ -15,7 +15,7 @@ dependencies = [ [[package]] name = "ac-compose-macros" version = "0.4.2" -source = "git+https://github.com/brenzi/substrate-api-client.git?branch=polkadot-v0.9.42-tag-v0.14.0-retracted#480823e6a82236c4d6eb3a488a56f4bce2c4be2c" +source = "git+https://github.com/brenzi/substrate-api-client.git?branch=polkadot-v0.9.42-tag-v0.14.0-retracted#d01bc07fe0c8a8db1451d0d5c8bf82493b274d80" dependencies = [ "ac-primitives", "log", @@ -25,7 +25,7 @@ dependencies = [ [[package]] name = "ac-node-api" version = "0.5.1" -source = "git+https://github.com/brenzi/substrate-api-client.git?branch=polkadot-v0.9.42-tag-v0.14.0-retracted#480823e6a82236c4d6eb3a488a56f4bce2c4be2c" +source = "git+https://github.com/brenzi/substrate-api-client.git?branch=polkadot-v0.9.42-tag-v0.14.0-retracted#d01bc07fe0c8a8db1451d0d5c8bf82493b274d80" dependencies = [ "ac-primitives", "bitvec", @@ -50,7 +50,7 @@ dependencies = [ [[package]] name = "ac-primitives" version = "0.9.0" -source = "git+https://github.com/brenzi/substrate-api-client.git?branch=polkadot-v0.9.42-tag-v0.14.0-retracted#480823e6a82236c4d6eb3a488a56f4bce2c4be2c" +source = "git+https://github.com/brenzi/substrate-api-client.git?branch=polkadot-v0.9.42-tag-v0.14.0-retracted#d01bc07fe0c8a8db1451d0d5c8bf82493b274d80" dependencies = [ "impl-serde", "parity-scale-codec", @@ -500,7 +500,7 @@ dependencies = [ [[package]] name = "common-primitives" version = "0.1.0" -source = "git+https://github.com/integritee-network/pallets.git?branch=sdk-v0.12.11-polkadot-v0.9.42#094b1e982b4637ebfbf5afb985100417215d49a0" +source = "git+https://github.com/integritee-network/pallets.git?branch=sdk-v0.13.0-polkadot-v0.9.42#abf29acd41a0fca9cd7025b297b6a9fa272a122f" dependencies = [ "derive_more", "parity-scale-codec", @@ -756,7 +756,7 @@ dependencies = [ [[package]] name = "enclave-bridge-primitives" version = "0.1.0" -source = "git+https://github.com/integritee-network/pallets.git?branch=sdk-v0.12.11-polkadot-v0.9.42#094b1e982b4637ebfbf5afb985100417215d49a0" +source = "git+https://github.com/integritee-network/pallets.git?branch=sdk-v0.13.0-polkadot-v0.9.42#abf29acd41a0fca9cd7025b297b6a9fa272a122f" dependencies = [ "common-primitives", "log", @@ -771,7 +771,7 @@ dependencies = [ [[package]] name = "enclave-runtime" -version = "0.12.12" +version = "0.13.0" dependencies = [ "array-bytes 6.2.2", "cid", @@ -2960,7 +2960,7 @@ dependencies = [ [[package]] name = "pallet-parentchain" version = "0.11.0" -source = "git+https://github.com/integritee-network/pallets.git?branch=sdk-v0.12.11-polkadot-v0.9.42#094b1e982b4637ebfbf5afb985100417215d49a0" +source = "git+https://github.com/integritee-network/pallets.git?branch=sdk-v0.13.0-polkadot-v0.9.42#abf29acd41a0fca9cd7025b297b6a9fa272a122f" dependencies = [ "frame-support", "frame-system", @@ -3960,7 +3960,7 @@ dependencies = [ [[package]] name = "sidechain-primitives" version = "0.1.0" -source = "git+https://github.com/integritee-network/pallets.git?branch=sdk-v0.12.11-polkadot-v0.9.42#094b1e982b4637ebfbf5afb985100417215d49a0" +source = "git+https://github.com/integritee-network/pallets.git?branch=sdk-v0.13.0-polkadot-v0.9.42#abf29acd41a0fca9cd7025b297b6a9fa272a122f" dependencies = [ "parity-scale-codec", "scale-info", @@ -4404,7 +4404,7 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "substrate-api-client" version = "0.14.0" -source = "git+https://github.com/brenzi/substrate-api-client.git?branch=polkadot-v0.9.42-tag-v0.14.0-retracted#480823e6a82236c4d6eb3a488a56f4bce2c4be2c" +source = "git+https://github.com/brenzi/substrate-api-client.git?branch=polkadot-v0.9.42-tag-v0.14.0-retracted#d01bc07fe0c8a8db1451d0d5c8bf82493b274d80" dependencies = [ "ac-compose-macros", "ac-node-api", @@ -4490,7 +4490,7 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "teeracle-primitives" version = "0.1.0" -source = "git+https://github.com/integritee-network/pallets.git?branch=sdk-v0.12.11-polkadot-v0.9.42#094b1e982b4637ebfbf5afb985100417215d49a0" +source = "git+https://github.com/integritee-network/pallets.git?branch=sdk-v0.13.0-polkadot-v0.9.42#abf29acd41a0fca9cd7025b297b6a9fa272a122f" dependencies = [ "common-primitives", "sp-std", @@ -4500,7 +4500,7 @@ dependencies = [ [[package]] name = "teerex-primitives" version = "0.1.0" -source = "git+https://github.com/integritee-network/pallets.git?branch=sdk-v0.12.11-polkadot-v0.9.42#094b1e982b4637ebfbf5afb985100417215d49a0" +source = "git+https://github.com/integritee-network/pallets.git?branch=sdk-v0.13.0-polkadot-v0.9.42#abf29acd41a0fca9cd7025b297b6a9fa272a122f" dependencies = [ "common-primitives", "derive_more", @@ -4657,7 +4657,7 @@ version = "1.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" dependencies = [ - "cfg-if 0.1.10", + "cfg-if 1.0.0", "digest 0.10.7", "static_assertions", ] diff --git a/enclave-runtime/Cargo.toml b/enclave-runtime/Cargo.toml index 7cad605ff9..c7fc6dd36c 100644 --- a/enclave-runtime/Cargo.toml +++ b/enclave-runtime/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "enclave-runtime" -version = "0.12.12" +version = "0.13.0" authors = ["Integritee AG "] edition = "2021" @@ -87,9 +87,9 @@ webpki = { git = "https://github.com/mesalock-linux/webpki", branch = "mesalock_ base58 = { rev = "sgx_1.1.3", package = "rust-base58", default-features = false, features = ["mesalock_sgx"], git = "https://github.com/mesalock-linux/rust-base58-sgx" } cid = { default-features = false, git = "https://github.com/whalelephant/rust-cid", branch = "nstd" } -enclave-bridge-primitives = { default-features = false, git = "https://github.com/integritee-network/pallets.git", branch = "sdk-v0.12.11-polkadot-v0.9.42" } +enclave-bridge-primitives = { default-features = false, git = "https://github.com/integritee-network/pallets.git", branch = "sdk-v0.13.0-polkadot-v0.9.42" } multibase = { default-features = false, git = "https://github.com/whalelephant/rust-multibase", branch = "nstd" } -teerex-primitives = { default-features = false, git = "https://github.com/integritee-network/pallets.git", branch = "sdk-v0.12.11-polkadot-v0.9.42" } +teerex-primitives = { default-features = false, git = "https://github.com/integritee-network/pallets.git", branch = "sdk-v0.13.0-polkadot-v0.9.42" } # local deps ita-oracle = { path = "../app-libs/oracle", default-features = false, optional = true, features = ["sgx"] } diff --git a/service/Cargo.toml b/service/Cargo.toml index a12edefe74..8c4bd8ee91 100644 --- a/service/Cargo.toml +++ b/service/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "integritee-service" -version = "0.12.12" +version = "0.13.0" authors = ["Integritee AG "] build = "build.rs" edition = "2021" @@ -61,12 +61,12 @@ its-primitives = { path = "../sidechain/primitives" } its-rpc-handler = { path = "../sidechain/rpc-handler" } its-storage = { path = "../sidechain/storage" } -sgx-verify = { git = "https://github.com/integritee-network/pallets.git", branch = "sdk-v0.12.11-polkadot-v0.9.42" } +sgx-verify = { git = "https://github.com/integritee-network/pallets.git", branch = "sdk-v0.13.0-polkadot-v0.9.42" } # `default-features = false` to remove the jsonrpsee dependency. -enclave-bridge-primitives = { git = "https://github.com/integritee-network/pallets.git", branch = "sdk-v0.12.11-polkadot-v0.9.42" } +enclave-bridge-primitives = { git = "https://github.com/integritee-network/pallets.git", branch = "sdk-v0.13.0-polkadot-v0.9.42" } # disable unsupported jsonrpcsee substrate-api-client = { default-features = false, features = ["std", "sync-api"], git = "https://github.com/brenzi/substrate-api-client.git", branch = "polkadot-v0.9.42-tag-v0.14.0-retracted" } -teerex-primitives = { git = "https://github.com/integritee-network/pallets.git", branch = "sdk-v0.12.11-polkadot-v0.9.42" } +teerex-primitives = { git = "https://github.com/integritee-network/pallets.git", branch = "sdk-v0.13.0-polkadot-v0.9.42" } # Substrate dependencies frame-support = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" }