From 7d399738cc1756c7d2eae5a699b4b20ee82a829f Mon Sep 17 00:00:00 2001 From: clangenb <37865735+clangenb@users.noreply.github.com> Date: Wed, 14 Jun 2023 13:22:31 +0200 Subject: [PATCH 01/11] [local-setup] fix setup with two workers: avoid using the same data dirs. (#1358) --- local-setup/config/two-workers.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/local-setup/config/two-workers.json b/local-setup/config/two-workers.json index 51acefce9b..6d5e2316da 100644 --- a/local-setup/config/two-workers.json +++ b/local-setup/config/two-workers.json @@ -55,7 +55,7 @@ "4546", "--ws-external", "--data-dir", - "/tmp/data-dir" + "/tmp/data-dir2" ], "subcommand_flags": [ "--skip-ra", From 8c17f521c19edc58161a2901dcf753b1e7f101e4 Mon Sep 17 00:00:00 2001 From: mosonyi Date: Wed, 14 Jun 2023 15:25:55 +0200 Subject: [PATCH 02/11] Added dcap flag to teeracle#1191 (#1357) --- .github/workflows/build_and_test.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 9dcf87e2b4..770fc1089c 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -367,6 +367,7 @@ jobs: - flavor_id: teeracle mode: teeracle sgx_mode: HW + worker_features: dcap steps: - uses: actions/checkout@v3 @@ -422,7 +423,7 @@ jobs: run: > docker build -t integritee/${{ matrix.flavor_id }}:${{ github.ref_name }} --target deployed-worker - --build-arg WORKER_MODE_ARG=${{ matrix.mode }} --build-arg SGX_COMMERCIAL_KEY=enclave-runtime/intel_sgx.pem --build-arg SGX_PASSFILE=enclave-runtime/passfile.txt --build-arg SGX_PRODUCTION=1 --build-arg ADDITIONAL_FEATURES_ARG=${{ matrix.additional_features }} --build-arg SGX_MODE=${{ matrix.sgx_mode }} + --build-arg WORKER_MODE_ARG=${{ matrix.mode }} --build-arg SGX_COMMERCIAL_KEY=enclave-runtime/intel_sgx.pem --build-arg SGX_PASSFILE=enclave-runtime/passfile.txt --build-arg SGX_PRODUCTION=1 --build-arg WORKER_FEATURES_ARG=${{ matrix.worker_features }} --build-arg ADDITIONAL_FEATURES_ARG=${{ matrix.additional_features }} --build-arg SGX_MODE=${{ matrix.sgx_mode }} -f build.Dockerfile . - name: Save released teeracle From a676e1fb084556ef626b3a30b02cd3176cec629f Mon Sep 17 00:00:00 2001 From: mosonyi Date: Fri, 16 Jun 2023 22:52:22 +0200 Subject: [PATCH 03/11] Added teeracle helm chart sample #1360 (#1369) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Added teeracle helm chart sample #1360 * Update samples/teeracle/README.md Co-authored-by: Szilárd Parrag * Update samples/teeracle/README.md Co-authored-by: Szilárd Parrag * Update samples/teeracle/kubernetes/Chart.yaml Co-authored-by: Szilárd Parrag * Update samples/teeracle/kubernetes/values.yaml Co-authored-by: Szilárd Parrag * Addedd suggested changes --------- Co-authored-by: Szilárd Parrag --- samples/teeracle/README.md | 58 +++++++++++++++ samples/teeracle/install-teeracle.sh | 7 ++ samples/teeracle/kubernetes/Chart.yaml | 7 ++ .../kubernetes/templates/teeracle.yaml | 73 +++++++++++++++++++ samples/teeracle/kubernetes/values.yaml | 14 ++++ 5 files changed, 159 insertions(+) create mode 100644 samples/teeracle/README.md create mode 100755 samples/teeracle/install-teeracle.sh create mode 100644 samples/teeracle/kubernetes/Chart.yaml create mode 100644 samples/teeracle/kubernetes/templates/teeracle.yaml create mode 100644 samples/teeracle/kubernetes/values.yaml diff --git a/samples/teeracle/README.md b/samples/teeracle/README.md new file mode 100644 index 0000000000..05758f7d09 --- /dev/null +++ b/samples/teeracle/README.md @@ -0,0 +1,58 @@ +# Teeracle install into Securitee's kubernetes cluster + +This example is about to install [Integritee's Teeracle](https://docs.integritee.network/3-our-technology/3.5-use-cases/3.5.3-teeracle-oracle-framework). + +*Prerequisites:* + +* Ensure you have access to a Kubernetes cluster with SGX-enabled nodes and kubectl installed and configured. The easiest way to get started is to order Kubernetes from Securitee [Securitee Kubernetes](https://securitee.tech/products/), which offers SGX-enabled nodes. +* You have [Helm](https://helm.sh/docs/intro/install/) installed + +## Kubernetes deployment walkthrough + +We are now installing Teeracle + +### Install steps + + +* Edit the configuration values in file [kubernetes/values.yaml](kubernetes/values.yaml) + ```yaml + app: + url: "wss://rococo.api.integritee.network" + interval: "2m" + ``` +* Install the Teeracle into the cluster + + ```bash + helm install -f ./kubernetes/values.yaml teeracle ./kubernetes --create-namespace -n teeracle + or run + ./install-teeracle.sh + ``` + + +## Misc. + +### SGX Plugin + +If you are running in simulation mode, or are using a different plugin please edit the [kubernetes/templates/teeracle.yaml](kubernetes/templates/teeracle.yaml) + ```yaml + limits: + sgx.intel.com/epc: "10Mi" + sgx.intel.com/enclave: 1 + sgx.intel.com/provision: 1 + ``` + +### PCCS server + +The DCAP attestation requires a running PCCS server - which is provided by Securitee by default that's why we need to mount the ```/etc/sgx_default_qcnl.conf``` config file +see [kubernetes/templates/teeracle.yaml](kubernetes/templates/teeracle.yaml) + ```yaml + volumeMounts: + - name: qcnl + mountPath: /etc/sgx_default_qcnl.conf + ... + volumes: + - name: qcnl + hostPath: + path: /etc/sgx_default_qcnl.conf + + ``` diff --git a/samples/teeracle/install-teeracle.sh b/samples/teeracle/install-teeracle.sh new file mode 100755 index 0000000000..dbc21bc2b4 --- /dev/null +++ b/samples/teeracle/install-teeracle.sh @@ -0,0 +1,7 @@ +#!/bin/env bash + +namespace=teeracle +helm uninstall -n $namespace teeracle + +helm install -f ./kubernetes/values.yaml teeracle ./kubernetes --create-namespace -n $namespace + diff --git a/samples/teeracle/kubernetes/Chart.yaml b/samples/teeracle/kubernetes/Chart.yaml new file mode 100644 index 0000000000..d1f3a9a7f8 --- /dev/null +++ b/samples/teeracle/kubernetes/Chart.yaml @@ -0,0 +1,7 @@ +apiVersion: v2 +name: teeracle +description: teeracle dcap + +type: application +version: 0.1.0 +appVersion: 1.0.0 \ No newline at end of file diff --git a/samples/teeracle/kubernetes/templates/teeracle.yaml b/samples/teeracle/kubernetes/templates/teeracle.yaml new file mode 100644 index 0000000000..130ad79cb4 --- /dev/null +++ b/samples/teeracle/kubernetes/templates/teeracle.yaml @@ -0,0 +1,73 @@ +kind: ServiceAccount +apiVersion: v1 +metadata: + name: teeracle + namespace: {{ .Release.Namespace }} +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: teeracle-main + namespace: {{ .Release.Namespace }} + labels: + app: teeracle + role: main + tier: backend +spec: + replicas: 1 + selector: + matchLabels: + app: teeracle + role: main + tier: backend + template: + metadata: + labels: + app: teeracle + spec: + serviceAccountName: teeracle + containers: + - image: {{ .Values.image }} + imagePullPolicy: {{ .Values.imagePullPolicy }} + + args: [ + "-p", "443", + "-u", {{ .Values.app.url }}, + "--enable-metrics", + "--data-dir", "/opt/teeracle", + "run", + "--teeracle-interval", {{ .Values.app.interval }} + ] + name: teeracle + + resources: + # Resource request to use Intel SGX Device Plugin + # If you are running in simulation mode, or are using a different plugin, + # update these values accordingly + limits: + sgx.intel.com/epc: "10Mi" + sgx.intel.com/enclave: 1 + sgx.intel.com/provision: 1 + + volumeMounts: + - name: aesmd-socket + mountPath: /var/run/aesmd + - name: data-dir + mountPath: /opt/teeracle + - name: qcnl + mountPath: /etc/sgx_default_qcnl.conf + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + volumes: + - name: aesmd-socket + hostPath: + path: /var/run/aesmd + - name: data-dir + hostPath: + path: /opt/teeracle + - name: qcnl + hostPath: + path: /etc/sgx_default_qcnl.conf + diff --git a/samples/teeracle/kubernetes/values.yaml b/samples/teeracle/kubernetes/values.yaml new file mode 100644 index 0000000000..8a423ee3ab --- /dev/null +++ b/samples/teeracle/kubernetes/values.yaml @@ -0,0 +1,14 @@ +imagePullSecrets: + - name: regcred + +imagePullPolicy: IfNotPresent + +image: integritee/teeracle:v0.12.2-dev + +# +# To get more insights run: +# docker run integritee/teeracle:v0.12.2-dev --help +# +app: + url: "wss://rococo.api.integritee.network" + interval: "2m" \ No newline at end of file From 7f3bcb94751f29558751c3f0dd4fd42d84b98c71 Mon Sep 17 00:00:00 2001 From: clangenb <37865735+clangenb@users.noreply.github.com> Date: Tue, 20 Jun 2023 14:35:38 +0200 Subject: [PATCH 04/11] attesteer feature implies dcap (#1373) --- service/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service/Cargo.toml b/service/Cargo.toml index 01c69708e7..75340ffe4f 100644 --- a/service/Cargo.toml +++ b/service/Cargo.toml @@ -83,7 +83,7 @@ offchain-worker = ["itp-settings/offchain-worker"] production = ["itp-settings/production"] teeracle = ["itp-settings/teeracle"] dcap = [] -attesteer = [] +attesteer = ["dcap"] [dev-dependencies] # crates.io From 3443f1545aaa7a7b51885c74106bfd55f1729b1b Mon Sep 17 00:00:00 2001 From: mosonyi Date: Mon, 17 Jul 2023 13:57:57 +0200 Subject: [PATCH 05/11] Switch from ias to dcap (#1375) * Switch from ias to dcap * Mount sgx qcnl * Mount sgx qcnl * Start aesmd in the background * Fix apt install * Fix apt install * Fix entrypoint * Fix lib path * Remove starting aesmd * Try with entrypoint * Move WORKDIR down * only ignore yaml files * Move back WORKDIR * Addedd qcnl sgx conf * change entrypoint to command * change entrypoint to command * Don't run aesmd service in cli * Try to remove IAS_SPID envs * Do not use ias version of the node * Do not use ias version of the node * Add back ias node * attestation-service: enable SGX DCAP QPL logging * docker: add missing DCAP packages * attestation: rename function used in MURA to distingiuish between DCAP and EPID attestation * attestation: preparing for DCAP MURA * attestation: prepare for DCAP * move qe_get_* to the worker * backup, linker error * testing * dcap-mura: fix DCAP API calls order * enclave-runtime: add dcap feature flag to it as well * fixup! enclave-runtime: add dcap feature flag to it as well * attestation-handler: return private_key as well from generate_dcap_ra_cert * add logging * fix logging * mura-dcap: add target to provisioning as well * MURA: use the same target * add printing for cert_der * to be dropped * mura: base64 encode the payload * fixup! mura: base64 encode the payload * fixup! mura: base64 encode the payload * mura: basically disable it with dcap * gha: add back clippy * attestation-handler: remove build.rs * attestation-handler: remove commented out code * attestation-handler: add debug log * fix typo * enclave-runtime: fix clippy * build: revert dcap lib linking * build: revert cargo verbosity * docker: remove epid leftover files * attestation-handler: return error if base64 decoding fails * docker: fix typo in network name * local-setup: print worker command as well * dcap with sw mode: fix * gha/build: remove worker_features_arg * dcap with sw mode: fix integration tests * cli: add a note regarding dcap * clippy: fix * mura: fix dcap related parameter references * fixup! mura: fix dcap related parameter references * docker: enable debug logging * add more logs * fixup! add more logs * mura: make sure enclave gets the correct reference * Revert "docker: enable debug logging" This reverts commit 1681a816573ebbe01930b93ad5d1416541318c1f. * Revert "add more logs" This reverts commit f141e030d37ae3d73948781c459803bf986c60e5. * service: remove potentially unnecessary clone() * attestation-handler: remove enum variant import * attestation-handler: add TODO for MURA removal * enclave-runtime/attestation: remove obsolete todo --------- Co-authored-by: Szilard Parrag --- .dockerignore | 2 +- .github/workflows/build_and_test.yml | 18 ++- build.Dockerfile | 26 +++- cli/Cargo.toml | 2 + .../attestation-handler/Cargo.toml | 2 +- .../src/attestation_handler.rs | 132 +++++++++++------- .../attestation-handler/src/cert.rs | 128 +++++++++-------- .../attestation-handler/src/lib.rs | 6 + core-primitives/enclave-api/ffi/src/lib.rs | 8 +- .../enclave-api/src/remote_attestation.rs | 63 ++++++++- docker/demo-direct-call.yml | 1 + docker/demo-indirect-invocation.yml | 1 + docker/demo-sidechain.yml | 1 + docker/demo-smart-contract.yml | 1 + docker/demo-teeracle-generic.yml | 8 +- docker/demo-teeracle.yml | 8 +- docker/docker-compose.yml | 11 +- docker/entrypoint.sh | 7 + docker/fork-inducer.yml | 2 + docker/sidechain-benchmark.yml | 1 + enclave-runtime/Cargo.toml | 1 + enclave-runtime/Enclave.edl | 12 +- enclave-runtime/src/attestation.rs | 51 +++++-- enclave-runtime/src/error.rs | 16 ++- enclave-runtime/src/test/cert_tests.rs | 4 +- enclave-runtime/src/tls_ra/authentication.rs | 12 +- enclave-runtime/src/tls_ra/tests.rs | 12 +- enclave-runtime/src/tls_ra/tls_ra_client.rs | 49 ++++++- enclave-runtime/src/tls_ra/tls_ra_server.rs | 35 ++++- local-setup/py/worker.py | 5 +- service/src/enclave/tls_ra.rs | 40 +++++- service/src/main.rs | 27 +++- service/src/sync_state.rs | 7 +- 33 files changed, 517 insertions(+), 182 deletions(-) create mode 100755 docker/entrypoint.sh diff --git a/.dockerignore b/.dockerignore index e77752005c..9184948340 100644 --- a/.dockerignore +++ b/.dockerignore @@ -3,7 +3,7 @@ .github .idea ci/ -docker/ +docker/*yml docs/ local-setup/ scripts/ diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 770fc1089c..d0f58ca51b 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -37,17 +37,20 @@ jobs: mode: sidechain host: integritee-builder-sgx sgx_mode: HW + additional_features: dcap - flavor_id: offchain-worker mode: offchain-worker host: integritee-builder-sgx sgx_mode: HW + additional_features: dcap - flavor_id: teeracle mode: teeracle host: integritee-builder-sgx sgx_mode: HW + additional_features: dcap - flavor_id: sidechain-evm mode: sidechain - additional_features: evm + additional_features: evm,dcap host: integritee-builder-sgx sgx_mode: HW @@ -60,7 +63,7 @@ jobs: echo "FINGERPRINT=$fingerprint" >> $GITHUB_ENV if [[ ${{ matrix.sgx_mode }} == 'HW' ]]; then echo "DOCKER_DEVICES=--device=/dev/sgx/enclave --device=/dev/sgx/provision" >> $GITHUB_ENV - echo "DOCKER_VOLUMES=--volume /var/run/aesmd:/var/run/aesmd" >> $GITHUB_ENV + echo "DOCKER_VOLUMES=--volume /var/run/aesmd:/var/run/aesmd --volume /etc/sgx_default_qcnl.conf:/etc/sgx_default_qcnl.conf" >> $GITHUB_ENV else echo "DOCKER_DEVICES=" >> $GITHUB_ENV echo "DOCKER_VOLUMES=" >> $GITHUB_ENV @@ -189,8 +192,8 @@ jobs: WORKER_IMAGE_TAG: integritee-worker:dev CLIENT_IMAGE_TAG: integritee-cli:dev COINMARKETCAP_KEY: ${{ secrets.COINMARKETCAP_KEY }} - IAS_EPID_SPID: ${{ secrets.IAS_SPID }} - IAS_EPID_KEY: ${{ secrets.IAS_PRIMARY_KEY }} + # IAS_EPID_SPID: ${{ secrets.IAS_SPID }} + # IAS_EPID_KEY: ${{ secrets.IAS_PRIMARY_KEY }} TEERACLE_INTERVAL_SECONDS: 10 strategy: @@ -254,6 +257,7 @@ jobs: echo "SGX_PROVISION=/dev/sgx/provision" >> $GITHUB_ENV echo "SGX_ENCLAVE=/dev/sgx/enclave" >> $GITHUB_ENV echo "AESMD=/var/run/aesmd" >> $GITHUB_ENV + echo "SGX_QCNL=/etc/sgx_default_qcnl.conf" >> $GITHUB_ENV fi echo "LOG_DIR=./logs-$version" >> $GITHUB_ENV @@ -367,7 +371,7 @@ jobs: - flavor_id: teeracle mode: teeracle sgx_mode: HW - worker_features: dcap + additional_features: dcap steps: - uses: actions/checkout@v3 @@ -384,7 +388,7 @@ jobs: echo "FINGERPRINT=$fingerprint" >> $GITHUB_ENV if [[ ${{ matrix.sgx_mode }} == 'HW' ]]; then echo "DOCKER_DEVICES=--device=/dev/sgx/enclave --device=/dev/sgx/provision" >> $GITHUB_ENV - echo "DOCKER_VOLUMES=--volume /var/run/aesmd:/var/run/aesmd" >> $GITHUB_ENV + echo "DOCKER_VOLUMES=--volume /var/run/aesmd:/var/run/aesmd --volume /etc/sgx_default_qcnl.conf:/etc/sgx_default_qcnl.conf" >> $GITHUB_ENV else echo "DOCKER_DEVICES=" >> $GITHUB_ENV echo "DOCKER_VOLUMES=" >> $GITHUB_ENV @@ -423,7 +427,7 @@ jobs: run: > docker build -t integritee/${{ matrix.flavor_id }}:${{ github.ref_name }} --target deployed-worker - --build-arg WORKER_MODE_ARG=${{ matrix.mode }} --build-arg SGX_COMMERCIAL_KEY=enclave-runtime/intel_sgx.pem --build-arg SGX_PASSFILE=enclave-runtime/passfile.txt --build-arg SGX_PRODUCTION=1 --build-arg WORKER_FEATURES_ARG=${{ matrix.worker_features }} --build-arg ADDITIONAL_FEATURES_ARG=${{ matrix.additional_features }} --build-arg SGX_MODE=${{ matrix.sgx_mode }} + --build-arg WORKER_MODE_ARG=${{ matrix.mode }} --build-arg SGX_COMMERCIAL_KEY=enclave-runtime/intel_sgx.pem --build-arg SGX_PASSFILE=enclave-runtime/passfile.txt --build-arg SGX_PRODUCTION=1 --build-arg ADDITIONAL_FEATURES_ARG=${{ matrix.additional_features }} --build-arg SGX_MODE=${{ matrix.sgx_mode }} -f build.Dockerfile . - name: Save released teeracle diff --git a/build.Dockerfile b/build.Dockerfile index fdc03795d2..13f8dfb4bc 100644 --- a/build.Dockerfile +++ b/build.Dockerfile @@ -38,8 +38,6 @@ ENV SGX_MODE=$SGX_MODE ARG SGX_PRODUCTION=0 ENV SGX_PRODUCTION=$SGX_PRODUCTION -ARG WORKER_FEATURES_ARG -ENV WORKER_FEATURES=$WORKER_FEATURES_ARG ENV WORKHOME=/home/ubuntu/work ENV HOME=/home/ubuntu @@ -80,6 +78,19 @@ RUN --mount=type=cache,id=cargo-registry-cache,target=/opt/rust/registry/cache,s FROM oasisprotocol/aesmd:master AS runner ENV SGX_SDK /opt/sgxsdk ENV LD_LIBRARY_PATH "${SGX_SDK}/sdk_libs" +RUN apt-get install -y \ + libsgx-aesm-ecdsa-plugin \ + libsgx-ae-qve \ + libsgx-aesm-quote-ex-plugin \ + libsgx-dcap-default-qpl \ + libsgx-dcap-ql \ + libsgx-dcap-quote-verify \ + libsgx-epid \ + libsgx-headers \ + libsgx-quote-ex \ + libsgx-ra-network \ + libsgx-ra-uefi \ + libsgx-uae-service ### Deployed CLI client ################################################## @@ -116,14 +127,19 @@ COPY --from=builder /home/ubuntu/work/worker/bin/* ./ COPY --from=builder /lib/x86_64-linux-gnu/libsgx* /lib/x86_64-linux-gnu/ COPY --from=builder /lib/x86_64-linux-gnu/libdcap* /lib/x86_64-linux-gnu/ -RUN touch spid.txt key.txt RUN chmod +x /usr/local/bin/integritee-service RUN ls -al /usr/local/bin # checks ENV SGX_SDK /opt/sgxsdk -ENV LD_LIBRARY_PATH $LD_LIBRARY_PATH:$SGX_SDK/sdk_libs +ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/intel/sgx-aesm-service/aesm:$SGX_SDK/sdk_libs +ENV AESM_PATH=/opt/intel/sgx-aesm-service/aesm + +COPY ./docker/entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh + + RUN ldd /usr/local/bin/integritee-service && \ /usr/local/bin/integritee-service --version -ENTRYPOINT ["/usr/local/bin/integritee-service"] +ENTRYPOINT ["/entrypoint.sh"] diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 49181dde7d..b318a3437c 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -60,3 +60,5 @@ teeracle = [] sidechain = [] offchain-worker = [] production = [] +# dcap feature flag is not used in this crate, but for easier build purposes only it present here as well +dcap = [] diff --git a/core-primitives/attestation-handler/Cargo.toml b/core-primitives/attestation-handler/Cargo.toml index 20ffad4f25..811dfff216 100644 --- a/core-primitives/attestation-handler/Cargo.toml +++ b/core-primitives/attestation-handler/Cargo.toml @@ -37,7 +37,7 @@ sgx_rand = { branch = "master", git = "https://github.com/apache/teaclave-sgx-sd sgx_tcrypto = { branch = "master", git = "https://github.com/apache/teaclave-sgx-sdk.git", optional = true } sgx_tse = { branch = "master", git = "https://github.com/apache/teaclave-sgx-sdk.git", optional = true } sgx_tstd = { branch = "master", git = "https://github.com/apache/teaclave-sgx-sdk.git", features = ["untrusted_fs", "net", "backtrace"], optional = true } -sgx_types = { branch = "master", git = "https://github.com/apache/teaclave-sgx-sdk.git" } +sgx_types = { branch = "master", git = "https://github.com/apache/teaclave-sgx-sdk.git", features = ["extra_traits"] } # local deps itp-ocall-api = { path = "../ocall-api", default-features = false } diff --git a/core-primitives/attestation-handler/src/attestation_handler.rs b/core-primitives/attestation-handler/src/attestation_handler.rs index 8b8401951d..fa2058d563 100644 --- a/core-primitives/attestation-handler/src/attestation_handler.rs +++ b/core-primitives/attestation-handler/src/attestation_handler.rs @@ -48,7 +48,7 @@ use sgx_tcrypto::{rsgx_sha256_slice, SgxEccHandle}; use sgx_tse::{rsgx_create_report, rsgx_verify_report}; use sgx_types::{ c_int, sgx_epid_group_id_t, sgx_quote_nonce_t, sgx_quote_sign_type_t, sgx_report_data_t, - sgx_spid_t, sgx_status_t, sgx_target_info_t, SgxResult, *, + sgx_spid_t, sgx_status_t, sgx_status_t::SGX_ERROR_UNEXPECTED, sgx_target_info_t, SgxResult, *, }; use sp_core::{ed25519, Pair}; use std::{ @@ -82,15 +82,15 @@ pub trait AttestationHandler { /// but instead generate a mock certificate. fn generate_ias_ra_cert(&self, skip_ra: bool) -> EnclaveResult>; - /// Returns the DER encoded certificate and the raw DCAP quote. + /// Returns the DER encoded private_key, DER encoded certificate and the raw DCAP quote. /// If skip_ra is set, it will not perform a remote attestation via IAS /// but instead generate a mock certificate. fn generate_dcap_ra_cert( &self, - quoting_enclave_target_info: &sgx_target_info_t, - quote_size: u32, + quoting_enclave_target_info: Option<&sgx_target_info_t>, + quote_size: Option<&u32>, skip_ra: bool, - ) -> EnclaveResult<(Vec, Vec)>; + ) -> EnclaveResult<(Vec, Vec, Vec)>; /// Get the measurement register value of the enclave fn get_mrenclave(&self) -> EnclaveResult<[u8; MR_ENCLAVE_SIZE]>; @@ -107,7 +107,7 @@ pub trait AttestationHandler { /// Create the remote attestation report and encapsulate it in a DER certificate /// Returns a pair consisting of (private key DER, certificate DER) - fn create_ra_report_and_signature( + fn create_epid_ra_report_and_signature( &self, sign_type: sgx_quote_sign_type_t, skip_ra: bool, @@ -119,6 +119,35 @@ pub struct IntelAttestationHandler { pub(crate) signing_key_repo: Arc, } +impl IntelAttestationHandler +where + OCallApi: EnclaveAttestationOCallApi, + AccessSigningKey: AccessKey, +{ + fn create_payload_epid( + &self, + pub_k: &[u8; 32], + sign_type: sgx_quote_sign_type_t, + ) -> EnclaveResult { + info!(" [Enclave] Create attestation report"); + let (attn_report, sig, cert) = match self.create_epid_attestation_report(&pub_k, sign_type) + { + Ok(r) => r, + Err(e) => { + error!(" [Enclave] Error in create_attestation_report: {:?}", e); + return Err(e.into()) + }, + }; + println!(" [Enclave] Create attestation report successful"); + debug!(" attn_report = {:?}", attn_report); + debug!(" sig = {:?}", sig); + debug!(" cert = {:?}", cert); + + // concat the information + Ok(attn_report + "|" + &sig + "|" + &cert) + } +} + impl AttestationHandler for IntelAttestationHandler where @@ -132,7 +161,7 @@ where // FIXME: should call `create_ra_report_and_signature` in skip_ra mode as well: // https://github.com/integritee-network/worker/issues/321. let cert_der = if !skip_ra { - match self.create_ra_report_and_signature(sign_type, skip_ra) { + match self.create_epid_ra_report_and_signature(sign_type, skip_ra) { Ok((_key_der, cert_der)) => cert_der, Err(e) => return Err(e), } @@ -154,7 +183,8 @@ where // our certificate is unlinkable let sign_type = sgx_quote_sign_type_t::SGX_UNLINKABLE_SIGNATURE; - let (_key_der, cert_der) = match self.create_ra_report_and_signature(sign_type, false) { + let (_key_der, cert_der) = match self.create_epid_ra_report_and_signature(sign_type, false) + { Ok(r) => r, Err(e) => return Err(e), }; @@ -175,11 +205,14 @@ where quoting_enclave_target_info: &sgx_target_info_t, quote_size: u32, ) -> EnclaveResult<()> { - let (_cert_der, dcap_quote) = - match self.generate_dcap_ra_cert(quoting_enclave_target_info, quote_size, false) { - Ok(r) => r, - Err(e) => return Err(e), - }; + let (_priv_key_der, _cert_der, dcap_quote) = match self.generate_dcap_ra_cert( + Some(quoting_enclave_target_info), + Some("e_size), + false, + ) { + Ok(r) => r, + Err(e) => return Err(e), + }; if let Err(err) = io::write(&dcap_quote, RA_DUMP_CERT_DER_FILE) { error!( @@ -192,7 +225,7 @@ where Ok(()) } - fn create_ra_report_and_signature( + fn create_epid_ra_report_and_signature( &self, sign_type: sgx_quote_sign_type_t, skip_ra: bool, @@ -209,36 +242,20 @@ where debug!(" pubkey Y is {:02x}", pub_k.gy.iter().format("")); let payload = if !skip_ra { - info!(" [Enclave] Create attestation report"); - let (attn_report, sig, cert) = - match self.create_attestation_report(&chain_signer.public().0, sign_type) { - Ok(r) => r, - Err(e) => { - error!(" [Enclave] Error in create_attestation_report: {:?}", e); - return Err(e.into()) - }, - }; - println!(" [Enclave] Create attestation report successful"); - debug!(" attn_report = {:?}", attn_report); - debug!(" sig = {:?}", sig); - debug!(" cert = {:?}", cert); - - // concat the information - attn_report + "|" + &sig + "|" + &cert + self.create_payload_epid(&chain_signer.public().0, sign_type)? } else { Default::default() }; // generate an ECC certificate info!(" [Enclave] Generate ECC Certificate"); - let (key_der, cert_der) = - match cert::gen_ecc_cert(&payload.into_bytes(), &prv_k, &pub_k, &ecc_handle) { - Ok(r) => r, - Err(e) => { - error!(" [Enclave] gen_ecc_cert failed: {:?}", e); - return Err(e.into()) - }, - }; + let (key_der, cert_der) = match cert::gen_ecc_cert(&payload, &prv_k, &pub_k, &ecc_handle) { + Ok(r) => r, + Err(e) => { + error!(" [Enclave] gen_ecc_cert failed: {:?}", e); + return Err(e.into()) + }, + }; let _ = ecc_handle.close(); info!(" [Enclave] Generate ECC Certificate successful"); @@ -247,10 +264,14 @@ where fn generate_dcap_ra_cert( &self, - quoting_enclave_target_info: &sgx_target_info_t, - quote_size: u32, + quoting_enclave_target_info: Option<&sgx_target_info_t>, + quote_size: Option<&u32>, skip_ra: bool, - ) -> EnclaveResult<(Vec, Vec)> { + ) -> EnclaveResult<(Vec, Vec, Vec)> { + if !skip_ra && quoting_enclave_target_info.is_none() && quote_size.is_none() { + error!("Enclave Attestation] remote attestation not skipped, but Quoting Enclave (QE) data is not available"); + return Err(EnclaveError::Sgx(sgx_status_t::SGX_ERROR_UNEXPECTED)) + } let chain_signer = self.signing_key_repo.retrieve_key()?; info!("[Enclave Attestation] Ed25519 signer pub key: {:?}", chain_signer.public().0); @@ -262,8 +283,8 @@ where let qe_quote = if !skip_ra { let qe_quote = match self.retrieve_qe_dcap_quote( &chain_signer.public().0, - quoting_enclave_target_info, - quote_size, + quoting_enclave_target_info.unwrap(), + *quote_size.unwrap(), ) { Ok(quote) => quote, Err(e) => { @@ -276,20 +297,25 @@ where Default::default() }; + let qe_quote_base_64 = base64::encode(&qe_quote[..]); // generate an ECC certificate debug!("[Enclave] Generate ECC Certificate"); - let (_key_der, cert_der) = match cert::gen_ecc_cert(&qe_quote, &prv_k, &pub_k, &ecc_handle) - { - Ok(r) => r, - Err(e) => { - error!("[Enclave] gen_ecc_cert failed: {:?}", e); - return Err(e.into()) - }, - }; + let (key_der, cert_der) = + match cert::gen_ecc_cert(&qe_quote_base_64, &prv_k, &pub_k, &ecc_handle) { + Ok(r) => r, + Err(e) => { + error!("[Enclave] gen_ecc_cert failed: {:?}", e); + return Err(e.into()) + }, + }; let _ = ecc_handle.close(); - Ok((cert_der, qe_quote)) + debug!("[Enclave] Generated ECC cert info:"); + trace!("[Enclave] Generated ECC cert info: key_der={:#?}", &key_der); + trace!("[Enclave] Generated ECC cert info: cert_der={:#?}", &cert_der); + trace!("[Enclave] Generated ECC cert info: qe_quote={:#?}", &qe_quote); + Ok((key_der, cert_der, qe_quote)) } } @@ -511,7 +537,7 @@ where + (u32::from(array[3]) << 24) } - fn create_attestation_report( + fn create_epid_attestation_report( &self, pub_k: &[u8; 32], sign_type: sgx_quote_sign_type_t, diff --git a/core-primitives/attestation-handler/src/cert.rs b/core-primitives/attestation-handler/src/cert.rs index e331d9e23a..ae158f661b 100644 --- a/core-primitives/attestation-handler/src/cert.rs +++ b/core-primitives/attestation-handler/src/cert.rs @@ -70,8 +70,9 @@ pub mod sgx { const ISSUER: &str = "Integritee"; const SUBJECT: &str = "Integritee ephemeral"; + /// `payload` must be a valid a string, not just arbitrary data. pub fn gen_ecc_cert( - payload: &[u8], + payload: &str, prv_k: &sgx_ec256_private_t, pub_k: &sgx_ec256_public_t, ecc_handle: &SgxEccHandle, @@ -158,7 +159,7 @@ pub mod sgx { writer.next().write_oid(&ObjectIdentifier::from_slice(&[ 2, 16, 840, 1, 113_730, 1, 13, ])); - writer.next().write_bytes(payload); + writer.next().write_bytes(payload.as_bytes()); }); }); }); @@ -234,7 +235,12 @@ pub fn percent_decode(orig: String) -> EnclaveResult { } // FIXME: This code is redundant with the host call of the integritee-node -pub fn verify_mra_cert(cert_der: &[u8], attestation_ocall: &A) -> SgxResult<()> +pub fn verify_mra_cert( + cert_der: &[u8], + is_payload_base64_encoded: bool, + is_dcap: bool, + attestation_ocall: &A, +) -> SgxResult<()> where A: EnclaveAttestationOCallApi, { @@ -276,62 +282,72 @@ where // Obtain Netscape Comment offset += 1; - let payload = cert_der[offset..offset + len].to_vec(); - - // Extract each field - let mut iter = payload.split(|x| *x == 0x7C); - let attn_report_raw = iter.next().ok_or(sgx_status_t::SGX_ERROR_UNEXPECTED)?; - let sig_raw = iter.next().ok_or(sgx_status_t::SGX_ERROR_UNEXPECTED)?; - let sig = base64::decode(sig_raw).map_err(|e| EnclaveError::Other(e.into()))?; - - let sig_cert_raw = iter.next().ok_or(sgx_status_t::SGX_ERROR_UNEXPECTED)?; - let sig_cert_dec = base64::decode_config(sig_cert_raw, base64::STANDARD) - .map_err(|e| EnclaveError::Other(e.into()))?; - let sig_cert = webpki::EndEntityCert::from(&sig_cert_dec).expect("Bad DER"); - - // Verify if the signing cert is issued by Intel CA - let mut ias_ca_stripped = IAS_REPORT_CA.to_vec(); - ias_ca_stripped.retain(|&x| x != 0x0d && x != 0x0a); - let head_len = "-----BEGIN CERTIFICATE-----".len(); - let tail_len = "-----END CERTIFICATE-----".len(); - let full_len = ias_ca_stripped.len(); - let ias_ca_core: &[u8] = &ias_ca_stripped[head_len..full_len - tail_len]; - let ias_cert_dec = base64::decode_config(ias_ca_core, base64::STANDARD) - .map_err(|e| EnclaveError::Other(e.into()))?; - - let mut ca_reader = BufReader::new(IAS_REPORT_CA); - - let mut root_store = rustls::RootCertStore::empty(); - root_store.add_pem_file(&mut ca_reader).expect("Failed to add CA"); - - let trust_anchors: Vec = - root_store.roots.iter().map(|cert| cert.to_trust_anchor()).collect(); - - let now_func = webpki::Time::try_from(SystemTime::now()); - - match sig_cert.verify_is_valid_tls_server_cert( - SUPPORTED_SIG_ALGS, - &webpki::TLSServerTrustAnchors(&trust_anchors), - &[ias_cert_dec.as_slice()], - now_func.map_err(|_e| EnclaveError::Time)?, - ) { - Ok(_) => info!("Cert is good"), - Err(e) => { - error!("Cert verification error {:?}", e); - return Err(sgx_status_t::SGX_ERROR_UNEXPECTED) - }, + let mut payload = cert_der[offset..offset + len].to_vec(); + println!("payload in mra cert verifier is: {:#?}", &payload); + if is_payload_base64_encoded { + payload = base64::decode(&payload[..]).or(Err(sgx_status_t::SGX_ERROR_UNEXPECTED))?; } + println!("payload in mra cert verifier is: {:#?}", &payload); + if !is_dcap { + // Extract each field + let mut iter = payload.split(|x| *x == b'|'); + let attn_report_raw = iter.next().ok_or(sgx_status_t::SGX_ERROR_UNEXPECTED)?; + let sig_raw = iter.next().ok_or(sgx_status_t::SGX_ERROR_UNEXPECTED)?; + let sig = base64::decode(sig_raw).map_err(|e| EnclaveError::Other(e.into()))?; + + let sig_cert_raw = iter.next().ok_or(sgx_status_t::SGX_ERROR_UNEXPECTED)?; + let sig_cert_dec = base64::decode_config(sig_cert_raw, base64::STANDARD) + .map_err(|e| EnclaveError::Other(e.into()))?; + let sig_cert = webpki::EndEntityCert::from(&sig_cert_dec).expect("Bad DER"); + + // Verify if the signing cert is issued by Intel CA + let mut ias_ca_stripped = IAS_REPORT_CA.to_vec(); + ias_ca_stripped.retain(|&x| x != b'\r' && x != b'\n'); + let head_len = "-----BEGIN CERTIFICATE-----".len(); + let tail_len = "-----END CERTIFICATE-----".len(); + let full_len = ias_ca_stripped.len(); + let ias_ca_core: &[u8] = &ias_ca_stripped[head_len..full_len - tail_len]; + let ias_cert_dec = base64::decode_config(ias_ca_core, base64::STANDARD) + .map_err(|e| EnclaveError::Other(e.into()))?; + + let mut ca_reader = BufReader::new(IAS_REPORT_CA); + + let mut root_store = rustls::RootCertStore::empty(); + root_store.add_pem_file(&mut ca_reader).expect("Failed to add CA"); + + let trust_anchors: Vec = + root_store.roots.iter().map(|cert| cert.to_trust_anchor()).collect(); + + let now_func = webpki::Time::try_from(SystemTime::now()); + + match sig_cert.verify_is_valid_tls_server_cert( + SUPPORTED_SIG_ALGS, + &webpki::TLSServerTrustAnchors(&trust_anchors), + &[ias_cert_dec.as_slice()], + now_func.map_err(|_e| EnclaveError::Time)?, + ) { + Ok(_) => info!("Cert is good"), + Err(e) => { + error!("Cert verification error {:?}", e); + return Err(sgx_status_t::SGX_ERROR_UNEXPECTED) + }, + } - // Verify the signature against the signing cert - match sig_cert.verify_signature(&webpki::RSA_PKCS1_2048_8192_SHA256, attn_report_raw, &sig) { - Ok(_) => info!("Signature good"), - Err(e) => { - error!("Signature verification error {:?}", e); - return Err(sgx_status_t::SGX_ERROR_UNEXPECTED) - }, - } + // Verify the signature against the signing cert + match sig_cert.verify_signature(&webpki::RSA_PKCS1_2048_8192_SHA256, attn_report_raw, &sig) + { + Ok(_) => info!("Signature good"), + Err(e) => { + error!("Signature verification error {:?}", e); + return Err(sgx_status_t::SGX_ERROR_UNEXPECTED) + }, + } - verify_attn_report(attn_report_raw, pub_k, attestation_ocall) + verify_attn_report(attn_report_raw, pub_k, attestation_ocall) + } else { + // TODO Refactor state provisioning to not use MURA #1385 + Ok(()) + } } pub fn verify_attn_report( diff --git a/core-primitives/attestation-handler/src/lib.rs b/core-primitives/attestation-handler/src/lib.rs index 651aeca924..c6763b3d9a 100644 --- a/core-primitives/attestation-handler/src/lib.rs +++ b/core-primitives/attestation-handler/src/lib.rs @@ -50,3 +50,9 @@ pub use attestation_handler::{AttestationHandler, IntelAttestationHandler, DEV_H pub use collateral::SgxQlQveCollateral; pub use error::{Error, Result}; + +#[derive(Clone, Eq, PartialEq, Debug)] +pub enum RemoteAttestationType { + Epid, + Dcap, +} diff --git a/core-primitives/enclave-api/ffi/src/lib.rs b/core-primitives/enclave-api/ffi/src/lib.rs index fa00b22143..9bb8920b4a 100644 --- a/core-primitives/enclave-api/ffi/src/lib.rs +++ b/core-primitives/enclave-api/ffi/src/lib.rs @@ -128,8 +128,8 @@ extern "C" { unchecked_extrinsic: *mut u8, unchecked_extrinsic_size: u32, skip_ra: c_int, - quoting_enclave_target_info: &sgx_target_info_t, - quote_size: u32, + quoting_enclave_target_info: Option<&sgx_target_info_t>, + quote_size: Option<&u32>, ) -> sgx_status_t; pub fn generate_dcap_ra_quote( @@ -214,6 +214,8 @@ extern "C" { retval: *mut sgx_status_t, socket_fd: c_int, sign_type: sgx_quote_sign_type_t, + quoting_enclave_target_info: Option<&sgx_target_info_t>, + quote_size: Option<&u32>, skip_ra: c_int, ) -> sgx_status_t; @@ -222,6 +224,8 @@ extern "C" { retval: *mut sgx_status_t, socket_fd: c_int, sign_type: sgx_quote_sign_type_t, + quoting_enclave_target_info: Option<&sgx_target_info_t>, + quote_size: Option<&u32>, shard: *const u8, shard_size: u32, skip_ra: c_int, diff --git a/core-primitives/enclave-api/src/remote_attestation.rs b/core-primitives/enclave-api/src/remote_attestation.rs index 8c6eda0c41..e4f3fca190 100644 --- a/core-primitives/enclave-api/src/remote_attestation.rs +++ b/core-primitives/enclave-api/src/remote_attestation.rs @@ -66,6 +66,8 @@ pub trait RemoteAttestation { fn set_ql_qe_enclave_paths(&self) -> EnclaveResult<()>; + fn set_sgx_qpl_logging(&self) -> EnclaveResult<()>; + fn qe_get_target_info(&self) -> EnclaveResult; fn qe_get_quote_size(&self) -> EnclaveResult; @@ -113,6 +115,8 @@ pub trait TlsRemoteAttestation { &self, socket_fd: c_int, sign_type: sgx_quote_sign_type_t, + quoting_enclave_target_info: Option<&sgx_target_info_t>, + quote_size: Option<&u32>, skip_ra: bool, ) -> EnclaveResult<()>; @@ -120,6 +124,8 @@ pub trait TlsRemoteAttestation { &self, socket_fd: c_int, sign_type: sgx_quote_sign_type_t, + quoting_enclave_target_info: Option<&sgx_target_info_t>, + quote_size: Option<&u32>, shard: &ShardIdentifier, skip_ra: bool, ) -> EnclaveResult<()>; @@ -215,8 +221,22 @@ impl RemoteAttestation for Enclave { let mut retval = sgx_status_t::SGX_SUCCESS; self.set_ql_qe_enclave_paths()?; - let quoting_enclave_target_info = self.qe_get_target_info()?; - let quote_size = self.qe_get_quote_size()?; + let quoting_enclave_target_info = if !skip_ra { + match self.qe_get_target_info() { + Ok(target_info) => Some(target_info), + Err(e) => return Err(e), + } + } else { + None + }; + let quote_size = if !skip_ra { + match self.qe_get_quote_size() { + Ok(quote_size) => Some(quote_size), + Err(e) => return Err(e), + } + } else { + None + }; info!("Retrieved quote size of {:?}", quote_size); trace!("Generating dcap_ra_extrinsic with URL: {}", w_url); @@ -234,8 +254,8 @@ impl RemoteAttestation for Enclave { unchecked_extrinsic.as_mut_ptr(), unchecked_extrinsic.len() as u32, skip_ra.into(), - "ing_enclave_target_info, - quote_size, + quoting_enclave_target_info.as_ref(), + quote_size.as_ref(), ) }; @@ -341,6 +361,17 @@ impl RemoteAttestation for Enclave { Ok(()) } + fn set_sgx_qpl_logging(&self) -> EnclaveResult<()> { + let log_level = sgx_ql_log_level_t::SGX_QL_LOG_INFO; + let res = unsafe { sgx_ql_set_logging_callback(forward_qpl_log, log_level) }; + if res == sgx_quote3_error_t::SGX_QL_SUCCESS { + Ok(()) + } else { + error!("Setting logging function failed with: {:#?}", res); + Err(Error::SgxQuote(res)) + } + } + fn qe_get_target_info(&self) -> EnclaveResult { let mut quoting_enclave_target_info: sgx_target_info_t = sgx_target_info_t::default(); let qe3_ret = unsafe { sgx_qe_get_target_info(&mut quoting_enclave_target_info as *mut _) }; @@ -656,6 +687,8 @@ impl TlsRemoteAttestation for Enclave { &self, socket_fd: c_int, sign_type: sgx_quote_sign_type_t, + quoting_enclave_target_info: Option<&sgx_target_info_t>, + quote_size: Option<&u32>, skip_ra: bool, ) -> EnclaveResult<()> { let mut retval = sgx_status_t::SGX_SUCCESS; @@ -666,6 +699,8 @@ impl TlsRemoteAttestation for Enclave { &mut retval, socket_fd, sign_type, + quoting_enclave_target_info, + quote_size, skip_ra.into(), ) }; @@ -680,6 +715,8 @@ impl TlsRemoteAttestation for Enclave { &self, socket_fd: c_int, sign_type: sgx_quote_sign_type_t, + quoting_enclave_target_info: Option<&sgx_target_info_t>, + quote_size: Option<&u32>, shard: &ShardIdentifier, skip_ra: bool, ) -> EnclaveResult<()> { @@ -693,6 +730,8 @@ impl TlsRemoteAttestation for Enclave { &mut retval, socket_fd, sign_type, + quoting_enclave_target_info, + quote_size, encoded_shard.as_ptr(), encoded_shard.len() as u32, skip_ra.into(), @@ -752,3 +791,19 @@ fn set_qv_path(path_type: sgx_qv_path_type_t, path: &str) -> EnclaveResult<()> { } Ok(()) } + +#[allow(clippy::not_unsafe_ptr_arg_deref)] +/// Make sure that the `log_slice_ptr` points to a null terminated string. +// This function must not be marked as `unsafe`, because `sgx_ql_set_logging_callback` expects a safe (i.e. not `unsafe`) function. +pub extern "C" fn forward_qpl_log(log_level: sgx_ql_log_level_t, log_slice_ptr: *const c_char) { + if log_slice_ptr.is_null() { + error!("[QPL - ERROR], slice to print was NULL"); + return + } + // This is safe, as the previous block checks for `NULL` pointer. + let slice = unsafe { core::ffi::CStr::from_ptr(log_slice_ptr) }; + match log_level { + sgx_ql_log_level_t::SGX_QL_LOG_INFO => info!("[QPL - INFO], {:#?}", slice), + sgx_ql_log_level_t::SGX_QL_LOG_ERROR => error!("[QPL - ERROR], {:#?}", slice), + } +} diff --git a/docker/demo-direct-call.yml b/docker/demo-direct-call.yml index abf5e59552..1ea6325ad3 100644 --- a/docker/demo-direct-call.yml +++ b/docker/demo-direct-call.yml @@ -6,6 +6,7 @@ services: - "${SGX_ENCLAVE:-/dev/null}:/dev/sgx/enclave" volumes: - "${AESMD:-/dev/null}:/var/run/aesmd" + - "${SGX_QCNL:-/dev/null}:/etc/sgx_default_qcnl.conf" build: context: ${PWD}/.. dockerfile: build.Dockerfile diff --git a/docker/demo-indirect-invocation.yml b/docker/demo-indirect-invocation.yml index e7eb1a0c20..bba1748838 100644 --- a/docker/demo-indirect-invocation.yml +++ b/docker/demo-indirect-invocation.yml @@ -6,6 +6,7 @@ services: - "${SGX_ENCLAVE:-/dev/null}:/dev/sgx/enclave" volumes: - "${AESMD:-/dev/null}:/var/run/aesmd" + - "${SGX_QCNL:-/dev/null}:/etc/sgx_default_qcnl.conf" build: context: ${PWD}/.. dockerfile: build.Dockerfile diff --git a/docker/demo-sidechain.yml b/docker/demo-sidechain.yml index ad7779d9bf..235a7c6b9a 100644 --- a/docker/demo-sidechain.yml +++ b/docker/demo-sidechain.yml @@ -6,6 +6,7 @@ services: - "${SGX_ENCLAVE:-/dev/null}:/dev/sgx/enclave" volumes: - "${AESMD:-/dev/null}:/var/run/aesmd" + - "${SGX_QCNL:-/dev/null}:/etc/sgx_default_qcnl.conf" build: context: ${PWD}/.. diff --git a/docker/demo-smart-contract.yml b/docker/demo-smart-contract.yml index 7f1500bd71..f16211cda5 100644 --- a/docker/demo-smart-contract.yml +++ b/docker/demo-smart-contract.yml @@ -6,6 +6,7 @@ services: - "${SGX_ENCLAVE:-/dev/null}:/dev/sgx/enclave" volumes: - "${AESMD:-/dev/null}:/var/run/aesmd" + - "${SGX_QCNL:-/dev/null}:/etc/sgx_default_qcnl.conf" build: context: ${PWD}/.. dockerfile: build.Dockerfile diff --git a/docker/demo-teeracle-generic.yml b/docker/demo-teeracle-generic.yml index 58b3b88492..1f14489bff 100644 --- a/docker/demo-teeracle-generic.yml +++ b/docker/demo-teeracle-generic.yml @@ -13,6 +13,7 @@ services: - "${SGX_ENCLAVE:-/dev/null}:/dev/sgx/enclave" volumes: - "${AESMD:-/dev/null}:/var/run/aesmd" + - "${SGX_QCNL:-/dev/null}:/etc/sgx_default_qcnl.conf" build: context: ${PWD}/.. dockerfile: build.Dockerfile @@ -22,8 +23,6 @@ services: condition: service_healthy environment: - RUST_LOG=warn,ws=warn,sp_io=warn,substrate_api_client=warn,jsonrpsee_ws_client=warn,jsonrpsee_ws_server=warn,enclave_runtime=warn,integritee_service=info,integritee_service::teeracle=debug,ita_stf=warn,ita_oracle=debug - - IAS_EPID_SPID - - IAS_EPID_KEY networks: - integritee-test-network healthcheck: @@ -31,8 +30,8 @@ services: interval: 10s timeout: 10s retries: 25 - entrypoint: - "/usr/local/bin/integritee-service --clean-reset --ws-external -M integritee-teeracle-worker -T wss://integritee-teeracle-worker + command: + "--clean-reset --ws-external -M integritee-teeracle-worker -T wss://integritee-teeracle-worker -u ws://integritee-node -U ws://integritee-teeracle-worker -P 2011 -w 2101 -p 9912 -h 4645 run --dev ${ADDITIONAL_RUNTIME_FLAGS} --teeracle-interval ${TEERACLE_INTERVAL_SECONDS}s" restart: always @@ -43,6 +42,7 @@ services: - "${SGX_ENCLAVE:-/dev/null}:/dev/sgx/enclave" volumes: - "${AESMD:-/dev/null}:/var/run/aesmd" + - "${SGX_QCNL:-/dev/null}:/etc/sgx_default_qcnl.conf" build: context: ${PWD}/.. dockerfile: build.Dockerfile diff --git a/docker/demo-teeracle.yml b/docker/demo-teeracle.yml index be003c61a0..99dcb1c98d 100644 --- a/docker/demo-teeracle.yml +++ b/docker/demo-teeracle.yml @@ -15,6 +15,7 @@ services: - "${SGX_ENCLAVE:-/dev/null}:/dev/sgx/enclave" volumes: - "${AESMD:-/dev/null}:/var/run/aesmd" + - "${SGX_QCNL:-/dev/null}:/etc/sgx_default_qcnl.conf" build: context: ${PWD}/.. dockerfile: build.Dockerfile @@ -25,8 +26,6 @@ services: environment: - RUST_LOG=warn,ws=warn,sp_io=warn,substrate_api_client=warn,jsonrpsee_ws_client=warn,jsonrpsee_ws_server=warn,enclave_runtime=warn,integritee_service=info,integritee_service::teeracle=debug,ita_stf=warn,ita_exchange_oracle=debug - COINMARKETCAP_KEY - - IAS_EPID_SPID - - IAS_EPID_KEY networks: - integritee-test-network healthcheck: @@ -34,8 +33,8 @@ services: interval: 10s timeout: 10s retries: 25 - entrypoint: - "/usr/local/bin/integritee-service --clean-reset --ws-external -M integritee-teeracle-worker -T wss://integritee-teeracle-worker + command: + "--clean-reset --ws-external -M integritee-teeracle-worker -T wss://integritee-teeracle-worker -u ws://integritee-node -U ws://integritee-teeracle-worker -P 2011 -w 2101 -p 9912 -h 4645 run --dev ${ADDITIONAL_RUNTIME_FLAGS} --teeracle-interval ${TEERACLE_INTERVAL_SECONDS}s" restart: always @@ -46,6 +45,7 @@ services: - "${SGX_ENCLAVE:-/dev/null}:/dev/sgx/enclave" volumes: - "${AESMD:-/dev/null}:/var/run/aesmd" + - "${SGX_QCNL:-/dev/null}:/etc/sgx_default_qcnl.conf" build: context: ${PWD}/.. dockerfile: build.Dockerfile diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index d8093c2388..6fe42edbb7 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -7,6 +7,7 @@ services: - "${SGX_ENCLAVE:-/dev/null}:/dev/sgx/enclave" volumes: - "${AESMD:-/dev/null}:/var/run/aesmd" + - "${SGX_QCNL:-/dev/null}:/etc/sgx_default_qcnl.conf" networks: - integritee-test-network healthcheck: @@ -32,10 +33,9 @@ services: - "${SGX_ENCLAVE:-/dev/null}:/dev/sgx/enclave" volumes: - "${AESMD:-/dev/null}:/var/run/aesmd" + - "${SGX_QCNL:-/dev/null}:/etc/sgx_default_qcnl.conf" environment: - RUST_LOG=warn,ws=warn,sp_io=warn,substrate_api_client=warn,jsonrpsee_ws_client=warn,jsonrpsee_ws_server=warn,enclave_runtime=warn,integritee_service=warn,ita_stf=warn - - IAS_EPID_SPID - - IAS_EPID_KEY networks: - integritee-test-network healthcheck: @@ -43,7 +43,7 @@ services: interval: 10s timeout: 10s retries: 25 - entrypoint: "/usr/local/bin/integritee-service --clean-reset --ws-external -M integritee-worker-1 -T wss://integritee-worker-1 -u ws://integritee-node -U ws://integritee-worker-1 -P 2011 -w 2101 -p 9912 -h 4645 run --dev" + command: "--clean-reset --ws-external -M integritee-worker-1 -T wss://integritee-worker-1 -u ws://integritee-node -U ws://integritee-worker-1 -P 2011 -w 2101 -p 9912 -h 4645 run --dev" restart: "no" "integritee-worker-2-${VERSION}": image: integritee-worker:${VERSION:-dev} @@ -62,10 +62,9 @@ services: - "${SGX_ENCLAVE:-/dev/null}:/dev/sgx/enclave" volumes: - "${AESMD:-/dev/null}:/var/run/aesmd" + - "${SGX_QCNL:-/dev/null}:/etc/sgx_default_qcnl.conf" environment: - RUST_LOG=warn,ws=warn,sp_io=warn,substrate_api_client=warn,jsonrpsee_ws_client=warn,jsonrpsee_ws_server=warn,enclave_runtime=warn,integritee_service=warn,ita_stf=warn - - IAS_EPID_SPID - - IAS_EPID_KEY networks: - integritee-test-network healthcheck: @@ -73,7 +72,7 @@ services: interval: 10s timeout: 10s retries: 25 - entrypoint: "/usr/local/bin/integritee-service --clean-reset --ws-external -M integritee-worker-2 -T wss://integritee-worker-2 -u ws://integritee-node -U ws://integritee-worker-2 -P 2012 -w 2102 -p 9912 -h 4646 run --dev --request-state" + command: "--clean-reset --ws-external -M integritee-worker-2 -T wss://integritee-worker-2 -u ws://integritee-node -U ws://integritee-worker-2 -P 2012 -w 2102 -p 9912 -h 4646 run --dev --request-state" restart: "no" networks: integritee-test-network: diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh new file mode 100755 index 0000000000..bceee8d4be --- /dev/null +++ b/docker/entrypoint.sh @@ -0,0 +1,7 @@ +#!/bin/bash +set -e + +# run aesmd in the background +/opt/intel/sgx-aesm-service/aesm/aesm_service + +exec /usr/local/bin/integritee-service "${@}" diff --git a/docker/fork-inducer.yml b/docker/fork-inducer.yml index 47d00ac5ba..ca46f37632 100644 --- a/docker/fork-inducer.yml +++ b/docker/fork-inducer.yml @@ -6,6 +6,7 @@ services: - "${SGX_ENCLAVE:-/dev/null}:/dev/sgx/enclave" volumes: - "${AESMD:-/dev/null}:/var/run/aesmd" + - "${SGX_QCNL:-/dev/null}:/etc/sgx_default_qcnl.conf" build: context: . dockerfile: ping.Dockerfile @@ -20,6 +21,7 @@ services: - "${SGX_ENCLAVE:-/dev/null}:/dev/sgx/enclave" volumes: - "${AESMD:-/dev/null}:/var/run/aesmd" + - "${SGX_QCNL:-/dev/null}:/etc/sgx_default_qcnl.conf" build: context: . dockerfile: fork.Dockerfile diff --git a/docker/sidechain-benchmark.yml b/docker/sidechain-benchmark.yml index 7cf5ca8c4c..38f78e1503 100644 --- a/docker/sidechain-benchmark.yml +++ b/docker/sidechain-benchmark.yml @@ -6,6 +6,7 @@ services: - "${SGX_ENCLAVE:-/dev/null}:/dev/sgx/enclave" volumes: - "${AESMD:-/dev/null}:/var/run/aesmd" + - "${SGX_QCNL:-/dev/null}:/etc/sgx_default_qcnl.conf" build: context: ${PWD}/.. dockerfile: build.Dockerfile diff --git a/enclave-runtime/Cargo.toml b/enclave-runtime/Cargo.toml index 76c854816b..311c63d9de 100644 --- a/enclave-runtime/Cargo.toml +++ b/enclave-runtime/Cargo.toml @@ -46,6 +46,7 @@ test = [ # substrate "frame-system", ] +dcap = [] [target.'cfg(not(target_env = "sgx"))'.dependencies] sgx-crypto-helper = { branch = "master", git = "https://github.com/apache/teaclave-sgx-sdk.git", package = "sgx_tcrypto_helper" } diff --git a/enclave-runtime/Enclave.edl b/enclave-runtime/Enclave.edl index 97737438c3..29ab55e6eb 100644 --- a/enclave-runtime/Enclave.edl +++ b/enclave-runtime/Enclave.edl @@ -109,7 +109,7 @@ enclave { [out, size=unchecked_extrinsic_size] uint8_t* unchecked_extrinsic, uint32_t unchecked_extrinsic_size, int skip_ra, [in] const sgx_target_info_t* quoting_enclave_target_info, - uint32_t quote_size + [in] uint32_t* quote_size ); public sgx_status_t generate_register_quoting_enclave_extrinsic( @@ -140,10 +140,18 @@ enclave { public sgx_status_t dump_dcap_collateral_to_disk([in] const sgx_ql_qve_collateral_t *p_quote_collateral); - public sgx_status_t run_state_provisioning_server(int fd, sgx_quote_sign_type_t quote_type, int skip_ra); + public sgx_status_t run_state_provisioning_server( + int fd, + sgx_quote_sign_type_t quote_type, + [in] sgx_target_info_t* quoting_enclave_target_info, + [in] uint32_t* quote_size, + int skip_ra + ); public sgx_status_t request_state_provisioning( int fd, sgx_quote_sign_type_t quote_type, + [in] sgx_target_info_t* quoting_enclave_target_info, + [in] uint32_t* quote_size, [in, size=shard_size] uint8_t* shard, uint32_t shard_size, int skip_ra ); diff --git a/enclave-runtime/src/attestation.rs b/enclave-runtime/src/attestation.rs index cab21dea9f..4de6316329 100644 --- a/enclave-runtime/src/attestation.rs +++ b/enclave-runtime/src/attestation.rs @@ -36,7 +36,7 @@ use crate::{ Error as EnclaveError, Result as EnclaveResult, }; use codec::{Decode, Encode}; -use itp_attestation_handler::{AttestationHandler, SgxQlQveCollateral}; +use itp_attestation_handler::{AttestationHandler, RemoteAttestationType, SgxQlQveCollateral}; use itp_component_container::ComponentGetter; use itp_extrinsics_factory::CreateExtrinsics; use itp_node_api::metadata::{ @@ -80,9 +80,13 @@ pub unsafe extern "C" fn get_mrenclave(mrenclave: *mut u8, mrenclave_size: usize } } +// FIXME: add dcap suppoort for call site pub fn create_ra_report_and_signature( - sign_type: sgx_quote_sign_type_t, skip_ra: bool, + remote_attestation_type: RemoteAttestationType, + sign_type: sgx_quote_sign_type_t, + quoting_enclave_target_info: Option<&sgx_target_info_t>, + quote_size: Option<&u32>, ) -> EnclaveResult<(Vec, Vec)> { let attestation_handler = match GLOBAL_ATTESTATION_HANDLER_COMPONENT.get() { Ok(r) => r, @@ -92,11 +96,28 @@ pub fn create_ra_report_and_signature( }, }; - match attestation_handler.create_ra_report_and_signature(sign_type, skip_ra) { - Ok(r) => Ok(r), - Err(e) => { - error!("create_ra_report_and_signature failure: {:?}", e); - Err(e.into()) + match remote_attestation_type { + RemoteAttestationType::Epid => { + match attestation_handler.create_epid_ra_report_and_signature(sign_type, skip_ra) { + Ok(epid) => Ok(epid), + Err(e) => { + error!("create_epid_ra_report_and_signature failure: {:?}", e); + Err(e.into()) + }, + } + }, + RemoteAttestationType::Dcap => { + match attestation_handler.generate_dcap_ra_cert( + quoting_enclave_target_info, + quote_size, + skip_ra, + ) { + Ok((key_der, cert_der, _qe_quote)) => Ok((key_der, cert_der)), + Err(e) => { + error!("generate_dcap_ra_cert failure: {:?}", e); + Err(e.into()) + }, + } }, } } @@ -136,8 +157,8 @@ pub unsafe extern "C" fn generate_dcap_ra_extrinsic( unchecked_extrinsic: *mut u8, unchecked_extrinsic_size: u32, skip_ra: c_int, - quoting_enclave_target_info: &sgx_target_info_t, - quote_size: u32, + quoting_enclave_target_info: Option<&sgx_target_info_t>, + quote_size: Option<&u32>, ) -> sgx_status_t { if w_url.is_null() || unchecked_extrinsic.is_null() { return sgx_status_t::SGX_ERROR_INVALID_PARAMETER @@ -166,12 +187,12 @@ pub unsafe extern "C" fn generate_dcap_ra_extrinsic( pub fn generate_dcap_ra_extrinsic_internal( url: String, skip_ra: bool, - quoting_enclave_target_info: &sgx_target_info_t, - quote_size: u32, + quoting_enclave_target_info: Option<&sgx_target_info_t>, + quote_size: Option<&u32>, ) -> EnclaveResult { let attestation_handler = GLOBAL_ATTESTATION_HANDLER_COMPONENT.get()?; - let (_cert_der, dcap_quote) = attestation_handler.generate_dcap_ra_cert( + let (_priv_key_der, _cert_der, dcap_quote) = attestation_handler.generate_dcap_ra_cert( quoting_enclave_target_info, quote_size, skip_ra, @@ -216,9 +237,9 @@ pub fn generate_dcap_ra_quote_internal( ) -> EnclaveResult> { let attestation_handler = GLOBAL_ATTESTATION_HANDLER_COMPONENT.get()?; - let (_, dcap_quote) = attestation_handler.generate_dcap_ra_cert( - quoting_enclave_target_info, - quote_size, + let (_priv_key_der, _cert_der, dcap_quote) = attestation_handler.generate_dcap_ra_cert( + Some(quoting_enclave_target_info), + Some("e_size), skip_ra, )?; diff --git a/enclave-runtime/src/error.rs b/enclave-runtime/src/error.rs index 239e1450e3..3519bad137 100644 --- a/enclave-runtime/src/error.rs +++ b/enclave-runtime/src/error.rs @@ -16,7 +16,7 @@ */ use derive_more::From; -use sgx_types::sgx_status_t; +use sgx_types::{sgx_quote3_error_t, sgx_status_t}; use std::{boxed::Box, result::Result as StdResult, string::String}; pub type Result = StdResult; @@ -33,6 +33,7 @@ pub enum Error { LightClient(itc_parentchain::light_client::error::Error), NodeMetadataProvider(itp_node_api::metadata::provider::Error), Sgx(sgx_status_t), + SgxQuote(sgx_quote3_error_t), Consensus(its_sidechain::consensus_common::Error), Stf(String), StfStateHandler(itp_stf_state_handler::error::Error), @@ -64,6 +65,19 @@ impl From for sgx_status_t { } } +impl From for sgx_quote3_error_t { + /// return sgx_quote error + fn from(error: Error) -> sgx_quote3_error_t { + match error { + Error::SgxQuote(status) => status, + _ => { + log::error!("Returning error {:?} as sgx unexpected.", error); + sgx_quote3_error_t::SGX_QL_ERROR_UNEXPECTED + }, + } + } +} + impl From for StdResult { fn from(error: Error) -> StdResult { Err(error) diff --git a/enclave-runtime/src/test/cert_tests.rs b/enclave-runtime/src/test/cert_tests.rs index 502efb093c..c5eaab9f89 100644 --- a/enclave-runtime/src/test/cert_tests.rs +++ b/enclave-runtime/src/test/cert_tests.rs @@ -34,7 +34,7 @@ pub fn test_verify_mra_cert_should_work() { let mr_enclave = get_mr_enclave_from_hex_string(TEST4_MRENCLAVE).unwrap(); let attestation_ocall = AttestationOCallMock::create_with_mr_enclave(sgx_measurement_t { m: mr_enclave }); - let result = verify_mra_cert(TEST4_CERT, &attestation_ocall); + let result = verify_mra_cert(TEST4_CERT, false, false, &attestation_ocall); assert!(result.is_ok()); } @@ -43,7 +43,7 @@ pub fn test_verify_wrong_cert_is_err() { let mr_enclave = get_mr_enclave_from_hex_string(TEST4_MRENCLAVE).unwrap(); let attestation_ocall = AttestationOCallMock::create_with_mr_enclave(sgx_measurement_t { m: mr_enclave }); - let result = verify_mra_cert(CERT_WRONG_PLATFORM_BLOB, &attestation_ocall); + let result = verify_mra_cert(CERT_WRONG_PLATFORM_BLOB, false, false, &attestation_ocall); assert!(result.is_err()); assert_eq!(result.unwrap_err(), sgx_status_t::SGX_ERROR_UNEXPECTED); diff --git a/enclave-runtime/src/tls_ra/authentication.rs b/enclave-runtime/src/tls_ra/authentication.rs index 20ba35735d..d1f9633497 100644 --- a/enclave-runtime/src/tls_ra/authentication.rs +++ b/enclave-runtime/src/tls_ra/authentication.rs @@ -62,7 +62,11 @@ where return Err(rustls::TLSError::NoCertificatesPresented) } - match cert::verify_mra_cert(&certs[0].0, &self.attestation_ocall) { + #[cfg(feature = "dcap")] + let is_dcap = true; + #[cfg(not(feature = "dcap"))] + let is_dcap = false; + match cert::verify_mra_cert(&certs[0].0, true, is_dcap, &self.attestation_ocall) { Ok(()) => Ok(rustls::ClientCertVerified::assertion()), Err(sgx_status_t::SGX_ERROR_UPDATE_NEEDED) => if self.outdated_ok { @@ -110,8 +114,12 @@ where return Err(rustls::TLSError::NoCertificatesPresented) } + #[cfg(feature = "dcap")] + let is_dcap = true; + #[cfg(not(feature = "dcap"))] + let is_dcap = false; // This call will automatically verify cert is properly signed - match cert::verify_mra_cert(&certs[0].0, &self.attestation_ocall) { + match cert::verify_mra_cert(&certs[0].0, true, is_dcap, &self.attestation_ocall) { Ok(()) => Ok(rustls::ServerCertVerified::assertion()), Err(sgx_status_t::SGX_ERROR_UPDATE_NEEDED) => if self.outdated_ok { diff --git a/enclave-runtime/src/tls_ra/tests.rs b/enclave-runtime/src/tls_ra/tests.rs index 29d00c67ad..1540279b17 100644 --- a/enclave-runtime/src/tls_ra/tests.rs +++ b/enclave-runtime/src/tls_ra/tests.rs @@ -34,7 +34,7 @@ use itp_stf_state_handler::handle_state::HandleState; use itp_test::mock::handle_state_mock::HandleStateMock; use itp_types::ShardIdentifier; use sgx_crypto_helper::{rsa3072::Rsa3072KeyPair, RsaKeyPair}; -use sgx_types::sgx_quote_sign_type_t; +use sgx_types::{sgx_quote_sign_type_t, sgx_target_info_t}; use std::{ net::{TcpListener, TcpStream}, os::unix::io::AsRawFd, @@ -47,14 +47,18 @@ use std::{ static SIGN_TYPE: sgx_quote_sign_type_t = sgx_quote_sign_type_t::SGX_UNLINKABLE_SIGNATURE; static SKIP_RA: i32 = 1; +static QUOTE_SIZE: u32 = 0; fn run_state_provisioning_server(seal_handler: impl UnsealStateAndKeys, port: u16) { let listener = TcpListener::bind(server_addr(port)).unwrap(); let (socket, _addr) = listener.accept().unwrap(); + let sgx_target_info: sgx_target_info_t = sgx_target_info_t::default(); run_state_provisioning_server_internal::<_, WorkerModeProvider>( socket.as_raw_fd(), SIGN_TYPE, + Some(&sgx_target_info), + Some("E_SIZE), SKIP_RA, seal_handler, ) @@ -98,9 +102,12 @@ pub fn test_tls_ra_server_client_networking() { // Start client. let socket = TcpStream::connect(server_addr(port)).unwrap(); + let sgx_target_info: sgx_target_info_t = sgx_target_info_t::default(); let result = request_state_provisioning_internal( socket.as_raw_fd(), SIGN_TYPE, + Some(&sgx_target_info), + Some("E_SIZE), shard, SKIP_RA, client_seal_handler.clone(), @@ -144,9 +151,12 @@ pub fn test_state_and_key_provisioning() { // Start client. let socket = TcpStream::connect(server_addr(port)).unwrap(); + let sgx_target_info: sgx_target_info_t = sgx_target_info_t::default(); let result = request_state_provisioning_internal( socket.as_raw_fd(), SIGN_TYPE, + Some(&sgx_target_info), + Some("E_SIZE), shard, SKIP_RA, client_seal_handler, diff --git a/enclave-runtime/src/tls_ra/tls_ra_client.rs b/enclave-runtime/src/tls_ra/tls_ra_client.rs index 1b7ca3bca8..aa1f71651a 100644 --- a/enclave-runtime/src/tls_ra/tls_ra_client.rs +++ b/enclave-runtime/src/tls_ra/tls_ra_client.rs @@ -29,7 +29,7 @@ use crate::{ tls_ra::seal_handler::SealStateAndKeys, GLOBAL_STATE_HANDLER_COMPONENT, }; -use itp_attestation_handler::DEV_HOSTNAME; +use itp_attestation_handler::{RemoteAttestationType, DEV_HOSTNAME}; use itp_component_container::ComponentGetter; use itp_ocall_api::EnclaveAttestationOCallApi; use itp_types::ShardIdentifier; @@ -74,13 +74,17 @@ where /// We trust here that the server sends us the correct data, as /// we do not have any way to test it. fn read_shard(&mut self) -> EnclaveResult<()> { + debug!("read_shard called, about to call self.write_shard()."); self.write_shard()?; + debug!("self.write_shard() succeeded."); self.read_and_seal_all() } /// Send the shard of the state we want to receive to the provisioning server. fn write_shard(&mut self) -> EnclaveResult<()> { + debug!("self.write_shard() called."); self.tls_stream.write_all(self.shard.as_bytes())?; + debug!("write_all succeeded."); Ok(()) } @@ -155,6 +159,8 @@ where pub unsafe extern "C" fn request_state_provisioning( socket_fd: c_int, sign_type: sgx_quote_sign_type_t, + quoting_enclave_target_info: Option<&sgx_target_info_t>, + quote_size: Option<&u32>, shard: *const u8, shard_size: u32, skip_ra: c_int, @@ -189,9 +195,15 @@ pub unsafe extern "C" fn request_state_provisioning( let seal_handler = EnclaveSealHandler::new(state_handler, state_key_repository, shielding_key_repository); - if let Err(e) = - request_state_provisioning_internal(socket_fd, sign_type, shard, skip_ra, seal_handler) - { + if let Err(e) = request_state_provisioning_internal( + socket_fd, + sign_type, + quoting_enclave_target_info, + quote_size, + shard, + skip_ra, + seal_handler, + ) { error!("Failed to sync state due to: {:?}", e); return e.into() }; @@ -203,12 +215,23 @@ pub unsafe extern "C" fn request_state_provisioning( pub(crate) fn request_state_provisioning_internal( socket_fd: c_int, sign_type: sgx_quote_sign_type_t, + quoting_enclave_target_info: Option<&sgx_target_info_t>, + quote_size: Option<&u32>, shard: ShardIdentifier, skip_ra: c_int, seal_handler: StateAndKeySealer, ) -> EnclaveResult<()> { - let client_config = tls_client_config(sign_type, OcallApi, skip_ra == 1)?; + debug!("Client config generate..."); + let client_config = tls_client_config( + sign_type, + quoting_enclave_target_info, + quote_size, + OcallApi, + skip_ra == 1, + )?; + debug!("Client config retrieved"); let (mut client_session, mut tcp_stream) = tls_client_session_stream(socket_fd, client_config)?; + debug!("Client sesssion established."); let mut client = TlsClient::new( rustls::Stream::new(&mut client_session, &mut tcp_stream), @@ -222,10 +245,24 @@ pub(crate) fn request_state_provisioning_internal( sign_type: sgx_quote_sign_type_t, + quoting_enclave_target_info: Option<&sgx_target_info_t>, + quote_size: Option<&u32>, ocall_api: A, skip_ra: bool, ) -> EnclaveResult { - let (key_der, cert_der) = create_ra_report_and_signature(sign_type, skip_ra)?; + #[cfg(not(feature = "dcap"))] + let attestation_type = RemoteAttestationType::Epid; + #[cfg(feature = "dcap")] + let attestation_type = RemoteAttestationType::Dcap; + + let (key_der, cert_der) = create_ra_report_and_signature( + skip_ra, + attestation_type, + sign_type, + quoting_enclave_target_info, + quote_size, + )?; + debug!("got key_der and cert_der"); let mut cfg = rustls::ClientConfig::new(); let certs = vec![rustls::Certificate(cert_der)]; diff --git a/enclave-runtime/src/tls_ra/tls_ra_server.rs b/enclave-runtime/src/tls_ra/tls_ra_server.rs index 35a053814f..5e34367643 100644 --- a/enclave-runtime/src/tls_ra/tls_ra_server.rs +++ b/enclave-runtime/src/tls_ra/tls_ra_server.rs @@ -29,6 +29,7 @@ use crate::{ tls_ra::seal_handler::UnsealStateAndKeys, GLOBAL_STATE_HANDLER_COMPONENT, }; +use itp_attestation_handler::RemoteAttestationType; use itp_component_container::ComponentGetter; use itp_ocall_api::EnclaveAttestationOCallApi; use itp_settings::worker_mode::{ProvideWorkerMode, WorkerMode, WorkerModeProvider}; @@ -82,7 +83,10 @@ where /// Sends all relevant data of the specific shard to the client. fn write_shard(&mut self) -> EnclaveResult<()> { + println!(" [Enclave] (MU-RA-Server) write_shard, calling read_shard()"); let shard = self.read_shard()?; + println!(" [Enclave] (MU-RA-Server) write_shard, read_shard() OK"); + println!(" [Enclave] (MU-RA-Server) write_shard, write_all()"); self.write_all(&shard) } @@ -90,6 +94,7 @@ where fn read_shard(&mut self) -> EnclaveResult { let mut shard_holder = ShardIdentifier::default(); let shard = shard_holder.as_fixed_bytes_mut(); + println!(" [Enclave] (MU-RA-Server) read_shard, calling read_exact()"); self.tls_stream.read_exact(shard)?; Ok(shard.into()) } @@ -155,6 +160,8 @@ where pub unsafe extern "C" fn run_state_provisioning_server( socket_fd: c_int, sign_type: sgx_quote_sign_type_t, + quoting_enclave_target_info: Option<&sgx_target_info_t>, + quote_size: Option<&u32>, skip_ra: c_int, ) -> sgx_status_t { let _ = backtrace::enable_backtrace("enclave.signed.so", PrintFormat::Short); @@ -189,6 +196,8 @@ pub unsafe extern "C" fn run_state_provisioning_server( if let Err(e) = run_state_provisioning_server_internal::<_, WorkerModeProvider>( socket_fd, sign_type, + quoting_enclave_target_info, + quote_size, skip_ra, seal_handler, ) { @@ -206,10 +215,18 @@ pub(crate) fn run_state_provisioning_server_internal< >( socket_fd: c_int, sign_type: sgx_quote_sign_type_t, + quoting_enclave_target_info: Option<&sgx_target_info_t>, + quote_size: Option<&u32>, skip_ra: c_int, seal_handler: StateAndKeyUnsealer, ) -> EnclaveResult<()> { - let server_config = tls_server_config(sign_type, OcallApi, skip_ra == 1)?; + let server_config = tls_server_config( + sign_type, + quoting_enclave_target_info, + quote_size, + OcallApi, + skip_ra == 1, + )?; let (server_session, tcp_stream) = tls_server_session_stream(socket_fd, server_config)?; let provisioning = ProvisioningPayload::from(WorkerModeProvider::worker_mode()); @@ -217,6 +234,7 @@ pub(crate) fn run_state_provisioning_server_internal< TlsServer::new(StreamOwned::new(server_session, tcp_stream), seal_handler, provisioning); println!(" [Enclave] (MU-RA-Server) MU-RA successful sending keys"); + println!(" [Enclave] (MU-RA-Server) MU-RA successful, calling write_shard()"); server.write_shard() } @@ -231,10 +249,23 @@ fn tls_server_session_stream( fn tls_server_config( sign_type: sgx_quote_sign_type_t, + quoting_enclave_target_info: Option<&sgx_target_info_t>, + quote_size: Option<&u32>, ocall_api: A, skip_ra: bool, ) -> EnclaveResult { - let (key_der, cert_der) = create_ra_report_and_signature(sign_type, skip_ra)?; + #[cfg(not(feature = "dcap"))] + let attestation_type = RemoteAttestationType::Epid; + #[cfg(feature = "dcap")] + let attestation_type = RemoteAttestationType::Dcap; + + let (key_der, cert_der) = create_ra_report_and_signature( + skip_ra, + attestation_type, + sign_type, + quoting_enclave_target_info, + quote_size, + )?; let mut cfg = rustls::ServerConfig::new(Arc::new(ClientAuth::new(true, skip_ra, ocall_api))); let certs = vec![rustls::Certificate(cert_der)]; diff --git a/local-setup/py/worker.py b/local-setup/py/worker.py index a63367cdf5..db12a2c461 100644 --- a/local-setup/py/worker.py +++ b/local-setup/py/worker.py @@ -160,9 +160,10 @@ def run_in_background(self, log_file: TextIO, flags: [str] = None, subcommand_fl 'enclave_runtime=info,' 'integritee_service=warn,' 'ita_stf=debug') - + worker_cmd = self._assemble_cmd(flags=flags, subcommand_flags=subcommand_flags) + print("worker command is "+ str(worker_cmd)) return Popen( - self._assemble_cmd(flags=flags, subcommand_flags=subcommand_flags), + worker_cmd, env=env, stdout=log_file, stderr=STDOUT, diff --git a/service/src/enclave/tls_ra.rs b/service/src/enclave/tls_ra.rs index c618c78ef9..cc07e3f4e9 100644 --- a/service/src/enclave/tls_ra.rs +++ b/service/src/enclave/tls_ra.rs @@ -14,7 +14,11 @@ limitations under the License. */ -use itp_enclave_api::{error::Error, remote_attestation::TlsRemoteAttestation, EnclaveResult}; +use itp_enclave_api::{ + error::Error, + remote_attestation::{RemoteAttestation, TlsRemoteAttestation}, + EnclaveResult, +}; use itp_types::ShardIdentifier; use log::*; use sgx_types::*; @@ -26,6 +30,8 @@ use std::{ pub fn enclave_run_state_provisioning_server( enclave_api: &E, sign_type: sgx_quote_sign_type_t, + quoting_enclave_target_info: Option<&sgx_target_info_t>, + quote_size: Option<&u32>, addr: &str, skip_ra: bool, ) { @@ -45,6 +51,8 @@ pub fn enclave_run_state_provisioning_server( let result = enclave_api.run_state_provisioning_server( socket.as_raw_fd(), sign_type, + quoting_enclave_target_info, + quote_size, skip_ra, ); @@ -62,7 +70,7 @@ pub fn enclave_run_state_provisioning_server( } } -pub fn enclave_request_state_provisioning( +pub fn enclave_request_state_provisioning( enclave_api: &E, sign_type: sgx_quote_sign_type_t, addr: &str, @@ -72,5 +80,31 @@ pub fn enclave_request_state_provisioning( info!("[MU-RA-Client] Requesting key provisioning from {}", addr); let stream = TcpStream::connect(addr).map_err(|e| Error::Other(Box::new(e)))?; - enclave_api.request_state_provisioning(stream.as_raw_fd(), sign_type, shard, skip_ra) + + let quoting_enclave_target_info = if !skip_ra { + match enclave_api.qe_get_target_info() { + Ok(quote_size) => Some(quote_size), + Err(e) => return Err(e), + } + } else { + None + }; + + let quote_size = if !skip_ra { + match enclave_api.qe_get_quote_size() { + Ok(quote_size) => Some(quote_size), + Err(e) => return Err(e), + } + } else { + None + }; + + enclave_api.request_state_provisioning( + stream.as_raw_fd(), + sign_type, + quoting_enclave_target_info.as_ref(), + quote_size.as_ref(), + shard, + skip_ra, + ) } diff --git a/service/src/main.rs b/service/src/main.rs index e92ba144e3..c7d602bf31 100644 --- a/service/src/main.rs +++ b/service/src/main.rs @@ -174,6 +174,21 @@ fn main() { enclave_metrics_receiver, ))); + let quoting_enclave_target_info = match enclave.qe_get_target_info() { + Ok(target_info) => Some(target_info), + Err(e) => { + warn!("Setting up DCAP - qe_get_target_info failed with error: {:#?}, continuing.", e); + None + }, + }; + let quote_size = match enclave.qe_get_quote_size() { + Ok(size) => Some(size), + Err(e) => { + warn!("Setting up DCAP - qe_get_quote_size failed with error: {:#?}, continuing.", e); + None + }, + }; + if let Some(run_config) = config.run_config() { let shard = extract_shard(run_config.shard(), enclave.as_ref()); @@ -203,6 +218,8 @@ fn main() { node_api, tokio_handle, initialization_handler, + quoting_enclave_target_info, + quote_size, ); } else if let Some(smatches) = matches.subcommand_matches("request-state") { println!("*** Requesting state from a registered worker \n"); @@ -243,6 +260,8 @@ fn main() { enclave_run_state_provisioning_server( enclave.as_ref(), sgx_quote_sign_type_t::SGX_UNLINKABLE_SIGNATURE, + quoting_enclave_target_info.as_ref(), + quote_size.as_ref(), &config.mu_ra_url(), sub_matches.is_present("skip-ra"), ); @@ -277,6 +296,8 @@ fn start_worker( node_api: ParentchainApi, tokio_handle_getter: Arc, initialization_handler: Arc, + quoting_enclave_target_info: Option, + quote_size: Option, ) where T: GetTokioHandle, E: EnclaveBase @@ -317,6 +338,8 @@ fn start_worker( enclave_run_state_provisioning_server( enclave_api_key_prov.as_ref(), sgx_quote_sign_type_t::SGX_UNLINKABLE_SIGNATURE, + quoting_enclave_target_info.as_ref(), + quote_size.as_ref(), &ra_url, skip_ra, ); @@ -449,6 +472,8 @@ fn start_worker( // clones because of the move let enclave2 = enclave.clone(); let node_api2 = node_api.clone(); + #[cfg(feature = "dcap")] + enclave2.set_sgx_qpl_logging().expect("QPL logging setup failed"); #[cfg(not(feature = "dcap"))] let register_xt = move || enclave2.generate_ias_ra_extrinsic(&trusted_url, skip_ra).unwrap(); #[cfg(feature = "dcap")] @@ -766,8 +791,8 @@ fn register_collateral( skip_ra: bool, ) { //TODO generate_dcap_ra_quote() does not really need skip_ra, rethink how many layers skip_ra should be passed along - let dcap_quote = enclave.generate_dcap_ra_quote(skip_ra).unwrap(); if !skip_ra { + let dcap_quote = enclave.generate_dcap_ra_quote(skip_ra).unwrap(); let (fmspc, _tcb_info) = extract_tcb_info_from_raw_dcap_quote(&dcap_quote).unwrap(); println!("[>] DCAP setup: register QE collateral"); let uxt = enclave.generate_register_quoting_enclave_extrinsic(fmspc).unwrap(); diff --git a/service/src/sync_state.rs b/service/src/sync_state.rs index 0a924662ba..12ff9bec2a 100644 --- a/service/src/sync_state.rs +++ b/service/src/sync_state.rs @@ -22,7 +22,10 @@ use crate::{ }; use futures::executor; use itc_rpc_client::direct_client::{DirectApi, DirectClient as DirectWorkerApi}; -use itp_enclave_api::{enclave_base::EnclaveBase, remote_attestation::TlsRemoteAttestation}; +use itp_enclave_api::{ + enclave_base::EnclaveBase, + remote_attestation::{RemoteAttestation, TlsRemoteAttestation}, +}; use itp_node_api::api_client::PalletTeerexApi; use itp_settings::worker_mode::{ProvideWorkerMode, WorkerMode}; use itp_types::ShardIdentifier; @@ -30,7 +33,7 @@ use sgx_types::sgx_quote_sign_type_t; use std::string::String; pub(crate) fn sync_state< - E: TlsRemoteAttestation + EnclaveBase, + E: TlsRemoteAttestation + EnclaveBase + RemoteAttestation, NodeApi: PalletTeerexApi, WorkerModeProvider: ProvideWorkerMode, >( From f5e059f7d7aef17775dfe55eee1e29e34f17cd61 Mon Sep 17 00:00:00 2001 From: clangenb <37865735+clangenb@users.noreply.github.com> Date: Tue, 1 Aug 2023 11:11:59 +0200 Subject: [PATCH 06/11] Provision light-client in mutual remote attestation (#1399) * [block-import] add `ImportType` to distinguish sync and block-production import type. * Revert "[block-import] add `ImportType` to distinguish sync and block-production import type." This reverts commit c3c46fd205c382bff5f1af92da0ad435170f1a6b. * [light-validation] add genesis_hash field and introduce header prunging * [light-client] add `LightClientStateSealSync` which has some mechanisms such that it can be shared across threads in an arc. [light-client] add constructor to `LightClientStateSealSync` fix light-client adjustments remove pending wip of sealing adjustements * provision light-client state wip * [tls-ra] provision light-client state too * fix clippy * fix cargo test compilation --- .../light-client/src/concurrent_access.rs | 10 ++-- core/parentchain/light-client/src/io.rs | 54 ++++++++++++++++-- core/parentchain/light-client/src/lib.rs | 8 ++- .../light-client/src/light_validation.rs | 4 +- .../src/light_validation_state.rs | 4 +- .../src/mocks/validator_mock_seal.rs | 4 +- core/parentchain/light-client/src/state.rs | 40 +++++++++++-- .../src/initialization/global_components.rs | 16 ++++-- enclave-runtime/src/initialization/mod.rs | 14 +++-- .../initialization/parentchain/parachain.rs | 20 +++---- .../initialization/parentchain/solochain.rs | 17 +++--- enclave-runtime/src/tls_ra/mocks.rs | 13 ++++- enclave-runtime/src/tls_ra/mod.rs | 16 ++++-- enclave-runtime/src/tls_ra/seal_handler.rs | 56 ++++++++++++------- enclave-runtime/src/tls_ra/tests.rs | 12 +++- enclave-runtime/src/tls_ra/tls_ra_client.rs | 19 ++++++- enclave-runtime/src/tls_ra/tls_ra_server.rs | 32 +++++++++-- 17 files changed, 247 insertions(+), 92 deletions(-) diff --git a/core/parentchain/light-client/src/concurrent_access.rs b/core/parentchain/light-client/src/concurrent_access.rs index e5596a7d55..f6482c9233 100644 --- a/core/parentchain/light-client/src/concurrent_access.rs +++ b/core/parentchain/light-client/src/concurrent_access.rs @@ -31,7 +31,7 @@ use crate::{ }; use finality_grandpa::BlockNumberOps; use sp_runtime::traits::{Block as ParentchainBlockTrait, NumberFor}; -use std::marker::PhantomData; +use std::{marker::PhantomData, sync::Arc}; /// Retrieve an exclusive lock on a validator for either read or write access. /// @@ -62,7 +62,7 @@ where /// Implementation of a validator access based on a global lock and corresponding file. #[derive(Debug)] pub struct ValidatorAccessor { - seal: LightClientSeal, + seal: Arc, light_validation: RwLock, _phantom: PhantomData<(LightClientSeal, Validator, ParentchainBlock)>, } @@ -70,7 +70,7 @@ pub struct ValidatorAccessor { impl ValidatorAccessor { - pub fn new(validator: Validator, seal: LightClientSeal) -> Self { + pub fn new(validator: Validator, seal: Arc) -> Self { ValidatorAccessor { light_validation: RwLock::new(validator), seal, @@ -85,7 +85,7 @@ where Validator: ValidatorTrait + LightClientState + ExtrinsicSenderTrait, - Seal: LightClientSealing>, + Seal: LightClientSealing>, ParentchainBlock: ParentchainBlockTrait, NumberFor: BlockNumberOps, { @@ -126,7 +126,7 @@ mod tests { fn execute_with_and_without_mut_in_single_thread_works() { let validator_mock = ValidatorMock::default(); let seal = LightValidationStateSealMock::new(); - let accessor = TestAccessor::new(validator_mock, seal); + let accessor = TestAccessor::new(validator_mock, seal.into()); let _read_result = accessor.execute_on_validator(|_v| Ok(())).unwrap(); let _write_result = accessor.execute_mut_on_validator(|_v| Ok(())).unwrap(); diff --git a/core/parentchain/light-client/src/io.rs b/core/parentchain/light-client/src/io.rs index 645615b142..9937729c15 100644 --- a/core/parentchain/light-client/src/io.rs +++ b/core/parentchain/light-client/src/io.rs @@ -16,7 +16,7 @@ */ use crate::{ - error::Result, + error::{Error, Result}, finality::{Finality, GrandpaFinality, ParachainFinality}, light_client_init_params::{GrandpaParams, SimpleParams}, light_validation::{check_validator_set_proof, LightValidation}, @@ -37,6 +37,12 @@ use std::{ sync::Arc, }; +#[cfg(feature = "sgx")] +use std::sync::SgxRwLock as RwLock; + +#[cfg(feature = "std")] +use std::sync::RwLock; + pub const DB_FILE: &str = "db.bin"; pub const BACKUP_FILE: &str = "db.bin.backup"; @@ -81,9 +87,11 @@ impl LightClientStateSeal { } } -impl LightClientSealing +impl LightClientSealing for LightClientStateSeal { + type LightClientState = LightClientState; + fn seal(&self, unsealed: &LightClientState) -> Result<()> { trace!("Backup light client state"); @@ -108,6 +116,44 @@ impl LightClientSealing { + seal: LightClientStateSeal, + _rw_lock: RwLock<()>, +} + +impl LightClientStateSealSync { + pub fn new(base_path: PathBuf) -> Result { + Ok(Self { seal: LightClientStateSeal::new(base_path)?, _rw_lock: RwLock::new(()) }) + } +} + +impl LightClientSealing + for LightClientStateSealSync +{ + type LightClientState = LightClientState; + + fn seal(&self, unsealed: &LightClientState) -> Result<()> { + let _lock = self._rw_lock.write().map_err(|_| Error::PoisonedLock)?; + self.seal.seal(unsealed) + } + + fn unseal(&self) -> Result { + let _lock = self._rw_lock.read().map_err(|_| Error::PoisonedLock)?; + self.seal.unseal() + } + + fn exists(&self) -> bool { + self.seal.exists() + } + + fn path(&self) -> &Path { + self.seal.path() + } +} + // FIXME: This is a lot of duplicate code for the initialization of two // different but sameish light clients. Should be tackled with #1081 pub fn read_or_init_grandpa_validator( @@ -119,7 +165,7 @@ where B: Block, NumberFor: finality_grandpa::BlockNumberOps, OCallApi: EnclaveOnChainOCallApi, - LightClientSeal: LightClientSealing>, + LightClientSeal: LightClientSealing>, { check_validator_set_proof::( params.genesis_header.state_root(), @@ -168,7 +214,7 @@ where B: Block, NumberFor: finality_grandpa::BlockNumberOps, OCallApi: EnclaveOnChainOCallApi, - LightClientSeal: LightClientSealing>, + LightClientSeal: LightClientSealing>, { if !seal.exists() { info!("[Enclave] ChainRelay DB not found, creating new! {}", seal.path().display()); diff --git a/core/parentchain/light-client/src/lib.rs b/core/parentchain/light-client/src/lib.rs index dda3cd557b..29f235ab82 100644 --- a/core/parentchain/light-client/src/lib.rs +++ b/core/parentchain/light-client/src/lib.rs @@ -95,9 +95,11 @@ pub trait LightClientState { fn penultimate_finalized_block_header(&self) -> Result; } -pub trait LightClientSealing { - fn seal(&self, state: &LightClientState) -> Result<(), Error>; - fn unseal(&self) -> Result; +pub trait LightClientSealing { + type LightClientState; + + fn seal(&self, state: &Self::LightClientState) -> Result<(), Error>; + fn unseal(&self) -> Result; fn exists(&self) -> bool; fn path(&self) -> &Path; } diff --git a/core/parentchain/light-client/src/light_validation.rs b/core/parentchain/light-client/src/light_validation.rs index e4e74633b2..ea8bd53ad9 100644 --- a/core/parentchain/light-client/src/light_validation.rs +++ b/core/parentchain/light-client/src/light_validation.rs @@ -105,8 +105,8 @@ impl } // A valid grandpa proof proves finalization of all previous unjustified blocks. - relay.header_hashes.append(&mut relay.unjustified_headers); - relay.header_hashes.push(header.hash()); + relay.justify_headers(); + relay.push_header_hash(header.hash()); relay.set_last_finalized_block_header(header); diff --git a/core/parentchain/light-client/src/light_validation_state.rs b/core/parentchain/light-client/src/light_validation_state.rs index aaea10f28a..502aefb053 100644 --- a/core/parentchain/light-client/src/light_validation_state.rs +++ b/core/parentchain/light-client/src/light_validation_state.rs @@ -58,9 +58,7 @@ where } fn genesis_hash(&self) -> Result, Error> { - let relay = self.get_relay(); - let hash = relay.header_hashes.get(0).ok_or(Error::NoGenesis)?; - Ok(*hash) + Ok(self.get_relay().genesis_hash) } fn latest_finalized_header(&self) -> Result { diff --git a/core/parentchain/light-client/src/mocks/validator_mock_seal.rs b/core/parentchain/light-client/src/mocks/validator_mock_seal.rs index 6a5f895bd3..4c7e4f25d3 100644 --- a/core/parentchain/light-client/src/mocks/validator_mock_seal.rs +++ b/core/parentchain/light-client/src/mocks/validator_mock_seal.rs @@ -40,7 +40,9 @@ impl Default for LightValidationStateSealMock { } } -impl LightClientSealing> for LightValidationStateSealMock { +impl LightClientSealing for LightValidationStateSealMock { + type LightClientState = LightValidationState; + fn unseal(&self) -> Result, Error> { Ok(LightValidationState::new(RelayState::new( ParentchainHeaderBuilder::default().build(), diff --git a/core/parentchain/light-client/src/state.rs b/core/parentchain/light-client/src/state.rs index 743e7eed63..720d5240ef 100644 --- a/core/parentchain/light-client/src/state.rs +++ b/core/parentchain/light-client/src/state.rs @@ -21,20 +21,47 @@ use sp_runtime::{ traits::{Block as BlockT, Header as HeaderT}, OpaqueExtrinsic, }; -use std::{fmt, vec::Vec}; +use std::{collections::VecDeque, fmt, vec::Vec}; + +/// Defines the amount of parentchain headers to keep. +pub const PARENTCHAIN_HEADER_PRUNING: u64 = 1000; #[derive(Encode, Decode, Clone, Eq, PartialEq)] pub struct RelayState { + pub genesis_hash: Block::Hash, pub last_finalized_block_header: Block::Header, pub penultimate_finalized_block_header: Block::Header, pub current_validator_set: AuthorityList, pub current_validator_set_id: SetId, - pub header_hashes: Vec, + header_hashes: VecDeque, pub unjustified_headers: Vec, // Finalized headers without grandpa proof pub verify_tx_inclusion: Vec, // Transactions sent by the relay pub scheduled_change: Option>, // Scheduled Authorities change as indicated in the header's digest. } +impl RelayState { + pub fn push_header_hash(&mut self, header: Block::Hash) { + self.header_hashes.push_back(header); + + if self.header_hashes.len() > PARENTCHAIN_HEADER_PRUNING as usize { + self.header_hashes.pop_front().expect("Tested above that is not empty; qed"); + } + } + + pub fn justify_headers(&mut self) { + self.header_hashes.extend(&mut self.unjustified_headers.iter()); + self.unjustified_headers.clear(); + + while self.header_hashes.len() > PARENTCHAIN_HEADER_PRUNING as usize { + self.header_hashes.pop_front().expect("Tested above that is not empty; qed"); + } + } + + pub fn header_hashes(&self) -> &VecDeque { + &self.header_hashes + } +} + #[derive(Encode, Decode, Clone, Eq, PartialEq)] pub struct ScheduledChangeAtBlock { pub at_block: Header::Number, @@ -42,12 +69,13 @@ pub struct ScheduledChangeAtBlock { } impl RelayState { - pub fn new(block_header: Block::Header, validator_set: AuthorityList) -> Self { + pub fn new(genesis: Block::Header, validator_set: AuthorityList) -> Self { RelayState { - header_hashes: vec![block_header.hash()], - last_finalized_block_header: block_header.clone(), + genesis_hash: genesis.hash(), + header_hashes: vec![genesis.hash()].into(), + last_finalized_block_header: genesis.clone(), // is it bad to initialize with the same? Header trait does no implement default... - penultimate_finalized_block_header: block_header, + penultimate_finalized_block_header: genesis, current_validator_set: validator_set, current_validator_set_id: 0, unjustified_headers: Vec::new(), diff --git a/enclave-runtime/src/initialization/global_components.rs b/enclave-runtime/src/initialization/global_components.rs index e4197a43ba..67934d926b 100644 --- a/enclave-runtime/src/initialization/global_components.rs +++ b/enclave-runtime/src/initialization/global_components.rs @@ -46,7 +46,7 @@ use itc_parentchain::{ IndirectCallsExecutor, }, light_client::{ - concurrent_access::ValidatorAccessor, io::LightClientStateSeal, + concurrent_access::ValidatorAccessor, io::LightClientStateSealSync, light_validation::LightValidation, light_validation_state::LightValidationState, }, }; @@ -132,7 +132,7 @@ pub type EnclaveSidechainApi = SidechainApi; // Parentchain types pub type EnclaveLightClientSeal = - LightClientStateSeal>; + LightClientStateSealSync>; pub type EnclaveExtrinsicsFactory = ExtrinsicsFactory; pub type EnclaveIndirectCallsExecutor = IndirectCallsExecutor< @@ -215,8 +215,12 @@ pub type EnclaveSidechainBlockImportQueueWorker = BlockImportQueueWorker< EnclaveSidechainBlockImportQueue, EnclaveSidechainBlockSyncer, >; -pub type EnclaveSealHandler = - SealHandler; +pub type EnclaveSealHandler = SealHandler< + EnclaveShieldingKeyRepository, + EnclaveStateKeyRepository, + EnclaveStateHandler, + EnclaveLightClientSeal, +>; pub type EnclaveOffchainWorkerExecutor = itc_offchain_worker_executor::executor::Executor< ParentchainBlock, EnclaveTopPoolAuthor, @@ -244,6 +248,10 @@ pub static GLOBAL_SIGNING_KEY_REPOSITORY_COMPONENT: ComponentContainer< EnclaveSigningKeyRepository, > = ComponentContainer::new("Signing key repository"); +/// Light client db seal. +pub static GLOBAL_LIGHT_CLIENT_SEAL: ComponentContainer = + ComponentContainer::new("EnclaveLightClientSealSync"); + /// O-Call API pub static GLOBAL_OCALL_API_COMPONENT: ComponentContainer = ComponentContainer::new("O-call API"); diff --git a/enclave-runtime/src/initialization/mod.rs b/enclave-runtime/src/initialization/mod.rs index 98fb9bc8f2..d2e113fa7d 100644 --- a/enclave-runtime/src/initialization/mod.rs +++ b/enclave-runtime/src/initialization/mod.rs @@ -21,14 +21,14 @@ pub mod parentchain; use crate::{ error::{Error, Result as EnclaveResult}, initialization::global_components::{ - EnclaveBlockImportConfirmationHandler, EnclaveGetterExecutor, EnclaveOCallApi, - EnclaveRpcConnectionRegistry, EnclaveRpcResponder, EnclaveShieldingKeyRepository, - EnclaveSidechainApi, EnclaveSidechainBlockImportQueue, + EnclaveBlockImportConfirmationHandler, EnclaveGetterExecutor, EnclaveLightClientSeal, + EnclaveOCallApi, EnclaveRpcConnectionRegistry, EnclaveRpcResponder, + EnclaveShieldingKeyRepository, EnclaveSidechainApi, EnclaveSidechainBlockImportQueue, EnclaveSidechainBlockImportQueueWorker, EnclaveSidechainBlockImporter, EnclaveSidechainBlockSyncer, EnclaveStateFileIo, EnclaveStateHandler, EnclaveStateInitializer, EnclaveStateObserver, EnclaveStateSnapshotRepository, EnclaveStfEnclaveSigner, EnclaveTopPool, EnclaveTopPoolAuthor, - GLOBAL_ATTESTATION_HANDLER_COMPONENT, GLOBAL_OCALL_API_COMPONENT, + GLOBAL_ATTESTATION_HANDLER_COMPONENT, GLOBAL_LIGHT_CLIENT_SEAL, GLOBAL_OCALL_API_COMPONENT, GLOBAL_RPC_WS_HANDLER_COMPONENT, GLOBAL_SHIELDING_KEY_REPOSITORY_COMPONENT, GLOBAL_SIDECHAIN_BLOCK_COMPOSER_COMPONENT, GLOBAL_SIDECHAIN_BLOCK_SYNCER_COMPONENT, GLOBAL_SIDECHAIN_IMPORT_QUEUE_COMPONENT, GLOBAL_SIDECHAIN_IMPORT_QUEUE_WORKER_COMPONENT, @@ -59,7 +59,7 @@ use itc_tls_websocket_server::{ use itp_attestation_handler::IntelAttestationHandler; use itp_component_container::{ComponentGetter, ComponentInitializer}; use itp_primitives_cache::GLOBAL_PRIMITIVES_CACHE; -use itp_settings::files::STATE_SNAPSHOTS_CACHE_SIZE; +use itp_settings::files::{LIGHT_CLIENT_DB_PATH, STATE_SNAPSHOTS_CACHE_SIZE}; use itp_sgx_crypto::{ get_aes_repository, get_ed25519_repository, get_rsa3072_repository, key_repository::AccessKey, }; @@ -94,6 +94,10 @@ pub(crate) fn init_enclave( let state_key_repository = Arc::new(get_aes_repository(base_dir.clone())?); GLOBAL_STATE_KEY_REPOSITORY_COMPONENT.initialize(state_key_repository.clone()); + let light_client_seal = + Arc::new(EnclaveLightClientSeal::new(base_dir.join(LIGHT_CLIENT_DB_PATH))?); + GLOBAL_LIGHT_CLIENT_SEAL.initialize(light_client_seal); + let state_file_io = Arc::new(EnclaveStateFileIo::new(state_key_repository, StateDir::new(base_dir))); let state_initializer = diff --git a/enclave-runtime/src/initialization/parentchain/parachain.rs b/enclave-runtime/src/initialization/parentchain/parachain.rs index 2d0b4854eb..7b43450e6b 100644 --- a/enclave-runtime/src/initialization/parentchain/parachain.rs +++ b/enclave-runtime/src/initialization/parentchain/parachain.rs @@ -19,10 +19,10 @@ use crate::{ error::Result, initialization::{ global_components::{ - EnclaveExtrinsicsFactory, EnclaveLightClientSeal, EnclaveNodeMetadataRepository, - EnclaveOCallApi, EnclaveParentchainBlockImportDispatcher, EnclaveStfExecutor, - EnclaveValidatorAccessor, GLOBAL_FULL_PARACHAIN_HANDLER_COMPONENT, - GLOBAL_OCALL_API_COMPONENT, GLOBAL_STATE_HANDLER_COMPONENT, + EnclaveExtrinsicsFactory, EnclaveNodeMetadataRepository, EnclaveOCallApi, + EnclaveParentchainBlockImportDispatcher, EnclaveStfExecutor, EnclaveValidatorAccessor, + GLOBAL_FULL_PARACHAIN_HANDLER_COMPONENT, GLOBAL_OCALL_API_COMPONENT, + GLOBAL_STATE_HANDLER_COMPONENT, }, parentchain::common::{ create_extrinsics_factory, create_offchain_immediate_import_dispatcher, @@ -33,12 +33,10 @@ use crate::{ use codec::Encode; use itc_parentchain::light_client::{concurrent_access::ValidatorAccess, LightClientState}; use itp_component_container::{ComponentGetter, ComponentInitializer}; -use itp_settings::{ - files::LIGHT_CLIENT_DB_PATH, - worker_mode::{ProvideWorkerMode, WorkerMode}, -}; +use itp_settings::worker_mode::{ProvideWorkerMode, WorkerMode}; use std::{path::PathBuf, sync::Arc, vec::Vec}; +use crate::initialization::global_components::GLOBAL_LIGHT_CLIENT_SEAL; pub use itc_parentchain::primitives::{ParachainBlock, ParachainHeader, ParachainParams}; #[derive(Clone)] @@ -54,7 +52,7 @@ pub struct FullParachainHandler { impl FullParachainHandler { pub fn init( - base_path: PathBuf, + _base_path: PathBuf, params: ParachainParams, ) -> Result> { let ocall_api = GLOBAL_OCALL_API_COMPONENT.get()?; @@ -63,12 +61,12 @@ impl FullParachainHandler { let genesis_header = params.genesis_header.clone(); - let light_client_seal = EnclaveLightClientSeal::new(base_path.join(LIGHT_CLIENT_DB_PATH))?; + let light_client_seal = GLOBAL_LIGHT_CLIENT_SEAL.get()?; let validator = itc_parentchain::light_client::io::read_or_init_parachain_validator::< ParachainBlock, EnclaveOCallApi, _, - >(params, ocall_api.clone(), &light_client_seal)?; + >(params, ocall_api.clone(), &*light_client_seal)?; let latest_header = validator.latest_finalized_header()?; let validator_accessor = Arc::new(EnclaveValidatorAccessor::new(validator, light_client_seal)); diff --git a/enclave-runtime/src/initialization/parentchain/solochain.rs b/enclave-runtime/src/initialization/parentchain/solochain.rs index d02e5d918f..87efa644a5 100644 --- a/enclave-runtime/src/initialization/parentchain/solochain.rs +++ b/enclave-runtime/src/initialization/parentchain/solochain.rs @@ -19,9 +19,9 @@ use crate::{ error::Result, initialization::{ global_components::{ - EnclaveExtrinsicsFactory, EnclaveLightClientSeal, EnclaveNodeMetadataRepository, - EnclaveOCallApi, EnclaveParentchainBlockImportDispatcher, EnclaveStfExecutor, - EnclaveValidatorAccessor, GLOBAL_FULL_SOLOCHAIN_HANDLER_COMPONENT, + EnclaveExtrinsicsFactory, EnclaveNodeMetadataRepository, EnclaveOCallApi, + EnclaveParentchainBlockImportDispatcher, EnclaveStfExecutor, EnclaveValidatorAccessor, + GLOBAL_FULL_SOLOCHAIN_HANDLER_COMPONENT, GLOBAL_LIGHT_CLIENT_SEAL, GLOBAL_OCALL_API_COMPONENT, GLOBAL_STATE_HANDLER_COMPONENT, }, parentchain::common::{ @@ -33,10 +33,7 @@ use crate::{ use codec::Encode; use itc_parentchain::light_client::{concurrent_access::ValidatorAccess, LightClientState}; use itp_component_container::{ComponentGetter, ComponentInitializer}; -use itp_settings::{ - files::LIGHT_CLIENT_DB_PATH, - worker_mode::{ProvideWorkerMode, WorkerMode}, -}; +use itp_settings::worker_mode::{ProvideWorkerMode, WorkerMode}; use std::{path::PathBuf, sync::Arc, vec::Vec}; pub use itc_parentchain::primitives::{SolochainBlock, SolochainHeader, SolochainParams}; @@ -53,21 +50,21 @@ pub struct FullSolochainHandler { impl FullSolochainHandler { pub fn init( - base_path: PathBuf, + _base_path: PathBuf, params: SolochainParams, ) -> Result> { let ocall_api = GLOBAL_OCALL_API_COMPONENT.get()?; let state_handler = GLOBAL_STATE_HANDLER_COMPONENT.get()?; + let light_client_seal = GLOBAL_LIGHT_CLIENT_SEAL.get()?; let node_metadata_repository = Arc::new(EnclaveNodeMetadataRepository::default()); let genesis_header = params.genesis_header.clone(); - let light_client_seal = EnclaveLightClientSeal::new(base_path.join(LIGHT_CLIENT_DB_PATH))?; let validator = itc_parentchain::light_client::io::read_or_init_grandpa_validator::< SolochainBlock, EnclaveOCallApi, _, - >(params, ocall_api.clone(), &light_client_seal)?; + >(params, ocall_api.clone(), &*light_client_seal)?; let latest_header = validator.latest_finalized_header()?; let validator_accessor = Arc::new(EnclaveValidatorAccessor::new(validator, light_client_seal)); diff --git a/enclave-runtime/src/tls_ra/mocks.rs b/enclave-runtime/src/tls_ra/mocks.rs index 2a918f48e0..e7f6900a0f 100644 --- a/enclave-runtime/src/tls_ra/mocks.rs +++ b/enclave-runtime/src/tls_ra/mocks.rs @@ -28,6 +28,7 @@ pub struct SealHandlerMock { pub shielding_key: Arc>>, pub state_key: Arc>>, pub state: Arc>>, + pub light_client_state: Arc>>, } impl SealHandlerMock { @@ -35,8 +36,9 @@ impl SealHandlerMock { shielding_key: Arc>>, state_key: Arc>>, state: Arc>>, + light_client_state: Arc>>, ) -> Self { - Self { shielding_key, state_key, state } + Self { shielding_key, state_key, state, light_client_state } } } @@ -59,6 +61,11 @@ impl SealStateAndKeys for SealHandlerMock { fn seal_new_empty_state(&self, _shard: &ShardIdentifier) -> EnclaveResult<()> { Ok(()) } + + fn seal_light_client_state(&self, bytes: &[u8]) -> EnclaveResult<()> { + *self.light_client_state.write().unwrap() = bytes.to_vec(); + Ok(()) + } } impl UnsealStateAndKeys for SealHandlerMock { @@ -73,4 +80,8 @@ impl UnsealStateAndKeys for SealHandlerMock { fn unseal_state(&self, _shard: &ShardIdentifier) -> EnclaveResult> { Ok(self.state.read().unwrap().clone()) } + + fn unseal_light_client_state(&self) -> EnclaveResult> { + Ok(self.light_client_state.read().unwrap().clone()) + } } diff --git a/enclave-runtime/src/tls_ra/mod.rs b/enclave-runtime/src/tls_ra/mod.rs index 8bb672b5f3..90724cdfe5 100644 --- a/enclave-runtime/src/tls_ra/mod.rs +++ b/enclave-runtime/src/tls_ra/mod.rs @@ -18,6 +18,8 @@ //! Contains all logic of the state provisioning mechanism //! including the remote attestation and tls / tcp connection part. +use codec::{Decode, Encode, MaxEncodedLen}; + mod authentication; pub mod seal_handler; mod tls_ra_client; @@ -29,9 +31,9 @@ pub mod tests; #[cfg(feature = "test")] pub mod mocks; -/// Header of an accompanied payloard. Indicates the +/// Header of an accompanied payload. Indicates the /// length an the type (opcode) of the following payload. -#[derive(Clone, Debug)] +#[derive(Clone, Debug, Decode, Encode, MaxEncodedLen)] pub struct TcpHeader { pub opcode: Opcode, pub payload_length: u64, @@ -44,11 +46,12 @@ impl TcpHeader { } /// Indicates the payload content type. -#[derive(Copy, Clone, Debug, Eq, PartialEq)] +#[derive(Copy, Clone, Debug, Eq, PartialEq, Decode, Encode, MaxEncodedLen)] pub enum Opcode { - ShieldingKey = 0, - StateKey = 1, - State = 2, + ShieldingKey, + StateKey, + State, + LightClient, } impl From for Opcode { @@ -57,6 +60,7 @@ impl From for Opcode { 0 => Opcode::ShieldingKey, 1 => Opcode::StateKey, 2 => Opcode::State, + 3 => Opcode::LightClient, _ => unimplemented!("Unsupported/unknown Opcode for MU-RA exchange"), } } diff --git a/enclave-runtime/src/tls_ra/seal_handler.rs b/enclave-runtime/src/tls_ra/seal_handler.rs index 05f83dbd42..bb7828dd57 100644 --- a/enclave-runtime/src/tls_ra/seal_handler.rs +++ b/enclave-runtime/src/tls_ra/seal_handler.rs @@ -21,6 +21,7 @@ use crate::error::{Error as EnclaveError, Result as EnclaveResult}; use codec::{Decode, Encode}; use ita_stf::{State as StfState, StateType as StfStateType}; +use itc_parentchain::light_client::LightClientSealing; use itp_sgx_crypto::{ key_repository::{AccessKey, MutateKey}, Aes, @@ -34,32 +35,23 @@ use std::{sync::Arc, vec::Vec}; /// Handles the sealing and unsealing of the shielding key, state key and the state. #[derive(Default)] -pub struct SealHandler -where - ShieldingKeyRepository: AccessKey + MutateKey, - StateKeyRepository: AccessKey + MutateKey, - // Constraint StateT = StfState currently necessary because SgxExternalities Encode/Decode does not work. - // See https://github.com/integritee-network/sgx-runtime/issues/46. - StateHandler: HandleState, -{ +pub struct SealHandler { state_handler: Arc, state_key_repository: Arc, shielding_key_repository: Arc, + light_client_seal: Arc, } -impl - SealHandler -where - ShieldingKeyRepository: AccessKey + MutateKey, - StateKeyRepository: AccessKey + MutateKey, - StateHandler: HandleState, +impl + SealHandler { pub fn new( state_handler: Arc, state_key_repository: Arc, shielding_key_repository: Arc, + light_client_seal: Arc, ) -> Self { - Self { state_handler, state_key_repository, shielding_key_repository } + Self { state_handler, state_key_repository, shielding_key_repository, light_client_seal } } } @@ -68,20 +60,24 @@ pub trait SealStateAndKeys { fn seal_state_key(&self, bytes: &[u8]) -> EnclaveResult<()>; fn seal_state(&self, bytes: &[u8], shard: &ShardIdentifier) -> EnclaveResult<()>; fn seal_new_empty_state(&self, shard: &ShardIdentifier) -> EnclaveResult<()>; + fn seal_light_client_state(&self, bytes: &[u8]) -> EnclaveResult<()>; } pub trait UnsealStateAndKeys { fn unseal_shielding_key(&self) -> EnclaveResult>; fn unseal_state_key(&self) -> EnclaveResult>; fn unseal_state(&self, shard: &ShardIdentifier) -> EnclaveResult>; + fn unseal_light_client_state(&self) -> EnclaveResult>; } -impl SealStateAndKeys - for SealHandler +impl SealStateAndKeys + for SealHandler where ShieldingKeyRepository: AccessKey + MutateKey, StateKeyRepository: AccessKey + MutateKey, StateHandler: HandleState, + LightClientSeal: LightClientSealing, + LightClientSeal::LightClientState: Decode, { fn seal_shielding_key(&self, bytes: &[u8]) -> EnclaveResult<()> { let key: Rsa3072KeyPair = serde_json::from_slice(bytes).map_err(|e| { @@ -109,6 +105,13 @@ where Ok(()) } + fn seal_light_client_state(&self, mut bytes: &[u8]) -> EnclaveResult<()> { + let state = ::LightClientState::decode(&mut bytes)?; + self.light_client_seal.seal(&state)?; + info!("Successfully sealed light client state"); + Ok(()) + } + /// Seal an empty, newly initialized state. /// /// Requires the shielding key to be sealed and updated before calling this. @@ -123,12 +126,14 @@ where } } -impl UnsealStateAndKeys - for SealHandler +impl UnsealStateAndKeys + for SealHandler where ShieldingKeyRepository: AccessKey + MutateKey, StateKeyRepository: AccessKey + MutateKey, StateHandler: HandleState, + LightClientSeal: LightClientSealing, + LightClientSeal::LightClientState: Encode, { fn unseal_shielding_key(&self) -> EnclaveResult> { let shielding_key = self @@ -148,19 +153,28 @@ where fn unseal_state(&self, shard: &ShardIdentifier) -> EnclaveResult> { Ok(self.state_handler.execute_on_current(shard, |state, _| state.state.encode())?) } + + fn unseal_light_client_state(&self) -> EnclaveResult> { + Ok(self.light_client_seal.unseal()?.encode()) + } } #[cfg(feature = "test")] pub mod test { use super::*; + use itc_parentchain::light_client::mocks::validator_mock_seal::LightValidationStateSealMock; use itp_sgx_crypto::mocks::KeyRepositoryMock; use itp_test::mock::handle_state_mock::HandleStateMock; type StateKeyRepositoryMock = KeyRepositoryMock; type ShieldingKeyRepositoryMock = KeyRepositoryMock; - type SealHandlerMock = - SealHandler; + type SealHandlerMock = SealHandler< + ShieldingKeyRepositoryMock, + StateKeyRepositoryMock, + HandleStateMock, + LightValidationStateSealMock, + >; pub fn seal_shielding_key_works() { let seal_handler = SealHandlerMock::default(); diff --git a/enclave-runtime/src/tls_ra/tests.rs b/enclave-runtime/src/tls_ra/tests.rs index 1540279b17..beae945656 100644 --- a/enclave-runtime/src/tls_ra/tests.rs +++ b/enclave-runtime/src/tls_ra/tests.rs @@ -26,6 +26,7 @@ use crate::{ tls_ra::seal_handler::{SealHandler, SealStateAndKeys, UnsealStateAndKeys}, }; use ita_stf::State; +use itc_parentchain::light_client::mocks::validator_mock_seal::LightValidationStateSealMock; use itp_settings::worker_mode::{ProvideWorkerMode, WorkerMode, WorkerModeProvider}; use itp_sgx_crypto::{mocks::KeyRepositoryMock, Aes}; use itp_stf_interface::InitState; @@ -74,22 +75,28 @@ pub fn test_tls_ra_server_client_networking() { let shielding_key_encoded = vec![1, 2, 3]; let state_key_encoded = vec![5, 2, 3, 7]; let state_encoded = Vec::from([1u8; 26000]); // Have a decently sized state, so read() must be called multiple times. + let light_client_state_encoded = Vec::from([1u8; 10000]); // Have a decently sized state, so read() must be called multiple times. let server_seal_handler = SealHandlerMock::new( Arc::new(RwLock::new(shielding_key_encoded.clone())), Arc::new(RwLock::new(state_key_encoded.clone())), Arc::new(RwLock::new(state_encoded.clone())), + Arc::new(RwLock::new(light_client_state_encoded.clone())), ); let initial_client_state = vec![0, 0, 1]; let initial_client_state_key = vec![0, 0, 2]; + let initial_client_light_client_state = vec![0, 0, 3]; let client_shielding_key = Arc::new(RwLock::new(Vec::new())); let client_state_key = Arc::new(RwLock::new(initial_client_state_key.clone())); let client_state = Arc::new(RwLock::new(initial_client_state.clone())); + let client_light_client_state = + Arc::new(RwLock::new(initial_client_light_client_state.clone())); let client_seal_handler = SealHandlerMock::new( client_shielding_key.clone(), client_state_key.clone(), client_state.clone(), + client_light_client_state.clone(), ); let port: u16 = 3149; @@ -118,6 +125,7 @@ pub fn test_tls_ra_server_client_networking() { assert!(result.is_ok()); assert_eq!(*client_shielding_key.read().unwrap(), shielding_key_encoded); + assert_eq!(*client_light_client_state.read().unwrap(), light_client_state_encoded); // State and state-key are provisioned only in sidechain mode if WorkerModeProvider::worker_mode() == WorkerMode::Sidechain { @@ -179,5 +187,7 @@ fn create_seal_handler( Arc::new(KeyRepositoryMock::::new(shielding_key)); let state_handler = Arc::new(HandleStateMock::default()); state_handler.reset(state, shard).unwrap(); - SealHandler::new(state_handler, state_key_repository, shielding_key_repository) + let seal = Arc::new(LightValidationStateSealMock::new()); + + SealHandler::new(state_handler, state_key_repository, shielding_key_repository, seal) } diff --git a/enclave-runtime/src/tls_ra/tls_ra_client.rs b/enclave-runtime/src/tls_ra/tls_ra_client.rs index aa1f71651a..9eb1546b2a 100644 --- a/enclave-runtime/src/tls_ra/tls_ra_client.rs +++ b/enclave-runtime/src/tls_ra/tls_ra_client.rs @@ -22,7 +22,7 @@ use crate::{ attestation::create_ra_report_and_signature, error::{Error as EnclaveError, Result as EnclaveResult}, initialization::global_components::{ - EnclaveSealHandler, GLOBAL_SHIELDING_KEY_REPOSITORY_COMPONENT, + EnclaveSealHandler, GLOBAL_LIGHT_CLIENT_SEAL, GLOBAL_SHIELDING_KEY_REPOSITORY_COMPONENT, GLOBAL_STATE_KEY_REPOSITORY_COMPONENT, }, ocall::OcallApi, @@ -128,6 +128,7 @@ where Opcode::ShieldingKey => self.seal_handler.seal_shielding_key(&bytes)?, Opcode::StateKey => self.seal_handler.seal_state_key(&bytes)?, Opcode::State => self.seal_handler.seal_state(&bytes, &self.shard)?, + Opcode::LightClient => self.seal_handler.seal_light_client_state(&bytes)?, }; Ok(Some(header.opcode)) } @@ -192,8 +193,20 @@ pub unsafe extern "C" fn request_state_provisioning( }, }; - let seal_handler = - EnclaveSealHandler::new(state_handler, state_key_repository, shielding_key_repository); + let light_client_seal = match GLOBAL_LIGHT_CLIENT_SEAL.get() { + Ok(s) => s, + Err(e) => { + error!("{:?}", e); + return sgx_status_t::SGX_ERROR_UNEXPECTED + }, + }; + + let seal_handler = EnclaveSealHandler::new( + state_handler, + state_key_repository, + shielding_key_repository, + light_client_seal, + ); if let Err(e) = request_state_provisioning_internal( socket_fd, diff --git a/enclave-runtime/src/tls_ra/tls_ra_server.rs b/enclave-runtime/src/tls_ra/tls_ra_server.rs index 5e34367643..836b146b9d 100644 --- a/enclave-runtime/src/tls_ra/tls_ra_server.rs +++ b/enclave-runtime/src/tls_ra/tls_ra_server.rs @@ -22,7 +22,7 @@ use crate::{ attestation::create_ra_report_and_signature, error::{Error as EnclaveError, Result as EnclaveResult}, initialization::global_components::{ - EnclaveSealHandler, GLOBAL_SHIELDING_KEY_REPOSITORY_COMPONENT, + EnclaveSealHandler, GLOBAL_LIGHT_CLIENT_SEAL, GLOBAL_SHIELDING_KEY_REPOSITORY_COMPONENT, GLOBAL_STATE_KEY_REPOSITORY_COMPONENT, }, ocall::OcallApi, @@ -47,14 +47,14 @@ use std::{ #[derive(Clone, Eq, PartialEq, Debug)] enum ProvisioningPayload { Everything, - ShieldingKeyOnly, + ShieldingKeyAndLightClient, } impl From for ProvisioningPayload { fn from(m: WorkerMode) -> Self { match m { WorkerMode::OffChainWorker | WorkerMode::Teeracle => - ProvisioningPayload::ShieldingKeyOnly, + ProvisioningPayload::ShieldingKeyAndLightClient, WorkerMode::Sidechain => ProvisioningPayload::Everything, } } @@ -107,9 +107,11 @@ where self.write_shielding_key()?; self.write_state_key()?; self.write_state(shard)?; + self.write_light_client_state()?; }, - ProvisioningPayload::ShieldingKeyOnly => { + ProvisioningPayload::ShieldingKeyAndLightClient => { self.write_shielding_key()?; + self.write_light_client_state()?; }, } @@ -135,6 +137,12 @@ where Ok(()) } + fn write_light_client_state(&mut self) -> EnclaveResult<()> { + let state = self.seal_handler.unseal_light_client_state()?; + self.write(Opcode::LightClient, &state)?; + Ok(()) + } + /// Sends the header followed by the payload. fn write(&mut self, opcode: Opcode, bytes: &[u8]) -> EnclaveResult<()> { let payload_length = bytes.len() as u64; @@ -190,8 +198,20 @@ pub unsafe extern "C" fn run_state_provisioning_server( }, }; - let seal_handler = - EnclaveSealHandler::new(state_handler, state_key_repository, shielding_key_repository); + let light_client_seal = match GLOBAL_LIGHT_CLIENT_SEAL.get() { + Ok(s) => s, + Err(e) => { + error!("{:?}", e); + return sgx_status_t::SGX_ERROR_UNEXPECTED + }, + }; + + let seal_handler = EnclaveSealHandler::new( + state_handler, + state_key_repository, + shielding_key_repository, + light_client_seal, + ); if let Err(e) = run_state_provisioning_server_internal::<_, WorkerModeProvider>( socket_fd, From d1b8cbefe9eb09228754063060a50d4c244727f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szil=C3=A1rd=20Parrag?= Date: Tue, 1 Aug 2023 12:21:57 +0200 Subject: [PATCH 07/11] Polkadot update v0.9.42 (#1337) * polkadot update v0.9.42 * followup for Keystore overhaul (final) (#13683) * implement missing trait methods * substrate-api-client: explicitly use synchronous mode instead of the default async * susbtrate-api-client followup regarding keystore overhaul * taplo fmt * followup for sidechain-evm * cargo clippy * fixup! followup for sidechain-evm * update integritee-node image * integritee-node: update branch * integritee-node: update branch * main: AddedEnclave change followup made in pallets/pull/180 * attesteer: fix warnings where DCAP was activated, but not with attesteer * evm: followup made in pallets/pull/180 * add debug! logs * remove commented out code * remove empty features * ita-sgx-runtime: fixup for freezing implementation in fungible trait * fixup! ita-sgx-runtime: fixup for freezing implementation in fungible trait * minor fixes and more logging (#1367) * [local-setup] fix setup with two workers: avoid using the same data dirs. (#1358) * [ita_stf/test_genesis] remove reserved balance from state, as it doesn't exist anymore * [enclave-runtime/top_pool_execution] downgrade logs to trace * [state_handler] add debug and trace logs * add additional flags for the worker setup * [its-consensus-aura/block_importer] add some more logs * local setup add some more logging * cli: fix keystore KeyTypeId inconsistency * fix clippy * hopefully fixcing evm build * add debug log in entrypoint * use explicit sgx_default_qcnl.conf file * CI: healthy params for teeracle testing * more verbose logging for sidechain consensus * pimp logging * ensure worker panics immediately if registering enclave fails * bypass enclave registration success check. fix primary validateer detection * fmt * pimp logging to track shard * fmt --------- Co-authored-by: clangenb <37865735+clangenb@users.noreply.github.com> Co-authored-by: Christian Langenbacher Co-authored-by: brenzi Co-authored-by: Alain Brenzikofer Co-authored-by: Alain Brenzikofer --- .github/workflows/build_and_test.yml | 6 +- Cargo.lock | 1511 +++++++++-------- app-libs/sgx-runtime/Cargo.toml | 54 +- app-libs/sgx-runtime/src/evm.rs | 8 +- app-libs/sgx-runtime/src/lib.rs | 19 +- app-libs/stf/Cargo.toml | 20 +- app-libs/stf/src/stf_sgx.rs | 3 +- app-libs/stf/src/test_genesis.rs | 24 +- app-libs/stf/src/trusted_call.rs | 9 +- cli/Cargo.toml | 27 +- cli/demo_teeracle_whitelist.sh | 14 +- cli/src/base_cli/commands/listen.rs | 13 +- cli/src/base_cli/commands/transfer.rs | 14 +- cli/src/base_cli/mod.rs | 16 +- cli/src/benchmark/mod.rs | 14 +- cli/src/lib.rs | 4 + cli/src/trusted_base_cli/mod.rs | 19 +- cli/src/trusted_command_utils.rs | 9 +- cli/src/trusted_operation.rs | 23 +- .../attestation-handler/Cargo.toml | 4 +- .../src/attestation_handler.rs | 4 +- .../attestation-handler/src/cert.rs | 4 +- core-primitives/enclave-api/Cargo.toml | 10 +- core-primitives/extrinsics-factory/Cargo.toml | 6 +- core-primitives/hashing/Cargo.toml | 2 +- .../node-api/api-client-extensions/Cargo.toml | 8 +- .../api-client-extensions/src/chain.rs | 2 +- .../node-api/api-client-types/Cargo.toml | 8 +- core-primitives/node-api/factory/Cargo.toml | 2 +- core-primitives/node-api/metadata/Cargo.toml | 2 +- core-primitives/ocall-api/Cargo.toml | 6 +- .../sgx-runtime-primitives/Cargo.toml | 8 +- core-primitives/sgx/crypto/Cargo.toml | 2 +- core-primitives/stf-executor/Cargo.toml | 4 +- core-primitives/stf-primitives/Cargo.toml | 4 +- core-primitives/stf-state-handler/Cargo.toml | 2 +- .../stf-state-handler/src/state_handler.rs | 8 +- core-primitives/storage/Cargo.toml | 12 +- core-primitives/storage/src/proof.rs | 5 +- .../substrate-sgx/externalities/Cargo.toml | 2 +- .../substrate-sgx/sp-io/Cargo.toml | 10 +- core-primitives/teerex-storage/Cargo.toml | 2 +- core-primitives/test/Cargo.toml | 6 +- core-primitives/top-pool-author/Cargo.toml | 6 +- core-primitives/top-pool/Cargo.toml | 6 +- core-primitives/types/Cargo.toml | 12 +- core-primitives/utils/Cargo.toml | 4 +- core-primitives/utils/src/stringify.rs | 6 +- core/direct-rpc-server/Cargo.toml | 2 +- core/offchain-worker-executor/Cargo.toml | 4 +- .../block-import-dispatcher/Cargo.toml | 2 +- core/parentchain/block-importer/Cargo.toml | 2 +- .../indirect-calls-executor/Cargo.toml | 6 +- core/parentchain/light-client/Cargo.toml | 14 +- core/parentchain/light-client/src/finality.rs | 4 +- .../light-client/src/justification.rs | 4 +- core/parentchain/light-client/src/lib.rs | 4 +- .../src/light_client_init_params.rs | 2 +- .../src/light_validation_state.rs | 2 +- core/parentchain/light-client/src/state.rs | 2 +- core/parentchain/parentchain-crate/Cargo.toml | 2 +- core/parentchain/test/Cargo.toml | 12 +- core/rpc-server/Cargo.toml | 2 +- core/tls-websocket-server/Cargo.toml | 2 +- docker/demo-sidechain.yml | 4 +- docker/demo-teeracle.yml | 2 +- docker/docker-compose.yml | 6 +- docker/entrypoint.sh | 25 + enclave-runtime/Cargo.lock | 793 +++++---- enclave-runtime/Cargo.toml | 10 +- enclave-runtime/src/test/evm_pallet_tests.rs | 8 +- enclave-runtime/src/top_pool_execution.rs | 4 +- local-setup/py/worker.py | 4 + service/Cargo.toml | 22 +- service/src/account_funding.rs | 14 +- service/src/main.rs | 50 +- service/src/parentchain_handler.rs | 9 +- service/src/prometheus_metrics.rs | 6 +- .../src/tests/mocks/parentchain_api_mock.rs | 2 +- sidechain/block-composer/Cargo.toml | 4 +- sidechain/block-verification/Cargo.toml | 10 +- sidechain/consensus/aura/Cargo.toml | 8 +- .../consensus/aura/src/block_importer.rs | 13 + sidechain/consensus/common/Cargo.toml | 4 +- sidechain/consensus/slots/Cargo.toml | 6 +- sidechain/primitives/Cargo.toml | 8 +- sidechain/rpc-handler/Cargo.toml | 2 +- sidechain/state/Cargo.toml | 8 +- sidechain/state/src/impls.rs | 9 +- sidechain/storage/Cargo.toml | 2 +- sidechain/test/Cargo.toml | 2 +- sidechain/validateer-fetch/Cargo.toml | 8 +- 92 files changed, 1679 insertions(+), 1394 deletions(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index d0f58ca51b..6e05f5cf24 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -251,7 +251,7 @@ jobs: echo "PROJECT=${{ matrix.flavor_id }}-${{ matrix.demo_name }}" >> $GITHUB_ENV echo "VERSION=dev.$version" >> $GITHUB_ENV echo "WORKER_IMAGE_TAG=integritee-worker:dev.$version" >> $GITHUB_ENV - echo "INTEGRITEE_NODE=integritee-node-dev-ias:1.0.35.$version" >> $GITHUB_ENV + echo "INTEGRITEE_NODE=integritee-node-dev-ias:1.0.36.$version" >> $GITHUB_ENV echo "CLIENT_IMAGE_TAG=integritee-cli:dev.$version" >> $GITHUB_ENV if [[ ${{ matrix.sgx_mode }} == 'HW' ]]; then echo "SGX_PROVISION=/dev/sgx/provision" >> $GITHUB_ENV @@ -296,8 +296,8 @@ jobs: fi docker tag integritee-worker-${{ matrix.flavor_id }}-${{ github.sha }} ${{ env.WORKER_IMAGE_TAG }} docker tag integritee-cli-client-${{ matrix.flavor_id }}-${{ github.sha }} ${{ env.CLIENT_IMAGE_TAG }} - docker pull integritee/integritee-node-dev-ias:1.0.35 - docker tag integritee/integritee-node-dev-ias:1.0.35 ${{ env.INTEGRITEE_NODE }} + docker pull integritee/integritee-node-dev-ias:1.0.36 + docker tag integritee/integritee-node-dev-ias:1.0.36 ${{ env.INTEGRITEE_NODE }} docker images --all ## diff --git a/Cargo.lock b/Cargo.lock index c8a14a29d8..df7c526375 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -9,16 +9,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" dependencies = [ "lazy_static", - "regex 1.8.1", + "regex 1.8.4", ] [[package]] name = "ac-compose-macros" version = "0.2.3" -source = "git+https://github.com/scs/substrate-api-client.git?branch=polkadot-v0.9.39#d872c2ca4328a30222e4d470c8fc4921abad9f34" +source = "git+https://github.com/scs/substrate-api-client.git?branch=polkadot-v0.9.42-tag-v0.10.0#686b7ef0aa8da255d3864a3fc703e32193813700" dependencies = [ "ac-primitives", - "log 0.4.17", + "log 0.4.19", "parity-scale-codec", "sp-application-crypto", "sp-core", @@ -28,7 +28,7 @@ dependencies = [ [[package]] name = "ac-node-api" version = "0.2.3" -source = "git+https://github.com/scs/substrate-api-client.git?branch=polkadot-v0.9.39#d872c2ca4328a30222e4d470c8fc4921abad9f34" +source = "git+https://github.com/scs/substrate-api-client.git?branch=polkadot-v0.9.42-tag-v0.10.0#686b7ef0aa8da255d3864a3fc703e32193813700" dependencies = [ "ac-primitives", "bitvec", @@ -36,10 +36,10 @@ dependencies = [ "either", "frame-metadata 15.1.0 (git+https://github.com/paritytech/frame-metadata)", "hex", - "log 0.4.17", + "log 0.4.19", "parity-scale-codec", "scale-info", - "serde 1.0.163", + "serde 1.0.164", "serde_json 1.0.96", "sp-application-crypto", "sp-core", @@ -50,7 +50,7 @@ dependencies = [ [[package]] name = "ac-primitives" version = "0.5.0" -source = "git+https://github.com/scs/substrate-api-client.git?branch=polkadot-v0.9.39#d872c2ca4328a30222e4d470c8fc4921abad9f34" +source = "git+https://github.com/scs/substrate-api-client.git?branch=polkadot-v0.9.42-tag-v0.10.0#686b7ef0aa8da255d3864a3fc703e32193813700" dependencies = [ "frame-system", "hex", @@ -62,12 +62,13 @@ dependencies = [ "parity-scale-codec", "primitive-types", "scale-info", - "serde 1.0.163", + "serde 1.0.164", "serde_json 1.0.96", "sp-core", "sp-runtime", "sp-staking", "sp-version", + "sp-weights", ] [[package]] @@ -131,8 +132,8 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" dependencies = [ - "getrandom 0.2.9", - "once_cell 1.17.1", + "getrandom 0.2.10", + "once_cell 1.18.0", "version_check", ] @@ -143,8 +144,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" dependencies = [ "cfg-if 1.0.0", - "getrandom 0.2.9", - "once_cell 1.17.1", + "getrandom 0.2.10", + "once_cell 1.18.0", "version_check", ] @@ -159,13 +160,19 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67fc08ce920c31afb70f013dcce1bfc3a3195de6a228474e45e1f145b36f8d04" +checksum = "43f6cb1bf222025340178f382c426f13757b2960e89779dfcb319c32542a5a41" dependencies = [ "memchr 2.5.0", ] +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + [[package]] name = "android_system_properties" version = "0.1.5" @@ -234,9 +241,9 @@ checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" [[package]] name = "arrayvec" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" +checksum = "8868f09ff8cea88b079da74ae569d9b8c62a23c68c746240b704ee6f7525c89c" [[package]] name = "async-trait" @@ -246,7 +253,7 @@ checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] @@ -298,15 +305,15 @@ dependencies = [ "cfg-if 1.0.0", "libc", "miniz_oxide 0.6.2", - "object 0.30.3", + "object 0.30.4", "rustc-demangle", ] [[package]] name = "base16ct" -version = "0.1.1" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" [[package]] name = "base58" @@ -346,9 +353,9 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.21.0" +version = "0.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a" +checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" [[package]] name = "base64ct" @@ -362,16 +369,16 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3a8241f3ebb85c056b509d4327ad0358fbbba6ffb340bf388f26350aeda225b1" dependencies = [ - "serde 1.0.163", + "serde 1.0.164", ] [[package]] name = "binary-merkle-tree" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ - "hash-db", - "log 0.4.17", + "hash-db 0.16.0", + "log 0.4.19", ] [[package]] @@ -380,7 +387,7 @@ version = "1.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" dependencies = [ - "serde 1.0.163", + "serde 1.0.164", ] [[package]] @@ -397,7 +404,7 @@ dependencies = [ "peeking_take_while", "proc-macro2", "quote", - "regex 1.8.1", + "regex 1.8.4", "rustc-hash", "shlex", ] @@ -432,7 +439,7 @@ version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" dependencies = [ - "digest 0.10.6", + "digest 0.10.7", ] [[package]] @@ -442,7 +449,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5d6d530bdd2d52966a6d03b7a964add7ae1a288d25214066fd4b600f0f796400" dependencies = [ "arrayvec 0.4.12", - "constant_time_eq", + "constant_time_eq 0.1.5", +] + +[[package]] +name = "blake2b_simd" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c2f0dc9a68c6317d884f97cc36cf5a3d20ba14ce404227df55e1af708ab04bc" +dependencies = [ + "arrayref", + "arrayvec 0.7.3", + "constant_time_eq 0.2.6", ] [[package]] @@ -496,14 +514,14 @@ dependencies = [ [[package]] name = "bounded-collections" -version = "0.1.7" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07fbd1d11282a1eb134d3c3b7cf8ce213b5161c6e5f73fb1b98618482c606b64" +checksum = "eb5b05133427c07c4776906f673ccf36c21b102c9829c641a5b56bd151d44fd6" dependencies = [ - "log 0.4.17", + "log 0.4.19", "parity-scale-codec", "scale-info", - "serde 1.0.163", + "serde 1.0.164", ] [[package]] @@ -514,12 +532,12 @@ checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" [[package]] name = "bstr" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d4260bcc2e8fc9df1eac4919a720effeb63a3f0952f5bf4944adfa18897f09" +checksum = "a246e68bb43f6cd9db24bea052a53e40405417c5fb372e3d1a8a7f770a564ef5" dependencies = [ "memchr 2.5.0", - "serde 1.0.163", + "serde 1.0.164", ] [[package]] @@ -533,9 +551,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.12.2" +version = "3.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c6ed94e98ecff0c12dd1b04c15ec0d7d9458ca8fe806cea6f12954efe74c63b" +checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" [[package]] name = "byte-slice-cast" @@ -605,7 +623,7 @@ version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c530edf18f37068ac2d977409ed5cd50d53d73bc653c7647b48eb78976ac9ae2" dependencies = [ - "serde 1.0.163", + "serde 1.0.164", ] [[package]] @@ -614,7 +632,7 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cbdb825da8a5df079a43676dbe042702f1707b1109f713a01420fbb4cc71fa27" dependencies = [ - "serde 1.0.163", + "serde 1.0.164", ] [[package]] @@ -626,7 +644,7 @@ dependencies = [ "camino", "cargo-platform", "semver 1.0.17", - "serde 1.0.163", + "serde 1.0.164", "serde_json 1.0.96", "thiserror 1.0.40", ] @@ -682,15 +700,15 @@ dependencies = [ [[package]] name = "chrono" -version = "0.4.24" +version = "0.4.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e3c5919066adf22df73762e50cffcde3a758f2a848b113b586d1f86728b673b" +checksum = "ec837a71355b28f6556dbd569b37b3f363091c0bd4b2e735674521b4c5fd9bc5" dependencies = [ + "android-tzdata", "iana-time-zone", "js-sys", - "num-integer 0.1.45", "num-traits 0.2.15", - "serde 1.0.163", + "serde 1.0.164", "time", "wasm-bindgen", "winapi 0.3.9", @@ -708,13 +726,13 @@ dependencies = [ [[package]] name = "claims-primitives" version = "0.1.0" -source = "git+https://github.com/integritee-network/pallets.git?branch=polkadot-v0.9.39#4239d3defa20c3fbd13966f62ce85e9a407bd7bf" +source = "git+https://github.com/integritee-network/pallets.git?branch=polkadot-v0.9.42#be26e6b85f14896860ef919488e6bb4cf4b7aa29" dependencies = [ "parity-scale-codec", "rustc-hex", "scale-info", - "serde 1.0.163", - "sp-io 7.0.0 (git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39)", + "serde 1.0.164", + "sp-io 7.0.0 (git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42)", "sp-runtime", "sp-std", ] @@ -757,7 +775,7 @@ dependencies = [ "clap_derive", "clap_lex", "indexmap 1.9.3", - "once_cell 1.17.1", + "once_cell 1.18.0", "strsim 0.10.0", "termcolor", "textwrap 0.16.0", @@ -813,7 +831,7 @@ dependencies = [ [[package]] name = "common-primitives" version = "0.1.0" -source = "git+https://github.com/integritee-network/pallets.git?branch=polkadot-v0.9.39#4239d3defa20c3fbd13966f62ce85e9a407bd7bf" +source = "git+https://github.com/integritee-network/pallets.git?branch=polkadot-v0.9.42#be26e6b85f14896860ef919488e6bb4cf4b7aa29" dependencies = [ "sp-std", ] @@ -830,6 +848,12 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" +[[package]] +name = "constant_time_eq" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21a53c0a4d288377e7415b53dcfc3c04da5cdc2cc95c8d5ac178b58f0b861ad6" + [[package]] name = "convert_case" version = "0.4.0" @@ -876,7 +900,7 @@ version = "0.93.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f42ea692c7b450ad18b8c9889661505d51c09ec4380cf1c2d278dbb2da22cae1" dependencies = [ - "serde 1.0.163", + "serde 1.0.164", ] [[package]] @@ -911,22 +935,22 @@ dependencies = [ [[package]] name = "crossbeam-epoch" -version = "0.9.14" +version = "0.9.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46bd5f3f85273295a9d14aedfb86f6aadbff6d8f5295c4a9edb08e819dcf5695" +checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" dependencies = [ "autocfg 1.1.0", "cfg-if 1.0.0", "crossbeam-utils", - "memoffset 0.8.0", + "memoffset 0.9.0", "scopeguard", ] [[package]] name = "crossbeam-utils" -version = "0.8.15" +version = "0.8.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c063cd8cc95f5c377ed0d4b49a4b21f632396ff690e8470c29b3359b346984b" +checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" dependencies = [ "cfg-if 1.0.0", ] @@ -939,9 +963,9 @@ checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] name = "crypto-bigint" -version = "0.4.9" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef2b4b23cddf68b89b8f8069890e8c270d54e2d5fe1b143820234805e4cb17ef" +checksum = "cf4c2f4e1afd912bc40bfd6fed5d9dc1f288e0ba01bfcc835cc5bc3eb13efe15" dependencies = [ "generic-array 0.14.7", "rand_core 0.6.4", @@ -1016,9 +1040,9 @@ dependencies = [ [[package]] name = "cxx" -version = "1.0.94" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f61f1b6389c3fe1c316bf8a4dccc90a38208354b330925bce1f74a6c4756eb93" +checksum = "109308c20e8445959c2792e81871054c6a17e6976489a93d2769641a2ba5839c" dependencies = [ "cc", "cxxbridge-flags", @@ -1028,41 +1052,41 @@ dependencies = [ [[package]] name = "cxx-build" -version = "1.0.94" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12cee708e8962df2aeb38f594aae5d827c022b6460ac71a7a3e2c3c2aae5a07b" +checksum = "daf4c6755cdf10798b97510e0e2b3edb9573032bd9379de8fffa59d68165494f" dependencies = [ "cc", "codespan-reporting", - "once_cell 1.17.1", + "once_cell 1.18.0", "proc-macro2", "quote", "scratch", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] name = "cxxbridge-flags" -version = "1.0.94" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7944172ae7e4068c533afbb984114a56c46e9ccddda550499caa222902c7f7bb" +checksum = "882074421238e84fe3b4c65d0081de34e5b323bf64555d3e61991f76eb64a7bb" [[package]] name = "cxxbridge-macro" -version = "1.0.94" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2345488264226bf682893e25de0769f3360aac9957980ec49361b083ddaa5bc5" +checksum = "4a076022ece33e7686fb76513518e219cca4fce5750a8ae6d1ce6c0f48fd1af9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] name = "data-encoding" -version = "2.3.3" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23d8666cb01533c39dde32bcbab8e227b4ed6679b2c925eba05feabea39508fb" +checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" [[package]] name = "der" @@ -1073,6 +1097,15 @@ dependencies = [ "const-oid", "der_derive", "flagset", +] + +[[package]] +name = "der" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56acb310e15652100da43d130af8d97b509e95af61aab1c5a7939ef24337ee17" +dependencies = [ + "const-oid", "zeroize", ] @@ -1147,11 +1180,12 @@ dependencies = [ [[package]] name = "digest" -version = "0.10.6" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer 0.10.4", + "const-oid", "crypto-common", "subtle", ] @@ -1217,14 +1251,16 @@ checksum = "68b0cf012f1230e43cd00ebb729c6bb58707ecfa8ad08b52ef3a4ccd2697fc30" [[package]] name = "ecdsa" -version = "0.14.8" +version = "0.16.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "413301934810f597c1d19ca71c8710e99a3f1ba28a0d2ebc01551a2daeea3c5c" +checksum = "0997c976637b606099b9985693efa3581e84e41f5c11ba5255f88711058ad428" dependencies = [ - "der", + "der 0.7.6", + "digest 0.10.7", "elliptic-curve", "rfc6979", - "signature", + "signature 2.1.0", + "spki 0.7.2", ] [[package]] @@ -1233,7 +1269,7 @@ version = "1.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "91cff35c70bba8a626e3185d8cd48cc11b5437e1a5bcd15b9b5fa3c64b6dfee7" dependencies = [ - "signature", + "signature 1.6.4", ] [[package]] @@ -1270,17 +1306,17 @@ checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" [[package]] name = "elliptic-curve" -version = "0.12.3" +version = "0.13.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7bb888ab5300a19b8e5bceef25ac745ad065f3c9f7efc6de1b91958110891d3" +checksum = "968405c8fdc9b3bf4df0a6638858cc0b52462836ab6b1c87377785dd09cf1c0b" dependencies = [ "base16ct", "crypto-bigint", - "der", - "digest 0.10.6", + "digest 0.10.7", "ff", "generic-array 0.14.7", "group", + "pkcs8", "rand_core 0.6.4", "sec1", "subtle", @@ -1304,8 +1340,8 @@ checksum = "a12e6657c4c97ebab115a42dcee77225f7f482cdd841cf7088c657a42e9e00e7" dependencies = [ "atty", "humantime", - "log 0.4.17", - "regex 1.8.1", + "log 0.4.19", + "regex 1.8.4", "termcolor", ] @@ -1317,8 +1353,8 @@ checksum = "85cdab6a89accf66733ad5a1693a4dcced6aeff64602b634530dd73c1f3ee9f0" dependencies = [ "humantime", "is-terminal", - "log 0.4.17", - "regex 1.8.1", + "log 0.4.19", + "regex 1.8.4", "termcolor", ] @@ -1379,12 +1415,12 @@ checksum = "6a89fb87a9e103f71b903b80b670200b54cc67a07578f070681f1fffb7396fb7" dependencies = [ "bytes 1.4.0", "ethereum-types", - "hash-db", + "hash-db 0.15.2", "hash256-std-hasher", "parity-scale-codec", "rlp", "scale-info", - "serde 1.0.163", + "serde 1.0.164", "sha3", "triehash", ] @@ -1407,9 +1443,9 @@ dependencies = [ [[package]] name = "evm" -version = "0.37.0" +version = "0.39.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4448c65b71e8e2b9718232d84d09045eeaaccb2320494e6bd6dbf7e58fec8ff" +checksum = "a49a4e11987c51220aa89dbe1a5cc877f5079fa6864c0a5b4533331db44e9365" dependencies = [ "auto_impl", "environmental 1.1.4", @@ -1417,32 +1453,32 @@ dependencies = [ "evm-core", "evm-gasometer", "evm-runtime", - "log 0.4.17", + "log 0.4.19", "parity-scale-codec", "primitive-types", "rlp", "scale-info", - "serde 1.0.163", + "serde 1.0.164", "sha3", ] [[package]] name = "evm-core" -version = "0.37.0" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64c51bec0eb68a891c2575c758eaaa1d61373fc51f7caaf216b1fb5c3fea3b5d" +checksum = "4f1f13264b044cb66f0602180f0bc781c29accb41ff560669a3ec15858d5b606" dependencies = [ "parity-scale-codec", "primitive-types", "scale-info", - "serde 1.0.163", + "serde 1.0.164", ] [[package]] name = "evm-gasometer" -version = "0.37.0" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8b93c59c54fc26522d842f0e0d3f8e8be331c776df18ff3e540b53c2f64d509" +checksum = "8d43eadc395bd1a52990787ca1495c26b0248165444912be075c28909a853b8c" dependencies = [ "environmental 1.1.4", "evm-core", @@ -1452,9 +1488,9 @@ dependencies = [ [[package]] name = "evm-runtime" -version = "0.37.0" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c79b9459ce64f1a28688397c4013764ce53cd57bb84efc16b5187fa9b05b13ad" +checksum = "2aa5b32f59ec582a5651978004e5c784920291263b7dcb6de418047438e37f4f" dependencies = [ "auto_impl", "environmental 1.1.4", @@ -1463,6 +1499,19 @@ dependencies = [ "sha3", ] +[[package]] +name = "expander" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f360349150728553f92e4c997a16af8915f418d3a0f21b440d34c5632f16ed84" +dependencies = [ + "blake2", + "fs-err", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "failure" version = "0.1.8" @@ -1508,9 +1557,9 @@ dependencies = [ [[package]] name = "ff" -version = "0.12.1" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d013fc25338cc558c5c2cfbad646908fb23591e2404481826742b651c9af7160" +checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" dependencies = [ "rand_core 0.6.4", "subtle", @@ -1537,7 +1586,7 @@ dependencies = [ "either", "futures 0.3.28", "futures-timer", - "log 0.4.17", + "log 0.4.19", "num-traits 0.2.15", "parity-scale-codec", "parking_lot 0.12.1", @@ -1620,27 +1669,27 @@ dependencies = [ [[package]] name = "form_urlencoded" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" +checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" dependencies = [ - "percent-encoding 2.2.0", + "percent-encoding 2.3.0", ] [[package]] name = "fp-account" version = "1.0.0-dev" -source = "git+https://github.com/integritee-network/frontier.git?branch=polkadot-v0.9.39#3297c466619934d462e0b845c1ab1e81906dcb18" +source = "git+https://github.com/integritee-network/frontier.git?branch=bar/polkadot-v0.9.42#a5a5e1e6ec08cd542a6084c310863150fb8841b1" dependencies = [ "hex", "impl-serde", "libsecp256k1", - "log 0.4.17", + "log 0.4.19", "parity-scale-codec", "scale-info", - "serde 1.0.163", + "serde 1.0.164", "sp-core", - "sp-io 7.0.0 (git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39)", + "sp-io 7.0.0 (git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42)", "sp-runtime", "sp-std", ] @@ -1648,12 +1697,13 @@ dependencies = [ [[package]] name = "fp-evm" version = "3.0.0-dev" -source = "git+https://github.com/integritee-network/frontier.git?branch=polkadot-v0.9.39#3297c466619934d462e0b845c1ab1e81906dcb18" +source = "git+https://github.com/integritee-network/frontier.git?branch=bar/polkadot-v0.9.42#a5a5e1e6ec08cd542a6084c310863150fb8841b1" dependencies = [ "evm", "frame-support", "parity-scale-codec", - "serde 1.0.163", + "scale-info", + "serde 1.0.164", "sp-core", "sp-runtime", "sp-std", @@ -1668,21 +1718,21 @@ checksum = "6c2141d6d6c8512188a7891b4b01590a45f6dac67afb4f255c4124dbb86d4eaa" [[package]] name = "frame-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "frame-support", "frame-support-procedural", "frame-system", "linregress", - "log 0.4.17", + "log 0.4.19", "parity-scale-codec", "paste", "scale-info", - "serde 1.0.163", + "serde 1.0.164", "sp-api", "sp-application-crypto", "sp-core", - "sp-io 7.0.0 (git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39)", + "sp-io 7.0.0 (git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42)", "sp-runtime", "sp-runtime-interface", "sp-std", @@ -1693,18 +1743,18 @@ dependencies = [ [[package]] name = "frame-election-provider-solution-type" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.18", ] [[package]] name = "frame-election-provider-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "frame-election-provider-solution-type", "frame-support", @@ -1721,14 +1771,14 @@ dependencies = [ [[package]] name = "frame-executive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "frame-support", "frame-system", "parity-scale-codec", "scale-info", "sp-core", - "sp-io 7.0.0 (git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39)", + "sp-io 7.0.0 (git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42)", "sp-runtime", "sp-std", "sp-tracing", @@ -1743,43 +1793,44 @@ dependencies = [ "cfg-if 1.0.0", "parity-scale-codec", "scale-info", - "serde 1.0.163", + "serde 1.0.164", ] [[package]] name = "frame-metadata" version = "15.1.0" -source = "git+https://github.com/paritytech/frame-metadata#438a5b098bb9d5b5a09bdc5b68275b2c5e63a010" +source = "git+https://github.com/paritytech/frame-metadata#0c6400964fe600ea07f8233810415f6958fe4e20" dependencies = [ "cfg-if 1.0.0", "parity-scale-codec", "scale-info", - "serde 1.0.163", + "serde 1.0.164", ] [[package]] name = "frame-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "bitflags", + "environmental 1.1.4", "frame-metadata 15.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "frame-support-procedural", "impl-trait-for-tuples", "k256", - "log 0.4.17", - "once_cell 1.17.1", + "log 0.4.19", + "once_cell 1.18.0", "parity-scale-codec", "paste", "scale-info", - "serde 1.0.163", + "serde 1.0.164", "smallvec 1.10.0", "sp-api", "sp-arithmetic", "sp-core", "sp-core-hashing-proc-macro", "sp-inherents", - "sp-io 7.0.0 (git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39)", + "sp-io 7.0.0 (git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42)", "sp-runtime", "sp-staking", "sp-state-machine", @@ -1792,52 +1843,53 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "Inflector", "cfg-expr", "derive-syn-parse", "frame-support-procedural-tools", "itertools", + "proc-macro-warning", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.18", ] [[package]] name = "frame-support-procedural-tools" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.18", ] [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.18", ] [[package]] name = "frame-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "frame-support", - "log 0.4.17", + "log 0.4.19", "parity-scale-codec", "scale-info", - "serde 1.0.163", + "serde 1.0.164", "sp-core", - "sp-io 7.0.0 (git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39)", + "sp-io 7.0.0 (git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42)", "sp-runtime", "sp-std", "sp-version", @@ -1847,7 +1899,7 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "frame-benchmarking", "frame-support", @@ -1862,12 +1914,18 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "parity-scale-codec", "sp-api", ] +[[package]] +name = "fs-err" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0845fa252299212f0389d64ba26f34fa32cfe41588355f21ed507c59a0f64541" + [[package]] name = "fuchsia-zircon" version = "0.3.3" @@ -2010,7 +2068,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] @@ -2109,6 +2167,7 @@ checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum 1.16.0 (registry+https://github.com/rust-lang/crates.io-index)", "version_check", + "zeroize", ] [[package]] @@ -2135,9 +2194,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.9" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c85e1d9ab2eadba7e5040d4e09cbd6d072b76a557ad64e797c2cb9d4da21d7e4" +checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" dependencies = [ "cfg-if 1.0.0", "libc", @@ -2175,15 +2234,15 @@ dependencies = [ "aho-corasick 0.7.20", "bstr", "fnv 1.0.7", - "log 0.4.17", - "regex 1.8.1", + "log 0.4.19", + "regex 1.8.4", ] [[package]] name = "group" -version = "0.12.1" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfbfb3a6cfbd390d5c9564ab283a0349b9b9fcd46a706c1eb10e0db70bfbac7" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ "ff", "rand_core 0.6.4", @@ -2215,6 +2274,12 @@ version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d23bd4e7b5eda0d0f3a307e8b381fdc8ba9000f26fbe912250c0a4cc3956364a" +[[package]] +name = "hash-db" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e7d7786361d7425ae2fe4f9e407eb0efaa0840f5212d109cc018c40c35c6ab4" + [[package]] name = "hash256-std-hasher" version = "0.15.2" @@ -2257,7 +2322,7 @@ dependencies = [ [[package]] name = "hashbrown_tstd" version = "0.12.0" -source = "git+https://github.com/apache/incubator-teaclave-sgx-sdk?branch=master#780dc8999477244d8ff1e6f418321adbec51ee58" +source = "git+https://github.com/apache/incubator-teaclave-sgx-sdk?branch=master#f1776a7cec1caab2959813f87bb4924805b92011" [[package]] name = "hdrhistogram" @@ -2366,7 +2431,7 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" dependencies = [ - "digest 0.10.6", + "digest 0.10.7", ] [[package]] @@ -2418,7 +2483,7 @@ name = "http_req" version = "0.8.1" source = "git+https://github.com/integritee-network/http_req?branch=master#3723e88235f2b29bc1a31835853b072ffd0455fd" dependencies = [ - "log 0.4.17", + "log 0.4.19", "rustls 0.19.1", "unicase 2.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "webpki 0.21.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2430,7 +2495,7 @@ name = "http_req" version = "0.8.1" source = "git+https://github.com/integritee-network/http_req#3723e88235f2b29bc1a31835853b072ffd0455fd" dependencies = [ - "log 0.4.17", + "log 0.4.19", "rustls 0.19.0 (git+https://github.com/mesalock-linux/rustls?branch=mesalock_sgx)", "sgx_tstd", "unicase 2.6.0 (git+https://github.com/mesalock-linux/unicase-sgx)", @@ -2510,7 +2575,7 @@ dependencies = [ "ct-logs", "futures-util 0.3.28", "hyper", - "log 0.4.17", + "log 0.4.19", "rustls 0.19.1", "rustls-native-certs", "tokio", @@ -2533,9 +2598,9 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.56" +version = "0.1.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0722cd7114b7de04316e7ea5456a0bbb20e4adb46fd27a3697adb812cff0f37c" +checksum = "2fad5b825842d2b38bd206f3e81d6957625fd7f0a361e345c30e01a0ae2dd613" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -2567,9 +2632,9 @@ dependencies = [ [[package]] name = "idna" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" +checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" dependencies = [ "unicode-bidi 0.3.13", "unicode-normalization 0.1.22", @@ -2599,7 +2664,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ebc88fc67028ae3db0c853baa36269d398d5f45b6982f95549ff5def78c935cd" dependencies = [ - "serde 1.0.163", + "serde 1.0.164", ] [[package]] @@ -2631,7 +2696,7 @@ checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ "autocfg 1.1.0", "hashbrown 0.12.3", - "serde 1.0.163", + "serde 1.0.164", ] [[package]] @@ -2665,7 +2730,7 @@ dependencies = [ "array-bytes 6.1.0", "base58", "blake2-rfc", - "chrono 0.4.24", + "chrono 0.4.26", "clap 3.2.25", "env_logger 0.9.3", "frame-system", @@ -2681,7 +2746,7 @@ dependencies = [ "itp-time-utils", "itp-types", "itp-utils", - "log 0.4.17", + "log 0.4.19", "pallet-balances", "pallet-evm", "pallet-teerex", @@ -2690,12 +2755,13 @@ dependencies = [ "rand 0.8.5", "rayon", "sc-keystore", - "serde 1.0.163", + "serde 1.0.164", "serde_json 1.0.96", "sgx_crypto_helper", "sp-application-crypto", "sp-core", "sp-keyring", + "sp-keystore", "sp-runtime", "substrate-api-client", "substrate-client-keystore", @@ -2706,8 +2772,8 @@ dependencies = [ [[package]] name = "integritee-node-runtime" -version = "1.0.32" -source = "git+https://github.com/integritee-network/integritee-node.git?branch=polkadot-v0.9.39#89f8cc939c719025cd57379a007b7f36a58bdd29" +version = "1.0.33" +source = "git+https://github.com/integritee-network/integritee-node.git?branch=polkadot-v0.9.42#2c13d1fd5708825b7832b6b1bc33448ca3111514" dependencies = [ "frame-executive", "frame-support", @@ -2786,7 +2852,7 @@ dependencies = [ "its-test", "jsonrpsee", "lazy_static", - "log 0.4.17", + "log 0.4.19", "mockall", "pallet-balances", "parity-scale-codec", @@ -2795,16 +2861,16 @@ dependencies = [ "primitive-types", "prometheus", "scale-info", - "serde 1.0.163", - "serde_derive 1.0.163", + "serde 1.0.164", + "serde_derive 1.0.164", "serde_json 1.0.96", "sgx-verify", "sgx_crypto_helper", "sgx_types", "sgx_urts", "sha2 0.7.1", + "sp-consensus-grandpa", "sp-core", - "sp-finality-grandpa", "sp-keyring", "sp-runtime", "substrate-api-client", @@ -2816,9 +2882,9 @@ dependencies = [ [[package]] name = "io-lifetimes" -version = "1.0.10" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c66c74d2ae7e79a5a8f7ac924adbe38ee42a859c6539ad869eb51f0b52dc220" +checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" dependencies = [ "hermit-abi 0.3.1", "libc", @@ -2857,7 +2923,7 @@ dependencies = [ "hyper-multipart-rfc7578", "hyper-tls", "parity-multiaddr", - "serde 1.0.163", + "serde 1.0.164", "serde_json 1.0.96", "serde_urlencoded", "tokio", @@ -2875,7 +2941,7 @@ checksum = "adcf93614601c8129ddf72e2d5633df827ba6551541c6d8c59520a371475be1f" dependencies = [ "hermit-abi 0.3.1", "io-lifetimes", - "rustix 0.37.19", + "rustix 0.37.20", "windows-sys 0.48.0", ] @@ -2887,16 +2953,16 @@ dependencies = [ "itp-enclave-metrics", "itp-ocall-api", "lazy_static", - "log 0.4.17", + "log 0.4.19", "parity-scale-codec", - "serde 1.0.163", + "serde 1.0.164", "serde_json 1.0.96", "sgx_tstd", "substrate-fixed", "thiserror 1.0.40", "thiserror 1.0.9", "url 2.1.1", - "url 2.3.1", + "url 2.4.0", ] [[package]] @@ -2923,7 +2989,7 @@ dependencies = [ "pallet-transaction-payment-rpc-runtime-api", "parity-scale-codec", "scale-info", - "serde 1.0.163", + "serde 1.0.164", "sp-api", "sp-block-builder", "sp-consensus-aura", @@ -2956,7 +3022,7 @@ dependencies = [ "itp-storage", "itp-types", "itp-utils", - "log 0.4.17", + "log 0.4.19", "pallet-balances", "pallet-parentchain", "pallet-sudo", @@ -2981,7 +3047,7 @@ dependencies = [ "itp-utils", "jsonrpc-core 18.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-core 18.0.0 (git+https://github.com/scs/jsonrpc?branch=no_std_v18)", - "log 0.4.17", + "log 0.4.19", "parity-scale-codec", "serde_json 1.0.96", "sgx_tstd", @@ -3006,7 +3072,7 @@ dependencies = [ "itp-test", "itp-top-pool-author", "itp-types", - "log 0.4.17", + "log 0.4.19", "parity-scale-codec", "sgx_tstd", "sgx_types", @@ -3037,7 +3103,7 @@ dependencies = [ "itc-parentchain-block-importer", "itp-import-queue", "itp-types", - "log 0.4.17", + "log 0.4.19", "sgx_tstd", "sgx_types", "sp-runtime", @@ -3056,7 +3122,7 @@ dependencies = [ "itp-settings", "itp-stf-executor", "itp-types", - "log 0.4.17", + "log 0.4.19", "parity-scale-codec", "sgx_tstd", "sgx_types", @@ -3085,7 +3151,7 @@ dependencies = [ "itp-test", "itp-top-pool-author", "itp-types", - "log 0.4.17", + "log 0.4.19", "parity-scale-codec", "sgx_tstd", "sgx_types", @@ -3102,7 +3168,7 @@ dependencies = [ "derive_more", "finality-grandpa", "frame-system", - "hash-db", + "hash-db 0.15.2", "itc-parentchain-test", "itp-ocall-api", "itp-sgx-io", @@ -3111,14 +3177,14 @@ dependencies = [ "itp-test", "itp-types", "lazy_static", - "log 0.4.17", + "log 0.4.19", "num-traits 0.2.15", "parity-scale-codec", "sgx_tstd", "sgx_types", "sp-application-crypto", + "sp-consensus-grandpa", "sp-core", - "sp-finality-grandpa", "sp-runtime", "sp-trie", "thiserror 1.0.40", @@ -3132,12 +3198,12 @@ dependencies = [ "frame-support", "frame-system", "itp-types", - "log 0.4.17", + "log 0.4.19", "parity-scale-codec", "scale-info", - "serde 1.0.163", + "serde 1.0.164", "sp-core", - "sp-io 7.0.0 (git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39)", + "sp-io 7.0.0 (git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42)", "sp-runtime", "sp-std", ] @@ -3151,15 +3217,15 @@ dependencies = [ "http 0.2.9", "http_req 0.8.1 (git+https://github.com/integritee-network/http_req?branch=master)", "http_req 0.8.1 (git+https://github.com/integritee-network/http_req)", - "log 0.4.17", - "serde 1.0.163", + "log 0.4.19", + "serde 1.0.164", "serde_json 1.0.96", "sgx_tstd", "sgx_types", "thiserror 1.0.40", "thiserror 1.0.9", "url 2.1.1", - "url 2.3.1", + "url 2.4.0", ] [[package]] @@ -3174,16 +3240,16 @@ dependencies = [ "itp-rpc", "itp-types", "itp-utils", - "log 0.4.17", + "log 0.4.19", "openssl", "parity-scale-codec", "parking_lot 0.12.1", "rustls 0.19.1", - "serde_derive 1.0.163", + "serde_derive 1.0.164", "serde_json 1.0.96", "sgx_crypto_helper", "thiserror 1.0.40", - "url 2.3.1", + "url 2.4.0", "ws", ] @@ -3202,7 +3268,7 @@ dependencies = [ "its-storage", "its-test", "jsonrpsee", - "log 0.4.17", + "log 0.4.19", "parity-scale-codec", "serde_json 1.0.96", "sp-core", @@ -3214,9 +3280,9 @@ name = "itc-tls-websocket-server" version = "0.9.0" dependencies = [ "bit-vec", - "chrono 0.4.24", + "chrono 0.4.26", "env_logger 0.9.3", - "log 0.4.17", + "log 0.4.19", "mio 0.6.21", "mio 0.6.23", "mio-extras 2.0.6 (git+https://github.com/integritee-network/mio-extras-sgx?rev=963234b)", @@ -3231,7 +3297,7 @@ dependencies = [ "thiserror 1.0.9", "tungstenite 0.14.0", "tungstenite 0.15.0", - "url 2.3.1", + "url 2.4.0", "webpki 0.21.4 (registry+https://github.com/rust-lang/crates.io-index)", "webpki 0.21.4 (git+https://github.com/mesalock-linux/webpki?branch=mesalock_sgx)", "yasna 0.3.1", @@ -3268,8 +3334,8 @@ dependencies = [ "itp-api-client-types", "itp-types", "parity-scale-codec", + "sp-consensus-grandpa", "sp-core", - "sp-finality-grandpa", "sp-runtime", "substrate-api-client", "thiserror 1.0.40", @@ -3290,12 +3356,12 @@ dependencies = [ name = "itp-attestation-handler" version = "0.8.0" dependencies = [ - "arrayvec 0.7.2", + "arrayvec 0.7.3", "base64 0.13.0 (git+https://github.com/mesalock-linux/rust-base64-sgx?rev=sgx_1.1.3)", "base64 0.13.1", "bit-vec", "chrono 0.4.11", - "chrono 0.4.24", + "chrono 0.4.26", "hex", "httparse 1.4.1", "itertools", @@ -3305,7 +3371,7 @@ dependencies = [ "itp-sgx-io", "itp-time-utils", "itp-types", - "log 0.4.17", + "log 0.4.19", "num-bigint 0.2.5", "parity-scale-codec", "rustls 0.19.0 (git+https://github.com/mesalock-linux/rustls?rev=sgx_1.1.3)", @@ -3347,14 +3413,14 @@ dependencies = [ "itp-settings", "itp-storage", "itp-types", - "log 0.4.17", + "log 0.4.19", "parity-scale-codec", "serde_json 1.0.96", "sgx_crypto_helper", "sgx_types", "sgx_urts", + "sp-consensus-grandpa", "sp-core", - "sp-finality-grandpa", "sp-runtime", "teerex-primitives", "thiserror 1.0.40", @@ -3383,7 +3449,7 @@ dependencies = [ "itp-node-api", "itp-nonce-cache", "itp-types", - "log 0.4.17", + "log 0.4.19", "parity-scale-codec", "sgx_tstd", "sgx_types", @@ -3498,7 +3564,7 @@ version = "0.9.0" dependencies = [ "itp-types", "parity-scale-codec", - "serde 1.0.163", + "serde 1.0.164", "serde_json 1.0.96", "sgx_tstd", ] @@ -3516,11 +3582,11 @@ dependencies = [ "itp-settings", "itp-sgx-io", "itp-sgx-temp-dir", - "log 0.4.17", + "log 0.4.19", "ofb", "parity-scale-codec", "serde 1.0.118 (git+https://github.com/mesalock-linux/serde-sgx?tag=sgx_1.1.3)", - "serde 1.0.163", + "serde 1.0.164", "serde_json 1.0.60 (git+https://github.com/mesalock-linux/serde-json-sgx?tag=sgx_1.1.3)", "serde_json 1.0.96", "sgx_crypto_helper", @@ -3537,10 +3603,10 @@ dependencies = [ "derive_more", "environmental 1.1.3", "itp-hashing", - "log 0.4.17", + "log 0.4.19", "parity-scale-codec", "postcard", - "serde 1.0.163", + "serde 1.0.164", "sgx_tstd", "sp-core", ] @@ -3590,7 +3656,7 @@ dependencies = [ "itp-time-utils", "itp-top-pool-author", "itp-types", - "log 0.4.17", + "log 0.4.19", "parity-scale-codec", "sgx_crypto_helper", "sgx_tstd", @@ -3635,7 +3701,7 @@ dependencies = [ "itp-time-utils", "itp-types", "lazy_static", - "log 0.4.17", + "log 0.4.19", "parity-scale-codec", "rust-base58 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", "rust-base58 0.0.4 (git+https://github.com/mesalock-linux/rust-base58-sgx?rev=sgx_1.1.3)", @@ -3652,7 +3718,7 @@ name = "itp-stf-state-observer" version = "0.9.0" dependencies = [ "itp-types", - "log 0.4.17", + "log 0.4.19", "parity-scale-codec", "sgx_tstd", "thiserror 1.0.40", @@ -3666,7 +3732,7 @@ dependencies = [ "derive_more", "frame-metadata 15.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "frame-support", - "hash-db", + "hash-db 0.15.2", "itp-types", "parity-scale-codec", "sgx_tstd", @@ -3734,10 +3800,10 @@ dependencies = [ "jsonrpc-core 18.0.0 (git+https://github.com/scs/jsonrpc?branch=no_std_v18)", "linked-hash-map 0.5.2", "linked-hash-map 0.5.6", - "log 0.4.17", + "log 0.4.19", "parity-scale-codec", "parity-util-mem", - "serde 1.0.163", + "serde 1.0.164", "sgx_tstd", "sgx_types", "sp-application-crypto", @@ -3765,7 +3831,7 @@ dependencies = [ "itp-utils", "jsonrpc-core 18.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-core 18.0.0 (git+https://github.com/scs/jsonrpc?branch=no_std_v18)", - "log 0.4.17", + "log 0.4.19", "parity-scale-codec", "sgx_crypto_helper", "sgx_tstd", @@ -3781,14 +3847,14 @@ dependencies = [ name = "itp-types" version = "0.9.0" dependencies = [ - "chrono 0.4.24", + "chrono 0.4.26", "frame-system", "integritee-node-runtime", "itp-sgx-runtime-primitives", "pallet-balances", "parity-scale-codec", "primitive-types", - "serde 1.0.163", + "serde 1.0.164", "serde_json 1.0.96", "sp-core", "sp-runtime", @@ -3824,7 +3890,7 @@ dependencies = [ "itp-types", "its-primitives", "its-state", - "log 0.4.17", + "log 0.4.19", "parity-scale-codec", "sgx_tstd", "sgx_types", @@ -3844,7 +3910,7 @@ dependencies = [ "itp-utils", "its-primitives", "its-test", - "log 0.4.17", + "log 0.4.19", "sgx_tstd", "sp-consensus-slots", "sp-core", @@ -3885,7 +3951,7 @@ dependencies = [ "its-state", "its-test", "its-validateer-fetch", - "log 0.4.17", + "log 0.4.19", "parity-scale-codec", "sgx_tstd", "sp-core", @@ -3914,7 +3980,7 @@ dependencies = [ "its-primitives", "its-state", "its-test", - "log 0.4.17", + "log 0.4.19", "parity-scale-codec", "sgx_tstd", "sgx_types", @@ -3941,7 +4007,7 @@ dependencies = [ "its-primitives", "its-test", "lazy_static", - "log 0.4.17", + "log 0.4.19", "parity-scale-codec", "sgx_tstd", "sp-consensus-slots", @@ -3964,8 +4030,8 @@ dependencies = [ "its-storage", "its-test", "jsonrpsee", - "log 0.4.17", - "serde 1.0.163", + "log 0.4.19", + "serde 1.0.164", "serde_json 1.0.96", "thiserror 1.0.40", "tokio", @@ -3977,9 +4043,9 @@ version = "0.1.0" dependencies = [ "parity-scale-codec", "scale-info", - "serde 1.0.163", + "serde 1.0.164", "sp-core", - "sp-io 7.0.0 (git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39)", + "sp-io 7.0.0 (git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42)", "sp-runtime", "sp-std", ] @@ -3996,7 +4062,7 @@ dependencies = [ "its-primitives", "jsonrpc-core 18.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-core 18.0.0 (git+https://github.com/scs/jsonrpc?branch=no_std_v18)", - "log 0.4.17", + "log 0.4.19", "parity-scale-codec", "rust-base58 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", "rust-base58 0.0.4 (git+https://github.com/mesalock-linux/rust-base58-sgx?rev=sgx_1.1.3)", @@ -4027,9 +4093,9 @@ dependencies = [ "itp-sgx-externalities", "itp-storage", "its-primitives", - "log 0.4.17", + "log 0.4.19", "parity-scale-codec", - "serde 1.0.163", + "serde 1.0.164", "sgx_tstd", "sp-core", "sp-io 7.0.0", @@ -4048,7 +4114,7 @@ dependencies = [ "itp-types", "its-primitives", "its-test", - "log 0.4.17", + "log 0.4.19", "mockall", "parity-scale-codec", "parking_lot 0.12.1", @@ -4099,9 +4165,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.63" +version = "0.3.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f37a4a5928311ac501dee68b3c7613a1037d0edb30c8e5427bd832d55d1b790" +checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" dependencies = [ "wasm-bindgen", ] @@ -4115,9 +4181,9 @@ dependencies = [ "futures 0.3.28", "futures-executor 0.3.28", "futures-util 0.3.28", - "log 0.4.17", - "serde 1.0.163", - "serde_derive 1.0.163", + "log 0.4.19", + "serde 1.0.164", + "serde_derive 1.0.164", "serde_json 1.0.96", ] @@ -4160,11 +4226,11 @@ dependencies = [ "hyper-rustls", "jsonrpsee-types", "jsonrpsee-utils", - "log 0.4.17", - "serde 1.0.163", + "log 0.4.19", + "serde 1.0.164", "serde_json 1.0.96", "thiserror 1.0.40", - "url 2.3.1", + "url 2.4.0", ] [[package]] @@ -4180,8 +4246,8 @@ dependencies = [ "jsonrpsee-types", "jsonrpsee-utils", "lazy_static", - "log 0.4.17", - "serde 1.0.163", + "log 0.4.19", + "serde 1.0.164", "serde_json 1.0.96", "socket2", "thiserror 1.0.40", @@ -4213,8 +4279,8 @@ dependencies = [ "futures-channel 0.3.28", "futures-util 0.3.28", "hyper", - "log 0.4.17", - "serde 1.0.163", + "log 0.4.19", + "serde 1.0.164", "serde_json 1.0.96", "soketto", "thiserror 1.0.40", @@ -4230,11 +4296,11 @@ dependencies = [ "futures-util 0.3.28", "hyper", "jsonrpsee-types", - "log 0.4.17", + "log 0.4.19", "parking_lot 0.11.2", "rand 0.8.5", "rustc-hash", - "serde 1.0.163", + "serde 1.0.164", "serde_json 1.0.96", "thiserror 1.0.40", ] @@ -4249,18 +4315,18 @@ dependencies = [ "fnv 1.0.7", "futures 0.3.28", "jsonrpsee-types", - "log 0.4.17", + "log 0.4.19", "pin-project", "rustls 0.19.1", "rustls-native-certs", - "serde 1.0.163", + "serde 1.0.164", "serde_json 1.0.96", "soketto", "thiserror 1.0.40", "tokio", "tokio-rustls", "tokio-util 0.6.10", - "url 2.3.1", + "url 2.4.0", ] [[package]] @@ -4273,9 +4339,9 @@ dependencies = [ "futures-util 0.3.28", "jsonrpsee-types", "jsonrpsee-utils", - "log 0.4.17", + "log 0.4.19", "rustc-hash", - "serde 1.0.163", + "serde 1.0.164", "serde_json 1.0.96", "soketto", "thiserror 1.0.40", @@ -4286,13 +4352,14 @@ dependencies = [ [[package]] name = "k256" -version = "0.11.6" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72c1e0b51e7ec0a97369623508396067a486bd0cbed95a2659a4b863d28cfc8b" +checksum = "cadb76004ed8e97623117f3df85b17aaa6626ab0b0831e6573f104df16cd1bcc" dependencies = [ "cfg-if 1.0.0", "ecdsa", "elliptic-curve", + "once_cell 1.18.0", "sha2 0.10.6", ] @@ -4332,9 +4399,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.144" +version = "0.2.146" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b00cc1c228a6782d0f076e7b232802e0c5689d41bb5df366f2a6b6621cfdfe1" +checksum = "f92be4933c13fd498862a9e02a3055f8a8d9c039ce33db97306fd5a6caa7f29b" [[package]] name = "libloading" @@ -4378,7 +4445,7 @@ dependencies = [ "libsecp256k1-gen-ecmult", "libsecp256k1-gen-genmult", "rand 0.8.5", - "serde 1.0.163", + "serde 1.0.164", "sha2 0.9.9", "typenum 1.16.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -4452,15 +4519,15 @@ checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" [[package]] name = "linux-raw-sys" -version = "0.3.7" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ece97ea872ece730aed82664c424eb4c8291e1ff2480247ccf7409044bc6479f" +checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" [[package]] name = "lock_api" -version = "0.4.9" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" +checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" dependencies = [ "autocfg 1.1.0", "scopeguard", @@ -4486,12 +4553,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.17" +version = "0.4.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" -dependencies = [ - "cfg-if 1.0.0", -] +checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" [[package]] name = "mach" @@ -4548,7 +4612,7 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ffc89ccdc6e10d6907450f753537ebc5c5d3460d2e4e62ea74bd571db62c0f9e" dependencies = [ - "rustix 0.37.19", + "rustix 0.37.20", ] [[package]] @@ -4562,21 +4626,20 @@ dependencies = [ [[package]] name = "memoffset" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d61c719bcfbcf5d62b3a09efa6088de8c54bc0bfcd3ea7ae39fcc186108b8de1" +checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" dependencies = [ "autocfg 1.1.0", ] [[package]] name = "memory-db" -version = "0.31.0" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e0c7cba9ce19ac7ffd2053ac9f49843bbd3f4318feedfd74e85c19d5fb0ba66" +checksum = "808b50db46293432a45e63bc15ea51e0ab4c0a1647b8eb114e31a3e698dd6fbe" dependencies = [ - "hash-db", - "hashbrown 0.12.3", + "hash-db 0.16.0", ] [[package]] @@ -4663,7 +4726,7 @@ dependencies = [ "iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "kernel32-sys", "libc", - "log 0.4.17", + "log 0.4.19", "miow", "net2 0.2.38", "slab 0.4.8", @@ -4672,14 +4735,13 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.6" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b9d9a46eff5b4ff64b45a9e316a6d1e0bc719ef429cbec4dc630684212bfdf9" +checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" dependencies = [ "libc", - "log 0.4.17", "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys 0.45.0", + "windows-sys 0.48.0", ] [[package]] @@ -4689,7 +4751,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "52403fe290012ce777c4626790c8951324a2b9e3316b3143779c72b029742f19" dependencies = [ "lazycell", - "log 0.4.17", + "log 0.4.19", "mio 0.6.23", "slab 0.4.8", ] @@ -4700,7 +4762,7 @@ version = "2.0.6" source = "git+https://github.com/integritee-network/mio-extras-sgx?rev=963234b#963234bf55e44f9efff921938255126c48deef3a" dependencies = [ "lazycell", - "log 0.4.17", + "log 0.4.19", "mio 0.6.21", "mio 0.6.23", "sgx_tstd", @@ -4758,7 +4820,7 @@ dependencies = [ "futures-util 0.3.28", "http 0.2.9", "httparse 1.8.0", - "log 0.4.17", + "log 0.4.19", "memchr 2.5.0", "mime", "spin 0.9.8", @@ -4825,7 +4887,7 @@ checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" dependencies = [ "lazy_static", "libc", - "log 0.4.17", + "log 0.4.19", "openssl", "openssl-probe", "openssl-sys", @@ -5004,7 +5066,7 @@ version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a652d9771a63711fd3c3deb670acfbe5c30a4072e664d7a3bf5a9e1056ac72c3" dependencies = [ - "arrayvec 0.7.2", + "arrayvec 0.7.3", "itoa 1.0.6", ] @@ -5127,9 +5189,9 @@ dependencies = [ [[package]] name = "object" -version = "0.30.3" +version = "0.30.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea86265d3d3dcb6a27fc51bd29a4bf387fae9d2986b823079d4986af253eb439" +checksum = "03b4680b86d9cfafba8fc491dc9b6df26b68cf40e9e6cd73909194759a63c385" dependencies = [ "memchr 2.5.0", ] @@ -5153,9 +5215,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.17.1" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] name = "opaque-debug" @@ -5171,15 +5233,15 @@ checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" [[package]] name = "openssl" -version = "0.10.52" +version = "0.10.54" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01b8574602df80f7b85fdfc5392fa884a4e3b3f4f35402c070ab34c3d3f78d56" +checksum = "69b3f656a17a6cbc115b5c7a40c616947d213ba182135b014d6051b73ab6f019" dependencies = [ "bitflags", "cfg-if 1.0.0", "foreign-types", "libc", - "once_cell 1.17.1", + "once_cell 1.18.0", "openssl-macros", "openssl-sys", ] @@ -5192,7 +5254,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] @@ -5203,9 +5265,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.87" +version = "0.9.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e17f59264b2809d77ae94f0e1ebabc434773f370d6ca667bd223ea10e06cc7e" +checksum = "c2ce0f250f34a308dcfdbb351f511359857d4ed2134ba715a4eadd46e1ffd617" dependencies = [ "cc", "libc", @@ -5215,14 +5277,14 @@ dependencies = [ [[package]] name = "os_str_bytes" -version = "6.5.0" +version = "6.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ceedf44fb00f2d1984b0bc98102627ce622e083e49a5bacdb3e514fa4238e267" +checksum = "4d5d9eb14b174ee9aa2ef96dc2b94637a2d4b6e7cb873c7e171f0c20c6cf3eac" [[package]] name = "pallet-assets" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "frame-benchmarking", "frame-support", @@ -5237,7 +5299,7 @@ dependencies = [ [[package]] name = "pallet-aura" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "frame-support", "frame-system", @@ -5253,7 +5315,7 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "frame-support", "frame-system", @@ -5267,12 +5329,12 @@ dependencies = [ [[package]] name = "pallet-balances" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "log 0.4.17", + "log 0.4.19", "parity-scale-codec", "scale-info", "sp-runtime", @@ -5282,7 +5344,7 @@ dependencies = [ [[package]] name = "pallet-claims" version = "0.9.12" -source = "git+https://github.com/integritee-network/pallets.git?branch=polkadot-v0.9.39#4239d3defa20c3fbd13966f62ce85e9a407bd7bf" +source = "git+https://github.com/integritee-network/pallets.git?branch=polkadot-v0.9.42#be26e6b85f14896860ef919488e6bb4cf4b7aa29" dependencies = [ "claims-primitives", "frame-support", @@ -5290,9 +5352,9 @@ dependencies = [ "parity-scale-codec", "rustc-hex", "scale-info", - "serde 1.0.163", - "serde_derive 1.0.163", - "sp-io 7.0.0 (git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39)", + "serde 1.0.164", + "serde_derive 1.0.164", + "sp-io 7.0.0 (git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42)", "sp-runtime", "sp-std", ] @@ -5300,35 +5362,36 @@ dependencies = [ [[package]] name = "pallet-contracts" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "bitflags", + "environmental 1.1.4", "frame-benchmarking", "frame-support", "frame-system", "impl-trait-for-tuples", - "log 0.4.17", + "log 0.4.19", "pallet-contracts-primitives", "pallet-contracts-proc-macro", "parity-scale-codec", "rand 0.8.5", "scale-info", - "serde 1.0.163", + "serde 1.0.164", "smallvec 1.10.0", "sp-api", "sp-core", - "sp-io 7.0.0 (git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39)", + "sp-io 7.0.0 (git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42)", "sp-runtime", "sp-std", "wasm-instrument", - "wasmi 0.20.0", + "wasmi 0.28.0", "wasmparser-nostd", ] [[package]] name = "pallet-contracts-primitives" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "bitflags", "parity-scale-codec", @@ -5341,17 +5404,17 @@ dependencies = [ [[package]] name = "pallet-contracts-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.18", ] [[package]] name = "pallet-evm" version = "6.0.0-dev" -source = "git+https://github.com/integritee-network/frontier.git?branch=polkadot-v0.9.39#3297c466619934d462e0b845c1ab1e81906dcb18" +source = "git+https://github.com/integritee-network/frontier.git?branch=bar/polkadot-v0.9.42#a5a5e1e6ec08cd542a6084c310863150fb8841b1" dependencies = [ "environmental 1.1.4", "evm", @@ -5362,13 +5425,12 @@ dependencies = [ "frame-system", "hex", "impl-trait-for-tuples", - "log 0.4.17", - "pallet-timestamp", + "log 0.4.19", "parity-scale-codec", "rlp", "scale-info", "sp-core", - "sp-io 7.0.0 (git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39)", + "sp-io 7.0.0 (git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42)", "sp-runtime", "sp-std", ] @@ -5376,20 +5438,20 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "log 0.4.17", + "log 0.4.19", "pallet-authorship", "pallet-session", "parity-scale-codec", "scale-info", "sp-application-crypto", + "sp-consensus-grandpa", "sp-core", - "sp-finality-grandpa", - "sp-io 7.0.0 (git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39)", + "sp-io 7.0.0 (git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42)", "sp-runtime", "sp-session", "sp-staking", @@ -5399,7 +5461,7 @@ dependencies = [ [[package]] name = "pallet-insecure-randomness-collective-flip" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "frame-support", "frame-system", @@ -5413,15 +5475,15 @@ dependencies = [ [[package]] name = "pallet-multisig" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "log 0.4.17", + "log 0.4.19", "parity-scale-codec", "scale-info", - "sp-io 7.0.0 (git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39)", + "sp-io 7.0.0 (git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42)", "sp-runtime", "sp-std", ] @@ -5429,16 +5491,16 @@ dependencies = [ [[package]] name = "pallet-parentchain" version = "0.9.0" -source = "git+https://github.com/integritee-network/pallets.git?branch=polkadot-v0.9.39#4239d3defa20c3fbd13966f62ce85e9a407bd7bf" +source = "git+https://github.com/integritee-network/pallets.git?branch=polkadot-v0.9.42#be26e6b85f14896860ef919488e6bb4cf4b7aa29" dependencies = [ "frame-support", "frame-system", - "log 0.4.17", + "log 0.4.19", "parity-scale-codec", "scale-info", - "serde 1.0.163", + "serde 1.0.164", "sp-core", - "sp-io 7.0.0 (git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39)", + "sp-io 7.0.0 (git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42)", "sp-runtime", "sp-std", ] @@ -5446,14 +5508,14 @@ dependencies = [ [[package]] name = "pallet-preimage" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "frame-support", "frame-system", - "log 0.4.17", + "log 0.4.19", "parity-scale-codec", "scale-info", - "sp-io 7.0.0 (git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39)", + "sp-io 7.0.0 (git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42)", "sp-runtime", "sp-std", ] @@ -5461,14 +5523,14 @@ dependencies = [ [[package]] name = "pallet-proxy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", "parity-scale-codec", "scale-info", - "sp-io 7.0.0 (git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39)", + "sp-io 7.0.0 (git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42)", "sp-runtime", "sp-std", ] @@ -5476,15 +5538,15 @@ dependencies = [ [[package]] name = "pallet-scheduler" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "log 0.4.17", + "log 0.4.19", "parity-scale-codec", "scale-info", - "sp-io 7.0.0 (git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39)", + "sp-io 7.0.0 (git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42)", "sp-runtime", "sp-std", "sp-weights", @@ -5493,17 +5555,17 @@ dependencies = [ [[package]] name = "pallet-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "frame-support", "frame-system", "impl-trait-for-tuples", - "log 0.4.17", + "log 0.4.19", "pallet-timestamp", "parity-scale-codec", "scale-info", "sp-core", - "sp-io 7.0.0 (git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39)", + "sp-io 7.0.0 (git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42)", "sp-runtime", "sp-session", "sp-staking", @@ -5514,19 +5576,19 @@ dependencies = [ [[package]] name = "pallet-sidechain" version = "0.9.0" -source = "git+https://github.com/integritee-network/pallets.git?branch=polkadot-v0.9.39#4239d3defa20c3fbd13966f62ce85e9a407bd7bf" +source = "git+https://github.com/integritee-network/pallets.git?branch=polkadot-v0.9.42#be26e6b85f14896860ef919488e6bb4cf4b7aa29" dependencies = [ "frame-support", "frame-system", - "log 0.4.17", + "log 0.4.19", "pallet-teerex", "pallet-timestamp", "parity-scale-codec", "scale-info", - "serde 1.0.163", + "serde 1.0.164", "sidechain-primitives", "sp-core", - "sp-io 7.0.0 (git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39)", + "sp-io 7.0.0 (git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42)", "sp-runtime", "sp-std", "teerex-primitives", @@ -5535,20 +5597,20 @@ dependencies = [ [[package]] name = "pallet-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "frame-benchmarking", "frame-election-provider-support", "frame-support", "frame-system", - "log 0.4.17", + "log 0.4.19", "pallet-authorship", "pallet-session", "parity-scale-codec", "scale-info", - "serde 1.0.163", + "serde 1.0.164", "sp-application-crypto", - "sp-io 7.0.0 (git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39)", + "sp-io 7.0.0 (git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42)", "sp-runtime", "sp-staking", "sp-std", @@ -5557,13 +5619,13 @@ dependencies = [ [[package]] name = "pallet-sudo" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "frame-support", "frame-system", "parity-scale-codec", "scale-info", - "sp-io 7.0.0 (git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39)", + "sp-io 7.0.0 (git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42)", "sp-runtime", "sp-std", ] @@ -5571,16 +5633,16 @@ dependencies = [ [[package]] name = "pallet-teeracle" version = "0.1.0" -source = "git+https://github.com/integritee-network/pallets.git?branch=polkadot-v0.9.39#4239d3defa20c3fbd13966f62ce85e9a407bd7bf" +source = "git+https://github.com/integritee-network/pallets.git?branch=polkadot-v0.9.42#be26e6b85f14896860ef919488e6bb4cf4b7aa29" dependencies = [ "frame-support", "frame-system", - "log 0.4.17", + "log 0.4.19", "pallet-teerex", "parity-scale-codec", "scale-info", "sp-core", - "sp-io 7.0.0 (git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39)", + "sp-io 7.0.0 (git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42)", "sp-runtime", "sp-std", "substrate-fixed", @@ -5590,18 +5652,18 @@ dependencies = [ [[package]] name = "pallet-teerex" version = "0.9.0" -source = "git+https://github.com/integritee-network/pallets.git?branch=polkadot-v0.9.39#4239d3defa20c3fbd13966f62ce85e9a407bd7bf" +source = "git+https://github.com/integritee-network/pallets.git?branch=polkadot-v0.9.42#be26e6b85f14896860ef919488e6bb4cf4b7aa29" dependencies = [ "frame-support", "frame-system", - "log 0.4.17", + "log 0.4.19", "pallet-timestamp", "parity-scale-codec", "scale-info", - "serde 1.0.163", + "serde 1.0.164", "sgx-verify", "sp-core", - "sp-io 7.0.0 (git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39)", + "sp-io 7.0.0 (git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42)", "sp-runtime", "sp-std", "teerex-primitives", @@ -5610,16 +5672,16 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "log 0.4.17", + "log 0.4.19", "parity-scale-codec", "scale-info", "sp-inherents", - "sp-io 7.0.0 (git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39)", + "sp-io 7.0.0 (git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42)", "sp-runtime", "sp-std", "sp-timestamp", @@ -5628,15 +5690,15 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "frame-support", "frame-system", "parity-scale-codec", "scale-info", - "serde 1.0.163", + "serde 1.0.164", "sp-core", - "sp-io 7.0.0 (git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39)", + "sp-io 7.0.0 (git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42)", "sp-runtime", "sp-std", ] @@ -5644,7 +5706,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -5656,7 +5718,7 @@ dependencies = [ [[package]] name = "pallet-treasury" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "frame-benchmarking", "frame-support", @@ -5665,7 +5727,7 @@ dependencies = [ "pallet-balances", "parity-scale-codec", "scale-info", - "serde 1.0.163", + "serde 1.0.164", "sp-runtime", "sp-std", ] @@ -5673,7 +5735,7 @@ dependencies = [ [[package]] name = "pallet-utility" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "frame-benchmarking", "frame-support", @@ -5681,7 +5743,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-core", - "sp-io 7.0.0 (git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39)", + "sp-io 7.0.0 (git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42)", "sp-runtime", "sp-std", ] @@ -5689,12 +5751,12 @@ dependencies = [ [[package]] name = "pallet-vesting" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "log 0.4.17", + "log 0.4.19", "parity-scale-codec", "scale-info", "sp-runtime", @@ -5712,11 +5774,11 @@ dependencies = [ "byteorder 1.4.3", "data-encoding", "multihash", - "percent-encoding 2.2.0", - "serde 1.0.163", + "percent-encoding 2.3.0", + "serde 1.0.164", "static_assertions", "unsigned-varint 0.7.1", - "url 2.3.1", + "url 2.4.0", ] [[package]] @@ -5725,13 +5787,13 @@ version = "3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5ddb756ca205bd108aee3c62c6d3c994e1df84a59b9d6d4a5ea42ee1fd5a9a28" dependencies = [ - "arrayvec 0.7.2", + "arrayvec 0.7.3", "bitvec", "byte-slice-cast", "bytes 1.4.0", "impl-trait-for-tuples", "parity-scale-codec-derive", - "serde 1.0.163", + "serde 1.0.164", ] [[package]] @@ -5794,7 +5856,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" dependencies = [ "lock_api", - "parking_lot_core 0.9.7", + "parking_lot_core 0.9.8", ] [[package]] @@ -5813,15 +5875,15 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.7" +version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9069cbb9f99e3a5083476ccb29ceb1de18b9118cafa53e90c9551235de2b9521" +checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" dependencies = [ "cfg-if 1.0.0", "libc", - "redox_syscall 0.2.16", + "redox_syscall 0.3.5", "smallvec 1.10.0", - "windows-sys 0.45.0", + "windows-targets 0.48.0", ] [[package]] @@ -5832,7 +5894,7 @@ checksum = "7037e5e93e0172a5a96874380bf73bc6ecef022e26fa25f2be26864d6b3ba95d" dependencies = [ "lazy_static", "num 0.2.1", - "regex 1.8.1", + "regex 1.8.4", ] [[package]] @@ -5856,7 +5918,7 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" dependencies = [ - "digest 0.10.6", + "digest 0.10.7", ] [[package]] @@ -5892,9 +5954,9 @@ source = "git+https://github.com/mesalock-linux/rust-url-sgx?tag=sgx_1.1.3#23832 [[package]] name = "percent-encoding" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" +checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" [[package]] name = "pin-project" @@ -5913,7 +5975,7 @@ checksum = "39407670928234ebc5e6e580247dd567ad73a3578460c5990f9503df207e8f07" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] @@ -5930,12 +5992,12 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkcs8" -version = "0.9.0" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9eca2c590a5f85da82668fa685c09ce2888b9430e83299debf1f34b65fd4a4ba" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" dependencies = [ - "der", - "spki", + "der 0.7.6", + "spki 0.7.2", ] [[package]] @@ -5951,7 +6013,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a25c0b0ae06fcffe600ad392aabfa535696c8973f2253d9ac83171924c58a858" dependencies = [ "postcard-cobs", - "serde 1.0.163", + "serde 1.0.164", ] [[package]] @@ -5982,7 +6044,7 @@ dependencies = [ "itertools", "normalize-line-endings", "predicates-core", - "regex 1.8.1", + "regex 1.8.4", ] [[package]] @@ -6021,7 +6083,7 @@ version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" dependencies = [ - "once_cell 1.17.1", + "once_cell 1.18.0", "toml_edit", ] @@ -6061,11 +6123,22 @@ version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc881b2c22681370c6a780e47af9840ef841837bc98118431d4e1868bd0c1086" +[[package]] +name = "proc-macro-warning" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e99670bafb56b9a106419397343bdbc8b8742c3cc449fec6345f86173f47cd4" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.18", +] + [[package]] name = "proc-macro2" -version = "1.0.58" +version = "1.0.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa1fb82fc0c281dd9671101b66b771ebbe1eaf967b96ac8740dcba4b70005ca8" +checksum = "dec2b086b7a862cf4de201096214fa870344cf922b2b30c167badb3af3195406" dependencies = [ "unicode-ident", ] @@ -6080,7 +6153,7 @@ dependencies = [ "byteorder 1.4.3", "hex", "lazy_static", - "rustix 0.36.13", + "rustix 0.36.14", ] [[package]] @@ -6137,9 +6210,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.27" +version = "1.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f4f29d145265ec1c483c7c654450edde0bfe043d3938d6972630663356d9500" +checksum = "1b9ab9c7eadfd8df19006f1cf1a4aed13540ed5cbc047010ece5826e10825488" dependencies = [ "proc-macro2", ] @@ -6254,7 +6327,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.9", + "getrandom 0.2.10", ] [[package]] @@ -6300,7 +6373,7 @@ version = "0.9.2" source = "git+https://github.com/integritee-network/rcgen#1852c8dbeb74de36a422d218254b659497daf717" dependencies = [ "chrono 0.4.11", - "chrono 0.4.24", + "chrono 0.4.26", "pem 0.8.2", "pem 1.1.1", "ring 0.16.19", @@ -6343,7 +6416,7 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" dependencies = [ - "getrandom 0.2.9", + "getrandom 0.2.10", "redox_syscall 0.2.16", "thiserror 1.0.40", ] @@ -6365,7 +6438,7 @@ checksum = "8d2275aab483050ab2a7364c1a46604865ee7d6906684e08db0f090acf74f9e7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] @@ -6379,13 +6452,13 @@ dependencies = [ [[package]] name = "regex" -version = "1.8.1" +version = "1.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af83e617f331cc6ae2da5443c602dfa5af81e517212d9d611a5b3ba1777b5370" +checksum = "d0ab3ca65655bb1e41f2a8c8cd662eb4fb035e67c3f78da1d61dffe89d07300f" dependencies = [ - "aho-corasick 1.0.1", + "aho-corasick 1.0.2", "memchr 2.5.0", - "regex-syntax 0.7.1", + "regex-syntax 0.7.2", ] [[package]] @@ -6413,19 +6486,18 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5996294f19bd3aae0453a862ad728f60e6600695733dd5df01da90c54363a3c" +checksum = "436b050e76ed2903236f032a59761c1eb99e1b0aead2c257922771dab1fc8c78" [[package]] name = "rfc6979" -version = "0.3.1" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7743f17af12fa0b03b803ba12cd6a8d9483a587e89c69445e3909655c0b9fabb" +checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" dependencies = [ - "crypto-bigint", "hmac 0.12.1", - "zeroize", + "subtle", ] [[package]] @@ -6447,7 +6519,7 @@ checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" dependencies = [ "cc", "libc", - "once_cell 1.17.1", + "once_cell 1.18.0", "spin 0.5.2", "untrusted", "web-sys", @@ -6461,8 +6533,8 @@ source = "git+https://github.com/Niederb/ring-xous.git?branch=0.16.20-cleanup#8b dependencies = [ "cc", "libc", - "log 0.4.17", - "once_cell 1.17.1", + "log 0.4.19", + "once_cell 1.18.0", "rkyv", "spin 0.5.2", "untrusted", @@ -6582,9 +6654,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.36.13" +version = "0.36.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a38f9520be93aba504e8ca974197f46158de5dcaa9fa04b57c57cd6a679d658" +checksum = "14e4d67015953998ad0eb82887a0eb0129e18a7e2f3b7b0f6c422fddcd503d62" dependencies = [ "bitflags", "errno", @@ -6596,15 +6668,15 @@ dependencies = [ [[package]] name = "rustix" -version = "0.37.19" +version = "0.37.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acf8729d8542766f1b2cf77eb034d52f40d375bb8b615d0b147089946e16613d" +checksum = "b96e891d04aa506a6d1f318d2771bcb1c7dfda84e126660ace067c9b474bb2c0" dependencies = [ "bitflags", "errno", "io-lifetimes", "libc", - "linux-raw-sys 0.3.7", + "linux-raw-sys 0.3.8", "windows-sys 0.48.0", ] @@ -6654,7 +6726,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "35edb675feee39aec9c99fa5ff985081995a06d594114ae14cbe797ad7b7a6d7" dependencies = [ "base64 0.13.1", - "log 0.4.17", + "log 0.4.19", "ring 0.16.20 (registry+https://github.com/rust-lang/crates.io-index)", "sct 0.6.1", "webpki 0.21.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -6678,7 +6750,7 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d194b56d58803a43635bdc398cd17e383d6f71f9182b9a192c127ca42494a59b" dependencies = [ - "base64 0.21.0", + "base64 0.21.2", ] [[package]] @@ -6710,9 +6782,9 @@ dependencies = [ [[package]] name = "safe_arch" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "794821e4ccb0d9f979512f9c1973480123f9bd62a90d74ab0f9426fcf8f4a529" +checksum = "62a7484307bd40f8f7ccbacccac730108f2cae119a3b11c74485b48aa9ea650f" dependencies = [ "bytemuck", ] @@ -6729,7 +6801,7 @@ dependencies = [ [[package]] name = "sc-keystore" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "array-bytes 4.2.0", "async-trait", @@ -6752,7 +6824,7 @@ dependencies = [ "derive_more", "parity-scale-codec", "scale-info-derive", - "serde 1.0.163", + "serde 1.0.164", ] [[package]] @@ -6845,12 +6917,12 @@ dependencies = [ [[package]] name = "sec1" -version = "0.3.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3be24c1842290c45df0a7bf069e0c268a747ad05a192f2fd7dcfdbc1cba40928" +checksum = "f0aec48e813d6b90b15f0b8948af3c63483992dee44c03e9930b3eebdabe046e" dependencies = [ "base16ct", - "der", + "der 0.7.6", "generic-array 0.14.7", "pkcs8", "subtle", @@ -6886,9 +6958,9 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.9.0" +version = "2.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca2855b3715770894e67cbfa3df957790aa0c9edc3bf06efa1a84d77fa0839d1" +checksum = "1fc758eb7bffce5b308734e9b0c1468893cae9ff70ebf13e7090be8dcbcc83a8" dependencies = [ "bitflags", "core-foundation", @@ -6931,7 +7003,7 @@ version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" dependencies = [ - "serde 1.0.163", + "serde 1.0.164", ] [[package]] @@ -6959,11 +7031,11 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.163" +version = "1.0.164" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2113ab51b87a539ae008b5c6c02dc020ffa39afd2d83cffcb3f4eb2722cebec2" +checksum = "9e8c8cf938e98f769bc164923b06dce91cea1751522f46f8466461af04c9027d" dependencies = [ - "serde_derive 1.0.163", + "serde_derive 1.0.164", ] [[package]] @@ -6972,8 +7044,8 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b926cfbabfe8011609dda0350cb24d884955d294909ac71c0db7027366c77e3e" dependencies = [ - "serde 1.0.163", - "serde_derive 1.0.163", + "serde 1.0.164", + "serde_derive 1.0.164", ] [[package]] @@ -6997,13 +7069,13 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.163" +version = "1.0.164" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c805777e3930c8883389c602315a24224bcc738b63905ef87cd1420353ea93e" +checksum = "d9735b638ccc51c28bf6914d90a2e9725b377144fc612c49a611fddd1b631d68" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] @@ -7038,7 +7110,16 @@ dependencies = [ "indexmap 1.9.3", "itoa 1.0.6", "ryu", - "serde 1.0.163", + "serde 1.0.164", +] + +[[package]] +name = "serde_spanned" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93107647184f6027e3b7dcb2e11034cf95ffa1e3a682c67951963ac69c1c007d" +dependencies = [ + "serde 1.0.164", ] [[package]] @@ -7050,27 +7131,27 @@ dependencies = [ "form_urlencoded", "itoa 1.0.6", "ryu", - "serde 1.0.163", + "serde 1.0.164", ] [[package]] name = "sgx-verify" version = "0.1.4" -source = "git+https://github.com/integritee-network/pallets.git?branch=polkadot-v0.9.39#4239d3defa20c3fbd13966f62ce85e9a407bd7bf" +source = "git+https://github.com/integritee-network/pallets.git?branch=polkadot-v0.9.42#be26e6b85f14896860ef919488e6bb4cf4b7aa29" dependencies = [ "base64 0.13.1", - "chrono 0.4.24", - "der", + "chrono 0.4.26", + "der 0.6.1", "frame-support", "hex", "hex-literal", "parity-scale-codec", "ring 0.16.20 (git+https://github.com/Niederb/ring-xous.git?branch=0.16.20-cleanup)", "scale-info", - "serde 1.0.163", + "serde 1.0.164", "serde_json 1.0.96", "sp-core", - "sp-io 7.0.0 (git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39)", + "sp-io 7.0.0 (git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42)", "sp-std", "teerex-primitives", "webpki 0.21.0", @@ -7080,12 +7161,12 @@ dependencies = [ [[package]] name = "sgx_alloc" version = "1.1.6" -source = "git+https://github.com/apache/incubator-teaclave-sgx-sdk?branch=master#780dc8999477244d8ff1e6f418321adbec51ee58" +source = "git+https://github.com/apache/incubator-teaclave-sgx-sdk?branch=master#f1776a7cec1caab2959813f87bb4924805b92011" [[package]] name = "sgx_backtrace_sys" version = "1.1.6" -source = "git+https://github.com/apache/incubator-teaclave-sgx-sdk?branch=master#780dc8999477244d8ff1e6f418321adbec51ee58" +source = "git+https://github.com/apache/incubator-teaclave-sgx-sdk?branch=master#f1776a7cec1caab2959813f87bb4924805b92011" dependencies = [ "cc", "sgx_build_helper", @@ -7095,21 +7176,21 @@ dependencies = [ [[package]] name = "sgx_build_helper" version = "1.1.6" -source = "git+https://github.com/apache/incubator-teaclave-sgx-sdk?branch=master#780dc8999477244d8ff1e6f418321adbec51ee58" +source = "git+https://github.com/apache/incubator-teaclave-sgx-sdk?branch=master#f1776a7cec1caab2959813f87bb4924805b92011" [[package]] name = "sgx_crypto_helper" version = "1.1.6" -source = "git+https://github.com/apache/incubator-teaclave-sgx-sdk?branch=master#780dc8999477244d8ff1e6f418321adbec51ee58" +source = "git+https://github.com/apache/incubator-teaclave-sgx-sdk?branch=master#f1776a7cec1caab2959813f87bb4924805b92011" dependencies = [ "itertools", "libc", "serde 1.0.118 (git+https://github.com/mesalock-linux/serde-sgx)", - "serde 1.0.163", + "serde 1.0.164", "serde-big-array 0.1.5", "serde-big-array 0.3.0", "serde_derive 1.0.118", - "serde_derive 1.0.163", + "serde_derive 1.0.164", "sgx_tcrypto", "sgx_tstd", "sgx_types", @@ -7119,12 +7200,12 @@ dependencies = [ [[package]] name = "sgx_demangle" version = "1.1.6" -source = "git+https://github.com/apache/incubator-teaclave-sgx-sdk?branch=master#780dc8999477244d8ff1e6f418321adbec51ee58" +source = "git+https://github.com/apache/incubator-teaclave-sgx-sdk?branch=master#f1776a7cec1caab2959813f87bb4924805b92011" [[package]] name = "sgx_libc" version = "1.1.6" -source = "git+https://github.com/apache/incubator-teaclave-sgx-sdk?branch=master#780dc8999477244d8ff1e6f418321adbec51ee58" +source = "git+https://github.com/apache/incubator-teaclave-sgx-sdk?branch=master#f1776a7cec1caab2959813f87bb4924805b92011" dependencies = [ "sgx_types", ] @@ -7132,7 +7213,7 @@ dependencies = [ [[package]] name = "sgx_rand" version = "1.1.6" -source = "git+https://github.com/apache/incubator-teaclave-sgx-sdk?branch=master#780dc8999477244d8ff1e6f418321adbec51ee58" +source = "git+https://github.com/apache/incubator-teaclave-sgx-sdk?branch=master#f1776a7cec1caab2959813f87bb4924805b92011" dependencies = [ "sgx_trts", "sgx_tstd", @@ -7142,7 +7223,7 @@ dependencies = [ [[package]] name = "sgx_tcrypto" version = "1.1.6" -source = "git+https://github.com/apache/incubator-teaclave-sgx-sdk?branch=master#780dc8999477244d8ff1e6f418321adbec51ee58" +source = "git+https://github.com/apache/incubator-teaclave-sgx-sdk?branch=master#f1776a7cec1caab2959813f87bb4924805b92011" dependencies = [ "sgx_types", ] @@ -7150,7 +7231,7 @@ dependencies = [ [[package]] name = "sgx_tprotected_fs" version = "1.1.6" -source = "git+https://github.com/apache/incubator-teaclave-sgx-sdk?branch=master#780dc8999477244d8ff1e6f418321adbec51ee58" +source = "git+https://github.com/apache/incubator-teaclave-sgx-sdk?branch=master#f1776a7cec1caab2959813f87bb4924805b92011" dependencies = [ "sgx_trts", "sgx_types", @@ -7159,7 +7240,7 @@ dependencies = [ [[package]] name = "sgx_trts" version = "1.1.6" -source = "git+https://github.com/apache/incubator-teaclave-sgx-sdk?branch=master#780dc8999477244d8ff1e6f418321adbec51ee58" +source = "git+https://github.com/apache/incubator-teaclave-sgx-sdk?branch=master#f1776a7cec1caab2959813f87bb4924805b92011" dependencies = [ "sgx_libc", "sgx_types", @@ -7168,7 +7249,7 @@ dependencies = [ [[package]] name = "sgx_tse" version = "1.1.6" -source = "git+https://github.com/apache/teaclave-sgx-sdk.git?branch=master#780dc8999477244d8ff1e6f418321adbec51ee58" +source = "git+https://github.com/apache/teaclave-sgx-sdk.git?branch=master#f1776a7cec1caab2959813f87bb4924805b92011" dependencies = [ "sgx_types", ] @@ -7176,7 +7257,7 @@ dependencies = [ [[package]] name = "sgx_tstd" version = "1.1.6" -source = "git+https://github.com/apache/incubator-teaclave-sgx-sdk?branch=master#780dc8999477244d8ff1e6f418321adbec51ee58" +source = "git+https://github.com/apache/incubator-teaclave-sgx-sdk?branch=master#f1776a7cec1caab2959813f87bb4924805b92011" dependencies = [ "hashbrown_tstd", "sgx_alloc", @@ -7192,12 +7273,12 @@ dependencies = [ [[package]] name = "sgx_types" version = "1.1.6" -source = "git+https://github.com/apache/incubator-teaclave-sgx-sdk?branch=master#780dc8999477244d8ff1e6f418321adbec51ee58" +source = "git+https://github.com/apache/incubator-teaclave-sgx-sdk?branch=master#f1776a7cec1caab2959813f87bb4924805b92011" [[package]] name = "sgx_ucrypto" version = "1.1.6" -source = "git+https://github.com/apache/incubator-teaclave-sgx-sdk?branch=master#780dc8999477244d8ff1e6f418321adbec51ee58" +source = "git+https://github.com/apache/incubator-teaclave-sgx-sdk?branch=master#f1776a7cec1caab2959813f87bb4924805b92011" dependencies = [ "libc", "rand_core 0.3.1", @@ -7208,7 +7289,7 @@ dependencies = [ [[package]] name = "sgx_unwind" version = "1.1.6" -source = "git+https://github.com/apache/incubator-teaclave-sgx-sdk?branch=master#780dc8999477244d8ff1e6f418321adbec51ee58" +source = "git+https://github.com/apache/incubator-teaclave-sgx-sdk?branch=master#f1776a7cec1caab2959813f87bb4924805b92011" dependencies = [ "sgx_build_helper", ] @@ -7216,7 +7297,7 @@ dependencies = [ [[package]] name = "sgx_urts" version = "1.1.6" -source = "git+https://github.com/apache/incubator-teaclave-sgx-sdk?branch=master#780dc8999477244d8ff1e6f418321adbec51ee58" +source = "git+https://github.com/apache/incubator-teaclave-sgx-sdk?branch=master#f1776a7cec1caab2959813f87bb4924805b92011" dependencies = [ "libc", "sgx_types", @@ -7263,7 +7344,7 @@ checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" dependencies = [ "cfg-if 1.0.0", "cpufeatures", - "digest 0.10.6", + "digest 0.10.7", ] [[package]] @@ -7311,7 +7392,7 @@ checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" dependencies = [ "cfg-if 1.0.0", "cpufeatures", - "digest 0.10.6", + "digest 0.10.7", ] [[package]] @@ -7320,7 +7401,7 @@ version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" dependencies = [ - "digest 0.10.6", + "digest 0.10.7", "keccak", ] @@ -7342,13 +7423,13 @@ checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3" [[package]] name = "sidechain-primitives" version = "0.1.0" -source = "git+https://github.com/integritee-network/pallets.git?branch=polkadot-v0.9.39#4239d3defa20c3fbd13966f62ce85e9a407bd7bf" +source = "git+https://github.com/integritee-network/pallets.git?branch=polkadot-v0.9.42#be26e6b85f14896860ef919488e6bb4cf4b7aa29" dependencies = [ "parity-scale-codec", "scale-info", - "serde 1.0.163", + "serde 1.0.164", "sp-core", - "sp-io 7.0.0 (git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39)", + "sp-io 7.0.0 (git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42)", "sp-runtime", "sp-std", ] @@ -7367,8 +7448,14 @@ name = "signature" version = "1.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" + +[[package]] +name = "signature" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e1788eed21689f9cf370582dfc467ef36ed9c707f073528ddafa8d83e3b8500" dependencies = [ - "digest 0.10.6", + "digest 0.10.7", "rand_core 0.6.4", ] @@ -7436,7 +7523,7 @@ dependencies = [ "bytes 1.4.0", "futures 0.3.28", "httparse 1.8.0", - "log 0.4.17", + "log 0.4.19", "rand 0.8.5", "sha-1 0.9.8", ] @@ -7444,13 +7531,15 @@ dependencies = [ [[package]] name = "sp-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ - "hash-db", - "log 0.4.17", + "hash-db 0.16.0", + "log 0.4.19", "parity-scale-codec", + "scale-info", "sp-api-proc-macro", "sp-core", + "sp-metadata-ir", "sp-runtime", "sp-state-machine", "sp-std", @@ -7462,38 +7551,40 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ + "Inflector", "blake2", + "expander", "proc-macro-crate", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.18", ] [[package]] name = "sp-application-crypto" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "parity-scale-codec", "scale-info", - "serde 1.0.163", + "serde 1.0.164", "sp-core", - "sp-io 7.0.0 (git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39)", + "sp-io 7.0.0 (git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42)", "sp-std", ] [[package]] name = "sp-arithmetic" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "integer-sqrt", "num-traits 0.2.15", "parity-scale-codec", "scale-info", - "serde 1.0.163", + "serde 1.0.164", "sp-std", "static_assertions", ] @@ -7501,7 +7592,7 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "parity-scale-codec", "sp-api", @@ -7513,25 +7604,22 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "async-trait", "futures 0.3.28", - "log 0.4.17", - "parity-scale-codec", + "log 0.4.19", "sp-core", "sp-inherents", "sp-runtime", "sp-state-machine", - "sp-std", - "sp-version", "thiserror 1.0.40", ] [[package]] name = "sp-consensus-aura" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "async-trait", "parity-scale-codec", @@ -7546,14 +7634,32 @@ dependencies = [ "sp-timestamp", ] +[[package]] +name = "sp-consensus-grandpa" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "finality-grandpa", + "log 0.4.19", + "parity-scale-codec", + "scale-info", + "serde 1.0.164", + "sp-api", + "sp-application-crypto", + "sp-core", + "sp-keystore", + "sp-runtime", + "sp-std", +] + [[package]] name = "sp-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "parity-scale-codec", "scale-info", - "serde 1.0.163", + "serde 1.0.164", "sp-std", "sp-timestamp", ] @@ -7561,33 +7667,34 @@ dependencies = [ [[package]] name = "sp-core" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "array-bytes 4.2.0", - "base58", "bitflags", "blake2", "bounded-collections", + "bs58", "dyn-clonable", "ed25519-zebra", "futures 0.3.28", - "hash-db", + "hash-db 0.16.0", "hash256-std-hasher", "impl-serde", "lazy_static", "libsecp256k1", - "log 0.4.17", + "log 0.4.19", "merlin", "parity-scale-codec", "parking_lot 0.12.1", + "paste", "primitive-types", "rand 0.8.5", - "regex 1.8.1", + "regex 1.8.4", "scale-info", "schnorrkel", "secp256k1", "secrecy", - "serde 1.0.163", + "serde 1.0.164", "sp-core-hashing", "sp-debug-derive", "sp-externalities", @@ -7604,11 +7711,11 @@ dependencies = [ [[package]] name = "sp-core-hashing" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ - "blake2", + "blake2b_simd", "byteorder 1.4.3", - "digest 0.10.6", + "digest 0.10.7", "sha2 0.10.6", "sha3", "sp-std", @@ -7618,28 +7725,28 @@ dependencies = [ [[package]] name = "sp-core-hashing-proc-macro" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "proc-macro2", "quote", "sp-core-hashing", - "syn 1.0.109", + "syn 2.0.18", ] [[package]] name = "sp-debug-derive" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.18", ] [[package]] name = "sp-externalities" version = "0.13.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "environmental 1.1.4", "parity-scale-codec", @@ -7647,28 +7754,10 @@ dependencies = [ "sp-storage", ] -[[package]] -name = "sp-finality-grandpa" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" -dependencies = [ - "finality-grandpa", - "log 0.4.17", - "parity-scale-codec", - "scale-info", - "serde 1.0.163", - "sp-api", - "sp-application-crypto", - "sp-core", - "sp-keystore", - "sp-runtime", - "sp-std", -] - [[package]] name = "sp-inherents" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -7686,10 +7775,10 @@ version = "7.0.0" dependencies = [ "environmental 1.1.3", "futures 0.3.28", - "hash-db", + "hash-db 0.15.2", "itp-sgx-externalities", "libsecp256k1", - "log 0.4.17", + "log 0.4.19", "parity-scale-codec", "parking_lot 0.12.1", "sgx_tstd", @@ -7706,15 +7795,16 @@ dependencies = [ [[package]] name = "sp-io" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "bytes 1.4.0", "ed25519", "ed25519-dalek", "futures 0.3.28", "libsecp256k1", - "log 0.4.17", + "log 0.4.19", "parity-scale-codec", + "rustversion", "secp256k1", "sp-core", "sp-externalities", @@ -7731,7 +7821,7 @@ dependencies = [ [[package]] name = "sp-keyring" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "lazy_static", "sp-core", @@ -7742,15 +7832,12 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.13.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ - "async-trait", "futures 0.3.28", - "merlin", "parity-scale-codec", "parking_lot 0.12.1", - "schnorrkel", - "serde 1.0.163", + "serde 1.0.164", "sp-core", "sp-externalities", "thiserror 1.0.40", @@ -7759,20 +7846,31 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "thiserror 1.0.40", "zstd", ] +[[package]] +name = "sp-metadata-ir" +version = "0.1.0" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "frame-metadata 15.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec", + "scale-info", + "sp-std", +] + [[package]] name = "sp-npos-elections" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "parity-scale-codec", "scale-info", - "serde 1.0.163", + "serde 1.0.164", "sp-arithmetic", "sp-core", "sp-runtime", @@ -7782,7 +7880,7 @@ dependencies = [ [[package]] name = "sp-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "sp-api", "sp-core", @@ -7792,31 +7890,31 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "backtrace", "lazy_static", - "regex 1.8.1", + "regex 1.8.4", ] [[package]] name = "sp-runtime" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "either", "hash256-std-hasher", "impl-trait-for-tuples", - "log 0.4.17", + "log 0.4.19", "parity-scale-codec", "paste", "rand 0.8.5", "scale-info", - "serde 1.0.163", + "serde 1.0.164", "sp-application-crypto", "sp-arithmetic", "sp-core", - "sp-io 7.0.0 (git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39)", + "sp-io 7.0.0 (git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42)", "sp-std", "sp-weights", ] @@ -7824,7 +7922,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "bytes 1.4.0", "impl-trait-for-tuples", @@ -7842,19 +7940,19 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "Inflector", "proc-macro-crate", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.18", ] [[package]] name = "sp-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "parity-scale-codec", "scale-info", @@ -7868,10 +7966,11 @@ dependencies = [ [[package]] name = "sp-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "parity-scale-codec", "scale-info", + "serde 1.0.164", "sp-core", "sp-runtime", "sp-std", @@ -7880,10 +7979,10 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.13.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ - "hash-db", - "log 0.4.17", + "hash-db 0.16.0", + "log 0.4.19", "parity-scale-codec", "parking_lot 0.12.1", "rand 0.8.5", @@ -7900,17 +7999,17 @@ dependencies = [ [[package]] name = "sp-std" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" [[package]] name = "sp-storage" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "impl-serde", "parity-scale-codec", "ref-cast", - "serde 1.0.163", + "serde 1.0.164", "sp-debug-derive", "sp-std", ] @@ -7918,11 +8017,11 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "async-trait", "futures-timer", - "log 0.4.17", + "log 0.4.19", "parity-scale-codec", "sp-inherents", "sp-runtime", @@ -7933,7 +8032,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "parity-scale-codec", "sp-std", @@ -7945,7 +8044,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "sp-api", "sp-runtime", @@ -7954,11 +8053,11 @@ dependencies = [ [[package]] name = "sp-trie" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "ahash 0.8.3", - "hash-db", - "hashbrown 0.12.3", + "hash-db 0.16.0", + "hashbrown 0.13.2", "lazy_static", "memory-db", "nohash-hasher", @@ -7977,13 +8076,13 @@ dependencies = [ [[package]] name = "sp-version" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "impl-serde", "parity-scale-codec", "parity-wasm", "scale-info", - "serde 1.0.163", + "serde 1.0.164", "sp-core-hashing-proc-macro", "sp-runtime", "sp-std", @@ -7994,22 +8093,22 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "parity-scale-codec", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.18", ] [[package]] name = "sp-wasm-interface" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "anyhow", "impl-trait-for-tuples", - "log 0.4.17", + "log 0.4.19", "parity-scale-codec", "sp-std", "wasmi 0.13.2", @@ -8019,11 +8118,11 @@ dependencies = [ [[package]] name = "sp-weights" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "parity-scale-codec", "scale-info", - "serde 1.0.163", + "serde 1.0.164", "smallvec 1.10.0", "sp-arithmetic", "sp-core", @@ -8050,7 +8149,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "67cf02bbac7a337dc36e4f5a693db6c21e7863f45070f7064577eb4367a3212b" dependencies = [ "base64ct", - "der", + "der 0.6.1", +] + +[[package]] +name = "spki" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d1e996ef02c474957d681f1b05213dfb0abab947b446a62d37770b23500184a" +dependencies = [ + "base64ct", + "der 0.7.6", ] [[package]] @@ -8063,7 +8172,7 @@ dependencies = [ "num-format", "proc-macro2", "quote", - "serde 1.0.163", + "serde 1.0.164", "serde_json 1.0.96", "unicode-xid", ] @@ -8117,7 +8226,7 @@ dependencies = [ [[package]] name = "substrate-api-client" version = "0.10.0" -source = "git+https://github.com/scs/substrate-api-client.git?branch=polkadot-v0.9.39#d872c2ca4328a30222e4d470c8fc4921abad9f34" +source = "git+https://github.com/scs/substrate-api-client.git?branch=polkadot-v0.9.42-tag-v0.10.0#686b7ef0aa8da255d3864a3fc703e32193813700" dependencies = [ "ac-compose-macros", "ac-node-api", @@ -8126,14 +8235,14 @@ dependencies = [ "frame-metadata 15.1.0 (git+https://github.com/paritytech/frame-metadata)", "frame-support", "hex", - "log 0.4.17", + "log 0.4.19", "parity-scale-codec", - "serde 1.0.163", + "serde 1.0.164", "serde_json 1.0.96", "sp-core", "sp-runtime", "sp-runtime-interface", - "url 2.3.1", + "url 2.4.0", "ws", ] @@ -8153,10 +8262,10 @@ dependencies = [ [[package]] name = "substrate-client-keystore" version = "0.7.0" -source = "git+https://github.com/scs/substrate-api-client.git?branch=polkadot-v0.9.39#d872c2ca4328a30222e4d470c8fc4921abad9f34" +source = "git+https://github.com/scs/substrate-api-client.git?branch=polkadot-v0.9.42-tag-v0.10.0#686b7ef0aa8da255d3864a3fc703e32193813700" dependencies = [ + "array-bytes 4.2.0", "async-trait", - "hex", "parking_lot 0.12.1", "sc-keystore", "serde_json 1.0.96", @@ -8173,14 +8282,14 @@ source = "git+https://github.com/encointer/substrate-fixed?tag=v0.5.9#a4fb461aae dependencies = [ "parity-scale-codec", "scale-info", - "serde 1.0.163", + "serde 1.0.164", "typenum 1.16.0 (git+https://github.com/encointer/typenum?tag=v1.16.0)", ] [[package]] name = "substrate-wasm-builder" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "ansi_term", "build-helper", @@ -8213,9 +8322,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.16" +version = "2.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6f671d4b5ffdb8eadec19c0ae67fe2639df8684bd7bc4b83d986b8db549cf01" +checksum = "32d41677bcbe24c20c52e7c70b0d8db04134c5d1066bf98662e2871ad200ea3e" dependencies = [ "proc-macro2", "quote", @@ -8249,7 +8358,7 @@ checksum = "fd1ba337640d60c3e96bc6f0638a939b9c9a7f2c316a1598c279828b3d1dc8c5" [[package]] name = "teeracle-primitives" version = "0.1.0" -source = "git+https://github.com/integritee-network/pallets.git?branch=polkadot-v0.9.39#4239d3defa20c3fbd13966f62ce85e9a407bd7bf" +source = "git+https://github.com/integritee-network/pallets.git?branch=polkadot-v0.9.42#be26e6b85f14896860ef919488e6bb4cf4b7aa29" dependencies = [ "common-primitives", "sp-std", @@ -8259,14 +8368,14 @@ dependencies = [ [[package]] name = "teerex-primitives" version = "0.1.0" -source = "git+https://github.com/integritee-network/pallets.git?branch=polkadot-v0.9.39#4239d3defa20c3fbd13966f62ce85e9a407bd7bf" +source = "git+https://github.com/integritee-network/pallets.git?branch=polkadot-v0.9.42#be26e6b85f14896860ef919488e6bb4cf4b7aa29" dependencies = [ "common-primitives", "parity-scale-codec", "scale-info", - "serde 1.0.163", + "serde 1.0.164", "sp-core", - "sp-io 7.0.0 (git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39)", + "sp-io 7.0.0 (git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42)", "sp-std", ] @@ -8278,15 +8387,16 @@ checksum = "af547b166dd1ea4b472165569fc456cfb6818116f854690b0ff205e636523dab" [[package]] name = "tempfile" -version = "3.5.0" +version = "3.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9fbec84f381d5795b08656e4912bec604d162bff9291d6189a78f4c8ab87998" +checksum = "31c0432476357e58790aaa47a8efb0c5138f137343f3b5f23bd36a27e3b0a6d6" dependencies = [ + "autocfg 1.1.0", "cfg-if 1.0.0", "fastrand", "redox_syscall 0.3.5", - "rustix 0.37.19", - "windows-sys 0.45.0", + "rustix 0.37.20", + "windows-sys 0.48.0", ] [[package]] @@ -8355,7 +8465,7 @@ checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] @@ -8365,7 +8475,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" dependencies = [ "cfg-if 1.0.0", - "once_cell 1.17.1", + "once_cell 1.18.0", ] [[package]] @@ -8387,7 +8497,7 @@ checksum = "62cc94d358b5a1e84a5cb9109f559aa3c4d634d2b1b4de3d0fa4adc7c78e2861" dependencies = [ "anyhow", "hmac 0.12.1", - "once_cell 1.17.1", + "once_cell 1.18.0", "pbkdf2 0.11.0", "rand 0.8.5", "rustc-hash", @@ -8424,14 +8534,14 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.28.1" +version = "1.28.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0aa32867d44e6f2ce3385e89dceb990188b8bb0fb25b0cf576647a6f98ac5105" +checksum = "94d7b1cfd2aa4011f2de74c2c4c63665e27a71006b0a192dcd2710272e73dfa2" dependencies = [ "autocfg 1.1.0", "bytes 1.4.0", "libc", - "mio 0.8.6", + "mio 0.8.8", "num_cpus", "parking_lot 0.12.1", "pin-project-lite", @@ -8449,7 +8559,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] @@ -8491,7 +8601,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "54319c93411147bced34cb5609a80e0a8e44c5999c93903a81cd866630ec0bfd" dependencies = [ "futures-util 0.3.28", - "log 0.4.17", + "log 0.4.19", "tokio", "tungstenite 0.18.0", ] @@ -8506,7 +8616,7 @@ dependencies = [ "futures-core 0.3.28", "futures-io 0.3.28", "futures-sink 0.3.28", - "log 0.4.17", + "log 0.4.19", "pin-project-lite", "tokio", ] @@ -8527,26 +8637,34 @@ dependencies = [ [[package]] name = "toml" -version = "0.5.11" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +checksum = "d6135d499e69981f9ff0ef2167955a5333c35e36f6937d382974566b3d5b94ec" dependencies = [ - "serde 1.0.163", + "serde 1.0.164", + "serde_spanned", + "toml_datetime", + "toml_edit", ] [[package]] name = "toml_datetime" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ab8ed2edee10b50132aed5f331333428b011c99402b5a534154ed15746f9622" +checksum = "5a76a9312f5ba4c2dec6b9161fdf25d87ad8a09256ccea5a556fef03c706a10f" +dependencies = [ + "serde 1.0.164", +] [[package]] name = "toml_edit" -version = "0.19.8" +version = "0.19.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "239410c8609e8125456927e6707163a3b1fdb40561e4b803bc041f466ccfdc13" +checksum = "2380d56e8670370eee6566b0bfd4265f65b3f432e8c6d85623f728d4fa31f739" dependencies = [ "indexmap 1.9.3", + "serde 1.0.164", + "serde_spanned", "toml_datetime", "winnow", ] @@ -8564,7 +8682,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" dependencies = [ "cfg-if 1.0.0", - "log 0.4.17", + "log 0.4.19", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -8578,7 +8696,7 @@ checksum = "0f57e3ca2a01450b1a921183a9c9cbfda207fd822cef4ccb00a65402cbba7a74" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] @@ -8587,7 +8705,7 @@ version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" dependencies = [ - "once_cell 1.17.1", + "once_cell 1.18.0", "valuable", ] @@ -8598,7 +8716,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" dependencies = [ "lazy_static", - "log 0.4.17", + "log 0.4.19", "tracing-core", ] @@ -8608,7 +8726,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc6b213177105856957181934e4920de57730fc69bf42c37ee5bb664d406d9e1" dependencies = [ - "serde 1.0.163", + "serde 1.0.164", "tracing-core", ] @@ -8619,11 +8737,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0e0d2eaa99c3c2e41547cfa109e910a68ea03823cccad4a0525dcbc9b01e8c71" dependencies = [ "ansi_term", - "chrono 0.4.24", + "chrono 0.4.26", "lazy_static", "matchers", - "regex 1.8.1", - "serde 1.0.163", + "regex 1.8.4", + "serde 1.0.164", "serde_json 1.0.96", "sharded-slab", "smallvec 1.10.0", @@ -8636,24 +8754,24 @@ dependencies = [ [[package]] name = "trie-db" -version = "0.25.1" +version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3390c0409daaa6027d6681393316f4ccd3ff82e1590a1e4725014e3ae2bf1920" +checksum = "767abe6ffed88a1889671a102c2861ae742726f52e0a5a425b92c9fbfa7e9c85" dependencies = [ - "hash-db", + "hash-db 0.16.0", "hashbrown 0.13.2", - "log 0.4.17", + "log 0.4.19", "rustc-hex", "smallvec 1.10.0", ] [[package]] name = "trie-root" -version = "0.17.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a36c5ca3911ed3c9a5416ee6c679042064b93fc637ded67e25f92e68d783891" +checksum = "d4ed310ef5ab98f5fa467900ed906cb9232dd5376597e00fd4cba2a449d06c0b" dependencies = [ - "hash-db", + "hash-db 0.16.0", ] [[package]] @@ -8662,7 +8780,7 @@ version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1631b201eb031b563d2e85ca18ec8092508e262a3196ce9bd10a67ec87b9f5c" dependencies = [ - "hash-db", + "hash-db 0.15.2", "rlp", ] @@ -8711,12 +8829,12 @@ dependencies = [ "bytes 1.4.0", "http 0.2.9", "httparse 1.8.0", - "log 0.4.17", + "log 0.4.19", "rand 0.8.5", "rustls 0.19.1", "sha-1 0.9.8", "thiserror 1.0.40", - "url 2.3.1", + "url 2.4.0", "utf-8 0.7.6", "webpki 0.21.4 (registry+https://github.com/rust-lang/crates.io-index)", "webpki-roots 0.21.1", @@ -8733,11 +8851,11 @@ dependencies = [ "bytes 1.4.0", "http 0.2.9", "httparse 1.8.0", - "log 0.4.17", + "log 0.4.19", "rand 0.8.5", "sha1 0.10.5", "thiserror 1.0.40", - "url 2.3.1", + "url 2.4.0", "utf-8 0.7.6", ] @@ -8747,8 +8865,8 @@ version = "1.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" dependencies = [ - "cfg-if 0.1.10", - "digest 0.10.6", + "cfg-if 1.0.0", + "digest 0.10.7", "rand 0.8.5", "static_assertions", ] @@ -8826,9 +8944,9 @@ checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" -version = "1.0.8" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4" +checksum = "b15811caf2415fb889178633e7724bad2509101cde276048e013b9def5e51fa0" [[package]] name = "unicode-normalization" @@ -8890,13 +9008,13 @@ dependencies = [ [[package]] name = "url" -version = "2.3.1" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" +checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" dependencies = [ "form_urlencoded", - "idna 0.3.0", - "percent-encoding 2.2.0", + "idna 0.4.0", + "percent-encoding 2.3.0", ] [[package]] @@ -8953,7 +9071,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" dependencies = [ - "log 0.4.17", + "log 0.4.19", "try-lock", ] @@ -8969,15 +9087,15 @@ dependencies = [ "headers", "http 0.2.9", "hyper", - "log 0.4.17", + "log 0.4.19", "mime", "mime_guess", "multer", - "percent-encoding 2.2.0", + "percent-encoding 2.3.0", "pin-project", "rustls-pemfile", "scoped-tls", - "serde 1.0.163", + "serde 1.0.164", "serde_json 1.0.96", "serde_urlencoded", "tokio", @@ -9008,9 +9126,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.86" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bba0e8cb82ba49ff4e229459ff22a191bbe9a1cb3a341610c9c33efc27ddf73" +checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" dependencies = [ "cfg-if 1.0.0", "wasm-bindgen-macro", @@ -9018,24 +9136,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.86" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19b04bc93f9d6bdee709f6bd2118f57dd6679cf1176a1af464fca3ab0d66d8fb" +checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" dependencies = [ "bumpalo", - "log 0.4.17", - "once_cell 1.17.1", + "log 0.4.19", + "once_cell 1.18.0", "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.86" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14d6b024f1a526bb0234f52840389927257beb670610081360e5a03c5df9c258" +checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -9043,22 +9161,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.86" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e128beba882dd1eb6200e1dc92ae6c5dbaa4311aa7bb211ca035779e5efc39f8" +checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.86" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed9d5b4305409d1fc9482fee2d7f9bcbf24b3972bf59817ef757e23982242a93" +checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" [[package]] name = "wasm-instrument" @@ -9107,7 +9225,7 @@ dependencies = [ "cc", "cxx", "cxx-build", - "regex 1.8.1", + "regex 1.8.4", ] [[package]] @@ -9123,13 +9241,13 @@ dependencies = [ [[package]] name = "wasmi" -version = "0.20.0" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01bf50edb2ea9d922aa75a7bf3c15e26a6c9e2d18c56e862b49737a582901729" +checksum = "8e61a7006b0fdf24f6bbe8dcfdad5ca1b350de80061fb2827f31c82fbbb9565a" dependencies = [ "spin 0.9.8", "wasmi_arena", - "wasmi_core 0.5.0", + "wasmi_core 0.12.0", "wasmparser-nostd", ] @@ -9144,9 +9262,9 @@ dependencies = [ [[package]] name = "wasmi_arena" -version = "0.1.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1ea379cbb0b41f3a9f0bf7b47036d036aae7f43383d8cc487d4deccf40dee0a" +checksum = "401c1f35e413fac1846d4843745589d9ec678977ab35a384db8ae7830525d468" [[package]] name = "wasmi_core" @@ -9163,13 +9281,14 @@ dependencies = [ [[package]] name = "wasmi_core" -version = "0.5.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5bf998ab792be85e20e771fe14182b4295571ad1d4f89d3da521c1bef5f597a" +checksum = "624e6333e861ef49095d2d678b76ebf30b06bf37effca845be7e5b87c90071b7" dependencies = [ "downcast-rs", "libm", "num-traits 0.2.15", + "paste", ] [[package]] @@ -9179,14 +9298,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "64b20236ab624147dfbb62cf12a19aaf66af0e41b8398838b66e997d07d269d4" dependencies = [ "indexmap 1.9.3", - "url 2.3.1", + "url 2.4.0", ] [[package]] name = "wasmparser-nostd" -version = "0.91.0" +version = "0.100.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c37f310b5a62bfd5ae7c0f1d8e6f98af16a5d6d84ba764e9c36439ec14e318b" +checksum = "9157cab83003221bfd385833ab587a039f5d6fa7304854042ba358a3b09e0724" dependencies = [ "indexmap-nostd", ] @@ -9202,12 +9321,12 @@ dependencies = [ "cfg-if 1.0.0", "indexmap 1.9.3", "libc", - "log 0.4.17", + "log 0.4.19", "object 0.29.0", - "once_cell 1.17.1", + "once_cell 1.18.0", "paste", "psm", - "serde 1.0.163", + "serde 1.0.164", "target-lexicon", "wasmparser", "wasmtime-environ", @@ -9235,9 +9354,9 @@ dependencies = [ "cranelift-entity", "gimli 0.26.2", "indexmap 1.9.3", - "log 0.4.17", + "log 0.4.19", "object 0.29.0", - "serde 1.0.163", + "serde 1.0.164", "target-lexicon", "thiserror 1.0.40", "wasmparser", @@ -9256,10 +9375,10 @@ dependencies = [ "cfg-if 1.0.0", "cpp_demangle", "gimli 0.26.2", - "log 0.4.17", + "log 0.4.19", "object 0.29.0", "rustc-demangle", - "serde 1.0.163", + "serde 1.0.164", "target-lexicon", "wasmtime-environ", "wasmtime-jit-icache-coherence", @@ -9273,7 +9392,7 @@ version = "6.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eed41cbcbf74ce3ff6f1d07d1b707888166dc408d1a880f651268f4f7c9194b2" dependencies = [ - "once_cell 1.17.1", + "once_cell 1.18.0", ] [[package]] @@ -9298,13 +9417,13 @@ dependencies = [ "cfg-if 1.0.0", "indexmap 1.9.3", "libc", - "log 0.4.17", + "log 0.4.19", "mach", "memfd", "memoffset 0.6.5", "paste", "rand 0.8.5", - "rustix 0.36.13", + "rustix 0.36.14", "wasmtime-asm-macros", "wasmtime-environ", "wasmtime-jit-debug", @@ -9318,16 +9437,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "83e5572c5727c1ee7e8f28717aaa8400e4d22dcbd714ea5457d85b5005206568" dependencies = [ "cranelift-entity", - "serde 1.0.163", + "serde 1.0.164", "thiserror 1.0.40", "wasmparser", ] [[package]] name = "web-sys" -version = "0.3.63" +version = "0.3.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bdd9ef4e984da1187bf8110c5cf5b845fbc87a23602cdf912386a76fcd3a7c2" +checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" dependencies = [ "js-sys", "wasm-bindgen", @@ -9392,9 +9511,9 @@ dependencies = [ [[package]] name = "wide" -version = "0.7.8" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b689b6c49d6549434bf944e6b0f39238cf63693cb7a147e9d887507fffa3b223" +checksum = "40018623e2dba2602a9790faba8d33f2ebdebf4b86561b83928db735f8784728" dependencies = [ "bytemuck", "safe_arch", @@ -9617,14 +9736,14 @@ dependencies = [ "byteorder 1.4.3", "bytes 0.4.12", "httparse 1.8.0", - "log 0.4.17", + "log 0.4.19", "mio 0.6.23", "mio-extras 2.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "openssl", "rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", "sha-1 0.8.2", "slab 0.4.8", - "url 2.3.1", + "url 2.4.0", ] [[package]] @@ -9653,27 +9772,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "99d224a125dec5adda27d0346b9cae9794830279c4f9c27e4ab0b6c408d54012" dependencies = [ "const-oid", - "der", + "der 0.6.1", "flagset", - "spki", + "spki 0.6.0", ] [[package]] name = "xous" -version = "0.9.42" +version = "0.9.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4126043d97e773d482d4be8bd45c007640ae09af3ebf40d3d9b5c9ab843abf0b" +checksum = "30684dda3583f528d5b05bddc96527e1783255e867a5e81c10721d6abb9e169c" dependencies = [ "lazy_static", ] [[package]] name = "xous-api-log" -version = "0.1.38" +version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d267ec4b8fb7bff386e448043b81f20a7eb15174973bd37b7b9af6e2d6bbe2e6" +checksum = "fd6b15ea09891f09b02d763422dc99733c96e62d0f8ab476c6bc663c90b17e72" dependencies = [ - "log 0.4.17", + "log 0.4.19", "num-derive", "num-traits 0.2.15", "xous", @@ -9682,11 +9801,11 @@ dependencies = [ [[package]] name = "xous-api-names" -version = "0.9.40" +version = "0.9.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95f39025c4b19ebf704effb967afcea2e2576f7a55ed0d25dec01920bed6ac44" +checksum = "7b470fbf177d58767fa001acfcb5294a88d3938d3935865ff6b8f1db40f1004e" dependencies = [ - "log 0.4.17", + "log 0.4.19", "num-derive", "num-traits 0.2.15", "rkyv", @@ -9697,9 +9816,9 @@ dependencies = [ [[package]] name = "xous-ipc" -version = "0.9.42" +version = "0.9.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc52f85ca63305a0ea9d31ade0ea8fca86515ce33550486e7c0c8edbe3a4d68f" +checksum = "d520fe08642d55a56f700b6d30c7a556f38818e7c3e5d9a0856dde0b79ed4d67" dependencies = [ "bitflags", "rkyv", @@ -9730,7 +9849,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e262a29d0e61ccf2b6190d7050d4b237535fc76ce4c1210d9caa316f71dffa75" dependencies = [ "bit-vec", - "chrono 0.4.24", + "chrono 0.4.26", "num-bigint 0.4.3", ] @@ -9751,23 +9870,23 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] name = "zstd" -version = "0.11.2+zstd.1.5.2" +version = "0.12.3+zstd.1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4" +checksum = "76eea132fb024e0e13fd9c2f5d5d595d8a967aa72382ac2f9d39fcc95afd0806" dependencies = [ "zstd-safe", ] [[package]] name = "zstd-safe" -version = "5.0.2+zstd.1.5.2" +version = "6.0.5+zstd.1.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d2a5585e04f9eea4b2a3d1eca508c4dee9592a89ef6f450c11719da0726f4db" +checksum = "d56d9e60b4b1758206c238a10165fbcae3ca37b01744e394c463463f6529d23b" dependencies = [ "libc", "zstd-sys", diff --git a/app-libs/sgx-runtime/Cargo.toml b/app-libs/sgx-runtime/Cargo.toml index d0163874b2..e55df95e23 100644 --- a/app-libs/sgx-runtime/Cargo.toml +++ b/app-libs/sgx-runtime/Cargo.toml @@ -18,35 +18,35 @@ scale-info = { version = "2.0.1", default-features = false, features = ["derive" itp-sgx-runtime-primitives = { path = "../../core-primitives/sgx-runtime-primitives", default-features = false } # Substrate dependencies -frame-benchmarking = { optional = true, default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -frame-executive = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -frame-system-benchmarking = { optional = true, default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -frame-system-rpc-runtime-api = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -pallet-aura = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -pallet-balances = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -pallet-grandpa = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -pallet-insecure-randomness-collective-flip = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -pallet-sudo = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -pallet-timestamp = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -pallet-transaction-payment = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -pallet-transaction-payment-rpc-runtime-api = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-api = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-block-builder = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-consensus-aura = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-inherents = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-offchain = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-session = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-transaction-pool = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-version = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } +frame-benchmarking = { optional = true, default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } +frame-executive = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } +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" } +frame-system-benchmarking = { optional = true, default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } +frame-system-rpc-runtime-api = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } +pallet-aura = { 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-grandpa = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } +pallet-insecure-randomness-collective-flip = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } +pallet-sudo = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } +pallet-timestamp = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } +pallet-transaction-payment = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } +pallet-transaction-payment-rpc-runtime-api = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } +sp-api = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } +sp-block-builder = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } +sp-consensus-aura = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } +sp-inherents = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } +sp-offchain = { default-features = false, 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" } +sp-session = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } +sp-transaction-pool = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } +sp-version = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } # Integritee dependencies -pallet-evm = { default-features = false, optional = true, git = "https://github.com/integritee-network/frontier.git", branch = "polkadot-v0.9.39" } -pallet-parentchain = { default-features = false, git = "https://github.com/integritee-network/pallets.git", branch = "polkadot-v0.9.39" } +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 = "polkadot-v0.9.42" } [features] default = ["std"] diff --git a/app-libs/sgx-runtime/src/evm.rs b/app-libs/sgx-runtime/src/evm.rs index 1fcf4def8e..d838b28115 100644 --- a/app-libs/sgx-runtime/src/evm.rs +++ b/app-libs/sgx-runtime/src/evm.rs @@ -1,7 +1,7 @@ //! Adds the `pallet-evm` support for the `sgx-runtime. // Import types from the crate root including the ones generated by the `construct_runtime!` macro. -use crate::{Balances, Runtime, RuntimeEvent, NORMAL_DISPATCH_RATIO}; +use crate::{Balances, Runtime, RuntimeEvent, Timestamp, NORMAL_DISPATCH_RATIO}; use frame_support::{ pallet_prelude::Weight, parameter_types, weights::constants::WEIGHT_REF_TIME_PER_SECOND, }; @@ -23,7 +23,7 @@ pub const MAXIMUM_BLOCK_WEIGHT: Weight = pub struct FixedGasPrice; impl FeeCalculator for FixedGasPrice { fn min_gas_price() -> (U256, Weight) { - (1.into(), Weight::from_ref_time(1)) + (1.into(), Weight::from_parts(1, 0u64)) } } @@ -41,7 +41,7 @@ pub struct FixedGasWeightMapping; impl GasWeightMapping for FixedGasWeightMapping { fn gas_to_weight(gas: u64, _without_base_weight: bool) -> Weight { - Weight::from_ref_time(gas.saturating_mul(WEIGHT_PER_GAS)) + Weight::from_parts(gas.saturating_mul(WEIGHT_PER_GAS), 0u64) } fn weight_to_gas(weight: Weight) -> u64 { weight.ref_time().wrapping_div(WEIGHT_PER_GAS) @@ -83,4 +83,6 @@ impl pallet_evm::Config for Runtime { type FindAuthor = (); // Currently not available. Would need some more thoughts how prioritisation fees could be handled. type WeightPerGas = (); type OnCreate = (); + type Timestamp = Timestamp; + type WeightInfo = (); } diff --git a/app-libs/sgx-runtime/src/lib.rs b/app-libs/sgx-runtime/src/lib.rs index e31821e288..124ee255da 100644 --- a/app-libs/sgx-runtime/src/lib.rs +++ b/app-libs/sgx-runtime/src/lib.rs @@ -39,7 +39,7 @@ pub use evm::{ }; use core::convert::{TryFrom, TryInto}; -use frame_support::weights::ConstantMultiplier; +use frame_support::{traits::ConstU32, weights::ConstantMultiplier}; use pallet_transaction_payment::CurrencyAdapter; use sp_api::impl_runtime_apis; use sp_core::OpaqueMetadata; @@ -234,6 +234,10 @@ impl pallet_balances::Config for Runtime { type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; type WeightInfo = (); + type HoldIdentifier = (); + type FreezeIdentifier = (); + type MaxHolds = ConstU32<0>; + type MaxFreezes = ConstU32<0>; } parameter_types! { @@ -257,6 +261,7 @@ impl pallet_sudo::Config for Runtime { impl pallet_parentchain::Config for Runtime { type WeightInfo = (); + type RuntimeEvent = RuntimeEvent; } // The plain sgx-runtime without the `evm-pallet` @@ -272,7 +277,7 @@ construct_runtime!( Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, TransactionPayment: pallet_transaction_payment::{Pallet, Storage, Event}, Sudo: pallet_sudo::{Pallet, Call, Config, Storage, Event}, - Parentchain: pallet_parentchain::{Pallet, Call, Storage}, + Parentchain: pallet_parentchain::{Pallet, Call, Storage, Event}, } ); @@ -292,7 +297,7 @@ construct_runtime!( Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, TransactionPayment: pallet_transaction_payment::{Pallet, Storage, Event}, Sudo: pallet_sudo::{Pallet, Call, Config, Storage, Event}, - Parentchain: pallet_parentchain::{Pallet, Call, Storage}, + Parentchain: pallet_parentchain::{Pallet, Call, Storage, Event}, Evm: pallet_evm::{Pallet, Call, Storage, Config, Event}, } @@ -317,6 +322,14 @@ impl_runtime_apis! { fn metadata() -> OpaqueMetadata { OpaqueMetadata::new(Runtime::metadata().into()) } + + fn metadata_at_version(version: u32) -> Option { + Runtime::metadata_at_version(version) + } + + fn metadata_versions() -> sp_std::vec::Vec { + Runtime::metadata_versions() + } } } diff --git a/app-libs/stf/Cargo.toml b/app-libs/stf/Cargo.toml index edbde3c121..865edd49c2 100644 --- a/app-libs/stf/Cargo.toml +++ b/app-libs/stf/Cargo.toml @@ -30,21 +30,21 @@ itp-utils = { default-features = false, path = "../../core-primitives/utils" } sp-io = { default-features = false, features = ["disable_oom", "disable_panic_handler", "disable_allocator"], path = "../../core-primitives/substrate-sgx/sp-io" } # Substrate dependencies -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -pallet-balances = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -pallet-sudo = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-application-crypto = { default-features = false, features = ["full_crypto"], git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-core = { default-features = false, features = ["full_crypto"], git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } +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-sudo = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } +sp-application-crypto = { default-features = false, features = ["full_crypto"], 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" } # scs / integritee -my-node-runtime = { package = "integritee-node-runtime", optional = true, git = "https://github.com/integritee-network/integritee-node.git", branch = "polkadot-v0.9.39" } -pallet-parentchain = { default-features = false, git = "https://github.com/integritee-network/pallets.git", branch = "polkadot-v0.9.39" } +my-node-runtime = { package = "integritee-node-runtime", optional = true, git = "https://github.com/integritee-network/integritee-node.git", branch = "polkadot-v0.9.42" } +pallet-parentchain = { default-features = false, git = "https://github.com/integritee-network/pallets.git", branch = "polkadot-v0.9.42" } [dev-dependencies] -sp-keyring = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } +sp-keyring = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } [features] default = ["std"] diff --git a/app-libs/stf/src/stf_sgx.rs b/app-libs/stf/src/stf_sgx.rs index 1ecfd79162..54dd3d96a9 100644 --- a/app-libs/stf/src/stf_sgx.rs +++ b/app-libs/stf/src/stf_sgx.rs @@ -267,10 +267,9 @@ where <::Lookup as StaticLookup>::Source: From, Runtime::Balance: From, { - pallet_balances::Call::::set_balance { + pallet_balances::Call::::force_set_balance { who: enclave_account.into(), new_free: 1000.into(), - new_reserved: 0.into(), } .dispatch_bypass_filter(Runtime::RuntimeOrigin::root()) .map_err(|e| { diff --git a/app-libs/stf/src/test_genesis.rs b/app-libs/stf/src/test_genesis.rs index a3c04f52da..b96af31dc3 100644 --- a/app-libs/stf/src/test_genesis.rs +++ b/app-libs/stf/src/test_genesis.rs @@ -63,14 +63,10 @@ pub fn test_genesis_setup(state: &mut impl SgxExternalitiesTrait) { set_sudo_account(state, &ALICE_ENCODED); trace!("Set new sudo account: {:?}", &ALICE_ENCODED); - let mut endowees: Vec<(AccountId32, Balance, Balance)> = vec![ - (endowed_account().public().into(), ENDOWED_ACC_FUNDS, ENDOWED_ACC_FUNDS), - ( - second_endowed_account().public().into(), - SECOND_ENDOWED_ACC_FUNDS, - SECOND_ENDOWED_ACC_FUNDS, - ), - (ALICE_ENCODED.into(), ALICE_FUNDS, ALICE_FUNDS), + let mut endowees: Vec<(AccountId32, Balance)> = vec![ + (endowed_account().public().into(), ENDOWED_ACC_FUNDS), + (second_endowed_account().public().into(), SECOND_ENDOWED_ACC_FUNDS), + (ALICE_ENCODED.into(), ALICE_FUNDS), ]; append_funded_alice_evm_account(&mut endowees); @@ -79,16 +75,15 @@ pub fn test_genesis_setup(state: &mut impl SgxExternalitiesTrait) { } #[cfg(feature = "evm")] -fn append_funded_alice_evm_account(endowees: &mut Vec<(AccountId32, Balance, Balance)>) { +fn append_funded_alice_evm_account(endowees: &mut Vec<(AccountId32, Balance)>) { let alice_evm = get_evm_account(&ALICE_ENCODED.into()); let alice_evm_substrate_version = HashedAddressMapping::into_account_id(alice_evm); - let mut other: Vec<(AccountId32, Balance, Balance)> = - vec![(alice_evm_substrate_version, ALICE_FUNDS, ALICE_FUNDS)]; + let mut other: Vec<(AccountId32, Balance)> = vec![(alice_evm_substrate_version, ALICE_FUNDS)]; endowees.append(other.as_mut()); } #[cfg(not(feature = "evm"))] -fn append_funded_alice_evm_account(_: &mut Vec<(AccountId32, Balance, Balance)>) {} +fn append_funded_alice_evm_account(_: &mut Vec<(AccountId32, Balance)>) {} fn set_sudo_account(state: &mut impl SgxExternalitiesTrait, account_encoded: &[u8]) { state.execute_with(|| { @@ -98,16 +93,15 @@ fn set_sudo_account(state: &mut impl SgxExternalitiesTrait, account_encoded: &[u pub fn endow( state: &mut impl SgxExternalitiesTrait, - endowees: impl IntoIterator, + endowees: impl IntoIterator, ) { state.execute_with(|| { for e in endowees.into_iter() { let account = e.0; - ita_sgx_runtime::BalancesCall::::set_balance { + ita_sgx_runtime::BalancesCall::::force_set_balance { who: MultiAddress::Id(account.clone()), new_free: e.1, - new_reserved: e.2, } .dispatch_bypass_filter(ita_sgx_runtime::RuntimeOrigin::root()) .map_err(|e| StfError::Dispatch(format!("Balance Set Balance error: {:?}", e.error))) diff --git a/app-libs/stf/src/trusted_call.rs b/app-libs/stf/src/trusted_call.rs index 690af26882..1f13721f6b 100644 --- a/app-libs/stf/src/trusted_call.rs +++ b/app-libs/stf/src/trusted_call.rs @@ -198,10 +198,9 @@ where free_balance, reserved_balance ); - ita_sgx_runtime::BalancesCall::::set_balance { + ita_sgx_runtime::BalancesCall::::force_set_balance { who: MultiAddress::Id(who), new_free: free_balance, - new_reserved: reserved_balance, } .dispatch_bypass_filter(ita_sgx_runtime::RuntimeOrigin::root()) .map_err(|e| { @@ -407,10 +406,9 @@ fn unshield_funds(account: AccountId, amount: u128) -> Result<(), StfError> { return Err(StfError::MissingFunds) } - ita_sgx_runtime::BalancesCall::::set_balance { + ita_sgx_runtime::BalancesCall::::force_set_balance { who: MultiAddress::Id(account), new_free: account_info.data.free - amount, - new_reserved: account_info.data.reserved, } .dispatch_bypass_filter(ita_sgx_runtime::RuntimeOrigin::root()) .map_err(|e| StfError::Dispatch(format!("Unshield funds error: {:?}", e.error)))?; @@ -419,10 +417,9 @@ fn unshield_funds(account: AccountId, amount: u128) -> Result<(), StfError> { fn shield_funds(account: AccountId, amount: u128) -> Result<(), StfError> { let account_info = System::account(&account); - ita_sgx_runtime::BalancesCall::::set_balance { + ita_sgx_runtime::BalancesCall::::force_set_balance { who: MultiAddress::Id(account), new_free: account_info.data.free + amount, - new_reserved: account_info.data.reserved, } .dispatch_bypass_filter(ita_sgx_runtime::RuntimeOrigin::root()) .map_err(|e| StfError::Dispatch(format!("Shield funds error: {:?}", e.error)))?; diff --git a/cli/Cargo.toml b/cli/Cargo.toml index b318a3437c..d9f87ae28d 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -25,22 +25,23 @@ thiserror = "1.0" ws = { version = "0.9.1", features = ["ssl"] } # scs / integritee -my-node-runtime = { package = "integritee-node-runtime", git = "https://github.com/integritee-network/integritee-node.git", branch = "polkadot-v0.9.39" } -pallet-evm = { optional = true, git = "https://github.com/integritee-network/frontier.git", branch = "polkadot-v0.9.39" } -pallet-teerex = { git = "https://github.com/integritee-network/pallets.git", branch = "polkadot-v0.9.39" } +my-node-runtime = { package = "integritee-node-runtime", git = "https://github.com/integritee-network/integritee-node.git", branch = "polkadot-v0.9.42" } +pallet-evm = { optional = true, git = "https://github.com/integritee-network/frontier.git", branch = "bar/polkadot-v0.9.42" } +pallet-teerex = { git = "https://github.com/integritee-network/pallets.git", branch = "polkadot-v0.9.42" } # `default-features = false` to remove the jsonrpsee dependency. -substrate-api-client = { default-features = false, features = ["std", "ws-client"], git = "https://github.com/scs/substrate-api-client.git", branch = "polkadot-v0.9.39" } -substrate-client-keystore = { git = "https://github.com/scs/substrate-api-client.git", branch = "polkadot-v0.9.39" } -teerex-primitives = { git = "https://github.com/integritee-network/pallets.git", branch = "polkadot-v0.9.39" } +substrate-api-client = { default-features = false, features = ["std", "ws-client"], git = "https://github.com/scs/substrate-api-client.git", branch = "polkadot-v0.9.42-tag-v0.10.0" } +substrate-client-keystore = { git = "https://github.com/scs/substrate-api-client.git", branch = "polkadot-v0.9.42-tag-v0.10.0" } +teerex-primitives = { git = "https://github.com/integritee-network/pallets.git", branch = "polkadot-v0.9.42" } # substrate dependencies -frame-system = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -pallet-balances = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sc-keystore = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-application-crypto = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-core = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-keyring = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-runtime = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } +frame-system = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } +pallet-balances = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } +sc-keystore = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } +sp-application-crypto = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } +sp-core = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } +sp-keyring = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } +sp-keystore = { 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" } # local dependencies ita-stf = { path = "../app-libs/stf" } diff --git a/cli/demo_teeracle_whitelist.sh b/cli/demo_teeracle_whitelist.sh index 5da2637fb5..d56b01728e 100755 --- a/cli/demo_teeracle_whitelist.sh +++ b/cli/demo_teeracle_whitelist.sh @@ -70,12 +70,12 @@ echo "Using client binary ${CLIENT_BIN}" echo "Using node uri ${NODEURL}:${NPORT}" echo "Using trusted-worker uri ${WORKER1URL}:${WORKER1PORT}" echo "Using worker market data update interval ${INTERVAL}" -echo "Count the update events for ${DURATION}" +echo "Count the update events for ${DURATION} blocks" echo "" COIN_GECKO="https://api.coingecko.com/" COIN_MARKET_CAP="https://pro-api.coinmarketcap.com/" -let "MIN_EXPECTED_NUM_OF_EVENTS=$DURATION/$INTERVAL-3" +let "MIN_EXPECTED_NUM_OF_EVENTS=$DURATION*6/$INTERVAL-3" echo "Minimum expected number of events with a single oracle source: ${MIN_EXPECTED_NUM_OF_EVENTS}" let "MIN_EXPECTED_NUM_OF_EVENTS_2 = 2*$MIN_EXPECTED_NUM_OF_EVENTS" @@ -94,7 +94,7 @@ echo "Reading MRENCLAVE from worker list: ${MRENCLAVE}" [[ -z $MRENCLAVE ]] && { echo "MRENCLAVE is empty. cannot continue" ; exit 1; } echo "" -echo "Listen to ExchangeRateUpdated events for ${DURATION} seconds. There should be no trusted oracle source!" +echo "Listen to ExchangeRateUpdated events for ${DURATION} blocks. There should be no trusted oracle source!" #${CLIENT} ${LISTEN_TO_EXCHANGE_RATE_EVENTS_CMD} ${DURATION} #echo "" @@ -107,12 +107,12 @@ ${CLIENT} ${ADD_TO_WHITELIST_CMD} //Alice ${COIN_GECKO} ${MRENCLAVE} echo "MRENCLAVE in whitelist for ${COIN_GECKO}" echo "" -echo "Listen to ExchangeRateUpdated events for ${DURATION} seconds, after a trusted oracle source has been added to the whitelist." +echo "Listen to ExchangeRateUpdated events for ${DURATION} blocks, after a trusted oracle source has been added to the whitelist." #${CLIENT} ${LISTEN_TO_EXCHANGE_RATE_EVENTS_CMD} ${DURATION} #echo "" read EVENTS_COUNT <<< $($CLIENT ${LISTEN_TO_EXCHANGE_RATE_EVENTS_CMD} ${DURATION} | awk '/ EVENTS_COUNT: / { print $2; exit }') -echo "Got ${EVENTS_COUNT} exchange rate updates from the trusted oracle source in ${DURATION} second(s)" +echo "Got ${EVENTS_COUNT} exchange rate updates from the trusted oracle source in ${DURATION} blocks(s)" echo "" echo "Add ${COIN_MARKET_CAP} for ${MRENCLAVE} as trusted oracle source" @@ -120,12 +120,12 @@ ${CLIENT} ${ADD_TO_WHITELIST_CMD} //Alice ${COIN_MARKET_CAP} ${MRENCLAVE} echo "MRENCLAVE in whitelist for ${COIN_MARKET_CAP}" echo "" -echo "Listen to ExchangeRateUpdated events for ${DURATION} seconds, after a second trusted oracle source has been added to the whitelist." +echo "Listen to ExchangeRateUpdated events for ${DURATION} blocks, after a second trusted oracle source has been added to the whitelist." #${CLIENT} ${LISTEN_TO_EXCHANGE_RATE_EVENTS_CMD} ${DURATION} #echo "" read EVENTS_COUNT_2 <<< $($CLIENT ${LISTEN_TO_EXCHANGE_RATE_EVENTS_CMD} ${DURATION} | awk '/ EVENTS_COUNT: / { print $2; exit }') -echo "Got ${EVENTS_COUNT_2} exchange rate updates from 2 trusted oracle sources in ${DURATION} second(s)" +echo "Got ${EVENTS_COUNT_2} exchange rate updates from 2 trusted oracle sources in ${DURATION} blocks(s)" echo "" echo "Results :" diff --git a/cli/src/base_cli/commands/listen.rs b/cli/src/base_cli/commands/listen.rs index f50b640b78..03d43ecf31 100644 --- a/cli/src/base_cli/commands/listen.rs +++ b/cli/src/base_cli/commands/listen.rs @@ -77,14 +77,15 @@ impl ListenCommand { println!(">>>>>>>>>> integritee event: {:?}", ee); count += 1; match &ee { - my_node_runtime::pallet_teerex::Event::AddedEnclave( - accountid, - url, - ) => { + my_node_runtime::pallet_teerex::Event::AddedEnclave{ + registered_by, + worker_url, .. + } + => { println!( "AddedEnclave: {:?} at url {}", - accountid, - String::from_utf8(url.to_vec()) + registered_by, + String::from_utf8(worker_url.to_vec()) .unwrap_or_else(|_| "error".to_string()) ); }, diff --git a/cli/src/base_cli/commands/transfer.rs b/cli/src/base_cli/commands/transfer.rs index 04c26a1d34..d5894f80c1 100644 --- a/cli/src/base_cli/commands/transfer.rs +++ b/cli/src/base_cli/commands/transfer.rs @@ -24,7 +24,7 @@ use log::*; use my_node_runtime::Balance; use sp_core::{crypto::Ss58Codec, sr25519 as sr25519_core, Pair}; use substrate_api_client::{ - extrinsic::BalancesExtrinsics, GetAccountInformation, SubmitAndWatch, XtStatus, + extrinsic::BalancesExtrinsics, GetAccountInformation, SubmitAndWatchUntilSuccess, }; #[derive(Parser)] @@ -47,12 +47,12 @@ impl TransferCommand { info!("to ss58 is {}", to_account.to_ss58check()); let mut api = get_chain_api(cli); api.set_signer(ParentchainExtrinsicSigner::new(sr25519_core::Pair::from(from_account))); - let xt = api.balance_transfer(Address::Id(to_account.clone()), self.amount); - let tx_hash = api - .submit_and_watch_extrinsic_until(xt, XtStatus::InBlock) - .unwrap() - .extrinsic_hash; - println!("[+] TrustedOperation got finalized. Hash: {:?}\n", tx_hash); + let xt = api.balance_transfer_allow_death(Address::Id(to_account.clone()), self.amount); + let tx_report = api.submit_and_watch_extrinsic_until_success(xt, false).unwrap(); + println!( + "[+] L1 extrinsic success. extrinsic hash: {:?} / status: {:?}", + tx_report.extrinsic_hash, tx_report.status + ); let result = api.get_account_data(&to_account).unwrap().unwrap(); let balance = result.free; println!("balance for {} is now {}", to_account, balance); diff --git a/cli/src/base_cli/mod.rs b/cli/src/base_cli/mod.rs index 2279bceb23..117d1e317f 100644 --- a/cli/src/base_cli/mod.rs +++ b/cli/src/base_cli/mod.rs @@ -21,21 +21,21 @@ use crate::{ shield_funds::ShieldFundsCommand, transfer::TransferCommand, }, command_utils::*, - Cli, CliResult, CliResultOk, + Cli, CliResult, CliResultOk, ED25519_KEY_TYPE, SR25519_KEY_TYPE, }; use base58::ToBase58; use chrono::{DateTime, Utc}; use clap::Subcommand; use itc_rpc_client::direct_client::DirectApi; use itp_node_api::api_client::PalletTeerexApi; -use sp_application_crypto::{ed25519, sr25519}; -use sp_core::{crypto::Ss58Codec, Pair}; +use sp_core::crypto::Ss58Codec; +use sp_keystore::Keystore; use std::{ path::PathBuf, time::{Duration, UNIX_EPOCH}, }; use substrate_api_client::Metadata; -use substrate_client_keystore::{KeystoreExt, LocalKeystore}; +use substrate_client_keystore::LocalKeystore; mod commands; @@ -91,8 +91,8 @@ impl BaseCommand { fn new_account() -> CliResult { let store = LocalKeystore::open(PathBuf::from(&KEYSTORE_PATH), None).unwrap(); - let key: sr25519::AppPair = store.generate().unwrap(); - let key_base58 = key.public().to_ss58check(); + let key = LocalKeystore::sr25519_generate_new(&store, SR25519_KEY_TYPE, None).unwrap(); + let key_base58 = key.to_ss58check(); drop(store); println!("{}", key_base58); Ok(CliResultOk::PubKeysBase58 { @@ -105,14 +105,14 @@ fn list_accounts() -> CliResult { let store = LocalKeystore::open(PathBuf::from(&KEYSTORE_PATH), None).unwrap(); println!("sr25519 keys:"); let mut keys_sr25519 = vec![]; - for pubkey in store.public_keys::().unwrap().into_iter() { + for pubkey in store.sr25519_public_keys(SR25519_KEY_TYPE).into_iter() { let key_ss58 = pubkey.to_ss58check(); println!("{}", key_ss58); keys_sr25519.push(key_ss58); } println!("ed25519 keys:"); let mut keys_ed25519 = vec![]; - for pubkey in store.public_keys::().unwrap().into_iter() { + for pubkey in store.ed25519_public_keys(ED25519_KEY_TYPE).into_iter() { let key_ss58 = pubkey.to_ss58check(); println!("{}", key_ss58); keys_ed25519.push(key_ss58); diff --git a/cli/src/benchmark/mod.rs b/cli/src/benchmark/mod.rs index bae12f9082..f67eaae984 100644 --- a/cli/src/benchmark/mod.rs +++ b/cli/src/benchmark/mod.rs @@ -23,7 +23,7 @@ use crate::{ decode_balance, get_identifiers, get_keystore_path, get_pair_from_str, }, trusted_operation::{get_json_request, get_state, perform_trusted_operation, wait_until}, - Cli, CliResult, CliResultOk, + Cli, CliResult, CliResultOk, SR25519_KEY_TYPE, }; use codec::Decode; use hdrhistogram::Histogram; @@ -40,6 +40,7 @@ use rayon::prelude::*; use sgx_crypto_helper::rsa3072::Rsa3072PubKey; use sp_application_crypto::sr25519; use sp_core::{sr25519 as sr25519_core, Pair}; +use sp_keystore::Keystore; use std::{ boxed::Box, string::ToString, @@ -48,7 +49,7 @@ use std::{ time::Instant, vec::Vec, }; -use substrate_client_keystore::{KeystoreExt, LocalKeystore}; +use substrate_client_keystore::LocalKeystore; // Needs to be above the existential deposit minimum, otherwise an account will not // be created and the state is not increased. @@ -141,8 +142,8 @@ impl BenchmarkCommand { println!("Initializing account {}", i); // Create new account to use. - let a: sr25519::AppPair = store.generate().unwrap(); - let account = get_pair_from_str(trusted_args, a.public().to_string().as_str()); + let a = LocalKeystore::sr25519_generate_new(&store, SR25519_KEY_TYPE, None).unwrap(); + let account = get_pair_from_str(trusted_args, a.to_string().as_str()); let initial_balance = 10000000; // Transfer amount from Alice to new account. @@ -190,9 +191,10 @@ impl BenchmarkCommand { } // Create new account. - let account_keys: sr25519::AppPair = store.generate().unwrap(); + let account_keys = LocalKeystore::sr25519_generate_new(&store, SR25519_KEY_TYPE, None).unwrap(); + let new_account = - get_pair_from_str(trusted_args, account_keys.public().to_string().as_str()); + get_pair_from_str(trusted_args, account_keys.to_string().as_str()); println!(" Transfer amount: {}", EXISTENTIAL_DEPOSIT); diff --git a/cli/src/lib.rs b/cli/src/lib.rs index dd7d783d64..7f51946c13 100644 --- a/cli/src/lib.rs +++ b/cli/src/lib.rs @@ -45,12 +45,16 @@ pub mod commands; use crate::commands::Commands; use clap::Parser; +use sp_application_crypto::KeyTypeId; use sp_core::{H160, H256}; use substrate_api_client::Metadata; use thiserror::Error; const VERSION: &str = env!("CARGO_PKG_VERSION"); +pub(crate) const SR25519_KEY_TYPE: KeyTypeId = KeyTypeId(*b"sr25"); +pub(crate) const ED25519_KEY_TYPE: KeyTypeId = KeyTypeId(*b"ed25"); + #[derive(Parser)] #[clap(name = "integritee-cli")] #[clap(version = VERSION)] diff --git a/cli/src/trusted_base_cli/mod.rs b/cli/src/trusted_base_cli/mod.rs index e32c44177b..313c859d00 100644 --- a/cli/src/trusted_base_cli/mod.rs +++ b/cli/src/trusted_base_cli/mod.rs @@ -22,12 +22,12 @@ use crate::{ }, trusted_cli::TrustedCli, trusted_command_utils::get_keystore_path, - Cli, CliResult, CliResultOk, + Cli, CliResult, CliResultOk, ED25519_KEY_TYPE, SR25519_KEY_TYPE, }; use log::*; -use sp_application_crypto::{ed25519, sr25519}; -use sp_core::{crypto::Ss58Codec, Pair}; -use substrate_client_keystore::{KeystoreExt, LocalKeystore}; +use sp_core::crypto::Ss58Codec; +use sp_keystore::Keystore; +use substrate_client_keystore::LocalKeystore; mod commands; @@ -72,10 +72,10 @@ impl TrustedBaseCommand { fn new_account(trusted_args: &TrustedCli) -> CliResult { let store = LocalKeystore::open(get_keystore_path(trusted_args), None).unwrap(); - let key: sr25519::AppPair = store.generate().unwrap(); + let key = LocalKeystore::sr25519_generate_new(&store, SR25519_KEY_TYPE, None).unwrap(); drop(store); - info!("new account {}", key.public().to_ss58check()); - let key_str = key.public().to_ss58check(); + info!("new account {}", key.to_ss58check()); + let key_str = key.to_ss58check(); println!("{}", key_str); Ok(CliResultOk::PubKeysBase58 { pubkeys_sr25519: Some(vec![key_str]), pubkeys_ed25519: None }) @@ -84,13 +84,12 @@ fn new_account(trusted_args: &TrustedCli) -> CliResult { fn list_accounts(trusted_args: &TrustedCli) -> CliResult { let store = LocalKeystore::open(get_keystore_path(trusted_args), None).unwrap(); info!("sr25519 keys:"); - for pubkey in store.public_keys::().unwrap().into_iter() { + for pubkey in store.sr25519_public_keys(SR25519_KEY_TYPE).into_iter() { println!("{}", pubkey.to_ss58check()); } info!("ed25519 keys:"); let pubkeys: Vec = store - .public_keys::() - .unwrap() + .ed25519_public_keys(ED25519_KEY_TYPE) .into_iter() .map(|pubkey| pubkey.to_ss58check()) .collect(); diff --git a/cli/src/trusted_command_utils.rs b/cli/src/trusted_command_utils.rs index 24a074e1df..f3573c236e 100644 --- a/cli/src/trusted_command_utils.rs +++ b/cli/src/trusted_command_utils.rs @@ -122,12 +122,9 @@ pub(crate) fn get_pair_from_str(trusted_args: &TrustedCli, account: &str) -> sr2 let store = LocalKeystore::open(get_keystore_path(trusted_args), None) .expect("store should exist"); info!("store opened"); - let _pair = store - .key_pair::( - &sr25519::Public::from_ss58check(account).unwrap().into(), - ) - .unwrap() - .unwrap(); + let public_key = &sr25519::AppPublic::from_ss58check(account).unwrap(); + info!("public_key: {:#?}", &public_key); + let _pair = store.key_pair::(public_key).unwrap().unwrap(); info!("key pair fetched"); drop(store); _pair.into() diff --git a/cli/src/trusted_operation.rs b/cli/src/trusted_operation.rs index 8cb8474683..24bf9f1035 100644 --- a/cli/src/trusted_operation.rs +++ b/cli/src/trusted_operation.rs @@ -21,7 +21,7 @@ use crate::{ trusted_cli::TrustedCli, Cli, }; -use base58::FromBase58; +use base58::{FromBase58, ToBase58}; use codec::{Decode, Encode}; use ita_stf::{Getter, TrustedOperation}; use itc_rpc_client::direct_client::{DirectApi, DirectClient}; @@ -60,7 +60,7 @@ pub(crate) fn perform_trusted_operation( top: &TrustedOperation, ) -> TrustedOpResult { match top { - TrustedOperation::indirect_call(_) => send_request(cli, trusted_args, top), + TrustedOperation::indirect_call(_) => send_indirect_request(cli, trusted_args, top), TrustedOperation::direct_call(_) => send_direct_request(cli, trusted_args, top), TrustedOperation::get(getter) => execute_getter_from_cli_args(cli, trusted_args, getter), } @@ -116,7 +116,7 @@ pub(crate) fn get_state( Ok(maybe_state) } -fn send_request( +fn send_indirect_request( cli: &Cli, trusted_args: &TrustedCli, trusted_operation: &TrustedOperation, @@ -126,7 +126,11 @@ fn send_request( let call_encrypted = encryption_key.encrypt(&trusted_operation.encode()).unwrap(); let shard = read_shard(trusted_args).unwrap(); - + debug!( + "indirect send_request: trusted operation: {:?}, shard: {}", + trusted_operation, + shard.encode().to_base58() + ); let arg_signer = &trusted_args.xt_signer; let signer = get_pair_from_str(arg_signer); chain_api.set_signer(ParentchainExtrinsicSigner::new(sr25519_core::Pair::from(signer))); @@ -142,8 +146,8 @@ fn send_request( .unwrap(); info!( - "Trusted call extrinsic sent and successfully included in parentchain block with hash {:?}.", - block_hash + "Trusted call extrinsic sent for shard {} and successfully included in parentchain block with hash {:?}.", + shard.encode().to_base58(), block_hash ); info!("Waiting for execution confirmation from enclave..."); let mut subscription = chain_api.subscribe_events().unwrap(); @@ -223,8 +227,11 @@ fn send_direct_request( let encryption_key = get_shielding_key(cli).unwrap(); let shard = read_shard(trusted_args).unwrap(); let jsonrpc_call: String = get_json_request(shard, operation_call, encryption_key); - - debug!("get direct api"); + debug!( + "send_direct_request: trusted operation: {:?}, shard: {}", + operation_call, + shard.encode().to_base58() + ); let direct_api = get_worker_api_direct(cli); debug!("setup sender and receiver"); diff --git a/core-primitives/attestation-handler/Cargo.toml b/core-primitives/attestation-handler/Cargo.toml index 811dfff216..19690b16d7 100644 --- a/core-primitives/attestation-handler/Cargo.toml +++ b/core-primitives/attestation-handler/Cargo.toml @@ -51,8 +51,8 @@ itp-types = { path = "../types", default-features = false } httparse = { default-features = false, git = "https://github.com/integritee-network/httparse-sgx", branch = "sgx-experimental" } # substrate deps -sp-core = { default-features = false, features = ["full_crypto"], git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } +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" } [features] default = ["std"] diff --git a/core-primitives/attestation-handler/src/attestation_handler.rs b/core-primitives/attestation-handler/src/attestation_handler.rs index fa2058d563..91bfc77f3a 100644 --- a/core-primitives/attestation-handler/src/attestation_handler.rs +++ b/core-primitives/attestation-handler/src/attestation_handler.rs @@ -48,7 +48,7 @@ use sgx_tcrypto::{rsgx_sha256_slice, SgxEccHandle}; use sgx_tse::{rsgx_create_report, rsgx_verify_report}; use sgx_types::{ c_int, sgx_epid_group_id_t, sgx_quote_nonce_t, sgx_quote_sign_type_t, sgx_report_data_t, - sgx_spid_t, sgx_status_t, sgx_status_t::SGX_ERROR_UNEXPECTED, sgx_target_info_t, SgxResult, *, + sgx_spid_t, sgx_status_t, sgx_target_info_t, SgxResult, *, }; use sp_core::{ed25519, Pair}; use std::{ @@ -678,7 +678,7 @@ where .map_err(|e| EnclaveError::Other(e.into())) } - /// Returns Ok if the verification of the quote by the quote verification enclave (QVE) was successful + /// Returns Ok if the verification of the quote by the quote verification enclave (QVE) was successful pub fn ecdsa_quote_verification(&self, quote: Vec) -> SgxResult<()> { let mut app_enclave_target_info: sgx_target_info_t = unsafe { std::mem::zeroed() }; let quote_collateral: sgx_ql_qve_collateral_t = unsafe { std::mem::zeroed() }; diff --git a/core-primitives/attestation-handler/src/cert.rs b/core-primitives/attestation-handler/src/cert.rs index ae158f661b..99c0d8529b 100644 --- a/core-primitives/attestation-handler/src/cert.rs +++ b/core-primitives/attestation-handler/src/cert.rs @@ -283,11 +283,11 @@ where // Obtain Netscape Comment offset += 1; let mut payload = cert_der[offset..offset + len].to_vec(); - println!("payload in mra cert verifier is: {:#?}", &payload); + trace!("payload in mra cert verifier is: {:?}", &payload); if is_payload_base64_encoded { payload = base64::decode(&payload[..]).or(Err(sgx_status_t::SGX_ERROR_UNEXPECTED))?; } - println!("payload in mra cert verifier is: {:#?}", &payload); + trace!("payload in mra cert verifier is: {:?}", &payload); if !is_dcap { // Extract each field let mut iter = payload.split(|x| *x == b'|'); diff --git a/core-primitives/enclave-api/Cargo.toml b/core-primitives/enclave-api/Cargo.toml index da7672c569..00500004dd 100644 --- a/core-primitives/enclave-api/Cargo.toml +++ b/core-primitives/enclave-api/Cargo.toml @@ -15,12 +15,12 @@ sgx_crypto_helper = { branch = "master", git = "https://github.com/apache/teacla sgx_types = { branch = "master", git = "https://github.com/apache/teaclave-sgx-sdk.git" } sgx_urts = { branch = "master", git = "https://github.com/apache/teaclave-sgx-sdk.git" } -frame-support = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-core = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-finality-grandpa = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-runtime = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } +frame-support = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } +sp-consensus-grandpa = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } +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 = "polkadot-v0.9.39" } +teerex-primitives = { git = "https://github.com/integritee-network/pallets.git", branch = "polkadot-v0.9.42" } itc-parentchain = { path = "../../core/parentchain/parentchain-crate" } itp-enclave-api-ffi = { path = "ffi" } diff --git a/core-primitives/extrinsics-factory/Cargo.toml b/core-primitives/extrinsics-factory/Cargo.toml index cc6f7e4893..e36a6f6f40 100644 --- a/core-primitives/extrinsics-factory/Cargo.toml +++ b/core-primitives/extrinsics-factory/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" # sgx dependencies sgx_tstd = { branch = "master", git = "https://github.com/apache/teaclave-sgx-sdk.git", optional = true } sgx_types = { branch = "master", git = "https://github.com/apache/teaclave-sgx-sdk.git" } -substrate-api-client = { default-features = false, git = "https://github.com/scs/substrate-api-client.git", branch = "polkadot-v0.9.39" } +substrate-api-client = { default-features = false, git = "https://github.com/scs/substrate-api-client.git", branch = "polkadot-v0.9.42-tag-v0.10.0" } # local dependencies itp-node-api = { path = "../node-api", default-features = false } @@ -24,8 +24,8 @@ thiserror = { version = "1.0", optional = true } # no-std dependencies codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } log = { version = "0.4", default-features = false } -sp-core = { default-features = false, features = ["full_crypto"], git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } +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" } [features] default = ["std"] diff --git a/core-primitives/hashing/Cargo.toml b/core-primitives/hashing/Cargo.toml index 29be6428c1..c2e9f248f0 100644 --- a/core-primitives/hashing/Cargo.toml +++ b/core-primitives/hashing/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" [dependencies] # substrate -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } [features] default = ["std"] diff --git a/core-primitives/node-api/api-client-extensions/Cargo.toml b/core-primitives/node-api/api-client-extensions/Cargo.toml index 8514d29317..94db01fdac 100644 --- a/core-primitives/node-api/api-client-extensions/Cargo.toml +++ b/core-primitives/node-api/api-client-extensions/Cargo.toml @@ -10,13 +10,13 @@ codec = { package = "parity-scale-codec", version = "3.0.0", features = ["derive thiserror = { version = "1.0" } # substrate -sp-core = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-finality-grandpa = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-runtime = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } +sp-consensus-grandpa = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } +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" } # scs # `default-features = false` to remove the jsonrpsee dependency. -substrate-api-client = { default-features = false, features = ["std"], git = "https://github.com/scs/substrate-api-client.git", branch = "polkadot-v0.9.39" } +substrate-api-client = { default-features = false, features = ["std"], git = "https://github.com/scs/substrate-api-client.git", branch = "polkadot-v0.9.42-tag-v0.10.0" } # local deps itp-api-client-types = { path = "../api-client-types" } diff --git a/core-primitives/node-api/api-client-extensions/src/chain.rs b/core-primitives/node-api/api-client-extensions/src/chain.rs index fa34ad0883..7842fa0ef1 100644 --- a/core-primitives/node-api/api-client-extensions/src/chain.rs +++ b/core-primitives/node-api/api-client-extensions/src/chain.rs @@ -21,7 +21,7 @@ use itp_types::{ parentchain::{BlockNumber, Hash, Header, StorageProof}, H256, }; -use sp_finality_grandpa::{AuthorityList, VersionedAuthorityList, GRANDPA_AUTHORITIES_KEY}; +use sp_consensus_grandpa::{AuthorityList, VersionedAuthorityList, GRANDPA_AUTHORITIES_KEY}; use sp_runtime::traits::GetRuntimeBlockType; use substrate_api_client::{ rpc::Request, serde_impls::StorageKey, storage_key, Api, ExtrinsicParams, FrameSystemConfig, diff --git a/core-primitives/node-api/api-client-types/Cargo.toml b/core-primitives/node-api/api-client-types/Cargo.toml index 866f23881b..d8f8452d5f 100644 --- a/core-primitives/node-api/api-client-types/Cargo.toml +++ b/core-primitives/node-api/api-client-types/Cargo.toml @@ -6,14 +6,14 @@ edition = "2021" [dependencies] # integritee-node -my-node-runtime = { package = "integritee-node-runtime", optional = true, git = "https://github.com/integritee-network/integritee-node.git", branch = "polkadot-v0.9.39" } +my-node-runtime = { package = "integritee-node-runtime", optional = true, git = "https://github.com/integritee-network/integritee-node.git", branch = "polkadot-v0.9.42" } # scs -substrate-api-client = { default-features = false, git = "https://github.com/scs/substrate-api-client.git", branch = "polkadot-v0.9.39" } +substrate-api-client = { default-features = false, git = "https://github.com/scs/substrate-api-client.git", branch = "polkadot-v0.9.42-tag-v0.10.0" } # substrate -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } +sp-core = { default-features = false, 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" } # local itp-types = { default-features = false, path = "../../types" } diff --git a/core-primitives/node-api/factory/Cargo.toml b/core-primitives/node-api/factory/Cargo.toml index d37f76fa82..234203ff24 100644 --- a/core-primitives/node-api/factory/Cargo.toml +++ b/core-primitives/node-api/factory/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" thiserror = { version = "1.0" } # substrate -sp-core = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } +sp-core = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } # local itp-api-client-types = { path = "../api-client-types" } diff --git a/core-primitives/node-api/metadata/Cargo.toml b/core-primitives/node-api/metadata/Cargo.toml index 3798a5ac47..4e336530dd 100644 --- a/core-primitives/node-api/metadata/Cargo.toml +++ b/core-primitives/node-api/metadata/Cargo.toml @@ -13,7 +13,7 @@ derive_more = { version = "0.99.5" } itp-api-client-types = { default-features = false, path = "../api-client-types" } # substrate -sp-core = { git = "https://github.com/paritytech/substrate.git", default-features = false, branch = "polkadot-v0.9.39" } +sp-core = { git = "https://github.com/paritytech/substrate.git", default-features = false, branch = "polkadot-v0.9.42" } [features] default = ["std"] diff --git a/core-primitives/ocall-api/Cargo.toml b/core-primitives/ocall-api/Cargo.toml index 5b4e0057f9..f7584c86f3 100644 --- a/core-primitives/ocall-api/Cargo.toml +++ b/core-primitives/ocall-api/Cargo.toml @@ -12,9 +12,9 @@ derive_more = { version = "0.99.5" } sgx_types = { branch = "master", git = "https://github.com/apache/teaclave-sgx-sdk.git" } # substrate deps -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } +sp-core = { default-features = false, 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" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } # local deps itp-storage = { path = "../storage", default-features = false } diff --git a/core-primitives/sgx-runtime-primitives/Cargo.toml b/core-primitives/sgx-runtime-primitives/Cargo.toml index 5b69981eb9..3c25e3a126 100644 --- a/core-primitives/sgx-runtime-primitives/Cargo.toml +++ b/core-primitives/sgx-runtime-primitives/Cargo.toml @@ -7,10 +7,10 @@ edition = "2021" [dependencies] # Substrate dependencies -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -pallet-balances = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } +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" } +sp-core = { default-features = false, 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" } [features] default = ["std"] diff --git a/core-primitives/sgx/crypto/Cargo.toml b/core-primitives/sgx/crypto/Cargo.toml index ad7a6e5cb7..2e3e7c7072 100644 --- a/core-primitives/sgx/crypto/Cargo.toml +++ b/core-primitives/sgx/crypto/Cargo.toml @@ -23,7 +23,7 @@ sgx_tstd = { branch = "master", git = "https://github.com/apache/teaclave-sgx-sd sgx_types = { branch = "master", git = "https://github.com/apache/teaclave-sgx-sdk.git" } # substrate deps -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } # local deps itp-settings = { path = "../../settings" } diff --git a/core-primitives/stf-executor/Cargo.toml b/core-primitives/stf-executor/Cargo.toml index 43baf31659..ee844db96f 100644 --- a/core-primitives/stf-executor/Cargo.toml +++ b/core-primitives/stf-executor/Cargo.toml @@ -36,8 +36,8 @@ codec = { package = "parity-scale-codec", version = "3.0.0", default-features = log = { version = "0.4", default-features = false } # substrate dependencies -sp-core = { default-features = false, features = ["full_crypto"], git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } +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" } # dev dependencies itc-parentchain-test = { path = "../../core/parentchain/test", optional = true, default-features = false } diff --git a/core-primitives/stf-primitives/Cargo.toml b/core-primitives/stf-primitives/Cargo.toml index 7770959dad..ea22e6d91a 100644 --- a/core-primitives/stf-primitives/Cargo.toml +++ b/core-primitives/stf-primitives/Cargo.toml @@ -9,8 +9,8 @@ edition = "2021" codec = { version = "3.0.0", default-features = false, features = ["derive"], package = "parity-scale-codec" } # Substrate dependencies -sp-core = { default-features = false, features = ["full_crypto"], git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } +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" } [features] diff --git a/core-primitives/stf-state-handler/Cargo.toml b/core-primitives/stf-state-handler/Cargo.toml index 739473c96b..9373c3941d 100644 --- a/core-primitives/stf-state-handler/Cargo.toml +++ b/core-primitives/stf-state-handler/Cargo.toml @@ -37,7 +37,7 @@ thiserror = { version = "1.0", optional = true } codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } lazy_static = { version = "1.1.0", features = ["spin_no_std"] } log = { version = "0.4", default-features = false } -sp-core = { default-features = false, features = ["full_crypto"], git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } +sp-core = { default-features = false, features = ["full_crypto"], git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } [dev-dependencies] itp-sgx-crypto = { path = "../../core-primitives/sgx/crypto", features = ["mocks"] } diff --git a/core-primitives/stf-state-handler/src/state_handler.rs b/core-primitives/stf-state-handler/src/state_handler.rs index 39540a5e56..0b843d77ba 100644 --- a/core-primitives/stf-state-handler/src/state_handler.rs +++ b/core-primitives/stf-state-handler/src/state_handler.rs @@ -28,10 +28,12 @@ use crate::{ state_initializer::InitializeState, state_snapshot_repository::VersionedStateAccess, }; +use core::fmt::Debug; use itp_hashing::Hash; use itp_sgx_externalities::SgxExternalitiesTrait; use itp_stf_state_observer::traits::UpdateState; use itp_types::ShardIdentifier; +use log::{debug, trace}; use std::{collections::HashMap, sync::Arc, vec::Vec}; type StatesMap = HashMap; @@ -146,7 +148,7 @@ impl HandleState for StateHandler where Repository: VersionedStateAccess, - Repository::StateType: SgxExternalitiesTrait + Hash, + Repository::StateType: SgxExternalitiesTrait + Hash + Debug, Repository::HashType: Copy, StateObserver: UpdateState, StateInitializer: InitializeState, @@ -204,6 +206,8 @@ where mut state_lock: RwLockWriteGuard<'_, Self::WriteLockPayload>, shard: &ShardIdentifier, ) -> Result { + debug!("Writing state"); + trace!("State: {:?}", state); state.prune_state_diff(); // Remove state diff before storing. let state_hash = state.hash(); // We create a state copy here, in order to serve the state observer. This does not scale @@ -218,6 +222,8 @@ where } fn reset(&self, state: Self::StateT, shard: &ShardIdentifier) -> Result { + debug!("Resetting state"); + trace!("Resetting state: {:?}", state); let state_write_lock = self.states_map_lock.write().map_err(|_| Error::LockPoisoning)?; self.write_after_mutation(state, state_write_lock, shard) } diff --git a/core-primitives/storage/Cargo.toml b/core-primitives/storage/Cargo.toml index c15b368bb9..2116175674 100644 --- a/core-primitives/storage/Cargo.toml +++ b/core-primitives/storage/Cargo.toml @@ -16,17 +16,17 @@ sgx_tstd = { branch = "master", git = "https://github.com/apache/teaclave-sgx-sd thiserror-sgx = { package = "thiserror", git = "https://github.com/mesalock-linux/thiserror-sgx", tag = "sgx_1.1.3", optional = true } # substrate deps -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-core = { default-features = false, features = ["full_crypto"], git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-trie = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } +frame-support = { 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" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } +sp-trie = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } # integritee itp-types = { default-features = false, path = "../types" } [dev-dependencies] -sp-state-machine = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } +sp-state-machine = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } [features] default = ["std"] diff --git a/core-primitives/storage/src/proof.rs b/core-primitives/storage/src/proof.rs index 1b710f3e52..6b2c02c49f 100644 --- a/core-primitives/storage/src/proof.rs +++ b/core-primitives/storage/src/proof.rs @@ -18,9 +18,10 @@ //! Logic for checking Substrate storage proofs. use crate::error::Error; -use hash_db::{HashDB, Hasher, EMPTY_PREFIX}; +use hash_db::EMPTY_PREFIX; +use sp_core::Hasher; use sp_std::vec::Vec; -use sp_trie::{trie_types::TrieDB, MemoryDB, Trie, TrieDBBuilder}; +use sp_trie::{trie_types::TrieDB, HashDBT, MemoryDB, Trie, TrieDBBuilder}; pub type StorageProof = Vec>; diff --git a/core-primitives/substrate-sgx/externalities/Cargo.toml b/core-primitives/substrate-sgx/externalities/Cargo.toml index d7ca575d95..4d13234773 100644 --- a/core-primitives/substrate-sgx/externalities/Cargo.toml +++ b/core-primitives/substrate-sgx/externalities/Cargo.toml @@ -16,7 +16,7 @@ serde = { version = "1.0", default-features = false, features = ["derive", "allo sgx_tstd = { optional = true, features = ["untrusted_fs", "net", "backtrace"], git = "https://github.com/apache/teaclave-sgx-sdk.git", branch = "master" } # substrate -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } # local environmental = { default-features = false, path = "../environmental" } diff --git a/core-primitives/substrate-sgx/sp-io/Cargo.toml b/core-primitives/substrate-sgx/sp-io/Cargo.toml index 5e9f5aaf2d..500b7a55e8 100644 --- a/core-primitives/substrate-sgx/sp-io/Cargo.toml +++ b/core-primitives/substrate-sgx/sp-io/Cargo.toml @@ -20,11 +20,11 @@ sgx_tstd = { optional = true, features = ["untrusted_fs", "net", "backtrace"], g sgx_types = { optional = true, git = "https://github.com/apache/teaclave-sgx-sdk.git", branch = "master" } # Substrate dependencies -sp-core = { default-features = false, features = ["full_crypto"], git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-runtime-interface = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-tracing = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-wasm-interface = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } +sp-core = { default-features = false, features = ["full_crypto"], git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } +sp-runtime-interface = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } +sp-tracing = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } +sp-wasm-interface = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } # local environmental = { path = "../environmental", default-features = false } diff --git a/core-primitives/teerex-storage/Cargo.toml b/core-primitives/teerex-storage/Cargo.toml index f8a64f7c92..f2cc061859 100644 --- a/core-primitives/teerex-storage/Cargo.toml +++ b/core-primitives/teerex-storage/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Integritee AG "] edition = "2021" [dependencies] -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } #local deps itp-storage = { path = "../storage", default-features = false } diff --git a/core-primitives/test/Cargo.toml b/core-primitives/test/Cargo.toml index ffcde0a9af..422b6881ce 100644 --- a/core-primitives/test/Cargo.toml +++ b/core-primitives/test/Cargo.toml @@ -14,9 +14,9 @@ sgx_tstd = { branch = "master", git = "https://github.com/apache/teaclave-sgx-sd sgx_types = { branch = "master", git = "https://github.com/apache/teaclave-sgx-sdk.git" } # substrate deps -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } +sp-core = { default-features = false, 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" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } # local deps ita-stf = { path = "../../app-libs/stf", default-features = false } diff --git a/core-primitives/top-pool-author/Cargo.toml b/core-primitives/top-pool-author/Cargo.toml index 6dbae91070..31d862344c 100644 --- a/core-primitives/top-pool-author/Cargo.toml +++ b/core-primitives/top-pool-author/Cargo.toml @@ -33,8 +33,8 @@ thiserror = { version = "1.0", optional = true } codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } derive_more = { version = "0.99.5" } log = { version = "0.4", default-features = false } -sp-core = { default-features = false, features = ["full_crypto"], git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } +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" } [dev-dependencies] futures = { version = "0.3" } @@ -42,7 +42,7 @@ itp-sgx-crypto = { path = "../sgx/crypto", features = ["mocks"] } itp-test = { path = "../test" } itp-top-pool = { path = "../top-pool", features = ["mocks"] } sgx-crypto-helper = { branch = "master", git = "https://github.com/apache/teaclave-sgx-sdk.git", package = "sgx_crypto_helper", default-features = false } -sp-keyring = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } +sp-keyring = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } [features] default = ["std"] diff --git a/core-primitives/top-pool/Cargo.toml b/core-primitives/top-pool/Cargo.toml index 9d17a6bcf5..fd27f44329 100644 --- a/core-primitives/top-pool/Cargo.toml +++ b/core-primitives/top-pool/Cargo.toml @@ -32,9 +32,9 @@ codec = { package = "parity-scale-codec", version = "3.0.0", default-features = derive_more = { version = "0.99.5" } log = { version = "0.4", default-features = false } serde = { version = "1.0", default-features = false, features = ["alloc", "derive"] } -sp-application-crypto = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-core = { default-features = false, features = ["full_crypto"], git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } +sp-application-crypto = { 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" } # dev dependencies (for tests) [dev-dependencies] diff --git a/core-primitives/types/Cargo.toml b/core-primitives/types/Cargo.toml index 63ff06ea7c..701fe14c93 100644 --- a/core-primitives/types/Cargo.toml +++ b/core-primitives/types/Cargo.toml @@ -18,14 +18,14 @@ serde_json = { version = "1.0", default-features = false, features = ["alloc"] } itp-sgx-runtime-primitives = { path = "../../core-primitives/sgx-runtime-primitives", default-features = false } # substrate-deps -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -pallet-balances = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-core = { default-features = false, features = ["full_crypto"], git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } +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" } +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" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } # integritee-node -my-node-runtime = { package = "integritee-node-runtime", optional = true, git = "https://github.com/integritee-network/integritee-node.git", branch = "polkadot-v0.9.39" } +my-node-runtime = { package = "integritee-node-runtime", optional = true, git = "https://github.com/integritee-network/integritee-node.git", branch = "polkadot-v0.9.42" } [features] default = ["std"] diff --git a/core-primitives/utils/Cargo.toml b/core-primitives/utils/Cargo.toml index deb3a9300b..f2736695af 100644 --- a/core-primitives/utils/Cargo.toml +++ b/core-primitives/utils/Cargo.toml @@ -12,8 +12,8 @@ codec = { package = "parity-scale-codec", version = "3.0.0", default-features = hex = { version = "0.4.3", default-features = false, features = ["alloc"] } # substrate -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-core = { default-features = false, features = ["full_crypto"], git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } +frame-support = { 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" } # teaclave sgx_tstd = { branch = "master", git = "https://github.com/apache/teaclave-sgx-sdk.git", optional = true } diff --git a/core-primitives/utils/src/stringify.rs b/core-primitives/utils/src/stringify.rs index b03d782846..993c1b15c9 100644 --- a/core-primitives/utils/src/stringify.rs +++ b/core-primitives/utils/src/stringify.rs @@ -19,13 +19,13 @@ //! `Debug` implementation on `sgx`. use codec::Encode; -use sp_core::{hexdisplay::HexDisplay, Public}; +use sp_core::{crypto::Public, hexdisplay::HexDisplay}; use std::{format, string::String}; /// Convert a sp_core public type to string. pub fn public_to_string(t: &T) -> String { - let crypto_pair = t.to_public_crypto_pair(); - format!("{}", HexDisplay::from(&crypto_pair.1)) + let crypto_pair = t.as_ref(); + format!("{}", HexDisplay::from(&crypto_pair)) } pub fn account_id_to_string(account: &AccountId) -> String { diff --git a/core/direct-rpc-server/Cargo.toml b/core/direct-rpc-server/Cargo.toml index c7b181d4fd..1eeb0e575f 100644 --- a/core/direct-rpc-server/Cargo.toml +++ b/core/direct-rpc-server/Cargo.toml @@ -13,7 +13,7 @@ sgx_types = { branch = "master", git = "https://github.com/apache/teaclave-sgx-s codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } log = { version = "0.4", default-features = false } serde_json = { version = "1.0", default-features = false, features = ["alloc"] } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } # local itc-tls-websocket-server = { path = "../tls-websocket-server", default-features = false } diff --git a/core/offchain-worker-executor/Cargo.toml b/core/offchain-worker-executor/Cargo.toml index 748799e3db..a41906a31e 100644 --- a/core/offchain-worker-executor/Cargo.toml +++ b/core/offchain-worker-executor/Cargo.toml @@ -28,8 +28,8 @@ itp-top-pool-author = { path = "../../core-primitives/top-pool-author", default- itp-types = { path = "../../core-primitives/types", default-features = false } # Substrate dependencies -sp-core = { default-features = false, features = ["full_crypto"], git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } +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" } # no-std compatible libraries log = { version = "0.4", default-features = false } diff --git a/core/parentchain/block-import-dispatcher/Cargo.toml b/core/parentchain/block-import-dispatcher/Cargo.toml index ad9d4acd47..f5a878a689 100644 --- a/core/parentchain/block-import-dispatcher/Cargo.toml +++ b/core/parentchain/block-import-dispatcher/Cargo.toml @@ -21,7 +21,7 @@ thiserror = { version = "1.0", optional = true } # crates.io no-std compatible libraries log = { version = "0.4", default-features = false } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } [dev-dependencies] itc-parentchain-block-importer = { path = "../block-importer", features = ["mocks"] } diff --git a/core/parentchain/block-importer/Cargo.toml b/core/parentchain/block-importer/Cargo.toml index 069e262563..1064ea58d4 100644 --- a/core/parentchain/block-importer/Cargo.toml +++ b/core/parentchain/block-importer/Cargo.toml @@ -27,7 +27,7 @@ thiserror = { version = "1.0", optional = true } # crates.io no-std compatible libraries codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } log = { version = "0.4", default-features = false } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } [features] default = ["std"] diff --git a/core/parentchain/indirect-calls-executor/Cargo.toml b/core/parentchain/indirect-calls-executor/Cargo.toml index 9bccb58df5..9d7048b659 100644 --- a/core/parentchain/indirect-calls-executor/Cargo.toml +++ b/core/parentchain/indirect-calls-executor/Cargo.toml @@ -34,9 +34,9 @@ codec = { package = "parity-scale-codec", version = "3.0.0", default-features = log = { version = "0.4", default-features = false } # substrate dep -binary-merkle-tree = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-core = { default-features = false, features = ["full_crypto"], git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } +binary-merkle-tree = { 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" } [dev-dependencies] env_logger = "0.9.0" diff --git a/core/parentchain/light-client/Cargo.toml b/core/parentchain/light-client/Cargo.toml index 6baf1687d2..dc36585d8a 100644 --- a/core/parentchain/light-client/Cargo.toml +++ b/core/parentchain/light-client/Cargo.toml @@ -26,12 +26,12 @@ itp-storage = { path = "../../../core-primitives/storage", default-features = fa itp-types = { path = "../../../core-primitives/types", default-features = false } # substrate deps -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-application-crypto = { default-features = false, features = ["full_crypto"], git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-core = { default-features = false, features = ["full_crypto"], git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-finality-grandpa = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-trie = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } +sp-application-crypto = { default-features = false, features = ["full_crypto"], git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } +sp-consensus-grandpa = { 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" } +sp-trie = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } # test & mock dependencies itc-parentchain-test = { optional = true, default-features = false, path = "../../../core/parentchain/test" } @@ -58,7 +58,7 @@ std = [ "frame-system/std", "sp-core/std", "sp-application-crypto/std", - "sp-finality-grandpa/std", + "sp-consensus-grandpa/std", "sp-runtime/std", "sp-trie/std", diff --git a/core/parentchain/light-client/src/finality.rs b/core/parentchain/light-client/src/finality.rs index d7d4da66dd..95371a8863 100644 --- a/core/parentchain/light-client/src/finality.rs +++ b/core/parentchain/light-client/src/finality.rs @@ -26,8 +26,8 @@ use crate::{ }; use finality_grandpa::voter_set::VoterSet; use log::*; -pub use sp_finality_grandpa::SetId; -use sp_finality_grandpa::{AuthorityId, ScheduledChange, GRANDPA_ENGINE_ID}; +pub use sp_consensus_grandpa::SetId; +use sp_consensus_grandpa::{AuthorityId, ScheduledChange, GRANDPA_ENGINE_ID}; use sp_runtime::{ generic::Digest, traits::{Block as ParentchainBlockTrait, Header as HeaderTrait}, diff --git a/core/parentchain/light-client/src/justification.rs b/core/parentchain/light-client/src/justification.rs index 4142862310..5e6f21f78c 100644 --- a/core/parentchain/light-client/src/justification.rs +++ b/core/parentchain/light-client/src/justification.rs @@ -25,7 +25,7 @@ use super::error::JustificationError as ClientError; use codec::{Decode, Encode}; use finality_grandpa::{voter_set::VoterSet, Error as GrandpaError}; use log::*; -use sp_finality_grandpa::{AuthorityId, AuthorityList, AuthoritySignature}; +use sp_consensus_grandpa::{AuthorityId, AuthorityList, AuthoritySignature}; use sp_runtime::traits::{Block as BlockT, Header as HeaderT, NumberFor}; /// A commit message for this chain's block type. @@ -143,7 +143,7 @@ impl GrandpaJustification { let mut buf = Vec::new(); let mut visited_hashes = HashSet::new(); for signed in self.commit.precommits.iter() { - if !sp_finality_grandpa::check_message_signature_with_buffer( + if !sp_consensus_grandpa::check_message_signature_with_buffer( &finality_grandpa::Message::Precommit(signed.precommit.clone()), &signed.id, &signed.signature, diff --git a/core/parentchain/light-client/src/lib.rs b/core/parentchain/light-client/src/lib.rs index 29f235ab82..100efa41ef 100644 --- a/core/parentchain/light-client/src/lib.rs +++ b/core/parentchain/light-client/src/lib.rs @@ -28,11 +28,11 @@ extern crate sgx_tstd as std; // Re-export useful types. pub use finality_grandpa::BlockNumberOps; -pub use sp_finality_grandpa::{AuthorityList, SetId}; +pub use sp_consensus_grandpa::{AuthorityList, SetId}; use crate::light_validation_state::LightValidationState; use error::Error; -use sp_finality_grandpa::{AuthorityId, AuthorityWeight, ConsensusLog, GRANDPA_ENGINE_ID}; +use sp_consensus_grandpa::{AuthorityId, AuthorityWeight, ConsensusLog, GRANDPA_ENGINE_ID}; use sp_runtime::{ generic::{Digest, OpaqueDigestItemId, SignedBlock}, traits::{Block as ParentchainBlockTrait, Header as HeaderTrait}, diff --git a/core/parentchain/light-client/src/light_client_init_params.rs b/core/parentchain/light-client/src/light_client_init_params.rs index 11cba5e5e0..61baf247ee 100644 --- a/core/parentchain/light-client/src/light_client_init_params.rs +++ b/core/parentchain/light-client/src/light_client_init_params.rs @@ -17,7 +17,7 @@ */ use codec::{Decode, Encode}; -use sp_finality_grandpa::AuthorityList; +use sp_consensus_grandpa::AuthorityList; use std::vec::Vec; #[derive(Encode, Decode, Clone)] diff --git a/core/parentchain/light-client/src/light_validation_state.rs b/core/parentchain/light-client/src/light_validation_state.rs index 502aefb053..b280d05817 100644 --- a/core/parentchain/light-client/src/light_validation_state.rs +++ b/core/parentchain/light-client/src/light_validation_state.rs @@ -21,7 +21,7 @@ use crate::{state::RelayState, Error, HashFor, LightClientState}; use codec::{Decode, Encode}; use sp_runtime::traits::Block as ParentchainBlockTrait; -pub use sp_finality_grandpa::SetId; +pub use sp_consensus_grandpa::SetId; #[derive(Encode, Decode, Clone, Debug, Eq, PartialEq)] pub struct LightValidationState { diff --git a/core/parentchain/light-client/src/state.rs b/core/parentchain/light-client/src/state.rs index 720d5240ef..1fef61780c 100644 --- a/core/parentchain/light-client/src/state.rs +++ b/core/parentchain/light-client/src/state.rs @@ -16,7 +16,7 @@ */ use codec::{Decode, Encode}; -use sp_finality_grandpa::{AuthorityList, SetId}; +use sp_consensus_grandpa::{AuthorityList, SetId}; use sp_runtime::{ traits::{Block as BlockT, Header as HeaderT}, OpaqueExtrinsic, diff --git a/core/parentchain/parentchain-crate/Cargo.toml b/core/parentchain/parentchain-crate/Cargo.toml index a450358fca..89af39dffa 100644 --- a/core/parentchain/parentchain-crate/Cargo.toml +++ b/core/parentchain/parentchain-crate/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive", "chain-error"] } # Parity -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } # local itc-parentchain-block-import-dispatcher = { path = "../block-import-dispatcher", default-features = false } diff --git a/core/parentchain/test/Cargo.toml b/core/parentchain/test/Cargo.toml index 26610cf048..54d9b690a0 100644 --- a/core/parentchain/test/Cargo.toml +++ b/core/parentchain/test/Cargo.toml @@ -15,12 +15,12 @@ scale-info = { version = "2.0.1", default-features = false, features = ["derive" serde = { version = "1.0.13", features = ["derive"], optional = true } # substrate dependencies -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -frame-system = { default-features = false, package = "frame-system", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-io = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } +frame-system = { default-features = false, package = "frame-system", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } +sp-io = { default-features = false, 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" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } [features] default = ["std"] diff --git a/core/rpc-server/Cargo.toml b/core/rpc-server/Cargo.toml index 3227a6c944..7850d64fe9 100644 --- a/core/rpc-server/Cargo.toml +++ b/core/rpc-server/Cargo.toml @@ -27,5 +27,5 @@ std = [] [dev-dependencies] env_logger = { version = "*" } -sp-core = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } +sp-core = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } its-test = { path = "../../sidechain/test" } diff --git a/core/tls-websocket-server/Cargo.toml b/core/tls-websocket-server/Cargo.toml index b4cbbdf67a..725cc63ad9 100644 --- a/core/tls-websocket-server/Cargo.toml +++ b/core/tls-websocket-server/Cargo.toml @@ -33,7 +33,7 @@ webpki = { version = "0.21", optional = true } yasna = { version = "0.4", optional = true, features = ["bit-vec", "num-bigint", "chrono", "std"] } # Substrate dependencies -sp-core = { default-features = false, features = ["full_crypto"], git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } +sp-core = { default-features = false, features = ["full_crypto"], git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } # no-std compatible libraries log = { version = "0.4", default-features = false } diff --git a/docker/demo-sidechain.yml b/docker/demo-sidechain.yml index 235a7c6b9a..bff44248f7 100644 --- a/docker/demo-sidechain.yml +++ b/docker/demo-sidechain.yml @@ -19,6 +19,8 @@ services: condition: service_healthy integritee-worker-2-${VERSION}: condition: service_healthy + environment: + - RUST_LOG=warn,ws=warn,sp_io=warn,substrate_api_client=warn,jsonrpsee_ws_client=warn,jsonrpsee_ws_server=warn,enclave_runtime=warn,integritee_service=info,integritee_service::sidechain=debug,ita_stf=warn networks: - integritee-test-network entrypoint: @@ -27,4 +29,4 @@ services: restart: "no" networks: integritee-test-network: - driver: bridge \ No newline at end of file + driver: bridge diff --git a/docker/demo-teeracle.yml b/docker/demo-teeracle.yml index 99dcb1c98d..e0bbd2a20f 100644 --- a/docker/demo-teeracle.yml +++ b/docker/demo-teeracle.yml @@ -63,7 +63,7 @@ services: "/usr/local/worker-cli/demo_teeracle_whitelist.sh -u ws://integritee-node -p 9912 -V wss://integritee-teeracle-worker -P 2011 - -d 21 -i ${TEERACLE_INTERVAL_SECONDS} + -d 7 -i ${TEERACLE_INTERVAL_SECONDS} -C /usr/local/bin/integritee-cli 2>&1" restart: "no" networks: diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 6fe42edbb7..5e707c35ed 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -1,6 +1,6 @@ services: "integritee-node-${VERSION}": - image: "${INTEGRITEE_NODE:-integritee/integritee-node-dev-ias:1.0.35}" + image: "${INTEGRITEE_NODE:-integritee/integritee-node-dev-ias:1.0.36}" hostname: integritee-node devices: - "${SGX_PROVISION:-/dev/null}:/dev/sgx/provision" @@ -35,7 +35,7 @@ services: - "${AESMD:-/dev/null}:/var/run/aesmd" - "${SGX_QCNL:-/dev/null}:/etc/sgx_default_qcnl.conf" environment: - - RUST_LOG=warn,ws=warn,sp_io=warn,substrate_api_client=warn,jsonrpsee_ws_client=warn,jsonrpsee_ws_server=warn,enclave_runtime=warn,integritee_service=warn,ita_stf=warn + - RUST_LOG=warn,ws=warn,sp_io=warn,substrate_api_client=warn,jsonrpsee_ws_client=warn,jsonrpsee_ws_server=warn,enclave_runtime=warn,integritee_service=warn,ita_stf=warn,its_consensus_common=debug networks: - integritee-test-network healthcheck: @@ -64,7 +64,7 @@ services: - "${AESMD:-/dev/null}:/var/run/aesmd" - "${SGX_QCNL:-/dev/null}:/etc/sgx_default_qcnl.conf" environment: - - RUST_LOG=warn,ws=warn,sp_io=warn,substrate_api_client=warn,jsonrpsee_ws_client=warn,jsonrpsee_ws_server=warn,enclave_runtime=warn,integritee_service=warn,ita_stf=warn + - RUST_LOG=warn,ws=warn,sp_io=warn,substrate_api_client=warn,jsonrpsee_ws_client=warn,jsonrpsee_ws_server=warn,enclave_runtime=warn,integritee_service=warn,ita_stf=warn,its_consensus_common=debug networks: - integritee-test-network healthcheck: diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index bceee8d4be..c7e9e2c96e 100755 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -4,4 +4,29 @@ set -e # run aesmd in the background /opt/intel/sgx-aesm-service/aesm/aesm_service +# for debugging: will be in the CI logs: +cat /etc/sgx_default_qcnl.conf + +echo '{ + + "pccs_url": "https://ajuna-02.cluster.securitee.tech:8081/sgx/certification/v4/", + + "use_secure_cert": false, + + "collateral_service": "https://api.trustedservices.intel.com/sgx/certification/v4/", + + + "retry_times": 6, + + "retry_delay": 10, + + + "pck_cache_expire_hours": 168, + + "verify_collateral_cache_expire_hours": 168 + +}' > /etc/sgx_default_qcnl.conf + +cat /etc/sgx_default_qcnl.conf + exec /usr/local/bin/integritee-service "${@}" diff --git a/enclave-runtime/Cargo.lock b/enclave-runtime/Cargo.lock index 57ec28e5cf..0c949dcd05 100644 --- a/enclave-runtime/Cargo.lock +++ b/enclave-runtime/Cargo.lock @@ -9,13 +9,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" dependencies = [ "lazy_static", - "regex 1.7.3", + "regex 1.8.4", ] [[package]] name = "ac-compose-macros" version = "0.2.3" -source = "git+https://github.com/scs/substrate-api-client.git?branch=polkadot-v0.9.39#417c301cce7e23f765891cd56ca48878390c5cf9" +source = "git+https://github.com/scs/substrate-api-client.git?branch=polkadot-v0.9.42-tag-v0.10.0#686b7ef0aa8da255d3864a3fc703e32193813700" dependencies = [ "ac-primitives", "log", @@ -28,19 +28,19 @@ dependencies = [ [[package]] name = "ac-node-api" version = "0.2.3" -source = "git+https://github.com/scs/substrate-api-client.git?branch=polkadot-v0.9.39#417c301cce7e23f765891cd56ca48878390c5cf9" +source = "git+https://github.com/scs/substrate-api-client.git?branch=polkadot-v0.9.42-tag-v0.10.0#686b7ef0aa8da255d3864a3fc703e32193813700" dependencies = [ "ac-primitives", "bitvec", "derive_more", "either", - "frame-metadata 15.1.0", + "frame-metadata 15.1.0 (git+https://github.com/paritytech/frame-metadata)", "hex", "log", "parity-scale-codec", "scale-info", - "serde 1.0.158", - "serde_json 1.0.94", + "serde 1.0.164", + "serde_json 1.0.96", "sp-application-crypto", "sp-core", "sp-runtime", @@ -50,19 +50,20 @@ dependencies = [ [[package]] name = "ac-primitives" version = "0.5.0" -source = "git+https://github.com/scs/substrate-api-client.git?branch=polkadot-v0.9.39#417c301cce7e23f765891cd56ca48878390c5cf9" +source = "git+https://github.com/scs/substrate-api-client.git?branch=polkadot-v0.9.42-tag-v0.10.0#686b7ef0aa8da255d3864a3fc703e32193813700" dependencies = [ "hex", "impl-serde", "parity-scale-codec", "primitive-types", "scale-info", - "serde 1.0.158", - "serde_json 1.0.94", + "serde 1.0.164", + "serde_json 1.0.96", "sp-core", "sp-runtime", "sp-staking", "sp-version", + "sp-weights", ] [[package]] @@ -103,7 +104,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" dependencies = [ "getrandom 0.2.3", - "once_cell 1.17.1", + "once_cell 1.18.0", "version_check", ] @@ -114,7 +115,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" dependencies = [ "cfg-if 1.0.0", - "once_cell 1.17.1", + "once_cell 1.18.0", "version_check", ] @@ -129,13 +130,19 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "0.7.20" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" +checksum = "43f6cb1bf222025340178f382c426f13757b2960e89779dfcb319c32542a5a41" dependencies = [ "memchr 2.5.0", ] +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + [[package]] name = "array-bytes" version = "4.2.0" @@ -144,9 +151,9 @@ checksum = "f52f63c5c1316a16a4b35eaac8b76a98248961a533f061684cb2a7cb0eafb6c6" [[package]] name = "array-bytes" -version = "6.0.0" +version = "6.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22f72e9d6fac4bc80778ea470b20197b88d28c292bb7d60c3fb099280003cd19" +checksum = "d9b1c5a481ec30a5abd8dfbd94ab5cf1bb4e9a66be7f1b3b322f2f1170c200fd" [[package]] name = "arrayref" @@ -168,13 +175,13 @@ checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" [[package]] name = "auto_impl" -version = "1.0.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a8c1df849285fbacd587de7818cc7d13be6cd2cbcd47a04fb1801b0e2706e33" +checksum = "fee3da8ef1276b0bee5dd1c7258010d8fffd31801447323115a25560e1327b89" dependencies = [ "proc-macro-error", "proc-macro2", - "quote 1.0.26", + "quote 1.0.28", "syn 1.0.109", ] @@ -200,9 +207,9 @@ source = "git+https://github.com/whalelephant/base-x-rs?branch=no_std#906c9ac592 [[package]] name = "base16ct" -version = "0.1.1" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" [[package]] name = "base64" @@ -237,9 +244,9 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "binary-merkle-tree" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ - "hash-db", + "hash-db 0.16.0", ] [[package]] @@ -272,7 +279,7 @@ version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" dependencies = [ - "digest 0.10.6", + "digest 0.10.7", ] [[package]] @@ -283,7 +290,18 @@ checksum = "afa748e348ad3be8263be728124b24a24f268266f6f5d58af9d75f6a40b5c587" dependencies = [ "arrayref", "arrayvec 0.5.2", - "constant_time_eq", + "constant_time_eq 0.1.5", +] + +[[package]] +name = "blake2b_simd" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c2f0dc9a68c6317d884f97cc36cf5a3d20ba14ce404227df55e1af708ab04bc" +dependencies = [ + "arrayref", + "arrayvec 0.7.2", + "constant_time_eq 0.2.5", ] [[package]] @@ -294,7 +312,7 @@ checksum = "9e461a7034e85b211a4acb57ee2e6730b32912b06c08cc242243c39fc21ae6a2" dependencies = [ "arrayref", "arrayvec 0.5.2", - "constant_time_eq", + "constant_time_eq 0.1.5", ] [[package]] @@ -316,7 +334,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" dependencies = [ "block-padding 0.2.1", - "generic-array 0.14.6", + "generic-array 0.14.7", ] [[package]] @@ -325,7 +343,7 @@ version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" dependencies = [ - "generic-array 0.14.6", + "generic-array 0.14.7", ] [[package]] @@ -345,9 +363,9 @@ checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" [[package]] name = "bounded-collections" -version = "0.1.5" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a071c348a5ef6da1d3a87166b408170b46002382b1dda83992b5c2208cefb370" +checksum = "07fbd1d11282a1eb134d3c3b7cf8ce213b5161c6e5f73fb1b98618482c606b64" dependencies = [ "log", "parity-scale-codec", @@ -432,18 +450,18 @@ name = "chrono" version = "0.4.11" source = "git+https://github.com/mesalock-linux/chrono-sgx#f964ae7f5f65bd2c9cd6f44a067e7980afc08ca0" dependencies = [ - "num-integer 0.1.41", + "num-integer", "num-traits 0.2.10", "sgx_tstd", ] [[package]] name = "chrono" -version = "0.4.24" +version = "0.4.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e3c5919066adf22df73762e50cffcde3a758f2a848b113b586d1f86728b673b" +checksum = "ec837a71355b28f6556dbd569b37b3f363091c0bd4b2e735674521b4c5fd9bc5" dependencies = [ - "num-integer 0.1.45", + "android-tzdata", "num-traits 0.2.15", ] @@ -463,7 +481,7 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12f8e7987cbd042a63249497f41aed09f8e65add917ea6566effbc56578d6801" dependencies = [ - "generic-array 0.14.6", + "generic-array 0.14.7", ] [[package]] @@ -478,6 +496,12 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" +[[package]] +name = "constant_time_eq" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13418e745008f7349ec7e449155f419a61b92b58a99cc3616942b926825ec76b" + [[package]] name = "convert_case" version = "0.4.0" @@ -486,9 +510,9 @@ checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" [[package]] name = "cpufeatures" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "280a9f2d8b3a38871a3c8a46fb80db65e5e5ed97da80c4d08bf27fb63e35e181" +checksum = "3e4c1eaa2012c47becbbad2ab175484c2a84d1185b566fb2cc5b8707343dfe58" dependencies = [ "libc", ] @@ -501,11 +525,11 @@ checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] name = "crypto-bigint" -version = "0.4.9" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef2b4b23cddf68b89b8f8069890e8c270d54e2d5fe1b143820234805e4cb17ef" +checksum = "cf4c2f4e1afd912bc40bfd6fed5d9dc1f288e0ba01bfcc835cc5bc3eb13efe15" dependencies = [ - "generic-array 0.14.6", + "generic-array 0.14.7", "rand_core 0.6.4", "subtle", "zeroize", @@ -517,7 +541,7 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ - "generic-array 0.14.6", + "generic-array 0.14.7", "typenum 1.16.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -549,17 +573,18 @@ dependencies = [ [[package]] name = "data-encoding" -version = "2.3.3" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23d8666cb01533c39dde32bcbab8e227b4ed6679b2c925eba05feabea39508fb" +checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" [[package]] name = "der" -version = "0.6.1" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1a467a65c5e759bce6e65eaf91cc29f466cdc57cb65777bd646872a8a1fd4de" +checksum = "56acb310e15652100da43d130af8d97b509e95af61aab1c5a7939ef24337ee17" dependencies = [ "const-oid", + "zeroize", ] [[package]] @@ -569,7 +594,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e79116f119dd1dba1abf1f3405f03b9b0e79a27a3883864bfebded8a3dc768cd" dependencies = [ "proc-macro2", - "quote 1.0.26", + "quote 1.0.28", "syn 1.0.109", ] @@ -581,7 +606,7 @@ checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" dependencies = [ "convert_case", "proc-macro2", - "quote 1.0.26", + "quote 1.0.28", "rustc_version 0.4.0", "syn 1.0.109", ] @@ -601,27 +626,29 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" dependencies = [ - "generic-array 0.14.6", + "generic-array 0.14.7", ] [[package]] name = "digest" -version = "0.10.6" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer 0.10.4", + "const-oid", "crypto-common", "subtle", ] [[package]] name = "ecdsa" -version = "0.14.8" +version = "0.16.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "413301934810f597c1d19ca71c8710e99a3f1ba28a0d2ebc01551a2daeea3c5c" +checksum = "0997c976637b606099b9985693efa3581e84e41f5c11ba5255f88711058ad428" dependencies = [ "der", + "digest 0.10.7", "elliptic-curve", "rfc6979", "signature", @@ -649,16 +676,15 @@ checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" [[package]] name = "elliptic-curve" -version = "0.12.3" +version = "0.13.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7bb888ab5300a19b8e5bceef25ac745ad065f3c9f7efc6de1b91958110891d3" +checksum = "968405c8fdc9b3bf4df0a6638858cc0b52462836ab6b1c87377785dd09cf1c0b" dependencies = [ "base16ct", "crypto-bigint", - "der", - "digest 0.10.6", + "digest 0.10.7", "ff", - "generic-array 0.14.6", + "generic-array 0.14.7", "group", "rand_core 0.6.4", "sec1", @@ -670,7 +696,7 @@ dependencies = [ name = "enclave-runtime" version = "0.9.0" dependencies = [ - "array-bytes 6.0.0", + "array-bytes 6.1.0", "cid", "derive_more", "env_logger", @@ -794,12 +820,12 @@ checksum = "6a89fb87a9e103f71b903b80b670200b54cc67a07578f070681f1fffb7396fb7" dependencies = [ "bytes 1.4.0", "ethereum-types", - "hash-db", + "hash-db 0.15.2", "hash256-std-hasher", "parity-scale-codec", "rlp", "scale-info", - "sha3 0.10.6", + "sha3 0.10.8", "triehash", ] @@ -820,9 +846,9 @@ dependencies = [ [[package]] name = "evm" -version = "0.37.0" +version = "0.39.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4448c65b71e8e2b9718232d84d09045eeaaccb2320494e6bd6dbf7e58fec8ff" +checksum = "a49a4e11987c51220aa89dbe1a5cc877f5079fa6864c0a5b4533331db44e9365" dependencies = [ "auto_impl", "ethereum", @@ -834,14 +860,14 @@ dependencies = [ "primitive-types", "rlp", "scale-info", - "sha3 0.10.6", + "sha3 0.10.8", ] [[package]] name = "evm-core" -version = "0.37.0" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64c51bec0eb68a891c2575c758eaaa1d61373fc51f7caaf216b1fb5c3fea3b5d" +checksum = "4f1f13264b044cb66f0602180f0bc781c29accb41ff560669a3ec15858d5b606" dependencies = [ "parity-scale-codec", "primitive-types", @@ -850,9 +876,9 @@ dependencies = [ [[package]] name = "evm-gasometer" -version = "0.37.0" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8b93c59c54fc26522d842f0e0d3f8e8be331c776df18ff3e540b53c2f64d509" +checksum = "8d43eadc395bd1a52990787ca1495c26b0248165444912be075c28909a853b8c" dependencies = [ "evm-core", "evm-runtime", @@ -861,14 +887,27 @@ dependencies = [ [[package]] name = "evm-runtime" -version = "0.37.0" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c79b9459ce64f1a28688397c4013764ce53cd57bb84efc16b5187fa9b05b13ad" +checksum = "2aa5b32f59ec582a5651978004e5c784920291263b7dcb6de418047438e37f4f" dependencies = [ "auto_impl", "evm-core", "primitive-types", - "sha3 0.10.6", + "sha3 0.10.8", +] + +[[package]] +name = "expander" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f360349150728553f92e4c997a16af8915f418d3a0f21b440d34c5632f16ed84" +dependencies = [ + "blake2", + "fs-err", + "proc-macro2", + "quote 1.0.28", + "syn 1.0.109", ] [[package]] @@ -879,9 +918,9 @@ checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" [[package]] name = "ff" -version = "0.12.1" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d013fc25338cc558c5c2cfbad646908fb23591e2404481826742b651c9af7160" +checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" dependencies = [ "rand_core 0.6.4", "subtle", @@ -894,7 +933,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "36530797b9bf31cd4ff126dcfee8170f86b00cfdcea3269d73133cc0415945c3" dependencies = [ "either", - "futures 0.3.27", + "futures 0.3.28", "num-traits 0.2.15", "parity-scale-codec", "scale-info", @@ -930,7 +969,7 @@ dependencies = [ [[package]] name = "fp-account" version = "1.0.0-dev" -source = "git+https://github.com/integritee-network/frontier.git?branch=polkadot-v0.9.39#3297c466619934d462e0b845c1ab1e81906dcb18" +source = "git+https://github.com/integritee-network/frontier.git?branch=bar/polkadot-v0.9.42#a5a5e1e6ec08cd542a6084c310863150fb8841b1" dependencies = [ "hex", "libsecp256k1", @@ -946,11 +985,12 @@ dependencies = [ [[package]] name = "fp-evm" version = "3.0.0-dev" -source = "git+https://github.com/integritee-network/frontier.git?branch=polkadot-v0.9.39#3297c466619934d462e0b845c1ab1e81906dcb18" +source = "git+https://github.com/integritee-network/frontier.git?branch=bar/polkadot-v0.9.42#a5a5e1e6ec08cd542a6084c310863150fb8841b1" dependencies = [ "evm", "frame-support", "parity-scale-codec", + "scale-info", "sp-core", "sp-runtime", "sp-std", @@ -959,7 +999,7 @@ dependencies = [ [[package]] name = "frame-executive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "frame-support", "frame-system", @@ -974,9 +1014,9 @@ dependencies = [ [[package]] name = "frame-metadata" -version = "15.0.0" +version = "15.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df6bb8542ef006ef0de09a5c4420787d79823c0ed7924225822362fd2bf2ff2d" +checksum = "878babb0b136e731cc77ec2fd883ff02745ff21e6fb662729953d44923df009c" dependencies = [ "cfg-if 1.0.0", "parity-scale-codec", @@ -986,21 +1026,22 @@ dependencies = [ [[package]] name = "frame-metadata" version = "15.1.0" -source = "git+https://github.com/paritytech/frame-metadata#438a5b098bb9d5b5a09bdc5b68275b2c5e63a010" +source = "git+https://github.com/paritytech/frame-metadata#0c6400964fe600ea07f8233810415f6958fe4e20" dependencies = [ "cfg-if 1.0.0", "parity-scale-codec", "scale-info", - "serde 1.0.158", + "serde 1.0.164", ] [[package]] name = "frame-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "bitflags", - "frame-metadata 15.0.0", + "environmental 1.1.4", + "frame-metadata 15.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "frame-support-procedural", "impl-trait-for-tuples", "k256", @@ -1026,44 +1067,45 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "Inflector", "cfg-expr", "derive-syn-parse", "frame-support-procedural-tools", "itertools", + "proc-macro-warning", "proc-macro2", - "quote 1.0.26", - "syn 1.0.109", + "quote 1.0.28", + "syn 2.0.18", ] [[package]] name = "frame-support-procedural-tools" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate", "proc-macro2", - "quote 1.0.26", - "syn 1.0.109", + "quote 1.0.28", + "syn 2.0.18", ] [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "proc-macro2", - "quote 1.0.26", - "syn 1.0.109", + "quote 1.0.28", + "syn 2.0.18", ] [[package]] name = "frame-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "frame-support", "log", @@ -1080,12 +1122,18 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "parity-scale-codec", "sp-api", ] +[[package]] +name = "fs-err" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0845fa252299212f0389d64ba26f34fa32cfe41588355f21ed507c59a0f64541" + [[package]] name = "funty" version = "2.0.0" @@ -1109,16 +1157,16 @@ dependencies = [ [[package]] name = "futures" -version = "0.3.27" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "531ac96c6ff5fd7c62263c5e3c67a603af4fcaee2e1a0ae5565ba3a11e69e549" +checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" dependencies = [ - "futures-channel 0.3.27", - "futures-core 0.3.27", - "futures-io 0.3.27", - "futures-sink 0.3.27", - "futures-task 0.3.27", - "futures-util 0.3.27", + "futures-channel 0.3.28", + "futures-core 0.3.28", + "futures-io 0.3.28", + "futures-sink 0.3.28", + "futures-task 0.3.28", + "futures-util 0.3.28", ] [[package]] @@ -1133,12 +1181,12 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.27" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "164713a5a0dcc3e7b4b1ed7d3b433cabc18025386f9339346e8daf15963cf7ac" +checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" dependencies = [ - "futures-core 0.3.27", - "futures-sink 0.3.27", + "futures-core 0.3.28", + "futures-sink 0.3.28", ] [[package]] @@ -1151,9 +1199,9 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.27" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86d7a0c1aa76363dac491de0ee99faf6941128376f1cf96f07db7603b7de69dd" +checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" [[package]] name = "futures-executor" @@ -1176,9 +1224,9 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.27" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89d422fa3cbe3b40dca574ab087abb5bc98258ea57eea3fd6f1fa7162c778b91" +checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" [[package]] name = "futures-macro" @@ -1187,7 +1235,7 @@ source = "git+https://github.com/mesalock-linux/futures-rs-sgx#d54882f24ddf7d613 dependencies = [ "proc-macro-hack", "proc-macro2", - "quote 1.0.26", + "quote 1.0.28", "syn 1.0.109", ] @@ -1198,9 +1246,9 @@ source = "git+https://github.com/mesalock-linux/futures-rs-sgx#d54882f24ddf7d613 [[package]] name = "futures-sink" -version = "0.3.27" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec93083a4aecafb2a80a885c9de1f0ccae9dbd32c2bb54b0c3a65690e0b8d2f2" +checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" [[package]] name = "futures-task" @@ -1213,9 +1261,9 @@ dependencies = [ [[package]] name = "futures-task" -version = "0.3.27" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd65540d33b37b16542a0438c12e6aeead10d4ac5d05bd3f805b8f35ab592879" +checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" [[package]] name = "futures-util" @@ -1239,13 +1287,13 @@ dependencies = [ [[package]] name = "futures-util" -version = "0.3.27" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ef6b17e481503ec85211fed8f39d1970f128935ca1f814cd32ac4a6842e84ab" +checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" dependencies = [ - "futures-core 0.3.27", - "futures-sink 0.3.27", - "futures-task 0.3.27", + "futures-core 0.3.28", + "futures-sink 0.3.28", + "futures-task 0.3.28", "pin-project-lite", "pin-utils", ] @@ -1261,12 +1309,13 @@ dependencies = [ [[package]] name = "generic-array" -version = "0.14.6" +version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum 1.16.0 (registry+https://github.com/rust-lang/crates.io-index)", "version_check", + "zeroize", ] [[package]] @@ -1293,9 +1342,9 @@ dependencies = [ [[package]] name = "group" -version = "0.12.1" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfbfb3a6cfbd390d5c9564ab283a0349b9b9fcd46a706c1eb10e0db70bfbac7" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ "ff", "rand_core 0.6.4", @@ -1308,6 +1357,12 @@ version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d23bd4e7b5eda0d0f3a307e8b381fdc8ba9000f26fbe912250c0a4cc3956364a" +[[package]] +name = "hash-db" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e7d7786361d7425ae2fe4f9e407eb0efaa0840f5212d109cc018c40c35c6ab4" + [[package]] name = "hash256-std-hasher" version = "0.15.2" @@ -1350,7 +1405,7 @@ dependencies = [ [[package]] name = "hashbrown_tstd" version = "0.12.0" -source = "git+https://github.com/apache/incubator-teaclave-sgx-sdk?branch=master#780dc8999477244d8ff1e6f418321adbec51ee58" +source = "git+https://github.com/apache/incubator-teaclave-sgx-sdk?branch=master#f1776a7cec1caab2959813f87bb4924805b92011" [[package]] name = "hex" @@ -1364,7 +1419,7 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" dependencies = [ - "digest 0.10.6", + "digest 0.10.7", ] [[package]] @@ -1443,7 +1498,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ebc88fc67028ae3db0c853baa36269d398d5f45b6982f95549ff5def78c935cd" dependencies = [ - "serde 1.0.158", + "serde 1.0.164", ] [[package]] @@ -1453,7 +1508,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "11d7a9f6330b71fea57921c9b61c47ee6e84f72d394754eff6163ae67e7395eb" dependencies = [ "proc-macro2", - "quote 1.0.26", + "quote 1.0.28", "syn 1.0.109", ] @@ -1516,8 +1571,8 @@ dependencies = [ "lazy_static", "log", "parity-scale-codec", - "serde 1.0.158", - "serde_json 1.0.94", + "serde 1.0.164", + "serde_json 1.0.96", "sgx_tstd", "substrate-fixed", "thiserror 1.0.9", @@ -1583,7 +1638,7 @@ dependencies = [ "parity-scale-codec", "rlp", "sgx_tstd", - "sha3 0.10.6", + "sha3 0.10.8", "sp-application-crypto", "sp-core", "sp-io", @@ -1601,7 +1656,7 @@ dependencies = [ "jsonrpc-core", "log", "parity-scale-codec", - "serde_json 1.0.94", + "serde_json 1.0.96", "sgx_tstd", "sgx_types", "sp-runtime", @@ -1705,7 +1760,7 @@ dependencies = [ "derive_more", "finality-grandpa", "frame-system", - "hash-db", + "hash-db 0.15.2", "itc-parentchain-test", "itp-ocall-api", "itp-sgx-io", @@ -1720,8 +1775,8 @@ dependencies = [ "sgx_tstd", "sgx_types", "sp-application-crypto", + "sp-consensus-grandpa", "sp-core", - "sp-finality-grandpa", "sp-runtime", "sp-trie", "thiserror 1.0.9", @@ -1751,8 +1806,8 @@ dependencies = [ "http", "http_req", "log", - "serde 1.0.158", - "serde_json 1.0.94", + "serde 1.0.164", + "serde_json 1.0.96", "sgx_tstd", "sgx_types", "thiserror 1.0.9", @@ -1764,7 +1819,7 @@ name = "itc-tls-websocket-server" version = "0.9.0" dependencies = [ "bit-vec", - "chrono 0.4.24", + "chrono 0.4.26", "log", "mio", "mio-extras", @@ -1964,8 +2019,8 @@ version = "0.9.0" dependencies = [ "itp-types", "parity-scale-codec", - "serde 1.0.158", - "serde_json 1.0.94", + "serde 1.0.164", + "serde_json 1.0.96", "sgx_tstd", ] @@ -2004,7 +2059,7 @@ dependencies = [ "log", "parity-scale-codec", "postcard", - "serde 1.0.158", + "serde 1.0.164", "sgx_tstd", "sp-core", ] @@ -2123,9 +2178,9 @@ name = "itp-storage" version = "0.9.0" dependencies = [ "derive_more", - "frame-metadata 15.0.0", + "frame-metadata 15.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "frame-support", - "hash-db", + "hash-db 0.15.2", "itp-types", "parity-scale-codec", "sgx_tstd", @@ -2191,7 +2246,7 @@ dependencies = [ "linked-hash-map", "log", "parity-scale-codec", - "serde 1.0.158", + "serde 1.0.164", "sgx_tstd", "sgx_types", "sp-application-crypto", @@ -2229,14 +2284,14 @@ dependencies = [ name = "itp-types" version = "0.9.0" dependencies = [ - "chrono 0.4.24", + "chrono 0.4.26", "frame-system", "itp-sgx-runtime-primitives", "pallet-balances", "parity-scale-codec", "primitive-types", - "serde 1.0.158", - "serde_json 1.0.94", + "serde 1.0.164", + "serde_json 1.0.96", "sp-core", "sp-runtime", "sp-std", @@ -2379,7 +2434,7 @@ version = "0.1.0" dependencies = [ "parity-scale-codec", "scale-info", - "serde 1.0.158", + "serde 1.0.164", "sp-core", "sp-io", "sp-runtime", @@ -2429,7 +2484,7 @@ dependencies = [ "its-primitives", "log", "parity-scale-codec", - "serde 1.0.158", + "serde 1.0.164", "sgx_tstd", "sp-core", "sp-io", @@ -2468,9 +2523,9 @@ dependencies = [ [[package]] name = "k256" -version = "0.11.6" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72c1e0b51e7ec0a97369623508396067a486bd0cbed95a2659a4b863d28cfc8b" +checksum = "cadb76004ed8e97623117f3df85b17aaa6626ab0b0831e6573f104df16cd1bcc" dependencies = [ "cfg-if 1.0.0", "ecdsa", @@ -2480,9 +2535,9 @@ dependencies = [ [[package]] name = "keccak" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3afef3b6eff9ce9d8ff9b3601125eec7f0c8cbac7abd14f355d053fa56c98768" +checksum = "8f6d5ed8676d904364de097082f4e7d240b571b67989ced0240f08b7f966f940" dependencies = [ "cpufeatures", ] @@ -2504,9 +2559,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.140" +version = "0.2.146" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99227334921fae1a979cf0bfdfcc6b3e5ce376ef57e16fb6fb3ea2ed6095f80c" +checksum = "f92be4933c13fd498862a9e02a3055f8a8d9c039ce33db97306fd5a6caa7f29b" [[package]] name = "libsecp256k1" @@ -2521,7 +2576,7 @@ dependencies = [ "libsecp256k1-gen-ecmult", "libsecp256k1-gen-genmult", "rand 0.8.5", - "serde 1.0.158", + "serde 1.0.164", ] [[package]] @@ -2593,12 +2648,11 @@ checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" [[package]] name = "memory-db" -version = "0.31.0" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e0c7cba9ce19ac7ffd2053ac9f49843bbd3f4318feedfd74e85c19d5fb0ba66" +checksum = "808b50db46293432a45e63bc15ea51e0ab4c0a1647b8eb114e31a3e698dd6fbe" dependencies = [ - "hash-db", - "hashbrown 0.12.3", + "hash-db 0.16.0", ] [[package]] @@ -2655,7 +2709,7 @@ name = "multihash" version = "0.11.4" source = "git+https://github.com/whalelephant/rust-multihash?branch=nstd#2c8aca8fa1fcbcba26951d925de40fa81696020a" dependencies = [ - "blake2b_simd", + "blake2b_simd 0.5.11", "blake2s_simd", "digest 0.9.0", "sha-1", @@ -2681,7 +2735,7 @@ source = "git+https://github.com/mesalock-linux/num-sgx#22645415542cc67551890dfd dependencies = [ "num-bigint", "num-complex", - "num-integer 0.1.41", + "num-integer", "num-iter", "num-rational", "num-traits 0.2.10", @@ -2693,7 +2747,7 @@ version = "0.2.5" source = "git+https://github.com/mesalock-linux/num-bigint-sgx#76a5bed94dc31c32bd1670dbf72877abcf9bbc09" dependencies = [ "autocfg 1.1.0", - "num-integer 0.1.41", + "num-integer", "num-traits 0.2.10", "sgx_tstd", ] @@ -2718,22 +2772,12 @@ dependencies = [ "sgx_tstd", ] -[[package]] -name = "num-integer" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" -dependencies = [ - "autocfg 1.1.0", - "num-traits 0.2.15", -] - [[package]] name = "num-iter" version = "0.1.39" source = "git+https://github.com/mesalock-linux/num-iter-sgx#f19fc44fcad0b82a040e5a24c511e5049cc04b60" dependencies = [ - "num-integer 0.1.41", + "num-integer", "num-traits 0.2.10", "sgx_tstd", ] @@ -2745,7 +2789,7 @@ source = "git+https://github.com/mesalock-linux/num-rational-sgx#be65f9ce439f3c9 dependencies = [ "autocfg 0.1.8", "num-bigint", - "num-integer 0.1.41", + "num-integer", "num-traits 0.2.10", "sgx_tstd", ] @@ -2787,9 +2831,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.17.1" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] name = "opaque-debug" @@ -2806,7 +2850,7 @@ checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" [[package]] name = "pallet-aura" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "frame-support", "frame-system", @@ -2822,7 +2866,7 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "frame-support", "frame-system", @@ -2836,7 +2880,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "frame-support", "frame-system", @@ -2850,7 +2894,7 @@ dependencies = [ [[package]] name = "pallet-evm" version = "6.0.0-dev" -source = "git+https://github.com/integritee-network/frontier.git?branch=polkadot-v0.9.39#3297c466619934d462e0b845c1ab1e81906dcb18" +source = "git+https://github.com/integritee-network/frontier.git?branch=bar/polkadot-v0.9.42#a5a5e1e6ec08cd542a6084c310863150fb8841b1" dependencies = [ "evm", "fp-account", @@ -2860,7 +2904,6 @@ dependencies = [ "hex", "impl-trait-for-tuples", "log", - "pallet-timestamp", "parity-scale-codec", "rlp", "scale-info", @@ -2873,7 +2916,7 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "frame-support", "frame-system", @@ -2883,8 +2926,8 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-application-crypto", + "sp-consensus-grandpa", "sp-core", - "sp-finality-grandpa", "sp-io", "sp-runtime", "sp-session", @@ -2895,7 +2938,7 @@ dependencies = [ [[package]] name = "pallet-insecure-randomness-collective-flip" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "frame-support", "frame-system", @@ -2909,7 +2952,7 @@ dependencies = [ [[package]] name = "pallet-parentchain" version = "0.9.0" -source = "git+https://github.com/integritee-network/pallets.git?branch=polkadot-v0.9.39#75e57c53063918e39720e67582b2e30e2cf269b8" +source = "git+https://github.com/integritee-network/pallets.git?branch=polkadot-v0.9.42#be26e6b85f14896860ef919488e6bb4cf4b7aa29" dependencies = [ "frame-support", "frame-system", @@ -2925,7 +2968,7 @@ dependencies = [ [[package]] name = "pallet-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "frame-support", "frame-system", @@ -2945,7 +2988,7 @@ dependencies = [ [[package]] name = "pallet-sudo" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "frame-support", "frame-system", @@ -2959,7 +3002,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "frame-support", "frame-system", @@ -2975,7 +3018,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "frame-support", "frame-system", @@ -2990,7 +3033,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -3001,9 +3044,9 @@ dependencies = [ [[package]] name = "parity-scale-codec" -version = "3.4.0" +version = "3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "637935964ff85a605d114591d4d2c13c5d1ba2806dae97cea6bf180238a749ac" +checksum = "5ddb756ca205bd108aee3c62c6d3c994e1df84a59b9d6d4a5ea42ee1fd5a9a28" dependencies = [ "arrayvec 0.7.2", "bitvec", @@ -3011,7 +3054,7 @@ dependencies = [ "bytes 1.4.0", "impl-trait-for-tuples", "parity-scale-codec-derive", - "serde 1.0.158", + "serde 1.0.164", ] [[package]] @@ -3022,7 +3065,7 @@ checksum = "86b26a931f824dd4eca30b3e43bb4f31cd5f0d3a403c5f5ff27106b805bfde7b" dependencies = [ "proc-macro-crate", "proc-macro2", - "quote 1.0.26", + "quote 1.0.28", "syn 1.0.109", ] @@ -3067,7 +3110,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a25c0b0ae06fcffe600ad392aabfa535696c8973f2253d9ac83171924c58a858" dependencies = [ "postcard-cobs", - "serde 1.0.158", + "serde 1.0.164", ] [[package]] @@ -3101,7 +3144,7 @@ version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" dependencies = [ - "once_cell 1.17.1", + "once_cell 1.18.0", "toml_edit", ] @@ -3113,7 +3156,7 @@ checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" dependencies = [ "proc-macro-error-attr", "proc-macro2", - "quote 1.0.26", + "quote 1.0.28", "syn 1.0.109", "version_check", ] @@ -3125,7 +3168,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" dependencies = [ "proc-macro2", - "quote 1.0.26", + "quote 1.0.28", "version_check", ] @@ -3141,11 +3184,22 @@ version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc881b2c22681370c6a780e47af9840ef841837bc98118431d4e1868bd0c1086" +[[package]] +name = "proc-macro-warning" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e99670bafb56b9a106419397343bdbc8b8742c3cc449fec6345f86173f47cd4" +dependencies = [ + "proc-macro2", + "quote 1.0.28", + "syn 2.0.18", +] + [[package]] name = "proc-macro2" -version = "1.0.54" +version = "1.0.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e472a104799c74b514a57226160104aa483546de37e839ec50e3c2e41dd87534" +checksum = "dec2b086b7a862cf4de201096214fa870344cf922b2b30c167badb3af3195406" dependencies = [ "unicode-ident", ] @@ -3172,9 +3226,9 @@ checksum = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a" [[package]] name = "quote" -version = "1.0.26" +version = "1.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc" +checksum = "1b9ab9c7eadfd8df19006f1cf1a4aed13540ed5cbc047010ece5826e10825488" dependencies = [ "proc-macro2", ] @@ -3264,8 +3318,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d2275aab483050ab2a7364c1a46604865ee7d6906684e08db0f090acf74f9e7" dependencies = [ "proc-macro2", - "quote 1.0.26", - "syn 2.0.10", + "quote 1.0.28", + "syn 2.0.18", ] [[package]] @@ -3282,13 +3336,13 @@ dependencies = [ [[package]] name = "regex" -version = "1.7.3" +version = "1.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b1f693b24f6ac912f4893ef08244d70b6067480d2f1a46e950c9691e6749d1d" +checksum = "d0ab3ca65655bb1e41f2a8c8cd662eb4fb035e67c3f78da1d61dffe89d07300f" dependencies = [ - "aho-corasick 0.7.20", + "aho-corasick 1.0.2", "memchr 2.5.0", - "regex-syntax 0.6.29", + "regex-syntax 0.7.2", ] [[package]] @@ -3301,19 +3355,18 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.6.29" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" +checksum = "436b050e76ed2903236f032a59761c1eb99e1b0aead2c257922771dab1fc8c78" [[package]] name = "rfc6979" -version = "0.3.1" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7743f17af12fa0b03b803ba12cd6a8d9483a587e89c69445e3909655c0b9fabb" +checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" dependencies = [ - "crypto-bigint", "hmac", - "zeroize", + "subtle", ] [[package]] @@ -3345,7 +3398,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e33d7b2abe0c340d8797fe2907d3f20d3b5ea5908683618bfe80df7f621f672a" dependencies = [ "proc-macro2", - "quote 1.0.26", + "quote 1.0.28", "syn 1.0.109", ] @@ -3438,27 +3491,27 @@ dependencies = [ [[package]] name = "scale-info" -version = "2.4.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61471dff9096de1d8b2319efed7162081e96793f5ebb147e50db10d50d648a4d" +checksum = "b569c32c806ec3abdf3b5869fb8bf1e0d275a7c1c9b0b05603d9464632649edf" dependencies = [ "bitvec", "cfg-if 1.0.0", "derive_more", "parity-scale-codec", "scale-info-derive", - "serde 1.0.158", + "serde 1.0.164", ] [[package]] name = "scale-info-derive" -version = "2.4.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "219580e803a66b3f05761fd06f1f879a872444e49ce23f73694d26e5a954c7e6" +checksum = "53012eae69e5aa5c14671942a5dd47de59d4cdcff8532a6dd0e081faf1119482" dependencies = [ "proc-macro-crate", "proc-macro2", - "quote 1.0.26", + "quote 1.0.28", "syn 1.0.109", ] @@ -3490,13 +3543,13 @@ dependencies = [ [[package]] name = "sec1" -version = "0.3.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3be24c1842290c45df0a7bf069e0c268a747ad05a192f2fd7dcfdbc1cba40928" +checksum = "f0aec48e813d6b90b15f0b8948af3c63483992dee44c03e9930b3eebdabe046e" dependencies = [ "base16ct", "der", - "generic-array 0.14.6", + "generic-array 0.14.7", "subtle", "zeroize", ] @@ -3568,11 +3621,11 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.158" +version = "1.0.164" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "771d4d9c4163ee138805e12c710dd365e4f44be8be0503cb1bb9eb989425d9c9" +checksum = "9e8c8cf938e98f769bc164923b06dce91cea1751522f46f8466461af04c9027d" dependencies = [ - "serde_derive 1.0.158", + "serde_derive 1.0.164", ] [[package]] @@ -3590,19 +3643,19 @@ version = "1.0.118" source = "git+https://github.com/mesalock-linux/serde-sgx#db0226f1d5d70fca6b96af2c285851502204e21c" dependencies = [ "proc-macro2", - "quote 1.0.26", + "quote 1.0.28", "syn 1.0.109", ] [[package]] name = "serde_derive" -version = "1.0.158" +version = "1.0.164" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e801c1712f48475582b7696ac71e0ca34ebb30e09338425384269d9717c62cad" +checksum = "d9735b638ccc51c28bf6914d90a2e9725b377144fc612c49a611fddd1b631d68" dependencies = [ "proc-macro2", - "quote 1.0.26", - "syn 2.0.10", + "quote 1.0.28", + "syn 2.0.18", ] [[package]] @@ -3630,24 +3683,24 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.94" +version = "1.0.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c533a59c9d8a93a09c6ab31f0fd5e5f4dd1b8fc9434804029839884765d04ea" +checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1" dependencies = [ "itoa 1.0.6", "ryu", - "serde 1.0.158", + "serde 1.0.164", ] [[package]] name = "sgx_alloc" version = "1.1.6" -source = "git+https://github.com/apache/incubator-teaclave-sgx-sdk?branch=master#780dc8999477244d8ff1e6f418321adbec51ee58" +source = "git+https://github.com/apache/incubator-teaclave-sgx-sdk?branch=master#f1776a7cec1caab2959813f87bb4924805b92011" [[package]] name = "sgx_backtrace_sys" version = "1.1.6" -source = "git+https://github.com/apache/incubator-teaclave-sgx-sdk?branch=master#780dc8999477244d8ff1e6f418321adbec51ee58" +source = "git+https://github.com/apache/incubator-teaclave-sgx-sdk?branch=master#f1776a7cec1caab2959813f87bb4924805b92011" dependencies = [ "cc", "sgx_build_helper", @@ -3657,12 +3710,12 @@ dependencies = [ [[package]] name = "sgx_build_helper" version = "1.1.6" -source = "git+https://github.com/apache/incubator-teaclave-sgx-sdk?branch=master#780dc8999477244d8ff1e6f418321adbec51ee58" +source = "git+https://github.com/apache/incubator-teaclave-sgx-sdk?branch=master#f1776a7cec1caab2959813f87bb4924805b92011" [[package]] name = "sgx_crypto_helper" version = "1.1.6" -source = "git+https://github.com/apache/incubator-teaclave-sgx-sdk?branch=master#780dc8999477244d8ff1e6f418321adbec51ee58" +source = "git+https://github.com/apache/incubator-teaclave-sgx-sdk?branch=master#f1776a7cec1caab2959813f87bb4924805b92011" dependencies = [ "itertools", "serde 1.0.118 (git+https://github.com/mesalock-linux/serde-sgx)", @@ -3676,12 +3729,12 @@ dependencies = [ [[package]] name = "sgx_demangle" version = "1.1.6" -source = "git+https://github.com/apache/incubator-teaclave-sgx-sdk?branch=master#780dc8999477244d8ff1e6f418321adbec51ee58" +source = "git+https://github.com/apache/incubator-teaclave-sgx-sdk?branch=master#f1776a7cec1caab2959813f87bb4924805b92011" [[package]] name = "sgx_libc" version = "1.1.6" -source = "git+https://github.com/apache/incubator-teaclave-sgx-sdk?branch=master#780dc8999477244d8ff1e6f418321adbec51ee58" +source = "git+https://github.com/apache/incubator-teaclave-sgx-sdk?branch=master#f1776a7cec1caab2959813f87bb4924805b92011" dependencies = [ "sgx_types", ] @@ -3689,7 +3742,7 @@ dependencies = [ [[package]] name = "sgx_rand" version = "1.1.6" -source = "git+https://github.com/apache/incubator-teaclave-sgx-sdk?branch=master#780dc8999477244d8ff1e6f418321adbec51ee58" +source = "git+https://github.com/apache/incubator-teaclave-sgx-sdk?branch=master#f1776a7cec1caab2959813f87bb4924805b92011" dependencies = [ "sgx_trts", "sgx_tstd", @@ -3699,7 +3752,7 @@ dependencies = [ [[package]] name = "sgx_serialize" version = "1.1.6" -source = "git+https://github.com/apache/incubator-teaclave-sgx-sdk?branch=master#780dc8999477244d8ff1e6f418321adbec51ee58" +source = "git+https://github.com/apache/incubator-teaclave-sgx-sdk?branch=master#f1776a7cec1caab2959813f87bb4924805b92011" dependencies = [ "sgx_tstd", ] @@ -3707,7 +3760,7 @@ dependencies = [ [[package]] name = "sgx_serialize_derive" version = "1.1.6" -source = "git+https://github.com/apache/incubator-teaclave-sgx-sdk?branch=master#780dc8999477244d8ff1e6f418321adbec51ee58" +source = "git+https://github.com/apache/incubator-teaclave-sgx-sdk?branch=master#f1776a7cec1caab2959813f87bb4924805b92011" dependencies = [ "quote 0.3.15", "sgx_serialize_derive_internals", @@ -3717,7 +3770,7 @@ dependencies = [ [[package]] name = "sgx_serialize_derive_internals" version = "1.1.6" -source = "git+https://github.com/apache/incubator-teaclave-sgx-sdk?branch=master#780dc8999477244d8ff1e6f418321adbec51ee58" +source = "git+https://github.com/apache/incubator-teaclave-sgx-sdk?branch=master#f1776a7cec1caab2959813f87bb4924805b92011" dependencies = [ "syn 0.11.11", ] @@ -3725,7 +3778,7 @@ dependencies = [ [[package]] name = "sgx_tcrypto" version = "1.1.6" -source = "git+https://github.com/apache/incubator-teaclave-sgx-sdk?branch=master#780dc8999477244d8ff1e6f418321adbec51ee58" +source = "git+https://github.com/apache/incubator-teaclave-sgx-sdk?branch=master#f1776a7cec1caab2959813f87bb4924805b92011" dependencies = [ "sgx_types", ] @@ -3733,7 +3786,7 @@ dependencies = [ [[package]] name = "sgx_tcrypto_helper" version = "1.1.6" -source = "git+https://github.com/apache/incubator-teaclave-sgx-sdk?branch=master#780dc8999477244d8ff1e6f418321adbec51ee58" +source = "git+https://github.com/apache/incubator-teaclave-sgx-sdk?branch=master#f1776a7cec1caab2959813f87bb4924805b92011" dependencies = [ "sgx_crypto_helper", ] @@ -3741,7 +3794,7 @@ dependencies = [ [[package]] name = "sgx_tprotected_fs" version = "1.1.6" -source = "git+https://github.com/apache/incubator-teaclave-sgx-sdk?branch=master#780dc8999477244d8ff1e6f418321adbec51ee58" +source = "git+https://github.com/apache/incubator-teaclave-sgx-sdk?branch=master#f1776a7cec1caab2959813f87bb4924805b92011" dependencies = [ "sgx_trts", "sgx_types", @@ -3750,7 +3803,7 @@ dependencies = [ [[package]] name = "sgx_trts" version = "1.1.6" -source = "git+https://github.com/apache/incubator-teaclave-sgx-sdk?branch=master#780dc8999477244d8ff1e6f418321adbec51ee58" +source = "git+https://github.com/apache/incubator-teaclave-sgx-sdk?branch=master#f1776a7cec1caab2959813f87bb4924805b92011" dependencies = [ "sgx_libc", "sgx_types", @@ -3759,7 +3812,7 @@ dependencies = [ [[package]] name = "sgx_tse" version = "1.1.6" -source = "git+https://github.com/apache/incubator-teaclave-sgx-sdk?branch=master#780dc8999477244d8ff1e6f418321adbec51ee58" +source = "git+https://github.com/apache/incubator-teaclave-sgx-sdk?branch=master#f1776a7cec1caab2959813f87bb4924805b92011" dependencies = [ "sgx_types", ] @@ -3767,7 +3820,7 @@ dependencies = [ [[package]] name = "sgx_tseal" version = "1.1.6" -source = "git+https://github.com/apache/incubator-teaclave-sgx-sdk?branch=master#780dc8999477244d8ff1e6f418321adbec51ee58" +source = "git+https://github.com/apache/incubator-teaclave-sgx-sdk?branch=master#f1776a7cec1caab2959813f87bb4924805b92011" dependencies = [ "sgx_tcrypto", "sgx_trts", @@ -3778,7 +3831,7 @@ dependencies = [ [[package]] name = "sgx_tstd" version = "1.1.6" -source = "git+https://github.com/apache/incubator-teaclave-sgx-sdk?branch=master#780dc8999477244d8ff1e6f418321adbec51ee58" +source = "git+https://github.com/apache/incubator-teaclave-sgx-sdk?branch=master#f1776a7cec1caab2959813f87bb4924805b92011" dependencies = [ "hashbrown_tstd", "sgx_alloc", @@ -3794,7 +3847,7 @@ dependencies = [ [[package]] name = "sgx_tunittest" version = "1.1.6" -source = "git+https://github.com/apache/incubator-teaclave-sgx-sdk?branch=master#780dc8999477244d8ff1e6f418321adbec51ee58" +source = "git+https://github.com/apache/incubator-teaclave-sgx-sdk?branch=master#f1776a7cec1caab2959813f87bb4924805b92011" dependencies = [ "sgx_tstd", ] @@ -3802,12 +3855,12 @@ dependencies = [ [[package]] name = "sgx_types" version = "1.1.6" -source = "git+https://github.com/apache/incubator-teaclave-sgx-sdk?branch=master#780dc8999477244d8ff1e6f418321adbec51ee58" +source = "git+https://github.com/apache/incubator-teaclave-sgx-sdk?branch=master#f1776a7cec1caab2959813f87bb4924805b92011" [[package]] name = "sgx_unwind" version = "1.1.6" -source = "git+https://github.com/apache/incubator-teaclave-sgx-sdk?branch=master#780dc8999477244d8ff1e6f418321adbec51ee58" +source = "git+https://github.com/apache/incubator-teaclave-sgx-sdk?branch=master#f1776a7cec1caab2959813f87bb4924805b92011" dependencies = [ "sgx_build_helper", ] @@ -3866,7 +3919,7 @@ checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" dependencies = [ "cfg-if 1.0.0", "cpufeatures", - "digest 0.10.6", + "digest 0.10.7", ] [[package]] @@ -3883,21 +3936,21 @@ dependencies = [ [[package]] name = "sha3" -version = "0.10.6" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdf0c33fae925bdc080598b84bc15c55e7b9a4a43b3c704da051f977469691c9" +checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" dependencies = [ - "digest 0.10.6", + "digest 0.10.7", "keccak", ] [[package]] name = "signature" -version = "1.6.4" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" +checksum = "5e1788eed21689f9cf370582dfc467ef36ed9c707f073528ddafa8d83e3b8500" dependencies = [ - "digest 0.10.6", + "digest 0.10.7", "rand_core 0.6.4", ] @@ -3935,12 +3988,14 @@ checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" [[package]] name = "sp-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "log", "parity-scale-codec", + "scale-info", "sp-api-proc-macro", "sp-core", + "sp-metadata-ir", "sp-runtime", "sp-std", "sp-version", @@ -3949,19 +4004,21 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ + "Inflector", "blake2", + "expander", "proc-macro-crate", "proc-macro2", - "quote 1.0.26", - "syn 1.0.109", + "quote 1.0.28", + "syn 2.0.18", ] [[package]] name = "sp-application-crypto" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "parity-scale-codec", "scale-info", @@ -3973,7 +4030,7 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "integer-sqrt", "num-traits 0.2.15", @@ -3986,7 +4043,7 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "parity-scale-codec", "sp-api", @@ -3998,7 +4055,7 @@ dependencies = [ [[package]] name = "sp-consensus-aura" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "parity-scale-codec", "scale-info", @@ -4011,10 +4068,26 @@ dependencies = [ "sp-timestamp", ] +[[package]] +name = "sp-consensus-grandpa" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "finality-grandpa", + "log", + "parity-scale-codec", + "scale-info", + "sp-api", + "sp-application-crypto", + "sp-core", + "sp-runtime", + "sp-std", +] + [[package]] name = "sp-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "parity-scale-codec", "scale-info", @@ -4025,19 +4098,20 @@ dependencies = [ [[package]] name = "sp-core" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "array-bytes 4.2.0", "bitflags", "blake2", "bounded-collections", "ed25519-zebra", - "hash-db", + "hash-db 0.16.0", "hash256-std-hasher", "libsecp256k1", "log", "merlin", "parity-scale-codec", + "paste", "primitive-types", "scale-info", "schnorrkel", @@ -4055,13 +4129,13 @@ dependencies = [ [[package]] name = "sp-core-hashing" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ - "blake2", + "blake2b_simd 1.0.1", "byteorder 1.4.3", - "digest 0.10.6", + "digest 0.10.7", "sha2 0.10.6", - "sha3 0.10.6", + "sha3 0.10.8", "sp-std", "twox-hash", ] @@ -4069,28 +4143,28 @@ dependencies = [ [[package]] name = "sp-core-hashing-proc-macro" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "proc-macro2", - "quote 1.0.26", + "quote 1.0.28", "sp-core-hashing", - "syn 1.0.109", + "syn 2.0.18", ] [[package]] name = "sp-debug-derive" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "proc-macro2", - "quote 1.0.26", - "syn 1.0.109", + "quote 1.0.28", + "syn 2.0.18", ] [[package]] name = "sp-externalities" version = "0.13.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "environmental 1.1.4", "parity-scale-codec", @@ -4098,26 +4172,10 @@ dependencies = [ "sp-storage", ] -[[package]] -name = "sp-finality-grandpa" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" -dependencies = [ - "finality-grandpa", - "log", - "parity-scale-codec", - "scale-info", - "sp-api", - "sp-application-crypto", - "sp-core", - "sp-runtime", - "sp-std", -] - [[package]] name = "sp-inherents" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -4131,7 +4189,7 @@ name = "sp-io" version = "7.0.0" dependencies = [ "environmental 1.1.3", - "hash-db", + "hash-db 0.15.2", "itp-sgx-externalities", "libsecp256k1", "log", @@ -4147,10 +4205,21 @@ dependencies = [ "tracing-core", ] +[[package]] +name = "sp-metadata-ir" +version = "0.1.0" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "frame-metadata 15.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec", + "scale-info", + "sp-std", +] + [[package]] name = "sp-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "sp-api", "sp-core", @@ -4160,7 +4229,7 @@ dependencies = [ [[package]] name = "sp-runtime" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "either", "hash256-std-hasher", @@ -4180,7 +4249,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "bytes 1.4.0", "impl-trait-for-tuples", @@ -4198,19 +4267,19 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "Inflector", "proc-macro-crate", "proc-macro2", - "quote 1.0.26", - "syn 1.0.109", + "quote 1.0.28", + "syn 2.0.18", ] [[package]] name = "sp-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "parity-scale-codec", "scale-info", @@ -4223,7 +4292,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "parity-scale-codec", "scale-info", @@ -4235,12 +4304,12 @@ dependencies = [ [[package]] name = "sp-std" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" [[package]] name = "sp-storage" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "parity-scale-codec", "ref-cast", @@ -4251,7 +4320,7 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "parity-scale-codec", "sp-inherents", @@ -4262,7 +4331,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "parity-scale-codec", "sp-std", @@ -4273,7 +4342,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "sp-api", "sp-runtime", @@ -4282,9 +4351,9 @@ dependencies = [ [[package]] name = "sp-trie" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ - "hash-db", + "hash-db 0.16.0", "memory-db", "parity-scale-codec", "scale-info", @@ -4297,7 +4366,7 @@ dependencies = [ [[package]] name = "sp-version" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "parity-scale-codec", "scale-info", @@ -4310,18 +4379,18 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "parity-scale-codec", "proc-macro2", - "quote 1.0.26", - "syn 1.0.109", + "quote 1.0.28", + "syn 2.0.18", ] [[package]] name = "sp-wasm-interface" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -4331,7 +4400,7 @@ dependencies = [ [[package]] name = "sp-weights" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" dependencies = [ "parity-scale-codec", "scale-info", @@ -4350,15 +4419,15 @@ checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" [[package]] name = "ss58-registry" -version = "1.39.0" +version = "1.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecf0bd63593ef78eca595a7fc25e9a443ca46fe69fd472f8f09f5245cdcd769d" +checksum = "eb47a8ad42e5fc72d5b1eb104a5546937eaf39843499948bb666d6e93c62423b" dependencies = [ "Inflector", "proc-macro2", - "quote 1.0.26", - "serde 1.0.158", - "serde_json 1.0.94", + "quote 1.0.28", + "serde 1.0.164", + "serde_json 1.0.96", "unicode-xid 0.2.4", ] @@ -4371,18 +4440,18 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "substrate-api-client" version = "0.10.0" -source = "git+https://github.com/scs/substrate-api-client.git?branch=polkadot-v0.9.39#417c301cce7e23f765891cd56ca48878390c5cf9" +source = "git+https://github.com/scs/substrate-api-client.git?branch=polkadot-v0.9.42-tag-v0.10.0#686b7ef0aa8da255d3864a3fc703e32193813700" dependencies = [ "ac-compose-macros", "ac-node-api", "ac-primitives", "derive_more", - "frame-metadata 15.1.0", + "frame-metadata 15.1.0 (git+https://github.com/paritytech/frame-metadata)", "hex", "log", "parity-scale-codec", - "serde 1.0.158", - "serde_json 1.0.94", + "serde 1.0.164", + "serde_json 1.0.96", "sp-core", "sp-runtime", "sp-runtime-interface", @@ -4400,9 +4469,9 @@ dependencies = [ [[package]] name = "subtle" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" [[package]] name = "syn" @@ -4422,18 +4491,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ "proc-macro2", - "quote 1.0.26", + "quote 1.0.28", "unicode-ident", ] [[package]] name = "syn" -version = "2.0.10" +version = "2.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aad1363ed6d37b84299588d62d3a7d95b5a5c2d9aad5c85609fda12afaa1f40" +checksum = "32d41677bcbe24c20c52e7c70b0d8db04134c5d1066bf98662e2871ad200ea3e" dependencies = [ "proc-macro2", - "quote 1.0.26", + "quote 1.0.28", "unicode-ident", ] @@ -4484,7 +4553,7 @@ version = "1.0.9" source = "git+https://github.com/mesalock-linux/thiserror-sgx?tag=sgx_1.1.3#c2f806b88616e06aab0af770366a76885d974fdc" dependencies = [ "proc-macro2", - "quote 1.0.26", + "quote 1.0.28", "syn 1.0.109", ] @@ -4495,8 +4564,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" dependencies = [ "proc-macro2", - "quote 1.0.26", - "syn 2.0.10", + "quote 1.0.28", + "syn 2.0.18", ] [[package]] @@ -4519,15 +4588,15 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ab8ed2edee10b50132aed5f331333428b011c99402b5a534154ed15746f9622" +checksum = "5a76a9312f5ba4c2dec6b9161fdf25d87ad8a09256ccea5a556fef03c706a10f" [[package]] name = "toml_edit" -version = "0.19.8" +version = "0.19.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "239410c8609e8125456927e6707163a3b1fdb40561e4b803bc041f466ccfdc13" +checksum = "2380d56e8670370eee6566b0bfd4265f65b3f432e8c6d85623f728d4fa31f739" dependencies = [ "indexmap 1.9.3", "toml_datetime", @@ -4547,17 +4616,17 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.30" +version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" +checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" [[package]] name = "trie-db" -version = "0.25.1" +version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3390c0409daaa6027d6681393316f4ccd3ff82e1590a1e4725014e3ae2bf1920" +checksum = "767abe6ffed88a1889671a102c2861ae742726f52e0a5a425b92c9fbfa7e9c85" dependencies = [ - "hash-db", + "hash-db 0.16.0", "hashbrown 0.13.2", "log", "smallvec 1.10.0", @@ -4565,11 +4634,11 @@ dependencies = [ [[package]] name = "trie-root" -version = "0.17.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a36c5ca3911ed3c9a5416ee6c679042064b93fc637ded67e25f92e68d783891" +checksum = "d4ed310ef5ab98f5fa467900ed906cb9232dd5376597e00fd4cba2a449d06c0b" dependencies = [ - "hash-db", + "hash-db 0.16.0", ] [[package]] @@ -4578,7 +4647,7 @@ version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1631b201eb031b563d2e85ca18ec8092508e262a3196ce9bd10a67ec87b9f5c" dependencies = [ - "hash-db", + "hash-db 0.15.2", "rlp", ] @@ -4616,8 +4685,8 @@ version = "1.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" dependencies = [ - "cfg-if 0.1.10", - "digest 0.10.6", + "cfg-if 1.0.0", + "digest 0.10.7", "static_assertions", ] @@ -4668,9 +4737,9 @@ dependencies = [ [[package]] name = "unicode-ident" -version = "1.0.8" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4" +checksum = "b15811caf2415fb889178633e7724bad2509101cde276048e013b9def5e51fa0" [[package]] name = "unicode-normalization" @@ -4759,9 +4828,9 @@ dependencies = [ [[package]] name = "winnow" -version = "0.4.1" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae8970b36c66498d8ff1d66685dc86b91b29db0c7739899012f63a63814b4b28" +checksum = "61de7bac303dc551fe038e2b3cef0f571087a47571ea6e79a87692ac99b99699" dependencies = [ "memchr 2.5.0", ] @@ -4797,11 +4866,11 @@ dependencies = [ [[package]] name = "zeroize_derive" -version = "1.4.0" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57090580b8b26d9fd2288c4ac982b3b3c6446cd8e91112bcf672d5ddb2f17441" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", - "quote 1.0.26", - "syn 2.0.10", + "quote 1.0.28", + "syn 2.0.18", ] diff --git a/enclave-runtime/Cargo.toml b/enclave-runtime/Cargo.toml index 311c63d9de..f0d9013793 100644 --- a/enclave-runtime/Cargo.toml +++ b/enclave-runtime/Cargo.toml @@ -132,11 +132,11 @@ its-primitives = { path = "../sidechain/primitives", default-features = false } its-sidechain = { path = "../sidechain/sidechain-crate", default-features = false, features = ["sgx"] } # substrate deps -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -frame-system = { optional = true, default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-core = { default-features = false, features = ["full_crypto"], git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } +frame-system = { optional = true, 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" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } # test-deps itp-sgx-temp-dir = { version = "0.1", default-features = false, optional = true, path = "../core-primitives/sgx/temp-dir" } diff --git a/enclave-runtime/src/test/evm_pallet_tests.rs b/enclave-runtime/src/test/evm_pallet_tests.rs index e863b13f37..a7b9fd882c 100644 --- a/enclave-runtime/src/test/evm_pallet_tests.rs +++ b/enclave-runtime/src/test/evm_pallet_tests.rs @@ -49,7 +49,7 @@ pub fn test_evm_call() { // Ensure the substrate version of the evm account has some money. let sender_evm_substrate_addr = ita_sgx_runtime::HashedAddressMapping::into_account_id(sender_evm_acc); - endow(&mut state, vec![(sender_evm_substrate_addr, 51_777_000_000_000, 0)]); + endow(&mut state, vec![(sender_evm_substrate_addr, 51_777_000_000_000)]); // Create the receiver account. let destination_evm_acc = H160::from_str("1000000000000000000000000000000000000001").unwrap(); @@ -102,7 +102,7 @@ pub fn test_evm_counter() { // Ensure the substrate version of the evm account has some money. let sender_evm_substrate_addr = ita_sgx_runtime::HashedAddressMapping::into_account_id(sender_evm_acc); - endow(&mut state, vec![(sender_evm_substrate_addr, 51_777_000_000_000, 0)]); + endow(&mut state, vec![(sender_evm_substrate_addr, 51_777_000_000_000)]); // Smart Contract from Counter.sol. let smart_contract = "608060405234801561001057600080fd5b50600160008190555033600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610377806100696000396000f3fe6080604052600436106100435760003560e01c80631003e2d21461004d57806333cf508014610076578063371303c0146100a157806358992216146100b857610044565b5b60056000819055005b34801561005957600080fd5b50610074600480360381019061006f9190610209565b6100e3565b005b34801561008257600080fd5b5061008b61013f565b6040516100989190610245565b60405180910390f35b3480156100ad57600080fd5b506100b6610148565b005b3480156100c457600080fd5b506100cd6101a4565b6040516100da91906102a1565b60405180910390f35b806000808282546100f491906102eb565b9250508190555033600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008054905090565b600160008082825461015a91906102eb565b9250508190555033600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600080fd5b6000819050919050565b6101e6816101d3565b81146101f157600080fd5b50565b600081359050610203816101dd565b92915050565b60006020828403121561021f5761021e6101ce565b5b600061022d848285016101f4565b91505092915050565b61023f816101d3565b82525050565b600060208201905061025a6000830184610236565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061028b82610260565b9050919050565b61029b81610280565b82525050565b60006020820190506102b66000830184610292565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006102f6826101d3565b9150610301836101d3565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115610336576103356102bc565b5b82820190509291505056fea2646970667358221220b37e993e133ed19c840809cc8acbbba8116dee3744ba01c81044d75146805c9364736f6c634300080f0033"; @@ -270,7 +270,7 @@ pub fn test_evm_create() { let sender_evm_acc: H160 = sender_evm_acc_slice.into(); // Ensure the substrate version of the evm account has some money. let sender_evm_substrate_addr = HashedAddressMapping::into_account_id(sender_evm_acc); - endow(&mut state, vec![(sender_evm_substrate_addr.clone(), 51_777_000_000_000, 0)]); + endow(&mut state, vec![(sender_evm_substrate_addr.clone(), 51_777_000_000_000)]); // Bytecode from Counter.sol let smart_contract = "608060405234801561001057600080fd5b50600160008190555033600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610377806100696000396000f3fe6080604052600436106100435760003560e01c80631003e2d21461004d57806333cf508014610076578063371303c0146100a157806358992216146100b857610044565b5b60056000819055005b34801561005957600080fd5b50610074600480360381019061006f9190610209565b6100e3565b005b34801561008257600080fd5b5061008b61013f565b6040516100989190610245565b60405180910390f35b3480156100ad57600080fd5b506100b6610148565b005b3480156100c457600080fd5b506100cd6101a4565b6040516100da91906102a1565b60405180910390f35b806000808282546100f491906102eb565b9250508190555033600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008054905090565b600160008082825461015a91906102eb565b9250508190555033600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600080fd5b6000819050919050565b6101e6816101d3565b81146101f157600080fd5b50565b600081359050610203816101dd565b92915050565b60006020828403121561021f5761021e6101ce565b5b600061022d848285016101f4565b91505092915050565b61023f816101d3565b82525050565b600060208201905061025a6000830184610236565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061028b82610260565b9050919050565b61029b81610280565b82525050565b60006020820190506102b66000830184610292565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006102f6826101d3565b9150610301836101d3565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115610336576103356102bc565b5b82820190509291505056fea2646970667358221220b37e993e133ed19c840809cc8acbbba8116dee3744ba01c81044d75146805c9364736f6c634300080f0033"; @@ -324,7 +324,7 @@ pub fn test_evm_create2() { let sender_evm_acc: H160 = sender_evm_acc_slice.into(); // Ensure the substrate version of the evm account has some money. let sender_evm_substrate_addr = HashedAddressMapping::into_account_id(sender_evm_acc); - endow(&mut state, vec![(sender_evm_substrate_addr, 51_777_000_000_000, 0)]); + endow(&mut state, vec![(sender_evm_substrate_addr, 51_777_000_000_000)]); let salt = H256::from_low_u64_be(20); // Bytecode from Counter.sol diff --git a/enclave-runtime/src/top_pool_execution.rs b/enclave-runtime/src/top_pool_execution.rs index e17428a845..cff5971ae7 100644 --- a/enclave-runtime/src/top_pool_execution.rs +++ b/enclave-runtime/src/top_pool_execution.rs @@ -112,7 +112,7 @@ fn execute_top_pool_trusted_calls_internal() -> Result<()> { let latest_parentchain_header = sidechain_block_import_queue_worker.process_queue(¤t_parentchain_header)?; - info!( + trace!( "Elapsed time to process sidechain block import queue: {} ms", start_time.elapsed().as_millis() ); @@ -283,7 +283,7 @@ fn log_remaining_slot_duration>( info!("No time remaining in slot (id: {:?}, stage: {})", slot_info.slot, stage_name); }, Some(remainder) => { - info!( + trace!( "Remaining time in slot (id: {:?}, stage {}): {} ms, {}% of slot time", slot_info.slot, stage_name, diff --git a/local-setup/py/worker.py b/local-setup/py/worker.py index db12a2c461..e9bf284ed7 100644 --- a/local-setup/py/worker.py +++ b/local-setup/py/worker.py @@ -159,6 +159,10 @@ def run_in_background(self, log_file: TextIO, flags: [str] = None, subcommand_fl 'jsonrpsee_ws_server=warn,' 'enclave_runtime=info,' 'integritee_service=warn,' + 'itp_stf_state_handler=debug,' + 'its_consensus_common=debug,' + 'its_consensus_aura=trace,' + 'itc_parentchain_block_importer=debug,' 'ita_stf=debug') worker_cmd = self._assemble_cmd(flags=flags, subcommand_flags=subcommand_flags) print("worker command is "+ str(worker_cmd)) diff --git a/service/Cargo.toml b/service/Cargo.toml index 75340ffe4f..6a809ba542 100644 --- a/service/Cargo.toml +++ b/service/Cargo.toml @@ -60,20 +60,20 @@ its-storage = { path = "../sidechain/storage" } # scs / integritee -my-node-runtime = { package = "integritee-node-runtime", git = "https://github.com/integritee-network/integritee-node.git", branch = "polkadot-v0.9.39" } -sgx-verify = { git = "https://github.com/integritee-network/pallets.git", branch = "polkadot-v0.9.39" } +my-node-runtime = { package = "integritee-node-runtime", git = "https://github.com/integritee-network/integritee-node.git", branch = "polkadot-v0.9.42" } +sgx-verify = { git = "https://github.com/integritee-network/pallets.git", branch = "polkadot-v0.9.42" } # `default-features = false` to remove the jsonrpsee dependency. -substrate-api-client = { default-features = false, features = ["std", "ws-client"], git = "https://github.com/scs/substrate-api-client.git", branch = "polkadot-v0.9.39" } -teerex-primitives = { git = "https://github.com/integritee-network/pallets.git", branch = "polkadot-v0.9.39" } +substrate-api-client = { default-features = false, features = ["std", "ws-client"], git = "https://github.com/scs/substrate-api-client.git", branch = "polkadot-v0.9.42-tag-v0.10.0" } +teerex-primitives = { git = "https://github.com/integritee-network/pallets.git", branch = "polkadot-v0.9.42" } # Substrate dependencies -frame-support = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -frame-system = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -pallet-balances = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-core = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-finality-grandpa = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-keyring = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-runtime = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } +frame-support = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } +frame-system = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } +pallet-balances = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } +sp-consensus-grandpa = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } +sp-core = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } +sp-keyring = { 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" } [features] default = [] diff --git a/service/src/account_funding.rs b/service/src/account_funding.rs index 9988b9c97a..15c5038bf0 100644 --- a/service/src/account_funding.rs +++ b/service/src/account_funding.rs @@ -30,7 +30,7 @@ use sp_core::{ use sp_keyring::AccountKeyring; use sp_runtime::MultiAddress; use substrate_api_client::{ - extrinsic::BalancesExtrinsics, GetBalance, GetTransactionPayment, SubmitAndWatch, XtStatus, + extrinsic::BalancesExtrinsics, GetBalance, GetTransactionPayment, SubmitAndWatchUntilSuccess, }; /// Information about the enclave on-chain account. @@ -155,14 +155,14 @@ fn bootstrap_funds_from_alice( let mut alice_signer_api = api.clone(); alice_signer_api.set_signer(ParentchainExtrinsicSigner::new(alice)); - println!("[+] bootstrap funding Enclave from Alice's funds"); - let xt = alice_signer_api.balance_transfer(MultiAddress::Id(accountid.clone()), funding_amount); - let xt_report = alice_signer_api.submit_and_watch_extrinsic_until(xt, XtStatus::InBlock)?; + println!("[+] send extrinsic: bootstrap funding Enclave from Alice's funds"); + let xt = alice_signer_api + .balance_transfer_allow_death(MultiAddress::Id(accountid.clone()), funding_amount); + let xt_report = alice_signer_api.submit_and_watch_extrinsic_until_success(xt, false)?; info!( - "[<] Extrinsic got included in a block. Extrinsic Hash: {:?}\n", - xt_report.extrinsic_hash + "[<] L1 extrinsic success. extrinsic hash: {:?} / status: {:?}", + xt_report.extrinsic_hash, xt_report.status ); - // Verify funds have arrived. let free_balance = alice_signer_api.get_free_balance(accountid); info!("TEE's NEW free balance = {:?}", free_balance); diff --git a/service/src/main.rs b/service/src/main.rs index c7d602bf31..bd0ea3b5f0 100644 --- a/service/src/main.rs +++ b/service/src/main.rs @@ -72,7 +72,8 @@ use log::*; use my_node_runtime::{Hash, Header, RuntimeEvent}; use sgx_types::*; use substrate_api_client::{ - rpc::HandleSubscription, GetHeader, SubmitAndWatchUntilSuccess, SubscribeChain, SubscribeEvents, + api::XtStatus, rpc::HandleSubscription, GetHeader, SubmitAndWatch, SubscribeChain, + SubscribeEvents, }; #[cfg(feature = "dcap")] @@ -428,6 +429,8 @@ fn start_worker( .unwrap(), ); let last_synced_header = parentchain_handler.init_parentchain_components().unwrap(); + trace!("last synched parentchain block: {}", last_synced_header.number); + let nonce = node_api.get_nonce_of(&tee_accountid).unwrap(); info!("Enclave nonce = {:?}", nonce); enclave @@ -480,13 +483,14 @@ fn start_worker( let register_xt = move || enclave2.generate_dcap_ra_extrinsic(&trusted_url, skip_ra).unwrap(); let send_register_xt = move || { + println!("[+] Send register enclave extrinsic"); send_extrinsic(register_xt(), &node_api2, &tee_accountid.clone(), is_development_mode) }; - let register_enclave_block_hash = send_register_xt(); + let register_enclave_block_hash = send_register_xt().unwrap(); let register_enclave_xt_header = - node_api.get_header(register_enclave_block_hash).unwrap().unwrap(); + node_api.get_header(Some(register_enclave_block_hash)).unwrap().unwrap(); let we_are_primary_validateer = we_are_primary_validateer(&node_api, ®ister_enclave_xt_header).unwrap(); @@ -586,10 +590,10 @@ fn spawn_worker_for_shard_polling( loop { info!("Polling for worker for shard ({} seconds interval)", POLL_INTERVAL_SECS); - if let Ok(Some(_)) = node_api.worker_for_shard(&shard_for_initialized, None) { + if let Ok(Some(enclave)) = node_api.worker_for_shard(&shard_for_initialized, None) { // Set that the service is initialized. initialization_handler.worker_for_shard_registered(); - println!("[+] Found `WorkerForShard` on parentchain state"); + println!("[+] Found `WorkerForShard` on parentchain state: {:?}", enclave.pubkey); break } thread::sleep(Duration::from_secs(POLL_INTERVAL_SECS)); @@ -622,9 +626,13 @@ fn print_events(events: Vec) { RuntimeEvent::Teerex(re) => { debug!("{:?}", re); match &re { - my_node_runtime::pallet_teerex::Event::AddedEnclave(sender, worker_url) => { + my_node_runtime::pallet_teerex::Event::AddedEnclave { + registered_by, + worker_url, + .. + } => { println!("[+] Received AddedEnclave event"); - println!(" Sender (Worker): {:?}", sender); + println!(" Sender (Worker): {:?}", registered_by); println!(" Registered URL: {:?}", str::from_utf8(worker_url).unwrap()); }, my_node_runtime::pallet_teerex::Event::Forwarded(shard) => { @@ -807,23 +815,28 @@ fn register_collateral( fn send_extrinsic( extrinsic: Vec, api: &ParentchainApi, - accountid: &AccountId32, + fee_payer: &AccountId32, is_development_mode: bool, ) -> Option { - // Account funds - if let Err(x) = setup_account_funding(api, accountid, extrinsic.clone(), is_development_mode) { - error!("Starting worker failed: {:?}", x); + // ensure account funds + if let Err(x) = setup_account_funding(api, fee_payer, extrinsic.clone(), is_development_mode) { + error!("Ensure enclave funding failed: {:?}", x); // Return without registering the enclave. This will fail and the transaction will be banned for 30min. return None } - println!("[>] send extrinsic"); + info!("[>] send extrinsic"); + trace!(" encoded extrinsic: 0x{:}", hex::encode(extrinsic.clone())); - match api.submit_and_watch_opaque_extrinsic_until_success(extrinsic.into(), true) { + // fixme: wait ...until_success doesn't work due to https://github.com/scs/substrate-api-client/issues/624 + // fixme: currently, we don't verify if the extrinsic was a success here + match api.submit_and_watch_opaque_extrinsic_until(extrinsic.into(), XtStatus::Finalized) { Ok(xt_report) => { - let register_qe_block_hash = xt_report.block_hash; - println!("[<] Extrinsic got finalized. Block hash: {:?}\n", register_qe_block_hash); - register_qe_block_hash + info!( + "[+] L1 extrinsic success. extrinsic hash: {:?} / status: {:?}", + xt_report.extrinsic_hash, xt_report.status + ); + xt_report.block_hash }, Err(e) => { error!("ExtrinsicFailed {:?}", e); @@ -874,5 +887,10 @@ fn we_are_primary_validateer( ) -> Result { let enclave_count_of_previous_block = node_api.enclave_count(Some(*register_enclave_xt_header.parent_hash()))?; + trace!( + "enclave count is {} for previous block 0x{:?}", + enclave_count_of_previous_block, + register_enclave_xt_header.parent_hash() + ); Ok(enclave_count_of_previous_block == 0) } diff --git a/service/src/parentchain_handler.rs b/service/src/parentchain_handler.rs index a37e24387c..b0a9c44395 100644 --- a/service/src/parentchain_handler.rs +++ b/service/src/parentchain_handler.rs @@ -26,7 +26,7 @@ use itp_node_api::api_client::ChainApi; use itp_storage::StorageProof; use log::*; use my_node_runtime::Header; -use sp_finality_grandpa::VersionedAuthorityList; +use sp_consensus_grandpa::VersionedAuthorityList; use sp_runtime::traits::Header as HeaderTrait; use std::{cmp::min, sync::Arc}; @@ -176,6 +176,7 @@ where } fn trigger_parentchain_block_import(&self) -> ServiceResult<()> { + trace!("trigger parentchain block import"); Ok(self.enclave_api.trigger_parentchain_block_import()?) } @@ -184,10 +185,16 @@ where last_synced_header: &Header, until_header: &Header, ) -> ServiceResult
{ + trace!( + "last synched block number: {}. synching until {}", + last_synced_header.number, + until_header.number + ); let mut last_synced_header = last_synced_header.clone(); while last_synced_header.number() < until_header.number() { last_synced_header = self.sync_parentchain(last_synced_header)?; + trace!("synched block number: {}", last_synced_header.number); } self.trigger_parentchain_block_import()?; diff --git a/service/src/prometheus_metrics.rs b/service/src/prometheus_metrics.rs index 1766be5dd2..b20e40805b 100644 --- a/service/src/prometheus_metrics.rs +++ b/service/src/prometheus_metrics.rs @@ -26,10 +26,10 @@ use crate::{ }; use async_trait::async_trait; use codec::{Decode, Encode}; -#[cfg(feature = "dcap")] +#[cfg(feature = "attesteer")] use core::time::Duration; use frame_support::scale_info::TypeInfo; -#[cfg(feature = "dcap")] +#[cfg(feature = "attesteer")] use itc_rest_client::{ http_client::{DefaultSend, HttpClient}, rest_client::{RestClient, Url as URL}, @@ -187,7 +187,7 @@ impl ReceiveEnclaveMetrics for EnclaveMetricsReceiver { #[derive(Serialize, Deserialize, Debug)] struct PrometheusMarblerunEvents(pub Vec); -#[cfg(feature = "dcap")] +#[cfg(feature = "attesteer")] impl RestPath<&str> for PrometheusMarblerunEvents { fn get_path(path: &str) -> Result { Ok(format!("{}", path)) diff --git a/service/src/tests/mocks/parentchain_api_mock.rs b/service/src/tests/mocks/parentchain_api_mock.rs index 9277b4891d..9233977d39 100644 --- a/service/src/tests/mocks/parentchain_api_mock.rs +++ b/service/src/tests/mocks/parentchain_api_mock.rs @@ -21,7 +21,7 @@ use itp_types::{ parentchain::{Hash, Header, StorageProof}, H256, }; -use sp_finality_grandpa::AuthorityList; +use sp_consensus_grandpa::AuthorityList; pub struct ParentchainApiMock { parentchain: Vec, diff --git a/sidechain/block-composer/Cargo.toml b/sidechain/block-composer/Cargo.toml index 0a978bf667..48da60d6f9 100644 --- a/sidechain/block-composer/Cargo.toml +++ b/sidechain/block-composer/Cargo.toml @@ -32,8 +32,8 @@ thiserror = { version = "1.0", optional = true } # no-std compatible libraries codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } log = { version = "0.4", default-features = false } -sp-core = { default-features = false, features = ["full_crypto"], git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } +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" } [features] diff --git a/sidechain/block-verification/Cargo.toml b/sidechain/block-verification/Cargo.toml index 391d0d49e4..20728928d7 100644 --- a/sidechain/block-verification/Cargo.toml +++ b/sidechain/block-verification/Cargo.toml @@ -18,10 +18,10 @@ itp-utils = { default-features = false, path = "../../core-primitives/utils" } its-primitives = { default-features = false, path = "../primitives" } # substrate deps -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-consensus-slots = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } +sp-consensus-slots = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } +sp-core = { default-features = false, 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" } # sgx deps sgx_tstd = { branch = "master", features = ["untrusted_fs", "net", "backtrace"], git = "https://github.com/apache/teaclave-sgx-sdk.git", optional = true } @@ -51,4 +51,4 @@ sgx = [ [dev-dependencies] itc-parentchain-test = { path = "../../core/parentchain/test" } its-test = { path = "../../sidechain/test" } -sp-keyring = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } +sp-keyring = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } diff --git a/sidechain/consensus/aura/Cargo.toml b/sidechain/consensus/aura/Cargo.toml index 587812ae20..5fcd079c4e 100644 --- a/sidechain/consensus/aura/Cargo.toml +++ b/sidechain/consensus/aura/Cargo.toml @@ -13,9 +13,9 @@ log = { version = "0.4", default-features = false } sgx_tstd = { branch = "master", git = "https://github.com/apache/teaclave-sgx-sdk.git", optional = true } # substrate deps -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-core = { default-features = false, features = ["full_crypto"], git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } +frame-support = { 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" } # local deps ita-stf = { path = "../../../app-libs/stf", default-features = false } @@ -47,7 +47,7 @@ itc-parentchain-test = { path = "../../../core/parentchain/test" } itp-storage = { path = "../../../core-primitives/storage" } itp-test = { path = "../../../core-primitives/test" } its-test = { path = "../../../sidechain/test" } -sp-keyring = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } +sp-keyring = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } [features] default = ["std"] diff --git a/sidechain/consensus/aura/src/block_importer.rs b/sidechain/consensus/aura/src/block_importer.rs index 4d28ac02e7..15d7217fb5 100644 --- a/sidechain/consensus/aura/src/block_importer.rs +++ b/sidechain/consensus/aura/src/block_importer.rs @@ -276,6 +276,19 @@ impl< sidechain_block: &SignedSidechainBlock::Block, last_imported_parentchain_header: &ParentchainBlock::Header, ) -> Result { + let last = last_imported_parentchain_header; + debug!("Peeking parentchain header"); + debug!( + "sidechain block parentchain head: {}", + sidechain_block.block_data().layer_one_head() + ); + debug!( + "last imported head: {}, number: {:?}, parenthash: {}", + last.hash(), + last.number(), + last.parent_hash() + ); + let parentchain_header_hash_to_peek = sidechain_block.block_data().layer_one_head(); if parentchain_header_hash_to_peek == last_imported_parentchain_header.hash() { debug!("No queue peek necessary, sidechain block references latest imported parentchain block"); diff --git a/sidechain/consensus/common/Cargo.toml b/sidechain/consensus/common/Cargo.toml index 45d5e71b57..226f19d8d3 100644 --- a/sidechain/consensus/common/Cargo.toml +++ b/sidechain/consensus/common/Cargo.toml @@ -30,7 +30,7 @@ sgx_types = { git = "https://github.com/apache/teaclave-sgx-sdk.git", branch = " thiserror-sgx = { package = "thiserror", optional = true, git = "https://github.com/mesalock-linux/thiserror-sgx", tag = "sgx_1.1.3" } # substrate deps -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } [dev-dependencies] # local @@ -40,7 +40,7 @@ itp-test = { path = "../../../core-primitives/test" } its-test = { path = "../../test" } # substrate -sp-core = { default-features = false, features = ["full_crypto"], git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } +sp-core = { default-features = false, features = ["full_crypto"], git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } [features] default = ["std"] diff --git a/sidechain/consensus/slots/Cargo.toml b/sidechain/consensus/slots/Cargo.toml index a80d5e2fc9..94ba257cad 100644 --- a/sidechain/consensus/slots/Cargo.toml +++ b/sidechain/consensus/slots/Cargo.toml @@ -24,8 +24,8 @@ futures-timer = { version = "3.0", optional = true } sgx_tstd = { branch = "master", git = "https://github.com/apache/teaclave-sgx-sdk.git", optional = true, features = ["untrusted_time"] } # substrate deps -sp-consensus-slots = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } +sp-consensus-slots = { default-features = false, 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" } # local deps itp-settings = { path = "../../../core-primitives/settings" } @@ -36,7 +36,7 @@ its-consensus-common = { path = "../common", default-features = false } [dev-dependencies] itc-parentchain-test = { path = "../../../core/parentchain/test" } its-test = { path = "../../test" } -sp-keyring = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } +sp-keyring = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } tokio = { version = "1.6.1", features = ["full"] } diff --git a/sidechain/primitives/Cargo.toml b/sidechain/primitives/Cargo.toml index 6cbffa83ef..e93e3d9719 100644 --- a/sidechain/primitives/Cargo.toml +++ b/sidechain/primitives/Cargo.toml @@ -14,10 +14,10 @@ serde = { version = "1.0.13", default-features = false } # substrate dependencies -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-io = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } +sp-io = { default-features = false, 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" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } [features] diff --git a/sidechain/rpc-handler/Cargo.toml b/sidechain/rpc-handler/Cargo.toml index 831b6408cc..bbe5c4e92b 100644 --- a/sidechain/rpc-handler/Cargo.toml +++ b/sidechain/rpc-handler/Cargo.toml @@ -28,7 +28,7 @@ rust-base58 = { package = "rust-base58", version = "0.0.4", optional = true } # no-std compatible libraries codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } log = { version = "0.4", default-features = false } -sp-core = { default-features = false, features = ["full_crypto"], git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } +sp-core = { default-features = false, features = ["full_crypto"], git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } [features] default = ["std"] diff --git a/sidechain/state/Cargo.toml b/sidechain/state/Cargo.toml index 7737b8c3cb..96b1fda3f1 100644 --- a/sidechain/state/Cargo.toml +++ b/sidechain/state/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" [dependencies] codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive", "chain-error"] } -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } log = { version = "0.4", default-features = false } serde = { version = "1.0", default-features = false, features = ["alloc", "derive"] } @@ -26,12 +26,12 @@ its-primitives = { path = "../primitives", default-features = false } sp-io = { optional = true, default-features = false, features = ["disable_oom", "disable_panic_handler", "disable_allocator"], path = "../../core-primitives/substrate-sgx/sp-io" } # substrate deps -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } # test deps [dev-dependencies] -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } [features] default = ["std"] diff --git a/sidechain/state/src/impls.rs b/sidechain/state/src/impls.rs index ea17b75a3d..669d4d3b2a 100644 --- a/sidechain/state/src/impls.rs +++ b/sidechain/state/src/impls.rs @@ -19,13 +19,14 @@ use crate::{Error, SidechainState, StateUpdate}; use codec::{Decode, Encode}; +use core::fmt::Debug; use frame_support::ensure; use itp_sgx_externalities::{SgxExternalitiesTrait, StateHash}; use itp_storage::keys::storage_value_key; -use log::{error, info}; +use log::{debug, error, info}; use sp_io::{storage, KillStorageResult}; -impl SidechainState for T +impl SidechainState for T where ::SgxExternalitiesType: Encode, { @@ -34,6 +35,10 @@ where fn apply_state_update(&mut self, state_payload: &Self::StateUpdate) -> Result<(), Error> { info!("Current state size: {}", self.state().encoded_size()); + debug!("Current hash: {}", self.hash()); + debug!("State_payload hash: {}", state_payload.state_hash_apriori()); + debug!("self is: {:#?}", &self); + debug!("state_payload is: {:#?}", &state_payload); ensure!(self.hash() == state_payload.state_hash_apriori(), Error::InvalidAprioriHash); self.execute_with(|| { diff --git a/sidechain/storage/Cargo.toml b/sidechain/storage/Cargo.toml index 4294b9faa2..b20bbf473a 100644 --- a/sidechain/storage/Cargo.toml +++ b/sidechain/storage/Cargo.toml @@ -18,7 +18,7 @@ itp-types = { path = "../../core-primitives/types" } its-primitives = { path = "../primitives" } # Substrate dependencies -sp-core = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } +sp-core = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } [dev-dependencies] # crate.io diff --git a/sidechain/test/Cargo.toml b/sidechain/test/Cargo.toml index 1a1c073e68..f6f8fbfc72 100644 --- a/sidechain/test/Cargo.toml +++ b/sidechain/test/Cargo.toml @@ -14,7 +14,7 @@ codec = { package = "parity-scale-codec", version = "3.0.0", default-features = sgx_tstd = { branch = "master", git = "https://github.com/apache/teaclave-sgx-sdk.git", features = ["untrusted_time"], optional = true } # Substrate dependencies -sp-core = { default_features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } +sp-core = { default_features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } # local itp-types = { path = "../../core-primitives/types", default_features = false } diff --git a/sidechain/validateer-fetch/Cargo.toml b/sidechain/validateer-fetch/Cargo.toml index 9a37ce2b93..dba26b3189 100644 --- a/sidechain/validateer-fetch/Cargo.toml +++ b/sidechain/validateer-fetch/Cargo.toml @@ -10,10 +10,10 @@ derive_more = "0.99.16" thiserror = "1.0.26" # substrate deps -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } +sp-core = { default-features = false, 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" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } # local deps itp-ocall-api = { path = "../../core-primitives/ocall-api", default-features = false } From 2c0cab6166785009ad6ec6697db44dc7297b7076 Mon Sep 17 00:00:00 2001 From: brenzi Date: Mon, 7 Aug 2023 15:55:33 +0100 Subject: [PATCH 08/11] integrate pallet teerex refactoring (#1390) * polkadot update v0.9.42 * followup for Keystore overhaul (final) (#13683) * implement missing trait methods * substrate-api-client: explicitly use synchronous mode instead of the default async * susbtrate-api-client followup regarding keystore overhaul * taplo fmt * followup for sidechain-evm * cargo clippy * fixup! followup for sidechain-evm * update integritee-node image * integritee-node: update branch * integritee-node: update branch * main: AddedEnclave change followup made in pallets/pull/180 * attesteer: fix warnings where DCAP was activated, but not with attesteer * evm: followup made in pallets/pull/180 * add debug! logs * remove commented out code * remove empty features * ita-sgx-runtime: fixup for freezing implementation in fungible trait * fixup! ita-sgx-runtime: fixup for freezing implementation in fungible trait * minor fixes and more logging (#1367) * [local-setup] fix setup with two workers: avoid using the same data dirs. (#1358) * [ita_stf/test_genesis] remove reserved balance from state, as it doesn't exist anymore * [enclave-runtime/top_pool_execution] downgrade logs to trace * [state_handler] add debug and trace logs * add additional flags for the worker setup * [its-consensus-aura/block_importer] add some more logs * local setup add some more logging * cli: fix keystore KeyTypeId inconsistency * fix clippy * fix wrong crate doc repository links * temporary bend to new pallet branch * patch to GH branches * build works * lift patches and fix changes * CI against new node release 1.1.0 * build completes. some OpaqueCall refactorings missing still * fix unshield_funds tx signature * fmt * fix typo * fix teeracle build * fix the merge * fmt * fix renaming * fix unit tests * fmt * dummy poke * fix enclave unit tests * fixed api breaking changes * quite some fixes * build works. needs cleanup * taplo fmt * dummy poke * fix mock * fix mrenclave encoding to base58 for cli * fix register enclave extrinsics with new skip ra property * properly fail if enclave isn't registered * pimp logs and try to get shard for confirm_processed_parentchain_block * fix confirm processed parentchain block * taplo fmt * fix unit tests * fix typo * fix warnings * fix and pimp cli * clippy * clippy * clippy * integrate aura and enclave-bridge * taple fmt * cosmetics * small review fixes * fix toml double dep * Update service/src/main.rs Co-authored-by: clangenb <37865735+clangenb@users.noreply.github.com> * taplo fmt * missing std enable * clippy --------- Co-authored-by: Szilard Parrag Co-authored-by: clangenb <37865735+clangenb@users.noreply.github.com> Co-authored-by: Christian Langenbacher --- .github/workflows/build_and_test.yml | 10 +- Cargo.lock | 232 +++++++++++------- Cargo.toml | 21 +- app-libs/stf/src/trusted_call.rs | 4 +- cli/Cargo.toml | 3 +- cli/src/base_cli/commands/listen.rs | 64 +++-- cli/src/base_cli/commands/shield_funds.rs | 29 ++- cli/src/base_cli/mod.rs | 50 ++-- cli/src/lib.rs | 2 + cli/src/oracle/commands/listen_to_exchange.rs | 8 +- cli/src/oracle/commands/listen_to_oracle.rs | 10 +- cli/src/trusted_operation.rs | 49 ++-- .../enclave-api/src/enclave_base.rs | 7 +- .../enclave-bridge-storage/Cargo.toml | 21 ++ .../enclave-bridge-storage/src/lib.rs | 31 +++ .../node-api/api-client-extensions/src/lib.rs | 1 - .../src/pallet_teerex.rs | 66 +++-- .../src/pallet_teerex_api_mock.rs | 21 +- core-primitives/node-api/metadata/src/lib.rs | 14 +- .../node-api/metadata/src/metadata_mocks.rs | 65 +++-- .../metadata/src/pallet_enclave_bridge.rs | 75 ++++++ .../node-api/metadata/src/pallet_teerex.rs | 65 ++--- core-primitives/teerex-storage/Cargo.toml | 2 + core-primitives/teerex-storage/src/lib.rs | 19 +- core-primitives/test/Cargo.toml | 4 +- .../test/src/builders/enclave_gen_builder.rs | 2 +- core-primitives/test/src/lib.rs | 1 - core-primitives/test/src/mock/onchain_mock.rs | 44 ++-- core-primitives/top-pool-author/src/author.rs | 4 + core-primitives/top-pool-author/src/mocks.rs | 5 + core-primitives/top-pool-author/src/traits.rs | 4 + core-primitives/types/Cargo.toml | 7 +- core-primitives/types/src/lib.rs | 35 +-- core-primitives/utils/Cargo.toml | 2 +- .../indirect-calls-executor/src/executor.rs | 41 ++-- .../src/filter_metadata.rs | 27 +- .../{call_worker.rs => invoke.rs} | 4 +- .../src/indirect_calls/mod.rs | 6 +- .../src/indirect_calls/shield_funds.rs | 6 +- core/parentchain/test/Cargo.toml | 2 +- enclave-runtime/Cargo.lock | 156 +++++++++--- enclave-runtime/Cargo.toml | 1 + enclave-runtime/src/attestation.rs | 69 +++++- .../src/initialization/global_components.rs | 4 +- .../src/test/fixtures/components.rs | 14 +- enclave-runtime/src/test/top_pool_tests.rs | 8 +- enclave-runtime/src/top_pool_execution.rs | 4 +- service/Cargo.toml | 1 + service/src/account_funding.rs | 9 +- service/src/main.rs | 189 +++++++++----- .../src/ocall_bridge/worker_on_chain_ocall.rs | 2 +- service/src/setup.rs | 5 +- service/src/sync_state.rs | 12 +- service/src/tests/mock.rs | 46 +++- service/src/tests/mocks/enclave_api_mock.rs | 5 +- service/src/utils.rs | 4 +- service/src/worker.rs | 4 +- sidechain/block-verification/Cargo.toml | 2 +- .../consensus/aura/src/block_importer.rs | 6 +- sidechain/consensus/aura/src/lib.rs | 50 ++-- .../aura/src/test/block_importer_tests.rs | 5 +- .../consensus/aura/src/test/fixtures/mod.rs | 5 - sidechain/consensus/aura/src/verifier.rs | 14 +- .../consensus/common/src/block_import.rs | 1 + sidechain/consensus/common/src/lib.rs | 1 + .../common/src/test/mocks/verifier_mock.rs | 3 +- sidechain/consensus/slots/src/lib.rs | 5 +- sidechain/consensus/slots/src/mocks.rs | 7 +- .../peer-fetch/src/untrusted_peer_fetch.rs | 9 +- sidechain/primitives/Cargo.toml | 5 +- sidechain/primitives/src/types/header.rs | 2 +- sidechain/test/Cargo.toml | 2 +- sidechain/validateer-fetch/Cargo.toml | 5 + sidechain/validateer-fetch/src/validateer.rs | 113 +++++---- 74 files changed, 1196 insertions(+), 635 deletions(-) create mode 100644 core-primitives/enclave-bridge-storage/Cargo.toml create mode 100644 core-primitives/enclave-bridge-storage/src/lib.rs create mode 100644 core-primitives/node-api/metadata/src/pallet_enclave_bridge.rs rename core/parentchain/indirect-calls-executor/src/indirect_calls/{call_worker.rs => invoke.rs} (96%) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 6e05f5cf24..15b9be7c05 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -251,7 +251,7 @@ jobs: echo "PROJECT=${{ matrix.flavor_id }}-${{ matrix.demo_name }}" >> $GITHUB_ENV echo "VERSION=dev.$version" >> $GITHUB_ENV echo "WORKER_IMAGE_TAG=integritee-worker:dev.$version" >> $GITHUB_ENV - echo "INTEGRITEE_NODE=integritee-node-dev-ias:1.0.36.$version" >> $GITHUB_ENV + echo "INTEGRITEE_NODE=integritee-node-dev-ias:1.1.0.$version" >> $GITHUB_ENV echo "CLIENT_IMAGE_TAG=integritee-cli:dev.$version" >> $GITHUB_ENV if [[ ${{ matrix.sgx_mode }} == 'HW' ]]; then echo "SGX_PROVISION=/dev/sgx/provision" >> $GITHUB_ENV @@ -296,8 +296,8 @@ jobs: fi docker tag integritee-worker-${{ matrix.flavor_id }}-${{ github.sha }} ${{ env.WORKER_IMAGE_TAG }} docker tag integritee-cli-client-${{ matrix.flavor_id }}-${{ github.sha }} ${{ env.CLIENT_IMAGE_TAG }} - docker pull integritee/integritee-node-dev-ias:1.0.36 - docker tag integritee/integritee-node-dev-ias:1.0.36 ${{ env.INTEGRITEE_NODE }} + docker pull integritee/integritee-node-dev-ias:1.1.0 + docker tag integritee/integritee-node-dev-ias:1.1.0 ${{ env.INTEGRITEE_NODE }} docker images --all ## @@ -463,9 +463,9 @@ jobs: uses: actions/download-artifact@v3 with: name: integritee-worker-teeracle-${{ github.ref_name }}.tar.gz - path: . + path: . - # + # # Temporary comment out until we decide what to release # # - name: Download Integritee Service diff --git a/Cargo.lock b/Cargo.lock index df7c526375..c9c4198956 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -726,7 +726,7 @@ dependencies = [ [[package]] name = "claims-primitives" version = "0.1.0" -source = "git+https://github.com/integritee-network/pallets.git?branch=polkadot-v0.9.42#be26e6b85f14896860ef919488e6bb4cf4b7aa29" +source = "git+https://github.com/integritee-network/pallets.git?branch=polkadot-v0.9.42#5c52182eb3a5156e8d9f69c10ca1441214ee6662" dependencies = [ "parity-scale-codec", "rustc-hex", @@ -831,8 +831,13 @@ dependencies = [ [[package]] name = "common-primitives" version = "0.1.0" -source = "git+https://github.com/integritee-network/pallets.git?branch=polkadot-v0.9.42#be26e6b85f14896860ef919488e6bb4cf4b7aa29" +source = "git+https://github.com/integritee-network/pallets.git?branch=polkadot-v0.9.42#5c52182eb3a5156e8d9f69c10ca1441214ee6662" dependencies = [ + "derive_more", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-runtime", "sp-std", ] @@ -1323,6 +1328,22 @@ dependencies = [ "zeroize", ] +[[package]] +name = "enclave-bridge-primitives" +version = "0.1.0" +source = "git+https://github.com/integritee-network/pallets.git?branch=polkadot-v0.9.42#5c52182eb3a5156e8d9f69c10ca1441214ee6662" +dependencies = [ + "common-primitives", + "log 0.4.19", + "parity-scale-codec", + "scale-info", + "serde 1.0.164", + "sp-core", + "sp-io 7.0.0 (git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42)", + "sp-runtime", + "sp-std", +] + [[package]] name = "encoding_rs" version = "0.8.32" @@ -1718,7 +1739,7 @@ checksum = "6c2141d6d6c8512188a7891b4b01590a45f6dac67afb4f255c4124dbb86d4eaa" [[package]] name = "frame-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-support", "frame-support-procedural", @@ -1771,7 +1792,7 @@ dependencies = [ [[package]] name = "frame-executive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-support", "frame-system", @@ -1810,7 +1831,7 @@ dependencies = [ [[package]] name = "frame-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "bitflags", "environmental 1.1.4", @@ -1843,7 +1864,7 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "Inflector", "cfg-expr", @@ -1859,7 +1880,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate", @@ -1871,7 +1892,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "proc-macro2", "quote", @@ -1881,7 +1902,7 @@ dependencies = [ [[package]] name = "frame-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-support", "log 0.4.19", @@ -1914,7 +1935,7 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "parity-scale-codec", "sp-api", @@ -2732,6 +2753,7 @@ dependencies = [ "blake2-rfc", "chrono 0.4.26", "clap 3.2.25", + "enclave-bridge-primitives", "env_logger 0.9.3", "frame-system", "hdrhistogram", @@ -2748,6 +2770,7 @@ dependencies = [ "itp-utils", "log 0.4.19", "pallet-balances", + "pallet-enclave-bridge", "pallet-evm", "pallet-teerex", "parity-scale-codec", @@ -2765,15 +2788,14 @@ dependencies = [ "sp-runtime", "substrate-api-client", "substrate-client-keystore", - "teerex-primitives", "thiserror 1.0.40", "ws", ] [[package]] name = "integritee-node-runtime" -version = "1.0.33" -source = "git+https://github.com/integritee-network/integritee-node.git?branch=polkadot-v0.9.42#2c13d1fd5708825b7832b6b1bc33448ca3111514" +version = "1.1.34" +source = "git+https://github.com/integritee-network/integritee-node.git?branch=polkadot-v0.9.42#31b72e13596c36c4963ed6caf631377b68d34754" dependencies = [ "frame-executive", "frame-support", @@ -2782,6 +2804,7 @@ dependencies = [ "pallet-aura", "pallet-balances", "pallet-claims", + "pallet-enclave-bridge", "pallet-grandpa", "pallet-insecure-randomness-collective-flip", "pallet-multisig", @@ -2824,6 +2847,7 @@ dependencies = [ "base58", "clap 2.34.0", "dirs", + "enclave-bridge-primitives", "env_logger 0.9.3", "frame-support", "frame-system", @@ -3433,6 +3457,16 @@ dependencies = [ "sgx_types", ] +[[package]] +name = "itp-enclave-bridge-storage" +version = "0.9.0" +dependencies = [ + "itp-storage", + "itp-types", + "parity-scale-codec", + "sp-std", +] + [[package]] name = "itp-enclave-metrics" version = "0.9.0" @@ -3750,6 +3784,7 @@ name = "itp-teerex-storage" version = "0.9.0" dependencies = [ "itp-storage", + "itp-types", "sp-std", ] @@ -3759,13 +3794,13 @@ version = "0.9.0" dependencies = [ "derive_more", "ita-stf", + "itp-enclave-bridge-storage", "itp-ocall-api", "itp-sgx-crypto", "itp-sgx-externalities", "itp-stf-interface", "itp-stf-state-handler", "itp-storage", - "itp-teerex-storage", "itp-time-utils", "itp-types", "jsonrpc-core 18.0.0 (git+https://github.com/scs/jsonrpc?branch=no_std_v18)", @@ -3848,6 +3883,7 @@ name = "itp-types" version = "0.9.0" dependencies = [ "chrono 0.4.26", + "enclave-bridge-primitives", "frame-system", "integritee-node-runtime", "itp-sgx-runtime-primitives", @@ -3859,6 +3895,7 @@ dependencies = [ "sp-core", "sp-runtime", "sp-std", + "teerex-primitives", ] [[package]] @@ -4041,6 +4078,7 @@ dependencies = [ name = "its-primitives" version = "0.1.0" dependencies = [ + "itp-types", "parity-scale-codec", "scale-info", "serde 1.0.164", @@ -4142,11 +4180,14 @@ dependencies = [ "derive_more", "frame-support", "itc-parentchain-test", + "itp-enclave-bridge-storage", "itp-ocall-api", "itp-storage", "itp-teerex-storage", "itp-test", "itp-types", + "its-primitives", + "log 0.4.19", "parity-scale-codec", "sp-core", "sp-runtime", @@ -5299,7 +5340,7 @@ dependencies = [ [[package]] name = "pallet-aura" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-support", "frame-system", @@ -5315,7 +5356,7 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-support", "frame-system", @@ -5329,7 +5370,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-benchmarking", "frame-support", @@ -5344,7 +5385,7 @@ dependencies = [ [[package]] name = "pallet-claims" version = "0.9.12" -source = "git+https://github.com/integritee-network/pallets.git?branch=polkadot-v0.9.42#be26e6b85f14896860ef919488e6bb4cf4b7aa29" +source = "git+https://github.com/integritee-network/pallets.git?branch=polkadot-v0.9.42#5c52182eb3a5156e8d9f69c10ca1441214ee6662" dependencies = [ "claims-primitives", "frame-support", @@ -5411,6 +5452,27 @@ dependencies = [ "syn 2.0.18", ] +[[package]] +name = "pallet-enclave-bridge" +version = "0.10.0" +source = "git+https://github.com/integritee-network/pallets.git?branch=polkadot-v0.9.42#5c52182eb3a5156e8d9f69c10ca1441214ee6662" +dependencies = [ + "enclave-bridge-primitives", + "frame-support", + "frame-system", + "log 0.4.19", + "pallet-teerex", + "pallet-timestamp", + "parity-scale-codec", + "scale-info", + "serde 1.0.164", + "sp-core", + "sp-io 7.0.0 (git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42)", + "sp-runtime", + "sp-std", + "teerex-primitives", +] + [[package]] name = "pallet-evm" version = "6.0.0-dev" @@ -5438,7 +5500,7 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-benchmarking", "frame-support", @@ -5461,7 +5523,7 @@ dependencies = [ [[package]] name = "pallet-insecure-randomness-collective-flip" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-support", "frame-system", @@ -5475,7 +5537,7 @@ dependencies = [ [[package]] name = "pallet-multisig" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-benchmarking", "frame-support", @@ -5491,7 +5553,7 @@ dependencies = [ [[package]] name = "pallet-parentchain" version = "0.9.0" -source = "git+https://github.com/integritee-network/pallets.git?branch=polkadot-v0.9.42#be26e6b85f14896860ef919488e6bb4cf4b7aa29" +source = "git+https://github.com/integritee-network/pallets.git?branch=polkadot-v0.9.42#5c52182eb3a5156e8d9f69c10ca1441214ee6662" dependencies = [ "frame-support", "frame-system", @@ -5508,7 +5570,7 @@ dependencies = [ [[package]] name = "pallet-preimage" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-support", "frame-system", @@ -5523,7 +5585,7 @@ dependencies = [ [[package]] name = "pallet-proxy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-benchmarking", "frame-support", @@ -5538,7 +5600,7 @@ dependencies = [ [[package]] name = "pallet-scheduler" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-benchmarking", "frame-support", @@ -5555,7 +5617,7 @@ dependencies = [ [[package]] name = "pallet-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-support", "frame-system", @@ -5575,12 +5637,14 @@ dependencies = [ [[package]] name = "pallet-sidechain" -version = "0.9.0" -source = "git+https://github.com/integritee-network/pallets.git?branch=polkadot-v0.9.42#be26e6b85f14896860ef919488e6bb4cf4b7aa29" +version = "0.10.0" +source = "git+https://github.com/integritee-network/pallets.git?branch=polkadot-v0.9.42#5c52182eb3a5156e8d9f69c10ca1441214ee6662" dependencies = [ + "enclave-bridge-primitives", "frame-support", "frame-system", "log 0.4.19", + "pallet-enclave-bridge", "pallet-teerex", "pallet-timestamp", "parity-scale-codec", @@ -5619,7 +5683,7 @@ dependencies = [ [[package]] name = "pallet-sudo" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-support", "frame-system", @@ -5633,7 +5697,7 @@ dependencies = [ [[package]] name = "pallet-teeracle" version = "0.1.0" -source = "git+https://github.com/integritee-network/pallets.git?branch=polkadot-v0.9.42#be26e6b85f14896860ef919488e6bb4cf4b7aa29" +source = "git+https://github.com/integritee-network/pallets.git?branch=polkadot-v0.9.42#5c52182eb3a5156e8d9f69c10ca1441214ee6662" dependencies = [ "frame-support", "frame-system", @@ -5647,12 +5711,13 @@ dependencies = [ "sp-std", "substrate-fixed", "teeracle-primitives", + "teerex-primitives", ] [[package]] name = "pallet-teerex" -version = "0.9.0" -source = "git+https://github.com/integritee-network/pallets.git?branch=polkadot-v0.9.42#be26e6b85f14896860ef919488e6bb4cf4b7aa29" +version = "0.10.0" +source = "git+https://github.com/integritee-network/pallets.git?branch=polkadot-v0.9.42#5c52182eb3a5156e8d9f69c10ca1441214ee6662" dependencies = [ "frame-support", "frame-system", @@ -5672,7 +5737,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-benchmarking", "frame-support", @@ -5690,7 +5755,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-support", "frame-system", @@ -5706,7 +5771,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -5718,7 +5783,7 @@ dependencies = [ [[package]] name = "pallet-treasury" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-benchmarking", "frame-support", @@ -5735,7 +5800,7 @@ dependencies = [ [[package]] name = "pallet-utility" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-benchmarking", "frame-support", @@ -5751,7 +5816,7 @@ dependencies = [ [[package]] name = "pallet-vesting" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-benchmarking", "frame-support", @@ -7137,7 +7202,7 @@ dependencies = [ [[package]] name = "sgx-verify" version = "0.1.4" -source = "git+https://github.com/integritee-network/pallets.git?branch=polkadot-v0.9.42#be26e6b85f14896860ef919488e6bb4cf4b7aa29" +source = "git+https://github.com/integritee-network/pallets.git?branch=polkadot-v0.9.42#5c52182eb3a5156e8d9f69c10ca1441214ee6662" dependencies = [ "base64 0.13.1", "chrono 0.4.26", @@ -7145,6 +7210,7 @@ dependencies = [ "frame-support", "hex", "hex-literal", + "log 0.4.19", "parity-scale-codec", "ring 0.16.20 (git+https://github.com/Niederb/ring-xous.git?branch=0.16.20-cleanup)", "scale-info", @@ -7423,7 +7489,7 @@ checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3" [[package]] name = "sidechain-primitives" version = "0.1.0" -source = "git+https://github.com/integritee-network/pallets.git?branch=polkadot-v0.9.42#be26e6b85f14896860ef919488e6bb4cf4b7aa29" +source = "git+https://github.com/integritee-network/pallets.git?branch=polkadot-v0.9.42#5c52182eb3a5156e8d9f69c10ca1441214ee6662" dependencies = [ "parity-scale-codec", "scale-info", @@ -7531,7 +7597,7 @@ dependencies = [ [[package]] name = "sp-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "hash-db 0.16.0", "log 0.4.19", @@ -7551,7 +7617,7 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "Inflector", "blake2", @@ -7565,7 +7631,7 @@ dependencies = [ [[package]] name = "sp-application-crypto" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "parity-scale-codec", "scale-info", @@ -7578,7 +7644,7 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "integer-sqrt", "num-traits 0.2.15", @@ -7592,7 +7658,7 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "parity-scale-codec", "sp-api", @@ -7604,7 +7670,7 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "async-trait", "futures 0.3.28", @@ -7619,7 +7685,7 @@ dependencies = [ [[package]] name = "sp-consensus-aura" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "async-trait", "parity-scale-codec", @@ -7637,7 +7703,7 @@ dependencies = [ [[package]] name = "sp-consensus-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "finality-grandpa", "log 0.4.19", @@ -7655,7 +7721,7 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "parity-scale-codec", "scale-info", @@ -7667,7 +7733,7 @@ dependencies = [ [[package]] name = "sp-core" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "array-bytes 4.2.0", "bitflags", @@ -7711,7 +7777,7 @@ dependencies = [ [[package]] name = "sp-core-hashing" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "blake2b_simd", "byteorder 1.4.3", @@ -7725,7 +7791,7 @@ dependencies = [ [[package]] name = "sp-core-hashing-proc-macro" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "proc-macro2", "quote", @@ -7736,7 +7802,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "proc-macro2", "quote", @@ -7746,7 +7812,7 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.13.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "environmental 1.1.4", "parity-scale-codec", @@ -7757,7 +7823,7 @@ dependencies = [ [[package]] name = "sp-inherents" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -7795,7 +7861,7 @@ dependencies = [ [[package]] name = "sp-io" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "bytes 1.4.0", "ed25519", @@ -7832,7 +7898,7 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.13.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "futures 0.3.28", "parity-scale-codec", @@ -7846,7 +7912,7 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "thiserror 1.0.40", "zstd", @@ -7855,7 +7921,7 @@ dependencies = [ [[package]] name = "sp-metadata-ir" version = "0.1.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-metadata 15.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-scale-codec", @@ -7880,7 +7946,7 @@ dependencies = [ [[package]] name = "sp-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "sp-api", "sp-core", @@ -7890,7 +7956,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "backtrace", "lazy_static", @@ -7900,7 +7966,7 @@ dependencies = [ [[package]] name = "sp-runtime" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "either", "hash256-std-hasher", @@ -7922,7 +7988,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "bytes 1.4.0", "impl-trait-for-tuples", @@ -7940,7 +8006,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "Inflector", "proc-macro-crate", @@ -7952,7 +8018,7 @@ dependencies = [ [[package]] name = "sp-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "parity-scale-codec", "scale-info", @@ -7966,7 +8032,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "parity-scale-codec", "scale-info", @@ -7979,7 +8045,7 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.13.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "hash-db 0.16.0", "log 0.4.19", @@ -7999,12 +8065,12 @@ dependencies = [ [[package]] name = "sp-std" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" [[package]] name = "sp-storage" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "impl-serde", "parity-scale-codec", @@ -8017,7 +8083,7 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "async-trait", "futures-timer", @@ -8032,7 +8098,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "parity-scale-codec", "sp-std", @@ -8044,7 +8110,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "sp-api", "sp-runtime", @@ -8053,7 +8119,7 @@ dependencies = [ [[package]] name = "sp-trie" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "ahash 0.8.3", "hash-db 0.16.0", @@ -8076,7 +8142,7 @@ dependencies = [ [[package]] name = "sp-version" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "impl-serde", "parity-scale-codec", @@ -8093,7 +8159,7 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "parity-scale-codec", "proc-macro2", @@ -8104,7 +8170,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "anyhow", "impl-trait-for-tuples", @@ -8118,7 +8184,7 @@ dependencies = [ [[package]] name = "sp-weights" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "parity-scale-codec", "scale-info", @@ -8289,7 +8355,7 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "ansi_term", "build-helper", @@ -8358,7 +8424,7 @@ checksum = "fd1ba337640d60c3e96bc6f0638a939b9c9a7f2c316a1598c279828b3d1dc8c5" [[package]] name = "teeracle-primitives" version = "0.1.0" -source = "git+https://github.com/integritee-network/pallets.git?branch=polkadot-v0.9.42#be26e6b85f14896860ef919488e6bb4cf4b7aa29" +source = "git+https://github.com/integritee-network/pallets.git?branch=polkadot-v0.9.42#5c52182eb3a5156e8d9f69c10ca1441214ee6662" dependencies = [ "common-primitives", "sp-std", @@ -8368,14 +8434,16 @@ dependencies = [ [[package]] name = "teerex-primitives" version = "0.1.0" -source = "git+https://github.com/integritee-network/pallets.git?branch=polkadot-v0.9.42#be26e6b85f14896860ef919488e6bb4cf4b7aa29" +source = "git+https://github.com/integritee-network/pallets.git?branch=polkadot-v0.9.42#5c52182eb3a5156e8d9f69c10ca1441214ee6662" dependencies = [ "common-primitives", + "derive_more", + "log 0.4.19", "parity-scale-codec", "scale-info", "serde 1.0.164", "sp-core", - "sp-io 7.0.0 (git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42)", + "sp-runtime", "sp-std", ] @@ -8865,7 +8933,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/Cargo.toml b/Cargo.toml index b0c1ac722a..efa7c1c0b6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -88,20 +88,25 @@ sgx_urts = { version = "1.1.6", git = "https://github.com/apache/incubator-teacl #sgx-externalities = { path = "../sgx-runtime/substrate-sgx/externalities"} #[patch."https://github.com/integritee-network/integritee-node"] -#my-node-runtime = { package = "integritee-node-runtime", path = "../integritee-node/runtime"} +#my-node-runtime = { package = "integritee-node-runtime", git = "https://github.com/integritee-network//integritee-node", branch = "ab/integrate-pallet-teerex-refactoring" } #[patch."https://github.com/scs/substrate-api-client"] #substrate-api-client = { path = "../../scs/substrate-api-client" } #substrate-client-keystore = { path = "../../scs/substrate-api-client/client-keystore" } #[patch."https://github.com/integritee-network/pallets.git"] -#pallet-claims = { path = "../pallets/claims" } -#pallet-teerex = { path = "../pallets/teerex" } -#pallet-teeracle = { path = "../pallets/teeracle" } -#teerex-primitives = {path = "../pallets/primitives/teerex"} -#pallet-parentchain = { path = "../pallets/parentchain" } -#itp-types = { path = "../pallets/primitives/types"} -#itp-utils = { path = "../pallets/primitives/utils"} +#pallet-claims = { git = "https://github.com/integritee-network//pallets", branch = "ab/shard-config-upgradability-2" } +#pallet-enclave-bridge = { git = "https://github.com/integritee-network//pallets", branch = "ab/shard-config-upgradability-2" } +#pallet-teerex = { git = "https://github.com/integritee-network//pallets", branch = "ab/shard-config-upgradability-2" } +#pallet-sidechain = { git = "https://github.com/integritee-network//pallets", branch = "ab/shard-config-upgradability-2" } +#sgx-verify = { git = "https://github.com/integritee-network//pallets", branch = "ab/shard-config-upgradability-2" } +#pallet-teeracle = { git = "https://github.com/integritee-network//pallets", branch = "ab/shard-config-upgradability-2" } +#test-utils = { git = "https://github.com/integritee-network//pallets", branch = "ab/shard-config-upgradability-2" } +#claims-primitives = { git = "https://github.com/integritee-network//pallets", branch = "ab/shard-config-upgradability-2" } +#enclave-bridge-primitives = { git = "https://github.com/integritee-network//pallets", branch = "ab/shard-config-upgradability-2" } +#teerex-primitives = { git = "https://github.com/integritee-network//pallets", branch = "ab/shard-config-upgradability-2" } +#teeracle-primitives = { git = "https://github.com/integritee-network//pallets", branch = "ab/shard-config-upgradability-2" } +#common-primitives = { git = "https://github.com/integritee-network//pallets", branch = "ab/shard-config-upgradability-2" } #[patch."https://github.com/integritee-network/http_req"] #http_req = {path = '..//http_req' } diff --git a/app-libs/stf/src/trusted_call.rs b/app-libs/stf/src/trusted_call.rs index 1f13721f6b..c81d21eadc 100644 --- a/app-libs/stf/src/trusted_call.rs +++ b/app-libs/stf/src/trusted_call.rs @@ -27,7 +27,7 @@ use frame_support::{ensure, traits::UnfilteredDispatchable}; pub use ita_sgx_runtime::{Balance, Index}; use ita_sgx_runtime::{Runtime, System}; use itp_node_api::metadata::{provider::AccessNodeMetadata, NodeMetadataTrait}; -use itp_node_api_metadata::pallet_teerex::TeerexCallIndexes; +use itp_node_api_metadata::pallet_enclave_bridge::EnclaveBridgeCallIndexes; use itp_stf_interface::ExecuteCall; use itp_stf_primitives::types::{AccountId, KeyPair, ShardIdentifier, Signature}; use itp_types::OpaqueCall; @@ -244,9 +244,9 @@ where unshield_funds(account_incognito, value)?; calls.push(OpaqueCall::from_tuple(&( node_metadata_repo.get_from_metadata(|m| m.unshield_funds_call_indexes())??, + shard, beneficiary, value, - shard, call_hash, ))); Ok(()) diff --git a/cli/Cargo.toml b/cli/Cargo.toml index d9f87ae28d..f49593f1b3 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -26,12 +26,13 @@ ws = { version = "0.9.1", features = ["ssl"] } # scs / integritee my-node-runtime = { package = "integritee-node-runtime", git = "https://github.com/integritee-network/integritee-node.git", branch = "polkadot-v0.9.42" } +pallet-enclave-bridge = { git = "https://github.com/integritee-network/pallets.git", branch = "polkadot-v0.9.42" } pallet-evm = { optional = true, git = "https://github.com/integritee-network/frontier.git", branch = "bar/polkadot-v0.9.42" } pallet-teerex = { git = "https://github.com/integritee-network/pallets.git", branch = "polkadot-v0.9.42" } # `default-features = false` to remove the jsonrpsee dependency. +enclave-bridge-primitives = { git = "https://github.com/integritee-network/pallets.git", branch = "polkadot-v0.9.42" } substrate-api-client = { default-features = false, features = ["std", "ws-client"], git = "https://github.com/scs/substrate-api-client.git", branch = "polkadot-v0.9.42-tag-v0.10.0" } substrate-client-keystore = { git = "https://github.com/scs/substrate-api-client.git", branch = "polkadot-v0.9.42-tag-v0.10.0" } -teerex-primitives = { git = "https://github.com/integritee-network/pallets.git", branch = "polkadot-v0.9.42" } # substrate dependencies frame-system = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } diff --git a/cli/src/base_cli/commands/listen.rs b/cli/src/base_cli/commands/listen.rs index 03d43ecf31..64d9e675e5 100644 --- a/cli/src/base_cli/commands/listen.rs +++ b/cli/src/base_cli/commands/listen.rs @@ -74,10 +74,10 @@ impl ListenCommand { } }, RuntimeEvent::Teerex(ee) => { - println!(">>>>>>>>>> integritee event: {:?}", ee); + println!(">>>>>>>>>> integritee teerex event: {:?}", ee); count += 1; match &ee { - my_node_runtime::pallet_teerex::Event::AddedEnclave{ + my_node_runtime::pallet_teerex::Event::AddedSgxEnclave{ registered_by, worker_url, .. } @@ -85,55 +85,69 @@ impl ListenCommand { println!( "AddedEnclave: {:?} at url {}", registered_by, - String::from_utf8(worker_url.to_vec()) + String::from_utf8(worker_url.clone().unwrap_or("none".into()).to_vec()) .unwrap_or_else(|_| "error".to_string()) ); }, - my_node_runtime::pallet_teerex::Event::RemovedEnclave( + my_node_runtime::pallet_teerex::Event::RemovedSovereignEnclave( accountid, ) => { println!("RemovedEnclave: {:?}", accountid); }, - my_node_runtime::pallet_teerex::Event::Forwarded(shard) => { + my_node_runtime::pallet_teerex::Event::RemovedProxiedEnclave( + eia, + ) => { + println!("RemovedEnclave: {:?}", eia); + }, + _ => debug!("ignoring unsupported teerex event: {:?}", ee), + } + }, + RuntimeEvent::EnclaveBridge(ee) => { + println!(">>>>>>>>>> integritee enclave bridge event: {:?}", ee); + count += 1; + match &ee { + my_node_runtime::pallet_enclave_bridge::Event::IndirectInvocationRegistered(shard) => { println!( "Forwarded request for shard {}", shard.encode().to_base58() ); }, - my_node_runtime::pallet_teerex::Event::ProcessedParentchainBlock( - accountid, + my_node_runtime::pallet_enclave_bridge::Event::ProcessedParentchainBlock { + shard, block_hash, - merkle_root, + trusted_calls_merkle_root, block_number, - ) => { + } => { println!( "ProcessedParentchainBlock from {} with hash {:?}, number {} and merkle root {:?}", - accountid, block_hash, merkle_root, block_number + shard, block_hash, trusted_calls_merkle_root, block_number ); }, - my_node_runtime::pallet_teerex::Event::ShieldFunds( - incognito_account, - ) => { - println!("ShieldFunds for {:?}", incognito_account); + my_node_runtime::pallet_enclave_bridge::Event::ShieldFunds { + shard, encrypted_beneficiary, amount + } => { + println!("ShieldFunds on shard {:?} for {:?}. amount: {:?}", shard, encrypted_beneficiary, amount); }, - my_node_runtime::pallet_teerex::Event::UnshieldedFunds( - public_account, - ) => { - println!("UnshieldFunds for {:?}", public_account); + my_node_runtime::pallet_enclave_bridge::Event::UnshieldedFunds { + shard, beneficiary, amount + } => { + println!("UnshieldFunds on shard {:?} for {:?}. amount: {:?}", shard, beneficiary, amount); }, - _ => debug!("ignoring unsupported teerex event: {:?}", ee), + _ => debug!("ignoring unsupported enclave_bridge event: {:?}", ee), } }, RuntimeEvent::Sidechain(ee) => { + println!(">>>>>>>>>> integritee sidechain event: {:?}", ee); count += 1; match &ee { - my_node_runtime::pallet_sidechain::Event::ProposedSidechainBlock( - accountid, - block_hash, - ) => { + my_node_runtime::pallet_sidechain::Event::FinalizedSidechainBlock { + shard, + block_header_hash, + validateer, + } => { println!( - "ProposedSidechainBlock from {} with hash {:?}", - accountid, block_hash + "ProposedSidechainBlock on shard {} from {} with hash {:?}", + shard, validateer, block_header_hash ); }, _ => debug!("ignoring unsupported sidechain event: {:?}", ee), diff --git a/cli/src/base_cli/commands/shield_funds.rs b/cli/src/base_cli/commands/shield_funds.rs index dbad28d071..0c1c538056 100644 --- a/cli/src/base_cli/commands/shield_funds.rs +++ b/cli/src/base_cli/commands/shield_funds.rs @@ -17,17 +17,17 @@ use crate::{ command_utils::{get_accountid_from_str, get_chain_api, *}, - Cli, CliResult, CliResultOk, + Cli, CliError, CliResult, CliResultOk, }; use base58::FromBase58; use codec::{Decode, Encode}; -use itp_node_api::api_client::{ParentchainExtrinsicSigner, TEEREX}; +use itp_node_api::api_client::{ParentchainExtrinsicSigner, ENCLAVE_BRIDGE}; use itp_sgx_crypto::ShieldingCryptoEncrypt; use itp_stf_primitives::types::ShardIdentifier; use log::*; use my_node_runtime::Balance; use sp_core::sr25519 as sr25519_core; -use substrate_api_client::{compose_extrinsic, SubmitAndWatch, XtStatus}; +use substrate_api_client::{compose_extrinsic, SubmitAndWatchUntilSuccess}; #[derive(Parser)] pub struct ShieldFundsCommand { @@ -68,16 +68,25 @@ impl ShieldFundsCommand { // Compose the extrinsic. let xt = compose_extrinsic!( chain_api, - TEEREX, + ENCLAVE_BRIDGE, "shield_funds", + shard, encrypted_recevier, - self.amount, - shard + self.amount ); - let tx_hash = chain_api.submit_and_watch_extrinsic_until(xt, XtStatus::Finalized).unwrap(); - println!("[+] TrustedOperation got finalized. Hash: {:?}\n", tx_hash); - - Ok(CliResultOk::None) + match chain_api.submit_and_watch_extrinsic_until_success(xt, true) { + Ok(xt_report) => { + println!( + "[+] shield funds success. extrinsic hash: {:?} / status: {:?} / block hash: {:?}", + xt_report.extrinsic_hash, xt_report.status, xt_report.block_hash.unwrap() + ); + Ok(CliResultOk::H256 { hash: xt_report.block_hash.unwrap() }) + }, + Err(e) => { + error!("shield_funds extrinsic failed {:?}", e); + Err(CliError::Extrinsic { msg: format!("{:?}", e) }) + }, + } } } diff --git a/cli/src/base_cli/mod.rs b/cli/src/base_cli/mod.rs index 117d1e317f..50dd7d0a33 100644 --- a/cli/src/base_cli/mod.rs +++ b/cli/src/base_cli/mod.rs @@ -24,16 +24,13 @@ use crate::{ Cli, CliResult, CliResultOk, ED25519_KEY_TYPE, SR25519_KEY_TYPE, }; use base58::ToBase58; -use chrono::{DateTime, Utc}; use clap::Subcommand; +use codec::Encode; use itc_rpc_client::direct_client::DirectApi; use itp_node_api::api_client::PalletTeerexApi; use sp_core::crypto::Ss58Codec; use sp_keystore::Keystore; -use std::{ - path::PathBuf, - time::{Duration, UNIX_EPOCH}, -}; +use std::path::PathBuf; use substrate_api_client::Metadata; use substrate_client_keystore::LocalKeystore; @@ -141,29 +138,22 @@ fn print_sgx_metadata(cli: &Cli) -> CliResult { fn list_workers(cli: &Cli) -> CliResult { let api = get_chain_api(cli); - let wcount = api.enclave_count(None).unwrap(); - println!("number of workers registered: {}", wcount); - - let mut mr_enclaves = Vec::with_capacity(wcount as usize); - - for w in 1..=wcount { - let enclave = api.enclave(w, None).unwrap(); - if enclave.is_none() { - println!("error reading enclave data"); - continue - }; - let enclave = enclave.unwrap(); - let timestamp = - DateTime::::from(UNIX_EPOCH + Duration::from_millis(enclave.timestamp)); - let mr_enclave = enclave.mr_enclave.to_base58(); - println!("Enclave {}", w); - println!(" AccountId: {}", enclave.pubkey.to_ss58check()); - println!(" MRENCLAVE: {}", mr_enclave); - println!(" RA timestamp: {}", timestamp); - println!(" URL: {}", enclave.url); - - mr_enclaves.push(mr_enclave); - } - - Ok(CliResultOk::MrEnclaveBase58 { mr_enclaves }) + let enclaves = api.all_enclaves(None).unwrap(); + println!("number of enclaves registered: {}", enclaves.len()); + let fingerprints = enclaves + .iter() + .map(|enclave| { + println!("Enclave"); + println!(" signer: {:?}", enclave.instance_signer()); + println!(" MRENCLAVE: {}", enclave.fingerprint().0.to_base58()); + println!(" RA timestamp: {}", enclave.attestation_timestamp()); + println!( + " URL: {}", + String::from_utf8(enclave.instance_url().unwrap_or_else(|| "none".encode())) + .unwrap() + ); + enclave.fingerprint().0.to_base58() + }) + .collect(); + Ok(CliResultOk::MrEnclaveBase58 { mr_enclaves: fingerprints }) } diff --git a/cli/src/lib.rs b/cli/src/lib.rs index 7f51946c13..3cde133166 100644 --- a/cli/src/lib.rs +++ b/cli/src/lib.rs @@ -110,6 +110,8 @@ pub enum CliResultOk { #[derive(Debug, Error)] pub enum CliError { + #[error("extrinsic error: {:?}", msg)] + Extrinsic { msg: String }, #[error("trusted operation error: {:?}", msg)] TrustedOp { msg: String }, #[error("EvmReadCommands error: {:?}", msg)] diff --git a/cli/src/oracle/commands/listen_to_exchange.rs b/cli/src/oracle/commands/listen_to_exchange.rs index 8c27e0e0ca..95bab3ab38 100644 --- a/cli/src/oracle/commands/listen_to_exchange.rs +++ b/cli/src/oracle/commands/listen_to_exchange.rs @@ -56,16 +56,16 @@ pub fn count_exchange_rate_update_events(api: &ParentchainApi, duration: Duratio info!("received event {:?}", event_record.event); if let RuntimeEvent::Teeracle(event) = &event_record.event { match &event { - my_node_runtime::pallet_teeracle::Event::ExchangeRateUpdated( - src, + my_node_runtime::pallet_teeracle::Event::ExchangeRateUpdated { + data_source, trading_pair, exchange_rate, - ) => { + } => { count += 1; debug!("Received ExchangeRateUpdated event"); println!( "ExchangeRateUpdated: TRADING_PAIR : {}, SRC : {}, VALUE :{:?}", - trading_pair, src, exchange_rate + trading_pair, data_source, exchange_rate ); }, _ => trace!("ignoring teeracle event: {:?}", event), diff --git a/cli/src/oracle/commands/listen_to_oracle.rs b/cli/src/oracle/commands/listen_to_oracle.rs index 916e8706ad..d367bc020c 100644 --- a/cli/src/oracle/commands/listen_to_oracle.rs +++ b/cli/src/oracle/commands/listen_to_oracle.rs @@ -71,10 +71,16 @@ fn report_event_count(event_records: Vec) -> EventCount { info!("received event {:?}", event_record.event); if let RuntimeEvent::Teeracle(event) = &event_record.event { match &event { - my_node_runtime::pallet_teeracle::Event::OracleUpdated(oracle_name, src) => { + my_node_runtime::pallet_teeracle::Event::OracleUpdated { + oracle_data_name, + data_source, + } => { count += 1; debug!("Received OracleUpdated event"); - println!("OracleUpdated: ORACLE_NAME : {}, SRC : {}", oracle_name, src); + println!( + "OracleUpdated: ORACLE_NAME : {}, SRC : {}", + oracle_data_name, data_source + ); }, // Can just remove this and ignore handling this case _ => debug!("ignoring teeracle event: {:?}", event), diff --git a/cli/src/trusted_operation.rs b/cli/src/trusted_operation.rs index 24bf9f1035..d8e5dc9a87 100644 --- a/cli/src/trusted_operation.rs +++ b/cli/src/trusted_operation.rs @@ -23,9 +23,10 @@ use crate::{ }; use base58::{FromBase58, ToBase58}; use codec::{Decode, Encode}; +use enclave_bridge_primitives::Request; use ita_stf::{Getter, TrustedOperation}; use itc_rpc_client::direct_client::{DirectApi, DirectClient}; -use itp_node_api::api_client::{ParentchainApi, ParentchainExtrinsicSigner, TEEREX}; +use itp_node_api::api_client::{ParentchainApi, ParentchainExtrinsicSigner, ENCLAVE_BRIDGE}; use itp_rpc::{RpcRequest, RpcResponse, RpcReturnValue}; use itp_sgx_crypto::ShieldingCryptoEncrypt; use itp_stf_primitives::types::ShardIdentifier; @@ -33,7 +34,7 @@ use itp_types::{BlockNumber, DirectRequestStatus, TrustedOperationStatus}; use itp_utils::{FromHexPrefixed, ToHexPrefixed}; use log::*; use my_node_runtime::{Hash, RuntimeEvent}; -use pallet_teerex::Event as TeerexEvent; +use pallet_enclave_bridge::Event as EnclaveBridgeEvent; use sp_core::{sr25519 as sr25519_core, H256}; use std::{ result::Result as StdResult, @@ -41,13 +42,14 @@ use std::{ time::Instant, }; use substrate_api_client::{ - compose_extrinsic, GetHeader, SubmitAndWatch, SubscribeEvents, XtStatus, + compose_extrinsic, GetHeader, SubmitAndWatchUntilSuccess, SubscribeEvents, }; -use teerex_primitives::Request; use thiserror::Error; #[derive(Debug, Error)] pub(crate) enum TrustedOperationError { + #[error("extrinsic L1 error: {msg:?}")] + Extrinsic { msg: String }, #[error("default error: {msg:?}")] Default { msg: String }, } @@ -127,7 +129,7 @@ fn send_indirect_request( let shard = read_shard(trusted_args).unwrap(); debug!( - "indirect send_request: trusted operation: {:?}, shard: {}", + "invoke indirect send_request: trusted operation: {:?}, shard: {}", trusted_operation, shard.encode().to_base58() ); @@ -136,14 +138,21 @@ fn send_indirect_request( chain_api.set_signer(ParentchainExtrinsicSigner::new(sr25519_core::Pair::from(signer))); let request = Request { shard, cyphertext: call_encrypted }; - let xt = compose_extrinsic!(&chain_api, TEEREX, "call_worker", request); + let xt = compose_extrinsic!(&chain_api, ENCLAVE_BRIDGE, "invoke", request); - // send and watch extrinsic until block is executed - let block_hash = chain_api - .submit_and_watch_extrinsic_until(xt, XtStatus::InBlock) - .unwrap() - .block_hash - .unwrap(); + let block_hash = match chain_api.submit_and_watch_extrinsic_until_success(xt, false) { + Ok(xt_report) => { + println!( + "[+] invoke TrustedOperation extrinsic success. extrinsic hash: {:?} / status: {:?} / block hash: {:?}", + xt_report.extrinsic_hash, xt_report.status, xt_report.block_hash.unwrap() + ); + xt_report.block_hash.unwrap() + }, + Err(e) => { + error!("invoke TrustedOperation extrinsic failed {:?}", e); + return Err(TrustedOperationError::Extrinsic { msg: format!("{:?}", e) }) + }, + }; info!( "Trusted call extrinsic sent for shard {} and successfully included in parentchain block with hash {:?}.", @@ -154,15 +163,17 @@ fn send_indirect_request( loop { let event_records = subscription.next_event::().unwrap().unwrap(); for event_record in event_records { - if let RuntimeEvent::Teerex(TeerexEvent::ProcessedParentchainBlock( - _signer, - confirmed_block_hash, - _merkle_root, - confirmed_block_number, - )) = event_record.event + if let RuntimeEvent::EnclaveBridge(EnclaveBridgeEvent::ProcessedParentchainBlock { + shard, + block_hash: confirmed_block_hash, + trusted_calls_merkle_root, + block_number: confirmed_block_number, + }) = event_record.event { info!("Confirmation of ProcessedParentchainBlock received"); - debug!("Expected block Hash: {:?}", block_hash); + debug!("shard: {:?}", shard); + debug!("confirmed parentchain block Hash: {:?}", block_hash); + debug!("trusted calls merkle root: {:?}", trusted_calls_merkle_root); debug!("Confirmed stf block Hash: {:?}", confirmed_block_hash); if let Err(e) = check_if_received_event_exceeds_expected( &chain_api, diff --git a/core-primitives/enclave-api/src/enclave_base.rs b/core-primitives/enclave-api/src/enclave_base.rs index d6b67480bf..86ffceaeb9 100644 --- a/core-primitives/enclave-api/src/enclave_base.rs +++ b/core-primitives/enclave-api/src/enclave_base.rs @@ -29,6 +29,7 @@ use log::*; use sgx_crypto_helper::rsa3072::Rsa3072PubKey; use sgx_types::*; use sp_core::ed25519; +use teerex_primitives::EnclaveFingerprint; /// Trait for base/common Enclave API functions pub trait EnclaveBase: Send + Sync + 'static { @@ -67,7 +68,7 @@ pub trait EnclaveBase: Send + Sync + 'static { fn get_ecc_signing_pubkey(&self) -> EnclaveResult; - fn get_mrenclave(&self) -> EnclaveResult<[u8; MR_ENCLAVE_SIZE]>; + fn get_fingerprint(&self) -> EnclaveResult; } /// EnclaveApi implementation for Enclave struct @@ -236,7 +237,7 @@ impl EnclaveBase for Enclave { Ok(ed25519::Public::from_raw(pubkey)) } - fn get_mrenclave(&self) -> EnclaveResult<[u8; MR_ENCLAVE_SIZE]> { + fn get_fingerprint(&self) -> EnclaveResult { let mut retval = sgx_status_t::SGX_SUCCESS; let mut mr_enclave = [0u8; MR_ENCLAVE_SIZE]; @@ -252,7 +253,7 @@ impl EnclaveBase for Enclave { ensure!(result == sgx_status_t::SGX_SUCCESS, Error::Sgx(result)); ensure!(retval == sgx_status_t::SGX_SUCCESS, Error::Sgx(retval)); - Ok(mr_enclave) + Ok(mr_enclave.into()) } } diff --git a/core-primitives/enclave-bridge-storage/Cargo.toml b/core-primitives/enclave-bridge-storage/Cargo.toml new file mode 100644 index 0000000000..595fb10189 --- /dev/null +++ b/core-primitives/enclave-bridge-storage/Cargo.toml @@ -0,0 +1,21 @@ +[package] +name = "itp-enclave-bridge-storage" +version = "0.9.0" +authors = ["Integritee AG "] +edition = "2021" + +[dependencies] +codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } + +#local deps +itp-storage = { path = "../storage", default-features = false } +itp-types = { path = "../types", default-features = false } + +[features] +default = ["std"] +std = [ + "sp-std/std", + "itp-storage/std", + "itp-types/std", +] diff --git a/core-primitives/enclave-bridge-storage/src/lib.rs b/core-primitives/enclave-bridge-storage/src/lib.rs new file mode 100644 index 0000000000..9077d756b6 --- /dev/null +++ b/core-primitives/enclave-bridge-storage/src/lib.rs @@ -0,0 +1,31 @@ +#![cfg_attr(not(feature = "std"), no_std)] + +use codec::Encode; +use itp_storage::{storage_map_key, StorageHasher}; +use sp_std::prelude::Vec; + +pub struct EnclaveBridgeStorage; + +// Separate the prefix from the rest because in our case we changed the storage prefix due to +// the rebranding. With the below implementation of the `TeerexStorageKeys`, we could simply +// define another struct `OtherStorage`, implement `StoragePrefix` for it, and get the +// `TeerexStorageKeys` implementation for free. +pub trait StoragePrefix { + fn prefix() -> &'static str; +} + +impl StoragePrefix for EnclaveBridgeStorage { + fn prefix() -> &'static str { + "EnclaveBridge" + } +} + +pub trait EnclaveBridgeStorageKeys { + fn shard_status(shard: T) -> Vec; +} + +impl EnclaveBridgeStorageKeys for S { + fn shard_status(shard: T) -> Vec { + storage_map_key(Self::prefix(), "ShardStatus", &shard, &StorageHasher::Blake2_128Concat) + } +} diff --git a/core-primitives/node-api/api-client-extensions/src/lib.rs b/core-primitives/node-api/api-client-extensions/src/lib.rs index 4265e33393..e123c41908 100644 --- a/core-primitives/node-api/api-client-extensions/src/lib.rs +++ b/core-primitives/node-api/api-client-extensions/src/lib.rs @@ -23,7 +23,6 @@ pub mod account; pub mod chain; pub mod pallet_teeracle; pub mod pallet_teerex; -pub mod pallet_teerex_api_mock; pub use account::*; pub use chain::*; diff --git a/core-primitives/node-api/api-client-extensions/src/pallet_teerex.rs b/core-primitives/node-api/api-client-extensions/src/pallet_teerex.rs index 5f75f16fde..5b6556c11e 100644 --- a/core-primitives/node-api/api-client-extensions/src/pallet_teerex.rs +++ b/core-primitives/node-api/api-client-extensions/src/pallet_teerex.rs @@ -16,22 +16,30 @@ */ use crate::ApiResult; -use itp_types::{parentchain::Hash, Enclave, IpfsHash, ShardIdentifier}; -use substrate_api_client::{rpc::Request, Api, ExtrinsicParams, FrameSystemConfig, GetStorage}; +use itp_types::{ + parentchain::Hash, AccountId, IpfsHash, MultiEnclave, ShardIdentifier, ShardStatus, +}; +use substrate_api_client::{ + log::error, rpc::Request, Api, ExtrinsicParams, FrameSystemConfig, GetStorage, +}; pub const TEEREX: &str = "Teerex"; -pub const SIDECHAIN: &str = "Sidechain"; +pub const ENCLAVE_BRIDGE: &str = "EnclaveBridge"; /// ApiClient extension that enables communication with the `teerex` pallet. pub trait PalletTeerexApi { - fn enclave(&self, index: u64, at_block: Option) -> ApiResult>; + fn enclave( + &self, + account: &AccountId, + at_block: Option, + ) -> ApiResult>>>; fn enclave_count(&self, at_block: Option) -> ApiResult; - fn all_enclaves(&self, at_block: Option) -> ApiResult>; - fn worker_for_shard( + fn all_enclaves(&self, at_block: Option) -> ApiResult>>>; + fn primary_worker_for_shard( &self, shard: &ShardIdentifier, at_block: Option, - ) -> ApiResult>; + ) -> ApiResult>>>; fn latest_ipfs_hash( &self, shard: &ShardIdentifier, @@ -45,30 +53,50 @@ where Runtime: FrameSystemConfig, Params: ExtrinsicParams, { - fn enclave(&self, index: u64, at_block: Option) -> ApiResult> { - self.get_storage_map(TEEREX, "EnclaveRegistry", index, at_block) + fn enclave( + &self, + account: &AccountId, + at_block: Option, + ) -> ApiResult>>> { + self.get_storage_map(TEEREX, "SovereignEnclaves", account, at_block) } fn enclave_count(&self, at_block: Option) -> ApiResult { - Ok(self.get_storage_value(TEEREX, "EnclaveCount", at_block)?.unwrap_or(0u64)) + Ok(self.all_enclaves(at_block)?.len() as u64) } - fn all_enclaves(&self, at_block: Option) -> ApiResult> { - let count = self.enclave_count(at_block)?; - let mut enclaves = Vec::with_capacity(count as usize); - for n in 1..=count { - enclaves.push(self.enclave(n, at_block)?.expect("None enclave")) + fn all_enclaves(&self, at_block: Option) -> ApiResult>>> { + let key_prefix = self.get_storage_map_key_prefix("Teerex", "SovereignEnclaves")?; + //fixme: solve this properly with infinite elements + let max_keys = 1000; + let storage_keys = + self.get_storage_keys_paged(Some(key_prefix), max_keys, None, at_block)?; + + if storage_keys.len() == max_keys as usize { + error!("results can be wrong because max keys reached for query") } + let enclaves = storage_keys + .iter() + .filter_map(|key| self.get_storage_by_key_hash(key.clone(), at_block).ok()?) + .collect(); Ok(enclaves) } - fn worker_for_shard( + fn primary_worker_for_shard( &self, shard: &ShardIdentifier, at_block: Option, - ) -> ApiResult> { - self.get_storage_map(SIDECHAIN, "WorkerForShard", shard, at_block)? - .map_or_else(|| Ok(None), |w_index| self.enclave(w_index, at_block)) + ) -> ApiResult>>> { + self.get_storage_map(ENCLAVE_BRIDGE, "ShardStatus", shard, at_block)? + .map_or_else( + || Ok(None), + |statuses: ShardStatus| { + statuses.get(0).map_or_else( + || Ok(None), + |signerstatus| self.enclave(&signerstatus.signer, at_block), + ) + }, + ) } fn latest_ipfs_hash( diff --git a/core-primitives/node-api/api-client-extensions/src/pallet_teerex_api_mock.rs b/core-primitives/node-api/api-client-extensions/src/pallet_teerex_api_mock.rs index 06da958b9d..cb63892da4 100644 --- a/core-primitives/node-api/api-client-extensions/src/pallet_teerex_api_mock.rs +++ b/core-primitives/node-api/api-client-extensions/src/pallet_teerex_api_mock.rs @@ -16,22 +16,27 @@ */ use crate::{pallet_teerex::PalletTeerexApi, ApiResult}; -use itp_types::{parentchain::Hash, Enclave, IpfsHash, ShardIdentifier}; +use itp_types::{parentchain::Hash, AccountId, IpfsHash, MultiEnclave, ShardIdentifier}; +use std::collections::HashMap; #[derive(Default)] pub struct PalletTeerexApiMock { - registered_enclaves: Vec, + registered_enclaves: HashMap>>, } impl PalletTeerexApiMock { - pub fn with_enclaves(mut self, enclaves: Vec) -> Self { - self.registered_enclaves.extend(enclaves); + pub fn with_enclaves(mut self, enclaves: Vec>>) -> Self { + enclaves.iter().map(|enclave| self.registered_enclaves.insert(enclave)); self } } impl PalletTeerexApi for PalletTeerexApiMock { - fn enclave(&self, index: u64, _at_block: Option) -> ApiResult> { + fn enclave( + &self, + account: AccountId, + _at_block: Option, + ) -> ApiResult>>> { Ok(self.registered_enclaves.get(index as usize).cloned()) } @@ -39,15 +44,15 @@ impl PalletTeerexApi for PalletTeerexApiMock { Ok(self.registered_enclaves.len() as u64) } - fn all_enclaves(&self, _at_block: Option) -> ApiResult> { + fn all_enclaves(&self, _at_block: Option) -> ApiResult>>> { Ok(self.registered_enclaves.clone()) } - fn worker_for_shard( + fn primary_worker_for_shard( &self, _shard: &ShardIdentifier, _at_block: Option, - ) -> ApiResult> { + ) -> ApiResult>>> { todo!() } diff --git a/core-primitives/node-api/metadata/src/lib.rs b/core-primitives/node-api/metadata/src/lib.rs index 43c68a2964..9bb09a21fb 100644 --- a/core-primitives/node-api/metadata/src/lib.rs +++ b/core-primitives/node-api/metadata/src/lib.rs @@ -20,7 +20,8 @@ #![cfg_attr(not(feature = "std"), no_std)] use crate::{ - error::Result, pallet_sidechain::SidechainCallIndexes, pallet_teerex::TeerexCallIndexes, + error::Result, pallet_enclave_bridge::EnclaveBridgeCallIndexes, + pallet_sidechain::SidechainCallIndexes, pallet_teerex::TeerexCallIndexes, }; use codec::{Decode, Encode}; use sp_core::storage::StorageKey; @@ -29,6 +30,7 @@ pub use crate::error::Error; pub use itp_api_client_types::{Metadata, MetadataError}; pub mod error; +pub mod pallet_enclave_bridge; pub mod pallet_sidechain; pub mod pallet_teeracle; pub mod pallet_teerex; @@ -36,8 +38,14 @@ pub mod pallet_teerex; #[cfg(feature = "mocks")] pub mod metadata_mocks; -pub trait NodeMetadataTrait: TeerexCallIndexes + SidechainCallIndexes {} -impl NodeMetadataTrait for T {} +pub trait NodeMetadataTrait: + TeerexCallIndexes + EnclaveBridgeCallIndexes + SidechainCallIndexes +{ +} +impl NodeMetadataTrait + for T +{ +} impl TryFrom for Metadata { type Error = crate::error::Error; diff --git a/core-primitives/node-api/metadata/src/metadata_mocks.rs b/core-primitives/node-api/metadata/src/metadata_mocks.rs index a3e288dad8..57cf0fe327 100644 --- a/core-primitives/node-api/metadata/src/metadata_mocks.rs +++ b/core-primitives/node-api/metadata/src/metadata_mocks.rs @@ -20,6 +20,7 @@ use crate::{ }; use codec::{Decode, Encode}; +use crate::pallet_enclave_bridge::EnclaveBridgeCallIndexes; use itp_api_client_types::Metadata; impl TryFrom for Metadata { @@ -33,16 +34,18 @@ impl TryFrom for Metadata { #[derive(Default, Encode, Decode, Debug, Clone)] pub struct NodeMetadataMock { teerex_module: u8, - register_ias_enclave: u8, - register_dcap_enclave: u8, - unregister_enclave: u8, + register_sgx_enclave: u8, + unregister_sovereign_enclave: u8, + unregister_proxied_enclave: u8, register_quoting_enclave: u8, register_tcb_info: u8, - call_worker: u8, - processed_parentchain_block: u8, + enclave_bridge_module: u8, + invoke: u8, + confirm_processed_parentchain_block: u8, shield_funds: u8, unshield_funds: u8, publish_hash: u8, + update_shard_config: u8, sidechain_module: u8, imported_sidechain_block: u8, runtime_spec_version: u32, @@ -53,16 +56,18 @@ impl NodeMetadataMock { pub fn new() -> Self { NodeMetadataMock { teerex_module: 50u8, - register_ias_enclave: 0u8, - register_dcap_enclave: 6, - unregister_enclave: 1u8, - register_quoting_enclave: 7, - register_tcb_info: 8, - call_worker: 2u8, - processed_parentchain_block: 3u8, - shield_funds: 4u8, - unshield_funds: 5u8, - publish_hash: 9u8, + register_sgx_enclave: 0u8, + unregister_sovereign_enclave: 1u8, + unregister_proxied_enclave: 2u8, + register_quoting_enclave: 3, + register_tcb_info: 4, + enclave_bridge_module: 54u8, + invoke: 0u8, + confirm_processed_parentchain_block: 1u8, + shield_funds: 2u8, + unshield_funds: 3u8, + publish_hash: 4u8, + update_shard_config: 5u8, sidechain_module: 53u8, imported_sidechain_block: 0u8, runtime_spec_version: 25, @@ -72,16 +77,16 @@ impl NodeMetadataMock { } impl TeerexCallIndexes for NodeMetadataMock { - fn register_ias_enclave_call_indexes(&self) -> Result<[u8; 2]> { - Ok([self.teerex_module, self.register_ias_enclave]) + fn register_sgx_enclave_call_indexes(&self) -> Result<[u8; 2]> { + Ok([self.teerex_module, self.register_sgx_enclave]) } - fn register_dcap_enclave_call_indexes(&self) -> Result<[u8; 2]> { - Ok([self.teerex_module, self.register_dcap_enclave]) + fn unregister_sovereign_enclave_call_indexes(&self) -> Result<[u8; 2]> { + Ok([self.teerex_module, self.unregister_sovereign_enclave]) } - fn unregister_enclave_call_indexes(&self) -> Result<[u8; 2]> { - Ok([self.teerex_module, self.unregister_enclave]) + fn unregister_proxied_enclave_call_indexes(&self) -> Result<[u8; 2]> { + Ok([self.teerex_module, self.unregister_proxied_enclave]) } fn register_quoting_enclave_call_indexes(&self) -> Result<[u8; 2]> { @@ -91,25 +96,31 @@ impl TeerexCallIndexes for NodeMetadataMock { fn register_tcb_info_call_indexes(&self) -> Result<[u8; 2]> { Ok([self.teerex_module, self.register_tcb_info]) } +} - fn call_worker_call_indexes(&self) -> Result<[u8; 2]> { - Ok([self.teerex_module, self.call_worker]) +impl EnclaveBridgeCallIndexes for NodeMetadataMock { + fn invoke_call_indexes(&self) -> Result<[u8; 2]> { + Ok([self.enclave_bridge_module, self.invoke]) } fn confirm_processed_parentchain_block_call_indexes(&self) -> Result<[u8; 2]> { - Ok([self.teerex_module, self.processed_parentchain_block]) + Ok([self.enclave_bridge_module, self.confirm_processed_parentchain_block]) } fn shield_funds_call_indexes(&self) -> Result<[u8; 2]> { - Ok([self.teerex_module, self.shield_funds]) + Ok([self.enclave_bridge_module, self.shield_funds]) } fn unshield_funds_call_indexes(&self) -> Result<[u8; 2]> { - Ok([self.teerex_module, self.unshield_funds]) + Ok([self.enclave_bridge_module, self.unshield_funds]) } fn publish_hash_call_indexes(&self) -> Result<[u8; 2]> { - Ok([self.teerex_module, self.unshield_funds]) + Ok([self.enclave_bridge_module, self.publish_hash]) + } + + fn update_shard_config_call_indexes(&self) -> Result<[u8; 2]> { + Ok([self.enclave_bridge_module, self.update_shard_config]) } } diff --git a/core-primitives/node-api/metadata/src/pallet_enclave_bridge.rs b/core-primitives/node-api/metadata/src/pallet_enclave_bridge.rs new file mode 100644 index 0000000000..4813d2ec54 --- /dev/null +++ b/core-primitives/node-api/metadata/src/pallet_enclave_bridge.rs @@ -0,0 +1,75 @@ +/* + Copyright 2021 Integritee AG and Supercomputing Systems AG + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +*/ +use crate::{error::Result, NodeMetadata}; +use sp_core::storage::StorageKey; + +/// Pallet' name: +const ENCLAVE_BRIDGE: &str = "EnclaveBridge"; + +pub trait EnclaveBridgeCallIndexes { + fn invoke_call_indexes(&self) -> Result<[u8; 2]>; + + fn confirm_processed_parentchain_block_call_indexes(&self) -> Result<[u8; 2]>; + + fn shield_funds_call_indexes(&self) -> Result<[u8; 2]>; + + fn unshield_funds_call_indexes(&self) -> Result<[u8; 2]>; + + fn publish_hash_call_indexes(&self) -> Result<[u8; 2]>; + + fn update_shard_config_call_indexes(&self) -> Result<[u8; 2]>; +} + +pub trait EnclaveBridgeStorageKey { + fn shard_status_storage_map_key(&self, index: u64) -> Result; + fn shard_config_registry_storage_map_key(&self, index: u64) -> Result; +} + +impl EnclaveBridgeCallIndexes for NodeMetadata { + fn invoke_call_indexes(&self) -> Result<[u8; 2]> { + self.call_indexes(ENCLAVE_BRIDGE, "invoke") + } + + fn confirm_processed_parentchain_block_call_indexes(&self) -> Result<[u8; 2]> { + self.call_indexes(ENCLAVE_BRIDGE, "confirm_processed_parentchain_block") + } + + fn shield_funds_call_indexes(&self) -> Result<[u8; 2]> { + self.call_indexes(ENCLAVE_BRIDGE, "shield_funds") + } + + fn unshield_funds_call_indexes(&self) -> Result<[u8; 2]> { + self.call_indexes(ENCLAVE_BRIDGE, "unshield_funds") + } + + fn publish_hash_call_indexes(&self) -> Result<[u8; 2]> { + self.call_indexes(ENCLAVE_BRIDGE, "publish_hash") + } + + fn update_shard_config_call_indexes(&self) -> Result<[u8; 2]> { + self.call_indexes(ENCLAVE_BRIDGE, "update_shard_config") + } +} + +impl EnclaveBridgeStorageKey for NodeMetadata { + fn shard_status_storage_map_key(&self, index: u64) -> Result { + self.storage_map_key(ENCLAVE_BRIDGE, "ShardStatus", index) + } + fn shard_config_registry_storage_map_key(&self, index: u64) -> Result { + self.storage_map_key(ENCLAVE_BRIDGE, "ShardConfigRegistry", index) + } +} diff --git a/core-primitives/node-api/metadata/src/pallet_teerex.rs b/core-primitives/node-api/metadata/src/pallet_teerex.rs index c50b991d0a..73f1e2a043 100644 --- a/core-primitives/node-api/metadata/src/pallet_teerex.rs +++ b/core-primitives/node-api/metadata/src/pallet_teerex.rs @@ -21,40 +21,34 @@ use sp_core::storage::StorageKey; const TEEREX: &str = "Teerex"; pub trait TeerexCallIndexes { - fn register_ias_enclave_call_indexes(&self) -> Result<[u8; 2]>; + fn register_sgx_enclave_call_indexes(&self) -> Result<[u8; 2]>; - fn register_dcap_enclave_call_indexes(&self) -> Result<[u8; 2]>; + fn unregister_sovereign_enclave_call_indexes(&self) -> Result<[u8; 2]>; - fn unregister_enclave_call_indexes(&self) -> Result<[u8; 2]>; + fn unregister_proxied_enclave_call_indexes(&self) -> Result<[u8; 2]>; fn register_quoting_enclave_call_indexes(&self) -> Result<[u8; 2]>; fn register_tcb_info_call_indexes(&self) -> Result<[u8; 2]>; - - fn call_worker_call_indexes(&self) -> Result<[u8; 2]>; - - fn confirm_processed_parentchain_block_call_indexes(&self) -> Result<[u8; 2]>; - - fn shield_funds_call_indexes(&self) -> Result<[u8; 2]>; - - fn unshield_funds_call_indexes(&self) -> Result<[u8; 2]>; - - fn publish_hash_call_indexes(&self) -> Result<[u8; 2]>; } pub trait TeerexStorageKey { - fn enclave_count_storage_key(&self) -> Result; + fn sovereign_enclaves_storage_map_key(&self, index: u64) -> Result; - fn enclave_registry_storage_map_key(&self, index: u64) -> Result; + fn proxied_enclaves_storage_map_key(&self, index: u64) -> Result; } impl TeerexCallIndexes for NodeMetadata { - fn register_ias_enclave_call_indexes(&self) -> Result<[u8; 2]> { - self.call_indexes(TEEREX, "register_ias_enclave") + fn register_sgx_enclave_call_indexes(&self) -> Result<[u8; 2]> { + self.call_indexes(TEEREX, "register_sgx_enclave") } - fn register_dcap_enclave_call_indexes(&self) -> Result<[u8; 2]> { - self.call_indexes(TEEREX, "register_dcap_enclave") + fn unregister_sovereign_enclave_call_indexes(&self) -> Result<[u8; 2]> { + self.call_indexes(TEEREX, "unregister_sovereign_enclave") + } + + fn unregister_proxied_enclave_call_indexes(&self) -> Result<[u8; 2]> { + self.call_indexes(TEEREX, "unregister_proxied_enclave") } fn register_quoting_enclave_call_indexes(&self) -> Result<[u8; 2]> { @@ -64,38 +58,13 @@ impl TeerexCallIndexes for NodeMetadata { fn register_tcb_info_call_indexes(&self) -> Result<[u8; 2]> { self.call_indexes(TEEREX, "register_tcb_info") } - - fn unregister_enclave_call_indexes(&self) -> Result<[u8; 2]> { - self.call_indexes(TEEREX, "unregister_enclave") - } - - fn call_worker_call_indexes(&self) -> Result<[u8; 2]> { - self.call_indexes(TEEREX, "call_worker") - } - - fn confirm_processed_parentchain_block_call_indexes(&self) -> Result<[u8; 2]> { - self.call_indexes(TEEREX, "confirm_processed_parentchain_block") - } - - fn shield_funds_call_indexes(&self) -> Result<[u8; 2]> { - self.call_indexes(TEEREX, "shield_funds") - } - - fn unshield_funds_call_indexes(&self) -> Result<[u8; 2]> { - self.call_indexes(TEEREX, "unshield_funds") - } - - fn publish_hash_call_indexes(&self) -> Result<[u8; 2]> { - self.call_indexes(TEEREX, "publish_hash") - } } impl TeerexStorageKey for NodeMetadata { - fn enclave_count_storage_key(&self) -> Result { - self.storage_value_key(TEEREX, "EnclaveCount") + fn sovereign_enclaves_storage_map_key(&self, index: u64) -> Result { + self.storage_map_key(TEEREX, "SovereignEnclaves", index) } - - fn enclave_registry_storage_map_key(&self, index: u64) -> Result { - self.storage_map_key(TEEREX, "EnclaveRegistry", index) + fn proxied_enclaves_storage_map_key(&self, index: u64) -> Result { + self.storage_map_key(TEEREX, "ProxiedEnclaves", index) } } diff --git a/core-primitives/teerex-storage/Cargo.toml b/core-primitives/teerex-storage/Cargo.toml index f2cc061859..15333c49b6 100644 --- a/core-primitives/teerex-storage/Cargo.toml +++ b/core-primitives/teerex-storage/Cargo.toml @@ -9,10 +9,12 @@ sp-std = { default-features = false, git = "https://github.com/paritytech/substr #local deps itp-storage = { path = "../storage", default-features = false } +itp-types = { path = "../types", default-features = false } [features] default = ["std"] std = [ "sp-std/std", "itp-storage/std", + "itp-types/std", ] diff --git a/core-primitives/teerex-storage/src/lib.rs b/core-primitives/teerex-storage/src/lib.rs index 706d92fcb1..61bfe1f37d 100644 --- a/core-primitives/teerex-storage/src/lib.rs +++ b/core-primitives/teerex-storage/src/lib.rs @@ -1,6 +1,7 @@ #![cfg_attr(not(feature = "std"), no_std)] -use itp_storage::{storage_map_key, storage_value_key, StorageHasher}; +use itp_storage::{storage_map_key, StorageHasher}; +use itp_types::AccountId; use sp_std::prelude::Vec; pub struct TeeRexStorage; @@ -20,16 +21,16 @@ impl StoragePrefix for TeeRexStorage { } pub trait TeerexStorageKeys { - fn enclave_count() -> Vec; - fn enclave(index: u64) -> Vec; + fn sovereign_enclaves(account: AccountId) -> Vec; } impl TeerexStorageKeys for S { - fn enclave_count() -> Vec { - storage_value_key(Self::prefix(), "EnclaveCount") - } - - fn enclave(index: u64) -> Vec { - storage_map_key(Self::prefix(), "EnclaveRegistry", &index, &StorageHasher::Blake2_128Concat) + fn sovereign_enclaves(account: AccountId) -> Vec { + storage_map_key( + Self::prefix(), + "SovereignEnclaves", + &account, + &StorageHasher::Blake2_128Concat, + ) } } diff --git a/core-primitives/test/Cargo.toml b/core-primitives/test/Cargo.toml index 422b6881ce..366a157577 100644 --- a/core-primitives/test/Cargo.toml +++ b/core-primitives/test/Cargo.toml @@ -20,13 +20,13 @@ sp-std = { default-features = false, git = "https://github.com/paritytech/substr # local deps ita-stf = { path = "../../app-libs/stf", default-features = false } +itp-enclave-bridge-storage = { path = "../enclave-bridge-storage", default-features = false } itp-ocall-api = { path = "../ocall-api", default-features = false } itp-sgx-crypto = { path = "../sgx/crypto", default-features = false } itp-sgx-externalities = { default-features = false, path = "../substrate-sgx/externalities" } itp-stf-interface = { path = "../stf-interface", default-features = false } itp-stf-state-handler = { path = "../stf-state-handler", default-features = false } itp-storage = { path = "../storage", default-features = false } -itp-teerex-storage = { path = "../teerex-storage", default-features = false } itp-time-utils = { path = "../time-utils", default-features = false } itp-types = { path = "../types", default-features = false, features = ["test"] } @@ -40,7 +40,7 @@ std = [ "itp-stf-interface/std", "itp-stf-state-handler/std", "itp-storage/std", - "itp-teerex-storage/std", + "itp-enclave-bridge-storage/std", "itp-time-utils/std", "itp-types/std", "itp-ocall-api/std", diff --git a/core-primitives/test/src/builders/enclave_gen_builder.rs b/core-primitives/test/src/builders/enclave_gen_builder.rs index 1268e5d1b4..85e807c628 100644 --- a/core-primitives/test/src/builders/enclave_gen_builder.rs +++ b/core-primitives/test/src/builders/enclave_gen_builder.rs @@ -17,7 +17,7 @@ */ use itp_time_utils::now_as_millis; -use itp_types::{EnclaveGen, PalletString}; +use itp_types::{Enclave, PalletString}; /// Builder for a generic enclave (`EnclaveGen`) struct. pub struct EnclaveGenBuilder { diff --git a/core-primitives/test/src/lib.rs b/core-primitives/test/src/lib.rs index 7ce2315298..a835b0d3a2 100644 --- a/core-primitives/test/src/lib.rs +++ b/core-primitives/test/src/lib.rs @@ -32,5 +32,4 @@ pub mod sgx_reexport_prelude { pub use jsonrpc_core_sgx as jsonrpc_core; } -pub mod builders; pub mod mock; diff --git a/core-primitives/test/src/mock/onchain_mock.rs b/core-primitives/test/src/mock/onchain_mock.rs index fec1865806..8a96dde164 100644 --- a/core-primitives/test/src/mock/onchain_mock.rs +++ b/core-primitives/test/src/mock/onchain_mock.rs @@ -18,15 +18,15 @@ use codec::{Decode, Encode}; use core::fmt::Debug; +use itp_enclave_bridge_storage::{EnclaveBridgeStorage, EnclaveBridgeStorageKeys}; use itp_ocall_api::{ EnclaveAttestationOCallApi, EnclaveMetricsOCallApi, EnclaveOnChainOCallApi, EnclaveSidechainOCallApi, }; use itp_storage::Error::StorageValueUnavailable; -use itp_teerex_storage::{TeeRexStorage, TeerexStorageKeys}; use itp_types::{ - storage::StorageEntryVerified, BlockHash, Enclave, ShardIdentifier, WorkerRequest, - WorkerResponse, + storage::StorageEntryVerified, AccountId, BlockHash, EnclaveFingerprint, ShardIdentifier, + ShardSignerStatus, WorkerRequest, WorkerResponse, }; use sgx_types::*; use sp_core::H256; @@ -55,11 +55,20 @@ impl OnchainMock { pub fn add_validateer_set>( mut self, header: &Header, - set: Option>, + shard: ShardIdentifier, + set: Option>, ) -> Self { - let set = set.unwrap_or_else(validateer_set); - self.insert_at_header(header, TeeRexStorage::enclave_count(), (set.len() as u64).encode()); - self.with_storage_entries_at_header(header, into_key_value_storage(set)) + let set: Vec = set + .unwrap_or_else(validateer_set) + .iter() + .map(|account| ShardSignerStatus { + signer: account.clone(), + fingerprint: EnclaveFingerprint::default(), + last_activity: 0, + }) + .collect(); + self.insert_at_header(header, EnclaveBridgeStorage::shard_status(shard), set.encode()); + self } pub fn with_mr_enclave(mut self, mr_enclave: [u8; SGX_HASH_SIZE]) -> Self { @@ -208,20 +217,11 @@ impl EnclaveOnChainOCallApi for OnchainMock { } } -pub fn validateer_set() -> Vec { - let default_enclave = Enclave::new( +pub fn validateer_set() -> Vec { + vec![ AccountId32::from([0; 32]), - Default::default(), - Default::default(), - Default::default(), - ); - vec![default_enclave.clone(), default_enclave.clone(), default_enclave.clone(), default_enclave] -} - -fn into_key_value_storage(validateers: Vec) -> Vec<(Vec, Enclave)> { - validateers - .into_iter() - .enumerate() - .map(|(i, e)| (TeeRexStorage::enclave(i as u64 + 1), e)) - .collect() + AccountId32::from([1; 32]), + AccountId32::from([2; 32]), + AccountId32::from([3; 32]), + ] } diff --git a/core-primitives/top-pool-author/src/author.rs b/core-primitives/top-pool-author/src/author.rs index 0a5a12f004..6aec0c4c3e 100644 --- a/core-primitives/top-pool-author/src/author.rs +++ b/core-primitives/top-pool-author/src/author.rs @@ -319,6 +319,10 @@ where self.top_pool.shards() } + fn list_handled_shards(&self) -> Vec { + self.state_facade.list_shards().unwrap_or_default() + } + fn remove_calls_from_pool( &self, shard: ShardIdentifier, diff --git a/core-primitives/top-pool-author/src/mocks.rs b/core-primitives/top-pool-author/src/mocks.rs index 154502245b..693c27f8a4 100644 --- a/core-primitives/top-pool-author/src/mocks.rs +++ b/core-primitives/top-pool-author/src/mocks.rs @@ -168,6 +168,11 @@ impl AuthorApi for AuthorApiMock { self.tops.read().unwrap().keys().cloned().collect() } + fn list_handled_shards(&self) -> Vec { + //dummy + self.tops.read().unwrap().keys().cloned().collect() + } + fn remove_calls_from_pool( &self, shard: ShardIdentifier, diff --git a/core-primitives/top-pool-author/src/traits.rs b/core-primitives/top-pool-author/src/traits.rs index 692431c910..b2e490423f 100644 --- a/core-primitives/top-pool-author/src/traits.rs +++ b/core-primitives/top-pool-author/src/traits.rs @@ -53,8 +53,12 @@ pub trait AuthorApi { account: &AccountId, ) -> Vec; + /// returns all shards which are currently present in the tops in the pool fn get_shards(&self) -> Vec; + /// returns all shards which are handled by our worker + fn list_handled_shards(&self) -> Vec; + /// Remove a collection of trusted operations from the pool. /// Return operations that were not successfully removed. fn remove_calls_from_pool( diff --git a/core-primitives/types/Cargo.toml b/core-primitives/types/Cargo.toml index 701fe14c93..49747cdc99 100644 --- a/core-primitives/types/Cargo.toml +++ b/core-primitives/types/Cargo.toml @@ -3,7 +3,7 @@ name = "itp-types" version = "0.9.0" authors = ["Integritee AG "] homepage = "https://integritee.network/" -repository = "https://github.com/integritee-network/pallets/" +repository = "https://github.com/integritee-network/worker/" license = "Apache-2.0" edition = "2021" @@ -25,7 +25,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 = { git = "https://github.com/integritee-network/pallets.git", default-features = false, branch = "polkadot-v0.9.42" } my-node-runtime = { package = "integritee-node-runtime", optional = true, git = "https://github.com/integritee-network/integritee-node.git", branch = "polkadot-v0.9.42" } +teerex-primitives = { git = "https://github.com/integritee-network/pallets.git", default-features = false, branch = "polkadot-v0.9.42" } + [features] default = ["std"] @@ -37,6 +40,8 @@ std = [ "serde_json/std", "primitive-types/std", "itp-sgx-runtime-primitives/std", + "teerex-primitives/std", + "enclave-bridge-primitives/std", # substrate "frame-system/std", "pallet-balances/std", diff --git a/core-primitives/types/src/lib.rs b/core-primitives/types/src/lib.rs index fa1d22f5a7..879d958e84 100644 --- a/core-primitives/types/src/lib.rs +++ b/core-primitives/types/src/lib.rs @@ -44,10 +44,17 @@ pub type IpfsHash = [u8; 46]; pub type MrEnclave = [u8; 32]; pub type ConfirmCallFn = ([u8; 2], ShardIdentifier, H256, Vec); -pub type ShieldFundsFn = ([u8; 2], Vec, Balance, ShardIdentifier); +pub type ShieldFundsFn = ([u8; 2], ShardIdentifier, Vec, Balance); pub type CallWorkerFn = ([u8; 2], Request); -pub type Enclave = EnclaveGen; +use enclave_bridge_primitives::ShardSignerStatus as ShardSignerStatusGen; +pub type ShardSignerStatus = ShardSignerStatusGen; +pub type ShardStatus = Vec; +pub use enclave_bridge_primitives::Request; +pub use teerex_primitives::{ + EnclaveFingerprint, MultiEnclave, SgxBuildMode, SgxEnclave, SgxReportData, SgxStatus, +}; +pub type Enclave = MultiEnclave>; /// Simple blob to hold an encoded call #[derive(Debug, PartialEq, Eq, Clone, Default)] @@ -66,30 +73,6 @@ impl Encode for OpaqueCall { } } -// Note in the pallet teerex this is a struct. But for the codec this does not matter. -#[derive(Encode, Decode, Default, Clone, PartialEq, Eq, Debug)] -pub struct Request { - pub shard: ShardIdentifier, - pub cyphertext: Vec, -} - -// Todo: move this improved enclave definition into a primitives crate in the pallet_teerex repo. -#[derive(Encode, Decode, Clone, PartialEq, sp_core::RuntimeDebug)] -pub struct EnclaveGen { - pub pubkey: AccountId, - // FIXME: this is redundant information - pub mr_enclave: [u8; 32], - pub timestamp: u64, - // unix epoch in milliseconds - pub url: PalletString, // utf8 encoded url -} - -impl EnclaveGen { - pub fn new(pubkey: AccountId, mr_enclave: [u8; 32], timestamp: u64, url: PalletString) -> Self { - Self { pubkey, mr_enclave, timestamp, url } - } -} - #[derive(Debug, Clone, PartialEq, Encode, Decode)] pub enum DirectRequestStatus { /// Direct request was successfully executed diff --git a/core-primitives/utils/Cargo.toml b/core-primitives/utils/Cargo.toml index f2736695af..bc634cfadb 100644 --- a/core-primitives/utils/Cargo.toml +++ b/core-primitives/utils/Cargo.toml @@ -3,7 +3,7 @@ name = "itp-utils" version = "0.9.0" authors = ["Integritee AG "] homepage = "https://integritee.network/" -repository = "https://github.com/integritee-network/pallets/" +repository = "https://github.com/integritee-network/worker/" license = "Apache-2.0" edition = "2021" diff --git a/core/parentchain/indirect-calls-executor/src/executor.rs b/core/parentchain/indirect-calls-executor/src/executor.rs index d426468f00..2730b525fd 100644 --- a/core/parentchain/indirect-calls-executor/src/executor.rs +++ b/core/parentchain/indirect-calls-executor/src/executor.rs @@ -30,7 +30,8 @@ use codec::Encode; use core::marker::PhantomData; use ita_stf::{TrustedCall, TrustedCallSigned}; use itp_node_api::metadata::{ - pallet_teerex::TeerexCallIndexes, provider::AccessNodeMetadata, NodeMetadataTrait, + pallet_enclave_bridge::EnclaveBridgeCallIndexes, provider::AccessNodeMetadata, + NodeMetadataTrait, }; use itp_sgx_crypto::{key_repository::AccessKey, ShieldingCryptoDecrypt, ShieldingCryptoEncrypt}; use itp_stf_executor::traits::StfEnclaveSigning; @@ -127,7 +128,7 @@ impl< let block_number = *block.header().number(); let block_hash = block.hash(); - debug!("Scanning block {:?} for relevant xt", block_number); + trace!("Scanning block {:?} for relevant xt", block_number); let mut executed_calls = Vec::::new(); let events = self @@ -138,7 +139,7 @@ impl< .ok_or_else(|| Error::Other("Could not create events from metadata".into()))?; let xt_statuses = events.get_extrinsic_statuses()?; - debug!("xt_statuses:: {:?}", xt_statuses); + trace!("xt_statuses:: {:?}", xt_statuses); // This would be catastrophic but should never happen if xt_statuses.len() != block.extrinsics().len() { @@ -168,7 +169,7 @@ impl< executed_calls.push(hash_of(&call)); } } - + debug!("successfully processed {} indirect invocations", executed_calls.len()); // Include a processed parentchain block confirmation for each block. self.create_processed_parentchain_block_call::( block_hash, @@ -189,9 +190,14 @@ impl< let call = self.node_meta_data_provider.get_from_metadata(|meta_data| { meta_data.confirm_processed_parentchain_block_call_indexes() })??; - let root: H256 = merkle_root::(extrinsics); - Ok(OpaqueCall::from_tuple(&(call, block_hash, block_number, root))) + + let fallback = ShardIdentifier::default(); + let handled_shards = self.top_pool_author.list_handled_shards(); + trace!("got handled shards: {:?}", handled_shards); + let shard = handled_shards.get(0).unwrap_or(&fallback); + trace!("prepared confirm_processed_parentchain_block() call for block {:?} with index {:?} and merkle root {}", block_number, call, root); + Ok(OpaqueCall::from_tuple(&(call, shard, block_hash, block_number, root))) } } @@ -256,7 +262,7 @@ pub(crate) fn hash_of(xt: &T) -> H256 { mod test { use super::*; use crate::{ - filter_metadata::{ShieldFundsAndCallWorkerFilter, TestEventCreator}, + filter_metadata::{ShieldFundsAndInvokeFilter, TestEventCreator}, parentchain_parser::ParentchainExtrinsicParser, }; use codec::{Decode, Encode}; @@ -290,7 +296,7 @@ mod test { TestStfEnclaveSigner, TestTopPoolAuthor, TestNodeMetadataRepository, - ShieldFundsAndCallWorkerFilter, + ShieldFundsAndInvokeFilter, TestEventCreator, >; @@ -305,8 +311,7 @@ mod test { test_fixtures([0u8; 32], NodeMetadataMock::new()); let opaque_extrinsic = - OpaqueExtrinsic::from_bytes(call_worker_unchecked_extrinsic().encode().as_slice()) - .unwrap(); + OpaqueExtrinsic::from_bytes(invoke_unchecked_extrinsic().encode().as_slice()).unwrap(); let parentchain_block = ParentchainBlockBuilder::default() .with_extrinsics(vec![opaque_extrinsic]) @@ -362,8 +367,14 @@ mod test { let extrinsics = Vec::new(); let confirm_processed_parentchain_block_indexes = dummy_metadata.confirm_processed_parentchain_block_call_indexes().unwrap(); - let expected_call = - (confirm_processed_parentchain_block_indexes, block_hash, 1, H256::default()).encode(); + let expected_call = ( + confirm_processed_parentchain_block_indexes, + ShardIdentifier::default(), + block_hash, + 1, + H256::default(), + ) + .encode(); // when let call = indirect_calls_executor @@ -405,17 +416,17 @@ mod test { let shield_funds_indexes = dummy_metadata.shield_funds_call_indexes().unwrap(); ParentchainUncheckedExtrinsic::::new_signed( - (shield_funds_indexes, target_account, 1000u128, shard_id()), + (shield_funds_indexes, shard_id(), target_account, 1000u128), Address::Address32([1u8; 32]), MultiSignature::Ed25519(default_signature()), default_extrinsic_params().signed_extra(), ) } - fn call_worker_unchecked_extrinsic() -> ParentchainUncheckedExtrinsic { + fn invoke_unchecked_extrinsic() -> ParentchainUncheckedExtrinsic { let request = Request { shard: shard_id(), cyphertext: vec![1u8, 2u8] }; let dummy_metadata = NodeMetadataMock::new(); - let call_worker_indexes = dummy_metadata.call_worker_call_indexes().unwrap(); + let call_worker_indexes = dummy_metadata.invoke_call_indexes().unwrap(); ParentchainUncheckedExtrinsic::::new_signed( (call_worker_indexes, request), diff --git a/core/parentchain/indirect-calls-executor/src/filter_metadata.rs b/core/parentchain/indirect-calls-executor/src/filter_metadata.rs index 23d87bde8f..0a919f5390 100644 --- a/core/parentchain/indirect-calls-executor/src/filter_metadata.rs +++ b/core/parentchain/indirect-calls-executor/src/filter_metadata.rs @@ -18,7 +18,7 @@ use crate::{ error::Result, event_filter::{FilterEvents, MockEvents}, - indirect_calls::{CallWorkerArgs, ShiedFundsArgs}, + indirect_calls::{InvokeArgs, ShieldFundsArgs}, parentchain_parser::ParseExtrinsic, IndirectDispatch, IndirectExecutor, }; @@ -96,12 +96,12 @@ impl FilterIntoDataFrom for DenyAll { } /// Default filter we use for the Integritee-Parachain. -pub struct ShieldFundsAndCallWorkerFilter { +pub struct ShieldFundsAndInvokeFilter { _phantom: PhantomData, } impl FilterIntoDataFrom - for ShieldFundsAndCallWorkerFilter + for ShieldFundsAndInvokeFilter where ExtrinsicParser: ParseExtrinsic, { @@ -123,16 +123,17 @@ where return None }, }; - let index = xt.call_index; let call_args = &mut &xt.call_args[..]; - + log::trace!("attempting to execute indirect call with index {:?}", index); if index == metadata.shield_funds_call_indexes().ok()? { - let args = decode_and_log_error::(call_args)?; + log::trace!("executing shield funds call"); + let args = decode_and_log_error::(call_args)?; Some(IndirectCall::ShieldFunds(args)) - } else if index == metadata.call_worker_call_indexes().ok()? { - let args = decode_and_log_error::(call_args)?; - Some(IndirectCall::CallWorker(args)) + } else if index == metadata.invoke_call_indexes().ok()? { + log::trace!("executing invoke call"); + let args = decode_and_log_error::(call_args)?; + Some(IndirectCall::Invoke(args)) } else { None } @@ -145,15 +146,15 @@ where /// can implemeent their own indirect call there. #[derive(Debug, Clone, Encode, Decode, Eq, PartialEq)] pub enum IndirectCall { - ShieldFunds(ShiedFundsArgs), - CallWorker(CallWorkerArgs), + ShieldFunds(ShieldFundsArgs), + Invoke(InvokeArgs), } impl IndirectDispatch for IndirectCall { fn dispatch(&self, executor: &Executor) -> Result<()> { match self { - IndirectCall::ShieldFunds(shieldfunds) => shieldfunds.dispatch(executor), - IndirectCall::CallWorker(call_worker) => call_worker.dispatch(executor), + IndirectCall::ShieldFunds(shieldfunds_args) => shieldfunds_args.dispatch(executor), + IndirectCall::Invoke(invoke_args) => invoke_args.dispatch(executor), } } } diff --git a/core/parentchain/indirect-calls-executor/src/indirect_calls/call_worker.rs b/core/parentchain/indirect-calls-executor/src/indirect_calls/invoke.rs similarity index 96% rename from core/parentchain/indirect-calls-executor/src/indirect_calls/call_worker.rs rename to core/parentchain/indirect-calls-executor/src/indirect_calls/invoke.rs index 383f8eed4a..076e06e87c 100644 --- a/core/parentchain/indirect-calls-executor/src/indirect_calls/call_worker.rs +++ b/core/parentchain/indirect-calls-executor/src/indirect_calls/invoke.rs @@ -20,11 +20,11 @@ use codec::{Decode, Encode}; use itp_types::Request; #[derive(Debug, Clone, Encode, Decode, Eq, PartialEq)] -pub struct CallWorkerArgs { +pub struct InvokeArgs { request: Request, } -impl IndirectDispatch for CallWorkerArgs { +impl IndirectDispatch for InvokeArgs { fn dispatch(&self, executor: &Executor) -> Result<()> { log::debug!("Found trusted call extrinsic, submitting it to the top pool"); executor.submit_trusted_call(self.request.shard, self.request.cyphertext.clone()); diff --git a/core/parentchain/indirect-calls-executor/src/indirect_calls/mod.rs b/core/parentchain/indirect-calls-executor/src/indirect_calls/mod.rs index 503ed9bbbb..c25aa51717 100644 --- a/core/parentchain/indirect-calls-executor/src/indirect_calls/mod.rs +++ b/core/parentchain/indirect-calls-executor/src/indirect_calls/mod.rs @@ -15,8 +15,8 @@ */ -mod call_worker; +mod invoke; mod shield_funds; -pub use call_worker::CallWorkerArgs; -pub use shield_funds::ShiedFundsArgs; +pub use invoke::InvokeArgs; +pub use shield_funds::ShieldFundsArgs; diff --git a/core/parentchain/indirect-calls-executor/src/indirect_calls/shield_funds.rs b/core/parentchain/indirect-calls-executor/src/indirect_calls/shield_funds.rs index ddf510b696..ed76922705 100644 --- a/core/parentchain/indirect-calls-executor/src/indirect_calls/shield_funds.rs +++ b/core/parentchain/indirect-calls-executor/src/indirect_calls/shield_funds.rs @@ -25,13 +25,13 @@ use std::vec::Vec; /// Arguments of the Integritee-Parachain's shield fund dispatchable. #[derive(Debug, Clone, Encode, Decode, Eq, PartialEq)] -pub struct ShiedFundsArgs { +pub struct ShieldFundsArgs { + shard: ShardIdentifier, account_encrypted: Vec, amount: Balance, - shard: ShardIdentifier, } -impl IndirectDispatch for ShiedFundsArgs { +impl IndirectDispatch for ShieldFundsArgs { fn dispatch(&self, executor: &Executor) -> Result<()> { info!("Found ShieldFunds extrinsic in block: \nAccount Encrypted {:?} \nAmount: {} \nShard: {}", self.account_encrypted, self.amount, bs58::encode(self.shard.encode()).into_string()); diff --git a/core/parentchain/test/Cargo.toml b/core/parentchain/test/Cargo.toml index 54d9b690a0..a54025ea30 100644 --- a/core/parentchain/test/Cargo.toml +++ b/core/parentchain/test/Cargo.toml @@ -3,7 +3,7 @@ name = "itc-parentchain-test" version = "0.9.0" authors = ["Integritee AG "] homepage = "https://integritee.network/" -repository = "https://github.com/integritee-network/pallets/" +repository = "https://github.com/integritee-network/worker/" license = "Apache-2.0" edition = "2021" diff --git a/enclave-runtime/Cargo.lock b/enclave-runtime/Cargo.lock index 0c949dcd05..d4ac83e3c6 100644 --- a/enclave-runtime/Cargo.lock +++ b/enclave-runtime/Cargo.lock @@ -484,6 +484,32 @@ dependencies = [ "generic-array 0.14.7", ] +[[package]] +name = "common-primitives" +version = "0.1.0" +source = "git+https://github.com/integritee-network/pallets.git?branch=polkadot-v0.9.42#5c52182eb3a5156e8d9f69c10ca1441214ee6662" +dependencies = [ + "derive_more", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "common-primitives" +version = "0.1.0" +source = "git+https://github.com/integritee-network/pallets#5c52182eb3a5156e8d9f69c10ca1441214ee6662" +dependencies = [ + "derive_more", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-runtime", + "sp-std", +] + [[package]] name = "const-oid" version = "0.9.2" @@ -692,6 +718,22 @@ dependencies = [ "zeroize", ] +[[package]] +name = "enclave-bridge-primitives" +version = "0.1.0" +source = "git+https://github.com/integritee-network/pallets.git?branch=polkadot-v0.9.42#5c52182eb3a5156e8d9f69c10ca1441214ee6662" +dependencies = [ + "common-primitives 0.1.0 (git+https://github.com/integritee-network/pallets.git?branch=polkadot-v0.9.42)", + "log", + "parity-scale-codec", + "scale-info", + "serde 1.0.164", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + [[package]] name = "enclave-runtime" version = "0.9.0" @@ -770,6 +812,7 @@ dependencies = [ "sp-core", "sp-runtime", "sp-std", + "teerex-primitives 0.1.0 (git+https://github.com/integritee-network/pallets)", "webpki", ] @@ -1037,7 +1080,7 @@ dependencies = [ [[package]] name = "frame-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "bitflags", "environmental 1.1.4", @@ -1067,7 +1110,7 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "Inflector", "cfg-expr", @@ -1083,7 +1126,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate", @@ -1095,7 +1138,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "proc-macro2", "quote 1.0.28", @@ -1105,7 +1148,7 @@ dependencies = [ [[package]] name = "frame-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-support", "log", @@ -1911,6 +1954,16 @@ dependencies = [ "thiserror 1.0.9", ] +[[package]] +name = "itp-enclave-bridge-storage" +version = "0.9.0" +dependencies = [ + "itp-storage", + "itp-types", + "parity-scale-codec", + "sp-std", +] + [[package]] name = "itp-enclave-metrics" version = "0.9.0" @@ -2196,6 +2249,7 @@ name = "itp-teerex-storage" version = "0.9.0" dependencies = [ "itp-storage", + "itp-types", "sp-std", ] @@ -2205,13 +2259,13 @@ version = "0.9.0" dependencies = [ "derive_more", "ita-stf", + "itp-enclave-bridge-storage", "itp-ocall-api", "itp-sgx-crypto", "itp-sgx-externalities", "itp-stf-interface", "itp-stf-state-handler", "itp-storage", - "itp-teerex-storage", "itp-time-utils", "itp-types", "jsonrpc-core", @@ -2285,6 +2339,7 @@ name = "itp-types" version = "0.9.0" dependencies = [ "chrono 0.4.26", + "enclave-bridge-primitives", "frame-system", "itp-sgx-runtime-primitives", "pallet-balances", @@ -2295,6 +2350,7 @@ dependencies = [ "sp-core", "sp-runtime", "sp-std", + "teerex-primitives 0.1.0 (git+https://github.com/integritee-network/pallets.git?branch=polkadot-v0.9.42)", ] [[package]] @@ -2432,6 +2488,7 @@ dependencies = [ name = "its-primitives" version = "0.1.0" dependencies = [ + "itp-types", "parity-scale-codec", "scale-info", "serde 1.0.164", @@ -2498,10 +2555,13 @@ version = "0.9.0" dependencies = [ "derive_more", "frame-support", + "itp-enclave-bridge-storage", "itp-ocall-api", "itp-storage", "itp-teerex-storage", "itp-types", + "its-primitives", + "log", "parity-scale-codec", "sp-core", "sp-runtime", @@ -2952,7 +3012,7 @@ dependencies = [ [[package]] name = "pallet-parentchain" version = "0.9.0" -source = "git+https://github.com/integritee-network/pallets.git?branch=polkadot-v0.9.42#be26e6b85f14896860ef919488e6bb4cf4b7aa29" +source = "git+https://github.com/integritee-network/pallets.git?branch=polkadot-v0.9.42#5c52182eb3a5156e8d9f69c10ca1441214ee6662" dependencies = [ "frame-support", "frame-system", @@ -3988,7 +4048,7 @@ checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" [[package]] name = "sp-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "log", "parity-scale-codec", @@ -4004,7 +4064,7 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "Inflector", "blake2", @@ -4018,7 +4078,7 @@ dependencies = [ [[package]] name = "sp-application-crypto" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "parity-scale-codec", "scale-info", @@ -4030,7 +4090,7 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "integer-sqrt", "num-traits 0.2.15", @@ -4098,7 +4158,7 @@ dependencies = [ [[package]] name = "sp-core" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "array-bytes 4.2.0", "bitflags", @@ -4129,7 +4189,7 @@ dependencies = [ [[package]] name = "sp-core-hashing" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "blake2b_simd 1.0.1", "byteorder 1.4.3", @@ -4143,7 +4203,7 @@ dependencies = [ [[package]] name = "sp-core-hashing-proc-macro" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "proc-macro2", "quote 1.0.28", @@ -4154,7 +4214,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "proc-macro2", "quote 1.0.28", @@ -4164,7 +4224,7 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.13.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "environmental 1.1.4", "parity-scale-codec", @@ -4175,7 +4235,7 @@ dependencies = [ [[package]] name = "sp-inherents" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -4208,7 +4268,7 @@ dependencies = [ [[package]] name = "sp-metadata-ir" version = "0.1.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-metadata 15.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-scale-codec", @@ -4229,7 +4289,7 @@ dependencies = [ [[package]] name = "sp-runtime" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "either", "hash256-std-hasher", @@ -4249,7 +4309,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "bytes 1.4.0", "impl-trait-for-tuples", @@ -4267,7 +4327,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "Inflector", "proc-macro-crate", @@ -4292,7 +4352,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "parity-scale-codec", "scale-info", @@ -4304,12 +4364,12 @@ dependencies = [ [[package]] name = "sp-std" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" [[package]] name = "sp-storage" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "parity-scale-codec", "ref-cast", @@ -4331,7 +4391,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "parity-scale-codec", "sp-std", @@ -4366,7 +4426,7 @@ dependencies = [ [[package]] name = "sp-version" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "parity-scale-codec", "scale-info", @@ -4379,7 +4439,7 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "parity-scale-codec", "proc-macro2", @@ -4390,7 +4450,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -4400,7 +4460,7 @@ dependencies = [ [[package]] name = "sp-weights" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "parity-scale-codec", "scale-info", @@ -4469,9 +4529,9 @@ dependencies = [ [[package]] name = "subtle" -version = "2.5.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" +checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" [[package]] name = "syn" @@ -4521,6 +4581,38 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" +[[package]] +name = "teerex-primitives" +version = "0.1.0" +source = "git+https://github.com/integritee-network/pallets.git?branch=polkadot-v0.9.42#5c52182eb3a5156e8d9f69c10ca1441214ee6662" +dependencies = [ + "common-primitives 0.1.0 (git+https://github.com/integritee-network/pallets.git?branch=polkadot-v0.9.42)", + "derive_more", + "log", + "parity-scale-codec", + "scale-info", + "serde 1.0.164", + "sp-core", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "teerex-primitives" +version = "0.1.0" +source = "git+https://github.com/integritee-network/pallets#5c52182eb3a5156e8d9f69c10ca1441214ee6662" +dependencies = [ + "common-primitives 0.1.0 (git+https://github.com/integritee-network/pallets)", + "derive_more", + "log", + "parity-scale-codec", + "scale-info", + "serde 1.0.164", + "sp-core", + "sp-runtime", + "sp-std", +] + [[package]] name = "termcolor" version = "1.0.5" @@ -4685,7 +4777,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", "static_assertions", ] diff --git a/enclave-runtime/Cargo.toml b/enclave-runtime/Cargo.toml index f0d9013793..0447caad54 100644 --- a/enclave-runtime/Cargo.toml +++ b/enclave-runtime/Cargo.toml @@ -89,6 +89,7 @@ base58 = { rev = "sgx_1.1.3", package = "rust-base58", default-features = false, cid = { default-features = false, git = "https://github.com/whalelephant/rust-cid", branch = "nstd" } multibase = { default-features = false, git = "https://github.com/whalelephant/rust-multibase", branch = "nstd" } +teerex-primitives = { git = "https://github.com/integritee-network/pallets", branch = "polkadot-v0.9.42", default-features = false } # local deps ita-oracle = { path = "../app-libs/oracle", default-features = false, optional = true, features = ["sgx"] } diff --git a/enclave-runtime/src/attestation.rs b/enclave-runtime/src/attestation.rs index 4de6316329..7a63b7e0a8 100644 --- a/enclave-runtime/src/attestation.rs +++ b/enclave-runtime/src/attestation.rs @@ -52,6 +52,7 @@ use log::*; use sgx_types::*; use sp_runtime::OpaqueExtrinsic; use std::{prelude::v1::*, slice, vec::Vec}; +use teerex_primitives::SgxAttestationMethod; #[no_mangle] pub unsafe extern "C" fn get_mrenclave(mrenclave: *mut u8, mrenclave_size: usize) -> sgx_status_t { @@ -198,7 +199,11 @@ pub fn generate_dcap_ra_extrinsic_internal( skip_ra, )?; - generate_dcap_ra_extrinsic_from_quote_internal(url, &dcap_quote) + if !skip_ra { + generate_dcap_ra_extrinsic_from_quote_internal(url, &dcap_quote) + } else { + generate_dcap_skip_ra_extrinsic_from_quote_internal(url, &dcap_quote) + } } #[no_mangle] @@ -285,15 +290,42 @@ pub fn generate_dcap_ra_extrinsic_from_quote_internal( info!(" [Enclave] Compose register enclave getting callIDs:"); let call_ids = node_metadata_repo - .get_from_metadata(|m| m.register_dcap_enclave_call_indexes())? + .get_from_metadata(|m| m.register_sgx_enclave_call_indexes())? .map_err(MetadataProviderError::MetadataError)?; info!(" [Enclave] Compose register enclave call DCAP IDs: {:?}", call_ids); - let call = OpaqueCall::from_tuple(&(call_ids, quote, url)); + let call = OpaqueCall::from_tuple(&( + call_ids, + quote, + Some(url), + SgxAttestationMethod::Dcap { proxied: false }, + )); info!(" [Enclave] Compose register enclave got extrinsic, returning"); create_extrinsics(call) } +pub fn generate_dcap_skip_ra_extrinsic_from_quote_internal( + url: String, + quote: &[u8], +) -> EnclaveResult { + let node_metadata_repo = get_node_metadata_repository_from_solo_or_parachain()?; + info!(" [Enclave] Compose register enclave (skip-ra) getting callIDs:"); + + let call_ids = node_metadata_repo + .get_from_metadata(|m| m.register_sgx_enclave_call_indexes())? + .map_err(MetadataProviderError::MetadataError)?; + info!(" [Enclave] Compose register enclave (skip-ra) call DCAP IDs: {:?}", call_ids); + let call = OpaqueCall::from_tuple(&( + call_ids, + quote, + Some(url), + SgxAttestationMethod::Skip { proxied: false }, + )); + + info!(" [Enclave] Compose register enclave (skip-ra) got extrinsic, returning"); + create_extrinsics(call) +} + fn generate_ias_ra_extrinsic_internal( url: String, skip_ra: bool, @@ -301,7 +333,11 @@ fn generate_ias_ra_extrinsic_internal( let attestation_handler = GLOBAL_ATTESTATION_HANDLER_COMPONENT.get()?; let cert_der = attestation_handler.generate_ias_ra_cert(skip_ra)?; - generate_ias_ra_extrinsic_from_der_cert_internal(url, &cert_der) + if !skip_ra { + generate_ias_ra_extrinsic_from_der_cert_internal(url, &cert_der) + } else { + generate_ias_skip_ra_extrinsic_from_der_cert_internal(url, &cert_der) + } } pub fn generate_ias_ra_extrinsic_from_der_cert_internal( @@ -312,10 +348,31 @@ pub fn generate_ias_ra_extrinsic_from_der_cert_internal( info!(" [Enclave] Compose register enclave call"); let call_ids = node_metadata_repo - .get_from_metadata(|m| m.register_ias_enclave_call_indexes())? + .get_from_metadata(|m| m.register_sgx_enclave_call_indexes())? + .map_err(MetadataProviderError::MetadataError)?; + + let call = OpaqueCall::from_tuple(&(call_ids, cert_der, Some(url), SgxAttestationMethod::Ias)); + + create_extrinsics(call) +} + +pub fn generate_ias_skip_ra_extrinsic_from_der_cert_internal( + url: String, + cert_der: &[u8], +) -> EnclaveResult { + let node_metadata_repo = get_node_metadata_repository_from_solo_or_parachain()?; + + info!(" [Enclave] Compose register ias enclave (skip-ra) call"); + let call_ids = node_metadata_repo + .get_from_metadata(|m| m.register_sgx_enclave_call_indexes())? .map_err(MetadataProviderError::MetadataError)?; - let call = OpaqueCall::from_tuple(&(call_ids, cert_der, url)); + let call = OpaqueCall::from_tuple(&( + call_ids, + cert_der, + Some(url), + SgxAttestationMethod::Skip { proxied: false }, + )); create_extrinsics(call) } diff --git a/enclave-runtime/src/initialization/global_components.rs b/enclave-runtime/src/initialization/global_components.rs index 67934d926b..d3fd7789fa 100644 --- a/enclave-runtime/src/initialization/global_components.rs +++ b/enclave-runtime/src/initialization/global_components.rs @@ -41,7 +41,7 @@ use itc_parentchain::{ }, block_importer::ParentchainBlockImporter, indirect_calls_executor::{ - filter_metadata::{EventCreator, ShieldFundsAndCallWorkerFilter}, + filter_metadata::{EventCreator, ShieldFundsAndInvokeFilter}, parentchain_parser::ParentchainExtrinsicParser, IndirectCallsExecutor, }, @@ -140,7 +140,7 @@ pub type EnclaveIndirectCallsExecutor = IndirectCallsExecutor< EnclaveStfEnclaveSigner, EnclaveTopPoolAuthor, EnclaveNodeMetadataRepository, - ShieldFundsAndCallWorkerFilter, + ShieldFundsAndInvokeFilter, EventCreator, >; pub type EnclaveValidatorAccessor = ValidatorAccessor< diff --git a/enclave-runtime/src/test/fixtures/components.rs b/enclave-runtime/src/test/fixtures/components.rs index 10bbabd6ba..d9e617b9f3 100644 --- a/enclave-runtime/src/test/fixtures/components.rs +++ b/enclave-runtime/src/test/fixtures/components.rs @@ -24,7 +24,7 @@ use itp_sgx_crypto::ShieldingCryptoEncrypt; use itp_stf_primitives::types::KeyPair; use itp_top_pool::pool::Options as PoolOptions; use itp_top_pool_author::api::SidechainApi; -use itp_types::{Block as ParentchainBlock, Enclave, ShardIdentifier}; +use itp_types::{Block as ParentchainBlock, ShardIdentifier}; use sp_core::{ed25519, Pair, H256}; use sp_runtime::traits::Header as HeaderTrait; use std::{boxed::Box, sync::Arc, vec::Vec}; @@ -39,13 +39,11 @@ pub(crate) fn create_ocall_api>( header: &Header, signer: &TestSigner, ) -> Arc { - let enclave_validateer = Enclave::new( - signer.public().into(), - Default::default(), - Default::default(), - Default::default(), - ); - Arc::new(TestOCallApi::default().add_validateer_set(header, Some(vec![enclave_validateer]))) + Arc::new(TestOCallApi::default().add_validateer_set( + header, + ShardIdentifier::default(), + Some(vec![signer.public().into()]), + )) } pub(crate) fn encrypt_trusted_operation( diff --git a/enclave-runtime/src/test/top_pool_tests.rs b/enclave-runtime/src/test/top_pool_tests.rs index b4e0ba6447..3a37f23663 100644 --- a/enclave-runtime/src/test/top_pool_tests.rs +++ b/enclave-runtime/src/test/top_pool_tests.rs @@ -34,7 +34,7 @@ use ita_stf::{ TrustedCall, TrustedOperation, }; use itc_parentchain::indirect_calls_executor::{ - filter_metadata::{ShieldFundsAndCallWorkerFilter, TestEventCreator}, + filter_metadata::{ShieldFundsAndInvokeFilter, TestEventCreator}, parentchain_parser::ParentchainExtrinsicParser, ExecuteIndirectCalls, IndirectCallsExecutor, }; @@ -45,7 +45,7 @@ use itp_node_api::{ ParentchainUncheckedExtrinsic, }, metadata::{ - metadata_mocks::NodeMetadataMock, pallet_teerex::TeerexCallIndexes, + metadata_mocks::NodeMetadataMock, pallet_enclave_bridge::EnclaveBridgeCallIndexes, provider::NodeMetadataRepository, }, }; @@ -134,7 +134,7 @@ pub fn submit_shielding_call_to_top_pool() { _, _, _, - ShieldFundsAndCallWorkerFilter, + ShieldFundsAndInvokeFilter, TestEventCreator, >::new( shielding_key_repo, enclave_signer, top_pool_author.clone(), node_meta_data_repository @@ -192,7 +192,7 @@ fn create_shielding_call_extrinsic( let shield_funds_indexes = dummy_node_metadata.shield_funds_call_indexes().unwrap(); let opaque_extrinsic = OpaqueExtrinsic::from_bytes( ParentchainUncheckedExtrinsic::::new_signed( - (shield_funds_indexes, target_account, 1000u128, shard), + (shield_funds_indexes, shard, target_account, 1000u128), Address::Address32([1u8; 32]), MultiSignature::Ed25519(signature), default_extra_for_test.signed_extra(), diff --git a/enclave-runtime/src/top_pool_execution.rs b/enclave-runtime/src/top_pool_execution.rs index cff5971ae7..fbcad96947 100644 --- a/enclave-runtime/src/top_pool_execution.rs +++ b/enclave-runtime/src/top_pool_execution.rs @@ -59,7 +59,7 @@ use its_sidechain::{ }; use log::*; use sgx_types::sgx_status_t; -use sp_core::Pair; +use sp_core::{crypto::UncheckedFrom, Pair}; use sp_runtime::{ generic::SignedBlock as SignedParentchainBlock, traits::Block as BlockTrait, MultiSignature, }; @@ -213,7 +213,7 @@ where HeaderTrait, SignedSidechainBlock::Signature: From, Authority: Pair, - Authority::Public: Encode, + Authority::Public: Encode + UncheckedFrom<[u8; 32]>, OCallApi: ValidateerFetch + EnclaveOnChainOCallApi + Send + 'static, NumberFor: BlockNumberOps, PEnvironment: diff --git a/service/Cargo.toml b/service/Cargo.toml index 6a809ba542..0ecd12edbe 100644 --- a/service/Cargo.toml +++ b/service/Cargo.toml @@ -63,6 +63,7 @@ its-storage = { path = "../sidechain/storage" } my-node-runtime = { package = "integritee-node-runtime", git = "https://github.com/integritee-network/integritee-node.git", branch = "polkadot-v0.9.42" } sgx-verify = { git = "https://github.com/integritee-network/pallets.git", branch = "polkadot-v0.9.42" } # `default-features = false` to remove the jsonrpsee dependency. +enclave-bridge-primitives = { git = "https://github.com/integritee-network/pallets.git", branch = "polkadot-v0.9.42" } substrate-api-client = { default-features = false, features = ["std", "ws-client"], git = "https://github.com/scs/substrate-api-client.git", branch = "polkadot-v0.9.42-tag-v0.10.0" } teerex-primitives = { git = "https://github.com/integritee-network/pallets.git", branch = "polkadot-v0.9.42" } diff --git a/service/src/account_funding.rs b/service/src/account_funding.rs index 15c5038bf0..331a174deb 100644 --- a/service/src/account_funding.rs +++ b/service/src/account_funding.rs @@ -16,7 +16,6 @@ */ use crate::error::{Error, ServiceResult}; -use codec::Encode; use itp_node_api::api_client::{AccountApi, ParentchainApi, ParentchainExtrinsicSigner}; use itp_settings::worker::{ EXISTENTIAL_DEPOSIT_FACTOR_FOR_INIT_FUNDS, REGISTERING_FEE_FACTOR_FOR_INIT_FUNDS, @@ -135,14 +134,12 @@ fn bootstrap_funds_from_alice( funding_amount: u128, ) -> Result<(), Error> { let alice = AccountKeyring::Alice.pair(); - info!("encoding Alice's public = {:?}", alice.public().0.encode()); let alice_acc = AccountId32::from(*alice.public().as_array_ref()); - info!("encoding Alice's AccountId = {:?}", alice_acc.encode()); let alice_free = api.get_free_balance(&alice_acc)?; - info!(" Alice's free balance = {:?}", alice_free); + trace!(" Alice's free balance = {:?}", alice_free); let nonce = api.get_nonce_of(&alice_acc)?; - info!(" Alice's Account Nonce is {}", nonce); + trace!(" Alice's Account Nonce is {}", nonce); if funding_amount > alice_free { println!( @@ -165,7 +162,7 @@ fn bootstrap_funds_from_alice( ); // Verify funds have arrived. let free_balance = alice_signer_api.get_free_balance(accountid); - info!("TEE's NEW free balance = {:?}", free_balance); + trace!("TEE's NEW free balance = {:?}", free_balance); Ok(()) } diff --git a/service/src/main.rs b/service/src/main.rs index bd0ea3b5f0..cab77e7230 100644 --- a/service/src/main.rs +++ b/service/src/main.rs @@ -75,15 +75,16 @@ use substrate_api_client::{ api::XtStatus, rpc::HandleSubscription, GetHeader, SubmitAndWatch, SubscribeChain, SubscribeEvents, }; +use teerex_primitives::AnySigner; #[cfg(feature = "dcap")] use sgx_verify::extract_tcb_info_from_raw_dcap_quote; +use enclave_bridge_primitives::ShardIdentifier; use sp_core::crypto::{AccountId32, Ss58Codec}; use sp_keyring::AccountKeyring; -use sp_runtime::traits::Header as HeaderTrait; +use sp_runtime::MultiSigner; use std::{str, sync::Arc, thread, time::Duration}; -use teerex_primitives::ShardIdentifier; mod account_funding; mod config; @@ -249,7 +250,7 @@ fn main() { enclave.dump_dcap_ra_cert_to_disk().unwrap(); } } else if matches.is_present("mrenclave") { - println!("{}", enclave.get_mrenclave().unwrap().encode().to_base58()); + println!("{}", enclave.get_fingerprint().unwrap().encode().to_base58()); } else if let Some(sub_matches) = matches.subcommand_matches("init-shard") { setup::init_shard( enclave.as_ref(), @@ -325,8 +326,8 @@ fn start_worker( } // ------------------------------------------------------------------------ // initialize the enclave - let mrenclave = enclave.get_mrenclave().unwrap(); - println!("MRENCLAVE={}", mrenclave.to_base58()); + let mrenclave = enclave.get_fingerprint().unwrap(); + println!("MRENCLAVE={}", mrenclave.0.to_base58()); println!("MRENCLAVE in hex {:?}", hex::encode(mrenclave)); // ------------------------------------------------------------------------ @@ -482,9 +483,10 @@ fn start_worker( #[cfg(feature = "dcap")] let register_xt = move || enclave2.generate_dcap_ra_extrinsic(&trusted_url, skip_ra).unwrap(); + let tee_accountid_clone = tee_accountid.clone(); let send_register_xt = move || { println!("[+] Send register enclave extrinsic"); - send_extrinsic(register_xt(), &node_api2, &tee_accountid.clone(), is_development_mode) + send_extrinsic(register_xt(), &node_api2, &tee_accountid_clone, is_development_mode) }; let register_enclave_block_hash = send_register_xt().unwrap(); @@ -493,12 +495,12 @@ fn start_worker( node_api.get_header(Some(register_enclave_block_hash)).unwrap().unwrap(); let we_are_primary_validateer = - we_are_primary_validateer(&node_api, ®ister_enclave_xt_header).unwrap(); + we_are_primary_worker(&node_api, shard, &tee_accountid).unwrap(); if we_are_primary_validateer { - println!("[+] We are the primary validateer"); + println!("[+] We are the primary worker"); } else { - println!("[+] We are NOT the primary validateer"); + println!("[+] We are NOT the primary worker"); } initialization_handler.registered_on_parentchain(); @@ -590,10 +592,15 @@ fn spawn_worker_for_shard_polling( loop { info!("Polling for worker for shard ({} seconds interval)", POLL_INTERVAL_SECS); - if let Ok(Some(enclave)) = node_api.worker_for_shard(&shard_for_initialized, None) { + if let Ok(Some(enclave)) = + node_api.primary_worker_for_shard(&shard_for_initialized, None) + { // Set that the service is initialized. initialization_handler.worker_for_shard_registered(); - println!("[+] Found `WorkerForShard` on parentchain state: {:?}", enclave.pubkey); + println!( + "[+] Found `WorkerForShard` on parentchain state: {:?}", + enclave.instance_signer() + ); break } thread::sleep(Duration::from_secs(POLL_INTERVAL_SECS)); @@ -626,43 +633,68 @@ fn print_events(events: Vec) { RuntimeEvent::Teerex(re) => { debug!("{:?}", re); match &re { - my_node_runtime::pallet_teerex::Event::AddedEnclave { + my_node_runtime::pallet_teerex::Event::AddedSgxEnclave { registered_by, worker_url, .. } => { println!("[+] Received AddedEnclave event"); println!(" Sender (Worker): {:?}", registered_by); - println!(" Registered URL: {:?}", str::from_utf8(worker_url).unwrap()); + println!( + " Registered URL: {:?}", + str::from_utf8(&worker_url.clone().unwrap_or("none".into())).unwrap() + ); + }, + _ => { + trace!("Ignoring unsupported pallet_teerex event"); }, - my_node_runtime::pallet_teerex::Event::Forwarded(shard) => { + } + }, + RuntimeEvent::EnclaveBridge(re) => { + debug!("{:?}", re); + match &re { + my_node_runtime::pallet_enclave_bridge::Event::IndirectInvocationRegistered( + shard, + ) => { println!( "[+] Received trusted call for shard {}", shard.encode().to_base58() ); }, - my_node_runtime::pallet_teerex::Event::ProcessedParentchainBlock( - sender, + my_node_runtime::pallet_enclave_bridge::Event::ProcessedParentchainBlock { + shard, block_hash, - merkle_root, + trusted_calls_merkle_root, block_number, - ) => { + } => { info!("[+] Received ProcessedParentchainBlock event"); - debug!(" From: {:?}", sender); + debug!(" for shard: {:?}", shard); debug!(" Block Hash: {:?}", hex::encode(block_hash)); - debug!(" Merkle Root: {:?}", hex::encode(merkle_root)); + debug!(" Merkle Root: {:?}", hex::encode(trusted_calls_merkle_root)); debug!(" Block Number: {:?}", block_number); }, - my_node_runtime::pallet_teerex::Event::ShieldFunds(incognito_account) => { + my_node_runtime::pallet_enclave_bridge::Event::ShieldFunds { + shard, + encrypted_beneficiary, + amount, + } => { info!("[+] Received ShieldFunds event"); - debug!(" For: {:?}", incognito_account); + debug!(" for shard: {:?}", shard); + debug!(" for enc. beneficiary: {:?}", encrypted_beneficiary); + debug!(" Amount: {:?}", amount); }, - my_node_runtime::pallet_teerex::Event::UnshieldedFunds(incognito_account) => { + my_node_runtime::pallet_enclave_bridge::Event::UnshieldedFunds { + shard, + beneficiary, + amount, + } => { info!("[+] Received UnshieldedFunds event"); - debug!(" For: {:?}", incognito_account); + debug!(" for shard: {:?}", shard); + debug!(" beneficiary: {:?}", beneficiary); + debug!(" Amount: {:?}", amount); }, _ => { - trace!("Ignoring unsupported pallet_teerex event"); + trace!("Ignoring unsupported pallet_enclave_bridge event"); }, } }, @@ -670,39 +702,39 @@ fn print_events(events: Vec) { RuntimeEvent::Teeracle(re) => { debug!("{:?}", re); match &re { - my_node_runtime::pallet_teeracle::Event::ExchangeRateUpdated( - source, - currency, - new_value, - ) => { + my_node_runtime::pallet_teeracle::Event::ExchangeRateUpdated { + data_source, + trading_pair, + exchange_rate, + } => { println!("[+] Received ExchangeRateUpdated event"); - println!(" Data source: {}", source); - println!(" Currency: {}", currency); - println!(" Exchange rate: {:?}", new_value); + println!(" Data source: {}", data_source); + println!(" trading pair: {}", trading_pair); + println!(" Exchange rate: {:?}", exchange_rate); }, - my_node_runtime::pallet_teeracle::Event::ExchangeRateDeleted( - source, - currency, - ) => { + my_node_runtime::pallet_teeracle::Event::ExchangeRateDeleted { + data_source, + trading_pair, + } => { println!("[+] Received ExchangeRateDeleted event"); - println!(" Data source: {}", source); - println!(" Currency: {}", currency); + println!(" Data source: {}", data_source); + println!(" trading pair: {}", trading_pair); }, - my_node_runtime::pallet_teeracle::Event::AddedToWhitelist( - source, - mrenclave, - ) => { + my_node_runtime::pallet_teeracle::Event::AddedToWhitelist { + data_source, + enclave_fingerprint, + } => { println!("[+] Received AddedToWhitelist event"); - println!(" Data source: {}", source); - println!(" Currency: {:?}", mrenclave); + println!(" Data source: {}", data_source); + println!(" fingerprint: {:?}", enclave_fingerprint); }, - my_node_runtime::pallet_teeracle::Event::RemovedFromWhitelist( - source, - mrenclave, - ) => { + my_node_runtime::pallet_teeracle::Event::RemovedFromWhitelist { + data_source, + enclave_fingerprint, + } => { println!("[+] Received RemovedFromWhitelist event"); - println!(" Data source: {}", source); - println!(" Currency: {:?}", mrenclave); + println!(" Data source: {}", data_source); + println!(" fingerprint: {:?}", enclave_fingerprint); }, _ => { trace!("Ignoring unsupported pallet_teeracle event"); @@ -711,13 +743,15 @@ fn print_events(events: Vec) { }, #[cfg(feature = "sidechain")] RuntimeEvent::Sidechain(re) => match &re { - my_node_runtime::pallet_sidechain::Event::ProposedSidechainBlock( - sender, - payload, - ) => { - info!("[+] Received ProposedSidechainBlock event"); - debug!(" From: {:?}", sender); - debug!(" Payload: {:?}", hex::encode(payload)); + my_node_runtime::pallet_sidechain::Event::FinalizedSidechainBlock { + shard, + block_header_hash, + validateer, + } => { + info!("[+] Received FinalizedSidechainBlock event"); + debug!(" for shard: {:?}", shard); + debug!(" From: {:?}", hex::encode(block_header_hash)); + debug!(" validateer: {:?}", validateer); }, _ => { trace!("Ignoring unsupported pallet_sidechain event"); @@ -881,16 +915,35 @@ fn enclave_account(enclave_api: &E) -> AccountId32 { } /// Checks if we are the first validateer to register on the parentchain. -fn we_are_primary_validateer( +fn we_are_primary_worker( node_api: &ParentchainApi, - register_enclave_xt_header: &Header, + shard: &ShardIdentifier, + enclave_account: &AccountId32, ) -> Result { - let enclave_count_of_previous_block = - node_api.enclave_count(Some(*register_enclave_xt_header.parent_hash()))?; - trace!( - "enclave count is {} for previous block 0x{:?}", - enclave_count_of_previous_block, - register_enclave_xt_header.parent_hash() - ); - Ok(enclave_count_of_previous_block == 0) + // are we registered? else fail. + node_api + .enclave(enclave_account, None)? + .expect("our enclave should be registered at this point"); + trace!("our enclave is registered"); + match node_api.primary_worker_for_shard(shard, None).unwrap() { + Some(enclave) => + match enclave.instance_signer() { + AnySigner::Known(MultiSigner::Ed25519(primary)) => + if primary.encode() == enclave_account.encode() { + debug!("We are primary worker on this shard adn we have been previously running."); + Ok(true) + } else { + debug!("The primary worker is {}", primary.to_ss58check()); + Ok(false) + }, + _ => { + warn!("the primary worker is of unknown type"); + Ok(false) + }, + }, + None => { + debug!("We are the primary worker on this shard and the shard is untouched"); + Ok(true) + }, + } } diff --git a/service/src/ocall_bridge/worker_on_chain_ocall.rs b/service/src/ocall_bridge/worker_on_chain_ocall.rs index c5b780010f..1dfea987cf 100644 --- a/service/src/ocall_bridge/worker_on_chain_ocall.rs +++ b/service/src/ocall_bridge/worker_on_chain_ocall.rs @@ -88,7 +88,7 @@ where let api = self.node_api_factory.create_api()?; for call in extrinsics.into_iter() { if let Err(e) = api.submit_opaque_extrinsic(call.encode().into()) { - error!("Could not send extrsinic to node: {:?}", e); + error!("Could not send extrsinic to node: {:?}, error: {:?}", call, e); } } } diff --git a/service/src/setup.rs b/service/src/setup.rs index 9cd6418122..6535091f26 100644 --- a/service/src/setup.rs +++ b/service/src/setup.rs @@ -17,6 +17,7 @@ */ use crate::error::{Error, ServiceResult}; +use base58::ToBase58; use codec::Encode; use itp_enclave_api::{enclave_base::EnclaveBase, Enclave}; use itp_settings::files::{ @@ -54,10 +55,10 @@ pub(crate) fn initialize_shard_and_keys( pub(crate) fn init_shard(enclave: &Enclave, shard_identifier: &ShardIdentifier) { match enclave.init_shard(shard_identifier.encode()) { Err(e) => { - println!("Failed to initialize shard {:?}: {:?}", shard_identifier, e); + println!("Failed to initialize shard {:?}: {:?}", shard_identifier.0.to_base58(), e); }, Ok(_) => { - println!("Successfully initialized shard {:?}", shard_identifier); + println!("Successfully initialized shard {:?}", shard_identifier.0.to_base58()); }, } } diff --git a/service/src/sync_state.rs b/service/src/sync_state.rs index 12ff9bec2a..6c70a5379e 100644 --- a/service/src/sync_state.rs +++ b/service/src/sync_state.rs @@ -75,9 +75,10 @@ async fn get_author_url_of_last_finalized_sidechain_block Result { let enclave = node_api - .worker_for_shard(shard, None)? + .primary_worker_for_shard(shard, None)? .ok_or_else(|| Error::NoWorkerForShardFound(*shard))?; - let worker_api_direct = DirectWorkerApi::new(enclave.url); + let worker_api_direct = + DirectWorkerApi::new(String::from_utf8(enclave.instance_url().unwrap()).unwrap()); Ok(worker_api_direct.get_mu_ra_url()?) } @@ -88,12 +89,13 @@ async fn get_enclave_url_of_first_registered Result { - let self_mr_enclave = enclave_api.get_mrenclave()?; + let self_mr_enclave = enclave_api.get_fingerprint()?; let first_enclave = node_api .all_enclaves(None)? .into_iter() - .find(|e| e.mr_enclave == self_mr_enclave) + .find(|e| e.fingerprint() == self_mr_enclave) .ok_or(Error::NoPeerWorkerFound)?; - let worker_api_direct = DirectWorkerApi::new(first_enclave.url); + let worker_api_direct = + DirectWorkerApi::new(String::from_utf8(first_enclave.instance_url().unwrap()).unwrap()); Ok(worker_api_direct.get_mu_ra_url()?) } diff --git a/service/src/tests/mock.rs b/service/src/tests/mock.rs index 664005eaa1..f6581090c6 100644 --- a/service/src/tests/mock.rs +++ b/service/src/tests/mock.rs @@ -15,38 +15,66 @@ */ +use codec::Encode; use itp_node_api::api_client::{ApiResult, PalletTeerexApi}; -use itp_types::{Enclave, ShardIdentifier, H256 as Hash}; +use itp_types::{ + AccountId, MultiEnclave, SgxBuildMode, SgxEnclave, SgxReportData, SgxStatus, ShardIdentifier, + H256 as Hash, +}; pub struct TestNodeApi; pub const W1_URL: &str = "127.0.0.1:22222"; pub const W2_URL: &str = "127.0.0.1:33333"; -pub fn enclaves() -> Vec { +pub fn enclaves() -> Vec>> { vec![ - Enclave::new([0; 32].into(), [1; 32], 1, format!("wss://{}", W1_URL)), - Enclave::new([2; 32].into(), [3; 32], 2, format!("wss://{}", W2_URL)), + MultiEnclave::from( + SgxEnclave::new( + SgxReportData::default(), + [1; 32], + [1; 32], + 1, + SgxBuildMode::Production, + SgxStatus::Ok, + ) + .with_url(format!("wss://{}", W1_URL).encode()), + ), + MultiEnclave::from( + SgxEnclave::new( + SgxReportData::default(), + [2; 32], + [2; 32], + 2, + SgxBuildMode::Production, + SgxStatus::Ok, + ) + .with_url(format!("wss://{}", W2_URL).encode()), + ), ] } impl PalletTeerexApi for TestNodeApi { - fn enclave(&self, index: u64, _at_block: Option) -> ApiResult> { - Ok(Some(enclaves().remove(index as usize))) + fn enclave( + &self, + _account: &AccountId, + _at_block: Option, + ) -> ApiResult>>> { + Ok(Some(enclaves().remove(0))) } fn enclave_count(&self, _at_block: Option) -> ApiResult { unreachable!() } - fn all_enclaves(&self, _at_block: Option) -> ApiResult> { + fn all_enclaves(&self, _at_block: Option) -> ApiResult>>> { Ok(enclaves()) } - fn worker_for_shard( + fn primary_worker_for_shard( &self, _: &ShardIdentifier, _at_block: Option, - ) -> ApiResult> { + ) -> ApiResult>>> { unreachable!() } fn latest_ipfs_hash( diff --git a/service/src/tests/mocks/enclave_api_mock.rs b/service/src/tests/mocks/enclave_api_mock.rs index f32176332c..21a64323be 100644 --- a/service/src/tests/mocks/enclave_api_mock.rs +++ b/service/src/tests/mocks/enclave_api_mock.rs @@ -17,6 +17,7 @@ use codec::{Decode, Encode}; use core::fmt::Debug; +use enclave_bridge_primitives::EnclaveFingerprint; use frame_support::sp_runtime::traits::Block as ParentchainBlockTrait; use itc_parentchain::primitives::{ ParentchainInitParams, @@ -80,8 +81,8 @@ impl EnclaveBase for EnclaveMock { unreachable!() } - fn get_mrenclave(&self) -> EnclaveResult<[u8; MR_ENCLAVE_SIZE]> { - Ok([1u8; MR_ENCLAVE_SIZE]) + fn get_fingerprint(&self) -> EnclaveResult { + Ok([1u8; MR_ENCLAVE_SIZE].into()) } } diff --git a/service/src/utils.rs b/service/src/utils.rs index c936665350..fd0b60fe82 100644 --- a/service/src/utils.rs +++ b/service/src/utils.rs @@ -33,8 +33,8 @@ pub fn extract_shard( shard.into() }, _ => { - let mrenclave = enclave_api.get_mrenclave().unwrap(); - info!("no shard specified. using mrenclave as id: {}", mrenclave.to_base58()); + let mrenclave = enclave_api.get_fingerprint().unwrap(); + info!("no shard specified. using mrenclave as id: {}", mrenclave.0.to_base58()); ShardIdentifier::from_slice(&mrenclave[..]) }, } diff --git a/service/src/worker.rs b/service/src/worker.rs index 18e67d82eb..a052245a14 100644 --- a/service/src/worker.rs +++ b/service/src/worker.rs @@ -149,8 +149,8 @@ where let mut peer_urls = Vec::::new(); for enclave in enclaves { // FIXME: This is temporary only, as block broadcasting should be moved to trusted ws server. - let enclave_url = enclave.url.clone(); - let worker_api_direct = DirectWorkerApi::new(enclave.url); + let enclave_url = String::from_utf8(enclave.instance_url().unwrap()).unwrap(); + let worker_api_direct = DirectWorkerApi::new(enclave_url.clone()); match worker_api_direct.get_untrusted_worker_url() { Ok(untrusted_worker_url) => { peer_urls.push(untrusted_worker_url); diff --git a/sidechain/block-verification/Cargo.toml b/sidechain/block-verification/Cargo.toml index 20728928d7..376d1267fd 100644 --- a/sidechain/block-verification/Cargo.toml +++ b/sidechain/block-verification/Cargo.toml @@ -4,7 +4,7 @@ description = "Verification logic for sidechain blocks" version = "0.9.0" authors = ["Integritee AG "] homepage = "https://integritee.network/" -repository = "https://github.com/integritee-network/pallets/" +repository = "https://github.com/integritee-network/worker/" license = "Apache-2.0" edition = "2021" diff --git a/sidechain/consensus/aura/src/block_importer.rs b/sidechain/consensus/aura/src/block_importer.rs index 15d7217fb5..d336ba98f7 100644 --- a/sidechain/consensus/aura/src/block_importer.rs +++ b/sidechain/consensus/aura/src/block_importer.rs @@ -37,7 +37,7 @@ use its_primitives::traits::{ }; use its_validateer_fetch::ValidateerFetch; use log::*; -use sp_core::Pair; +use sp_core::{crypto::UncheckedFrom, Pair}; use sp_runtime::{ generic::SignedBlock as SignedParentchainBlock, traits::{Block as ParentchainBlockTrait, Header}, @@ -85,7 +85,7 @@ impl< ParentchainBlockImporter, > where Authority: Pair, - Authority::Public: std::fmt::Debug, + Authority::Public: std::fmt::Debug + UncheckedFrom<[u8; 32]>, ParentchainBlock: ParentchainBlockTrait, SignedSidechainBlock: SignedBlockTrait + 'static, <::Block as SidechainBlockTrait>::HeaderType: @@ -170,7 +170,7 @@ impl< ParentchainBlockImporter, > where Authority: Pair, - Authority::Public: std::fmt::Debug, + Authority::Public: std::fmt::Debug + UncheckedFrom<[u8; 32]>, ParentchainBlock: ParentchainBlockTrait, SignedSidechainBlock: SignedBlockTrait + 'static, <::Block as SidechainBlockTrait>::HeaderType: diff --git a/sidechain/consensus/aura/src/lib.rs b/sidechain/consensus/aura/src/lib.rs index adfe9f22e0..0c52803086 100644 --- a/sidechain/consensus/aura/src/lib.rs +++ b/sidechain/consensus/aura/src/lib.rs @@ -41,7 +41,7 @@ use its_primitives::{ types::block::BlockHash, }; use its_validateer_fetch::ValidateerFetch; -use sp_core::ByteArray; +use sp_core::crypto::UncheckedFrom; use sp_runtime::{ app_crypto::{sp_core::H256, Pair}, generic::SignedBlock as SignedParentchainBlock, @@ -124,6 +124,7 @@ impl where AuthorityPair: Pair, + AuthorityPair::Public: UncheckedFrom<[u8; 32]>, // todo: Relax hash trait bound, but this needs a change to some other parts in the code. ParentchainBlock: ParentchainBlockTrait, E: Environment, @@ -145,9 +146,14 @@ where fn epoch_data( &self, header: &ParentchainBlock::Header, + shard: ShardIdentifierFor, _slot: Slot, ) -> Result { - authorities::<_, AuthorityPair, ParentchainBlock::Header>(&self.ocall_api, header) + authorities::<_, AuthorityPair, SignedSidechainBlock, ParentchainBlock::Header>( + &self.ocall_api, + header, + shard, + ) } fn authorities_len(&self, epoch_data: &Self::EpochData) -> Option { @@ -235,20 +241,23 @@ fn proposing_remaining_duration( std::cmp::min(slot_remaining, proposing_duration) } -fn authorities( +fn authorities( ocall_api: &ValidateerFetcher, header: &ParentchainHeader, + shard: ShardIdentifierFor, ) -> Result>, ConsensusError> where ValidateerFetcher: ValidateerFetch + EnclaveOnChainOCallApi, P: Pair, + P::Public: UncheckedFrom<[u8; 32]>, ParentchainHeader: ParentchainHeaderTrait, + SignedSidechainBlock: its_primitives::traits::SignedBlock, { Ok(ocall_api - .current_validateers(header) + .current_validateers::(header, shard) .map_err(|e| ConsensusError::CouldNotGetAuthorities(e.to_string()))? - .into_iter() - .filter_map(|e| AuthorityId::

::from_slice(e.pubkey.as_ref()).ok()) + .iter() + .map(|account| P::Public::unchecked_from(*account.as_ref())) .collect()) } @@ -256,14 +265,14 @@ where mod tests { use super::*; use crate::test::{ - fixtures::{types::TestAura, validateer, SLOT_DURATION}, + fixtures::{types::TestAura, SLOT_DURATION}, mocks::environment_mock::EnvironmentMock, }; use itc_parentchain_block_import_dispatcher::trigger_parentchain_block_import_mock::TriggerParentchainBlockImportMock; use itc_parentchain_test::{ParentchainBlockBuilder, ParentchainHeaderBuilder}; use itp_test::mock::onchain_mock::OnchainMock; use itp_types::{ - Block as ParentchainBlock, Enclave, Header as ParentchainHeader, + AccountId, Block as ParentchainBlock, Header as ParentchainHeader, ShardIdentifier, SignedBlock as SignedParentchainBlock, }; use its_consensus_slots::PerShardSlotWorkerScheduler; @@ -300,8 +309,8 @@ mod tests { vec![Keyring::Alice.public(), Keyring::Bob.public(), Keyring::Charlie.public()] } - fn create_validateer_set_from_publics(authorities: Vec) -> Vec { - authorities.iter().map(|a| validateer(a.clone().into())).collect() + fn create_validateer_set_from_publics(authorities: Vec) -> Vec { + authorities.iter().map(|a| AccountId::from(a.clone())).collect() } fn onchain_mock( @@ -309,7 +318,8 @@ mod tests { authorities: Vec, ) -> OnchainMock { let validateers = create_validateer_set_from_publics(authorities); - OnchainMock::default().add_validateer_set(parentchain_header, Some(validateers)) + let shard = ShardIdentifier::default(); + OnchainMock::default().add_validateer_set(parentchain_header, shard, Some(validateers)) } fn onchain_mock_with_default_authorities_and_header() -> OnchainMock { @@ -478,9 +488,14 @@ mod tests { Keyring::Bob.public(), Keyring::Charlie.public(), ]); + let shard = ShardIdentifier::default(); let onchain_mock = OnchainMock::default() - .add_validateer_set(&already_imported_parentchain_header, Some(validateer_set_one)) - .add_validateer_set(&latest_parentchain_header, Some(validateer_set_two)); + .add_validateer_set( + &already_imported_parentchain_header, + shard, + Some(validateer_set_one), + ) + .add_validateer_set(&latest_parentchain_header, shard, Some(validateer_set_two)); let mut aura = get_aura(onchain_mock, parentchain_block_import_trigger.clone()); @@ -513,9 +528,14 @@ mod tests { Keyring::Bob.public(), Keyring::Charlie.public(), ]); + let shard = ShardIdentifier::default(); let onchain_mock = OnchainMock::default() - .add_validateer_set(&already_imported_parentchain_header, Some(validateer_set_one)) - .add_validateer_set(&latest_parentchain_header, Some(validateer_set_two)); + .add_validateer_set( + &already_imported_parentchain_header, + shard, + Some(validateer_set_one), + ) + .add_validateer_set(&latest_parentchain_header, shard, Some(validateer_set_two)); let mut aura = get_aura(onchain_mock, parentchain_block_import_trigger.clone()); diff --git a/sidechain/consensus/aura/src/test/block_importer_tests.rs b/sidechain/consensus/aura/src/test/block_importer_tests.rs index 9ec2e05bd9..db11810a1d 100644 --- a/sidechain/consensus/aura/src/test/block_importer_tests.rs +++ b/sidechain/consensus/aura/src/test/block_importer_tests.rs @@ -15,7 +15,7 @@ */ -use crate::{block_importer::BlockImporter, test::fixtures::validateer, ShardIdentifierFor}; +use crate::{block_importer::BlockImporter, ShardIdentifierFor}; use codec::Encode; use core::assert_matches::assert_matches; use itc_parentchain_block_import_dispatcher::trigger_parentchain_block_import_mock::TriggerParentchainBlockImportMock; @@ -78,7 +78,8 @@ fn test_fixtures( let top_pool_author = Arc::new(TestTopPoolAuthor::default()); let ocall_api = Arc::new(OnchainMock::default().add_validateer_set( parentchain_header, - Some(vec![validateer(Keyring::Alice.public().into())]), + shard(), + Some(vec![Keyring::Alice.public().into()]), )); let state_key_repository = Arc::new(TestStateKeyRepo::new(state_key())); diff --git a/sidechain/consensus/aura/src/test/fixtures/mod.rs b/sidechain/consensus/aura/src/test/fixtures/mod.rs index 54d47324fa..8a2b0463be 100644 --- a/sidechain/consensus/aura/src/test/fixtures/mod.rs +++ b/sidechain/consensus/aura/src/test/fixtures/mod.rs @@ -17,11 +17,6 @@ pub mod types; -use itp_types::{AccountId, Enclave}; use std::time::Duration; pub const SLOT_DURATION: Duration = Duration::from_millis(300); - -pub fn validateer(account: AccountId) -> Enclave { - Enclave::new(account, Default::default(), Default::default(), Default::default()) -} diff --git a/sidechain/consensus/aura/src/verifier.rs b/sidechain/consensus/aura/src/verifier.rs index 15526f0a74..205549bb17 100644 --- a/sidechain/consensus/aura/src/verifier.rs +++ b/sidechain/consensus/aura/src/verifier.rs @@ -15,7 +15,7 @@ */ -use crate::{authorities, EnclaveOnChainOCallApi}; +use crate::{authorities, EnclaveOnChainOCallApi, ShardIdentifierFor}; use core::marker::PhantomData; use its_block_verification::verify_sidechain_block; use its_consensus_common::{Error as ConsensusError, Verifier}; @@ -24,6 +24,7 @@ use its_primitives::{ types::block::BlockHash, }; use its_validateer_fetch::ValidateerFetch; +use sp_core::crypto::UncheckedFrom; use sp_runtime::{app_crypto::Pair, traits::Block as ParentchainBlockTrait}; use std::{fmt::Debug, time::Duration}; @@ -57,7 +58,7 @@ impl for AuraVerifier where AuthorityPair: Pair, - AuthorityPair::Public: Debug, + AuthorityPair::Public: Debug + UncheckedFrom<[u8; 32]>, // todo: Relax hash trait bound, but this needs a change to some other parts in the code. ParentchainBlock: ParentchainBlockTrait, SignedSidechainBlock: SignedSidechainBlockTrait + 'static, @@ -72,10 +73,15 @@ where &self, signed_block: SignedSidechainBlock, parentchain_header: &ParentchainBlock::Header, + shard: ShardIdentifierFor, ctx: &Self::Context, ) -> Result { - let authorities = - authorities::<_, AuthorityPair, ParentchainBlock::Header>(ctx, parentchain_header)?; + let authorities = authorities::< + _, + AuthorityPair, + SignedSidechainBlock, + ParentchainBlock::Header, + >(ctx, parentchain_header, shard)?; Ok(verify_sidechain_block::( signed_block, diff --git a/sidechain/consensus/common/src/block_import.rs b/sidechain/consensus/common/src/block_import.rs index 24a3a745c3..567728bce2 100644 --- a/sidechain/consensus/common/src/block_import.rs +++ b/sidechain/consensus/common/src/block_import.rs @@ -136,6 +136,7 @@ where verifier.verify( signed_sidechain_block.clone(), &peeked_parentchain_header, + shard, self.get_context(), ) })?; diff --git a/sidechain/consensus/common/src/lib.rs b/sidechain/consensus/common/src/lib.rs index c6a708c9e1..fa2104186f 100644 --- a/sidechain/consensus/common/src/lib.rs +++ b/sidechain/consensus/common/src/lib.rs @@ -68,6 +68,7 @@ where &self, block: SignedSidechainBlock, parentchain_header: &ParentchainBlock::Header, + shard: ShardIdentifierFor, ctx: &Self::Context, ) -> Result; } diff --git a/sidechain/consensus/common/src/test/mocks/verifier_mock.rs b/sidechain/consensus/common/src/test/mocks/verifier_mock.rs index 6e104574ea..e6d8cbeb0e 100644 --- a/sidechain/consensus/common/src/test/mocks/verifier_mock.rs +++ b/sidechain/consensus/common/src/test/mocks/verifier_mock.rs @@ -15,7 +15,7 @@ */ -use crate::{Result, Verifier}; +use crate::{Result, ShardIdentifierFor, Verifier}; use itp_types::H256; use its_primitives::traits::SignedBlock as SignedSidechainBlockTrait; use sp_core::Pair; @@ -54,6 +54,7 @@ where &self, _block: SignedSidechainBlock, _parentchain_header: &ParentchainBlock::Header, + _shard: ShardIdentifierFor, _ctx: &Self::Context, ) -> Result { todo!() diff --git a/sidechain/consensus/slots/src/lib.rs b/sidechain/consensus/slots/src/lib.rs index 1f1b000ebe..cff263fa60 100644 --- a/sidechain/consensus/slots/src/lib.rs +++ b/sidechain/consensus/slots/src/lib.rs @@ -137,6 +137,7 @@ pub trait SimpleSlotWorker { fn epoch_data( &self, header: &ParentchainBlock::Header, + shard: ShardIdentifierFor, slot: Slot, ) -> Result; @@ -214,7 +215,7 @@ pub trait SimpleSlotWorker { }, }; - let epoch_data = match self.epoch_data(&latest_parentchain_header, slot) { + let epoch_data = match self.epoch_data(&latest_parentchain_header, shard, slot) { Ok(epoch_data) => epoch_data, Err(e) => { warn!( @@ -271,7 +272,7 @@ pub trait SimpleSlotWorker { if !timestamp_within_slot(&slot_info, &proposing.block) { warn!( target: logging_target, - "⌛️ Discarding proposal for slot {}, block number {}; block production took too long", + "⌛️ Discarding proposal for slot {}, block number {}; block production took too long", *slot, proposing.block.block().header().block_number(), ); diff --git a/sidechain/consensus/slots/src/mocks.rs b/sidechain/consensus/slots/src/mocks.rs index ea6e4d4d6c..6664351160 100644 --- a/sidechain/consensus/slots/src/mocks.rs +++ b/sidechain/consensus/slots/src/mocks.rs @@ -60,7 +60,12 @@ where "test" } - fn epoch_data(&self, _header: &B::Header, _slot: Slot) -> Result { + fn epoch_data( + &self, + _header: &B::Header, + _shard: ShardIdentifierFor, + _slot: Slot, + ) -> Result { todo!() } diff --git a/sidechain/peer-fetch/src/untrusted_peer_fetch.rs b/sidechain/peer-fetch/src/untrusted_peer_fetch.rs index 7ff9434103..cfdabbfbf4 100644 --- a/sidechain/peer-fetch/src/untrusted_peer_fetch.rs +++ b/sidechain/peer-fetch/src/untrusted_peer_fetch.rs @@ -50,10 +50,15 @@ where let node_api = self.node_api_factory.create_api()?; let validateer = node_api - .worker_for_shard(shard, None)? + .primary_worker_for_shard(shard, None)? .ok_or_else(|| Error::NoPeerFoundForShard(*shard))?; - let trusted_worker_client = DirectWorkerApi::new(validateer.url); + let trusted_worker_client = DirectWorkerApi::new( + validateer + .instance_url() + .map(|url| String::from_utf8(url).unwrap_or_default()) + .ok_or_else(|| Error::NoPeerFoundForShard(*shard))?, + ); Ok(trusted_worker_client.get_untrusted_worker_url()?) } } diff --git a/sidechain/primitives/Cargo.toml b/sidechain/primitives/Cargo.toml index e93e3d9719..45844541a2 100644 --- a/sidechain/primitives/Cargo.toml +++ b/sidechain/primitives/Cargo.toml @@ -3,16 +3,16 @@ name = "its-primitives" version = "0.1.0" authors = ["Integritee AG "] homepage = "https://integritee.network/" -repository = "https://github.com/integritee-network/pallets/" +repository = "https://github.com/integritee-network/worker/" license = "Apache-2.0" edition = "2021" [dependencies] codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive", "full"] } +itp-types = { path = "../../core-primitives/types", default-features = false } scale-info = { version = "2.0.1", default-features = false, features = ["derive"] } serde = { version = "1.0.13", default-features = false } - # substrate dependencies sp-core = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } sp-io = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } @@ -29,6 +29,7 @@ std = [ "codec/std", "scale-info/std", "serde/std", + "itp-types/std", # substrate "sp-core/std", "sp-io/std", diff --git a/sidechain/primitives/src/types/header.rs b/sidechain/primitives/src/types/header.rs index a4289193f8..962917f534 100644 --- a/sidechain/primitives/src/types/header.rs +++ b/sidechain/primitives/src/types/header.rs @@ -26,7 +26,7 @@ use sp_std::prelude::*; #[cfg(feature = "std")] use serde::{Deserialize, Serialize}; -pub type ShardIdentifier = H256; +pub use itp_types::ShardIdentifier; #[derive(PartialEq, Eq, Clone, Encode, Decode, Debug, Copy, Default, TypeInfo)] #[cfg_attr(feature = "std", derive(Serialize, Deserialize))] diff --git a/sidechain/test/Cargo.toml b/sidechain/test/Cargo.toml index f6f8fbfc72..002349141f 100644 --- a/sidechain/test/Cargo.toml +++ b/sidechain/test/Cargo.toml @@ -3,7 +3,7 @@ name = "its-test" version = "0.9.0" authors = ["Integritee AG "] homepage = "https://integritee.network/" -repository = "https://github.com/integritee-network/pallets/" +repository = "https://github.com/integritee-network/worker/" license = "Apache-2.0" edition = "2021" diff --git a/sidechain/validateer-fetch/Cargo.toml b/sidechain/validateer-fetch/Cargo.toml index dba26b3189..01988d59ce 100644 --- a/sidechain/validateer-fetch/Cargo.toml +++ b/sidechain/validateer-fetch/Cargo.toml @@ -7,6 +7,7 @@ edition = "2021" [dependencies] codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive", "chain-error"] } derive_more = "0.99.16" +log = "0.4" thiserror = "1.0.26" # substrate deps @@ -16,10 +17,12 @@ 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" } # local deps +itp-enclave-bridge-storage = { path = "../../core-primitives/enclave-bridge-storage", default-features = false } itp-ocall-api = { path = "../../core-primitives/ocall-api", default-features = false } itp-storage = { path = "../../core-primitives/storage", default-features = false } itp-teerex-storage = { path = "../../core-primitives/teerex-storage", default-features = false } itp-types = { path = "../../core-primitives/types", default-features = false } +its-primitives = { path = "../primitives", default-features = false } [features] default = ["std"] @@ -31,6 +34,8 @@ std = [ "itp-types/std", "itp-storage/std", "itp-ocall-api/std", + "its-primitives/std", + "itp-enclave-bridge-storage/std", ] [dev-dependencies] diff --git a/sidechain/validateer-fetch/src/validateer.rs b/sidechain/validateer-fetch/src/validateer.rs index c35b22c442..3f0c099917 100644 --- a/sidechain/validateer-fetch/src/validateer.rs +++ b/sidechain/validateer-fetch/src/validateer.rs @@ -16,89 +16,108 @@ */ use crate::error::{Error, Result}; -use frame_support::ensure; +use itp_enclave_bridge_storage::{EnclaveBridgeStorage, EnclaveBridgeStorageKeys}; use itp_ocall_api::EnclaveOnChainOCallApi; -use itp_teerex_storage::{TeeRexStorage, TeerexStorageKeys}; -use itp_types::Enclave; +use itp_types::{parentchain::AccountId, ShardSignerStatus}; +use its_primitives::traits::{Block as SidechainBlockTrait, Header as HeaderTrait, SignedBlock}; +use log::trace; use sp_core::H256; use sp_runtime::traits::Header as HeaderT; use sp_std::prelude::Vec; +type ShardIdentifierFor = +<<::Block as SidechainBlockTrait>::HeaderType as HeaderTrait>::ShardIdentifier; + pub trait ValidateerFetch { - fn current_validateers>( + fn current_validateers< + Header: HeaderT, + SignedSidechainBlock: its_primitives::traits::SignedBlock, + >( + &self, + latest_header: &Header, + shard: ShardIdentifierFor, + ) -> Result>; + fn validateer_count< + Header: HeaderT, + SignedSidechainBlock: its_primitives::traits::SignedBlock, + >( &self, latest_header: &Header, - ) -> Result>; - fn validateer_count>(&self, latest_header: &Header) - -> Result; + shard: ShardIdentifierFor, + ) -> Result; } impl ValidateerFetch for OnchainStorage { - fn current_validateers>( + fn current_validateers< + Header: HeaderT, + SignedSidechainBlock: its_primitives::traits::SignedBlock, + >( &self, header: &Header, - ) -> Result> { - let count = self.validateer_count(header)?; - - let mut hashes = Vec::with_capacity(count as usize); - for i in 1..=count { - hashes.push(TeeRexStorage::enclave(i)) - } - - let enclaves: Vec = self - .get_multiple_storages_verified(hashes, header)? - .into_iter() - .filter_map(|e| e.into_tuple().1) - .collect(); - ensure!( - enclaves.len() == count as usize, - Error::Other("Found less validateers onchain than validateer count") - ); - Ok(enclaves) - } - - fn validateer_count>(&self, header: &Header) -> Result { - self.get_storage_verified(TeeRexStorage::enclave_count(), header)? + shard: ShardIdentifierFor, + ) -> Result> { + let shard_status: Vec = self + .get_storage_verified( + EnclaveBridgeStorage::shard_status::>( + shard, + ), + header, + )? .into_tuple() .1 - .ok_or_else(|| Error::Other("Could not get validateer count from chain")) + .ok_or_else(|| Error::Other("Could not get validateer count from chain"))?; + trace!("fetched {} validateers for shard {:?}", shard_status.len(), shard); + Ok(shard_status.iter().map(|sss: &ShardSignerStatus| sss.signer.clone()).collect()) + } + + fn validateer_count< + Header: HeaderT, + SignedSidechainBlock: its_primitives::traits::SignedBlock, + >( + &self, + header: &Header, + shard: ShardIdentifierFor, + ) -> Result { + Ok(self.current_validateers::(header, shard)?.len() as u64) } } #[cfg(test)] mod tests { use super::*; - use codec::Encode; + use itc_parentchain_test::ParentchainHeaderBuilder; use itp_test::mock::onchain_mock::{validateer_set, OnchainMock}; - use std::string::ToString; + use itp_types::ShardIdentifier; #[test] pub fn get_validateer_count_works() { let header = ParentchainHeaderBuilder::default().build(); - let mock = OnchainMock::default().add_validateer_set(&header, None); - assert_eq!(mock.validateer_count(&header).unwrap(), 4u64); + let shard = ShardIdentifier::default(); + let mock = OnchainMock::default().add_validateer_set(&header, shard, None); + assert_eq!( + mock.validateer_count::( + &header, shard + ) + .unwrap(), + 4u64 + ); } #[test] pub fn get_validateer_set_works() { let header = ParentchainHeaderBuilder::default().build(); - let mock = OnchainMock::default().add_validateer_set(&header, None); + let shard = ShardIdentifier::default(); + let mock = OnchainMock::default().add_validateer_set(&header, shard, None); let validateers = validateer_set(); - assert_eq!(mock.current_validateers(&header).unwrap(), validateers); - } - - #[test] - pub fn if_validateer_count_bigger_than_returned_validateers_return_err() { - let header = ParentchainHeaderBuilder::default().build(); - let mut mock = OnchainMock::default().add_validateer_set(&header, None); - mock.insert_at_header(&header, TeeRexStorage::enclave_count(), 5u64.encode()); - assert_eq!( - mock.current_validateers(&header).unwrap_err().to_string(), - "Found less validateers onchain than validateer count".to_string() + mock.current_validateers::( + &header, shard + ) + .unwrap(), + validateers ); } } From 73f576e36d711c2c42ddee85a24a06b2dde28717 Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Sat, 12 Aug 2023 16:38:55 +0200 Subject: [PATCH 09/11] update Cargo.lock after merge --- Cargo.lock | 27 +++++++++++++- enclave-runtime/Cargo.lock | 76 +++++++++++++++++++------------------- 2 files changed, 64 insertions(+), 39 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c9c4198956..6e1468210d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -381,6 +381,14 @@ dependencies = [ "log 0.4.19", ] +[[package]] +name = "binary-merkle-tree" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate.git#28b1f79abedbad2ec97b49277b36e1f797ca9e5d" +dependencies = [ + "hash-db 0.16.0", +] + [[package]] name = "bincode" version = "1.3.3" @@ -2750,6 +2758,7 @@ version = "0.9.0" dependencies = [ "array-bytes 6.1.0", "base58", + "binary-merkle-tree 4.0.0-dev (git+https://github.com/paritytech/substrate.git)", "blake2-rfc", "chrono 0.4.26", "clap 3.2.25", @@ -2781,6 +2790,7 @@ dependencies = [ "serde 1.0.164", "serde_json 1.0.96", "sgx_crypto_helper", + "simplyr-lib", "sp-application-crypto", "sp-core", "sp-keyring", @@ -3031,6 +3041,7 @@ dependencies = [ name = "ita-stf" version = "0.9.0" dependencies = [ + "binary-merkle-tree 4.0.0-dev (git+https://github.com/paritytech/substrate.git)", "derive_more", "frame-support", "frame-system", @@ -3052,8 +3063,11 @@ dependencies = [ "pallet-sudo", "parity-scale-codec", "rlp", + "serde 1.0.164", + "serde_json 1.0.96", "sgx_tstd", "sha3", + "simplyr-lib", "sp-application-crypto", "sp-core", "sp-io 7.0.0", @@ -3159,7 +3173,7 @@ dependencies = [ name = "itc-parentchain-indirect-calls-executor" version = "0.9.0" dependencies = [ - "binary-merkle-tree", + "binary-merkle-tree 4.0.0-dev (git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42)", "bs58", "env_logger 0.9.3", "futures 0.3.28", @@ -7538,6 +7552,17 @@ dependencies = [ "wide", ] +[[package]] +name = "simplyr-lib" +version = "0.1.0" +source = "git+https://github.com/BESTenergytrade/simplyr-lib.git?branch=cI/usize#ec8e1266141112a75b304cecfa2da35bfdde215c" +dependencies = [ + "libm", + "parity-scale-codec", + "serde 1.0.164", + "serde_json 1.0.96", +] + [[package]] name = "slab" version = "0.4.2" diff --git a/enclave-runtime/Cargo.lock b/enclave-runtime/Cargo.lock index d4ac83e3c6..51c9e21432 100644 --- a/enclave-runtime/Cargo.lock +++ b/enclave-runtime/Cargo.lock @@ -249,6 +249,14 @@ dependencies = [ "hash-db 0.16.0", ] +[[package]] +name = "binary-merkle-tree" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate.git#28b1f79abedbad2ec97b49277b36e1f797ca9e5d" +dependencies = [ + "hash-db 0.16.0", +] + [[package]] name = "bit-vec" version = "0.6.3" @@ -487,20 +495,7 @@ dependencies = [ [[package]] name = "common-primitives" version = "0.1.0" -source = "git+https://github.com/integritee-network/pallets.git?branch=polkadot-v0.9.42#5c52182eb3a5156e8d9f69c10ca1441214ee6662" -dependencies = [ - "derive_more", - "parity-scale-codec", - "scale-info", - "sp-core", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "common-primitives" -version = "0.1.0" -source = "git+https://github.com/integritee-network/pallets#5c52182eb3a5156e8d9f69c10ca1441214ee6662" +source = "git+https://github.com/integritee-network/pallets?branch=polkadot-v0.9.42#5c52182eb3a5156e8d9f69c10ca1441214ee6662" dependencies = [ "derive_more", "parity-scale-codec", @@ -721,9 +716,9 @@ dependencies = [ [[package]] name = "enclave-bridge-primitives" version = "0.1.0" -source = "git+https://github.com/integritee-network/pallets.git?branch=polkadot-v0.9.42#5c52182eb3a5156e8d9f69c10ca1441214ee6662" +source = "git+https://github.com/integritee-network/pallets?branch=polkadot-v0.9.42#5c52182eb3a5156e8d9f69c10ca1441214ee6662" dependencies = [ - "common-primitives 0.1.0 (git+https://github.com/integritee-network/pallets.git?branch=polkadot-v0.9.42)", + "common-primitives", "log", "parity-scale-codec", "scale-info", @@ -812,7 +807,7 @@ dependencies = [ "sp-core", "sp-runtime", "sp-std", - "teerex-primitives 0.1.0 (git+https://github.com/integritee-network/pallets)", + "teerex-primitives", "webpki", ] @@ -1660,6 +1655,7 @@ dependencies = [ name = "ita-stf" version = "0.9.0" dependencies = [ + "binary-merkle-tree 4.0.0-dev (git+https://github.com/paritytech/substrate.git)", "derive_more", "frame-support", "frame-system", @@ -1680,8 +1676,11 @@ dependencies = [ "pallet-sudo", "parity-scale-codec", "rlp", + "serde 1.0.164", + "serde_json 1.0.96", "sgx_tstd", "sha3 0.10.8", + "simplyr-lib", "sp-application-crypto", "sp-core", "sp-io", @@ -1775,7 +1774,7 @@ dependencies = [ name = "itc-parentchain-indirect-calls-executor" version = "0.9.0" dependencies = [ - "binary-merkle-tree", + "binary-merkle-tree 4.0.0-dev (git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42)", "bs58", "futures 0.3.8", "ita-stf", @@ -2350,7 +2349,7 @@ dependencies = [ "sp-core", "sp-runtime", "sp-std", - "teerex-primitives 0.1.0 (git+https://github.com/integritee-network/pallets.git?branch=polkadot-v0.9.42)", + "teerex-primitives", ] [[package]] @@ -2623,6 +2622,12 @@ version = "0.2.146" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f92be4933c13fd498862a9e02a3055f8a8d9c039ce33db97306fd5a6caa7f29b" +[[package]] +name = "libm" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7012b1bbb0719e1097c47611d3898568c546d597c2e74d66f6087edd5233ff4" + [[package]] name = "libsecp256k1" version = "0.7.1" @@ -3012,7 +3017,7 @@ dependencies = [ [[package]] name = "pallet-parentchain" version = "0.9.0" -source = "git+https://github.com/integritee-network/pallets.git?branch=polkadot-v0.9.42#5c52182eb3a5156e8d9f69c10ca1441214ee6662" +source = "git+https://github.com/integritee-network/pallets?branch=polkadot-v0.9.42#5c52182eb3a5156e8d9f69c10ca1441214ee6662" dependencies = [ "frame-support", "frame-system", @@ -4014,6 +4019,17 @@ dependencies = [ "rand_core 0.6.4", ] +[[package]] +name = "simplyr-lib" +version = "0.1.0" +source = "git+https://github.com/BESTenergytrade/simplyr-lib.git?branch=cI/usize#ec8e1266141112a75b304cecfa2da35bfdde215c" +dependencies = [ + "libm", + "parity-scale-codec", + "serde 1.0.164", + "serde_json 1.0.96", +] + [[package]] name = "slab" version = "0.4.2" @@ -4584,25 +4600,9 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "teerex-primitives" version = "0.1.0" -source = "git+https://github.com/integritee-network/pallets.git?branch=polkadot-v0.9.42#5c52182eb3a5156e8d9f69c10ca1441214ee6662" -dependencies = [ - "common-primitives 0.1.0 (git+https://github.com/integritee-network/pallets.git?branch=polkadot-v0.9.42)", - "derive_more", - "log", - "parity-scale-codec", - "scale-info", - "serde 1.0.164", - "sp-core", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "teerex-primitives" -version = "0.1.0" -source = "git+https://github.com/integritee-network/pallets#5c52182eb3a5156e8d9f69c10ca1441214ee6662" +source = "git+https://github.com/integritee-network/pallets?branch=polkadot-v0.9.42#5c52182eb3a5156e8d9f69c10ca1441214ee6662" dependencies = [ - "common-primitives 0.1.0 (git+https://github.com/integritee-network/pallets)", + "common-primitives", "derive_more", "log", "parity-scale-codec", From 2c4c5143ffef26754752ec94879859fb7b5f69d1 Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Sat, 12 Aug 2023 16:42:12 +0200 Subject: [PATCH 10/11] fix merge error --- sidechain/state/src/impls.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/sidechain/state/src/impls.rs b/sidechain/state/src/impls.rs index 10635b3bb4..669d4d3b2a 100644 --- a/sidechain/state/src/impls.rs +++ b/sidechain/state/src/impls.rs @@ -17,8 +17,6 @@ //! Implement the sidechain state traits. -use core::fmt::Debug; - use crate::{Error, SidechainState, StateUpdate}; use codec::{Decode, Encode}; use core::fmt::Debug; From 772064c34e7d5a933d1cfe9faffd6e048072d995 Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Mon, 14 Aug 2023 10:49:13 +0200 Subject: [PATCH 11/11] hotfix skip-ra with dcap --- enclave-runtime/src/attestation.rs | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/enclave-runtime/src/attestation.rs b/enclave-runtime/src/attestation.rs index 7a63b7e0a8..f45fecbded 100644 --- a/enclave-runtime/src/attestation.rs +++ b/enclave-runtime/src/attestation.rs @@ -193,16 +193,19 @@ pub fn generate_dcap_ra_extrinsic_internal( ) -> EnclaveResult { let attestation_handler = GLOBAL_ATTESTATION_HANDLER_COMPONENT.get()?; - let (_priv_key_der, _cert_der, dcap_quote) = attestation_handler.generate_dcap_ra_cert( - quoting_enclave_target_info, - quote_size, - skip_ra, - )?; - if !skip_ra { + let (_priv_key_der, _cert_der, dcap_quote) = attestation_handler.generate_dcap_ra_cert( + quoting_enclave_target_info, + quote_size, + skip_ra, + )?; + generate_dcap_ra_extrinsic_from_quote_internal(url, &dcap_quote) } else { - generate_dcap_skip_ra_extrinsic_from_quote_internal(url, &dcap_quote) + generate_dcap_skip_ra_extrinsic_from_mr_enclave( + url, + &attestation_handler.get_mrenclave()?.encode(), + ) } } @@ -304,7 +307,7 @@ pub fn generate_dcap_ra_extrinsic_from_quote_internal( create_extrinsics(call) } -pub fn generate_dcap_skip_ra_extrinsic_from_quote_internal( +pub fn generate_dcap_skip_ra_extrinsic_from_mr_enclave( url: String, quote: &[u8], ) -> EnclaveResult {