From ec200d21bfa37b8a7b7c6b49b97fe5e1cec7f458 Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Mon, 7 Jun 2021 09:01:39 +0200 Subject: [PATCH 1/4] move substratee-node-primitives to primitives/node --- Cargo.toml | 2 +- enclave/Cargo.toml | 2 +- {substratee-node-primitives => primitives/node}/Cargo.toml | 0 {substratee-node-primitives => primitives/node}/src/lib.rs | 0 worker/Cargo.toml | 2 +- 5 files changed, 3 insertions(+), 3 deletions(-) rename {substratee-node-primitives => primitives/node}/Cargo.toml (100%) rename {substratee-node-primitives => primitives/node}/src/lib.rs (100%) diff --git a/Cargo.toml b/Cargo.toml index abdf265f2e..2a5cab0f6c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ members = [ "primitives/settings", "worker", "worker/worker-api", - "substratee-node-primitives", + "primitives/node", "substratee-worker-primitives", "client", "stf", diff --git a/enclave/Cargo.toml b/enclave/Cargo.toml index 418048b4a1..6f0ac44011 100644 --- a/enclave/Cargo.toml +++ b/enclave/Cargo.toml @@ -144,7 +144,7 @@ git = "https://github.com/scs/sgx-runtime" default-features = false [dependencies.substratee-node-primitives] -path = "../substratee-node-primitives" +path = "../primitives/node" default-features = false features = ["sgx"] diff --git a/substratee-node-primitives/Cargo.toml b/primitives/node/Cargo.toml similarity index 100% rename from substratee-node-primitives/Cargo.toml rename to primitives/node/Cargo.toml diff --git a/substratee-node-primitives/src/lib.rs b/primitives/node/src/lib.rs similarity index 100% rename from substratee-node-primitives/src/lib.rs rename to primitives/node/src/lib.rs diff --git a/worker/Cargo.toml b/worker/Cargo.toml index 596dd7a52f..b2035844c6 100644 --- a/worker/Cargo.toml +++ b/worker/Cargo.toml @@ -41,7 +41,7 @@ substratee-settings = { path = "../primitives/settings" } git = "https://github.com/scs/substrate-api-client" [dependencies.substratee-node-primitives] -path = "../substratee-node-primitives" +path = "../primitives/node" [dependencies.substratee-worker-primitives] path = "../substratee-worker-primitives" From 7517a7175d1dddced065b3dc0709d4fb05fce260 Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Mon, 7 Jun 2021 10:43:09 +0200 Subject: [PATCH 2/4] move substratee-worker-primitives to primitives/worker --- Cargo.toml | 2 +- Makefile | 2 +- client/Cargo.toml | 2 +- enclave/Cargo.toml | 2 +- {substratee-worker-primitives => primitives/worker}/Cargo.toml | 0 .../worker}/src/block.rs | 0 {substratee-worker-primitives => primitives/worker}/src/lib.rs | 0 stf/Cargo.toml | 2 +- worker/Cargo.toml | 2 +- worker/worker-api/Cargo.toml | 2 +- 10 files changed, 7 insertions(+), 7 deletions(-) rename {substratee-worker-primitives => primitives/worker}/Cargo.toml (100%) rename {substratee-worker-primitives => primitives/worker}/src/block.rs (100%) rename {substratee-worker-primitives => primitives/worker}/src/lib.rs (100%) diff --git a/Cargo.toml b/Cargo.toml index 2a5cab0f6c..6c4081b0ad 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ members = [ "worker", "worker/worker-api", "primitives/node", - "substratee-worker-primitives", + "primitives/worker", "client", "stf", # "enclave", diff --git a/Makefile b/Makefile index 43fcf06483..29dd9fb675 100755 --- a/Makefile +++ b/Makefile @@ -17,7 +17,7 @@ include UpdateRustSGXSDK.mk ######## SGX SDK Settings ######## SGX_SDK ?= /opt/intel/sgxsdk -SGX_MODE ?= HW +SGX_MODE ?= SW SGX_ARCH ?= x64 SGX_DEBUG ?= 0 SGX_PRERELEASE ?= 0 diff --git a/client/Cargo.toml b/client/Cargo.toml index e90115e70f..3e709da226 100644 --- a/client/Cargo.toml +++ b/client/Cargo.toml @@ -61,7 +61,7 @@ git = "https://github.com/scs/substraTEE-node" package = "substratee-node-runtime" [dependencies.substratee-worker-primitives] -path = "../substratee-worker-primitives" +path = "../primitives/worker" [dependencies.substratee-stf] path = "../stf" diff --git a/enclave/Cargo.toml b/enclave/Cargo.toml index 6f0ac44011..cb79fe4475 100644 --- a/enclave/Cargo.toml +++ b/enclave/Cargo.toml @@ -149,7 +149,7 @@ default-features = false features = ["sgx"] [dependencies.substratee-worker-primitives] -path = "../substratee-worker-primitives" +path = "../primitives/worker" default-features = false features = ["sgx"] diff --git a/substratee-worker-primitives/Cargo.toml b/primitives/worker/Cargo.toml similarity index 100% rename from substratee-worker-primitives/Cargo.toml rename to primitives/worker/Cargo.toml diff --git a/substratee-worker-primitives/src/block.rs b/primitives/worker/src/block.rs similarity index 100% rename from substratee-worker-primitives/src/block.rs rename to primitives/worker/src/block.rs diff --git a/substratee-worker-primitives/src/lib.rs b/primitives/worker/src/lib.rs similarity index 100% rename from substratee-worker-primitives/src/lib.rs rename to primitives/worker/src/lib.rs diff --git a/stf/Cargo.toml b/stf/Cargo.toml index 6a53241f60..44e41704f4 100644 --- a/stf/Cargo.toml +++ b/stf/Cargo.toml @@ -122,7 +122,7 @@ version = "3.0.0" optional = true [dependencies.substratee-worker-primitives] -path = "../substratee-worker-primitives" +path = "../primitives/worker" default-features = false features = ["sgx"] optional = true diff --git a/worker/Cargo.toml b/worker/Cargo.toml index b2035844c6..8d8d429b48 100644 --- a/worker/Cargo.toml +++ b/worker/Cargo.toml @@ -44,7 +44,7 @@ git = "https://github.com/scs/substrate-api-client" path = "../primitives/node" [dependencies.substratee-worker-primitives] -path = "../substratee-worker-primitives" +path = "../primitives/worker" [dependencies.substratee-worker-api] path = "worker-api" diff --git a/worker/worker-api/Cargo.toml b/worker/worker-api/Cargo.toml index bc67de07cd..34b0eb51dd 100644 --- a/worker/worker-api/Cargo.toml +++ b/worker/worker-api/Cargo.toml @@ -13,4 +13,4 @@ sgx_crypto_helper = { rev = "v1.1.3", git = "https://github.com/apache/teaclave- codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] } [dependencies.substratee-worker-primitives] -path = "../../substratee-worker-primitives" \ No newline at end of file +path = "../../primitives/worker" \ No newline at end of file From a4a16f0c7843130e52227dce459140c7b4fcefed Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Mon, 7 Jun 2021 10:50:28 +0200 Subject: [PATCH 3/4] remove bin2. It is no longer necessary. --- .gitignore | 8 -------- Makefile | 1 - bin2/README.md | 1 - 3 files changed, 10 deletions(-) delete mode 100644 bin2/README.md diff --git a/.gitignore b/.gitignore index 8842bbec28..523ec43723 100644 --- a/.gitignore +++ b/.gitignore @@ -11,7 +11,6 @@ bin/*.so bin/substratee-* bin/*.wasm -bin2/substratee-* # sealed data bin/*.bin @@ -54,13 +53,6 @@ bin/shards bin/*.der bin/enclave-shielding-pubkey.json -# in order to have 2 workers run and exchange keys -bin2/substratee-worker -bin2/*.bin -bin2/*.txt -bin2/shards -bin2/enclave-shielding-pubkey.json - # client client/my_keystore client/my_trusted_keystore diff --git a/Makefile b/Makefile index 29dd9fb675..aae9d45433 100755 --- a/Makefile +++ b/Makefile @@ -170,7 +170,6 @@ $(Worker_Name): $(Worker_Enclave_u_Object) $(Worker_SRC_Files) @cd worker && SGX_SDK=$(SGX_SDK) SGX_MODE=$(SGX_MODE) cargo build $(Worker_Rust_Flags) @echo "Cargo => $@" cp $(Worker_Rust_Path)/substratee-worker ./bin - cp $(Worker_Rust_Path)/substratee-worker ./bin2 ######## SubstraTEE-client objects ######## $(Client_Name): $(Client_SRC_Files) diff --git a/bin2/README.md b/bin2/README.md deleted file mode 100644 index 7049ab86b5..0000000000 --- a/bin2/README.md +++ /dev/null @@ -1 +0,0 @@ -2nd Output directory for the binaries in order to have a 2nd worker run locally and have its own keys From 779608b2de2b7629ea6646fa1f84d37ec125854e Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Mon, 7 Jun 2021 15:25:15 +0200 Subject: [PATCH 4/4] Revert `SGX_MODE=SW` and cleanup workspace file --- Cargo.toml | 6 +++--- Makefile | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 6c4081b0ad..0155b92785 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,12 +1,12 @@ [workspace] members = [ + "client", "primitives/settings", - "worker", - "worker/worker-api", "primitives/node", "primitives/worker", - "client", "stf", + "worker", + "worker/worker-api", # "enclave", ] diff --git a/Makefile b/Makefile index aae9d45433..3b78247cc3 100755 --- a/Makefile +++ b/Makefile @@ -17,7 +17,7 @@ include UpdateRustSGXSDK.mk ######## SGX SDK Settings ######## SGX_SDK ?= /opt/intel/sgxsdk -SGX_MODE ?= SW +SGX_MODE ?= HW SGX_ARCH ?= x64 SGX_DEBUG ?= 0 SGX_PRERELEASE ?= 0