From 35658086e4b0fbffaaf4213328b03b5793d9df61 Mon Sep 17 00:00:00 2001 From: Szilard Parrag Date: Wed, 17 May 2023 15:04:51 +0200 Subject: [PATCH 1/4] docker: add WORKER_FEATURES_ARG needed for DCAP --- build.Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build.Dockerfile b/build.Dockerfile index 214af47795..59f7928333 100644 --- a/build.Dockerfile +++ b/build.Dockerfile @@ -35,6 +35,9 @@ ENV CARGO_NET_GIT_FETCH_WITH_CLI true ARG SGX_MODE=SW ENV SGX_MODE=$SGX_MODE +ARG WORKER_FEATURES_ARG +ENV WORKER_FEATURES=$WORKER_FEATURES_ARG + ENV WORKHOME=/home/ubuntu/work ENV HOME=/home/ubuntu From 0afd94b8da4d3861005894ce40107012967aa5c5 Mon Sep 17 00:00:00 2001 From: Szilard Parrag Date: Wed, 17 May 2023 15:01:09 +0200 Subject: [PATCH 2/4] docker: fix LD_LIBRARY_PATH from aesmd service LD_LIBRARY_PATH must NOT contain the urts library of the aesmd_service, it will override the default one, which will result in a weird SGX enclave initialization errors. --- build.Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/build.Dockerfile b/build.Dockerfile index 59f7928333..1733d39876 100644 --- a/build.Dockerfile +++ b/build.Dockerfile @@ -68,6 +68,7 @@ RUN --mount=type=cache,id=cargo-registry,target=/opt/rust/registry \ ### The runner needs the aesmd service for the `SGX_MODE=HW`. ###################################################### FROM oasisprotocol/aesmd:master AS runner +ENV LD_LIBRARY_PATH "${SGX_SDK}/sdk_libs" ### Deployed CLI client ################################################## From a2d31c81d8dfbfc288fc8946344e65ee2462c941 Mon Sep 17 00:00:00 2001 From: Szilard Parrag Date: Wed, 17 May 2023 15:03:33 +0200 Subject: [PATCH 3/4] service/main: follow-up for send_extrinsic signature changes in DCAP only methods --- service/src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/service/src/main.rs b/service/src/main.rs index 7acf39ec9e..b831d63654 100644 --- a/service/src/main.rs +++ b/service/src/main.rs @@ -765,10 +765,10 @@ fn register_collateral( let (fmspc, _tcb_info) = extract_tcb_info_from_raw_dcap_quote(&dcap_quote).unwrap(); let uxt = enclave.generate_register_quoting_enclave_extrinsic(fmspc).unwrap(); - send_extrinsic(&uxt, api, accountid, is_development_mode); + send_extrinsic(uxt, api, accountid, is_development_mode); let uxt = enclave.generate_register_tcb_info_extrinsic(fmspc).unwrap(); - send_extrinsic(&uxt, api, accountid, is_development_mode); + send_extrinsic(uxt, api, accountid, is_development_mode); } } From 2bfdf780594e44b43646ec17cf9d8a88cb30fa2d Mon Sep 17 00:00:00 2001 From: Szilard Parrag Date: Wed, 17 May 2023 15:26:44 +0200 Subject: [PATCH 4/4] fixup! docker: fix LD_LIBRARY_PATH from aesmd service --- build.Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build.Dockerfile b/build.Dockerfile index 1733d39876..cbb3525056 100644 --- a/build.Dockerfile +++ b/build.Dockerfile @@ -60,7 +60,7 @@ WORKDIR $WORKHOME/worker COPY . . RUN --mount=type=cache,id=cargo-registry,target=/opt/rust/registry \ - --mount=type=cache,id=cargo-git,target=/opt/rust/git/db \ + --mount=type=cache,id=cargo-git,target=/opt/rust/git/db \ --mount=type=cache,id=cargo-sccache-${WORKER_MODE}${ADDITIONAL_FEATURES},target=/home/ubuntu/.cache/sccache \ echo ${FINGERPRINT} && make && cargo test --release && sccache --show-stats @@ -68,6 +68,7 @@ RUN --mount=type=cache,id=cargo-registry,target=/opt/rust/registry \ ### The runner needs the aesmd service for the `SGX_MODE=HW`. ###################################################### FROM oasisprotocol/aesmd:master AS runner +ENV SGX_SDK /opt/sgxsdk ENV LD_LIBRARY_PATH "${SGX_SDK}/sdk_libs" ### Deployed CLI client