From 5636416a92beab179264ce72a2ad9d1f3bbf040d Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Wed, 2 Jun 2021 05:17:49 +0200 Subject: [PATCH 01/80] [worker/rpc] small cleanup --- Cargo.toml | 5 ++++ worker/rpc/Cargo.toml | 23 ++++++++++++++++ worker/rpc/src/lib.rs | 44 +++++++++++++++++++++++++++++++ worker/rpc/src/tests.rs | 58 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 130 insertions(+) create mode 100644 worker/rpc/Cargo.toml create mode 100644 worker/rpc/src/lib.rs create mode 100644 worker/rpc/src/tests.rs diff --git a/Cargo.toml b/Cargo.toml index 1f1aa586cf..5b0e2f0cb6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,4 +1,8 @@ +# this can be removed when the enclave's toolchain is > rustc 1.50 +cargo-features = ["resolver"] + [workspace] +resolver = "2" members = [ "client", "primitives/api-client-extensions", @@ -8,6 +12,7 @@ members = [ "stf", "worker", "worker/worker-api", + "worker/rpc", # "enclave", ] diff --git a/worker/rpc/Cargo.toml b/worker/rpc/Cargo.toml new file mode 100644 index 0000000000..df0197a8de --- /dev/null +++ b/worker/rpc/Cargo.toml @@ -0,0 +1,23 @@ +[package] +name = "substratee-worker-rpc" +version = "0.8.0" +authors = ["Supercomputing Systems AG "] +edition = "2018" +resolver = "2" + +[dependencies] +anyhow = "1.0.40" +log = "0.4.14" +jsonrpsee = { version = "0.2.0-alpha.7", features = ["server"] } +serde_json = "1.0.64" +tokio = { version = "1.6.1", features = ["full"] } + +[features] +default = ["std"] +std = [] + +[dev-dependencies] +env_logger = { version = "*" } +soketto = "0.5.0" +futures-util = { version = "*" } +tokio-util = { version = "0.6", features = ["compat"] } \ No newline at end of file diff --git a/worker/rpc/src/lib.rs b/worker/rpc/src/lib.rs new file mode 100644 index 0000000000..6c722d3385 --- /dev/null +++ b/worker/rpc/src/lib.rs @@ -0,0 +1,44 @@ +/* + Copyright 2019 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 std::net::{SocketAddr}; + +use log::debug; + +use jsonrpsee::ws_server::{WsServer}; +use tokio::net::ToSocketAddrs; + +#[cfg(test)] +mod tests; + +pub async fn run_server(addr: impl ToSocketAddrs) -> anyhow::Result { + let mut server = WsServer::new(addr).await?; + + server.register_method("author_importBlock", |params| { + debug!("author_importBlock params: {:?}", params); + Ok("Hello") + })?; + + server.register_method("enclave_directRequest", |params| { + debug!("enclave_directRequest params: {:?}", params); + Ok("Hello") + })?; + + let socket_addr = server.local_addr()?; + tokio::spawn(async move { server.start().await }); + Ok(socket_addr) +} \ No newline at end of file diff --git a/worker/rpc/src/tests.rs b/worker/rpc/src/tests.rs new file mode 100644 index 0000000000..8ea6b0300a --- /dev/null +++ b/worker/rpc/src/tests.rs @@ -0,0 +1,58 @@ +use log::info; + +use super::*; +use soketto::handshake; +use serde_json::Value as JsonValue; +use tokio_util::compat::{Compat, TokioAsyncReadCompatExt}; +use futures_util::io::{BufReader, BufWriter}; +use tokio::net::TcpStream; + +fn init() { + let _ = env_logger::builder().is_test(true).try_init(); +} + +struct WsTestClient { + tx: soketto::Sender>>>, + rx: soketto::Receiver>>>, +} + +type Error = Box; + +impl WsTestClient { + pub async fn new(url: SocketAddr) -> Result { + let socket = TcpStream::connect(url).await?; + let mut client = handshake::Client::new(BufReader::new(BufWriter::new(socket.compat())), "test-client", "/"); + match client.handshake().await { + Ok(handshake::ServerResponse::Accepted { .. }) => { + let (tx, rx) = client.into_builder().finish(); + Ok(Self { tx, rx }) + } + r => Err(format!("WebSocketHandshake failed: {:?}", r).into()), + } + } + + pub async fn send_request_text(&mut self, msg: impl AsRef) -> Result { + self.tx.send_text(msg).await?; + self.tx.flush().await?; + let mut data = Vec::new(); + self.rx.receive_data(&mut data).await?; + String::from_utf8(data).map_err(Into::into) + } +} + +pub fn ok_response(result: JsonValue, id: u32) -> String { + format!(r#"{{"jsonrpc":"2.0","result":{},"id":{}}}"#, result, id) +} + +#[tokio::test] +async fn test_client_calls() { + init(); + let addr = run_server("127.0.0.1:0").await.unwrap(); + info!("ServerAddress: {:?}", addr); + + let mut client = WsTestClient::new(addr).await.unwrap(); + + let req = format!(r#"{{"jsonrpc":"2.0","method":"author_importBlock","id":{}}}"#, 1); + let res = client.send_request_text(req).await.unwrap(); + assert_eq!(res, ok_response(JsonValue::String("Hello".into()), 1)); +} \ No newline at end of file From f5aad7f8260cca374d705b6c7375402f55f203a2 Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Fri, 4 Jun 2021 16:55:51 +0200 Subject: [PATCH 02/80] refactor: move worker-api to rpc/client. move rpc to rpc/server --- Cargo.toml | 4 ++-- client/Cargo.toml | 2 +- local-setup/launch.py | 4 ++-- .../py/__pycache__/__init__.cpython-36.pyc | Bin 0 -> 139 bytes .../py/__pycache__/helpers.cpython-36.pyc | Bin 0 -> 2302 bytes local-setup/py/__pycache__/worker.cpython-36.pyc | Bin 0 -> 5894 bytes worker/Cargo.toml | 2 +- worker/{worker-api => rpc/client}/Cargo.toml | 0 .../client}/src/direct_client.rs | 0 worker/{worker-api => rpc/client}/src/lib.rs | 0 worker/rpc/{ => server}/Cargo.toml | 0 worker/rpc/{ => server}/src/lib.rs | 0 worker/rpc/{ => server}/src/tests.rs | 0 13 files changed, 6 insertions(+), 6 deletions(-) create mode 100644 local-setup/py/__pycache__/__init__.cpython-36.pyc create mode 100644 local-setup/py/__pycache__/helpers.cpython-36.pyc create mode 100644 local-setup/py/__pycache__/worker.cpython-36.pyc rename worker/{worker-api => rpc/client}/Cargo.toml (100%) rename worker/{worker-api => rpc/client}/src/direct_client.rs (100%) rename worker/{worker-api => rpc/client}/src/lib.rs (100%) rename worker/rpc/{ => server}/Cargo.toml (100%) rename worker/rpc/{ => server}/src/lib.rs (100%) rename worker/rpc/{ => server}/src/tests.rs (100%) diff --git a/Cargo.toml b/Cargo.toml index 5b0e2f0cb6..4342b0e66f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,8 +11,8 @@ members = [ "primitives/worker", "stf", "worker", - "worker/worker-api", - "worker/rpc", + "worker/rpc/client", + "worker/rpc/server", # "enclave", ] diff --git a/client/Cargo.toml b/client/Cargo.toml index 8b64ce09c8..418bdc68c0 100644 --- a/client/Cargo.toml +++ b/client/Cargo.toml @@ -80,7 +80,7 @@ path = "../primitives/api-client-extensions" path = "../stf" [dependencies.substratee-worker-api] -path = "../worker/worker-api" +path = "../worker/rpc/client" [dependencies.sp-keyring] git = "https://github.com/paritytech/substrate.git" diff --git a/local-setup/launch.py b/local-setup/launch.py index 28e563596e..8f27dae385 100755 --- a/local-setup/launch.py +++ b/local-setup/launch.py @@ -39,9 +39,9 @@ def main(processes): w2 = setup_worker(w2_working_dir, worker2_log) print('Starting worker 1 in background') - processes.append(w1.run_in_background(log_file=worker1_log, flags=['-P', '2001'], subcommand_flags=['--skip-ra'])) + processes.append(w1.run_in_background(log_file=worker1_log, flags=['-P', '2001'])) print('Starting worker 2 in background') - processes.append(w2.run_in_background(log_file=worker2_log, subcommand_flags=['--skip-ra'])) + processes.append(w2.run_in_background(log_file=worker2_log)) # keep script alive until terminated signal.pause() diff --git a/local-setup/py/__pycache__/__init__.cpython-36.pyc b/local-setup/py/__pycache__/__init__.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e7e03581cfba45513dbb6f693cbce7c3c96baa09 GIT binary patch literal 139 zcmXr!<>dl5Z}E&_Qg%oL`8)PXb&i;MvaZc1E^G0QCn3NB1lcDz)96{xm_pcobRr? z=d?D?3y##j^nvG=55Q;Oo9ru3e1$ymo3)d)DVOZ*?A`9n&TnRZ{(5Ptwe|AvU-uh~ z{lngPux7V0^zRUY37)fPHuH$vwG%mZb|V+FlY0X{@&}Em!I@Z=zTmPc8$I_DdrJ?5 z_u3V{XdL>{f(&FJny(!Zh=oHhYKfLOcgUi1_nBA}ONUG>O`T{_@D0{J|1a*r*4vKp z9~D_y80W!HM^2~Pc1=Uqq8!$CmP#2neJWCqw&S6hV!4B%FGJL<&nIlcC+@@%{H51- z`mS)MyzfmJ{J7)q!Y!3ll~iG(%3&cwJ>0HTnM$q0dN--VB+tvII!wZxUhPY@U1}Mo zcpbJ~<-><+k|4KZe^~d{zHR%ab!x`AYFOBfrXgfn3Tb>@tE_5!#!J+Wo*AL@*3w^0 zEkQr}rdw8ZSMMfDiZ0CIOtN|J-rCbr?McIgHzCqqjp|)!$X}{tQcDyk)p6DfvpN(dinb{0P(DMP9pex7@Nw*{Re+Eh zPAx#Rx$&x`-km{tf~RTP-Enn^ZaeSH522?RCl7^l8^fkpGNR$gk#64u)w+FOIGGbQ zs3$?8P1}tu0=-fnn&tZ{No8-C|B&UmRHm`<;QoX4P1D4@dGFzmCyh?dT?~ucmr#J) zoHP5*)Zxc#cfw|CFe!^YLEOpL!E+6&;v`oeXP%aM zPkn;-XF&<#I4f{GCce?chK#S^Z~Xq-!E}!IrF3z62&oo^4Pp~Y4Zb4U?>iHI3H(G1 zg?FHR&YoSvd-pDTeEGl~Elz;vlySDjo?PXaIr|0L&lp>*_WQusvKxi#t&cCX9)h>B zeJR4<4p1```S{|UTqXr^4Os6a)Q+N(Y&VUMiYxGI)hpE?sZDcsN?Qnww}<=~SC6#u z2)nkYKE<)fqBJ222HMy$ZV1_8z8%5iU|3luz&&ud{Ll4FY4a6&(JsFUD2z&La+M$Gu)G`ckzgInB=t)40Eo~_@Vo`cefow3_<$F*L~rtfZCAA3D- z+~_sN&0Z62HC~Tb#;sm!yxLnGw|i~d`rP6kZ=71Z@yzM1ar>dwX?}-wti6s?)*qx3 zk(A!U{m;JmYQN)_^{=MHoN~t>D>R~I~#rRWnJcpuk!vxrlC-(yr@K$PyC}) z9!AN~=aDQM<3kkwB&6x5R}+`ZIt$ji>Gr^ z!_(!|Qq$^ng1=!_$NCuOMklog-&nI%Ic4u!ia8Bngdk|zJmZdBk ziK?A}ekMg6WYH5rpANvw0ZSzd6bt$)jq^;f3C1lfLerw#E|qlA5`Yc^W<;2!@|dNA zg*DEMoXctV!TqIawV47H58dAu_<$v zO?i#e^iZ(@m>Wc~P)mGczO!^19cnHg2?^=Uq^1~@i)qq4o8*|jqApH{L&3XjFU`a* zJ0K9C#{r8Ji;_$v+>j1F@+3@?K{U)|(2u{Lfr>%B@+y-r=O0opK! zIFjqA$qV$_^2bsnVH`XWoqAbQA|A*#eWlLxet);*CK~?z!A?5KcGL(w@u~UEA-@x+ zVG!TZE^B9UykpSaog9}<-;a_g^ZixKqFQ)ZS3J9Ed$#8k7anQj?N0l2?6O_qP(vXk z20%#q)su~`a-Li{~iniJ3kQ_B#RL;D{Pw=ux4A(?~Aoz~QH6jpY{TT+K^r++x zh;)n3*@IjT0rvnl#QPQY2a$wf1PQ?-%Az2S3Uncei{wcp(_}0Xd>Q*=H} zC&y&xm5~}Ff-Sye|9hRrTrg!_Lswn_16ti^AcD#ot=zGV#Lft-rF9v`B1rCFoYAM# zfXpboV)uVQC@P0XB1z310_-Cp z|Af#AL2b@Ple9=WLLz3!tDvSdoDsfxxp5?;O!z7qCIaC$@0XiZ%P0~tr*MqM^F<^H zoga{FC@@=)N*ljobwM&qsP@oFqk0#W6I-<*0qdFdRAc%CV3OMubbxX|iUaFI=Zclp z9@hy@xEtJkUIUKM0n`y0X_`IN8&V|WIh+MfOU}c zx%8TD; z0w5<%E>uH$50$9^uSM`gM+WTzkUB=HyH76fU1+AP zM+wrTa#c@n(4l=H!l#awgo++uK$!*{9%928jK~}4@c_4?{?-b`0kV+|SP3G$Q@mY4 z^W zGT{9-<}J4j%gbH9$Dd!r0D)VPrzU@nIM=TD($mbaPxe9h*Yy7smGj&=h{o=WkezH~ z?qlpN;L7o?u}=Isd&SNDsfH`Jt=GZcDMchjcsLs#4zaxD6qgqHGsp92w8 z(*@G6ER#OV375=%7V>C^K?Xs%LO`=AtWi)ihTWWoc*uDNJtZZ=i7ufMTRW;bOmO&tV~*zt%5YI8 z-*lfN@FKVT6Z)I=)SUqlD7S`TSMSdH9BBdmmg#a>~H{y611r02DMFjL-c}h-%)+tAMk$vRElh+Yj7u_XZA-FFwGZh* z{4MaTxu?uS(rE>qAt(x=O~)wq#`b!xxzcR3+PE(_z1B+GYc`rL{jRR*F`ac|*j<|B zEqah@4SQa8OghmV8XAbhUSlL;oE9qMXz94ZY|@E@^JpuZzc51lC52**K1xcONV~S2 GE%!g4Kb?XA literal 0 HcmV?d00001 diff --git a/worker/Cargo.toml b/worker/Cargo.toml index 610e58f4ab..6d157c993f 100644 --- a/worker/Cargo.toml +++ b/worker/Cargo.toml @@ -51,7 +51,7 @@ path = "../primitives/worker" path = "../primitives/api-client-extensions" [dependencies.substratee-worker-api] -path = "worker-api" +path = "rpc/client" [dependencies.my-node-runtime] git = "https://github.com/scs/substraTEE-node" diff --git a/worker/worker-api/Cargo.toml b/worker/rpc/client/Cargo.toml similarity index 100% rename from worker/worker-api/Cargo.toml rename to worker/rpc/client/Cargo.toml diff --git a/worker/worker-api/src/direct_client.rs b/worker/rpc/client/src/direct_client.rs similarity index 100% rename from worker/worker-api/src/direct_client.rs rename to worker/rpc/client/src/direct_client.rs diff --git a/worker/worker-api/src/lib.rs b/worker/rpc/client/src/lib.rs similarity index 100% rename from worker/worker-api/src/lib.rs rename to worker/rpc/client/src/lib.rs diff --git a/worker/rpc/Cargo.toml b/worker/rpc/server/Cargo.toml similarity index 100% rename from worker/rpc/Cargo.toml rename to worker/rpc/server/Cargo.toml diff --git a/worker/rpc/src/lib.rs b/worker/rpc/server/src/lib.rs similarity index 100% rename from worker/rpc/src/lib.rs rename to worker/rpc/server/src/lib.rs diff --git a/worker/rpc/src/tests.rs b/worker/rpc/server/src/tests.rs similarity index 100% rename from worker/rpc/src/tests.rs rename to worker/rpc/server/src/tests.rs From 11ec0a08da654a20bbc0baea9ffdffa684597609 Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Mon, 7 Jun 2021 15:43:44 +0200 Subject: [PATCH 03/80] fix path after rebase --- worker/rpc/client/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worker/rpc/client/Cargo.toml b/worker/rpc/client/Cargo.toml index 34b0eb51dd..3747f48099 100644 --- a/worker/rpc/client/Cargo.toml +++ b/worker/rpc/client/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 = "../../primitives/worker" \ No newline at end of file +path = "../../../primitives/worker" \ No newline at end of file From 17eca9111303da1944f80e7a8d441bae40e23a4e Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Wed, 9 Jun 2021 14:20:38 +0200 Subject: [PATCH 04/80] initial draft of worker struct --- Cargo.toml | 3 ++- Makefile | 2 +- primitives/enclave-api/Cargo.toml | 7 +++++++ primitives/enclave-api/src/lib.rs | 9 +++++++++ worker/Cargo.toml | 7 +++++++ worker/rpc/server/Cargo.toml | 4 +++- worker/rpc/server/src/lib.rs | 25 +++++++++++++++++++++---- worker/src/enclave/mod.rs | 2 +- worker/src/main.rs | 20 +++++++++++++++----- worker/src/worker.rs | 22 ++++++++++++++++++++++ 10 files changed, 88 insertions(+), 13 deletions(-) create mode 100644 primitives/enclave-api/Cargo.toml create mode 100644 primitives/enclave-api/src/lib.rs create mode 100644 worker/src/worker.rs diff --git a/Cargo.toml b/Cargo.toml index 4342b0e66f..78cf54d6a2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,8 +6,9 @@ resolver = "2" members = [ "client", "primitives/api-client-extensions", - "primitives/settings", + "primitives/enclave-api", "primitives/node", + "primitives/settings", "primitives/worker", "stf", "worker", diff --git a/Makefile b/Makefile index 3b78247cc3..aae9d45433 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/primitives/enclave-api/Cargo.toml b/primitives/enclave-api/Cargo.toml new file mode 100644 index 0000000000..e5510cc81c --- /dev/null +++ b/primitives/enclave-api/Cargo.toml @@ -0,0 +1,7 @@ +[package] +name = "substratee-enclave-api" +version = "0.8.0" +authors = ["clangenbacher "] +edition = "2018" + +[dependencies] diff --git a/primitives/enclave-api/src/lib.rs b/primitives/enclave-api/src/lib.rs new file mode 100644 index 0000000000..40fcd2d757 --- /dev/null +++ b/primitives/enclave-api/src/lib.rs @@ -0,0 +1,9 @@ +//! some definitions and traits that facilitate interaction with the enclave. + +pub struct Enclave; + +impl EnclaveApi for Enclave { + +} + +pub trait EnclaveApi {} \ No newline at end of file diff --git a/worker/Cargo.toml b/worker/Cargo.toml index 6d157c993f..44097a7cf3 100644 --- a/worker/Cargo.toml +++ b/worker/Cargo.toml @@ -14,6 +14,7 @@ base58 = "0.1" rust-crypto = "0.2" clap = { version = "2.33", features = [ "yaml" ] } lazy_static = "1.4.0" +parking_lot = "0.11.1" dirs = "1.0.2" serde = "1.0" @@ -53,6 +54,12 @@ path = "../primitives/api-client-extensions" [dependencies.substratee-worker-api] path = "rpc/client" +[dependencies.substratee-worker-rpc-server] +path = "rpc/server" + +[dependencies.substratee-enclave-api] +path = "../primitives/enclave-api" + [dependencies.my-node-runtime] git = "https://github.com/scs/substraTEE-node" branch = "master" diff --git a/worker/rpc/server/Cargo.toml b/worker/rpc/server/Cargo.toml index df0197a8de..8fe4b98caa 100644 --- a/worker/rpc/server/Cargo.toml +++ b/worker/rpc/server/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "substratee-worker-rpc" +name = "substratee-worker-rpc-server" version = "0.8.0" authors = ["Supercomputing Systems AG "] edition = "2018" @@ -12,6 +12,8 @@ jsonrpsee = { version = "0.2.0-alpha.7", features = ["server"] } serde_json = "1.0.64" tokio = { version = "1.6.1", features = ["full"] } +substratee-enclave-api = { path = "../../../primitives/enclave-api" } + [features] default = ["std"] std = [] diff --git a/worker/rpc/server/src/lib.rs b/worker/rpc/server/src/lib.rs index 6c722d3385..62e73e0798 100644 --- a/worker/rpc/server/src/lib.rs +++ b/worker/rpc/server/src/lib.rs @@ -19,25 +19,42 @@ use std::net::{SocketAddr}; use log::debug; -use jsonrpsee::ws_server::{WsServer}; +use jsonrpsee:: ws_server::{RpcModule, WsServerBuilder}; use tokio::net::ToSocketAddrs; +use substratee_enclave_api::EnclaveApi; +use std::marker::PhantomData; + #[cfg(test)] mod tests; +pub struct RpcServer{ + _enclave: PhantomData +} + +impl ServerApi for RpcServer { + +} + +pub trait ServerApi {} + + pub async fn run_server(addr: impl ToSocketAddrs) -> anyhow::Result { - let mut server = WsServer::new(addr).await?; + let mut server = WsServerBuilder::default().build(addr).await?; + let mut module = RpcModule::new(()); - server.register_method("author_importBlock", |params| { + module.register_method("author_importBlock", |params, _| { debug!("author_importBlock params: {:?}", params); Ok("Hello") })?; - server.register_method("enclave_directRequest", |params| { + module.register_method("enclave_directRequest", |params, _| { debug!("enclave_directRequest params: {:?}", params); Ok("Hello") })?; + server.register_module(module).unwrap(); + let socket_addr = server.local_addr()?; tokio::spawn(async move { server.start().await }); Ok(socket_addr) diff --git a/worker/src/enclave/mod.rs b/worker/src/enclave/mod.rs index 6d53fba9da..942e1cdc97 100644 --- a/worker/src/enclave/mod.rs +++ b/worker/src/enclave/mod.rs @@ -1,4 +1,4 @@ pub mod api; pub mod attestation_ocalls; pub mod tls_ra; -pub mod worker_api_direct_server; +pub mod worker_api_direct_server; \ No newline at end of file diff --git a/worker/src/main.rs b/worker/src/main.rs index 32860e513e..ca6a493cae 100644 --- a/worker/src/main.rs +++ b/worker/src/main.rs @@ -36,6 +36,7 @@ use log::*; use my_node_runtime::{ substratee_registry::ShardIdentifier, Event, Hash, Header, UncheckedExtrinsic }; +use parking_lot::RwLock; use sp_core::{ crypto::{AccountId32, Ss58Codec}, sr25519, @@ -57,7 +58,10 @@ use std::time::{Duration, SystemTime}; use substratee_api_client_extensions::{AccountApi, ChainApi}; use substratee_worker_primitives::block::SignedBlock as SignedSidechainBlock; +use substratee_enclave_api::{Enclave, EnclaveApi}; +use substratee_worker_rpc_server::{RpcServer}; use substratee_node_primitives::SignedBlock; + use config::Config; use utils::extract_shard; @@ -66,11 +70,14 @@ use substratee_settings::files::{ RA_SPID_FILE, RA_API_KEY_FILE, SHARDS_PATH, ENCRYPTED_STATE_FILE }; +use worker::{Worker as WorkerGen}; + mod enclave; mod ipfs; mod tests; mod config; mod utils; +mod worker; /// how many blocks will be synced before storing the chain db to disk const BLOCK_SYNC_BATCH_SIZE: u32 = 1000; @@ -78,6 +85,14 @@ const VERSION: &str = env!("CARGO_PKG_VERSION"); /// start block production every ... ms const BLOCK_PRODUCTION_INTERVAL: u64 = 1000; +type Worker = WorkerGen, Enclave, RpcServer>; + +lazy_static! { + // todo: replace with &str, but use &str in api-client first + static ref NODE_URL: Mutex = Mutex::new("".to_string()); + static ref WORKER: RwLock> = RwLock::new(None); +} + fn main() { // Setup logging env_logger::init(); @@ -631,11 +646,6 @@ pub fn check_files() { } } -lazy_static! { - // todo: replace with &str, but use &str in api-client first - static ref NODE_URL: Mutex = Mutex::new("".to_string()); -} - /// # Safety /// /// FFI are always unsafe diff --git a/worker/src/worker.rs b/worker/src/worker.rs new file mode 100644 index 0000000000..4791fff9ea --- /dev/null +++ b/worker/src/worker.rs @@ -0,0 +1,22 @@ +use substratee_api_client_extensions::{SubstrateeRegistryApi, AccountApi, ChainApi}; + +use substratee_enclave_api::EnclaveApi; +use substratee_worker_rpc_server::ServerApi; + + +pub struct Worker { + config: Config, + node_api: NodeApi, + enclave_api: Enclave, + server: Server, +} + +pub trait WorkerT +where + NodeApi: SubstrateeRegistryApi + AccountApi + ChainApi, + Enclave: EnclaveApi, + Server: ServerApi, +{ + + +} \ No newline at end of file From f833d65f9f4b48521e9e2553eb55d4e374b1e10a Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Wed, 9 Jun 2021 17:01:15 +0200 Subject: [PATCH 05/80] [worker] move hex_encode to utils --- worker/src/main.rs | 7 +------ worker/src/utils.rs | 8 +++++++- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/worker/src/main.rs b/worker/src/main.rs index ca6a493cae..2ca8a4d6a5 100644 --- a/worker/src/main.rs +++ b/worker/src/main.rs @@ -71,6 +71,7 @@ use substratee_settings::files::{ }; use worker::{Worker as WorkerGen}; +use crate::utils::hex_encode; mod enclave; mod ipfs; @@ -560,12 +561,6 @@ pub fn produce_blocks( curr_head.block.header } -fn hex_encode(data: Vec) -> String { - let mut hex_str = hex::encode(data); - hex_str.insert_str(0, "0x"); - hex_str -} - fn init_shard(shard: &ShardIdentifier) { let path = format!("{}/{}", SHARDS_PATH, shard.encode().to_base58()); println!("initializing shard at {}", path); diff --git a/worker/src/utils.rs b/worker/src/utils.rs index 0f00af5198..edf5642334 100644 --- a/worker/src/utils.rs +++ b/worker/src/utils.rs @@ -22,4 +22,10 @@ pub fn extract_shard(m: &ArgMatches<'_>) -> ShardIdentifier { ShardIdentifier::from_slice(&mrenclave[..]) } } -} \ No newline at end of file +} + +pub fn hex_encode(data: Vec) -> String { + let mut hex_str = hex::encode(data); + hex_str.insert_str(0, "0x"); + hex_str +} From 0c4d3e7360ad01a7a3451ad8cd77ca18b6ce0aa0 Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Wed, 9 Jun 2021 17:15:15 +0200 Subject: [PATCH 06/80] [worker] add error type add minimal implementation of Worker trait --- worker/Cargo.toml | 1 + worker/src/error.rs | 11 +++++++++ worker/src/main.rs | 3 ++- worker/src/worker.rs | 56 ++++++++++++++++++++++++++++++++++---------- 4 files changed, 58 insertions(+), 13 deletions(-) create mode 100644 worker/src/error.rs diff --git a/worker/Cargo.toml b/worker/Cargo.toml index 44097a7cf3..095027de27 100644 --- a/worker/Cargo.toml +++ b/worker/Cargo.toml @@ -15,6 +15,7 @@ rust-crypto = "0.2" clap = { version = "2.33", features = [ "yaml" ] } lazy_static = "1.4.0" parking_lot = "0.11.1" +thiserror = "1.0" dirs = "1.0.2" serde = "1.0" diff --git a/worker/src/error.rs b/worker/src/error.rs new file mode 100644 index 0000000000..d423641ed9 --- /dev/null +++ b/worker/src/error.rs @@ -0,0 +1,11 @@ +use codec::{Error as CodecError}; +use substrate_api_client::ApiClientError; + + +#[derive(Debug, thiserror::Error)] +pub enum Error { + #[error("{0}")] + Codec(#[from] CodecError), + #[error("{0}")] + ApiClientError(#[from] ApiClientError), +} \ No newline at end of file diff --git a/worker/src/main.rs b/worker/src/main.rs index 2ca8a4d6a5..d919f564ad 100644 --- a/worker/src/main.rs +++ b/worker/src/main.rs @@ -79,6 +79,7 @@ mod tests; mod config; mod utils; mod worker; +mod error; /// how many blocks will be synced before storing the chain db to disk const BLOCK_SYNC_BATCH_SIZE: u32 = 1000; @@ -86,7 +87,7 @@ const VERSION: &str = env!("CARGO_PKG_VERSION"); /// start block production every ... ms const BLOCK_PRODUCTION_INTERVAL: u64 = 1000; -type Worker = WorkerGen, Enclave, RpcServer>; +type Worker = WorkerGen, Enclave, DirectApi>; lazy_static! { // todo: replace with &str, but use &str in api-client first diff --git a/worker/src/worker.rs b/worker/src/worker.rs index 4791fff9ea..f0c463fb7b 100644 --- a/worker/src/worker.rs +++ b/worker/src/worker.rs @@ -1,22 +1,54 @@ -use substratee_api_client_extensions::{SubstrateeRegistryApi, AccountApi, ChainApi}; +use log::info; +use sp_core::sr25519; +use std::sync::Arc; +use std::sync::mpsc::channel; +use substrate_api_client::{Api, XtStatus}; +use substratee_api_client_extensions::SubstrateeRegistryApi; -use substratee_enclave_api::EnclaveApi; -use substratee_worker_rpc_server::ServerApi; +use substratee_worker_primitives::block::{SignedBlock as SignedSidechainBlock}; +use crate::error::Error; +use crate::utils::hex_encode; +use crate::config::Config; -pub struct Worker { +pub type WorkerResult = Result; + +pub struct Worker { config: Config, node_api: NodeApi, - enclave_api: Enclave, - server: Server, + _enclave_api: Enclave, + _worker_api_direct: Arc, +} + +pub trait Ocall { + fn send_confirmations(&self, confirms: Vec>) -> WorkerResult<()>; + fn gossip_blocks(&self, blocks: Vec) -> WorkerResult<()>; } -pub trait WorkerT -where - NodeApi: SubstrateeRegistryApi + AccountApi + ChainApi, - Enclave: EnclaveApi, - Server: ServerApi, -{ +// todo make generic over api also, but for this, we need to hide sending extrinsics behind a trait +impl Ocall for Worker, Enclave, WorkerApiDirect> { + fn send_confirmations(&self, confirms: Vec>) -> WorkerResult<()> { + if !confirms.is_empty() { + println!("Enclave wants to send {} extrinsics", confirms.len()); + + for call in confirms.into_iter() { + self.node_api.send_extrinsic(hex_encode(call), XtStatus::Ready)?; + } + // await next block to avoid #37 + let (events_in, events_out) = channel(); + self.node_api.subscribe_events(events_in)?; + let _ = events_out.recv().unwrap(); + let _ = events_out.recv().unwrap(); + // FIXME: we should unsubscribe here or the thread will throw a SendError because the channel is destroyed + } + Ok(()) + } + fn gossip_blocks(&self, _blocks: Vec) -> WorkerResult<()> { + let mut peers = self.node_api.all_enclaves()?; + peers.retain(|e| e.url != self.config.worker_url().as_bytes().to_vec()); + info!("Gossiping sidechain blocks to peers: {:?}", peers); + Ok(()) + } } \ No newline at end of file From 2254dce7dd29dfa516dd39524d6b1a9e85e50099 Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Thu, 10 Jun 2021 07:52:34 +0200 Subject: [PATCH 07/80] [worker/rpc/client] put `watch` and `get_rsa_key` behind a trait --- Cargo.lock | 226 +++++++++++++++++++++++-- client/src/main.rs | 2 +- worker/rpc/client/src/direct_client.rs | 26 ++- worker/src/main.rs | 2 +- worker/src/worker.rs | 11 +- 5 files changed, 242 insertions(+), 25 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 76c7cce134..e2bfc9e908 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -344,6 +344,15 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" +[[package]] +name = "beef" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6736e2428df2ca2848d846c43e88745121a6654696e349ce0054a420815a7409" +dependencies = [ + "serde", +] + [[package]] name = "bitflags" version = "1.2.1" @@ -453,6 +462,15 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" +[[package]] +name = "bstr" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90682c8d613ad3373e66de8c6411e0ae2ab2571e879d2efbf73558cc66f21279" +dependencies = [ + "memchr 2.4.0", +] + [[package]] name = "build-helper" version = "0.1.1" @@ -1423,6 +1441,19 @@ version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0e4075386626662786ddb0ec9081e7c7eeb1ba31951f447ca780ef9f5d568189" +[[package]] +name = "globset" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10463d9ff00a2a068db14231982f5132edebad0d7660cd956a1c30292dbcbfbd" +dependencies = [ + "aho-corasick 0.7.18", + "bstr", + "fnv", + "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.5.4", +] + [[package]] name = "gloo-timers" version = "0.2.1" @@ -1719,7 +1750,7 @@ dependencies = [ [[package]] name = "ias-verify" version = "0.1.4" -source = "git+https://github.com/scs/pallet-substratee-registry.git?branch=master#10f13173d2a07b3eb1062a956cda0e9dcd99a541" +source = "git+https://github.com/scs/pallet-substratee-registry.git?branch=feature-gate-ias-check#8fc938ba1d78678552acd8b7f0a5b73521c4f48e" dependencies = [ "base64 0.11.0", "chrono", @@ -1975,6 +2006,97 @@ dependencies = [ "serde", ] +[[package]] +name = "jsonrpsee" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "316a89048d2ea5530ab5502aa31e1128f6429b524a37e4c0bc54903bcdf3d342" +dependencies = [ + "jsonrpsee-http-server", + "jsonrpsee-utils", + "jsonrpsee-ws-server", +] + +[[package]] +name = "jsonrpsee-http-server" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d22372378f63f7d16de453e786afc740fca5ee80bd260be024a616b6ac2cefe5" +dependencies = [ + "futures-channel", + "futures-util", + "globset", + "hyper 0.14.9", + "jsonrpsee-types", + "jsonrpsee-utils", + "lazy_static", + "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", + "serde", + "serde_json", + "socket2", + "thiserror", + "tokio 1.7.1", + "unicase", +] + +[[package]] +name = "jsonrpsee-types" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0cf7bd4e93b3b56e59131de7f24afbea871faf914e97bcdd942c86927ab0172" +dependencies = [ + "async-trait", + "beef", + "futures-channel", + "futures-util", + "hyper 0.14.9", + "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", + "serde", + "serde_json", + "soketto", + "thiserror", +] + +[[package]] +name = "jsonrpsee-utils" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47554ecaacb479285da68799d9b6afc258c32b332cc8b85829c6a9304ee98776" +dependencies = [ + "futures-channel", + "futures-util", + "hyper 0.14.9", + "jsonrpsee-types", + "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.11.1", + "rand 0.8.4", + "rustc-hash", + "serde", + "serde_json", + "thiserror", +] + +[[package]] +name = "jsonrpsee-ws-server" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b512c3c679a89d20f97802f69188a2d01f6234491b7513076e21e8424efccafe" +dependencies = [ + "futures-channel", + "futures-util", + "jsonrpsee-types", + "jsonrpsee-utils", + "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-hash", + "serde", + "serde_json", + "soketto", + "thiserror", + "tokio 1.7.1", + "tokio-stream", + "tokio-util 0.6.7", +] + [[package]] name = "keccak" version = "0.1.0" @@ -2809,7 +2931,7 @@ dependencies = [ [[package]] name = "pallet-substratee-registry" version = "0.9.0" -source = "git+https://github.com/scs/pallet-substratee-registry.git?branch=master#10f13173d2a07b3eb1062a956cda0e9dcd99a541" +source = "git+https://github.com/scs/pallet-substratee-registry.git?branch=feature-gate-ias-check#8fc938ba1d78678552acd8b7f0a5b73521c4f48e" dependencies = [ "frame-support", "frame-system", @@ -4096,7 +4218,7 @@ dependencies = [ [[package]] name = "sgx-externalities" version = "0.3.0" -source = "git+https://github.com/scs/sgx-runtime?branch=master#bb0b6a206006299ab773a375197c4846a4c83a30" +source = "git+https://github.com/scs/sgx-runtime?branch=version-update#de9fc665a1e5268e53432841d642d61ddc793db2" dependencies = [ "environmental", "log 0.4.14 (git+https://github.com/mesalock-linux/log-sgx)", @@ -4109,7 +4231,7 @@ dependencies = [ [[package]] name = "sgx-runtime" version = "0.8.0" -source = "git+https://github.com/scs/sgx-runtime?branch=master#bb0b6a206006299ab773a375197c4846a4c83a30" +source = "git+https://github.com/scs/sgx-runtime?branch=version-update#de9fc665a1e5268e53432841d642d61ddc793db2" dependencies = [ "frame-executive", "frame-support", @@ -4289,6 +4411,19 @@ dependencies = [ "opaque-debug 0.2.3", ] +[[package]] +name = "sha-1" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c4cfa741c5832d0ef7fab46cabed29c2aae926db0b11bb2069edd8db5e64e16" +dependencies = [ + "block-buffer 0.9.0", + "cfg-if 1.0.0", + "cpufeatures", + "digest 0.9.0", + "opaque-debug 0.3.0", +] + [[package]] name = "sha1" version = "0.5.0" @@ -4436,6 +4571,21 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "soketto" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4919971d141dbadaa0e82b5d369e2d7666c98e4625046140615ca363e50d4daa" +dependencies = [ + "base64 0.13.0", + "bytes 1.0.1", + "futures 0.3.15", + "httparse", + "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.8.4", + "sha-1 0.9.6", +] + [[package]] name = "sp-api" version = "3.0.0" @@ -4731,7 +4881,7 @@ dependencies = [ [[package]] name = "sp-io" version = "3.1.0" -source = "git+https://github.com/scs/sgx-runtime?branch=master#bb0b6a206006299ab773a375197c4846a4c83a30" +source = "git+https://github.com/scs/sgx-runtime?branch=version-update#de9fc665a1e5268e53432841d642d61ddc793db2" dependencies = [ "environmental", "hash-db", @@ -5098,7 +5248,7 @@ dependencies = [ [[package]] name = "substrate-api-client" version = "0.6.0" -source = "git+https://github.com/scs/substrate-api-client?branch=master#731a3a5c3a16ed3ce7f1f6b50593a2cdfd08a39f" +source = "git+https://github.com/scs/substrate-api-client?branch=master#3c8c04cd785b383dfbacb48a374503e644d13a08" dependencies = [ "env_logger 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "frame-metadata", @@ -5136,7 +5286,7 @@ dependencies = [ [[package]] name = "substrate-client-keystore" version = "0.6.0" -source = "git+https://github.com/scs/substrate-api-client?branch=master#731a3a5c3a16ed3ce7f1f6b50593a2cdfd08a39f" +source = "git+https://github.com/scs/substrate-api-client?branch=master#3c8c04cd785b383dfbacb48a374503e644d13a08" dependencies = [ "async-trait", "hex 0.4.3", @@ -5230,6 +5380,10 @@ dependencies = [ "ws 0.7.9", ] +[[package]] +name = "substratee-enclave-api" +version = "0.8.0" + [[package]] name = "substratee-node-primitives" version = "0.8.0" @@ -5243,8 +5397,8 @@ dependencies = [ [[package]] name = "substratee-node-runtime" -version = "0.9.0" -source = "git+https://github.com/scs/substraTEE-node?branch=master#d0df8591618ca175cf03970a26b1ab1e52aef4a5" +version = "0.8.0" +source = "git+https://github.com/scs/substraTEE-node?branch=feature-gate-ias-verify#102dee0f031a1aca16962dc9899db0607a6e9515" dependencies = [ "frame-executive", "frame-support", @@ -5327,6 +5481,7 @@ dependencies = [ "multihash 0.8.0", "pallet-balances", "parity-scale-codec 2.1.3", + "parking_lot 0.11.1", "primitive-types 0.9.0", "rust-crypto", "serde", @@ -5342,12 +5497,15 @@ dependencies = [ "sp-runtime", "substrate-api-client", "substratee-api-client-extensions", + "substratee-enclave-api", "substratee-node-primitives", "substratee-node-runtime", "substratee-settings", "substratee-stf", "substratee-worker-api", "substratee-worker-primitives", + "substratee-worker-rpc-server", + "thiserror", "tokio 0.2.25", "ws 0.7.9", ] @@ -5381,6 +5539,22 @@ dependencies = [ "sp-runtime", ] +[[package]] +name = "substratee-worker-rpc-server" +version = "0.8.0" +dependencies = [ + "anyhow", + "env_logger 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-util", + "jsonrpsee", + "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json", + "soketto", + "substratee-enclave-api", + "tokio 1.7.1", + "tokio-util 0.6.7", +] + [[package]] name = "subtle" version = "1.0.0" @@ -5607,7 +5781,7 @@ dependencies = [ "futures-core", "memchr 2.4.0", "pin-project-lite 0.1.12", - "tokio-macros", + "tokio-macros 0.2.6", ] [[package]] @@ -5621,7 +5795,12 @@ dependencies = [ "libc", "memchr 2.4.0", "mio 0.7.13", + "num_cpus", + "once_cell 1.8.0", + "parking_lot 0.11.1", "pin-project-lite 0.2.6", + "signal-hook-registry", + "tokio-macros 1.2.0", "winapi 0.3.9", ] @@ -5636,6 +5815,17 @@ dependencies = [ "syn 1.0.73", ] +[[package]] +name = "tokio-macros" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c49e3df43841dafb86046472506755d8501c5615673955f6aa17181125d13c37" +dependencies = [ + "proc-macro2", + "quote 1.0.9", + "syn 1.0.73", +] + [[package]] name = "tokio-native-tls" version = "0.3.0" @@ -5646,6 +5836,17 @@ dependencies = [ "tokio 1.7.1", ] +[[package]] +name = "tokio-stream" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8864d706fdb3cc0843a49647ac892720dac98a6eeb818b77190592cf4994066" +dependencies = [ + "futures-core", + "pin-project-lite 0.2.6", + "tokio 1.7.1", +] + [[package]] name = "tokio-util" version = "0.3.1" @@ -5668,6 +5869,7 @@ checksum = "1caa0b0c8d94a049db56b5acf8cba99dc0623aab1b26d5b5f5e2d945846b3592" dependencies = [ "bytes 1.0.1", "futures-core", + "futures-io", "futures-sink", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", "pin-project-lite 0.2.6", @@ -5810,7 +6012,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04f8ab788026715fa63b31960869617cba39117e520eb415b0139543e325ab59" dependencies = [ "cfg-if 0.1.10", - "rand 0.6.5", + "rand 0.7.3", "static_assertions", ] @@ -6267,7 +6469,7 @@ dependencies = [ "mio-extras", "openssl", "rand 0.7.3", - "sha-1", + "sha-1 0.8.2", "slab", "url 2.2.2", ] diff --git a/client/src/main.rs b/client/src/main.rs index b9e0cf2f29..a63b7bb2c8 100644 --- a/client/src/main.rs +++ b/client/src/main.rs @@ -64,7 +64,7 @@ use substrate_api_client::{ use substrate_client_keystore::{LocalKeystore, KeystoreExt}; use substratee_stf::{ShardIdentifier, TrustedCallSigned, TrustedOperation}; -use substratee_worker_api::direct_client::DirectApi as DirectWorkerApi; +use substratee_worker_api::direct_client::{DirectClient as DirectWorkerApi, DirectApi}; use substratee_api_client_extensions::SubstrateeRegistryApi; use substratee_worker_primitives::{DirectRequestStatus, RpcRequest, RpcResponse, RpcReturnValue}; diff --git a/worker/rpc/client/src/direct_client.rs b/worker/rpc/client/src/direct_client.rs index 5cfae54447..0a073fb545 100644 --- a/worker/rpc/client/src/direct_client.rs +++ b/worker/rpc/client/src/direct_client.rs @@ -11,14 +11,14 @@ use substratee_worker_primitives::{DirectRequestStatus, RpcRequest, RpcResponse, use sgx_crypto_helper::rsa3072::Rsa3072PubKey; -pub struct DirectWsClient { +pub struct WsClient { pub out: Sender, pub request: String, pub result: MpscSender, pub do_watch: bool, } -impl Handler for DirectWsClient { +impl Handler for WsClient { fn on_open(&mut self, _: Handshake) -> ClientResult<()> { debug!("sending request: {:?}", self.request.clone()); match self.out.send(self.request.clone()) { @@ -38,11 +38,16 @@ impl Handler for DirectWsClient { } #[derive(Clone)] -pub struct DirectApi { +pub struct DirectClient { url: String, } -impl DirectApi { +pub trait DirectApi { + fn watch(&self, request: String, sender: MpscSender) -> Result<(), ()>; + fn get_rsa_pubkey(&self) -> Result; +} + +impl DirectClient { pub fn new(url: String) -> Self { Self { url } } @@ -55,7 +60,7 @@ impl DirectApi { info!("[WorkerApi Direct]: Sending request: {:?}", request); let client = thread::spawn(move || { - match connect(url, |out| DirectWsClient { + match connect(url, |out| WsClient { out, request: request.clone(), result: port_in.clone(), @@ -77,14 +82,17 @@ impl DirectApi { } } } +} + +impl DirectApi for DirectClient { /// server connection with more than one response #[allow(clippy::result_unit_err)] - pub fn watch(&self, request: String, sender: MpscSender) -> Result<(), ()> { + fn watch(&self, request: String, sender: MpscSender) -> Result<(), ()> { let url = self.url.clone(); info!("[WorkerApi Direct]: Sending request: {:?}", request); thread::spawn(move || { - match connect(url, |out| DirectWsClient { + match connect(url, |out| WsClient { out, request: request.clone(), result: sender.clone(), @@ -99,7 +107,7 @@ impl DirectApi { Ok(()) } - pub fn get_rsa_pubkey(&self) -> Result { + fn get_rsa_pubkey(&self) -> Result { // compose jsonrpc call let method = "author_getShieldingKey".to_owned(); let jsonrpc_call: String = RpcRequest::compose_jsonrpc_call(method, vec![]); @@ -144,4 +152,4 @@ impl DirectApi { info!("[+] Got RSA public key of enclave"); Ok(shielding_pubkey) } -} +} \ No newline at end of file diff --git a/worker/src/main.rs b/worker/src/main.rs index d919f564ad..7aad785ecf 100644 --- a/worker/src/main.rs +++ b/worker/src/main.rs @@ -87,7 +87,7 @@ const VERSION: &str = env!("CARGO_PKG_VERSION"); /// start block production every ... ms const BLOCK_PRODUCTION_INTERVAL: u64 = 1000; -type Worker = WorkerGen, Enclave, DirectApi>; +type Worker = WorkerGen, Enclave, DirectClient>; lazy_static! { // todo: replace with &str, but use &str in api-client first diff --git a/worker/src/worker.rs b/worker/src/worker.rs index f0c463fb7b..179471f59c 100644 --- a/worker/src/worker.rs +++ b/worker/src/worker.rs @@ -20,13 +20,13 @@ pub struct Worker { _worker_api_direct: Arc, } -pub trait Ocall { +pub trait WorkerT { fn send_confirmations(&self, confirms: Vec>) -> WorkerResult<()>; fn gossip_blocks(&self, blocks: Vec) -> WorkerResult<()>; } // todo make generic over api also, but for this, we need to hide sending extrinsics behind a trait -impl Ocall for Worker, Enclave, WorkerApiDirect> { +impl WorkerT for Worker, Enclave, WorkerApiDirect> { fn send_confirmations(&self, confirms: Vec>) -> WorkerResult<()> { if !confirms.is_empty() { println!("Enclave wants to send {} extrinsics", confirms.len()); @@ -51,4 +51,11 @@ impl Ocall for Worker, Encl info!("Gossiping sidechain blocks to peers: {:?}", peers); Ok(()) } +} + +#[cfg(test)] +mod tests { + + + } \ No newline at end of file From cb64128fc53ee74d14cb76ccbcc5c1be49062388 Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Thu, 10 Jun 2021 08:10:51 +0200 Subject: [PATCH 08/80] [worker] move check files to utils --- worker/src/main.rs | 21 ++------------------- worker/src/utils.rs | 23 ++++++++++++++++++++++- 2 files changed, 24 insertions(+), 20 deletions(-) diff --git a/worker/src/main.rs b/worker/src/main.rs index 7aad785ecf..92a00c3368 100644 --- a/worker/src/main.rs +++ b/worker/src/main.rs @@ -66,12 +66,11 @@ use config::Config; use utils::extract_shard; use substratee_settings::files::{ - SIGNING_KEY_FILE, SHIELDING_KEY_FILE, ENCLAVE_FILE, - RA_SPID_FILE, RA_API_KEY_FILE, SHARDS_PATH, ENCRYPTED_STATE_FILE + SIGNING_KEY_FILE, SHIELDING_KEY_FILE, SHARDS_PATH, ENCRYPTED_STATE_FILE }; use worker::{Worker as WorkerGen}; -use crate::utils::hex_encode; +use crate::utils::{hex_encode, check_files}; mod enclave; mod ipfs; @@ -626,22 +625,6 @@ fn ensure_account_has_funds(api: &mut Api, accountid: &AccountId3 } } -pub fn check_files() { - debug!("*** Check files"); - let files = vec![ - ENCLAVE_FILE, - SHIELDING_KEY_FILE, - SIGNING_KEY_FILE, - RA_SPID_FILE, - RA_API_KEY_FILE, - ]; - for f in files.iter() { - if !Path::new(f).exists() { - panic!("file doesn't exist: {}", f); - } - } -} - /// # Safety /// /// FFI are always unsafe diff --git a/worker/src/utils.rs b/worker/src/utils.rs index edf5642334..d8aac8b5ce 100644 --- a/worker/src/utils.rs +++ b/worker/src/utils.rs @@ -1,8 +1,9 @@ use substratee_stf::ShardIdentifier; use clap::ArgMatches; use base58::{FromBase58, ToBase58}; -use log::info; +use log::{info, debug}; use crate::enclave::api::{enclave_init, enclave_mrenclave}; +use std::path::Path; pub fn extract_shard(m: &ArgMatches<'_>) -> ShardIdentifier { match m.value_of("shard") { @@ -29,3 +30,23 @@ pub fn hex_encode(data: Vec) -> String { hex_str.insert_str(0, "0x"); hex_str } + +pub fn check_files() { + use substratee_settings::files::{ + SIGNING_KEY_FILE, SHIELDING_KEY_FILE, ENCLAVE_FILE, + RA_SPID_FILE, RA_API_KEY_FILE, + }; + debug!("*** Check files"); + let files = vec![ + ENCLAVE_FILE, + SHIELDING_KEY_FILE, + SIGNING_KEY_FILE, + RA_SPID_FILE, + RA_API_KEY_FILE, + ]; + for f in files.iter() { + if !Path::new(f).exists() { + panic!("file doesn't exist: {}", f); + } + } +} \ No newline at end of file From 0e57ea71036cbf96e6f818c4f9578bb88f50874b Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Thu, 10 Jun 2021 08:13:56 +0200 Subject: [PATCH 09/80] [worker] move write_files_and_whitespace_pad to utils --- worker/src/main.rs | 13 +------------ worker/src/utils.rs | 11 +++++++++++ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/worker/src/main.rs b/worker/src/main.rs index 92a00c3368..e08f01a7c3 100644 --- a/worker/src/main.rs +++ b/worker/src/main.rs @@ -63,14 +63,13 @@ use substratee_worker_rpc_server::{RpcServer}; use substratee_node_primitives::SignedBlock; use config::Config; -use utils::extract_shard; use substratee_settings::files::{ SIGNING_KEY_FILE, SHIELDING_KEY_FILE, SHARDS_PATH, ENCRYPTED_STATE_FILE }; use worker::{Worker as WorkerGen}; -use crate::utils::{hex_encode, check_files}; +use crate::utils::{extract_shard, hex_encode, check_files, write_slice_and_whitespace_pad}; mod enclave; mod ipfs; @@ -725,16 +724,6 @@ pub unsafe extern "C" fn ocall_send_block_and_confirmation( status } -pub fn write_slice_and_whitespace_pad(writable: &mut [u8], data: Vec) { - if data.len() > writable.len() { - panic!("not enough bytes in output buffer for return value"); - } - let (left, right) = writable.split_at_mut(data.len()); - left.clone_from_slice(&data); - // fill the right side with whitespace - right.iter_mut().for_each(|x| *x = 0x20); -} - #[derive(Encode, Decode, Clone, Debug, PartialEq)] pub enum WorkerRequest { ChainStorage(Vec, Option), // (storage_key, at_block) diff --git a/worker/src/utils.rs b/worker/src/utils.rs index d8aac8b5ce..f168f5258f 100644 --- a/worker/src/utils.rs +++ b/worker/src/utils.rs @@ -31,6 +31,17 @@ pub fn hex_encode(data: Vec) -> String { hex_str } +pub fn write_slice_and_whitespace_pad(writable: &mut [u8], data: Vec) { + if data.len() > writable.len() { + panic!("not enough bytes in output buffer for return value"); + } + let (left, right) = writable.split_at_mut(data.len()); + left.clone_from_slice(&data); + // fill the right side with whitespace + right.iter_mut().for_each(|x| *x = 0x20); +} + + pub fn check_files() { use substratee_settings::files::{ SIGNING_KEY_FILE, SHIELDING_KEY_FILE, ENCLAVE_FILE, From db678f384d8cd070b4d445f65b70d9d0b5cd7083 Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Thu, 10 Jun 2021 11:33:37 +0200 Subject: [PATCH 10/80] [worker] update futures and add jsonrpsee dev-dep. --- worker/Cargo.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/worker/Cargo.toml b/worker/Cargo.toml index 095027de27..22e4799573 100644 --- a/worker/Cargo.toml +++ b/worker/Cargo.toml @@ -102,3 +102,6 @@ path = "../stf" [features] default = [] production = ['substratee-settings/production'] + +[dev-dependencies] +jsonrpsee = { version = "0.2.0", features = ["server", "client"]} \ No newline at end of file From fd6c57a4ab8feea9666c35b2fd1970f97c97338e Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Thu, 10 Jun 2021 11:40:53 +0200 Subject: [PATCH 11/80] [primitives/node] Enclave type now contains `PalletString` instead of `Vec` --- primitives/node/src/lib.rs | 11 ++++++++++- worker/src/worker.rs | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/primitives/node/src/lib.rs b/primitives/node/src/lib.rs index e060e4e3be..9e14071cc4 100644 --- a/primitives/node/src/lib.rs +++ b/primitives/node/src/lib.rs @@ -7,6 +7,15 @@ use sgx_tstd as std; use sp_core::H256; use std::vec::Vec; +/// Substrate runtimes provide no string type. Hence, for arbitrary data of varying length the +/// `Vec` is used. In the polkadot-js the typedef `Text` is used to automatically +/// utf8 decode bytes into a string. +#[cfg(not(feature = "std"))] +pub type PalletString = Vec; + +#[cfg(feature = "std")] +pub type PalletString = String; + #[cfg(feature = "std")] pub type SignedBlock = sp_runtime::generic::SignedBlock; @@ -26,7 +35,7 @@ pub struct Request { } #[cfg(feature = "std")] -pub type Enclave = EnclaveGen>; +pub type Enclave = EnclaveGen; pub type IpfsHash = [u8; 46]; pub type SubstrateeConfirmCallFn = ([u8; 2], ShardIdentifier, H256, Vec); diff --git a/worker/src/worker.rs b/worker/src/worker.rs index 179471f59c..41ac0d3ad3 100644 --- a/worker/src/worker.rs +++ b/worker/src/worker.rs @@ -46,7 +46,7 @@ impl WorkerT for Worker, En fn gossip_blocks(&self, _blocks: Vec) -> WorkerResult<()> { let mut peers = self.node_api.all_enclaves()?; - peers.retain(|e| e.url != self.config.worker_url().as_bytes().to_vec()); + peers.retain(|e| e.url != self.config.worker_url()); info!("Gossiping sidechain blocks to peers: {:?}", peers); Ok(()) From f7d984e8da77660eb3100f9913e53491ec7d6a2a Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Thu, 10 Jun 2021 11:53:08 +0200 Subject: [PATCH 12/80] [node/primitives] add improved enclave definition. --- Cargo.lock | 130 ++++++++++++++++++++++++++++++++++++- primitives/node/src/lib.rs | 31 +++++++-- 2 files changed, 154 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e2bfc9e908..01ac56c78c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -752,6 +752,15 @@ dependencies = [ "subtle 2.4.0", ] +[[package]] +name = "ct-logs" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1a816186fa68d9e426e3cb4ae4dff1fcd8e4a2c34b781bf7a822574a0d0aac8" +dependencies = [ + "sct", +] + [[package]] name = "ctor" version = "0.1.20" @@ -1734,6 +1743,23 @@ dependencies = [ "hyper 0.14.9", ] +[[package]] +name = "hyper-rustls" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f9f7a97316d44c0af9b0301e65010573a853a9fc97046d7331d7f6bc0fd5a64" +dependencies = [ + "ct-logs", + "futures-util", + "hyper 0.14.9", + "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", + "rustls", + "rustls-native-certs", + "tokio 1.7.1", + "tokio-rustls", + "webpki 0.21.4", +] + [[package]] name = "hyper-tls" version = "0.5.0" @@ -1760,7 +1786,7 @@ dependencies = [ "sp-core", "sp-io 3.0.0", "sp-std", - "webpki", + "webpki 0.21.0", ] [[package]] @@ -2012,11 +2038,32 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "316a89048d2ea5530ab5502aa31e1128f6429b524a37e4c0bc54903bcdf3d342" dependencies = [ + "jsonrpsee-http-client", "jsonrpsee-http-server", "jsonrpsee-utils", + "jsonrpsee-ws-client", "jsonrpsee-ws-server", ] +[[package]] +name = "jsonrpsee-http-client" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7275601ba6f9f6feaa82d3c66b51e34d190e75f1cf23d5c40f7801f3a7610a6" +dependencies = [ + "async-trait", + "fnv", + "hyper 0.14.9", + "hyper-rustls", + "jsonrpsee-types", + "jsonrpsee-utils", + "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", + "serde", + "serde_json", + "thiserror", + "url 2.2.2", +] + [[package]] name = "jsonrpsee-http-server" version = "0.2.0" @@ -2076,6 +2123,30 @@ dependencies = [ "thiserror", ] +[[package]] +name = "jsonrpsee-ws-client" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ec51150965544e1a4468f372bdab8545243a1b045d4ab272023aac74c60de32" +dependencies = [ + "async-trait", + "fnv", + "futures 0.3.15", + "jsonrpsee-types", + "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", + "pin-project 1.0.7", + "rustls", + "rustls-native-certs", + "serde", + "serde_json", + "soketto", + "thiserror", + "tokio 1.7.1", + "tokio-rustls", + "tokio-util 0.6.7", + "url 2.2.2", +] + [[package]] name = "jsonrpsee-ws-server" version = "0.2.0" @@ -3957,6 +4028,31 @@ dependencies = [ "semver 0.9.0", ] +[[package]] +name = "rustls" +version = "0.19.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35edb675feee39aec9c99fa5ff985081995a06d594114ae14cbe797ad7b7a6d7" +dependencies = [ + "base64 0.13.0", + "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", + "ring 0.16.20", + "sct", + "webpki 0.21.4", +] + +[[package]] +name = "rustls-native-certs" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a07b7c1885bd8ed3831c289b7870b13ef46fe0e856d288c30d9cc17d75a2092" +dependencies = [ + "openssl-probe", + "rustls", + "schannel", + "security-framework", +] + [[package]] name = "ruzstd" version = "0.2.2" @@ -4087,6 +4183,16 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +[[package]] +name = "sct" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b362b83898e0e69f38515b82ee15aa80636befe47c3b6d3d89a911e78fc228ce" +dependencies = [ + "ring 0.16.20", + "untrusted", +] + [[package]] name = "secrecy" version = "0.7.0" @@ -5476,6 +5582,7 @@ dependencies = [ "futures 0.3.15", "hex 0.3.2", "ipfs-api", + "jsonrpsee", "lazy_static", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", "multihash 0.8.0", @@ -5836,6 +5943,17 @@ dependencies = [ "tokio 1.7.1", ] +[[package]] +name = "tokio-rustls" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc6844de72e57df1980054b38be3a9f4702aba4858be64dd700181a8a6d0e1b6" +dependencies = [ + "rustls", + "tokio 1.7.1", + "webpki 0.21.4", +] + [[package]] name = "tokio-stream" version = "0.1.6" @@ -6364,6 +6482,16 @@ dependencies = [ "untrusted", ] +[[package]] +name = "webpki" +version = "0.21.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8e38c0608262c46d4a56202ebabdeb094cef7e560ca7a226c6bf055188aa4ea" +dependencies = [ + "ring 0.16.20", + "untrusted", +] + [[package]] name = "wepoll-ffi" version = "0.1.2" diff --git a/primitives/node/src/lib.rs b/primitives/node/src/lib.rs index 9e14071cc4..d191059afa 100644 --- a/primitives/node/src/lib.rs +++ b/primitives/node/src/lib.rs @@ -17,10 +17,7 @@ pub type PalletString = Vec; pub type PalletString = String; #[cfg(feature = "std")] -pub type SignedBlock = sp_runtime::generic::SignedBlock; - -#[cfg(feature = "std")] -pub use my_node_runtime::substratee_registry::Enclave as EnclaveGen; +pub use my_node_runtime::SignedBlock; pub use sp_core::crypto::AccountId32 as AccountId; @@ -34,10 +31,32 @@ pub struct Request { pub cyphertext: Vec, } -#[cfg(feature = "std")] -pub type Enclave = EnclaveGen; pub type IpfsHash = [u8; 46]; pub type SubstrateeConfirmCallFn = ([u8; 2], ShardIdentifier, H256, Vec); pub type ShieldFundsFn = ([u8; 2], Vec, u128, ShardIdentifier); pub type CallWorkerFn = ([u8; 2], Request); + +// Todo: move this improved enclave definition into a primitives crate substratee-registry repo. +#[derive(Encode, Decode, Default, 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, + } + } +} + +pub type Enclave = EnclaveGen; From 3bdd682b00639a8231075d03a6293d01960f075f Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Thu, 10 Jun 2021 12:23:58 +0200 Subject: [PATCH 13/80] [worker/tests] add some mocks. --- worker/src/tests/mock.rs | 47 ++++++++++++++++++++++++++++++++++++++++ worker/src/tests/mod.rs | 1 + 2 files changed, 48 insertions(+) create mode 100644 worker/src/tests/mock.rs diff --git a/worker/src/tests/mock.rs b/worker/src/tests/mock.rs new file mode 100644 index 0000000000..c4d7e72445 --- /dev/null +++ b/worker/src/tests/mock.rs @@ -0,0 +1,47 @@ +use substratee_api_client_extensions::{SubstrateeRegistryApi, ApiResult}; +use substratee_node_primitives::{Enclave, ShardIdentifier}; +use primitive_types::H256; + +pub struct TestNodeApi; + +const W1_URL: &str = "127.0.0.1:2222"; +const W2_URL: &str = "127.0.0.1:2223"; + +fn enclaves() -> Vec { + vec![ + Enclave::new( + H256::random().to_fixed_bytes().into(), + H256::random().to_fixed_bytes().into(), + 1, + W1_URL.into(), + ), + Enclave::new( + H256::random().to_fixed_bytes().into(), + H256::random().to_fixed_bytes().into(), + 2, + W2_URL.into(), + ), + ] +} + +impl SubstrateeRegistryApi for TestNodeApi { + + fn enclave(&self, index: u64) -> ApiResult> { + Ok(Some(enclaves().remove(index as usize))) + } + fn enclave_count(&self) -> ApiResult { + unreachable!() + } + + fn all_enclaves(&self) -> ApiResult> { + // the args are okay here. The IDE does not grasp types depending on feature flags. + Ok(enclaves()) + } + + fn worker_for_shard(&self, _: &ShardIdentifier) -> ApiResult> { + unreachable!() + } + fn latest_ipfs_hash(&self, _: &ShardIdentifier) -> ApiResult> { + unreachable!() + } +} \ No newline at end of file diff --git a/worker/src/tests/mod.rs b/worker/src/tests/mod.rs index 8369af6b49..8687675438 100644 --- a/worker/src/tests/mod.rs +++ b/worker/src/tests/mod.rs @@ -25,6 +25,7 @@ use self::integration_tests::*; pub mod commons; pub mod ecalls; pub mod integration_tests; +pub mod mock; pub fn run_enclave_tests(matches: &ArgMatches, port: &str) { println!("*** Starting Test enclave"); From b955522371c53bd0470710bb363d877cbe650813 Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Thu, 10 Jun 2021 12:24:17 +0200 Subject: [PATCH 14/80] [worker] fmt --- worker/src/worker.rs | 85 ++++++++++++++++++++++++++------------------ 1 file changed, 50 insertions(+), 35 deletions(-) diff --git a/worker/src/worker.rs b/worker/src/worker.rs index 41ac0d3ad3..f6653bc74e 100644 --- a/worker/src/worker.rs +++ b/worker/src/worker.rs @@ -1,61 +1,76 @@ use log::info; use sp_core::sr25519; -use std::sync::Arc; use std::sync::mpsc::channel; +use std::sync::Arc; use substrate_api_client::{Api, XtStatus}; use substratee_api_client_extensions::SubstrateeRegistryApi; -use substratee_worker_primitives::block::{SignedBlock as SignedSidechainBlock}; +use substratee_worker_primitives::block::SignedBlock as SignedSidechainBlock; +use crate::config::Config; use crate::error::Error; use crate::utils::hex_encode; -use crate::config::Config; +use substratee_worker_api::direct_client::WorkerToWorkerApi; pub type WorkerResult = Result; pub struct Worker { - config: Config, - node_api: NodeApi, - _enclave_api: Enclave, - _worker_api_direct: Arc, + config: Config, + node_api: NodeApi, + _enclave_api: Enclave, + _worker_api_direct: Arc, } pub trait WorkerT { - fn send_confirmations(&self, confirms: Vec>) -> WorkerResult<()>; - fn gossip_blocks(&self, blocks: Vec) -> WorkerResult<()>; + fn send_confirmations(&self, confirms: Vec>) -> WorkerResult<()>; + fn gossip_blocks(&self, blocks: Vec) -> WorkerResult<()>; } // todo make generic over api also, but for this, we need to hide sending extrinsics behind a trait -impl WorkerT for Worker, Enclave, WorkerApiDirect> { - fn send_confirmations(&self, confirms: Vec>) -> WorkerResult<()> { - if !confirms.is_empty() { - println!("Enclave wants to send {} extrinsics", confirms.len()); - - for call in confirms.into_iter() { - self.node_api.send_extrinsic(hex_encode(call), XtStatus::Ready)?; - } - // await next block to avoid #37 - let (events_in, events_out) = channel(); - self.node_api.subscribe_events(events_in)?; - let _ = events_out.recv().unwrap(); - let _ = events_out.recv().unwrap(); - // FIXME: we should unsubscribe here or the thread will throw a SendError because the channel is destroyed - } - Ok(()) - } - - fn gossip_blocks(&self, _blocks: Vec) -> WorkerResult<()> { - let mut peers = self.node_api.all_enclaves()?; - peers.retain(|e| e.url != self.config.worker_url()); - - info!("Gossiping sidechain blocks to peers: {:?}", peers); - Ok(()) - } +impl WorkerT + for Worker, Enclave, WorkerApiDirect> +{ + fn send_confirmations(&self, confirms: Vec>) -> WorkerResult<()> { + if !confirms.is_empty() { + println!("Enclave wants to send {} extrinsics", confirms.len()); + + for call in confirms.into_iter() { + self.node_api + .send_extrinsic(hex_encode(call), XtStatus::Ready)?; + } + // await next block to avoid #37 + let (events_in, events_out) = channel(); + self.node_api.subscribe_events(events_in)?; + let _ = events_out.recv().unwrap(); + let _ = events_out.recv().unwrap(); + // FIXME: we should unsubscribe here or the thread will throw a SendError because the channel is destroyed + } + Ok(()) + } + + fn gossip_blocks(&self, _blocks: Vec) -> WorkerResult<()> { + let mut peers = self.node_api.all_enclaves()?; + peers.retain(|e| e.url != self.config.worker_url()); + + info!("Gossiping sidechain blocks to peers: {:?}", peers); + // for p in peers.iter() { + // self.worker_api_direct.send_blocks() + // } + Ok(()) + } } #[cfg(test)] mod tests { + use jsonrpsee::{wsclient::WsClientBuilder, wsserver::WsServerBuilder}; + use sp_core::H256; + use substratee_api_client_extensions::{ApiResult, SubstrateeRegistryApi}; + use substratee_node_primitives::{Enclave, ShardIdentifier}; + use crate::tests::mock::TestNodeApi; + #[test] + fn gossip_blocks_works() { -} \ No newline at end of file + } +} From da7febbb14ade32da422b88d0f066a5c7a56b4f5 Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Thu, 10 Jun 2021 15:04:54 +0200 Subject: [PATCH 15/80] [worker] PoC send to other worker blocks in unit test. --- client/src/main.rs | 2 +- worker/Cargo.toml | 6 +- worker/rpc/client/src/direct_client.rs | 7 ++ worker/src/config.rs | 17 ++++ worker/src/error.rs | 3 +- worker/src/tests/commons.rs | 26 ++++- worker/src/tests/mock.rs | 4 +- worker/src/worker.rs | 136 +++++++++++++++++-------- 8 files changed, 154 insertions(+), 47 deletions(-) diff --git a/client/src/main.rs b/client/src/main.rs index a63b7bb2c8..3d36348892 100644 --- a/client/src/main.rs +++ b/client/src/main.rs @@ -311,7 +311,7 @@ fn main() { println!(" AccountId: {}", enclave.pubkey.to_ss58check()); println!(" MRENCLAVE: {}", enclave.mr_enclave.to_base58()); println!(" RA timestamp: {}", timestamp); - println!(" URL: {}", String::from_utf8(enclave.url).unwrap()); + println!(" URL: {}", enclave.url); } Ok(()) }), diff --git a/worker/Cargo.toml b/worker/Cargo.toml index 22e4799573..be7e488780 100644 --- a/worker/Cargo.toml +++ b/worker/Cargo.toml @@ -21,11 +21,13 @@ dirs = "1.0.2" serde = "1.0" serde_json = "1.0" serde_derive = "1.0" +jsonrpsee = { version = "0.2.0", features = ["client", "ws-server", "macros"]} +async-trait = "0.1.50" +tokio = { version = "1.6.1", features = ["full"] } # ipfs ipfs-api = "0.11.0" futures = "0.3" -tokio = { version = "0.2", features = ["macros"] } multihash = "0.8" cid = "<0.3.1" sha2 = { version = "0.7", default-features = false } @@ -104,4 +106,4 @@ default = [] production = ['substratee-settings/production'] [dev-dependencies] -jsonrpsee = { version = "0.2.0", features = ["server", "client"]} \ No newline at end of file +anyhow = "1.0.40" \ No newline at end of file diff --git a/worker/rpc/client/src/direct_client.rs b/worker/rpc/client/src/direct_client.rs index 0a073fb545..bca1b61d27 100644 --- a/worker/rpc/client/src/direct_client.rs +++ b/worker/rpc/client/src/direct_client.rs @@ -10,6 +10,7 @@ use ws::{connect, CloseCode, Handler, Handshake, Message, Result as ClientResult use substratee_worker_primitives::{DirectRequestStatus, RpcRequest, RpcResponse, RpcReturnValue}; use sgx_crypto_helper::rsa3072::Rsa3072PubKey; +use substratee_worker_primitives::block::SignedBlock; pub struct WsClient { pub out: Sender, @@ -47,6 +48,12 @@ pub trait DirectApi { fn get_rsa_pubkey(&self) -> Result; } +pub trait WorkerToWorkerApi { + // If I understand correctly, this should never be more than one block. + // Will migrate to that later + fn send_blocks(&self, block: Vec) -> Result<(), ()>; +} + impl DirectClient { pub fn new(url: String) -> Self { Self { url } diff --git a/worker/src/config.rs b/worker/src/config.rs index c25673f97d..bc859f7836 100644 --- a/worker/src/config.rs +++ b/worker/src/config.rs @@ -14,6 +14,23 @@ pub struct Config { } impl Config { + pub fn new( + node_ip: String, + node_port: String, + worker_ip: String, + worker_rpc_port: String, + worker_mu_ra_port: String) -> Self { + Self { + node_ip, + node_port, + worker_ip, + worker_rpc_port, + worker_mu_ra_port, + ext_api_url: None, + } + } + + pub fn node_url(&self) -> String { format!("{}:{}", self.node_ip, self.node_port) } diff --git a/worker/src/error.rs b/worker/src/error.rs index d423641ed9..ed918b0310 100644 --- a/worker/src/error.rs +++ b/worker/src/error.rs @@ -1,11 +1,12 @@ use codec::{Error as CodecError}; use substrate_api_client::ApiClientError; - #[derive(Debug, thiserror::Error)] pub enum Error { #[error("{0}")] Codec(#[from] CodecError), #[error("{0}")] ApiClientError(#[from] ApiClientError), + #[error("{0}")] + JsonRpSeeClient(#[from] jsonrpsee::types::Error), } \ No newline at end of file diff --git a/worker/src/tests/commons.rs b/worker/src/tests/commons.rs index 260329de07..ea51f9317c 100644 --- a/worker/src/tests/commons.rs +++ b/worker/src/tests/commons.rs @@ -22,7 +22,7 @@ use serde_derive::{Deserialize, Serialize}; use sgx_crypto_helper::rsa3072::Rsa3072PubKey; use sgx_types::*; use sp_core::crypto::AccountId32; -use sp_core::sr25519; +use sp_core::{sr25519, H256, Pair}; use sp_keyring::AccountKeyring; use std::{fs, str}; @@ -31,6 +31,7 @@ use crate::enclave::api::*; use crate::{enclave_account, ensure_account_has_funds}; use substrate_api_client::Api; use substratee_stf::{Index, KeyPair, ShardIdentifier, TrustedCall, TrustedGetter, Getter}; +use substratee_worker_primitives::block::{SignedBlock, Block}; #[derive(Debug, Serialize, Deserialize)] pub struct Message { @@ -132,3 +133,26 @@ pub fn get_nonce(api: &Api, who: &AccountId32) -> u32 { 0 } } + +pub fn test_sidechain_block() -> SignedBlock { + let signer_pair = sp_core::ed25519::Pair::from_string("//Alice", None).unwrap(); + let author: AccountId32 = signer_pair.public().into(); + let block_number: u64 = 0; + let parent_hash = H256::random(); + let layer_one_head = H256::random(); + let signed_top_hashes = vec![]; + let encrypted_payload: Vec = vec![]; + let shard = ShardIdentifier::default(); + + // when + let block = Block::construct_block( + author, + block_number, + parent_hash.clone(), + layer_one_head.clone(), + shard.clone(), + signed_top_hashes.clone(), + encrypted_payload.clone(), + ); + block.sign(&signer_pair) +} \ No newline at end of file diff --git a/worker/src/tests/mock.rs b/worker/src/tests/mock.rs index c4d7e72445..95bdd8ab21 100644 --- a/worker/src/tests/mock.rs +++ b/worker/src/tests/mock.rs @@ -4,8 +4,8 @@ use primitive_types::H256; pub struct TestNodeApi; -const W1_URL: &str = "127.0.0.1:2222"; -const W2_URL: &str = "127.0.0.1:2223"; +pub const W1_URL: &str = "127.0.0.1:2222"; +pub const W2_URL: &str = "127.0.0.1:2223"; fn enclaves() -> Vec { vec![ diff --git a/worker/src/worker.rs b/worker/src/worker.rs index f6653bc74e..c242158a84 100644 --- a/worker/src/worker.rs +++ b/worker/src/worker.rs @@ -1,16 +1,17 @@ +use async_trait::async_trait; +use jsonrpsee::{ + types::{to_json_value, traits::Client}, + ws_client::WsClientBuilder, +}; use log::info; -use sp_core::sr25519; -use std::sync::mpsc::channel; use std::sync::Arc; -use substrate_api_client::{Api, XtStatus}; -use substratee_api_client_extensions::SubstrateeRegistryApi; +use substratee_api_client_extensions::SubstrateeRegistryApi; +// use substratee_worker_api::direct_client::WorkerToWorkerApi; use substratee_worker_primitives::block::SignedBlock as SignedSidechainBlock; use crate::config::Config; use crate::error::Error; -use crate::utils::hex_encode; -use substratee_worker_api::direct_client::WorkerToWorkerApi; pub type WorkerResult = Result; @@ -21,56 +22,111 @@ pub struct Worker { _worker_api_direct: Arc, } +impl Worker { + pub fn new( + config: Config, + node_api: NodeApi, + _enclave_api: Enclave, + _worker_api_direct: WorkerApiDirect, + ) -> Self { + Self { + config, + node_api, + _enclave_api, + _worker_api_direct: Arc::new(_worker_api_direct), + } + } +} + +#[async_trait] pub trait WorkerT { - fn send_confirmations(&self, confirms: Vec>) -> WorkerResult<()>; - fn gossip_blocks(&self, blocks: Vec) -> WorkerResult<()>; + // fn send_confirmations(&self, confirms: Vec>) -> WorkerResult<()>; + async fn gossip_blocks(&self, blocks: Vec) -> WorkerResult<()>; } -// todo make generic over api also, but for this, we need to hide sending extrinsics behind a trait -impl WorkerT - for Worker, Enclave, WorkerApiDirect> +#[async_trait] +impl WorkerT + for Worker +where + NodeApi: SubstrateeRegistryApi + Send + Sync, + Enclave: Send + Sync, + WorkerApiDirect: Send + Sync, { - fn send_confirmations(&self, confirms: Vec>) -> WorkerResult<()> { - if !confirms.is_empty() { - println!("Enclave wants to send {} extrinsics", confirms.len()); - - for call in confirms.into_iter() { - self.node_api - .send_extrinsic(hex_encode(call), XtStatus::Ready)?; - } - // await next block to avoid #37 - let (events_in, events_out) = channel(); - self.node_api.subscribe_events(events_in)?; - let _ = events_out.recv().unwrap(); - let _ = events_out.recv().unwrap(); - // FIXME: we should unsubscribe here or the thread will throw a SendError because the channel is destroyed - } - Ok(()) - } - - fn gossip_blocks(&self, _blocks: Vec) -> WorkerResult<()> { + async fn gossip_blocks(&self, blocks: Vec) -> WorkerResult<()> { let mut peers = self.node_api.all_enclaves()?; peers.retain(|e| e.url != self.config.worker_url()); info!("Gossiping sidechain blocks to peers: {:?}", peers); - // for p in peers.iter() { - // self.worker_api_direct.send_blocks() - // } + for p in peers.iter() { + let url = format!("ws://{}", p.url); + info!("Gossiping block to peer with address: {:?}", url); + let client = WsClientBuilder::default().build(&url).await?; + let response: String = client + .request( + "author_importBlock", + vec![to_json_value(blocks.clone()).unwrap()].into(), + ) + .await?; + println!("Response: {:?}", response); + } Ok(()) } } #[cfg(test)] mod tests { - use jsonrpsee::{wsclient::WsClientBuilder, wsserver::WsServerBuilder}; - use sp_core::H256; - use substratee_api_client_extensions::{ApiResult, SubstrateeRegistryApi}; - use substratee_node_primitives::{Enclave, ShardIdentifier}; - use crate::tests::mock::TestNodeApi; + use jsonrpsee::{ws_server::WsServerBuilder, RpcModule}; + use log::debug; + use std::net::SocketAddr; + use tokio::net::ToSocketAddrs; + + use crate::config::Config; + use crate::tests::{ + commons::test_sidechain_block, + mock::{TestNodeApi, W1_URL, W2_URL}, + }; + use crate::worker::{Worker, WorkerT}; + + fn init() { + let _ = env_logger::builder().is_test(true).try_init(); + } + + async fn run_server(addr: impl ToSocketAddrs) -> anyhow::Result { + let mut server = WsServerBuilder::default().build(addr).await?; + let mut module = RpcModule::new(()); + + module.register_method("author_importBlock", |params, _| { + debug!("author_importBlock params: {:?}", params); + Ok("Hello") + })?; + + server.register_module(module).unwrap(); + + let socket_addr = server.local_addr()?; + tokio::spawn(async move { server.start().await }); + Ok(socket_addr) + } + + fn test_config(worker_url: String) -> Config { + Config::new( + Default::default(), + Default::default(), + "127.0.0.1".into(), + worker_url.split(":").collect::>()[1].into(), + Default::default(), + ) + } - #[test] - fn gossip_blocks_works() { + #[tokio::test] + async fn gossip_blocks_works() { + init(); + run_server(W2_URL).await.unwrap(); + let worker = Worker::new(test_config(W1_URL.into()), TestNodeApi, (), ()); + worker + .gossip_blocks(vec![test_sidechain_block()]) + .await + .unwrap(); } } From 707c3b7fd59b94c88460804e0ce60179db6da383 Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Thu, 10 Jun 2021 15:11:01 +0200 Subject: [PATCH 16/80] [worker/test] mock enclave deterministic enclaves --- worker/src/tests/mock.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/worker/src/tests/mock.rs b/worker/src/tests/mock.rs index 95bdd8ab21..cedb1ff5fe 100644 --- a/worker/src/tests/mock.rs +++ b/worker/src/tests/mock.rs @@ -1,6 +1,5 @@ use substratee_api_client_extensions::{SubstrateeRegistryApi, ApiResult}; use substratee_node_primitives::{Enclave, ShardIdentifier}; -use primitive_types::H256; pub struct TestNodeApi; @@ -10,14 +9,14 @@ pub const W2_URL: &str = "127.0.0.1:2223"; fn enclaves() -> Vec { vec![ Enclave::new( - H256::random().to_fixed_bytes().into(), - H256::random().to_fixed_bytes().into(), + [0;32].into(), + [1;32].into(), 1, W1_URL.into(), ), Enclave::new( - H256::random().to_fixed_bytes().into(), - H256::random().to_fixed_bytes().into(), + [2;32].into(), + [3;32].into(), 2, W2_URL.into(), ), @@ -34,7 +33,6 @@ impl SubstrateeRegistryApi for TestNodeApi { } fn all_enclaves(&self) -> ApiResult> { - // the args are okay here. The IDE does not grasp types depending on feature flags. Ok(enclaves()) } From cf1d6f308852d1c8744d4551c1f14fe8b872c9d1 Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Thu, 10 Jun 2021 15:24:08 +0200 Subject: [PATCH 17/80] [worker] add Serialization error --- worker/src/error.rs | 2 ++ worker/src/worker.rs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/worker/src/error.rs b/worker/src/error.rs index ed918b0310..c152889ddf 100644 --- a/worker/src/error.rs +++ b/worker/src/error.rs @@ -9,4 +9,6 @@ pub enum Error { ApiClientError(#[from] ApiClientError), #[error("{0}")] JsonRpSeeClient(#[from] jsonrpsee::types::Error), + #[error("{0}")] + Serialization(#[from] serde_json::Error), } \ No newline at end of file diff --git a/worker/src/worker.rs b/worker/src/worker.rs index c242158a84..c0f04fd228 100644 --- a/worker/src/worker.rs +++ b/worker/src/worker.rs @@ -64,7 +64,7 @@ where let response: String = client .request( "author_importBlock", - vec![to_json_value(blocks.clone()).unwrap()].into(), + vec![to_json_value(blocks.clone())?].into(), ) .await?; println!("Response: {:?}", response); From 1edb129b0bdcab5c9ea78965c8f57d7695e133bd Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Thu, 10 Jun 2021 15:25:31 +0200 Subject: [PATCH 18/80] [worker/worker] make println! to info! --- worker/src/worker.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worker/src/worker.rs b/worker/src/worker.rs index c0f04fd228..bf52269b80 100644 --- a/worker/src/worker.rs +++ b/worker/src/worker.rs @@ -67,7 +67,7 @@ where vec![to_json_value(blocks.clone())?].into(), ) .await?; - println!("Response: {:?}", response); + info!("author_importBlock response: {:?}", response); } Ok(()) } From 7288c8f9e210f94f94f44655475af64930de2925 Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Thu, 10 Jun 2021 15:32:47 +0200 Subject: [PATCH 19/80] typo --- primitives/node/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/primitives/node/src/lib.rs b/primitives/node/src/lib.rs index d191059afa..0a9ad48ff4 100644 --- a/primitives/node/src/lib.rs +++ b/primitives/node/src/lib.rs @@ -37,7 +37,7 @@ pub type SubstrateeConfirmCallFn = ([u8; 2], ShardIdentifier, H256, Vec); pub type ShieldFundsFn = ([u8; 2], Vec, u128, ShardIdentifier); pub type CallWorkerFn = ([u8; 2], Request); -// Todo: move this improved enclave definition into a primitives crate substratee-registry repo. +// Todo: move this improved enclave definition into a primitives crate in the substratee-registry repo. #[derive(Encode, Decode, Default, Clone, PartialEq, sp_core::RuntimeDebug)] pub struct EnclaveGen { pub pubkey: AccountId, From b83c2d2918fd550710593d1175f12d20d801fb5b Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Thu, 10 Jun 2021 16:06:10 +0200 Subject: [PATCH 20/80] Add simpel RwLock test for the worker. --- worker/src/tests/commons.rs | 14 ++++++++++++++ worker/src/tests/mock.rs | 2 +- worker/src/tests/mod.rs | 3 +++ worker/src/tests/worker.rs | 34 ++++++++++++++++++++++++++++++++++ worker/src/worker.rs | 4 ++++ 5 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 worker/src/tests/worker.rs diff --git a/worker/src/tests/commons.rs b/worker/src/tests/commons.rs index ea51f9317c..c1c16b3a91 100644 --- a/worker/src/tests/commons.rs +++ b/worker/src/tests/commons.rs @@ -32,6 +32,7 @@ use crate::{enclave_account, ensure_account_has_funds}; use substrate_api_client::Api; use substratee_stf::{Index, KeyPair, ShardIdentifier, TrustedCall, TrustedGetter, Getter}; use substratee_worker_primitives::block::{SignedBlock, Block}; +use crate::config::Config; #[derive(Debug, Serialize, Deserialize)] pub struct Message { @@ -155,4 +156,17 @@ pub fn test_sidechain_block() -> SignedBlock { encrypted_payload.clone(), ); block.sign(&signer_pair) +} + +/// Local Worker config. Fields are the default values except for +/// the worker's rpc server. +pub fn local_worker_config(worker_url: String) -> Config { + let mut url = worker_url.split(":"); + Config::new( + Default::default(), + Default::default(), + url.next().unwrap().into(), + url.next().unwrap().into(), + Default::default(), + ) } \ No newline at end of file diff --git a/worker/src/tests/mock.rs b/worker/src/tests/mock.rs index cedb1ff5fe..9b1cc7728e 100644 --- a/worker/src/tests/mock.rs +++ b/worker/src/tests/mock.rs @@ -6,7 +6,7 @@ pub struct TestNodeApi; pub const W1_URL: &str = "127.0.0.1:2222"; pub const W2_URL: &str = "127.0.0.1:2223"; -fn enclaves() -> Vec { +pub fn enclaves() -> Vec { vec![ Enclave::new( [0;32].into(), diff --git a/worker/src/tests/mod.rs b/worker/src/tests/mod.rs index 8687675438..99be5402a2 100644 --- a/worker/src/tests/mod.rs +++ b/worker/src/tests/mod.rs @@ -27,6 +27,9 @@ pub mod ecalls; pub mod integration_tests; pub mod mock; +#[cfg(test)] +pub mod worker; + pub fn run_enclave_tests(matches: &ArgMatches, port: &str) { println!("*** Starting Test enclave"); let enclave = enclave_init().unwrap(); diff --git a/worker/src/tests/worker.rs b/worker/src/tests/worker.rs new file mode 100644 index 0000000000..29c3ae2aa9 --- /dev/null +++ b/worker/src/tests/worker.rs @@ -0,0 +1,34 @@ +use lazy_static::lazy_static; +use parking_lot::RwLock; +use substratee_api_client_extensions::SubstrateeRegistryApi; + +use crate::config::Config; +use crate::tests::commons::local_worker_config; +use crate::tests::mock::{enclaves, TestNodeApi, W2_URL}; +use crate::worker::Worker as WorkerGen; + +type TestWorker = WorkerGen; + +lazy_static! { + static ref WORKER: RwLock> = RwLock::new(None); +} + +#[test] +fn worker_rw_lock_works() { + { + let mut w = WORKER.write(); + *w = Some(TestWorker::new( + local_worker_config(W2_URL.into()), + TestNodeApi, + (), + (), + )); + } + + let w = WORKER.read(); + // call some random function to see how the worker needs to be called. + assert_eq!( + w.as_ref().unwrap().node_api().all_enclaves().unwrap(), + enclaves() + ) +} diff --git a/worker/src/worker.rs b/worker/src/worker.rs index bf52269b80..e32bcbccd2 100644 --- a/worker/src/worker.rs +++ b/worker/src/worker.rs @@ -36,6 +36,10 @@ impl Worker &NodeApi { + &self.node_api + } } #[async_trait] From 013b301ee7b5162aab3d77d620a2a62001b641cf Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Thu, 10 Jun 2021 16:12:59 +0200 Subject: [PATCH 21/80] [worker/worker] use test_config defined in tests/commons --- worker/src/worker.rs | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/worker/src/worker.rs b/worker/src/worker.rs index e32bcbccd2..40a9e0c3c3 100644 --- a/worker/src/worker.rs +++ b/worker/src/worker.rs @@ -84,9 +84,8 @@ mod tests { use std::net::SocketAddr; use tokio::net::ToSocketAddrs; - use crate::config::Config; use crate::tests::{ - commons::test_sidechain_block, + commons::{test_sidechain_block, local_worker_config}, mock::{TestNodeApi, W1_URL, W2_URL}, }; use crate::worker::{Worker, WorkerT}; @@ -111,22 +110,12 @@ mod tests { Ok(socket_addr) } - fn test_config(worker_url: String) -> Config { - Config::new( - Default::default(), - Default::default(), - "127.0.0.1".into(), - worker_url.split(":").collect::>()[1].into(), - Default::default(), - ) - } - #[tokio::test] async fn gossip_blocks_works() { init(); run_server(W2_URL).await.unwrap(); - let worker = Worker::new(test_config(W1_URL.into()), TestNodeApi, (), ()); + let worker = Worker::new(local_worker_config(W1_URL.into()), TestNodeApi, (), ()); worker .gossip_blocks(vec![test_sidechain_block()]) From 965b1be1ba968794059449dd6a9a8731eb94b74f Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Thu, 10 Jun 2021 16:51:58 +0200 Subject: [PATCH 22/80] [worker/worker] remove some warnings --- worker/src/config.rs | 18 ++++++++---------- worker/src/tests/commons.rs | 12 ++++++++++-- worker/src/worker.rs | 2 ++ 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/worker/src/config.rs b/worker/src/config.rs index bc859f7836..624b24389f 100644 --- a/worker/src/config.rs +++ b/worker/src/config.rs @@ -30,8 +30,7 @@ impl Config { } } - - pub fn node_url(&self) -> String { + pub fn node_url(&self) -> String { format!("{}:{}", self.node_ip, self.node_port) } @@ -50,17 +49,16 @@ impl Config { impl From<&ArgMatches<'_>> for Config { fn from(m: &ArgMatches<'_>) -> Self { - Self { - node_ip: m.value_of("node-server").unwrap_or("ws://127.0.0.1").into(), - node_port: m.value_of("node-port").unwrap_or("9944").into(), - worker_ip: if m.is_present("ws-external") { + Self::new( + m.value_of("node-server").unwrap_or("ws://127.0.0.1").into(), + m.value_of("node-port").unwrap_or("9944").into(), + if m.is_present("ws-external") { "0.0.0.0".into() } else { "127.0.0.1".into() }, - worker_rpc_port: m.value_of("worker-rpc-port").unwrap_or("2000").into(), - worker_mu_ra_port: m.value_of("mu-ra-port").unwrap_or("3443").into(), - ext_api_url: None, - } + m.value_of("worker-rpc-port").unwrap_or("2000").into(), + m.value_of("mu-ra-port").unwrap_or("3443").into(), + ) } } \ No newline at end of file diff --git a/worker/src/tests/commons.rs b/worker/src/tests/commons.rs index c1c16b3a91..7fdc93179d 100644 --- a/worker/src/tests/commons.rs +++ b/worker/src/tests/commons.rs @@ -22,7 +22,7 @@ use serde_derive::{Deserialize, Serialize}; use sgx_crypto_helper::rsa3072::Rsa3072PubKey; use sgx_types::*; use sp_core::crypto::AccountId32; -use sp_core::{sr25519, H256, Pair}; +use sp_core::sr25519; use sp_keyring::AccountKeyring; use std::{fs, str}; @@ -31,8 +31,11 @@ use crate::enclave::api::*; use crate::{enclave_account, ensure_account_has_funds}; use substrate_api_client::Api; use substratee_stf::{Index, KeyPair, ShardIdentifier, TrustedCall, TrustedGetter, Getter}; -use substratee_worker_primitives::block::{SignedBlock, Block}; + +#[test] use crate::config::Config; +#[test] +use substratee_worker_primitives::block::{SignedBlock, Block}; #[derive(Debug, Serialize, Deserialize)] pub struct Message { @@ -135,7 +138,11 @@ pub fn get_nonce(api: &Api, who: &AccountId32) -> u32 { } } +#[cfg(test)] pub fn test_sidechain_block() -> SignedBlock { + use sp_core::{H256, Pair}; + + let signer_pair = sp_core::ed25519::Pair::from_string("//Alice", None).unwrap(); let author: AccountId32 = signer_pair.public().into(); let block_number: u64 = 0; @@ -160,6 +167,7 @@ pub fn test_sidechain_block() -> SignedBlock { /// Local Worker config. Fields are the default values except for /// the worker's rpc server. +#[cfg(test)] pub fn local_worker_config(worker_url: String) -> Config { let mut url = worker_url.split(":"); Config::new( diff --git a/worker/src/worker.rs b/worker/src/worker.rs index 40a9e0c3c3..c1e494c249 100644 --- a/worker/src/worker.rs +++ b/worker/src/worker.rs @@ -37,6 +37,8 @@ impl Worker &NodeApi { &self.node_api } From b5ae6de4bb4dd19f82547e6d8132f216ab6680b7 Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Thu, 10 Jun 2021 16:52:32 +0200 Subject: [PATCH 23/80] [worker] initialize lazy_static worker --- worker/src/main.rs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/worker/src/main.rs b/worker/src/main.rs index e08f01a7c3..80b2d9ad72 100644 --- a/worker/src/main.rs +++ b/worker/src/main.rs @@ -70,6 +70,7 @@ use substratee_settings::files::{ use worker::{Worker as WorkerGen}; use crate::utils::{extract_shard, hex_encode, check_files, write_slice_and_whitespace_pad}; +use crate::worker::WorkerT; mod enclave; mod ipfs; @@ -104,6 +105,14 @@ fn main() { println!("Worker Config: {:?}", config); *NODE_URL.lock().unwrap() = config.node_url(); + *WORKER.write() = Some( + Worker::new( + config.clone(), + Api::new(config.node_url()).map(|api| api.set_signer(AccountKeyring::Alice.pair())).unwrap(), + Enclave, + DirectClient::new(config.worker_url()), + ) + ); if let Some(smatches) = matches.subcommand_matches("run") { println!("*** Starting substraTEE-worker"); @@ -668,7 +677,7 @@ pub unsafe extern "C" fn ocall_worker_request( /// /// FFI are always unsafe #[no_mangle] -pub unsafe extern "C" fn ocall_send_block_and_confirmation( +pub async unsafe extern "C" fn ocall_send_block_and_confirmation( confirmations: *const u8, confirmations_size: u32, signed_blocks_ptr: *const u8, @@ -718,9 +727,12 @@ pub unsafe extern "C" fn ocall_send_block_and_confirmation( vec![] } }; + println! {"Received blocks: {:?}", signed_blocks}; + + let w = WORKER.read(); + w.as_ref().unwrap().gossip_blocks(signed_blocks).await.unwrap(); // TODO: M8.3: Store blocks - // TODO: M8.3: broadcast blocks status } From 792802b8638876afd705fcca099f06a72b4bb8cf Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Thu, 10 Jun 2021 20:03:44 +0200 Subject: [PATCH 24/80] [stf] move all sgx stuff into sgx file. --- enclave/src/tests.rs | 2 +- stf/src/lib.rs | 18 +++--------------- stf/src/sgx.rs | 15 +++++++++++++-- 3 files changed, 17 insertions(+), 18 deletions(-) diff --git a/enclave/src/tests.rs b/enclave/src/tests.rs index 8951c44ab3..f781775e32 100644 --- a/enclave/src/tests.rs +++ b/enclave/src/tests.rs @@ -49,7 +49,7 @@ use chain_relay::{Block, Header}; use sp_runtime::traits::Header as HeaderT; use sgx_externalities::SgxExternalitiesTypeTrait; -use substratee_stf::sgx::AccountInfo; +use substratee_stf::AccountInfo; use substratee_stf::StateTypeDiff as StfStateTypeDiff; use substratee_stf::{ShardIdentifier, Stf, TrustedCall}; use substratee_stf::{TrustedGetter, TrustedOperation}; diff --git a/stf/src/lib.rs b/stf/src/lib.rs index d3509ff5bc..8c98341b9a 100644 --- a/stf/src/lib.rs +++ b/stf/src/lib.rs @@ -33,10 +33,6 @@ use codec::{Compact, Decode, Encode}; use my_node_runtime::Balance; #[cfg(feature = "std")] pub use my_node_runtime::Index; -#[cfg(feature = "sgx")] -use sgx_runtime::Balance; -#[cfg(feature = "sgx")] -pub use sgx_runtime::Index; use sp_core::crypto::AccountId32; //use sp_core::{Encode, Decode}; @@ -91,17 +87,12 @@ impl From for KeyPair { #[cfg(feature = "sgx")] pub mod sgx; +#[cfg(feature = "sgx")] +pub use sgx::types::*; + #[cfg(feature = "std")] pub mod cli; -#[cfg(feature = "sgx")] -//pub type State = sp_io::SgxExternalitiesType; -pub type StateType = sgx_externalities::SgxExternalitiesType; -#[cfg(feature = "sgx")] -pub type State = sgx_externalities::SgxExternalities; -#[cfg(feature = "sgx")] -pub type StateTypeDiff = sgx_externalities::SgxExternalitiesDiffType; - #[derive(Encode, Decode, Clone, core::fmt::Debug)] #[allow(non_camel_case_types)] pub enum TrustedOperation { @@ -284,9 +275,6 @@ pub struct TrustedReturnValue { impl TrustedReturnValue */ -#[cfg(feature = "sgx")] -pub struct Stf {} - #[cfg(test)] mod tests { use super::*; diff --git a/stf/src/sgx.rs b/stf/src/sgx.rs index 63f50158c4..cae1e28f79 100644 --- a/stf/src/sgx.rs +++ b/stf/src/sgx.rs @@ -32,8 +32,19 @@ impl Encode for OpaqueCall { } } -pub type AccountData = balances::AccountData; -pub type AccountInfo = system::AccountInfo; +pub mod types { + pub use sgx_runtime::{Balance, Index}; + pub type AccountData = balances::AccountData; + pub type AccountInfo = system::AccountInfo; + + pub type StateType = sgx_externalities::SgxExternalitiesType; + pub type State = sgx_externalities::SgxExternalities; + pub type StateTypeDiff = sgx_externalities::SgxExternalitiesDiffType; + pub struct Stf {} +} + +use types::*; + const ALICE_ENCODED: [u8; 32] = [ 212, 53, 147, 199, 21, 253, 211, 28, 97, 20, 26, 189, 4, 169, 159, 214, 130, 44, 133, 88, 133, From 7ed5253a0fb38a53c73ef3827683e931ac0dcc88 Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Thu, 10 Jun 2021 20:39:19 +0200 Subject: [PATCH 25/80] move StfStatePayload to Stf --- Cargo.lock | 1665 +++++++++++++++----------------- enclave/src/lib.rs | 4 +- enclave/src/tests.rs | 3 +- primitives/worker/src/block.rs | 52 - stf/Cargo.toml | 4 +- stf/src/lib.rs | 62 ++ stf/src/sgx.rs | 2 +- 7 files changed, 835 insertions(+), 957 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 01ac56c78c..573b790ae7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -9,14 +9,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" dependencies = [ "lazy_static", - "regex 1.5.4", + "regex 1.4.5", ] [[package]] name = "addr2line" -version = "0.15.2" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7a2e47a1fbe209ee101dd6d61285226744c6c8d3c21c8dc878ba6cb9f467f3a" +checksum = "a55f82cfe485775d02112886f4169bde0c5894d75e79ead7eafe7e40a25e45f7" dependencies = [ "gimli", ] @@ -44,11 +44,11 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "0.7.18" +version = "0.7.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" +checksum = "7404febffaa47dac81aa44dba71523c9d069b1bdc50a77db41195149e17f68e5" dependencies = [ - "memchr 2.4.0", + "memchr 2.3.4", ] [[package]] @@ -71,24 +71,15 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.41" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15af2628f6890fe2609a3b91bef4c83450512802e59489f9c1cb1fa5df064a61" - -[[package]] -name = "approx" -version = "0.4.0" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f2a05fd1bd10b2527e20a2cd32d8873d115b8b39fe219ee25f42a8aca6ba278" -dependencies = [ - "num-traits", -] +checksum = "28b2cd92db5cbd74e8e5028f7e27dd7aa3090e89e4f2a197cc7c8dfb69c7063b" [[package]] name = "approx" -version = "0.5.0" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "072df7202e63b127ab55acfe16ce97013d5b97bf160489336d3f1840fd78e99e" +checksum = "f0e60b75072ecd4168020818c0107f2857bb6c4e64252d8d3983f6263b40a5c3" dependencies = [ "num-traits", ] @@ -115,16 +106,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" [[package]] -name = "arrayvec" -version = "0.7.1" +name = "asn1_der" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4dc07131ffa69b8072d35f5007352af944213cde02545e2103680baed38fcd" +checksum = "6fce6b6a0ffdafebd82c87e79e3f40e8d2c523e5fea5566ff6b90509bf98d638" +dependencies = [ + "asn1_der_derive", +] [[package]] -name = "asn1_der" -version = "0.7.4" +name = "asn1_der_derive" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d6e24d2cce90c53b948c46271bfb053e4bdc2db9b5d3f65e20f8cf28a1b7fc3" +checksum = "0d0864d84b8e07b145449be9a8537db86bf9de5ce03b913214694643b4743502" +dependencies = [ + "quote 1.0.9", + "syn 1.0.68", +] [[package]] name = "async-channel" @@ -139,16 +137,16 @@ dependencies = [ [[package]] name = "async-executor" -version = "1.4.1" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "871f9bb5e0a22eeb7e8cf16641feb87c9dc67032ccf8ff49e772eb9941d3a965" +checksum = "eb877970c7b440ead138f6321a3b5395d6061183af779340b65e20c0fede9146" dependencies = [ "async-task", "concurrent-queue", "fastrand", "futures-lite", - "once_cell 1.8.0", - "slab", + "once_cell 1.7.2", + "vec-arena", ] [[package]] @@ -164,34 +162,34 @@ dependencies = [ "blocking", "futures-lite", "num_cpus", - "once_cell 1.8.0", + "once_cell 1.7.2", ] [[package]] name = "async-io" -version = "1.4.1" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bbfd5cf2794b1e908ea8457e6c45f8f8f1f6ec5f74617bf4662623f47503c3b" +checksum = "9315f8f07556761c3e48fec2e6b276004acf426e6dc068b2c2251854d65ee0fd" dependencies = [ "concurrent-queue", "fastrand", "futures-lite", "libc", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", - "once_cell 1.8.0", + "nb-connect", + "once_cell 1.7.2", "parking", "polling", - "slab", - "socket2", + "vec-arena", "waker-fn", "winapi 0.3.9", ] [[package]] name = "async-lock" -version = "2.4.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6a8ea61bf9947a1007c5cada31e647dbc77b103c679858150003ba697ea798b" +checksum = "1996609732bde4a9988bc42125f55f2af5f3c36370e27c778d5191a4a1b63bfb" dependencies = [ "event-listener", ] @@ -207,17 +205,16 @@ dependencies = [ [[package]] name = "async-process" -version = "1.1.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f38756dd9ac84671c428afbf7c9f7495feff9ec5b0710f17100098e5b354ac" +checksum = "ef37b86e2fa961bae5a4d212708ea0154f904ce31d1a4a7f47e1bbc33a0c040b" dependencies = [ "async-io", "blocking", "cfg-if 1.0.0", "event-listener", "futures-lite", - "libc", - "once_cell 1.8.0", + "once_cell 1.7.2", "signal-hook", "winapi 0.3.9", ] @@ -241,9 +238,9 @@ dependencies = [ "gloo-timers", "kv-log-macro", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", - "memchr 2.4.0", + "memchr 2.3.4", "num_cpus", - "once_cell 1.8.0", + "once_cell 1.7.2", "pin-project-lite 0.2.6", "pin-utils", "slab", @@ -264,7 +261,7 @@ checksum = "0b98e84bbb4cbcdd97da190ba0c58a1bb0de2c1fdf67d159e192ed766aeca722" dependencies = [ "proc-macro2", "quote 1.0.9", - "syn 1.0.73", + "syn 1.0.68", ] [[package]] @@ -307,12 +304,11 @@ checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" [[package]] name = "backtrace" -version = "0.3.60" +version = "0.3.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7815ea54e4d821e791162e078acbebfd6d8c8939cd559c9335dceb1c8ca7282" +checksum = "9d117600f438b1707d4e4ae15d3595657288f8235a0eb593e80ecc98ab34e1bc" dependencies = [ "addr2line", - "cc", "cfg-if 1.0.0", "libc", "miniz_oxide", @@ -371,9 +367,9 @@ dependencies = [ [[package]] name = "bitvec" -version = "0.20.4" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7774144344a4faa177370406a7ff5f1da24303817368584c6206c8303eb07848" +checksum = "1f682656975d3a682daff957be4ddeb65d6ad656737cd821f2d00685ae466af1" dependencies = [ "funty", "radium 0.6.2", @@ -453,7 +449,7 @@ dependencies = [ "atomic-waker", "fastrand", "futures-lite", - "once_cell 1.8.0", + "once_cell 1.7.2", ] [[package]] @@ -464,11 +460,11 @@ checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" [[package]] name = "bstr" -version = "0.2.16" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90682c8d613ad3373e66de8c6411e0ae2ab2571e879d2efbf73558cc66f21279" +checksum = "a40b47ad93e1a5404e6c18dec46b628214fee441c70f4ab5d6942142cc268a3d" dependencies = [ - "memchr 2.4.0", + "memchr 2.3.4", ] [[package]] @@ -482,9 +478,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.7.0" +version = "3.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c59e7af012c713f529e7a3ee57ce9b31ddd858d4b512923602f74608b009631" +checksum = "63396b8a4b9de3f4fdfb320ab6080762242f66a8ef174c49d8e19b674db4cdbe" [[package]] name = "byte-slice-cast" @@ -544,15 +540,6 @@ version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "631ae5198c9be5e753e5cc215e1bd73c2b466a3565173db433f52bb9d3e66dba" -[[package]] -name = "camino" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4648c6d00a709aa069a236adcaae4f605a6241c72bf5bee79331a4b625921a9" -dependencies = [ - "serde", -] - [[package]] name = "cargo-platform" version = "0.1.1" @@ -564,11 +551,10 @@ dependencies = [ [[package]] name = "cargo_metadata" -version = "0.13.1" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "081e3f0755c1f380c2d010481b6fa2e02973586d5f2b24eebb7a2a1d98b143d8" +checksum = "7714a157da7991e23d90686b9524b9e12e0407a108647f52e9328f4b3d51ac7f" dependencies = [ - "camino", "cargo-platform", "semver 0.11.0", "semver-parser 0.10.2", @@ -578,12 +564,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.68" +version = "1.0.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a72c244c1ff497a746a7e1fb3d14bd08420ecda70c8f25c7112f2781652d787" -dependencies = [ - "jobserver", -] +checksum = "e3c69b077ad434294d3ce9f1f6143a2a4b89a8a2d54ef813d85003a4fd1137fd" [[package]] name = "cfg-if" @@ -646,6 +629,15 @@ dependencies = [ "clap", ] +[[package]] +name = "clear_on_drop" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9cc5db465b294c3fa986d5bbb0f3017cd850bff6dd6c52f9ccff8b4d21b7b08" +dependencies = [ + "cc", +] + [[package]] name = "cloudabi" version = "0.0.3" @@ -666,7 +658,7 @@ dependencies = [ "http", "mime", "mime_guess", - "rand 0.8.4", + "rand 0.8.3", "thiserror", ] @@ -709,19 +701,26 @@ checksum = "ea221b5284a47e40033bf9b66f35f984ec0ea2931eb03505246cd27a963f981b" [[package]] name = "cpufeatures" -version = "0.1.5" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66c99696f6c9dd7f35d486b9d04d7e6e202aa3e8c40d553f2fdf5e7e0c6a71ef" +checksum = "ed00c67cb5d0a7d64a44f6ad2668db7e7530311dd53ea79bcd4fb022c64911c8" dependencies = [ "libc", ] +[[package]] +name = "cpuid-bool" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8aebca1129a03dc6dc2b127edd729435bbc4a37e1d5f4d7513165089ceb02634" + [[package]] name = "crossbeam-utils" -version = "0.8.5" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d82cfc11ce7f2c3faef78d8a684447b40d503d9681acebed6cb728d45940c4db" +checksum = "e7e9d99fa91428effe99c5c6d4634cdeba32b8cf784fc428a2a687f61a952c49" dependencies = [ + "autocfg 1.0.1", "cfg-if 1.0.0", "lazy_static", ] @@ -768,7 +767,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5e98e2ad1a782e33928b96fc3948e7c355e5af34ba4de7670fe8bac2a3b2006d" dependencies = [ "quote 1.0.9", - "syn 1.0.73", + "syn 1.0.68", +] + +[[package]] +name = "curve25519-dalek" +version = "1.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d59fed08e452f286b251f88b2fc64a01f50a7b263aa09557ad7285d9e7fa" +dependencies = [ + "byteorder", + "clear_on_drop", + "digest 0.8.1", + "rand_core 0.3.1", + "subtle 2.4.0", ] [[package]] @@ -781,20 +793,20 @@ dependencies = [ "digest 0.8.1", "rand_core 0.5.1", "subtle 2.4.0", - "zeroize", + "zeroize 1.2.0", ] [[package]] name = "curve25519-dalek" -version = "3.1.0" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "639891fde0dbea823fc3d798a0fdf9d2f9440a42d64a78ab3488b0ca025117b3" +checksum = "f627126b946c25a4638eec0ea634fc52506dea98db118aae985118ce7c3d723f" dependencies = [ "byteorder", "digest 0.9.0", "rand_core 0.5.1", "subtle 2.4.0", - "zeroize", + "zeroize 1.2.0", ] [[package]] @@ -805,14 +817,14 @@ checksum = "3ee2393c4a91429dffb4bedf19f4d6abf27d8a732c8ce4980305d782e5426d57" [[package]] name = "derive_more" -version = "0.99.14" +version = "0.99.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cc7b9cef1e351660e5443924e4f43ab25fbbed3e9a5f052df3677deb4d6b320" +checksum = "f82b1b72f1263f214c0f823371768776c4f5841b942c9883aa8e5ec584fd0ba6" dependencies = [ "convert_case", "proc-macro2", "quote 1.0.9", - "syn 1.0.73", + "syn 1.0.68", ] [[package]] @@ -849,36 +861,30 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fd78930633bd1c6e35c4b42b1df7b0cbc6bc191146e512bb3bedf243fcc3901" dependencies = [ "libc", - "redox_users 0.3.5", + "redox_users", "winapi 0.3.9", ] [[package]] name = "dirs" -version = "3.0.2" +version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30baa043103c9d0c2a57cf537cc2f35623889dc0d405e6c3cccfadbc81c71309" +checksum = "142995ed02755914747cc6ca76fc7e4583cd18578746716d0508ea6ed558b9ff" dependencies = [ "dirs-sys", ] [[package]] name = "dirs-sys" -version = "0.3.6" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03d86534ed367a67548dc68113a0f5db55432fdfbb6e6f9d77704397d95d5780" +checksum = "8e93d7f5705de3e49895a2b5e0b8855a1c27f080192ae9c32a6432d50741a57a" dependencies = [ "libc", - "redox_users 0.4.0", + "redox_users", "winapi 0.3.9", ] -[[package]] -name = "downcast-rs" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" - [[package]] name = "dyn-clonable" version = "0.9.0" @@ -897,7 +903,7 @@ checksum = "558e40ea573c374cf53507fd240b7ee2f5477df7cfebdb97323ec61c719399c5" dependencies = [ "proc-macro2", "quote 1.0.9", - "syn 1.0.73", + "syn 1.0.68", ] [[package]] @@ -908,9 +914,9 @@ checksum = "ee2626afccd7561a06cf1367e2950c4718ea04565e20fb5029b6c7d8ad09abcf" [[package]] name = "ed25519" -version = "1.1.1" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d0860415b12243916284c67a9be413e044ee6668247b99ba26d94b2bc06c8f6" +checksum = "37c66a534cbb46ab4ea03477eae19d5c22c01da8258030280b7bd9d8433fb6ef" dependencies = [ "signature", ] @@ -921,12 +927,12 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d" dependencies = [ - "curve25519-dalek 3.1.0", + "curve25519-dalek 3.0.2", "ed25519", "rand 0.7.3", "serde", - "sha2 0.9.5", - "zeroize", + "sha2 0.9.3", + "zeroize 1.2.0", ] [[package]] @@ -935,19 +941,6 @@ version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" -[[package]] -name = "env_logger" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44533bbbb3bb3c1fa17d9f2e4e38bbbaf8396ba82193c4cb1b6445d711445d36" -dependencies = [ - "atty", - "humantime 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.5.4", - "termcolor 1.1.2", -] - [[package]] name = "env_logger" version = "0.7.1" @@ -961,19 +954,23 @@ dependencies = [ ] [[package]] -name = "environmental" -version = "1.1.3" +name = "env_logger" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68b91989ae21441195d7d9b9993a2f9295c7e1a8c96255d8b729accddc124797" +checksum = "44533bbbb3bb3c1fa17d9f2e4e38bbbaf8396ba82193c4cb1b6445d711445d36" +dependencies = [ + "atty", + "humantime 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.4.5", + "termcolor 1.1.2", +] [[package]] -name = "erased-serde" -version = "0.3.16" +name = "environmental" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3de9ad4541d99dc22b59134e7ff8dc3d6c988c89ecd7324bf10a8362b07a2afa" -dependencies = [ - "serde", -] +checksum = "6576a1755ddffd988788025e75bce9e74b018f7cc226198fe931d077911c6d7e" [[package]] name = "event-listener" @@ -999,7 +996,7 @@ checksum = "aa4da3c766cd7a0db8242e326e9e4e081edd567072893ed320008189715366a4" dependencies = [ "proc-macro2", "quote 1.0.9", - "syn 1.0.73", + "syn 1.0.68", "synstructure", ] @@ -1011,25 +1008,25 @@ checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" [[package]] name = "fastrand" -version = "1.4.1" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77b705829d1e87f762c2df6da140b26af5839e1033aa84aa5f56bb688e4e1bdb" +checksum = "ca5faf057445ce5c9d4329e382b2ce7ca38550ef3b73a5348362d5f24e0c7fe3" dependencies = [ "instant", ] [[package]] name = "finality-grandpa" -version = "0.14.1" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74a1bfdcc776e63e49f741c7ce6116fa1b887e8ac2e3ccb14dd4aa113e54feb9" +checksum = "c6447e2f8178843749e8c8003206def83ec124a7859475395777a28b5338647c" dependencies = [ "either", "futures 0.3.15", "futures-timer", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits", - "parity-scale-codec 2.1.3", + "parity-scale-codec 2.0.1", "parking_lot 0.11.1", ] @@ -1052,7 +1049,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfcf0ed7fe52a17a03854ec54a9f76d6d84508d1c0e66bc1793301c73fc8493c" dependencies = [ "byteorder", - "rand 0.8.4", + "rand 0.8.3", "rustc-hex", "static_assertions", ] @@ -1096,15 +1093,14 @@ dependencies = [ [[package]] name = "frame-benchmarking" -version = "3.1.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" dependencies = [ "frame-support", "frame-system", "linregress", - "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-scale-codec 2.1.3", - "paste", + "parity-scale-codec 2.0.1", + "paste 1.0.5", "sp-api", "sp-io 3.0.0", "sp-runtime", @@ -1116,11 +1112,12 @@ dependencies = [ [[package]] name = "frame-executive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" +source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" dependencies = [ "frame-support", "frame-system", - "parity-scale-codec 2.1.3", + "parity-scale-codec 2.0.1", + "serde", "sp-core", "sp-io 3.0.0", "sp-runtime", @@ -1131,9 +1128,9 @@ dependencies = [ [[package]] name = "frame-metadata" version = "13.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" +source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" dependencies = [ - "parity-scale-codec 2.1.3", + "parity-scale-codec 2.0.1", "serde", "sp-core", "sp-std", @@ -1142,17 +1139,16 @@ dependencies = [ [[package]] name = "frame-support" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" +source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" dependencies = [ "bitflags", "frame-metadata", "frame-support-procedural", "impl-trait-for-tuples", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", - "max-encoded-len", - "once_cell 1.8.0", - "parity-scale-codec 2.1.3", - "paste", + "once_cell 1.7.2", + "parity-scale-codec 2.0.1", + "paste 1.0.5", "serde", "smallvec 1.6.1", "sp-arithmetic", @@ -1169,46 +1165,45 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" +source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" dependencies = [ "Inflector", "frame-support-procedural-tools", "proc-macro2", "quote 1.0.9", - "syn 1.0.73", + "syn 1.0.68", ] [[package]] name = "frame-support-procedural-tools" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" +source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" dependencies = [ "frame-support-procedural-tools-derive", - "proc-macro-crate 1.0.0", + "proc-macro-crate 0.1.5", "proc-macro2", "quote 1.0.9", - "syn 1.0.73", + "syn 1.0.68", ] [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" +source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" dependencies = [ "proc-macro2", "quote 1.0.9", - "syn 1.0.73", + "syn 1.0.68", ] [[package]] name = "frame-system" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" +source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" dependencies = [ "frame-support", "impl-trait-for-tuples", - "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-scale-codec 2.1.3", + "parity-scale-codec 2.0.1", "serde", "sp-core", "sp-io 3.0.0", @@ -1220,9 +1215,9 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" +source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" dependencies = [ - "parity-scale-codec 2.1.3", + "parity-scale-codec 2.0.1", "sp-api", ] @@ -1311,14 +1306,14 @@ checksum = "acc499defb3b348f8d8f3f66415835a9131856ff7714bf10dadfc4ec4bdb29a1" [[package]] name = "futures-lite" -version = "1.12.0" +version = "1.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7694489acd39452c77daa48516b894c153f192c3578d5a839b62c58099fcbf48" +checksum = "b4481d0cd0de1d204a4fa55e7d45f07b1d958abcb06714b3446438e2eff695fb" dependencies = [ "fastrand", "futures-core", "futures-io", - "memchr 2.4.0", + "memchr 2.3.4", "parking", "pin-project-lite 0.2.6", "waker-fn", @@ -1334,7 +1329,7 @@ dependencies = [ "proc-macro-hack", "proc-macro2", "quote 1.0.9", - "syn 1.0.73", + "syn 1.0.68", ] [[package]] @@ -1369,7 +1364,7 @@ dependencies = [ "futures-macro", "futures-sink", "futures-task", - "memchr 2.4.0", + "memchr 2.3.4", "pin-project-lite 0.2.6", "pin-utils", "proc-macro-hack", @@ -1401,6 +1396,15 @@ dependencies = [ "typenum", ] +[[package]] +name = "generic-array" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f797e67af32588215eaaab8327027ee8e71b9dd0b2b26996aedf20c030fce309" +dependencies = [ + "typenum", +] + [[package]] name = "generic-array" version = "0.14.4" @@ -1435,9 +1439,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.3" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753" +checksum = "c9495705279e7140bf035dde1f6e750c162df8b625267cd52cc44e0b156732c8" dependencies = [ "cfg-if 1.0.0", "libc", @@ -1446,21 +1450,21 @@ dependencies = [ [[package]] name = "gimli" -version = "0.24.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4075386626662786ddb0ec9081e7c7eeb1ba31951f447ca780ef9f5d568189" +checksum = "f6503fe142514ca4799d4c26297c4248239fe8838d827db6bd6065c6ed29a6ce" [[package]] name = "globset" -version = "0.4.8" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10463d9ff00a2a068db14231982f5132edebad0d7660cd956a1c30292dbcbfbd" +checksum = "c152169ef1e421390738366d2f796655fec62621dabbd0fd476f905934061e4a" dependencies = [ - "aho-corasick 0.7.18", + "aho-corasick 0.7.15", "bstr", "fnv", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.5.4", + "regex 1.4.5", ] [[package]] @@ -1498,9 +1502,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.3" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "825343c4eef0b63f541f8903f395dc5beb362a979b5799a84062527ef1e37726" +checksum = "fc018e188373e2777d0ef2467ebff62a08e66c3f5857b23c8fbec3018210dc00" dependencies = [ "bytes 1.0.1", "fnv", @@ -1510,8 +1514,8 @@ dependencies = [ "http", "indexmap", "slab", - "tokio 1.7.1", - "tokio-util 0.6.7", + "tokio 1.6.1", + "tokio-util 0.6.5", "tracing", ] @@ -1552,22 +1556,22 @@ dependencies = [ [[package]] name = "hashbrown_tstd" version = "0.9.0" -source = "git+https://github.com/apache/teaclave-sgx-sdk.git?rev=v1.1.3#a6a172e652b4db4eaa17e4faa078fda8922abdd0" +source = "git+https://github.com/apache/teaclave-sgx-sdk.git?rev=v1.1.3#ed9e7cce4fd40efd7a256d5c4be1c5f00778a5bb" [[package]] name = "heck" -version = "0.3.3" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" +checksum = "87cbf45460356b7deeb5e3415b5563308c0a9b057c85e12b06ad551f98d0a6ac" dependencies = [ "unicode-segmentation", ] [[package]] name = "hermit-abi" -version = "0.1.19" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +checksum = "322f4de77956e22ed0e5032c359a0f1273f1f7f0d79bfa3b8ffbc730d7fbcc5c" dependencies = [ "libc", ] @@ -1580,9 +1584,9 @@ checksum = "805026a5d0141ffc30abb3be3173848ad46a1b1664fe632428479619a3644d77" [[package]] name = "hex" -version = "0.4.3" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +checksum = "644f9158b2f133fd50f5fb3242878846d9eb792e445c893805ff0e3824006e35" [[package]] name = "hmac" @@ -1617,9 +1621,9 @@ dependencies = [ [[package]] name = "http" -version = "0.2.4" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "527e8c9ac747e28542699a951517aa9a6945af506cd1f2e1b53a576c17b6cc11" +checksum = "7245cd7449cc792608c3c8a9eaf69bd4eabbabf802713748fd739c98b82f0747" dependencies = [ "bytes 1.0.1", "fnv", @@ -1638,9 +1642,9 @@ dependencies = [ [[package]] name = "http-body" -version = "0.4.2" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60daa14be0e0786db0f03a9e57cb404c9d756eed2b6c62b9ea98ec5743ec75a9" +checksum = "5dfb77c123b4e2f72a2069aeae0b4b4949cc7e966df277813fc16347e7549737" dependencies = [ "bytes 1.0.1", "http", @@ -1649,9 +1653,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.4.1" +version = "1.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3a87b616e37e93c22fb19bcd386f02f3af5ea98a25670ad0fce773de23c5e68" +checksum = "615caabe2c3160b313d52ccc905335f4ed5f10881dd63dc5699d47e90be85691" [[package]] name = "httpdate" @@ -1659,28 +1663,22 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "494b4d60369511e7dea41cf646832512a94e542f68bb9c49e54518e0f468eb47" -[[package]] -name = "httpdate" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6456b8a6c8f33fee7d958fcd1b60d55b11940a79e63ae87013e6d22e26034440" - [[package]] name = "humantime" version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f" +source = "git+https://github.com/mesalock-linux/humantime-sgx#c5243dfa36002c01adbc9aade288ead1b2c411cc" dependencies = [ - "quick-error 1.2.3", + "quick-error 1.2.2", + "sgx_tstd", ] [[package]] name = "humantime" version = "1.3.0" -source = "git+https://github.com/mesalock-linux/humantime-sgx#c5243dfa36002c01adbc9aade288ead1b2c411cc" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f" dependencies = [ - "quick-error 1.2.2", - "sgx_tstd", + "quick-error 1.2.3", ] [[package]] @@ -1697,9 +1695,9 @@ dependencies = [ "http", "http-body 0.3.1", "httparse", - "httpdate 0.3.2", + "httpdate", "itoa", - "pin-project 1.0.7", + "pin-project 1.0.6", "tokio 0.2.25", "tower-service", "tracing", @@ -1708,23 +1706,23 @@ dependencies = [ [[package]] name = "hyper" -version = "0.14.9" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07d6baa1b441335f3ce5098ac421fb6547c46dda735ca1bc6d0153c838f9dd83" +checksum = "8bf09f61b52cfcf4c00de50df88ae423d6c02354e385a86341133b5338630ad1" dependencies = [ "bytes 1.0.1", "futures-channel", "futures-core", "futures-util", - "h2 0.3.3", + "h2 0.3.2", "http", - "http-body 0.4.2", + "http-body 0.4.1", "httparse", - "httpdate 1.0.1", + "httpdate", "itoa", - "pin-project-lite 0.2.6", + "pin-project 1.0.6", "socket2", - "tokio 1.7.1", + "tokio 1.6.1", "tower-service", "tracing", "want", @@ -1740,7 +1738,7 @@ dependencies = [ "common-multipart-rfc7578", "futures 0.3.15", "http", - "hyper 0.14.9", + "hyper 0.14.5", ] [[package]] @@ -1751,11 +1749,11 @@ checksum = "5f9f7a97316d44c0af9b0301e65010573a853a9fc97046d7331d7f6bc0fd5a64" dependencies = [ "ct-logs", "futures-util", - "hyper 0.14.9", + "hyper 0.14.5", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", "rustls", "rustls-native-certs", - "tokio 1.7.1", + "tokio 1.6.1", "tokio-rustls", "webpki 0.21.4", ] @@ -1767,21 +1765,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" dependencies = [ "bytes 1.0.1", - "hyper 0.14.9", + "hyper 0.14.5", "native-tls", - "tokio 1.7.1", + "tokio 1.6.1", "tokio-native-tls", ] [[package]] name = "ias-verify" version = "0.1.4" -source = "git+https://github.com/scs/pallet-substratee-registry.git?branch=feature-gate-ias-check#8fc938ba1d78678552acd8b7f0a5b73521c4f48e" +source = "git+https://github.com/scs/pallet-substratee-registry.git#860097f21141fb6cd5eb455d8ca9e8adb7031c7d" dependencies = [ "base64 0.11.0", "chrono", "frame-support", - "parity-scale-codec 2.1.3", + "parity-scale-codec 2.0.1", "serde_json", "sp-core", "sp-io 3.0.0", @@ -1802,9 +1800,9 @@ dependencies = [ [[package]] name = "idna" -version = "0.2.3" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" +checksum = "89829a5d69c23d348314a7ac337fe39173b61149a9864deabd260983aed48c21" dependencies = [ "matches", "unicode-bidi", @@ -1826,7 +1824,7 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df170efa359aebdd5cb7fe78edcc67107748e4737bdca8a8fb40d15ea7a877ed" dependencies = [ - "parity-scale-codec 2.1.3", + "parity-scale-codec 2.0.1", ] [[package]] @@ -1846,7 +1844,7 @@ checksum = "d5dacb10c5b3bb92d46ba347505a9041e676bb20ad220101326bffb0c93031ee" dependencies = [ "proc-macro2", "quote 1.0.9", - "syn 1.0.73", + "syn 1.0.68", ] [[package]] @@ -1903,19 +1901,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c3824538e42e84c792988098df4ad5a35b47be98b19e31454e09f4e322f00fc" dependencies = [ "bytes 1.0.1", - "dirs 3.0.2", + "dirs 3.0.1", "failure", "futures 0.3.15", "http", - "hyper 0.14.9", + "hyper 0.14.5", "hyper-multipart-rfc7578", "hyper-tls", "parity-multiaddr", "serde", "serde_json", "serde_urlencoded", - "tokio 1.7.1", - "tokio-util 0.6.7", + "tokio 1.6.1", + "tokio-util 0.6.5", "tracing", "typed-builder", "walkdir", @@ -1930,35 +1928,17 @@ dependencies = [ "either", ] -[[package]] -name = "itertools" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69ddb889f9d0d08a67338271fa9b62996bc788c7796a5c18cf057420aaed5eaf" -dependencies = [ - "either", -] - [[package]] name = "itoa" version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736" -[[package]] -name = "jobserver" -version = "0.1.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "972f5ae5d1cb9c6ae417789196c803205313edde988685da5e3aae0827b9e7fd" -dependencies = [ - "libc", -] - [[package]] name = "js-sys" -version = "0.3.51" +version = "0.3.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83bdfbace3a0e81a4253f73b49e960b053e396a11012cbd49b9b74d6a2b67062" +checksum = "2d99f9e3e84b8f67f846ef5b4cbbc3b1c29f6c759fcbce6f01aa0e73d932a24c" dependencies = [ "wasm-bindgen", ] @@ -2016,7 +1996,7 @@ dependencies = [ "proc-macro-crate 0.1.5", "proc-macro2", "quote 1.0.9", - "syn 1.0.73", + "syn 1.0.68", ] [[package]] @@ -2040,6 +2020,8 @@ checksum = "316a89048d2ea5530ab5502aa31e1128f6429b524a37e4c0bc54903bcdf3d342" dependencies = [ "jsonrpsee-http-client", "jsonrpsee-http-server", + "jsonrpsee-proc-macros", + "jsonrpsee-types", "jsonrpsee-utils", "jsonrpsee-ws-client", "jsonrpsee-ws-server", @@ -2053,7 +2035,7 @@ checksum = "e7275601ba6f9f6feaa82d3c66b51e34d190e75f1cf23d5c40f7801f3a7610a6" dependencies = [ "async-trait", "fnv", - "hyper 0.14.9", + "hyper 0.14.5", "hyper-rustls", "jsonrpsee-types", "jsonrpsee-utils", @@ -2061,7 +2043,7 @@ dependencies = [ "serde", "serde_json", "thiserror", - "url 2.2.2", + "url 2.2.1", ] [[package]] @@ -2073,7 +2055,7 @@ dependencies = [ "futures-channel", "futures-util", "globset", - "hyper 0.14.9", + "hyper 0.14.5", "jsonrpsee-types", "jsonrpsee-utils", "lazy_static", @@ -2082,10 +2064,23 @@ dependencies = [ "serde_json", "socket2", "thiserror", - "tokio 1.7.1", + "tokio 1.6.1", "unicase", ] +[[package]] +name = "jsonrpsee-proc-macros" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b4c85cfa6767333f3e5f3b2f2f765dad2727b0033ee270ae07c599bf43ed5ae" +dependencies = [ + "Inflector", + "proc-macro-crate 1.0.0", + "proc-macro2", + "quote 1.0.9", + "syn 1.0.68", +] + [[package]] name = "jsonrpsee-types" version = "0.2.0" @@ -2096,7 +2091,7 @@ dependencies = [ "beef", "futures-channel", "futures-util", - "hyper 0.14.9", + "hyper 0.14.5", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", "serde", "serde_json", @@ -2112,11 +2107,11 @@ checksum = "47554ecaacb479285da68799d9b6afc258c32b332cc8b85829c6a9304ee98776" dependencies = [ "futures-channel", "futures-util", - "hyper 0.14.9", + "hyper 0.14.5", "jsonrpsee-types", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.11.1", - "rand 0.8.4", + "rand 0.8.3", "rustc-hash", "serde", "serde_json", @@ -2134,17 +2129,17 @@ dependencies = [ "futures 0.3.15", "jsonrpsee-types", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", - "pin-project 1.0.7", + "pin-project 1.0.6", "rustls", "rustls-native-certs", "serde", "serde_json", "soketto", "thiserror", - "tokio 1.7.1", + "tokio 1.6.1", "tokio-rustls", - "tokio-util 0.6.7", - "url 2.2.2", + "tokio-util 0.6.5", + "url 2.2.1", ] [[package]] @@ -2163,9 +2158,9 @@ dependencies = [ "serde_json", "soketto", "thiserror", - "tokio 1.7.1", + "tokio 1.6.1", "tokio-stream", - "tokio-util 0.6.7", + "tokio-util 0.6.5", ] [[package]] @@ -2220,9 +2215,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.97" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12b8adadd720df158f4d70dfe7ccc6adb0472d7c55ca83445f6a5ab3e36f8fb6" +checksum = "56d855069fafbb9b344c0f962150cd2c1187975cb1c22c1522c240d8c4986714" [[package]] name = "libm" @@ -2232,29 +2227,29 @@ checksum = "c7d73b3f436185384286bd8098d17ec07c9a7d2388a6599f824d8502b529702a" [[package]] name = "libp2p" -version = "0.37.1" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08053fbef67cd777049ef7a95ebaca2ece370b4ed7712c3fa404d69a88cb741b" +checksum = "d5133112ce42be9482f6a87be92a605dd6bbc9e93c297aee77d172ff06908f3a" dependencies = [ "atomic", "bytes 1.0.1", "futures 0.3.15", "lazy_static", "libp2p-core", + "libp2p-core-derive", "libp2p-swarm", - "libp2p-swarm-derive", "parity-multiaddr", "parking_lot 0.11.1", - "pin-project 1.0.7", + "pin-project 1.0.6", "smallvec 1.6.1", "wasm-timer", ] [[package]] name = "libp2p-core" -version = "0.28.3" +version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "554d3e7e9e65f939d66b75fd6a4c67f258fe250da61b91f46c545fc4a89b51d9" +checksum = "8a2d56aadc2c2bf22cd7797f86e56a65b5b3994a0136b65be3106938acae7a26" dependencies = [ "asn1_der", "bs58", @@ -2270,25 +2265,35 @@ dependencies = [ "multistream-select", "parity-multiaddr", "parking_lot 0.11.1", - "pin-project 1.0.7", + "pin-project 1.0.6", "prost", "prost-build", "rand 0.7.3", "ring 0.16.20", "rw-stream-sink", - "sha2 0.9.5", + "sha2 0.9.3", "smallvec 1.6.1", "thiserror", "unsigned-varint 0.7.0", "void", - "zeroize", + "zeroize 1.2.0", +] + +[[package]] +name = "libp2p-core-derive" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4bc40943156e42138d22ed3c57ff0e1a147237742715937622a99b10fbe0156" +dependencies = [ + "quote 1.0.9", + "syn 1.0.68", ] [[package]] name = "libp2p-swarm" -version = "0.29.0" +version = "0.27.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e04d8e1eef675029ec728ba14e8d0da7975d84b6679b699b4ae91a1de9c3a92" +checksum = "7955b973e1fd2bd61ffd43ce261c1223f61f4aacd5bae362a924993f9a25fd98" dependencies = [ "either", "futures 0.3.15", @@ -2300,16 +2305,6 @@ dependencies = [ "wasm-timer", ] -[[package]] -name = "libp2p-swarm-derive" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "365b0a699fea5168676840567582a012ea297b1ca02eee467e58301b9c9c5eed" -dependencies = [ - "quote 1.0.9", - "syn 1.0.73", -] - [[package]] name = "libsecp256k1" version = "0.3.5" @@ -2328,11 +2323,11 @@ dependencies = [ [[package]] name = "linregress" -version = "0.4.2" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1ff7f341d23e1275eec0656a9a07225fcc86216c4322392868adffe59023d1a" +checksum = "0d0ad4b5cc8385a881c561fac3501353d63d2a2b7a357b5064d71815c9a92724" dependencies = [ - "nalgebra 0.27.1", + "nalgebra", "statrs", ] @@ -2356,9 +2351,9 @@ dependencies = [ [[package]] name = "lock_api" -version = "0.4.4" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0382880606dff6d15c9476c416d18690b72742aa7b605bb6dd6ec9030fbf07eb" +checksum = "5a3c91c24eae6777794bb1997ad98bbb87daf92890acab859f7eaa4320333176" dependencies = [ "scopeguard 1.1.0", ] @@ -2366,20 +2361,20 @@ dependencies = [ [[package]] name = "log" version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" +source = "git+https://github.com/mesalock-linux/log-sgx#2ca9039a9ebba0ed90ed2ad57425917d4b3a2a24" dependencies = [ "cfg-if 1.0.0", - "value-bag", + "sgx_tstd", ] [[package]] name = "log" version = "0.4.14" -source = "git+https://github.com/mesalock-linux/log-sgx#2ca9039a9ebba0ed90ed2ad57425917d4b3a2a24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" dependencies = [ "cfg-if 1.0.0", - "sgx_tstd", + "value-bag", ] [[package]] @@ -2408,35 +2403,13 @@ checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" [[package]] name = "matrixmultiply" -version = "0.3.1" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a8a15b776d9dfaecd44b03c5828c2199cddff5247215858aac14624f8d6b741" +checksum = "916806ba0031cd542105d916a97c8572e1fa6dd79c9c51e7eb43a09ec2dd84c1" dependencies = [ "rawpointer", ] -[[package]] -name = "max-encoded-len" -version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" -dependencies = [ - "impl-trait-for-tuples", - "max-encoded-len-derive", - "parity-scale-codec 2.1.3", - "primitive-types 0.9.0", -] - -[[package]] -name = "max-encoded-len-derive" -version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" -dependencies = [ - "proc-macro-crate 1.0.0", - "proc-macro2", - "quote 1.0.9", - "syn 1.0.73", -] - [[package]] name = "maybe-uninit" version = "2.0.0" @@ -2455,9 +2428,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.4.0" +version = "2.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b16bd47d9e329435e309c58469fe0791c2d0d1ba96ec0954152a5ae2b04387dc" +checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525" [[package]] name = "memory-db" @@ -2476,6 +2449,18 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "71d96e3f3c0b6325d8ccd83c33b28acb183edcb6c67938ba104ec546854b0882" +[[package]] +name = "merlin" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b0942b357c1b4d0dc43ba724674ec89c3218e6ca2b3e8269e7cb53bcecd2f6e" +dependencies = [ + "byteorder", + "keccak", + "rand_core 0.4.2", + "zeroize 1.2.0", +] + [[package]] name = "merlin" version = "2.0.1" @@ -2485,7 +2470,7 @@ dependencies = [ "byteorder", "keccak", "rand_core 0.5.1", - "zeroize", + "zeroize 1.2.0", ] [[package]] @@ -2535,9 +2520,9 @@ dependencies = [ [[package]] name = "mio" -version = "0.7.13" +version = "0.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c2bdb6314ec10835cd3293dd268473a835c02b7b352e788be788b3c6ca6bb16" +checksum = "cf80d3e903b34e0bd7282b218398aec54e082c840d9baf8339e0080a0c542956" dependencies = [ "libc", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2608,21 +2593,21 @@ dependencies = [ "digest 0.9.0", "generic-array 0.14.4", "multihash-derive", - "sha2 0.9.5", + "sha2 0.9.3", "unsigned-varint 0.5.1", ] [[package]] name = "multihash-derive" -version = "0.7.2" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "424f6e86263cd5294cbd7f1e95746b95aca0e0d66bff31e5a40d6baa87b4aa99" +checksum = "85ee3c48cb9d9b275ad967a0e96715badc13c6029adb92f34fa17b9ff28fd81f" dependencies = [ - "proc-macro-crate 1.0.0", + "proc-macro-crate 0.1.5", "proc-macro-error", "proc-macro2", "quote 1.0.9", - "syn 1.0.73", + "syn 1.0.68", "synstructure", ] @@ -2641,55 +2626,29 @@ dependencies = [ "bytes 1.0.1", "futures 0.3.15", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", - "pin-project 1.0.7", + "pin-project 1.0.6", "smallvec 1.6.1", "unsigned-varint 0.7.0", ] [[package]] name = "nalgebra" -version = "0.26.2" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "476d1d59fe02fe54c86356e91650cd892f392782a1cb9fc524ec84f7aa9e1d06" +checksum = "d6b6147c3d50b4f3cdabfe2ecc94a0191fd3d6ad58aefd9664cf396285883486" dependencies = [ - "approx 0.4.0", + "approx", + "generic-array 0.13.3", "matrixmultiply", - "num-complex 0.3.1", - "num-rational 0.3.2", + "num-complex", + "num-rational", "num-traits", - "rand 0.8.4", + "rand 0.7.3", "rand_distr", - "simba 0.4.0", + "simba", "typenum", ] -[[package]] -name = "nalgebra" -version = "0.27.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "462fffe4002f4f2e1f6a9dcf12cc1a6fc0e15989014efc02a941d3e0f5dc2120" -dependencies = [ - "approx 0.5.0", - "matrixmultiply", - "nalgebra-macros", - "num-complex 0.4.0", - "num-rational 0.4.0", - "num-traits", - "simba 0.5.1", - "typenum", -] - -[[package]] -name = "nalgebra-macros" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01fcc0b8149b4632adc89ac3b7b31a12fb6099a0317a4eb2ebff574ef7de7218" -dependencies = [ - "proc-macro2", - "quote 1.0.9", - "syn 1.0.73", -] - [[package]] name = "native-tls" version = "0.2.7" @@ -2708,6 +2667,16 @@ dependencies = [ "tempfile", ] +[[package]] +name = "nb-connect" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a19900e7eee95eb2b3c2e26d12a874cc80aaf750e31be6fcbe743ead369fa45d" +dependencies = [ + "libc", + "socket2", +] + [[package]] name = "net2" version = "0.2.37" @@ -2747,62 +2716,32 @@ dependencies = [ [[package]] name = "num-complex" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "747d632c0c558b87dbabbe6a82f3b4ae03720d0646ac5b7b4dae89394be5f2c5" -dependencies = [ - "num-traits", -] - -[[package]] -name = "num-complex" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26873667bbbb7c5182d4a37c1add32cdf09f841af72da53318fdb81543c15085" -dependencies = [ - "num-traits", -] - -[[package]] -name = "num-integer" -version = "0.1.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db" -dependencies = [ - "autocfg 1.0.1", - "num-traits", -] - -[[package]] -name = "num-rational" version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c000134b5dbf44adc5cb772486d335293351644b801551abe8f75c84cfa4aef" +checksum = "b6b19411a9719e753aff12e5187b74d60d3dc449ec3f4dc21e3989c3f554bc95" dependencies = [ - "autocfg 1.0.1", - "num-bigint", - "num-integer", + "autocfg 1.0.1", "num-traits", ] [[package]] -name = "num-rational" -version = "0.3.2" +name = "num-integer" +version = "0.1.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12ac428b1cb17fce6f731001d307d351ec70a6d202fc2e60f7d4c5e42d8f4f07" +checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db" dependencies = [ "autocfg 1.0.1", - "num-integer", "num-traits", ] [[package]] name = "num-rational" -version = "0.4.0" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d41702bd167c2df5520b384281bc111a4b5efcf7fbc4c9c222c815b07e0a6a6a" +checksum = "5c000134b5dbf44adc5cb772486d335293351644b801551abe8f75c84cfa4aef" dependencies = [ "autocfg 1.0.1", + "num-bigint", "num-integer", "num-traits", ] @@ -2829,12 +2768,9 @@ dependencies = [ [[package]] name = "object" -version = "0.25.3" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a38f2be3697a57b4060074ff41b44c16870d916ad7877c17696e063257482bc7" -dependencies = [ - "memchr 2.4.0", -] +checksum = "a9a7ab5d64814df0fe4a4b5ead45ed6c5f181ee3ff04ba344313a6c80446c5d4" [[package]] name = "once_cell" @@ -2847,9 +2783,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.8.0" +version = "1.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56" +checksum = "af8b08b04175473088b46763e51ee54da5f9a164bc162f615b91bc179dbf15a3" dependencies = [ "parking_lot 0.11.1", ] @@ -2868,29 +2804,29 @@ checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" [[package]] name = "openssl" -version = "0.10.35" +version = "0.10.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "549430950c79ae24e6d02e0b7404534ecf311d94cc9f861e9e4020187d13d885" +checksum = "a61075b62a23fef5a29815de7536d940aa35ce96d18ce0cc5076272db678a577" dependencies = [ "bitflags", "cfg-if 1.0.0", "foreign-types", "libc", - "once_cell 1.8.0", + "once_cell 1.7.2", "openssl-sys", ] [[package]] name = "openssl-probe" -version = "0.1.4" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28988d872ab76095a6e6ac88d99b54fd267702734fd7ffe610ca27f533ddb95a" +checksum = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de" [[package]] name = "openssl-sys" -version = "0.9.65" +version = "0.9.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a7907e3bfa08bb85105209cdfcb6c63d109f8f6c1ed6ca318fff5c1853fbc1d" +checksum = "313752393519e876837e09e1fa183ddef0be7735868dced3196f4472d536277f" dependencies = [ "autocfg 1.0.1", "cc", @@ -2902,29 +2838,32 @@ dependencies = [ [[package]] name = "pallet-aura" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" +source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" dependencies = [ "frame-support", "frame-system", "pallet-session", "pallet-timestamp", - "parity-scale-codec 2.1.3", + "parity-scale-codec 2.0.1", + "serde", "sp-application-crypto", "sp-consensus-aura", "sp-runtime", "sp-std", + "sp-timestamp", ] [[package]] name = "pallet-authorship" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" +source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" dependencies = [ "frame-support", "frame-system", "impl-trait-for-tuples", - "parity-scale-codec 2.1.3", + "parity-scale-codec 2.0.1", "sp-authorship", + "sp-inherents", "sp-runtime", "sp-std", ] @@ -2932,34 +2871,32 @@ dependencies = [ [[package]] name = "pallet-balances" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" +source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", - "max-encoded-len", - "parity-scale-codec 2.1.3", + "parity-scale-codec 2.0.1", + "serde", "sp-runtime", "sp-std", ] [[package]] name = "pallet-grandpa" -version = "3.1.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", "pallet-authorship", "pallet-session", - "parity-scale-codec 2.1.3", + "parity-scale-codec 2.0.1", + "serde", "sp-application-crypto", "sp-core", "sp-finality-grandpa", - "sp-io 3.0.0", "sp-runtime", "sp-session", "sp-staking", @@ -2969,11 +2906,11 @@ dependencies = [ [[package]] name = "pallet-randomness-collective-flip" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" +source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" dependencies = [ "frame-support", "frame-system", - "parity-scale-codec 2.1.3", + "parity-scale-codec 2.0.1", "safe-mix", "sp-runtime", "sp-std", @@ -2982,14 +2919,14 @@ dependencies = [ [[package]] name = "pallet-session" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" +source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" dependencies = [ "frame-support", "frame-system", "impl-trait-for-tuples", - "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", "pallet-timestamp", - "parity-scale-codec 2.1.3", + "parity-scale-codec 2.0.1", + "serde", "sp-core", "sp-io 3.0.0", "sp-runtime", @@ -3001,15 +2938,15 @@ dependencies = [ [[package]] name = "pallet-substratee-registry" -version = "0.9.0" -source = "git+https://github.com/scs/pallet-substratee-registry.git?branch=feature-gate-ias-check#8fc938ba1d78678552acd8b7f0a5b73521c4f48e" +version = "0.8.0" +source = "git+https://github.com/scs/pallet-substratee-registry.git#860097f21141fb6cd5eb455d8ca9e8adb7031c7d" dependencies = [ "frame-support", "frame-system", "ias-verify", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", "pallet-timestamp", - "parity-scale-codec 2.1.3", + "parity-scale-codec 2.0.1", "serde", "sp-core", "sp-io 3.0.0", @@ -3020,11 +2957,12 @@ dependencies = [ [[package]] name = "pallet-sudo" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" +source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" dependencies = [ "frame-support", "frame-system", - "parity-scale-codec 2.1.3", + "parity-scale-codec 2.0.1", + "serde", "sp-io 3.0.0", "sp-runtime", "sp-std", @@ -3033,14 +2971,14 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" +source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", "impl-trait-for-tuples", - "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-scale-codec 2.1.3", + "parity-scale-codec 2.0.1", + "serde", "sp-inherents", "sp-runtime", "sp-std", @@ -3050,11 +2988,11 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" +source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" dependencies = [ "frame-support", "frame-system", - "parity-scale-codec 2.1.3", + "parity-scale-codec 2.0.1", "serde", "smallvec 1.6.1", "sp-core", @@ -3066,10 +3004,10 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" +source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" dependencies = [ "pallet-transaction-payment", - "parity-scale-codec 2.1.3", + "parity-scale-codec 2.0.1", "sp-api", "sp-runtime", ] @@ -3089,7 +3027,7 @@ dependencies = [ "serde", "static_assertions", "unsigned-varint 0.7.0", - "url 2.2.2", + "url 2.2.1", ] [[package]] @@ -3106,12 +3044,12 @@ dependencies = [ [[package]] name = "parity-scale-codec" -version = "2.1.3" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b310f220c335f9df1b3d2e9fbe3890bbfeef5030dad771620f48c5c229877cd3" +checksum = "0cd3dab59b5cf4bc81069ade0fc470341a1ef3ad5fa73e5a8943bed2ec12b2e8" dependencies = [ - "arrayvec 0.7.1", - "bitvec 0.20.4", + "arrayvec 0.5.2", + "bitvec 0.20.2", "byte-slice-cast 1.0.0", "parity-scale-codec-derive", "serde", @@ -3119,14 +3057,14 @@ dependencies = [ [[package]] name = "parity-scale-codec-derive" -version = "2.1.3" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81038e13ca2c32587201d544ea2e6b6c47120f1e4eae04478f9f60b6bcb89145" +checksum = "fa04976a81fde04924b40cc4036c4d12841e8bb04325a5cf2ada75731a150a7d" dependencies = [ - "proc-macro-crate 1.0.0", + "proc-macro-crate 0.1.5", "proc-macro2", "quote 1.0.9", - "syn 1.0.73", + "syn 1.0.68", ] [[package]] @@ -3151,7 +3089,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f557c32c6d268a07c921471619c0295f5efad3a0e76d4f97a05c091a51d110b2" dependencies = [ "proc-macro2", - "syn 1.0.73", + "syn 1.0.68", "synstructure", ] @@ -3166,9 +3104,9 @@ dependencies = [ [[package]] name = "parity-wasm" -version = "0.42.2" +version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be5e13c266502aadf83426d87d81a0f5d1ef45b8027f5a471c360abfe4bfae92" +checksum = "ddfc878dac00da22f8f61e7af3157988424567ab01d9920b962ef7dcbd7cd865" [[package]] name = "parking" @@ -3203,7 +3141,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6d7744ac029df22dca6284efe4e898991d28e3085c706c972bcd7da4a27a15eb" dependencies = [ "instant", - "lock_api 0.4.4", + "lock_api 0.4.3", "parking_lot_core 0.8.3", ] @@ -3243,17 +3181,36 @@ dependencies = [ "cfg-if 1.0.0", "instant", "libc", - "redox_syscall 0.2.9", + "redox_syscall 0.2.5", "smallvec 1.6.1", "winapi 0.3.9", ] +[[package]] +name = "paste" +version = "0.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45ca20c77d80be666aef2b45486da86238fabe33e38306bd3118fe4af33fa880" +dependencies = [ + "paste-impl", + "proc-macro-hack", +] + [[package]] name = "paste" version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "acbf547ad0c65e31259204bd90935776d1c693cec2f4ff7abb7a1bbbd40dfe58" +[[package]] +name = "paste-impl" +version = "0.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d95a7db200b97ef370c8e6de0088252f7e0dfff7d047a28528e47456c0fc98b6" +dependencies = [ + "proc-macro-hack", +] + [[package]] name = "pbkdf2" version = "0.3.0" @@ -3315,11 +3272,11 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.0.7" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7509cc106041c40a4518d2af7a61530e1eed0e6285296a3d8c5472806ccc4a4" +checksum = "bc174859768806e91ae575187ada95c91a29e96a98dc5d2cd9a1fed039501ba6" dependencies = [ - "pin-project-internal 1.0.7", + "pin-project-internal 1.0.6", ] [[package]] @@ -3330,18 +3287,18 @@ checksum = "3be26700300be6d9d23264c73211d8190e755b6b5ca7a1b28230025511b52a5e" dependencies = [ "proc-macro2", "quote 1.0.9", - "syn 1.0.73", + "syn 1.0.68", ] [[package]] name = "pin-project-internal" -version = "1.0.7" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48c950132583b500556b1efd71d45b319029f2b71518d979fcc208e16b42426f" +checksum = "a490329918e856ed1b083f244e3bfe2d8c4f336407e4ea9e1a9f479ff09049e5" dependencies = [ "proc-macro2", "quote 1.0.9", - "syn 1.0.73", + "syn 1.0.68", ] [[package]] @@ -3370,14 +3327,14 @@ checksum = "3831453b3449ceb48b6d9c7ad7c96d5ea673e9b470a1dc578c2ce6521230884c" [[package]] name = "polling" -version = "2.1.0" +version = "2.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92341d779fa34ea8437ef4d82d440d5e1ce3f3ff7f824aa64424cd481f9a1f25" +checksum = "4fc12d774e799ee9ebae13f4076ca003b40d18a11ac0f3641e6f899618580b7b" dependencies = [ "cfg-if 1.0.0", "libc", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", - "wepoll-ffi", + "wepoll-sys", "winapi 0.3.9", ] @@ -3438,7 +3395,7 @@ dependencies = [ "proc-macro-error-attr", "proc-macro2", "quote 1.0.9", - "syn 1.0.73", + "syn 1.0.68", "version_check", ] @@ -3467,11 +3424,11 @@ checksum = "bc881b2c22681370c6a780e47af9840ef841837bc98118431d4e1868bd0c1086" [[package]] name = "proc-macro2" -version = "1.0.27" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0d8caf72986c1a598726adc988bb5984792ef84f5ee5aa50209145ee8077038" +checksum = "a152013215dca273577e18d2bf00fa862b89b24169fb78c4c95aeb07992c9cec" dependencies = [ - "unicode-xid 0.2.2", + "unicode-xid 0.2.1", ] [[package]] @@ -3484,7 +3441,7 @@ dependencies = [ "fnv", "lazy_static", "parking_lot 0.11.1", - "regex 1.5.4", + "regex 1.4.5", "thiserror", ] @@ -3506,7 +3463,7 @@ checksum = "32d3ebd75ac2679c2af3a92246639f9fcc8a442ee420719cc4fe195b98dd5fa3" dependencies = [ "bytes 1.0.1", "heck", - "itertools 0.9.0", + "itertools", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", "multimap", "petgraph", @@ -3523,10 +3480,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "169a15f3008ecb5160cba7d37bcd690a7601b6d30cfb87a117d45e59d52af5d4" dependencies = [ "anyhow", - "itertools 0.9.0", + "itertools", "proc-macro2", "quote 1.0.9", - "syn 1.0.73", + "syn 1.0.68", ] [[package]] @@ -3635,14 +3592,14 @@ dependencies = [ [[package]] name = "rand" -version = "0.8.4" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e7573632e6454cf6b99d7aac4ccca54be06da05aca2ef7423d22d27d4d4bcd8" +checksum = "0ef9e7e66b4468674bfcb0c81af8b7fa0bb154fa9f28eb840da5c447baeb8d7e" dependencies = [ "libc", - "rand_chacha 0.3.1", - "rand_core 0.6.3", - "rand_hc 0.3.1", + "rand_chacha 0.3.0", + "rand_core 0.6.2", + "rand_hc 0.3.0", ] [[package]] @@ -3667,12 +3624,12 @@ dependencies = [ [[package]] name = "rand_chacha" -version = "0.3.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +checksum = "e12735cf05c9e10bf21534da50a147b924d555dc7a547c42e6bb2d5b6017ae0d" dependencies = [ "ppv-lite86", - "rand_core 0.6.3", + "rand_core 0.6.2", ] [[package]] @@ -3701,21 +3658,20 @@ dependencies = [ [[package]] name = "rand_core" -version = "0.6.3" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" +checksum = "34cf66eb183df1c5876e2dcf6b13d57340741e8dc255b48e40a26de954d06ae7" dependencies = [ - "getrandom 0.2.3", + "getrandom 0.2.2", ] [[package]] name = "rand_distr" -version = "0.4.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "051b398806e42b9cd04ad9ec8f81e355d0a382c543ac6672c62f5a5b452ef142" +checksum = "96977acbdd3a6576fb1d27391900035bf3863d4a16422973a409b488cf29ffb2" dependencies = [ - "num-traits", - "rand 0.8.4", + "rand 0.7.3", ] [[package]] @@ -3738,11 +3694,11 @@ dependencies = [ [[package]] name = "rand_hc" -version = "0.3.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d51e9f596de227fda2ea6c84607f5558e196eeaf43c986b724ba4fb8fdf497e7" +checksum = "3190ef7066a446f2e7f42e239d161e905420ccab01eb967c9eb27d21b2322a73" dependencies = [ - "rand_core 0.6.3", + "rand_core 0.6.2", ] [[package]] @@ -3839,9 +3795,9 @@ checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" [[package]] name = "redox_syscall" -version = "0.2.9" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ab49abadf3f9e1c4bc499e8845e152ad87d2ad2d30371841171169e9d75feee" +checksum = "94341e4e44e24f6b591b59e47a8a027df12e008d73fd5672dbea9cc22f4507d9" dependencies = [ "bitflags", ] @@ -3857,16 +3813,6 @@ dependencies = [ "rust-argon2", ] -[[package]] -name = "redox_users" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "528532f3d801c87aec9def2add9ca802fe569e44a544afe633765267840abe64" -dependencies = [ - "getrandom 0.2.3", - "redox_syscall 0.2.9", -] - [[package]] name = "ref-cast" version = "1.0.6" @@ -3884,7 +3830,7 @@ checksum = "4c38e3aecd2b21cb3959637b883bb3714bc7e43f0268b9a29d3743ee3e55cdd2" dependencies = [ "proc-macro2", "quote 1.0.9", - "syn 1.0.73", + "syn 1.0.68", ] [[package]] @@ -3901,22 +3847,23 @@ dependencies = [ [[package]] name = "regex" -version = "1.5.4" +version = "1.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461" +checksum = "957056ecddbeba1b26965114e191d2e8589ce74db242b6ea25fc4062427a5c19" dependencies = [ - "aho-corasick 0.7.18", - "memchr 2.4.0", - "regex-syntax 0.6.25", + "aho-corasick 0.7.15", + "memchr 2.3.4", + "regex-syntax 0.6.23", ] [[package]] name = "regex-automata" -version = "0.1.10" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +checksum = "ae1ded71d66a4a97f5e961fd0cb25a5f366a42a41570d16a763a69c092c26ae4" dependencies = [ - "regex-syntax 0.6.25", + "byteorder", + "regex-syntax 0.6.23", ] [[package]] @@ -3929,9 +3876,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.6.25" +version = "0.6.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" +checksum = "24d5f089152e60f62d28b835fbff2cd2e8dc0baf1ac13343bef92ab7eed84548" [[package]] name = "remove_dir_all" @@ -3963,7 +3910,7 @@ checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" dependencies = [ "cc", "libc", - "once_cell 1.8.0", + "once_cell 1.7.2", "spin", "untrusted", "web-sys", @@ -3997,9 +3944,9 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.20" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dead70b0b5e03e9c814bcb6b01e03e68f7c57a80aa48c72ec92152ab3e818d49" +checksum = "6e3bad0ee36814ca07d7968269dd4b7ec89ec2da10c4bb613928d3077083c232" [[package]] name = "rustc-hash" @@ -4053,16 +4000,6 @@ dependencies = [ "security-framework", ] -[[package]] -name = "ruzstd" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d425143485a37727c7a46e689bbe3b883a00f42b4a52c4ac0f44855c1009b00" -dependencies = [ - "byteorder", - "twox-hash", -] - [[package]] name = "rw-stream-sink" version = "0.2.1" @@ -4101,14 +4038,14 @@ dependencies = [ [[package]] name = "sc-keystore" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" +source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" dependencies = [ "async-trait", "derive_more", "futures 0.3.15", "futures-util", - "hex 0.4.3", - "merlin", + "hex 0.4.2", + "merlin 2.0.1", "parking_lot 0.11.1", "rand 0.7.3", "serde_json", @@ -4121,7 +4058,7 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" +source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" dependencies = [ "derive_more", "futures 0.3.15", @@ -4130,7 +4067,7 @@ dependencies = [ "jsonrpc-derive", "jsonrpc-pubsub", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-scale-codec 2.1.3", + "parity-scale-codec 2.0.1", "parking_lot 0.11.1", "serde", "serde_json", @@ -4138,7 +4075,6 @@ dependencies = [ "sp-core", "sp-rpc", "sp-runtime", - "sp-tracing", "sp-transaction-pool", "sp-version", ] @@ -4153,6 +4089,23 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "schnorrkel" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eacd8381b3c37840c9c9f40472af529e49975bdcbc24f83c31059fd6539023d3" +dependencies = [ + "curve25519-dalek 1.2.6", + "failure", + "merlin 1.3.0", + "rand 0.6.5", + "rand_core 0.4.2", + "rand_os", + "sha2 0.8.2", + "subtle 2.4.0", + "zeroize 0.9.3", +] + [[package]] name = "schnorrkel" version = "0.9.1" @@ -4163,12 +4116,13 @@ dependencies = [ "arrayvec 0.5.2", "curve25519-dalek 2.1.2", "getrandom 0.1.16", - "merlin", + "merlin 2.0.1", "rand 0.7.3", "rand_core 0.5.1", + "serde", "sha2 0.8.2", "subtle 2.4.0", - "zeroize", + "zeroize 1.2.0", ] [[package]] @@ -4199,14 +4153,14 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0673d6a6449f5e7d12a1caf424fd9363e2af3a4953023ed455e3c4beef4597c0" dependencies = [ - "zeroize", + "zeroize 1.2.0", ] [[package]] name = "security-framework" -version = "2.3.1" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23a2ac85147a3a11d77ecf1bc7166ec0b92febfa4461c37944e180f319ece467" +checksum = "3670b1d2fdf6084d192bc71ead7aabe6c06aa2ea3fbd9cc3ac111fa5c2b1bd84" dependencies = [ "bitflags", "core-foundation", @@ -4217,9 +4171,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.3.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e4effb91b4b8b6fb7732e670b6cee160278ff8e6bf485c7805d9e319d76e284" +checksum = "3676258fd3cfe2c9a0ec99ce3038798d847ce3e4bb17746373eb9f0f1ac16339" dependencies = [ "core-foundation-sys", "libc", @@ -4270,9 +4224,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.126" +version = "1.0.125" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec7505abeacaec74ae4778d9d9328fe5a5d04253220a85c4ee022239fc996d03" +checksum = "558dc50e1a5a5fa7112ca2ce4effcb321b0300c0d4ccf0776a9f60cd89031171" dependencies = [ "serde_derive", ] @@ -4289,13 +4243,13 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.126" +version = "1.0.125" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "963a7dbc9895aeac7ac90e74f34a5d5261828f79df35cbed41e10189d3804d43" +checksum = "b093b7a2bb58203b5da3056c05b4ec1fed827dcfdb37347a8841695263b3d06d" dependencies = [ "proc-macro2", "quote 1.0.9", - "syn 1.0.73", + "syn 1.0.68", ] [[package]] @@ -4324,7 +4278,7 @@ dependencies = [ [[package]] name = "sgx-externalities" version = "0.3.0" -source = "git+https://github.com/scs/sgx-runtime?branch=version-update#de9fc665a1e5268e53432841d642d61ddc793db2" +source = "git+https://github.com/scs/sgx-runtime#3638c9d23f107d9dae7b9e6643af93e27da517bf" dependencies = [ "environmental", "log 0.4.14 (git+https://github.com/mesalock-linux/log-sgx)", @@ -4337,7 +4291,7 @@ dependencies = [ [[package]] name = "sgx-runtime" version = "0.8.0" -source = "git+https://github.com/scs/sgx-runtime?branch=version-update#de9fc665a1e5268e53432841d642d61ddc793db2" +source = "git+https://github.com/scs/sgx-runtime#3638c9d23f107d9dae7b9e6643af93e27da517bf" dependencies = [ "frame-executive", "frame-support", @@ -4351,7 +4305,7 @@ dependencies = [ "pallet-timestamp", "pallet-transaction-payment", "pallet-transaction-payment-rpc-runtime-api", - "parity-scale-codec 2.1.3", + "parity-scale-codec 2.0.1", "sp-api", "sp-block-builder", "sp-consensus-aura", @@ -4368,12 +4322,12 @@ dependencies = [ [[package]] name = "sgx_alloc" version = "1.1.3" -source = "git+https://github.com/apache/teaclave-sgx-sdk.git?rev=v1.1.3#a6a172e652b4db4eaa17e4faa078fda8922abdd0" +source = "git+https://github.com/apache/teaclave-sgx-sdk.git?rev=v1.1.3#ed9e7cce4fd40efd7a256d5c4be1c5f00778a5bb" [[package]] name = "sgx_backtrace_sys" version = "1.1.3" -source = "git+https://github.com/apache/teaclave-sgx-sdk.git?rev=v1.1.3#a6a172e652b4db4eaa17e4faa078fda8922abdd0" +source = "git+https://github.com/apache/teaclave-sgx-sdk.git?rev=v1.1.3#ed9e7cce4fd40efd7a256d5c4be1c5f00778a5bb" dependencies = [ "cc", "sgx_build_helper", @@ -4383,14 +4337,14 @@ dependencies = [ [[package]] name = "sgx_build_helper" version = "0.1.3" -source = "git+https://github.com/apache/teaclave-sgx-sdk.git?rev=v1.1.3#a6a172e652b4db4eaa17e4faa078fda8922abdd0" +source = "git+https://github.com/apache/teaclave-sgx-sdk.git?rev=v1.1.3#ed9e7cce4fd40efd7a256d5c4be1c5f00778a5bb" [[package]] name = "sgx_crypto_helper" version = "1.1.3" -source = "git+https://github.com/apache/teaclave-sgx-sdk.git?rev=v1.1.3#a6a172e652b4db4eaa17e4faa078fda8922abdd0" +source = "git+https://github.com/apache/teaclave-sgx-sdk.git?rev=v1.1.3#ed9e7cce4fd40efd7a256d5c4be1c5f00778a5bb" dependencies = [ - "itertools 0.10.1", + "itertools", "libc", "serde", "serde-big-array", @@ -4402,12 +4356,12 @@ dependencies = [ [[package]] name = "sgx_demangle" version = "1.1.3" -source = "git+https://github.com/apache/teaclave-sgx-sdk.git?rev=v1.1.3#a6a172e652b4db4eaa17e4faa078fda8922abdd0" +source = "git+https://github.com/apache/teaclave-sgx-sdk.git?rev=v1.1.3#ed9e7cce4fd40efd7a256d5c4be1c5f00778a5bb" [[package]] name = "sgx_libc" version = "1.1.3" -source = "git+https://github.com/apache/teaclave-sgx-sdk.git?rev=v1.1.3#a6a172e652b4db4eaa17e4faa078fda8922abdd0" +source = "git+https://github.com/apache/teaclave-sgx-sdk.git?rev=v1.1.3#ed9e7cce4fd40efd7a256d5c4be1c5f00778a5bb" dependencies = [ "sgx_types", ] @@ -4415,7 +4369,7 @@ dependencies = [ [[package]] name = "sgx_serialize" version = "1.1.3" -source = "git+https://github.com/apache/teaclave-sgx-sdk.git?rev=v1.1.3#a6a172e652b4db4eaa17e4faa078fda8922abdd0" +source = "git+https://github.com/apache/teaclave-sgx-sdk.git?rev=v1.1.3#ed9e7cce4fd40efd7a256d5c4be1c5f00778a5bb" dependencies = [ "sgx_tstd", ] @@ -4423,7 +4377,7 @@ dependencies = [ [[package]] name = "sgx_serialize_derive" version = "1.1.3" -source = "git+https://github.com/apache/teaclave-sgx-sdk.git?rev=v1.1.3#a6a172e652b4db4eaa17e4faa078fda8922abdd0" +source = "git+https://github.com/apache/teaclave-sgx-sdk.git?rev=v1.1.3#ed9e7cce4fd40efd7a256d5c4be1c5f00778a5bb" dependencies = [ "quote 0.3.15", "sgx_serialize_derive_internals", @@ -4433,7 +4387,7 @@ dependencies = [ [[package]] name = "sgx_serialize_derive_internals" version = "1.1.3" -source = "git+https://github.com/apache/teaclave-sgx-sdk.git?rev=v1.1.3#a6a172e652b4db4eaa17e4faa078fda8922abdd0" +source = "git+https://github.com/apache/teaclave-sgx-sdk.git?rev=v1.1.3#ed9e7cce4fd40efd7a256d5c4be1c5f00778a5bb" dependencies = [ "syn 0.11.11", ] @@ -4441,7 +4395,7 @@ dependencies = [ [[package]] name = "sgx_tprotected_fs" version = "1.1.3" -source = "git+https://github.com/apache/teaclave-sgx-sdk.git?rev=v1.1.3#a6a172e652b4db4eaa17e4faa078fda8922abdd0" +source = "git+https://github.com/apache/teaclave-sgx-sdk.git?rev=v1.1.3#ed9e7cce4fd40efd7a256d5c4be1c5f00778a5bb" dependencies = [ "sgx_trts", "sgx_types", @@ -4450,7 +4404,7 @@ dependencies = [ [[package]] name = "sgx_trts" version = "1.1.3" -source = "git+https://github.com/apache/teaclave-sgx-sdk.git?rev=v1.1.3#a6a172e652b4db4eaa17e4faa078fda8922abdd0" +source = "git+https://github.com/apache/teaclave-sgx-sdk.git?rev=v1.1.3#ed9e7cce4fd40efd7a256d5c4be1c5f00778a5bb" dependencies = [ "sgx_libc", "sgx_types", @@ -4459,7 +4413,7 @@ dependencies = [ [[package]] name = "sgx_tstd" version = "1.1.3" -source = "git+https://github.com/apache/teaclave-sgx-sdk.git?rev=v1.1.3#a6a172e652b4db4eaa17e4faa078fda8922abdd0" +source = "git+https://github.com/apache/teaclave-sgx-sdk.git?rev=v1.1.3#ed9e7cce4fd40efd7a256d5c4be1c5f00778a5bb" dependencies = [ "hashbrown_tstd", "sgx_alloc", @@ -4475,12 +4429,12 @@ dependencies = [ [[package]] name = "sgx_types" version = "1.1.3" -source = "git+https://github.com/apache/teaclave-sgx-sdk.git?rev=v1.1.3#a6a172e652b4db4eaa17e4faa078fda8922abdd0" +source = "git+https://github.com/apache/teaclave-sgx-sdk.git?rev=v1.1.3#ed9e7cce4fd40efd7a256d5c4be1c5f00778a5bb" [[package]] name = "sgx_ucrypto" version = "1.1.3" -source = "git+https://github.com/apache/teaclave-sgx-sdk.git?rev=v1.1.3#a6a172e652b4db4eaa17e4faa078fda8922abdd0" +source = "git+https://github.com/apache/teaclave-sgx-sdk.git?rev=v1.1.3#ed9e7cce4fd40efd7a256d5c4be1c5f00778a5bb" dependencies = [ "libc", "rand_core 0.3.1", @@ -4491,7 +4445,7 @@ dependencies = [ [[package]] name = "sgx_unwind" version = "0.1.1" -source = "git+https://github.com/apache/teaclave-sgx-sdk.git?rev=v1.1.3#a6a172e652b4db4eaa17e4faa078fda8922abdd0" +source = "git+https://github.com/apache/teaclave-sgx-sdk.git?rev=v1.1.3#ed9e7cce4fd40efd7a256d5c4be1c5f00778a5bb" dependencies = [ "sgx_build_helper", ] @@ -4499,7 +4453,7 @@ dependencies = [ [[package]] name = "sgx_urts" version = "1.1.3" -source = "git+https://github.com/apache/teaclave-sgx-sdk.git?rev=v1.1.3#a6a172e652b4db4eaa17e4faa078fda8922abdd0" +source = "git+https://github.com/apache/teaclave-sgx-sdk.git?rev=v1.1.3#ed9e7cce4fd40efd7a256d5c4be1c5f00778a5bb" dependencies = [ "libc", "sgx_types", @@ -4568,13 +4522,13 @@ dependencies = [ [[package]] name = "sha2" -version = "0.9.5" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b362ae5752fd2137731f9fa25fd4d9058af34666ca1966fb969119cc35719f12" +checksum = "fa827a14b29ab7f44778d14a88d3cb76e949c45083f7dbfa507d0cb699dc12de" dependencies = [ "block-buffer 0.9.0", "cfg-if 1.0.0", - "cpufeatures", + "cpuid-bool", "digest 0.9.0", "opaque-debug 0.3.0", ] @@ -4590,9 +4544,9 @@ dependencies = [ [[package]] name = "signal-hook" -version = "0.3.9" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "470c5a6397076fae0094aaf06a08e6ba6f37acb77d3b1b91ea92b4d6c8650c39" +checksum = "ef33d6d0cd06e0840fba9985aab098c147e67e05cee14d412d3345ed14ff30ac" dependencies = [ "libc", "signal-hook-registry", @@ -4600,9 +4554,9 @@ dependencies = [ [[package]] name = "signal-hook-registry" -version = "1.4.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" +checksum = "16f1d0fef1604ba8f7a073c7e701f213e056707210e9020af4528e0101ce11a6" dependencies = [ "libc", ] @@ -4615,42 +4569,21 @@ checksum = "0f0242b8e50dd9accdd56170e94ca1ebd223b098eb9c83539a6e367d0f36ae68" [[package]] name = "simba" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5132a955559188f3d13c9ba831e77c802ddc8782783f050ed0c52f5988b95f4c" -dependencies = [ - "approx 0.4.0", - "num-complex 0.3.1", - "num-traits", - "paste", -] - -[[package]] -name = "simba" -version = "0.5.1" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e82063457853d00243beda9952e910b82593e4b07ae9f721b9278a99a0d3d5c" +checksum = "fb931b1367faadea6b1ab1c306a860ec17aaa5fa39f367d0c744e69d971a1fb2" dependencies = [ - "approx 0.5.0", - "num-complex 0.4.0", + "approx", + "num-complex", "num-traits", - "paste", + "paste 0.1.18", ] [[package]] name = "slab" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f173ac3d1a7e3b28003f40de0b5ce7fe2710f9b9dc3fc38664cebee46b3b6527" - -[[package]] -name = "slog" -version = "2.7.0" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8347046d4ebd943127157b94d63abb990fcf729dc4e9978927fdf4ac3c998d06" -dependencies = [ - "erased-serde", -] +checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" [[package]] name = "smallvec" @@ -4688,18 +4621,17 @@ dependencies = [ "futures 0.3.15", "httparse", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.8.4", + "rand 0.8.3", "sha-1 0.9.6", ] [[package]] name = "sp-api" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" +source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" dependencies = [ "hash-db", - "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-scale-codec 2.1.3", + "parity-scale-codec 2.0.1", "sp-api-proc-macro", "sp-core", "sp-runtime", @@ -4712,22 +4644,21 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" +source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" dependencies = [ "blake2-rfc", - "proc-macro-crate 1.0.0", + "proc-macro-crate 0.1.5", "proc-macro2", "quote 1.0.9", - "syn 1.0.73", + "syn 1.0.68", ] [[package]] name = "sp-application-crypto" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" +source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" dependencies = [ - "max-encoded-len", - "parity-scale-codec 2.1.3", + "parity-scale-codec 2.0.1", "serde", "sp-core", "sp-io 3.0.0", @@ -4737,24 +4668,22 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" +source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" dependencies = [ "integer-sqrt", "num-traits", - "parity-scale-codec 2.1.3", + "parity-scale-codec 2.0.1", "serde", "sp-debug-derive", "sp-std", - "static_assertions", ] [[package]] name = "sp-authorship" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" +source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" dependencies = [ - "async-trait", - "parity-scale-codec 2.1.3", + "parity-scale-codec 2.0.1", "sp-inherents", "sp-runtime", "sp-std", @@ -4763,9 +4692,9 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" +source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" dependencies = [ - "parity-scale-codec 2.1.3", + "parity-scale-codec 2.0.1", "sp-api", "sp-inherents", "sp-runtime", @@ -4775,12 +4704,12 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" +source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" dependencies = [ "futures 0.3.15", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", "lru", - "parity-scale-codec 2.1.3", + "parity-scale-codec 2.0.1", "parking_lot 0.11.1", "sp-api", "sp-consensus", @@ -4793,7 +4722,7 @@ dependencies = [ [[package]] name = "sp-chain-spec" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" +source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" dependencies = [ "serde", "serde_json", @@ -4802,14 +4731,13 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" +source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" dependencies = [ - "async-trait", "futures 0.3.15", "futures-timer", "libp2p", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-scale-codec 2.1.3", + "parity-scale-codec 2.0.1", "parking_lot 0.11.1", "serde", "sp-api", @@ -4829,13 +4757,11 @@ dependencies = [ [[package]] name = "sp-consensus-aura" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" +source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" dependencies = [ - "async-trait", - "parity-scale-codec 2.1.3", + "parity-scale-codec 2.0.1", "sp-api", "sp-application-crypto", - "sp-consensus", "sp-consensus-slots", "sp-inherents", "sp-runtime", @@ -4846,9 +4772,9 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" +source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" dependencies = [ - "parity-scale-codec 2.1.3", + "parity-scale-codec 2.0.1", "sp-arithmetic", "sp-runtime", ] @@ -4856,7 +4782,7 @@ dependencies = [ [[package]] name = "sp-core" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" +source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" dependencies = [ "base58", "blake2-rfc", @@ -4866,42 +4792,41 @@ dependencies = [ "futures 0.3.15", "hash-db", "hash256-std-hasher", - "hex 0.4.3", + "hex 0.4.2", "impl-serde", "lazy_static", "libsecp256k1", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", - "max-encoded-len", - "merlin", + "merlin 2.0.1", "num-traits", - "parity-scale-codec 2.1.3", + "parity-scale-codec 2.0.1", "parity-util-mem", "parking_lot 0.11.1", "primitive-types 0.9.0", "rand 0.7.3", - "regex 1.5.4", - "schnorrkel", + "regex 1.4.5", + "schnorrkel 0.9.1", "secrecy", "serde", - "sha2 0.9.5", + "sha2 0.9.3", "sp-debug-derive", "sp-externalities", "sp-runtime-interface", "sp-std", "sp-storage", - "substrate-bip39", + "substrate-bip39 0.4.2", "thiserror", "tiny-bip39 0.8.0", "tiny-keccak 2.0.2", "twox-hash", "wasmi", - "zeroize", + "zeroize 1.2.0", ] [[package]] name = "sp-database" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" +source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" dependencies = [ "kvdb", "parking_lot 0.11.1", @@ -4910,20 +4835,20 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" +source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" dependencies = [ "proc-macro2", "quote 1.0.9", - "syn 1.0.73", + "syn 1.0.68", ] [[package]] name = "sp-externalities" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" +source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" dependencies = [ "environmental", - "parity-scale-codec 2.1.3", + "parity-scale-codec 2.0.1", "sp-std", "sp-storage", ] @@ -4931,11 +4856,11 @@ dependencies = [ [[package]] name = "sp-finality-grandpa" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" +source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" dependencies = [ "finality-grandpa", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-scale-codec 2.1.3", + "parity-scale-codec 2.0.1", "serde", "sp-api", "sp-application-crypto", @@ -4948,13 +4873,11 @@ dependencies = [ [[package]] name = "sp-inherents" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" +source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" dependencies = [ - "async-trait", - "impl-trait-for-tuples", - "parity-scale-codec 2.1.3", + "parity-scale-codec 2.0.1", + "parking_lot 0.11.1", "sp-core", - "sp-runtime", "sp-std", "thiserror", ] @@ -4962,18 +4885,17 @@ dependencies = [ [[package]] name = "sp-io" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" +source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" dependencies = [ "futures 0.3.15", "hash-db", "libsecp256k1", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-scale-codec 2.1.3", + "parity-scale-codec 2.0.1", "parking_lot 0.11.1", "sp-core", "sp-externalities", "sp-keystore", - "sp-maybe-compressed-blob", "sp-runtime-interface", "sp-state-machine", "sp-std", @@ -4987,12 +4909,12 @@ dependencies = [ [[package]] name = "sp-io" version = "3.1.0" -source = "git+https://github.com/scs/sgx-runtime?branch=version-update#de9fc665a1e5268e53432841d642d61ddc793db2" +source = "git+https://github.com/scs/sgx-runtime#3638c9d23f107d9dae7b9e6643af93e27da517bf" dependencies = [ "environmental", "hash-db", "log 0.4.14 (git+https://github.com/mesalock-linux/log-sgx)", - "parity-scale-codec 2.1.3", + "parity-scale-codec 2.0.1", "sgx-externalities", "sgx_tstd", "sgx_types", @@ -5008,7 +4930,7 @@ dependencies = [ [[package]] name = "sp-keyring" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" +source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" dependencies = [ "lazy_static", "sp-core", @@ -5019,33 +4941,24 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" +source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" dependencies = [ "async-trait", "derive_more", "futures 0.3.15", - "merlin", - "parity-scale-codec 2.1.3", + "merlin 2.0.1", + "parity-scale-codec 2.0.1", "parking_lot 0.11.1", - "schnorrkel", + "schnorrkel 0.9.1", "serde", "sp-core", "sp-externalities", ] -[[package]] -name = "sp-maybe-compressed-blob" -version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" -dependencies = [ - "ruzstd", - "zstd", -] - [[package]] name = "sp-offchain" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" +source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" dependencies = [ "sp-api", "sp-core", @@ -5055,7 +4968,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" +source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" dependencies = [ "backtrace", ] @@ -5063,27 +4976,24 @@ dependencies = [ [[package]] name = "sp-rpc" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" +source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" dependencies = [ - "rustc-hash", "serde", "sp-core", - "tracing-core", ] [[package]] name = "sp-runtime" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" +source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" dependencies = [ "either", "hash256-std-hasher", "impl-trait-for-tuples", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", - "max-encoded-len", - "parity-scale-codec 2.1.3", + "parity-scale-codec 2.0.1", "parity-util-mem", - "paste", + "paste 1.0.5", "rand 0.7.3", "serde", "sp-application-crypto", @@ -5096,10 +5006,10 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" +source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" dependencies = [ "impl-trait-for-tuples", - "parity-scale-codec 2.1.3", + "parity-scale-codec 2.0.1", "primitive-types 0.9.0", "sp-externalities", "sp-runtime-interface-proc-macro", @@ -5113,21 +5023,21 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" +source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" dependencies = [ "Inflector", - "proc-macro-crate 1.0.0", + "proc-macro-crate 0.1.5", "proc-macro2", "quote 1.0.9", - "syn 1.0.73", + "syn 1.0.68", ] [[package]] name = "sp-session" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" +source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" dependencies = [ - "parity-scale-codec 2.1.3", + "parity-scale-codec 2.0.1", "sp-api", "sp-core", "sp-runtime", @@ -5138,9 +5048,9 @@ dependencies = [ [[package]] name = "sp-staking" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" +source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" dependencies = [ - "parity-scale-codec 2.1.3", + "parity-scale-codec 2.0.1", "sp-runtime", "sp-std", ] @@ -5148,12 +5058,12 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" +source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" dependencies = [ "hash-db", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits", - "parity-scale-codec 2.1.3", + "parity-scale-codec 2.0.1", "parking_lot 0.11.1", "rand 0.7.3", "smallvec 1.6.1", @@ -5163,7 +5073,6 @@ dependencies = [ "sp-std", "sp-trie", "thiserror", - "tracing", "trie-db", "trie-root", ] @@ -5171,15 +5080,15 @@ dependencies = [ [[package]] name = "sp-std" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" +source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" [[package]] name = "sp-storage" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" +source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" dependencies = [ "impl-serde", - "parity-scale-codec 2.1.3", + "parity-scale-codec 2.0.1", "ref-cast", "serde", "sp-debug-derive", @@ -5189,32 +5098,24 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" +source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" dependencies = [ - "async-trait", - "futures-timer", - "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-scale-codec 2.1.3", + "impl-trait-for-tuples", + "parity-scale-codec 2.0.1", "sp-api", "sp-inherents", "sp-runtime", "sp-std", - "thiserror", "wasm-timer", ] [[package]] name = "sp-tracing" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" +source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" dependencies = [ - "erased-serde", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-scale-codec 2.1.3", - "parking_lot 0.10.2", - "serde", - "serde_json", - "slog", + "parity-scale-codec 2.0.1", "sp-std", "tracing", "tracing-core", @@ -5224,12 +5125,12 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" +source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" dependencies = [ "derive_more", "futures 0.3.15", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-scale-codec 2.1.3", + "parity-scale-codec 2.0.1", "serde", "sp-api", "sp-blockchain", @@ -5240,11 +5141,11 @@ dependencies = [ [[package]] name = "sp-trie" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" +source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" dependencies = [ "hash-db", "memory-db", - "parity-scale-codec 2.1.3", + "parity-scale-codec 2.0.1", "sp-core", "sp-std", "trie-db", @@ -5254,7 +5155,7 @@ dependencies = [ [[package]] name = "sp-utils" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" +source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" dependencies = [ "futures 0.3.15", "futures-core", @@ -5266,35 +5167,22 @@ dependencies = [ [[package]] name = "sp-version" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" +source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" dependencies = [ "impl-serde", - "parity-scale-codec 2.1.3", + "parity-scale-codec 2.0.1", "serde", "sp-runtime", "sp-std", - "sp-version-proc-macro", -] - -[[package]] -name = "sp-version-proc-macro" -version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" -dependencies = [ - "parity-scale-codec 2.1.3", - "proc-macro-crate 1.0.0", - "proc-macro2", - "quote 1.0.9", - "syn 1.0.73", ] [[package]] name = "sp-wasm-interface" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" +source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" dependencies = [ "impl-trait-for-tuples", - "parity-scale-codec 2.1.3", + "parity-scale-codec 2.0.1", "sp-std", "wasmi", ] @@ -5313,15 +5201,11 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "statrs" -version = "0.14.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e0c1f144861fbfd2a8cc82d564ccbf7fb3b7834d4fa128b84e9c2a73371aead" +checksum = "cce16f6de653e88beca7bd13780d08e09d4489dbca1f9210e041bc4852481382" dependencies = [ - "approx 0.4.0", - "lazy_static", - "nalgebra 0.26.2", - "num-traits", - "rand 0.8.4", + "rand 0.7.3", ] [[package]] @@ -5348,22 +5232,22 @@ dependencies = [ "heck", "proc-macro2", "quote 1.0.9", - "syn 1.0.73", + "syn 1.0.68", ] [[package]] name = "substrate-api-client" -version = "0.6.0" -source = "git+https://github.com/scs/substrate-api-client?branch=master#3c8c04cd785b383dfbacb48a374503e644d13a08" +version = "0.5.0" +source = "git+https://github.com/scs/substrate-api-client#b4ccb09405bb49b2609f20d5ef19db05834a5a02" dependencies = [ "env_logger 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "frame-metadata", "frame-support", "frame-system", - "hex 0.4.3", + "hex 0.4.2", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", "pallet-balances", - "parity-scale-codec 2.1.3", + "parity-scale-codec 2.0.1", "primitive-types 0.6.2", "sc-rpc-api", "serde", @@ -5376,6 +5260,18 @@ dependencies = [ "ws 0.9.1", ] +[[package]] +name = "substrate-bip39" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3be511be555a3633e71739a79e4ddff6a6aaa6579fa6114182a51d72c3eb93c5" +dependencies = [ + "hmac 0.7.1", + "pbkdf2 0.3.0", + "schnorrkel 0.8.5", + "sha2 0.8.2", +] + [[package]] name = "substrate-bip39" version = "0.4.2" @@ -5384,18 +5280,18 @@ checksum = "bed6646a0159b9935b5d045611560eeef842b78d7adc3ba36f5ca325a13a0236" dependencies = [ "hmac 0.7.1", "pbkdf2 0.3.0", - "schnorrkel", + "schnorrkel 0.9.1", "sha2 0.8.2", - "zeroize", + "zeroize 1.2.0", ] [[package]] name = "substrate-client-keystore" -version = "0.6.0" -source = "git+https://github.com/scs/substrate-api-client?branch=master#3c8c04cd785b383dfbacb48a374503e644d13a08" +version = "0.1.0" +source = "git+https://github.com/scs/substrate-api-client#b4ccb09405bb49b2609f20d5ef19db05834a5a02" dependencies = [ "async-trait", - "hex 0.4.3", + "hex 0.4.2", "parking_lot 0.10.2", "sc-keystore", "serde_json", @@ -5408,7 +5304,7 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" +source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" dependencies = [ "async-std", "derive_more", @@ -5422,13 +5318,12 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" +source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" dependencies = [ "ansi_term 0.12.1", "atty", "build-helper", "cargo_metadata", - "sp-maybe-compressed-blob", "tempfile", "toml", "walkdir", @@ -5439,7 +5334,7 @@ dependencies = [ name = "substratee-api-client-extensions" version = "0.8.0" dependencies = [ - "parity-scale-codec 2.1.3", + "parity-scale-codec 2.0.1", "sp-core", "sp-finality-grandpa", "sp-runtime", @@ -5459,11 +5354,11 @@ dependencies = [ "env_logger 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "frame-system", "geojson", - "hex 0.4.3", + "hex 0.4.2", "json", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", "pallet-balances", - "parity-scale-codec 2.1.3", + "parity-scale-codec 2.0.1", "primitive-types 0.6.2", "sc-keystore", "serde", @@ -5474,7 +5369,7 @@ dependencies = [ "sp-keyring", "sp-runtime", "substrate-api-client", - "substrate-bip39", + "substrate-bip39 0.3.1", "substrate-client-keystore", "substratee-api-client-extensions", "substratee-node-primitives", @@ -5494,17 +5389,16 @@ version = "0.8.0" name = "substratee-node-primitives" version = "0.8.0" dependencies = [ - "parity-scale-codec 2.1.3", + "parity-scale-codec 2.0.1", "sgx_tstd", "sp-core", - "sp-runtime", "substratee-node-runtime", ] [[package]] name = "substratee-node-runtime" version = "0.8.0" -source = "git+https://github.com/scs/substraTEE-node?branch=feature-gate-ias-verify#102dee0f031a1aca16962dc9899db0607a6e9515" +source = "git+https://github.com/scs/substraTEE-node#1a0ad62ba0965c2f4a79b8e6d83b7d6669b59c88" dependencies = [ "frame-executive", "frame-support", @@ -5519,7 +5413,8 @@ dependencies = [ "pallet-timestamp", "pallet-transaction-payment", "pallet-transaction-payment-rpc-runtime-api", - "parity-scale-codec 2.1.3", + "parity-scale-codec 2.0.1", + "serde", "sp-api", "sp-block-builder", "sp-consensus-aura", @@ -5549,12 +5444,13 @@ dependencies = [ "env_logger 0.7.1 (git+https://github.com/mesalock-linux/env_logger-sgx)", "frame-support", "frame-system", - "hex 0.4.3", - "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", + "hex 0.4.2", "log 0.4.14 (git+https://github.com/mesalock-linux/log-sgx)", + "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", "pallet-balances", - "parity-scale-codec 2.1.3", + "parity-scale-codec 2.0.1", "sc-keystore", + "serde", "sgx-externalities", "sgx-runtime", "sgx_tstd", @@ -5573,6 +5469,8 @@ dependencies = [ name = "substratee-worker" version = "0.8.0" dependencies = [ + "anyhow", + "async-trait", "base58", "cid", "clap", @@ -5587,7 +5485,7 @@ dependencies = [ "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", "multihash 0.8.0", "pallet-balances", - "parity-scale-codec 2.1.3", + "parity-scale-codec 2.0.1", "parking_lot 0.11.1", "primitive-types 0.9.0", "rust-crypto", @@ -5613,7 +5511,7 @@ dependencies = [ "substratee-worker-primitives", "substratee-worker-rpc-server", "thiserror", - "tokio 0.2.25", + "tokio 1.6.1", "ws 0.7.9", ] @@ -5622,7 +5520,7 @@ name = "substratee-worker-api" version = "0.8.0" dependencies = [ "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-scale-codec 2.1.3", + "parity-scale-codec 2.0.1", "serde_derive", "serde_json", "sgx_crypto_helper", @@ -5635,7 +5533,7 @@ name = "substratee-worker-primitives" version = "0.8.0" dependencies = [ "chrono", - "parity-scale-codec 2.1.3", + "parity-scale-codec 2.0.1", "primitive-types 0.9.0", "serde", "serde_derive", @@ -5658,8 +5556,8 @@ dependencies = [ "serde_json", "soketto", "substratee-enclave-api", - "tokio 1.7.1", - "tokio-util 0.6.7", + "tokio 1.6.1", + "tokio-util 0.6.5", ] [[package]] @@ -5687,13 +5585,13 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.73" +version = "1.0.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f71489ff30030d2ae598524f61326b902466f72a0fb1a8564c001cc63425bcc7" +checksum = "3ce15dd3ed8aa2f8eeac4716d6ef5ab58b6b9256db41d7e1a0224c2788e8fd87" dependencies = [ "proc-macro2", "quote 1.0.9", - "unicode-xid 0.2.2", + "unicode-xid 0.2.1", ] [[package]] @@ -5713,8 +5611,8 @@ checksum = "b834f2d66f734cb897113e34aaff2f1ab4719ca946f9a7358dba8f8064148701" dependencies = [ "proc-macro2", "quote 1.0.9", - "syn 1.0.73", - "unicode-xid 0.2.2", + "syn 1.0.68", + "unicode-xid 0.2.1", ] [[package]] @@ -5731,8 +5629,8 @@ checksum = "dac1c663cfc93810f88aed9b8941d48cabf856a1b111c29a40439018d870eb22" dependencies = [ "cfg-if 1.0.0", "libc", - "rand 0.8.4", - "redox_syscall 0.2.9", + "rand 0.8.3", + "redox_syscall 0.2.5", "remove_dir_all", "winapi 0.3.9", ] @@ -5765,22 +5663,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.25" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa6f76457f59514c7eeb4e59d891395fab0b2fd1d40723ae737d64153392e9c6" +checksum = "e0f4a65597094d4483ddaed134f409b2cb7c1beccf25201a9f73c719254fa98e" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.25" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a36768c0fbf1bb15eca10defa29526bda730a2376c2ab4393ccfa16fb1a318d" +checksum = "7765189610d8241a44529806d6fd1f2e0a08734313a35d5b3a556f92b381f3c0" dependencies = [ "proc-macro2", "quote 1.0.9", - "syn 1.0.73", + "syn 1.0.68", ] [[package]] @@ -5798,7 +5696,7 @@ version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8018d24e04c95ac8790716a5987d0fec4f8b27249ffa0f7d33f1369bdfb88cbd" dependencies = [ - "once_cell 1.8.0", + "once_cell 1.7.2", ] [[package]] @@ -5834,14 +5732,14 @@ checksum = "d9e44c4759bae7f1032e286a7ef990bd9ed23fe831b7eeba0beb97484c2e59b8" dependencies = [ "anyhow", "hmac 0.8.1", - "once_cell 1.8.0", + "once_cell 1.7.2", "pbkdf2 0.4.0", "rand 0.7.3", "rustc-hash", - "sha2 0.9.5", + "sha2 0.9.3", "thiserror", "unicode-normalization", - "zeroize", + "zeroize 1.2.0", ] [[package]] @@ -5886,42 +5784,30 @@ dependencies = [ "bytes 0.5.6", "fnv", "futures-core", - "memchr 2.4.0", + "memchr 2.3.4", "pin-project-lite 0.1.12", - "tokio-macros 0.2.6", ] [[package]] name = "tokio" -version = "1.7.1" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fb2ed024293bb19f7a5dc54fe83bf86532a44c12a2bb8ba40d64a4509395ca2" +checksum = "0a38d31d7831c6ed7aad00aa4c12d9375fd225a6dd77da1d25b707346319a975" dependencies = [ "autocfg 1.0.1", "bytes 1.0.1", "libc", - "memchr 2.4.0", - "mio 0.7.13", + "memchr 2.3.4", + "mio 0.7.11", "num_cpus", - "once_cell 1.8.0", + "once_cell 1.7.2", "parking_lot 0.11.1", "pin-project-lite 0.2.6", "signal-hook-registry", - "tokio-macros 1.2.0", + "tokio-macros", "winapi 0.3.9", ] -[[package]] -name = "tokio-macros" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e44da00bfc73a25f814cd8d7e57a68a5c31b74b3152a0a1d1f590c97ed06265a" -dependencies = [ - "proc-macro2", - "quote 1.0.9", - "syn 1.0.73", -] - [[package]] name = "tokio-macros" version = "1.2.0" @@ -5930,7 +5816,7 @@ checksum = "c49e3df43841dafb86046472506755d8501c5615673955f6aa17181125d13c37" dependencies = [ "proc-macro2", "quote 1.0.9", - "syn 1.0.73", + "syn 1.0.68", ] [[package]] @@ -5940,7 +5826,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7d995660bd2b7f8c1568414c1126076c13fbb725c40112dc0120b78eb9b717b" dependencies = [ "native-tls", - "tokio 1.7.1", + "tokio 1.6.1", ] [[package]] @@ -5950,7 +5836,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc6844de72e57df1980054b38be3a9f4702aba4858be64dd700181a8a6d0e1b6" dependencies = [ "rustls", - "tokio 1.7.1", + "tokio 1.6.1", "webpki 0.21.4", ] @@ -5962,7 +5848,7 @@ checksum = "f8864d706fdb3cc0843a49647ac892720dac98a6eeb818b77190592cf4994066" dependencies = [ "futures-core", "pin-project-lite 0.2.6", - "tokio 1.7.1", + "tokio 1.6.1", ] [[package]] @@ -5981,9 +5867,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.6.7" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1caa0b0c8d94a049db56b5acf8cba99dc0623aab1b26d5b5f5e2d945846b3592" +checksum = "5143d049e85af7fbc36f5454d990e62c2df705b3589f123b71f441b6b59f443f" dependencies = [ "bytes 1.0.1", "futures-core", @@ -5991,7 +5877,7 @@ dependencies = [ "futures-sink", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", "pin-project-lite 0.2.6", - "tokio 1.7.1", + "tokio 1.6.1", ] [[package]] @@ -6011,9 +5897,9 @@ checksum = "360dfd1d6d30e05fda32ace2c8c70e9c0a9da713275777f5a4dbb8a1893930c6" [[package]] name = "tracing" -version = "0.1.26" +version = "0.1.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09adeb8c97449311ccd28a427f96fb563e7fd31aabf994189879d9da2394b89d" +checksum = "01ebdc2bb4498ab1ab5f5b73c5803825e60199229ccba0698170e3be0e7f959f" dependencies = [ "cfg-if 1.0.0", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", @@ -6030,14 +5916,14 @@ checksum = "c42e6fa53307c8a17e4ccd4dc81cf5ec38db9209f59b222210375b54ee40d1e2" dependencies = [ "proc-macro2", "quote 1.0.9", - "syn 1.0.73", + "syn 1.0.68", ] [[package]] name = "tracing-core" -version = "0.1.18" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9ff14f98b1a4b289c6248a023c1c2fa1491062964e9fed67ab29c4e4da4a052" +checksum = "f50de3927f93d202783f4513cda820ab47ef17f624b03c096e86ef00c67e6b5f" dependencies = [ "lazy_static", ] @@ -6048,7 +5934,7 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" dependencies = [ - "pin-project 1.0.7", + "pin-project 1.0.6", "tracing", ] @@ -6075,15 +5961,15 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.2.18" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa5553bf0883ba7c9cbe493b085c29926bd41b66afc31ff72cf17ff4fb60dcd5" +checksum = "705096c6f83bf68ea5d357a6aa01829ddbdac531b357b45abeca842938085baa" dependencies = [ "ansi_term 0.12.1", "chrono", "lazy_static", "matchers", - "regex 1.5.4", + "regex 1.4.5", "serde", "serde_json", "sharded-slab", @@ -6097,9 +5983,9 @@ dependencies = [ [[package]] name = "trie-db" -version = "0.22.5" +version = "0.22.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd81fe0c8bc2b528a51c9d2c31dae4483367a26a723a3c9a4a8120311d7774e3" +checksum = "ec051edf7f0fc9499a2cb0947652cab2148b9d7f61cee7605e312e9f970dacaf" dependencies = [ "hash-db", "hashbrown 0.9.1", @@ -6142,7 +6028,7 @@ checksum = "345426c7406aa355b60c5007c79a2d1f5b605540072795222f17f6443e6a9c6f" dependencies = [ "proc-macro2", "quote 1.0.9", - "syn 1.0.73", + "syn 1.0.68", ] [[package]] @@ -6177,7 +6063,7 @@ checksum = "e11fe9a9348741cf134085ad57c249508345fe16411b3d7fb4ff2da2f1d6382e" dependencies = [ "byteorder", "crunchy", - "hex 0.4.3", + "hex 0.4.2", "static_assertions", ] @@ -6192,18 +6078,18 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.5" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eeb8be209bb1c96b7c177c7420d26e04eccacb0eeae6b980e35fcb74678107e0" +checksum = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" dependencies = [ "matches", ] [[package]] name = "unicode-normalization" -version = "0.1.19" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54590932941a9e9266f0832deed84ebe1bf2e4c9e4a3554d393d18f5e854bf9" +checksum = "07fbfce1c8a97d547e8b5334978438d9d6ec8c20e38f56d4a4374d181493eaef" dependencies = [ "tinyvec", ] @@ -6228,9 +6114,9 @@ checksum = "8c1f860d7d29cf02cb2f3f359fd35991af3d30bac52c57d265a3c461074cb4dc" [[package]] name = "unicode-xid" -version = "0.2.2" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" +checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" [[package]] name = "unsigned-varint" @@ -6263,31 +6149,36 @@ dependencies = [ [[package]] name = "url" -version = "2.2.2" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c" +checksum = "9ccd964113622c8e9322cfac19eb1004a07e636c545f325da085d5cdde6f1f8b" dependencies = [ "form_urlencoded", - "idna 0.2.3", + "idna 0.2.2", "matches", "percent-encoding 2.1.0", ] [[package]] name = "value-bag" -version = "1.0.0-alpha.7" +version = "1.0.0-alpha.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd320e1520f94261153e96f7534476ad869c14022aee1e59af7c778075d840ae" +checksum = "6b676010e055c99033117c2343b33a40a30b91fecd6c49055ac9cd2d6c305ab1" dependencies = [ "ctor", - "version_check", ] [[package]] name = "vcpkg" -version = "0.2.15" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b00bca6106a5e23f3eee943593759b7fcddb00554332e856d990c893966879fb" + +[[package]] +name = "vec-arena" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" +checksum = "34b2f665b594b07095e3ac3f718e13c2197143416fae4c5706cffb7b1af8d7f1" [[package]] name = "vec_map" @@ -6348,9 +6239,9 @@ checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" [[package]] name = "wasm-bindgen" -version = "0.2.74" +version = "0.2.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54ee1d4ed486f78874278e63e4069fc1ab9f6a18ca492076ffb90c5eb2997fd" +checksum = "83240549659d187488f91f33c0f8547cbfef0b2088bc470c116d1d260ef623d9" dependencies = [ "cfg-if 1.0.0", "wasm-bindgen-macro", @@ -6358,24 +6249,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.74" +version = "0.2.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b33f6a0694ccfea53d94db8b2ed1c3a8a4c86dd936b13b9f0a15ec4a451b900" +checksum = "ae70622411ca953215ca6d06d3ebeb1e915f0f6613e3b495122878d7ebec7dae" dependencies = [ "bumpalo", "lazy_static", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", "proc-macro2", "quote 1.0.9", - "syn 1.0.73", + "syn 1.0.68", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.24" +version = "0.4.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fba7978c679d53ce2d0ac80c8c175840feb849a161664365d1287b41f2e67f1" +checksum = "81b8b767af23de6ac18bf2168b690bed2902743ddf0fb39252e36f9e2bfc63ea" dependencies = [ "cfg-if 1.0.0", "js-sys", @@ -6385,9 +6276,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.74" +version = "0.2.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "088169ca61430fe1e58b8096c24975251700e7b1f6fd91cc9d59b04fb9b18bd4" +checksum = "3e734d91443f177bfdb41969de821e15c516931c3c3db3d318fa1b68975d0f6f" dependencies = [ "quote 1.0.9", "wasm-bindgen-macro-support", @@ -6395,22 +6286,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.74" +version = "0.2.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be2241542ff3d9f241f5e2cb6dd09b37efe786df8851c54957683a49f0987a97" +checksum = "d53739ff08c8a68b0fdbcd54c372b8ab800b1449ab3c9d706503bc7dd1621b2c" dependencies = [ "proc-macro2", "quote 1.0.9", - "syn 1.0.73", + "syn 1.0.68", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.74" +version = "0.2.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7cff876b8f18eed75a66cf49b65e7f967cb354a7aa16003fb55dbfd25b44b4f" +checksum = "d9a543ae66aa233d14bb765ed9af4a33e81b8b58d1584cf1b47ff8cd0b9e4489" [[package]] name = "wasm-gc-api" @@ -6440,33 +6331,32 @@ dependencies = [ [[package]] name = "wasmi" -version = "0.9.0" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2ee05bba3d1d994652079893941a2ef9324d2b58a63c31b40678fb7eddd7a5a" +checksum = "bf617d864d25af3587aa745529f7aaa541066c876d57e050c0d0c85c61c92aff" dependencies = [ - "downcast-rs", "libc", "memory_units", - "num-rational 0.2.4", + "num-rational", "num-traits", - "parity-wasm 0.42.2", + "parity-wasm 0.41.0", "wasmi-validation", ] [[package]] name = "wasmi-validation" -version = "0.4.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb8e860796d8be48efef530b60eebf84e74a88bce107374fffb0da97d504b8" +checksum = "ea78c597064ba73596099281e2f4cfc019075122a65cdda3205af94f0b264d93" dependencies = [ - "parity-wasm 0.42.2", + "parity-wasm 0.41.0", ] [[package]] name = "web-sys" -version = "0.3.51" +version = "0.3.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e828417b379f3df7111d3a2a9e5753706cae29c41f7c4029ee9fd77f3e09e582" +checksum = "a905d57e488fec8861446d3393670fb50d27a262344013181c2cdf9fff5481be" dependencies = [ "js-sys", "wasm-bindgen", @@ -6493,10 +6383,10 @@ dependencies = [ ] [[package]] -name = "wepoll-ffi" -version = "0.1.2" +name = "wepoll-sys" +version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d743fdedc5c64377b5fc2bc036b01c7fd642205a0d96356034ae3404d49eb7fb" +checksum = "0fcb14dea929042224824779fbc82d9fab8d2e6d3cbc0ac404de8edf489e77ff" dependencies = [ "cc", ] @@ -6599,7 +6489,7 @@ dependencies = [ "rand 0.7.3", "sha-1 0.8.2", "slab", - "url 2.2.2", + "url 2.2.1", ] [[package]] @@ -6626,50 +6516,27 @@ checksum = "e66366e18dc58b46801afbf2ca7661a9f59cc8c5962c29892b6039b4f86fa992" [[package]] name = "zeroize" -version = "1.3.0" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45af6a010d13e4cf5b54c94ba5a2b2eba5596b9e46bf5875612d332a1f2b3f86" + +[[package]] +name = "zeroize" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4756f7db3f7b5574938c3eb1c117038b8e07f95ee6718c0efad4ac21508f1efd" +checksum = "81a974bcdd357f0dca4d41677db03436324d45a4c9ed2d0b873a5a360ce41c36" dependencies = [ "zeroize_derive", ] [[package]] name = "zeroize_derive" -version = "1.1.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2c1e130bebaeab2f23886bf9acbaca14b092408c452543c857f66399cd6dab1" +checksum = "c3f369ddb18862aba61aa49bf31e74d29f0f162dec753063200e1dc084345d16" dependencies = [ "proc-macro2", "quote 1.0.9", - "syn 1.0.73", + "syn 1.0.68", "synstructure", ] - -[[package]] -name = "zstd" -version = "0.6.1+zstd.1.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5de55e77f798f205d8561b8fe2ef57abfb6e0ff2abe7fd3c089e119cdb5631a3" -dependencies = [ - "zstd-safe", -] - -[[package]] -name = "zstd-safe" -version = "3.0.1+zstd.1.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1387cabcd938127b30ce78c4bf00b30387dddf704e3f0881dbc4ff62b5566f8c" -dependencies = [ - "libc", - "zstd-sys", -] - -[[package]] -name = "zstd-sys" -version = "1.4.20+zstd.1.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebd5b733d7cf2d9447e2c3e76a5589b4f5e5ae065c22a2bc0b023cbc331b6c8e" -dependencies = [ - "cc", - "libc", -] diff --git a/enclave/src/lib.rs b/enclave/src/lib.rs index 2d85da4b20..e0fa3855cb 100644 --- a/enclave/src/lib.rs +++ b/enclave/src/lib.rs @@ -37,7 +37,7 @@ use sgx_types::{sgx_epid_group_id_t, sgx_status_t, sgx_target_info_t, SgxResult} use substrate_api_client::compose_extrinsic_offline; use substratee_node_primitives::{CallWorkerFn, ShieldFundsFn}; use substratee_worker_primitives::block::{ - Block as SidechainBlock, SignedBlock as SignedSidechainBlock, StatePayload, + Block as SidechainBlock, SignedBlock as SignedSidechainBlock, }; use substratee_worker_primitives::BlockHash; @@ -69,7 +69,7 @@ use sgx_externalities::SgxExternalitiesTypeTrait; use substratee_stf::sgx::{shards_key_hash, storage_hashes_to_update_per_shard, OpaqueCall}; use substratee_stf::State as StfState; use substratee_stf::{ - AccountId, Getter, ShardIdentifier, Stf, TrustedCall, TrustedCallSigned, TrustedGetterSigned, + AccountId, Getter, ShardIdentifier, Stf, TrustedCall, TrustedCallSigned, TrustedGetterSigned, StatePayload }; use rpc::author::{hash::TrustedOperationOrHash, Author, AuthorApi}; diff --git a/enclave/src/tests.rs b/enclave/src/tests.rs index f781775e32..44d52b25f5 100644 --- a/enclave/src/tests.rs +++ b/enclave/src/tests.rs @@ -29,7 +29,6 @@ use sgx_tunittest::*; use sgx_types::{sgx_status_t, size_t}; use substrate_api_client::utils::storage_key; -use substratee_worker_primitives::block::StatePayload; use codec::{Decode, Encode}; use sp_core::{crypto::Pair, hashing::blake2_256, H256}; @@ -51,7 +50,7 @@ use sp_runtime::traits::Header as HeaderT; use sgx_externalities::SgxExternalitiesTypeTrait; use substratee_stf::AccountInfo; use substratee_stf::StateTypeDiff as StfStateTypeDiff; -use substratee_stf::{ShardIdentifier, Stf, TrustedCall}; +use substratee_stf::{ShardIdentifier, Stf, TrustedCall, StatePayload}; use substratee_stf::{TrustedGetter, TrustedOperation}; use substratee_settings::enclave::{GETTER_TIMEOUT}; diff --git a/primitives/worker/src/block.rs b/primitives/worker/src/block.rs index 120cabbae4..f07d95fad6 100644 --- a/primitives/worker/src/block.rs +++ b/primitives/worker/src/block.rs @@ -31,38 +31,6 @@ pub struct SignedBlock { signature: Signature, } -/// payload of block that needs to be encrypted -#[derive(PartialEq, Eq, Clone, Encode, Decode, Debug)] -#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] -pub struct StatePayload { - state_hash_apriori: H256, - state_hash_aposteriori: H256, - /// encoded state update - state_update: Vec, -} - -impl StatePayload { - /// get hash of state before block execution - pub fn state_hash_apriori(&self) -> H256 { - self.state_hash_apriori - } - /// get hash of state after block execution - pub fn state_hash_aposteriori(&self) -> H256 { - self.state_hash_aposteriori - } - /// get encoded state update reference - pub fn state_update(&self) -> &Vec { - &self.state_update - } - pub fn new(apriori: H256, aposteriori: H256, update: Vec) -> StatePayload { - StatePayload { - state_hash_apriori: apriori, - state_hash_aposteriori: aposteriori, - state_update: update, - } - } -} - /// simplified block structure for relay chain submission as an extrinsic #[derive(PartialEq, Eq, Clone, Encode, Decode, Debug)] #[cfg_attr(feature = "std", derive(Serialize, Deserialize))] @@ -184,26 +152,6 @@ mod tests { use std::thread; use std::time::Duration; - #[test] - fn new_payload_works() { - // given - let state_hash_apriori = H256::random(); - let state_hash_aposteriori = H256::random(); - let state_update: Vec = vec![]; - - // when - let payload = StatePayload::new( - state_hash_apriori.clone(), - state_hash_aposteriori.clone(), - state_update.clone(), - ); - - // then - assert_eq!(state_hash_apriori, payload.state_hash_apriori()); - assert_eq!(state_hash_aposteriori, payload.state_hash_aposteriori()); - assert_eq!(state_update, *payload.state_update()); - } - #[test] fn construct_block_works() { // given diff --git a/stf/Cargo.toml b/stf/Cargo.toml index 50afa765d2..27a51273bc 100644 --- a/stf/Cargo.toml +++ b/stf/Cargo.toml @@ -22,12 +22,13 @@ std = [ "log", "base58", "sc-keystore", + "serde", "system/std", "sp-core/std", "hex", "substrate-api-client", "substrate-client-keystore", - "my-node-runtime" + "my-node-runtime", ] [dependencies] @@ -39,6 +40,7 @@ log = { version = "0.4", optional = true } base58 = { version = "0.1", optional = true } derive_more = { version = "0.99.5", optional = true } hex = { version = "0.4.2", optional = true } +serde = { version = "1.0", features = ["derive"], optional = true } [dependencies.sgx_tstd] git = "https://github.com/apache/teaclave-sgx-sdk.git" diff --git a/stf/src/lib.rs b/stf/src/lib.rs index 8c98341b9a..6d9ab89a59 100644 --- a/stf/src/lib.rs +++ b/stf/src/lib.rs @@ -28,6 +28,9 @@ extern crate alloc; #[cfg(feature = "std")] extern crate clap; +#[cfg(feature = "std")] +use serde::{Deserialize, Serialize}; + use codec::{Compact, Decode, Encode}; #[cfg(feature = "std")] use my_node_runtime::Balance; @@ -275,6 +278,45 @@ pub struct TrustedReturnValue { impl TrustedReturnValue */ + +#[cfg(feature = "sgx")] +use sgx_tstd as std; + +#[cfg(feature = "sgx")] +use std::vec::Vec; + +/// payload of block that needs to be encrypted +#[derive(PartialEq, Eq, Clone, Encode, Decode, Debug)] +#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] +pub struct StatePayload { + state_hash_apriori: H256, + state_hash_aposteriori: H256, + /// encoded state update + state_update: Vec, +} + +impl StatePayload { + /// get hash of state before block execution + pub fn state_hash_apriori(&self) -> H256 { + self.state_hash_apriori + } + /// get hash of state after block execution + pub fn state_hash_aposteriori(&self) -> H256 { + self.state_hash_aposteriori + } + /// get encoded state update reference + pub fn state_update(&self) -> &Vec { + &self.state_update + } + pub fn new(apriori: H256, aposteriori: H256, update: Vec) -> StatePayload { + StatePayload { + state_hash_apriori: apriori, + state_hash_aposteriori: aposteriori, + state_update: update, + } + } +} + #[cfg(test)] mod tests { use super::*; @@ -301,4 +343,24 @@ mod tests { assert!(signed_call.verify_signature(&mrenclave, &shard)); } + + #[test] + fn new_payload_works() { + // given + let state_hash_apriori = H256::random(); + let state_hash_aposteriori = H256::random(); + let state_update: Vec = vec![]; + + // when + let payload = StatePayload::new( + state_hash_apriori.clone(), + state_hash_aposteriori.clone(), + state_update.clone(), + ); + + // then + assert_eq!(state_hash_apriori, payload.state_hash_apriori()); + assert_eq!(state_hash_aposteriori, payload.state_hash_aposteriori()); + assert_eq!(state_update, *payload.state_update()); + } } diff --git a/stf/src/sgx.rs b/stf/src/sgx.rs index cae1e28f79..6a9f7f6081 100644 --- a/stf/src/sgx.rs +++ b/stf/src/sgx.rs @@ -40,7 +40,7 @@ pub mod types { pub type StateType = sgx_externalities::SgxExternalitiesType; pub type State = sgx_externalities::SgxExternalities; pub type StateTypeDiff = sgx_externalities::SgxExternalitiesDiffType; - pub struct Stf {} + pub struct Stf; } use types::*; From 55a31db551518bf2538b4a64cf7609ae0bbcdbb7 Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Tue, 15 Jun 2021 08:34:21 +0200 Subject: [PATCH 26/80] add stf result --- stf/src/lib.rs | 1 + stf/src/sgx.rs | 29 ++++++++++++++++++++++------- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/stf/src/lib.rs b/stf/src/lib.rs index 6d9ab89a59..fc05611ce9 100644 --- a/stf/src/lib.rs +++ b/stf/src/lib.rs @@ -20,6 +20,7 @@ #![feature(rustc_attrs)] #![feature(core_intrinsics)] #![feature(derive_eq)] +#![feature(trait_alias)] #![cfg_attr(all(not(target_env = "sgx"), not(feature = "std")), no_std)] #![cfg_attr(target_env = "sgx", feature(rustc_private))] diff --git a/stf/src/sgx.rs b/stf/src/sgx.rs index 6a9f7f6081..30b456899a 100644 --- a/stf/src/sgx.rs +++ b/stf/src/sgx.rs @@ -18,7 +18,7 @@ use support::metadata::StorageHasher; use support::traits::UnfilteredDispatchable; use crate::{ - AccountId, Getter, Index, PublicGetter, ShardIdentifier, State, Stf, TrustedCall, + AccountId, Getter, Index, PublicGetter, ShardIdentifier, TrustedCall, StatePayload, TrustedCallSigned, TrustedGetter, SUBSRATEE_REGISTRY_MODULE, UNSHIELD, }; @@ -32,6 +32,12 @@ impl Encode for OpaqueCall { } } +pub trait StfTrait = SgxExternalitiesTrait + StateHash; + +pub trait StateHash { + fn hash() -> Hash; +} + pub mod types { pub use sgx_runtime::{Balance, Index}; pub type AccountData = balances::AccountData; @@ -218,7 +224,7 @@ impl Stf { ext: &mut State, call: TrustedCallSigned, calls: &mut Vec, - ) -> Result<(), StfError> { + ) -> StfResult<()> { let call_hash = blake2_256(&call.encode()); ext.execute_with(|| { let sender = call.call.account().clone(); @@ -364,7 +370,7 @@ impl Stf { }) } - fn ensure_root(account: AccountId) -> Result<(), StfError> { + fn ensure_root(account: AccountId) -> StfResult<()> { if sp_io::storage::get(&storage_value_key("Sudo", "Key")).unwrap() == account.encode() { Ok(()) } else { @@ -372,7 +378,7 @@ impl Stf { } } - fn shield_funds(account: AccountId, amount: u128) -> Result<(), StfError> { + fn shield_funds(account: AccountId, amount: u128) -> StfResult<()> { match get_account_info(&account) { Some(account_info) => sgx_runtime::BalancesCall::::set_balance( MultiAddress::Id(account), @@ -392,7 +398,7 @@ impl Stf { Ok(()) } - fn unshield_funds(account: AccountId, amount: u128) -> Result<(), StfError> { + fn unshield_funds(account: AccountId, amount: u128) -> StfResult<()> { match get_account_info(&account) { Some(account_info) => { if account_info.data.free < amount { @@ -423,6 +429,12 @@ impl Stf { key_hashes } + pub fn apply_state_dif(ext: &mut StfTrait, getter: StatePayload) -> StfResult<()> { + ext.e + + Ok(()) + } + pub fn get_storage_hashes_to_update_for_getter(getter: &Getter) -> Vec> { debug!( "No specific storage updates needed for getter. Returning those for on block: {:?}", @@ -477,7 +489,7 @@ fn get_account_info(who: &AccountId) -> Option { } } -fn validate_nonce(who: &AccountId, nonce: Index) -> Result<(), StfError> { +fn validate_nonce(who: &AccountId, nonce: Index) -> StfResult<()> { // validate let expected_nonce = get_account_info(who).map_or_else(|| 0, |acc| acc.nonce); if expected_nonce == nonce { @@ -559,11 +571,13 @@ fn key_hash(key: &K, hasher: &StorageHasher) -> Vec { } } +pub type StfResult = Result; + #[derive(Debug, Display)] pub enum StfError { #[display(fmt = "Insufficient privileges {:?}, are you sure you are root?", _0)] MissingPrivileges(AccountId), - #[display(fmt = "Error dispatching runtime call")] + #[display(fmt = "Error dispatching runtime call. {:?}", _0)] Dispatch(String), #[display(fmt = "Not enough funds to perform operation")] MissingFunds, @@ -571,4 +585,5 @@ pub enum StfError { InexistentAccount(AccountId), #[display(fmt = "Invalid Nonce {:?}", _0)] InvalidNonce(Index), + StorageHashMismatch, } From c7058b1ee7fcea69d9e0ca40a6237cf3eb31950a Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Tue, 15 Jun 2021 09:57:46 +0200 Subject: [PATCH 27/80] [Stf] add apply_state_diff --- stf/src/sgx.rs | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/stf/src/sgx.rs b/stf/src/sgx.rs index 30b456899a..31e2ff2bbc 100644 --- a/stf/src/sgx.rs +++ b/stf/src/sgx.rs @@ -8,14 +8,16 @@ use derive_more::Display; use log_sgx::*; use sgx_runtime::{Balance, BlockNumber as L1BlockNumer, Runtime}; use sp_core::crypto::AccountId32; -use sp_core::Pair; -use sp_core::H256 as Hash; -use sp_io::hashing::blake2_256; -use sp_io::SgxExternalitiesTrait; +use sp_core::{Pair, H256 as Hash}; +use sp_io::{hashing::blake2_256, SgxExternalitiesTrait}; +use sgx_externalities::SgxExternalitiesTypeTrait; use sp_runtime::MultiAddress; use substratee_worker_primitives::BlockNumber; -use support::metadata::StorageHasher; -use support::traits::UnfilteredDispatchable; +use support::{ + ensure, + metadata::StorageHasher, + traits::UnfilteredDispatchable +}; use crate::{ AccountId, Getter, Index, PublicGetter, ShardIdentifier, TrustedCall, StatePayload, @@ -35,7 +37,7 @@ impl Encode for OpaqueCall { pub trait StfTrait = SgxExternalitiesTrait + StateHash; pub trait StateHash { - fn hash() -> Hash; + fn hash(&self) -> Hash; } pub mod types { @@ -137,7 +139,7 @@ impl Stf { ext } - pub fn update_storage(ext: &mut State, map_update: &HashMap, Option>>) { + pub fn update_storage(ext: &mut impl SgxExternalitiesTrait, map_update: &HashMap, Option>>) { ext.execute_with(|| { map_update.iter().for_each(|(k, v)| { match v { @@ -429,9 +431,9 @@ impl Stf { key_hashes } - pub fn apply_state_dif(ext: &mut StfTrait, getter: StatePayload) -> StfResult<()> { - ext.e - + pub fn apply_state_diff(ext: &mut impl StfTrait, state_payload: &mut StatePayload) -> StfResult<()> { + ensure!(ext.hash() == state_payload.state_hash_apriori(), StfError::StorageHashMismatch); + Self::update_storage(ext, &StateTypeDiff::decode(state_payload.state_update.clone())); Ok(()) } From 79d0d18c51178644924d91ffea3d93afc191ff1a Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Tue, 15 Jun 2021 11:08:37 +0200 Subject: [PATCH 28/80] [primitives/worker] fix conditional compilation for sgx. No need of sgx flag anymore. It is defined by the target_arch --- primitives/worker/Cargo.toml | 12 +++--------- primitives/worker/src/block.rs | 8 ++++---- primitives/worker/src/lib.rs | 2 +- 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/primitives/worker/Cargo.toml b/primitives/worker/Cargo.toml index 5ef04f47f4..dbb7878296 100644 --- a/primitives/worker/Cargo.toml +++ b/primitives/worker/Cargo.toml @@ -4,6 +4,9 @@ version = "0.8.0" authors = ["bhaerdi "] edition = "2018" +[target.'cfg(target_env = "sgx")'.dependencies] +sgx_tstd = { rev = "v1.1.3", git = "https://github.com/apache/teaclave-sgx-sdk.git", features = ["untrusted_fs","net","backtrace"] } + [dependencies] codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] } primitive-types = { version = "0.9", default-features = false, features = ["codec"] } @@ -12,12 +15,6 @@ serde_derive = { version = "1.0", optional = true} serde_json = { version = "1.0", optional = true} chrono = { version = "0.4.19", default-features = false, features = ["alloc"]} -[dependencies.sgx_tstd] -git = "https://github.com/apache/teaclave-sgx-sdk.git" -features = ["untrusted_fs","net","backtrace"] -rev = "v1.1.3" -optional = true - [dependencies.sp-runtime] git = "https://github.com/paritytech/substrate.git" branch = "master" @@ -43,9 +40,6 @@ std = [ 'codec/std', 'sp-core/std', 'primitive-types/std' ] -sgx = [ 'sgx_tstd',] - - [dev-dependencies.sp-keyring] git = "https://github.com/paritytech/substrate.git" diff --git a/primitives/worker/src/block.rs b/primitives/worker/src/block.rs index f07d95fad6..5b244eeab6 100644 --- a/primitives/worker/src/block.rs +++ b/primitives/worker/src/block.rs @@ -1,9 +1,10 @@ +#[cfg(target_env = "sgx")] +extern crate sgx_tstd as std; + use crate::{BlockNumber, ShardIdentifier}; use codec::{Decode, Encode}; #[cfg(feature = "std")] use serde::{Deserialize, Serialize}; -#[cfg(feature = "sgx")] -use sgx_tstd as std; use std::vec::Vec; //FIXME: Should use blocknumber from sgxruntime @@ -17,8 +18,7 @@ use sp_runtime::{traits::Verify, MultiSignature}; pub type Signature = MultiSignature; use std::time::{SystemTime, UNIX_EPOCH}; -#[cfg(feature = "sgx")] -use std::untrusted::time::SystemTimeEx; + /* use chrono::Utc as TzUtc; use chrono::TimeZone; */ diff --git a/primitives/worker/src/lib.rs b/primitives/worker/src/lib.rs index 09d057eefa..4b722c0fa2 100644 --- a/primitives/worker/src/lib.rs +++ b/primitives/worker/src/lib.rs @@ -1,4 +1,4 @@ -#![cfg_attr(all(not(target_env = "sgx"), not(feature = "std")), no_std)] +#![cfg_attr(target_env = "sgx", no_std)] #![cfg_attr(target_env = "sgx", feature(rustc_private))] pub mod block; From 8436c8fa6e4a3be31b18afa88d39916c4877761a Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Wed, 16 Jun 2021 09:31:03 +0200 Subject: [PATCH 29/80] Revert "[primitives/worker] fix conditional compilation for sgx. No need of sgx flag anymore. It is defined by the target_arch". Sgx conditional compilation seems to be more involed than i thought. This needs proper thinking changing this. This reverts commit 8d0400c4 --- primitives/worker/Cargo.toml | 12 +++++++++--- primitives/worker/src/block.rs | 8 ++++---- primitives/worker/src/lib.rs | 2 +- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/primitives/worker/Cargo.toml b/primitives/worker/Cargo.toml index dbb7878296..5ef04f47f4 100644 --- a/primitives/worker/Cargo.toml +++ b/primitives/worker/Cargo.toml @@ -4,9 +4,6 @@ version = "0.8.0" authors = ["bhaerdi "] edition = "2018" -[target.'cfg(target_env = "sgx")'.dependencies] -sgx_tstd = { rev = "v1.1.3", git = "https://github.com/apache/teaclave-sgx-sdk.git", features = ["untrusted_fs","net","backtrace"] } - [dependencies] codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] } primitive-types = { version = "0.9", default-features = false, features = ["codec"] } @@ -15,6 +12,12 @@ serde_derive = { version = "1.0", optional = true} serde_json = { version = "1.0", optional = true} chrono = { version = "0.4.19", default-features = false, features = ["alloc"]} +[dependencies.sgx_tstd] +git = "https://github.com/apache/teaclave-sgx-sdk.git" +features = ["untrusted_fs","net","backtrace"] +rev = "v1.1.3" +optional = true + [dependencies.sp-runtime] git = "https://github.com/paritytech/substrate.git" branch = "master" @@ -40,6 +43,9 @@ std = [ 'codec/std', 'sp-core/std', 'primitive-types/std' ] +sgx = [ 'sgx_tstd',] + + [dev-dependencies.sp-keyring] git = "https://github.com/paritytech/substrate.git" diff --git a/primitives/worker/src/block.rs b/primitives/worker/src/block.rs index 5b244eeab6..f07d95fad6 100644 --- a/primitives/worker/src/block.rs +++ b/primitives/worker/src/block.rs @@ -1,10 +1,9 @@ -#[cfg(target_env = "sgx")] -extern crate sgx_tstd as std; - use crate::{BlockNumber, ShardIdentifier}; use codec::{Decode, Encode}; #[cfg(feature = "std")] use serde::{Deserialize, Serialize}; +#[cfg(feature = "sgx")] +use sgx_tstd as std; use std::vec::Vec; //FIXME: Should use blocknumber from sgxruntime @@ -18,7 +17,8 @@ use sp_runtime::{traits::Verify, MultiSignature}; pub type Signature = MultiSignature; use std::time::{SystemTime, UNIX_EPOCH}; - +#[cfg(feature = "sgx")] +use std::untrusted::time::SystemTimeEx; /* use chrono::Utc as TzUtc; use chrono::TimeZone; */ diff --git a/primitives/worker/src/lib.rs b/primitives/worker/src/lib.rs index 4b722c0fa2..09d057eefa 100644 --- a/primitives/worker/src/lib.rs +++ b/primitives/worker/src/lib.rs @@ -1,4 +1,4 @@ -#![cfg_attr(target_env = "sgx", no_std)] +#![cfg_attr(all(not(target_env = "sgx"), not(feature = "std")), no_std)] #![cfg_attr(target_env = "sgx", feature(rustc_private))] pub mod block; From c2f3f03cd6cc6031a483c008b0d816d43707f8a0 Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Wed, 16 Jun 2021 15:49:53 +0200 Subject: [PATCH 30/80] [stf] more rigorous checks in apply_state_diff. --- stf/src/sgx.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/stf/src/sgx.rs b/stf/src/sgx.rs index 31e2ff2bbc..21b27ed6ee 100644 --- a/stf/src/sgx.rs +++ b/stf/src/sgx.rs @@ -34,7 +34,7 @@ impl Encode for OpaqueCall { } } -pub trait StfTrait = SgxExternalitiesTrait + StateHash; +pub trait StfTrait = SgxExternalitiesTrait + StateHash + Clone + Send + Sync; pub trait StateHash { fn hash(&self) -> Hash; @@ -433,7 +433,10 @@ impl Stf { pub fn apply_state_diff(ext: &mut impl StfTrait, state_payload: &mut StatePayload) -> StfResult<()> { ensure!(ext.hash() == state_payload.state_hash_apriori(), StfError::StorageHashMismatch); - Self::update_storage(ext, &StateTypeDiff::decode(state_payload.state_update.clone())); + let mut ext2 = ext.clone(); + Self::update_storage(&mut ext2, &StateTypeDiff::decode(state_payload.state_update.clone())); + ensure!(ext2.hash() == state_payload.state_hash_aposteriori(), StfError::InvalidStorageDiff); + *ext = ext2; Ok(()) } @@ -588,4 +591,5 @@ pub enum StfError { #[display(fmt = "Invalid Nonce {:?}", _0)] InvalidNonce(Index), StorageHashMismatch, + InvalidStorageDiff, } From 6411ca351f94d194fd79d2aa4e3bd8a4b58925df Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Tue, 22 Jun 2021 16:52:23 +0200 Subject: [PATCH 31/80] [worker] move instantiation of the global Worker into the fn worker. --- worker/src/main.rs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/worker/src/main.rs b/worker/src/main.rs index 80b2d9ad72..fce9618714 100644 --- a/worker/src/main.rs +++ b/worker/src/main.rs @@ -105,14 +105,6 @@ fn main() { println!("Worker Config: {:?}", config); *NODE_URL.lock().unwrap() = config.node_url(); - *WORKER.write() = Some( - Worker::new( - config.clone(), - Api::new(config.node_url()).map(|api| api.set_signer(AccountKeyring::Alice.pair())).unwrap(), - Enclave, - DirectClient::new(config.worker_url()), - ) - ); if let Some(smatches) = matches.subcommand_matches("run") { println!("*** Starting substraTEE-worker"); @@ -245,6 +237,15 @@ fn worker( #[cfg(not(feature = "production"))] println!("*** Starting enclave in development mode"); + *WORKER.write() = Some( + Worker::new( + config.clone(), + Api::new(config.node_url()).map(|api| api.set_signer(AccountKeyring::Alice.pair())).unwrap(), + Enclave, + DirectClient::new(config.worker_url()), + ) + ); + let enclave = enclave_init().unwrap(); let mrenclave = enclave_mrenclave(enclave.geteid()).unwrap(); println!("MRENCLAVE={}", mrenclave.to_base58()); From 42b776d2d0875b2d3f447a4ff50e61c523646fa7 Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Tue, 22 Jun 2021 17:33:46 +0200 Subject: [PATCH 32/80] [stf] add some unit tests for stf. --- enclave/src/tests.rs | 3 ++ stf/src/sgx.rs | 69 +++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 71 insertions(+), 1 deletion(-) diff --git a/enclave/src/tests.rs b/enclave/src/tests.rs index 44d52b25f5..06d0de9b26 100644 --- a/enclave/src/tests.rs +++ b/enclave/src/tests.rs @@ -114,6 +114,9 @@ pub extern "C" fn test_main_entrance() -> size_t { test_executing_call_updates_account_nonce, test_invalid_nonce_call_is_not_executed, test_non_root_shielding_call_is_not_executed, + substratee_stf::sgx::tests::apply_state_diff_works, + substratee_stf::sgx::tests::apply_state_diff_returns_storage_hash_mismatch_err, + substratee_stf::sgx::tests::apply_state_diff_returns_invalid_storage_diff_err, // these unit tests (?) need an ipfs node running.. //ipfs::test_creates_ipfs_content_struct_works, //ipfs::test_verification_ok_for_correct_content, diff --git a/stf/src/sgx.rs b/stf/src/sgx.rs index 21b27ed6ee..41cc717b1f 100644 --- a/stf/src/sgx.rs +++ b/stf/src/sgx.rs @@ -437,6 +437,8 @@ impl Stf { Self::update_storage(&mut ext2, &StateTypeDiff::decode(state_payload.state_update.clone())); ensure!(ext2.hash() == state_payload.state_hash_aposteriori(), StfError::InvalidStorageDiff); *ext = ext2; + // If the apriori state hash matches, we should not prune any state_diffs we want to gossip. + ext.prune_state_diff(); Ok(()) } @@ -578,7 +580,7 @@ fn key_hash(key: &K, hasher: &StorageHasher) -> Vec { pub type StfResult = Result; -#[derive(Debug, Display)] +#[derive(Debug, Display, PartialEq, Eq)] pub enum StfError { #[display(fmt = "Insufficient privileges {:?}, are you sure you are root?", _0)] MissingPrivileges(AccountId), @@ -593,3 +595,68 @@ pub enum StfError { StorageHashMismatch, InvalidStorageDiff, } + +// this must be pub to be able to test it in the enclave. In the future this should be testable +// with cargo test. See: https://github.com/scs/substraTEE-worker/issues/272. +pub mod tests { + use super::{Stf, StfTrait, StateHash, State, StatePayload}; + use support::{assert_ok, assert_err}; + use sp_core::H256; + use sp_runtime::traits::{BlakeTwo256, Hash}; + use sgx_externalities::{SgxExternalitiesTypeTrait}; + use crate::sgx::StfError; + + impl StateHash for State { + fn hash(&self) -> H256 { + BlakeTwo256::hash(self.state.clone().encode().as_slice()) + } + } + + pub fn apply_state_diff_works() { + let mut state1 = State::new(); + let mut state2 = State::new(); + + let apriori = state1.hash(); + state1.insert(b"Hello".to_vec(), b"World".to_vec()); + let aposteriori = state1.hash(); + + let mut state_update = StatePayload::new(apriori, aposteriori, state1.state_diff.clone().encode()); + + assert_ok!(Stf::apply_state_diff(&mut state2, &mut state_update)); + assert_eq!(state2.hash(), aposteriori); + assert_eq!(*state2.get(b"Hello").unwrap(), b"World".to_vec()); + assert!(state2.state_diff.is_empty()); + } + + pub fn apply_state_diff_returns_storage_hash_mismatch_err() { + let mut state1 = State::new(); + let mut state2 = State::new(); + + let apriori = H256::from([1; 32]); + state1.insert(b"Hello".to_vec(), b"World".to_vec()); + let aposteriori = state1.hash(); + + let mut state_update = StatePayload::new(apriori, aposteriori, state1.state_diff.clone().encode()); + + assert_err!(Stf::apply_state_diff(&mut state2, &mut state_update), StfError::StorageHashMismatch); + // todo: Derive `Eq` on State + assert_eq!(state2.hash(), State::new().hash()); + assert!(state2.state_diff.is_empty()); + } + + pub fn apply_state_diff_returns_invalid_storage_diff_err() { + let mut state1 = State::new(); + let mut state2 = State::new(); + + let apriori = state1.hash(); + state1.insert(b"Hello".to_vec(), b"World".to_vec()); + let aposteriori = H256::from([1; 32]); + + let mut state_update = StatePayload::new(apriori, aposteriori, state1.state_diff.clone().encode()); + + assert_err!(Stf::apply_state_diff(&mut state2, &mut state_update), StfError::InvalidStorageDiff); + // todo: Derive `Eq` on State + assert_eq!(state2.hash(), State::new().hash()); + assert!(state2.state_diff.is_empty()); + } +} From 5bd35e759da356effb49d739a8d6f69e520e1846 Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Wed, 23 Jun 2021 08:50:39 +0200 Subject: [PATCH 33/80] [worker] add PoC of `EnclaveApi` trait with call_rpc_methods ffi wrapper. --- Cargo.lock | 14 ++++++--- primitives/enclave-api/Cargo.toml | 6 ++++ primitives/enclave-api/src/error.rs | 11 +++++++ primitives/enclave-api/src/ffi.rs | 12 ++++++++ primitives/enclave-api/src/lib.rs | 48 +++++++++++++++++++++++++++-- worker/rpc/server/src/lib.rs | 30 ++++++------------ worker/src/main.rs | 23 ++++++++++---- 7 files changed, 110 insertions(+), 34 deletions(-) create mode 100644 primitives/enclave-api/src/error.rs create mode 100644 primitives/enclave-api/src/ffi.rs diff --git a/Cargo.lock b/Cargo.lock index 573b790ae7..475d188d1d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5384,6 +5384,12 @@ dependencies = [ [[package]] name = "substratee-enclave-api" version = "0.8.0" +dependencies = [ + "frame-support", + "parity-scale-codec 2.0.1", + "sgx_types", + "thiserror", +] [[package]] name = "substratee-node-primitives" @@ -5663,18 +5669,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.24" +version = "1.0.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0f4a65597094d4483ddaed134f409b2cb7c1beccf25201a9f73c719254fa98e" +checksum = "fa6f76457f59514c7eeb4e59d891395fab0b2fd1d40723ae737d64153392e9c6" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.24" +version = "1.0.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7765189610d8241a44529806d6fd1f2e0a08734313a35d5b3a556f92b381f3c0" +checksum = "8a36768c0fbf1bb15eca10defa29526bda730a2376c2ab4393ccfa16fb1a318d" dependencies = [ "proc-macro2", "quote 1.0.9", diff --git a/primitives/enclave-api/Cargo.toml b/primitives/enclave-api/Cargo.toml index e5510cc81c..ec5cb6b1bd 100644 --- a/primitives/enclave-api/Cargo.toml +++ b/primitives/enclave-api/Cargo.toml @@ -5,3 +5,9 @@ authors = ["clangenbacher "] edition = "2018" [dependencies] +thiserror = "1.0.25" +codec = { package = "parity-scale-codec", version = "2.0.0", features = ["derive"] } + +sgx_types = { rev = "v1.1.3", git = "https://github.com/apache/teaclave-sgx-sdk.git" } + +frame-support = { git = "https://github.com/paritytech/substrate.git", version = "3.0.0" } \ No newline at end of file diff --git a/primitives/enclave-api/src/error.rs b/primitives/enclave-api/src/error.rs new file mode 100644 index 0000000000..085cbf1ed5 --- /dev/null +++ b/primitives/enclave-api/src/error.rs @@ -0,0 +1,11 @@ +use codec::{Error as CodecError}; +use sgx_types::sgx_status_t; + +#[derive(Debug, thiserror::Error)] +pub enum Error { + #[error("{0}")] + Codec(#[from] CodecError), + #[error("Enclave Error: {0}")] + Sgx(sgx_status_t) +} + diff --git a/primitives/enclave-api/src/ffi.rs b/primitives/enclave-api/src/ffi.rs new file mode 100644 index 0000000000..af3f4123d4 --- /dev/null +++ b/primitives/enclave-api/src/ffi.rs @@ -0,0 +1,12 @@ +use sgx_types::{sgx_enclave_id_t, sgx_status_t}; + +extern "C" { + pub fn call_rpc_methods( + eid: sgx_enclave_id_t, + retval: *mut sgx_status_t, + request: *const u8, + request_len: u32, + response: *mut u8, + response_len: u32, + ) -> sgx_status_t; +} \ No newline at end of file diff --git a/primitives/enclave-api/src/lib.rs b/primitives/enclave-api/src/lib.rs index 40fcd2d757..947c2f0c15 100644 --- a/primitives/enclave-api/src/lib.rs +++ b/primitives/enclave-api/src/lib.rs @@ -1,9 +1,51 @@ //! some definitions and traits that facilitate interaction with the enclave. -pub struct Enclave; +use sgx_types::{sgx_enclave_id_t, sgx_status_t}; +use frame_support::ensure; -impl EnclaveApi for Enclave { +use crate::error::Error; + +pub mod ffi; +pub mod error; + +pub struct Enclave { + eid: sgx_enclave_id_t +} +impl Enclave { + pub fn new(eid: sgx_enclave_id_t) -> Self { + Enclave { eid } + } } -pub trait EnclaveApi {} \ No newline at end of file +pub type EnclaveResult = Result; + +pub trait EnclaveApi: Send + Sync + 'static { + // Todo: Vec shall be replaced by D: Decode, E: Encode but this is currently + // not compatible with the direct_api_server... + fn rpc(&self, request: Vec) -> EnclaveResult>; +} + +impl EnclaveApi for Enclave { + fn rpc(&self, request: Vec) -> EnclaveResult> { + let mut retval = sgx_status_t::SGX_SUCCESS; + let response_len = 8192; + let mut response: Vec = vec![0u8; response_len as usize]; + + let res = unsafe { + ffi::call_rpc_methods( + self.eid, + &mut retval, + request.as_ptr(), + request.len() as u32, + response.as_mut_ptr(), + response_len + ) + }; + + ensure!(res == sgx_status_t::SGX_SUCCESS, Error::Sgx(res)); + ensure!(retval == sgx_status_t::SGX_SUCCESS, Error::Sgx(retval)); + + Ok(response) + } +} \ No newline at end of file diff --git a/worker/rpc/server/src/lib.rs b/worker/rpc/server/src/lib.rs index 62e73e0798..3b217682a9 100644 --- a/worker/rpc/server/src/lib.rs +++ b/worker/rpc/server/src/lib.rs @@ -19,38 +19,26 @@ use std::net::{SocketAddr}; use log::debug; -use jsonrpsee:: ws_server::{RpcModule, WsServerBuilder}; +use jsonrpsee::{ws_server::{RpcModule, WsServerBuilder}, types::error::CallError}; use tokio::net::ToSocketAddrs; use substratee_enclave_api::EnclaveApi; -use std::marker::PhantomData; #[cfg(test)] mod tests; -pub struct RpcServer{ - _enclave: PhantomData -} +pub async fn run_server(addr: impl ToSocketAddrs, enclave: Enclave) -> anyhow::Result +where + Enclave: EnclaveApi -impl ServerApi for RpcServer { - -} - -pub trait ServerApi {} - - -pub async fn run_server(addr: impl ToSocketAddrs) -> anyhow::Result { +{ let mut server = WsServerBuilder::default().build(addr).await?; - let mut module = RpcModule::new(()); - module.register_method("author_importBlock", |params, _| { - debug!("author_importBlock params: {:?}", params); - Ok("Hello") - })?; + let mut module = RpcModule::new(enclave); - module.register_method("enclave_directRequest", |params, _| { - debug!("enclave_directRequest params: {:?}", params); - Ok("Hello") + module.register_method("sidechain_importBlock", |params, enclave| { + debug!("sidechain_importBlock params: {:?}", params); + enclave.rpc(params.parse()?).map_err(|e| CallError::Failed(e.into())) })?; server.register_module(module).unwrap(); diff --git a/worker/src/main.rs b/worker/src/main.rs index fce9618714..c9ff068c3e 100644 --- a/worker/src/main.rs +++ b/worker/src/main.rs @@ -220,7 +220,8 @@ fn main() { } } -fn worker( +#[tokio::main] +async fn worker( config: Config, shard: &ShardIdentifier, skip_ra: bool, @@ -237,19 +238,20 @@ fn worker( #[cfg(not(feature = "production"))] println!("*** Starting enclave in development mode"); + let enclave = enclave_init().unwrap(); + let mrenclave = enclave_mrenclave(enclave.geteid()).unwrap(); + println!("MRENCLAVE={}", mrenclave.to_base58()); + let eid = enclave.geteid(); + *WORKER.write() = Some( Worker::new( config.clone(), Api::new(config.node_url()).map(|api| api.set_signer(AccountKeyring::Alice.pair())).unwrap(), - Enclave, + Enclave::new(eid), DirectClient::new(config.worker_url()), ) ); - let enclave = enclave_init().unwrap(); - let mrenclave = enclave_mrenclave(enclave.geteid()).unwrap(); - println!("MRENCLAVE={}", mrenclave.to_base58()); - let eid = enclave.geteid(); // ------------------------------------------------------------------------ // let new workers call us for key provisioning println!("MU-RA server listening on ws://{}", config.mu_ra_url()); @@ -267,6 +269,15 @@ fn worker( println!("rpc worker server listening on ws://{}", config.worker_url()); start_worker_api_direct_server( config.worker_url(), eid); + // listen for sidechain_block import request. Later the `start_worker_api_direct_server` + // should be merged into this one. + let enclave = Enclave::new(eid); + let port: i32 = config.worker_rpc_port.parse().unwrap(); + substratee_worker_rpc_server::run_server( + format!("{}:{}", config.worker_ip, (port + 1)), + enclave, + ).await.unwrap(); + // ------------------------------------------------------------------------ // start the substrate-api-client to communicate with the node let mut api = Api::new(NODE_URL.lock().unwrap().clone()) From 383acfa1a6399b9460be3c68101449e1d864213e Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Wed, 23 Jun 2021 09:16:30 +0200 Subject: [PATCH 34/80] [worker/rpc/server] remove PoC test and add sidechain_importBlock test, which currently fails due to invalid RPC params --- Cargo.lock | 3 -- worker/rpc/server/Cargo.toml | 7 +--- worker/rpc/server/src/tests.rs | 71 ++++++++++++++-------------------- 3 files changed, 30 insertions(+), 51 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 475d188d1d..3f9bd3f697 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5556,14 +5556,11 @@ version = "0.8.0" dependencies = [ "anyhow", "env_logger 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-util", "jsonrpsee", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json", - "soketto", "substratee-enclave-api", "tokio 1.6.1", - "tokio-util 0.6.5", ] [[package]] diff --git a/worker/rpc/server/Cargo.toml b/worker/rpc/server/Cargo.toml index 8fe4b98caa..fd6e6139d3 100644 --- a/worker/rpc/server/Cargo.toml +++ b/worker/rpc/server/Cargo.toml @@ -8,7 +8,7 @@ resolver = "2" [dependencies] anyhow = "1.0.40" log = "0.4.14" -jsonrpsee = { version = "0.2.0-alpha.7", features = ["server"] } +jsonrpsee = { version = "0.2.0-alpha.7", features = ["full"] } serde_json = "1.0.64" tokio = { version = "1.6.1", features = ["full"] } @@ -19,7 +19,4 @@ default = ["std"] std = [] [dev-dependencies] -env_logger = { version = "*" } -soketto = "0.5.0" -futures-util = { version = "*" } -tokio-util = { version = "0.6", features = ["compat"] } \ No newline at end of file +env_logger = { version = "*" } \ No newline at end of file diff --git a/worker/rpc/server/src/tests.rs b/worker/rpc/server/src/tests.rs index 8ea6b0300a..24aca888e2 100644 --- a/worker/rpc/server/src/tests.rs +++ b/worker/rpc/server/src/tests.rs @@ -1,58 +1,43 @@ use log::info; use super::*; -use soketto::handshake; +use jsonrpsee::{ + types::{to_json_value, traits::Client}, ws_client::WsClientBuilder, + }; use serde_json::Value as JsonValue; -use tokio_util::compat::{Compat, TokioAsyncReadCompatExt}; -use futures_util::io::{BufReader, BufWriter}; -use tokio::net::TcpStream; +use substratee_enclave_api::EnclaveResult; fn init() { - let _ = env_logger::builder().is_test(true).try_init(); + let _ = env_logger::builder().is_test(true).try_init(); } -struct WsTestClient { - tx: soketto::Sender>>>, - rx: soketto::Receiver>>>, +pub fn ok_response(result: JsonValue, id: u32) -> String { + format!(r#"{{"jsonrpc":"2.0","result":{},"id":{}}}"#, result, id) } -type Error = Box; - -impl WsTestClient { - pub async fn new(url: SocketAddr) -> Result { - let socket = TcpStream::connect(url).await?; - let mut client = handshake::Client::new(BufReader::new(BufWriter::new(socket.compat())), "test-client", "/"); - match client.handshake().await { - Ok(handshake::ServerResponse::Accepted { .. }) => { - let (tx, rx) = client.into_builder().finish(); - Ok(Self { tx, rx }) - } - r => Err(format!("WebSocketHandshake failed: {:?}", r).into()), - } - } - - pub async fn send_request_text(&mut self, msg: impl AsRef) -> Result { - self.tx.send_text(msg).await?; - self.tx.flush().await?; - let mut data = Vec::new(); - self.rx.receive_data(&mut data).await?; - String::from_utf8(data).map_err(Into::into) - } -} +struct TestEnclave; -pub fn ok_response(result: JsonValue, id: u32) -> String { - format!(r#"{{"jsonrpc":"2.0","result":{},"id":{}}}"#, result, id) +impl EnclaveApi for TestEnclave { + fn rpc(&self, request: Vec) -> EnclaveResult> { + Ok(request) + } } #[tokio::test] async fn test_client_calls() { - init(); - let addr = run_server("127.0.0.1:0").await.unwrap(); - info!("ServerAddress: {:?}", addr); - - let mut client = WsTestClient::new(addr).await.unwrap(); - - let req = format!(r#"{{"jsonrpc":"2.0","method":"author_importBlock","id":{}}}"#, 1); - let res = client.send_request_text(req).await.unwrap(); - assert_eq!(res, ok_response(JsonValue::String("Hello".into()), 1)); -} \ No newline at end of file + init(); + let addr = run_server("127.0.0.1:0", TestEnclave).await.unwrap(); + info!("ServerAddress: {:?}", addr); + + let url = format!("ws://{}", addr); + let client = WsClientBuilder::default().build(&url).await.unwrap(); + let response: String = client + .request( + "sidechain_importBlock", + vec![to_json_value(vec![1, 1, 2]).unwrap()].into(), + ) + .await + .unwrap(); + + assert_eq!(response, ok_response(to_json_value([1, 1, 2]).unwrap(), 1)); +} From cccb6ca4c7083b60355f6a50d7f44373e5201a8f Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Wed, 23 Jun 2021 09:35:23 +0200 Subject: [PATCH 35/80] [worker/rpc/server] fix unit test. --- worker/rpc/server/src/lib.rs | 41 +++++++++++++++++++++------------- worker/rpc/server/src/tests.rs | 14 +++++------- 2 files changed, 30 insertions(+), 25 deletions(-) diff --git a/worker/rpc/server/src/lib.rs b/worker/rpc/server/src/lib.rs index 3b217682a9..03d4613859 100644 --- a/worker/rpc/server/src/lib.rs +++ b/worker/rpc/server/src/lib.rs @@ -15,11 +15,14 @@ */ -use std::net::{SocketAddr}; +use std::net::SocketAddr; use log::debug; -use jsonrpsee::{ws_server::{RpcModule, WsServerBuilder}, types::error::CallError}; +use jsonrpsee::{ + types::error::CallError, + ws_server::{RpcModule, WsServerBuilder}, +}; use tokio::net::ToSocketAddrs; use substratee_enclave_api::EnclaveApi; @@ -27,23 +30,29 @@ use substratee_enclave_api::EnclaveApi; #[cfg(test)] mod tests; -pub async fn run_server(addr: impl ToSocketAddrs, enclave: Enclave) -> anyhow::Result +pub async fn run_server( + addr: impl ToSocketAddrs, + enclave: Enclave, +) -> anyhow::Result where - Enclave: EnclaveApi - + Enclave: EnclaveApi, { - let mut server = WsServerBuilder::default().build(addr).await?; + let mut server = WsServerBuilder::default().build(addr).await?; + + let mut module = RpcModule::new(enclave); + + module.register_method("sidechain_importBlock", |params, enclave| { + debug!("sidechain_importBlock params: {:?}", params); - let mut module = RpcModule::new(enclave); + enclave + .rpc(params.one()?) + .map_err(|e| CallError::Failed(e.into())) - module.register_method("sidechain_importBlock", |params, enclave| { - debug!("sidechain_importBlock params: {:?}", params); - enclave.rpc(params.parse()?).map_err(|e| CallError::Failed(e.into())) - })?; + })?; - server.register_module(module).unwrap(); + server.register_module(module).unwrap(); - let socket_addr = server.local_addr()?; - tokio::spawn(async move { server.start().await }); - Ok(socket_addr) -} \ No newline at end of file + let socket_addr = server.local_addr()?; + tokio::spawn(async move { server.start().await }); + Ok(socket_addr) +} diff --git a/worker/rpc/server/src/tests.rs b/worker/rpc/server/src/tests.rs index 24aca888e2..bec4eaa455 100644 --- a/worker/rpc/server/src/tests.rs +++ b/worker/rpc/server/src/tests.rs @@ -2,19 +2,15 @@ use log::info; use super::*; use jsonrpsee::{ - types::{to_json_value, traits::Client}, ws_client::WsClientBuilder, - }; -use serde_json::Value as JsonValue; + types::{to_json_value, traits::Client}, + ws_client::WsClientBuilder, +}; use substratee_enclave_api::EnclaveResult; fn init() { let _ = env_logger::builder().is_test(true).try_init(); } -pub fn ok_response(result: JsonValue, id: u32) -> String { - format!(r#"{{"jsonrpc":"2.0","result":{},"id":{}}}"#, result, id) -} - struct TestEnclave; impl EnclaveApi for TestEnclave { @@ -31,7 +27,7 @@ async fn test_client_calls() { let url = format!("ws://{}", addr); let client = WsClientBuilder::default().build(&url).await.unwrap(); - let response: String = client + let response: Vec = client .request( "sidechain_importBlock", vec![to_json_value(vec![1, 1, 2]).unwrap()].into(), @@ -39,5 +35,5 @@ async fn test_client_calls() { .await .unwrap(); - assert_eq!(response, ok_response(to_json_value([1, 1, 2]).unwrap(), 1)); + assert_eq!(response, vec![1, 1, 2]); } From ec3d2b73b27ae07cbcf3e985831f5e306a2dade4 Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Wed, 23 Jun 2021 11:32:25 +0200 Subject: [PATCH 36/80] [worker/rpc] use in sidechain_blockImport rpc the RpcRequest struct of the substratee-worker-primitives. --- Cargo.lock | 141 ++++++++++++++++++--------------- primitives/worker/src/lib.rs | 2 + worker/rpc/server/Cargo.toml | 5 +- worker/rpc/server/src/lib.rs | 16 +++- worker/rpc/server/src/mock.rs | 43 ++++++++++ worker/rpc/server/src/tests.rs | 17 ++-- worker/src/tests/commons.rs | 4 +- worker/src/worker.rs | 16 ++-- 8 files changed, 153 insertions(+), 91 deletions(-) create mode 100644 worker/rpc/server/src/mock.rs diff --git a/Cargo.lock b/Cargo.lock index 3f9bd3f697..bbd899be85 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -105,6 +105,12 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" +[[package]] +name = "arrayvec" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4dc07131ffa69b8072d35f5007352af944213cde02545e2103680baed38fcd" + [[package]] name = "asn1_der" version = "0.6.3" @@ -1026,7 +1032,7 @@ dependencies = [ "futures-timer", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.3", "parking_lot 0.11.1", ] @@ -1099,7 +1105,7 @@ dependencies = [ "frame-support", "frame-system", "linregress", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.3", "paste 1.0.5", "sp-api", "sp-io 3.0.0", @@ -1116,7 +1122,7 @@ source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615ad dependencies = [ "frame-support", "frame-system", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.3", "serde", "sp-core", "sp-io 3.0.0", @@ -1130,7 +1136,7 @@ name = "frame-metadata" version = "13.0.0" source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" dependencies = [ - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.3", "serde", "sp-core", "sp-std", @@ -1147,7 +1153,7 @@ dependencies = [ "impl-trait-for-tuples", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", "once_cell 1.7.2", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.3", "paste 1.0.5", "serde", "smallvec 1.6.1", @@ -1203,7 +1209,7 @@ source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615ad dependencies = [ "frame-support", "impl-trait-for-tuples", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.3", "serde", "sp-core", "sp-io 3.0.0", @@ -1217,7 +1223,7 @@ name = "frame-system-rpc-runtime-api" version = "3.0.0" source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" dependencies = [ - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.3", "sp-api", ] @@ -1779,7 +1785,7 @@ dependencies = [ "base64 0.11.0", "chrono", "frame-support", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.3", "serde_json", "sp-core", "sp-io 3.0.0", @@ -1824,7 +1830,7 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df170efa359aebdd5cb7fe78edcc67107748e4737bdca8a8fb40d15ea7a877ed" dependencies = [ - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.3", ] [[package]] @@ -2844,7 +2850,7 @@ dependencies = [ "frame-system", "pallet-session", "pallet-timestamp", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.3", "serde", "sp-application-crypto", "sp-consensus-aura", @@ -2861,7 +2867,7 @@ dependencies = [ "frame-support", "frame-system", "impl-trait-for-tuples", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.3", "sp-authorship", "sp-inherents", "sp-runtime", @@ -2876,7 +2882,7 @@ dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.3", "serde", "sp-runtime", "sp-std", @@ -2892,7 +2898,7 @@ dependencies = [ "frame-system", "pallet-authorship", "pallet-session", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.3", "serde", "sp-application-crypto", "sp-core", @@ -2910,7 +2916,7 @@ source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615ad dependencies = [ "frame-support", "frame-system", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.3", "safe-mix", "sp-runtime", "sp-std", @@ -2925,7 +2931,7 @@ dependencies = [ "frame-system", "impl-trait-for-tuples", "pallet-timestamp", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.3", "serde", "sp-core", "sp-io 3.0.0", @@ -2946,7 +2952,7 @@ dependencies = [ "ias-verify", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", "pallet-timestamp", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.3", "serde", "sp-core", "sp-io 3.0.0", @@ -2961,7 +2967,7 @@ source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615ad dependencies = [ "frame-support", "frame-system", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.3", "serde", "sp-io 3.0.0", "sp-runtime", @@ -2977,7 +2983,7 @@ dependencies = [ "frame-support", "frame-system", "impl-trait-for-tuples", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.3", "serde", "sp-inherents", "sp-runtime", @@ -2992,7 +2998,7 @@ source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615ad dependencies = [ "frame-support", "frame-system", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.3", "serde", "smallvec 1.6.1", "sp-core", @@ -3007,7 +3013,7 @@ version = "3.0.0" source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" dependencies = [ "pallet-transaction-payment", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.3", "sp-api", "sp-runtime", ] @@ -3044,11 +3050,11 @@ dependencies = [ [[package]] name = "parity-scale-codec" -version = "2.0.1" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0cd3dab59b5cf4bc81069ade0fc470341a1ef3ad5fa73e5a8943bed2ec12b2e8" +checksum = "b310f220c335f9df1b3d2e9fbe3890bbfeef5030dad771620f48c5c229877cd3" dependencies = [ - "arrayvec 0.5.2", + "arrayvec 0.7.1", "bitvec 0.20.2", "byte-slice-cast 1.0.0", "parity-scale-codec-derive", @@ -3057,11 +3063,11 @@ dependencies = [ [[package]] name = "parity-scale-codec-derive" -version = "2.0.1" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa04976a81fde04924b40cc4036c4d12841e8bb04325a5cf2ada75731a150a7d" +checksum = "81038e13ca2c32587201d544ea2e6b6c47120f1e4eae04478f9f60b6bcb89145" dependencies = [ - "proc-macro-crate 0.1.5", + "proc-macro-crate 1.0.0", "proc-macro2", "quote 1.0.9", "syn 1.0.68", @@ -4067,7 +4073,7 @@ dependencies = [ "jsonrpc-derive", "jsonrpc-pubsub", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.3", "parking_lot 0.11.1", "serde", "serde_json", @@ -4305,7 +4311,7 @@ dependencies = [ "pallet-timestamp", "pallet-transaction-payment", "pallet-transaction-payment-rpc-runtime-api", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.3", "sp-api", "sp-block-builder", "sp-consensus-aura", @@ -4631,7 +4637,7 @@ version = "3.0.0" source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" dependencies = [ "hash-db", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.3", "sp-api-proc-macro", "sp-core", "sp-runtime", @@ -4658,7 +4664,7 @@ name = "sp-application-crypto" version = "3.0.0" source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" dependencies = [ - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.3", "serde", "sp-core", "sp-io 3.0.0", @@ -4672,7 +4678,7 @@ source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615ad dependencies = [ "integer-sqrt", "num-traits", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.3", "serde", "sp-debug-derive", "sp-std", @@ -4683,7 +4689,7 @@ name = "sp-authorship" version = "3.0.0" source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" dependencies = [ - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.3", "sp-inherents", "sp-runtime", "sp-std", @@ -4694,7 +4700,7 @@ name = "sp-block-builder" version = "3.0.0" source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" dependencies = [ - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.3", "sp-api", "sp-inherents", "sp-runtime", @@ -4709,7 +4715,7 @@ dependencies = [ "futures 0.3.15", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", "lru", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.3", "parking_lot 0.11.1", "sp-api", "sp-consensus", @@ -4737,7 +4743,7 @@ dependencies = [ "futures-timer", "libp2p", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.3", "parking_lot 0.11.1", "serde", "sp-api", @@ -4759,7 +4765,7 @@ name = "sp-consensus-aura" version = "0.9.0" source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" dependencies = [ - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.3", "sp-api", "sp-application-crypto", "sp-consensus-slots", @@ -4774,7 +4780,7 @@ name = "sp-consensus-slots" version = "0.9.0" source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" dependencies = [ - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.3", "sp-arithmetic", "sp-runtime", ] @@ -4799,7 +4805,7 @@ dependencies = [ "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", "merlin 2.0.1", "num-traits", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.3", "parity-util-mem", "parking_lot 0.11.1", "primitive-types 0.9.0", @@ -4848,7 +4854,7 @@ version = "0.9.0" source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" dependencies = [ "environmental", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.3", "sp-std", "sp-storage", ] @@ -4860,7 +4866,7 @@ source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615ad dependencies = [ "finality-grandpa", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.3", "serde", "sp-api", "sp-application-crypto", @@ -4875,7 +4881,7 @@ name = "sp-inherents" version = "3.0.0" source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" dependencies = [ - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.3", "parking_lot 0.11.1", "sp-core", "sp-std", @@ -4891,7 +4897,7 @@ dependencies = [ "hash-db", "libsecp256k1", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.3", "parking_lot 0.11.1", "sp-core", "sp-externalities", @@ -4914,7 +4920,7 @@ dependencies = [ "environmental", "hash-db", "log 0.4.14 (git+https://github.com/mesalock-linux/log-sgx)", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.3", "sgx-externalities", "sgx_tstd", "sgx_types", @@ -4947,7 +4953,7 @@ dependencies = [ "derive_more", "futures 0.3.15", "merlin 2.0.1", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.3", "parking_lot 0.11.1", "schnorrkel 0.9.1", "serde", @@ -4991,7 +4997,7 @@ dependencies = [ "hash256-std-hasher", "impl-trait-for-tuples", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.3", "parity-util-mem", "paste 1.0.5", "rand 0.7.3", @@ -5009,7 +5015,7 @@ version = "3.0.0" source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" dependencies = [ "impl-trait-for-tuples", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.3", "primitive-types 0.9.0", "sp-externalities", "sp-runtime-interface-proc-macro", @@ -5037,7 +5043,7 @@ name = "sp-session" version = "3.0.0" source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" dependencies = [ - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.3", "sp-api", "sp-core", "sp-runtime", @@ -5050,7 +5056,7 @@ name = "sp-staking" version = "3.0.0" source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" dependencies = [ - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.3", "sp-runtime", "sp-std", ] @@ -5063,7 +5069,7 @@ dependencies = [ "hash-db", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.3", "parking_lot 0.11.1", "rand 0.7.3", "smallvec 1.6.1", @@ -5088,7 +5094,7 @@ version = "3.0.0" source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" dependencies = [ "impl-serde", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.3", "ref-cast", "serde", "sp-debug-derive", @@ -5101,7 +5107,7 @@ version = "3.0.0" source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" dependencies = [ "impl-trait-for-tuples", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.3", "sp-api", "sp-inherents", "sp-runtime", @@ -5115,7 +5121,7 @@ version = "3.0.0" source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" dependencies = [ "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.3", "sp-std", "tracing", "tracing-core", @@ -5130,7 +5136,7 @@ dependencies = [ "derive_more", "futures 0.3.15", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.3", "serde", "sp-api", "sp-blockchain", @@ -5145,7 +5151,7 @@ source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615ad dependencies = [ "hash-db", "memory-db", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.3", "sp-core", "sp-std", "trie-db", @@ -5170,7 +5176,7 @@ version = "3.0.0" source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" dependencies = [ "impl-serde", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.3", "serde", "sp-runtime", "sp-std", @@ -5182,7 +5188,7 @@ version = "3.0.0" source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" dependencies = [ "impl-trait-for-tuples", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.3", "sp-std", "wasmi", ] @@ -5247,7 +5253,7 @@ dependencies = [ "hex 0.4.2", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", "pallet-balances", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.3", "primitive-types 0.6.2", "sc-rpc-api", "serde", @@ -5334,7 +5340,7 @@ dependencies = [ name = "substratee-api-client-extensions" version = "0.8.0" dependencies = [ - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.3", "sp-core", "sp-finality-grandpa", "sp-runtime", @@ -5358,7 +5364,7 @@ dependencies = [ "json", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", "pallet-balances", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.3", "primitive-types 0.6.2", "sc-keystore", "serde", @@ -5386,7 +5392,7 @@ name = "substratee-enclave-api" version = "0.8.0" dependencies = [ "frame-support", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.3", "sgx_types", "thiserror", ] @@ -5395,7 +5401,7 @@ dependencies = [ name = "substratee-node-primitives" version = "0.8.0" dependencies = [ - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.3", "sgx_tstd", "sp-core", "substratee-node-runtime", @@ -5419,7 +5425,7 @@ dependencies = [ "pallet-timestamp", "pallet-transaction-payment", "pallet-transaction-payment-rpc-runtime-api", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.3", "serde", "sp-api", "sp-block-builder", @@ -5454,7 +5460,7 @@ dependencies = [ "log 0.4.14 (git+https://github.com/mesalock-linux/log-sgx)", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", "pallet-balances", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.3", "sc-keystore", "serde", "sgx-externalities", @@ -5491,7 +5497,7 @@ dependencies = [ "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", "multihash 0.8.0", "pallet-balances", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.3", "parking_lot 0.11.1", "primitive-types 0.9.0", "rust-crypto", @@ -5526,7 +5532,7 @@ name = "substratee-worker-api" version = "0.8.0" dependencies = [ "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.3", "serde_derive", "serde_json", "sgx_crypto_helper", @@ -5539,7 +5545,7 @@ name = "substratee-worker-primitives" version = "0.8.0" dependencies = [ "chrono", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.3", "primitive-types 0.9.0", "serde", "serde_derive", @@ -5558,8 +5564,11 @@ dependencies = [ "env_logger 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpsee", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 2.1.3", "serde_json", + "sp-core", "substratee-enclave-api", + "substratee-worker-primitives", "tokio 1.6.1", ] diff --git a/primitives/worker/src/lib.rs b/primitives/worker/src/lib.rs index 09d057eefa..8e642d80c2 100644 --- a/primitives/worker/src/lib.rs +++ b/primitives/worker/src/lib.rs @@ -75,6 +75,7 @@ impl RpcReturnValue { #[cfg(feature = "std")] #[derive(Encode, Decode, Serialize, Deserialize)] +// Todo: result should not be Vec, but `T: Serialize` pub struct RpcResponse { pub jsonrpc: String, pub result: Vec, // encoded RpcReturnValue @@ -83,6 +84,7 @@ pub struct RpcResponse { #[cfg(feature = "std")] #[derive(Encode, Decode, Serialize)] +// Todo: params should not be Vec, but `T: Serialize` pub struct RpcRequest { pub jsonrpc: String, pub method: String, diff --git a/worker/rpc/server/Cargo.toml b/worker/rpc/server/Cargo.toml index fd6e6139d3..04b59de877 100644 --- a/worker/rpc/server/Cargo.toml +++ b/worker/rpc/server/Cargo.toml @@ -11,12 +11,15 @@ log = "0.4.14" jsonrpsee = { version = "0.2.0-alpha.7", features = ["full"] } serde_json = "1.0.64" tokio = { version = "1.6.1", features = ["full"] } +parity-scale-codec = "2.1.3" substratee-enclave-api = { path = "../../../primitives/enclave-api" } +substratee-worker-primitives = { path = "../../../primitives/worker" } [features] default = ["std"] std = [] [dev-dependencies] -env_logger = { version = "*" } \ No newline at end of file +env_logger = { version = "*" } +sp-core = { git = "https://github.com/paritytech/substrate.git" } \ No newline at end of file diff --git a/worker/rpc/server/src/lib.rs b/worker/rpc/server/src/lib.rs index 03d4613859..88a6e794eb 100644 --- a/worker/rpc/server/src/lib.rs +++ b/worker/rpc/server/src/lib.rs @@ -17,18 +17,22 @@ use std::net::SocketAddr; -use log::debug; - use jsonrpsee::{ types::error::CallError, ws_server::{RpcModule, WsServerBuilder}, }; +use log::debug; +use parity_scale_codec::Encode; use tokio::net::ToSocketAddrs; use substratee_enclave_api::EnclaveApi; +use substratee_worker_primitives::block::SignedBlock; +use substratee_worker_primitives::RpcRequest; #[cfg(test)] mod tests; +#[cfg(test)] +mod mock; pub async fn run_server( addr: impl ToSocketAddrs, @@ -44,10 +48,14 @@ where module.register_method("sidechain_importBlock", |params, enclave| { debug!("sidechain_importBlock params: {:?}", params); + let enclave_req = RpcRequest::compose_jsonrpc_call( + "sidechain_importBlock".into(), + params.one::>()?.encode(), + ); + enclave - .rpc(params.one()?) + .rpc(enclave_req.as_bytes().to_vec()) .map_err(|e| CallError::Failed(e.into())) - })?; server.register_module(module).unwrap(); diff --git a/worker/rpc/server/src/mock.rs b/worker/rpc/server/src/mock.rs new file mode 100644 index 0000000000..0d4d4023a9 --- /dev/null +++ b/worker/rpc/server/src/mock.rs @@ -0,0 +1,43 @@ +use parity_scale_codec::Encode; + +use substratee_enclave_api::{EnclaveApi, EnclaveResult}; +use substratee_worker_primitives::block::{SignedBlock, Block}; +use substratee_worker_primitives::{ShardIdentifier, RpcResponse}; +use sp_core::crypto::AccountId32; + +pub struct TestEnclave; + +impl EnclaveApi for TestEnclave { + fn rpc(&self, _request: Vec) -> EnclaveResult> { + Ok(RpcResponse { + jsonrpc: "mock_response".into(), + result: "null".encode(), + id: 1 + }.encode()) + } +} + +pub fn test_sidechain_block() -> SignedBlock { + use sp_core::{H256, Pair}; + + let signer_pair = sp_core::ed25519::Pair::from_string("//Alice", None).unwrap(); + let author: AccountId32 = signer_pair.public().into(); + let block_number: u64 = 0; + let parent_hash = H256::random(); + let layer_one_head = H256::random(); + let signed_top_hashes = vec![]; + let encrypted_payload: Vec = vec![]; + let shard = ShardIdentifier::default(); + + // when + let block = Block::construct_block( + author, + block_number, + parent_hash.clone(), + layer_one_head.clone(), + shard.clone(), + signed_top_hashes.clone(), + encrypted_payload.clone(), + ); + block.sign(&signer_pair) +} \ No newline at end of file diff --git a/worker/rpc/server/src/tests.rs b/worker/rpc/server/src/tests.rs index bec4eaa455..fa1bffdecd 100644 --- a/worker/rpc/server/src/tests.rs +++ b/worker/rpc/server/src/tests.rs @@ -1,24 +1,19 @@ use log::info; use super::*; +use parity_scale_codec::Decode; use jsonrpsee::{ types::{to_json_value, traits::Client}, ws_client::WsClientBuilder, }; -use substratee_enclave_api::EnclaveResult; + +use mock::{test_sidechain_block, TestEnclave}; +use substratee_worker_primitives::RpcResponse; fn init() { let _ = env_logger::builder().is_test(true).try_init(); } -struct TestEnclave; - -impl EnclaveApi for TestEnclave { - fn rpc(&self, request: Vec) -> EnclaveResult> { - Ok(request) - } -} - #[tokio::test] async fn test_client_calls() { init(); @@ -30,10 +25,10 @@ async fn test_client_calls() { let response: Vec = client .request( "sidechain_importBlock", - vec![to_json_value(vec![1, 1, 2]).unwrap()].into(), + vec![to_json_value(vec![test_sidechain_block()]).unwrap()].into(), ) .await .unwrap(); - assert_eq!(response, vec![1, 1, 2]); + assert!(RpcResponse::decode(&mut response.as_slice()).is_ok()); } diff --git a/worker/src/tests/commons.rs b/worker/src/tests/commons.rs index 7fdc93179d..1a05adc10d 100644 --- a/worker/src/tests/commons.rs +++ b/worker/src/tests/commons.rs @@ -32,9 +32,9 @@ use crate::{enclave_account, ensure_account_has_funds}; use substrate_api_client::Api; use substratee_stf::{Index, KeyPair, ShardIdentifier, TrustedCall, TrustedGetter, Getter}; -#[test] +#[cfg(test)] use crate::config::Config; -#[test] +#[cfg(test)] use substratee_worker_primitives::block::{SignedBlock, Block}; #[derive(Debug, Serialize, Deserialize)] diff --git a/worker/src/worker.rs b/worker/src/worker.rs index c1e494c249..27304bbdca 100644 --- a/worker/src/worker.rs +++ b/worker/src/worker.rs @@ -67,13 +67,13 @@ where let url = format!("ws://{}", p.url); info!("Gossiping block to peer with address: {:?}", url); let client = WsClientBuilder::default().build(&url).await?; - let response: String = client + let response: Vec = client .request( - "author_importBlock", + "sidechain_importBlock", vec![to_json_value(blocks.clone())?].into(), ) .await?; - info!("author_importBlock response: {:?}", response); + info!("sidechain_importBlock response: {:?}", response); } Ok(()) } @@ -84,10 +84,11 @@ mod tests { use jsonrpsee::{ws_server::WsServerBuilder, RpcModule}; use log::debug; use std::net::SocketAddr; + use substratee_worker_primitives::block::SignedBlock as SignedSidechainBlock; use tokio::net::ToSocketAddrs; use crate::tests::{ - commons::{test_sidechain_block, local_worker_config}, + commons::{local_worker_config, test_sidechain_block}, mock::{TestNodeApi, W1_URL, W2_URL}, }; use crate::worker::{Worker, WorkerT}; @@ -100,9 +101,10 @@ mod tests { let mut server = WsServerBuilder::default().build(addr).await?; let mut module = RpcModule::new(()); - module.register_method("author_importBlock", |params, _| { - debug!("author_importBlock params: {:?}", params); - Ok("Hello") + module.register_method("sidechain_importBlock", |params, _| { + debug!("sidechain_importBlock params: {:?}", params); + let blocks: Vec = params.one()?; + Ok(blocks) })?; server.register_module(module).unwrap(); From f4bbd9c67d389147f37a69a5e002733d9a341d71 Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Tue, 29 Jun 2021 11:02:19 +0200 Subject: [PATCH 37/80] [enclave/rpc] add `sidechain_importBlock` rpc and tests  Conflicts:  enclave/Cargo.lock --- enclave/src/rpc/worker_api_direct.rs | 55 +++++++++++++++++++++++++++- enclave/src/tests.rs | 3 ++ primitives/worker/Cargo.toml | 6 +-- primitives/worker/src/lib.rs | 10 +++-- 4 files changed, 66 insertions(+), 8 deletions(-) diff --git a/enclave/src/rpc/worker_api_direct.rs b/enclave/src/rpc/worker_api_direct.rs index 79a2246db1..73966bcbfb 100644 --- a/enclave/src/rpc/worker_api_direct.rs +++ b/enclave/src/rpc/worker_api_direct.rs @@ -57,7 +57,7 @@ use chain_relay::Block; use substratee_node_primitives::Request; use substratee_worker_primitives::RpcReturnValue; -use substratee_worker_primitives::{DirectRequestStatus, TrustedOperationStatus}; +use substratee_worker_primitives::{DirectRequestStatus, TrustedOperationStatus, block::SignedBlock}; use crate::rsa3072; use crate::utils::write_slice_and_whitespace_pad; @@ -357,6 +357,20 @@ fn init_io_handler() -> IoHandler { Ok(Value::String(format!("hello, {}", parsed))) }); + let sidechain_import_import_name: &str = "sidechain_importBlock"; + rpc_methods_vec.push(sidechain_import_import_name); + io.add_sync_method(sidechain_import_import_name, |sidechain_blocks: Params| { + debug!("sidechain_importBlock rpc. Params: {:?}", sidechain_blocks); + let block_vec: Vec = sidechain_blocks.parse()?; + let blocks: Vec = Decode::decode(&mut block_vec.as_slice()) + .map_err(|_| jsonrpc_core::error::Error::invalid_params_with_details( + "Could not decode Vec", + block_vec + ))?; + info!("sidechain_importBlock. Blocks: {:?}", blocks); + Ok(Value::String("ok".to_owned())) + }); + // returns all rpcs methods let rpc_methods_string: String = convert_vec_to_string(rpc_methods_vec); io.add_sync_method("rpc_methods", move |_: Params| { @@ -449,3 +463,42 @@ pub fn send_state(hash: H, value_opt: Option>) -> Result<(), Ok(()) } + +pub mod tests { + use super::init_io_handler; + use super::alloc::string::ToString; + use std::string::String; + + fn rpc_response(result: T) -> String { + format!(r#"{{"jsonrpc":"2.0","result":{},"id":1}}"#, result.to_string()) + } + + pub fn sidechain_import_block_is_ok() { + let io = init_io_handler(); + let enclave_req = r#"{"jsonrpc":"2.0","method":"sidechain_importBlock","params":[4,0,0,0,0,0,0,0,0,228,0,145,188,97,251,138,131,108,29,6,107,10,152,67,29,148,190,114,167,223,169,197,163,93,228,76,169,171,80,15,209,101,11,211,96,0,0,0,0,83,52,167,255,37,229,185,231,38,66,122,3,55,139,5,190,125,85,94,177,190,99,22,149,92,97,154,30,142,89,24,144,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,136,220,52,23,213,5,142,196,180,80,62,12,18,234,26,10,137,190,32,15,233,137,34,66,61,67,52,1,79,166,176,238,0,0,0,175,124,84,84,32,238,162,224,130,203,26,66,7,121,44,59,196,200,100,31,173,226,165,106,187,135,223,149,30,46,191,95,116,203,205,102,100,85,82,74,158,197,166,218,181,130,119,127,162,134,227,129,118,85,123,76,21,113,90,1,160,77,110,15],"id":1}"#; + + let response_string = io.handle_request_sync(enclave_req).unwrap(); + + assert_eq!(response_string, rpc_response("\"ok\"")); + } + + pub fn sidechain_import_block_returns_invalid_param_err() { + let io = init_io_handler(); + let enclave_req = r#"{"jsonrpc":"2.0","method":"sidechain_importBlock","params":["SophisticatedInvalidParam"],"id":1}"#; + + let response_string = io.handle_request_sync(enclave_req).unwrap(); + + let err_msg = r#"{"jsonrpc":"2.0","error":{"code":-32602,"message":"Invalid params: invalid type: string \"SophisticatedInvalidParam\", expected u8."},"id":1}"#; + assert_eq!(response_string, err_msg); + } + + pub fn sidechain_import_block_returns_decode_err() { + let io = init_io_handler(); + let enclave_req = r#"{"jsonrpc":"2.0","method":"sidechain_importBlock","params":[2],"id":1}"#; + + let response_string = io.handle_request_sync(enclave_req).unwrap(); + + let err_msg = r#"{"jsonrpc":"2.0","error":{"code":-32602,"message":"Invalid parameters: Could not decode Vec","data":"[2]"},"id":1}"#; + assert_eq!(response_string, err_msg); + } +} \ No newline at end of file diff --git a/enclave/src/tests.rs b/enclave/src/tests.rs index 06d0de9b26..7145ff57bc 100644 --- a/enclave/src/tests.rs +++ b/enclave/src/tests.rs @@ -117,6 +117,9 @@ pub extern "C" fn test_main_entrance() -> size_t { substratee_stf::sgx::tests::apply_state_diff_works, substratee_stf::sgx::tests::apply_state_diff_returns_storage_hash_mismatch_err, substratee_stf::sgx::tests::apply_state_diff_returns_invalid_storage_diff_err, + rpc::worker_api_direct::tests::sidechain_import_block_is_ok, + rpc::worker_api_direct::tests::sidechain_import_block_returns_invalid_param_err, + rpc::worker_api_direct::tests::sidechain_import_block_returns_decode_err, // these unit tests (?) need an ipfs node running.. //ipfs::test_creates_ipfs_content_struct_works, //ipfs::test_verification_ok_for_correct_content, diff --git a/primitives/worker/Cargo.toml b/primitives/worker/Cargo.toml index 5ef04f47f4..24f2283ebe 100644 --- a/primitives/worker/Cargo.toml +++ b/primitives/worker/Cargo.toml @@ -5,11 +5,11 @@ authors = ["bhaerdi "] edition = "2018" [dependencies] -codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] } +codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive", "full"] } primitive-types = { version = "0.9", default-features = false, features = ["codec"] } serde = { version = "1.0", optional = true} serde_derive = { version = "1.0", optional = true} -serde_json = { version = "1.0", optional = true} +serde_json = { version = "1.0", default-features = false, features = ["alloc"] } chrono = { version = "0.4.19", default-features = false, features = ["alloc"]} [dependencies.sgx_tstd] @@ -38,7 +38,7 @@ std = [ 'codec/std', 'chrono/std', 'serde', 'serde_derive', - 'serde_json', + 'serde_json/std', 'sp-runtime/std', 'sp-core/std', 'primitive-types/std' diff --git a/primitives/worker/src/lib.rs b/primitives/worker/src/lib.rs index 8e642d80c2..05536a1207 100644 --- a/primitives/worker/src/lib.rs +++ b/primitives/worker/src/lib.rs @@ -15,6 +15,8 @@ pub type BlockHash = H256; pub type BlockNumber = u64; pub type ShardIdentifier = H256; +use std::string::String; + //use sp_core::ed25519::Signature; #[derive(Debug, Clone, PartialEq, Encode, Decode)] @@ -73,8 +75,8 @@ impl RpcReturnValue { } } -#[cfg(feature = "std")] -#[derive(Encode, Decode, Serialize, Deserialize)] +#[derive(Encode, Decode)] +#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] // Todo: result should not be Vec, but `T: Serialize` pub struct RpcResponse { pub jsonrpc: String, @@ -82,8 +84,8 @@ pub struct RpcResponse { pub id: u32, } -#[cfg(feature = "std")] -#[derive(Encode, Decode, Serialize)] +#[derive(Encode, Decode)] +#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] // Todo: params should not be Vec, but `T: Serialize` pub struct RpcRequest { pub jsonrpc: String, From 28710803ac10b950d6183edea4a09f8bbd50d636 Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Thu, 24 Jun 2021 18:35:09 +0200 Subject: [PATCH 38/80] add draft of sending a mock_register_enclave_xt, which contains an empty report to register the enclave with a node that has `skip-ias-check` flag enabled. --- enclave/Enclave.edl | 6 +++++ enclave/src/lib.rs | 41 +++++++++++++++++++++++++++++-- local-setup/launch.py | 5 ++-- primitives/enclave-api/src/ffi.rs | 10 ++++++++ primitives/enclave-api/src/lib.rs | 32 ++++++++++++++++++++++++ worker/src/main.rs | 35 ++++++++++++-------------- 6 files changed, 105 insertions(+), 24 deletions(-) diff --git a/enclave/Enclave.edl b/enclave/Enclave.edl index c5a04eb671..722f555ce7 100644 --- a/enclave/Enclave.edl +++ b/enclave/Enclave.edl @@ -67,6 +67,12 @@ enclave { [out, size=unchecked_extrinsic_size] uint8_t* unchecked_extrinsic, uint32_t unchecked_extrinsic_size ); + public sgx_status_t mock_register_enclave_xt( + [in] uint32_t* nonce, + [in, size=w_url_size] uint8_t* w_url, uint32_t w_url_size, + [out, size=unchecked_extrinsic_size] uint8_t* unchecked_extrinsic, uint32_t unchecked_extrinsic_size + ); + public sgx_status_t dump_ra_to_disk(); public sgx_status_t run_key_provisioning_server(int fd, sgx_quote_sign_type_t quote_type); diff --git a/enclave/src/lib.rs b/enclave/src/lib.rs index e0fa3855cb..e4c9d24024 100644 --- a/enclave/src/lib.rs +++ b/enclave/src/lib.rs @@ -56,7 +56,7 @@ use std::time::{SystemTime, UNIX_EPOCH}; use std::untrusted::time::SystemTimeEx; use utils::write_slice_and_whitespace_pad; -use crate::utils::UnwrapOrSgxErrorUnexpected; +use crate::utils::{UnwrapOrSgxErrorUnexpected, hash_from_slice}; use chain_relay::{ storage_proof::{StorageProof, StorageProofChecker}, Block, Header, LightValidation, @@ -92,7 +92,7 @@ pub mod tests; pub mod tls_ra; pub mod top_pool; -use substratee_settings::node::{BLOCK_CONFIRMED, CALL_CONFIRMED, RUNTIME_SPEC_VERSION, RUNTIME_TRANSACTION_VERSION, SUBSTRATEE_REGISTRY_MODULE, CALL_WORKER, SHIELD_FUNDS}; +use substratee_settings::node::{BLOCK_CONFIRMED, CALL_CONFIRMED, RUNTIME_SPEC_VERSION, RUNTIME_TRANSACTION_VERSION, SUBSTRATEE_REGISTRY_MODULE, CALL_WORKER, SHIELD_FUNDS, REGISTER_ENCLAVE}; use substratee_settings::enclave::{CALL_TIMEOUT, GETTER_TIMEOUT}; pub const CERTEXPIRYDAYS: i64 = 90i64; @@ -190,6 +190,43 @@ pub unsafe extern "C" fn get_ecc_signing_pubkey(pubkey: *mut u8, pubkey_size: u3 sgx_status_t::SGX_SUCCESS } + +#[no_mangle] +pub unsafe extern "C" fn mock_register_enclave_xt( + genesis_hash: *const u8, + genesis_hash_size: u32, + nonce: *const u32, + w_url: *const u8, + w_url_size: u32, + unchecked_extrinsic: *mut u8, + unchecked_extrinsic_size: u32, +) -> sgx_status_t { + let genesis_hash_slice = slice::from_raw_parts(genesis_hash, genesis_hash_size as usize); + let genesis_hash = hash_from_slice(genesis_hash_slice); + + let url_slice = slice::from_raw_parts(w_url, w_url_size as usize); + let extrinsic_slice = + slice::from_raw_parts_mut(unchecked_extrinsic, unchecked_extrinsic_size as usize); + + let signer = ed25519::unseal_pair().unwrap(); + + let call = [SUBSTRATEE_REGISTRY_MODULE, REGISTER_ENCLAVE]; + + let xt = compose_extrinsic_offline!( + signer, + (call, Vec::::new(), url_slice.to_vec()), + *nonce, + Era::Immortal, + genesis_hash, + genesis_hash, + RUNTIME_SPEC_VERSION, + RUNTIME_TRANSACTION_VERSION + ).encode(); + + write_slice_and_whitespace_pad(extrinsic_slice, xt); + sgx_status_t::SGX_SUCCESS +} + fn create_extrinsics( validator: LightValidation, calls_buffer: Vec, diff --git a/local-setup/launch.py b/local-setup/launch.py index 8f27dae385..ca0654cfbd 100755 --- a/local-setup/launch.py +++ b/local-setup/launch.py @@ -39,10 +39,9 @@ def main(processes): w2 = setup_worker(w2_working_dir, worker2_log) print('Starting worker 1 in background') - processes.append(w1.run_in_background(log_file=worker1_log, flags=['-P', '2001'])) + processes.append(w1.run_in_background(log_file=worker1_log, flags=['-P', '2001'], subcommand_flags=['--skip-ra'])) print('Starting worker 2 in background') - processes.append(w2.run_in_background(log_file=worker2_log)) - + processes.append(w2.run_in_background(log_file=worker2_log, subcommand_flags=['--skip-ra'])) # keep script alive until terminated signal.pause() diff --git a/primitives/enclave-api/src/ffi.rs b/primitives/enclave-api/src/ffi.rs index af3f4123d4..395433e833 100644 --- a/primitives/enclave-api/src/ffi.rs +++ b/primitives/enclave-api/src/ffi.rs @@ -9,4 +9,14 @@ extern "C" { response: *mut u8, response_len: u32, ) -> sgx_status_t; + + pub fn mock_register_enclave_xt( + eid: sgx_enclave_id_t, + retval: *mut sgx_status_t, + nonce: *const u32, + w_url: *const u8, + w_url_size: u32, + unchecked_extrinsic: *mut u8, + unchecked_extrinsic_size: u32, + ) -> sgx_status_t; } \ No newline at end of file diff --git a/primitives/enclave-api/src/lib.rs b/primitives/enclave-api/src/lib.rs index 947c2f0c15..c49efe9182 100644 --- a/primitives/enclave-api/src/lib.rs +++ b/primitives/enclave-api/src/lib.rs @@ -4,10 +4,12 @@ use sgx_types::{sgx_enclave_id_t, sgx_status_t}; use frame_support::ensure; use crate::error::Error; +use codec::Encode; pub mod ffi; pub mod error; +#[derive(Clone, Copy, PartialEq, Eq)] pub struct Enclave { eid: sgx_enclave_id_t } @@ -24,6 +26,7 @@ pub trait EnclaveApi: Send + Sync + 'static { // Todo: Vec shall be replaced by D: Decode, E: Encode but this is currently // not compatible with the direct_api_server... fn rpc(&self, request: Vec) -> EnclaveResult>; + fn mock_register_enclave_xt(&self, nonce: u32, w_url: &str) -> EnclaveResult>; } impl EnclaveApi for Enclave { @@ -48,4 +51,33 @@ impl EnclaveApi for Enclave { Ok(response) } + + fn mock_register_enclave_xt( + &self, + nonce: u32, + w_url: &str, + ) -> EnclaveResult> { + let mut retval = sgx_status_t::SGX_SUCCESS; + let response_len = 8192; + let mut response: Vec = vec![0u8; response_len as usize]; + + let url = w_url.encode(); + + let res = unsafe { + ffi::mock_register_enclave_xt( + self.eid, + &mut retval, + &nonce, + url.as_ptr(), + url.len() as u32, + response.as_mut_ptr(), + response_len + ) + }; + + ensure!(res == sgx_status_t::SGX_SUCCESS, Error::Sgx(res)); + ensure!(retval == sgx_status_t::SGX_SUCCESS, Error::Sgx(retval)); + + Ok(response) + } } \ No newline at end of file diff --git a/worker/src/main.rs b/worker/src/main.rs index c9ff068c3e..c1e39a0b4f 100644 --- a/worker/src/main.rs +++ b/worker/src/main.rs @@ -61,6 +61,7 @@ use substratee_worker_primitives::block::SignedBlock as SignedSidechainBlock; use substratee_enclave_api::{Enclave, EnclaveApi}; use substratee_worker_rpc_server::{RpcServer}; use substratee_node_primitives::SignedBlock; +use substratee_worker_api::direct_client::DirectClient; use config::Config; @@ -291,28 +292,24 @@ async fn worker( // ------------------------------------------------------------------------ // perform a remote attestation and get an unchecked extrinsic back - if skip_ra { - println!("[!] skipping remote attestation. will not register this enclave on chain"); - } else { - // get enclaves's account nonce - let nonce = api.get_nonce_of(&tee_accountid).unwrap(); - info!("Enclave nonce = {:?}", nonce); - - let uxt = - enclave_perform_ra(eid, genesis_hash, nonce, config.ext_api_url.unwrap().as_bytes().to_vec()).unwrap(); - - let ue = UncheckedExtrinsic::decode(&mut uxt.as_slice()).unwrap(); + // get enclaves's account nonce + let nonce = api.get_nonce_of(&tee_accountid).unwrap(); + info!("Enclave nonce = {:?}", nonce); - debug!("RA extrinsic: {:?}", ue); + let uxt = if skip_ra { + println!("[!] skipping remote attestation. Registering enclave without attestation report."); + enclave.mock_register_enclave_xt(nonce, &config.ext_api_url.unwrap()).unwrap() + } else { + enclave_perform_ra(eid, genesis_hash, nonce, config.ext_api_url.unwrap().as_bytes().to_vec()).unwrap() + }; - let mut _xthex = hex::encode(ue.encode()); - _xthex.insert_str(0, "0x"); + let mut xthex = hex::encode(uxt); + xthex.insert_str(0, "0x"); - // send the extrinsic and wait for confirmation - println!("[>] Register the enclave (send the extrinsic)"); - let tx_hash = api.send_extrinsic(_xthex, XtStatus::InBlock).unwrap(); - println!("[<] Extrinsic got finalized. Hash: {:?}\n", tx_hash); - } + // send the extrinsic and wait for confirmation + println!("[>] Register the enclave (send the extrinsic)"); + let tx_hash = api.send_extrinsic(xthex, XtStatus::InBlock).unwrap(); + println!("[<] Extrinsic got finalized. Hash: {:?}\n", tx_hash); let latest_head = init_chain_relay(eid, &api); println!("*** [+] Finished syncing chain relay\n"); From ee405295aa45b3d1710f99c8ff5d76c603f8fd9b Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Thu, 24 Jun 2021 19:37:33 +0200 Subject: [PATCH 39/80] wip re-introduce branch-ids and bump substrate@8a9a8f170f556beb7c86e996f0576ae3df632f9b. Small conflicts in stf and api-client-keystore --- Cargo.lock | 1837 +++++++++++++++++------------ primitives/enclave-api/Cargo.toml | 2 +- 2 files changed, 1077 insertions(+), 762 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bbd899be85..401f8c86c3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -9,14 +9,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" dependencies = [ "lazy_static", - "regex 1.4.5", + "regex 1.5.4", ] [[package]] name = "addr2line" -version = "0.14.1" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a55f82cfe485775d02112886f4169bde0c5894d75e79ead7eafe7e40a25e45f7" +checksum = "e7a2e47a1fbe209ee101dd6d61285226744c6c8d3c21c8dc878ba6cb9f467f3a" dependencies = [ "gimli", ] @@ -44,11 +44,11 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "0.7.15" +version = "0.7.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7404febffaa47dac81aa44dba71523c9d069b1bdc50a77db41195149e17f68e5" +checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" dependencies = [ - "memchr 2.3.4", + "memchr 2.4.0", ] [[package]] @@ -71,15 +71,24 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.40" +version = "1.0.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28b2cd92db5cbd74e8e5028f7e27dd7aa3090e89e4f2a197cc7c8dfb69c7063b" +checksum = "15af2628f6890fe2609a3b91bef4c83450512802e59489f9c1cb1fa5df064a61" [[package]] name = "approx" -version = "0.3.2" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f2a05fd1bd10b2527e20a2cd32d8873d115b8b39fe219ee25f42a8aca6ba278" +dependencies = [ + "num-traits", +] + +[[package]] +name = "approx" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0e60b75072ecd4168020818c0107f2857bb6c4e64252d8d3983f6263b40a5c3" +checksum = "072df7202e63b127ab55acfe16ce97013d5b97bf160489336d3f1840fd78e99e" dependencies = [ "num-traits", ] @@ -113,22 +122,9 @@ checksum = "be4dc07131ffa69b8072d35f5007352af944213cde02545e2103680baed38fcd" [[package]] name = "asn1_der" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fce6b6a0ffdafebd82c87e79e3f40e8d2c523e5fea5566ff6b90509bf98d638" -dependencies = [ - "asn1_der_derive", -] - -[[package]] -name = "asn1_der_derive" -version = "0.1.2" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d0864d84b8e07b145449be9a8537db86bf9de5ce03b913214694643b4743502" -dependencies = [ - "quote 1.0.9", - "syn 1.0.68", -] +checksum = "9d6e24d2cce90c53b948c46271bfb053e4bdc2db9b5d3f65e20f8cf28a1b7fc3" [[package]] name = "async-channel" @@ -143,16 +139,16 @@ dependencies = [ [[package]] name = "async-executor" -version = "1.4.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb877970c7b440ead138f6321a3b5395d6061183af779340b65e20c0fede9146" +checksum = "871f9bb5e0a22eeb7e8cf16641feb87c9dc67032ccf8ff49e772eb9941d3a965" dependencies = [ "async-task", "concurrent-queue", "fastrand", "futures-lite", - "once_cell 1.7.2", - "vec-arena", + "once_cell 1.8.0", + "slab", ] [[package]] @@ -168,34 +164,34 @@ dependencies = [ "blocking", "futures-lite", "num_cpus", - "once_cell 1.7.2", + "once_cell 1.8.0", ] [[package]] name = "async-io" -version = "1.3.1" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9315f8f07556761c3e48fec2e6b276004acf426e6dc068b2c2251854d65ee0fd" +checksum = "4bbfd5cf2794b1e908ea8457e6c45f8f8f1f6ec5f74617bf4662623f47503c3b" dependencies = [ "concurrent-queue", "fastrand", "futures-lite", "libc", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", - "nb-connect", - "once_cell 1.7.2", + "once_cell 1.8.0", "parking", "polling", - "vec-arena", + "slab", + "socket2", "waker-fn", "winapi 0.3.9", ] [[package]] name = "async-lock" -version = "2.3.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1996609732bde4a9988bc42125f55f2af5f3c36370e27c778d5191a4a1b63bfb" +checksum = "e6a8ea61bf9947a1007c5cada31e647dbc77b103c679858150003ba697ea798b" dependencies = [ "event-listener", ] @@ -211,16 +207,17 @@ dependencies = [ [[package]] name = "async-process" -version = "1.0.2" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef37b86e2fa961bae5a4d212708ea0154f904ce31d1a4a7f47e1bbc33a0c040b" +checksum = "a8f38756dd9ac84671c428afbf7c9f7495feff9ec5b0710f17100098e5b354ac" dependencies = [ "async-io", "blocking", "cfg-if 1.0.0", "event-listener", "futures-lite", - "once_cell 1.7.2", + "libc", + "once_cell 1.8.0", "signal-hook", "winapi 0.3.9", ] @@ -244,9 +241,9 @@ dependencies = [ "gloo-timers", "kv-log-macro", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", - "memchr 2.3.4", + "memchr 2.4.0", "num_cpus", - "once_cell 1.7.2", + "once_cell 1.8.0", "pin-project-lite 0.2.6", "pin-utils", "slab", @@ -267,7 +264,7 @@ checksum = "0b98e84bbb4cbcdd97da190ba0c58a1bb0de2c1fdf67d159e192ed766aeca722" dependencies = [ "proc-macro2", "quote 1.0.9", - "syn 1.0.68", + "syn 1.0.73", ] [[package]] @@ -310,11 +307,12 @@ checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" [[package]] name = "backtrace" -version = "0.3.56" +version = "0.3.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d117600f438b1707d4e4ae15d3595657288f8235a0eb593e80ecc98ab34e1bc" +checksum = "b7815ea54e4d821e791162e078acbebfd6d8c8939cd559c9335dceb1c8ca7282" dependencies = [ "addr2line", + "cc", "cfg-if 1.0.0", "libc", "miniz_oxide", @@ -373,9 +371,9 @@ dependencies = [ [[package]] name = "bitvec" -version = "0.20.2" +version = "0.20.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f682656975d3a682daff957be4ddeb65d6ad656737cd821f2d00685ae466af1" +checksum = "7774144344a4faa177370406a7ff5f1da24303817368584c6206c8303eb07848" dependencies = [ "funty", "radium 0.6.2", @@ -455,7 +453,7 @@ dependencies = [ "atomic-waker", "fastrand", "futures-lite", - "once_cell 1.7.2", + "once_cell 1.8.0", ] [[package]] @@ -466,11 +464,11 @@ checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" [[package]] name = "bstr" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a40b47ad93e1a5404e6c18dec46b628214fee441c70f4ab5d6942142cc268a3d" +checksum = "90682c8d613ad3373e66de8c6411e0ae2ab2571e879d2efbf73558cc66f21279" dependencies = [ - "memchr 2.3.4", + "memchr 2.4.0", ] [[package]] @@ -484,9 +482,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.6.1" +version = "3.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63396b8a4b9de3f4fdfb320ab6080762242f66a8ef174c49d8e19b674db4cdbe" +checksum = "9c59e7af012c713f529e7a3ee57ce9b31ddd858d4b512923602f74608b009631" [[package]] name = "byte-slice-cast" @@ -546,6 +544,15 @@ version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "631ae5198c9be5e753e5cc215e1bd73c2b466a3565173db433f52bb9d3e66dba" +[[package]] +name = "camino" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4648c6d00a709aa069a236adcaae4f605a6241c72bf5bee79331a4b625921a9" +dependencies = [ + "serde", +] + [[package]] name = "cargo-platform" version = "0.1.1" @@ -557,10 +564,11 @@ dependencies = [ [[package]] name = "cargo_metadata" -version = "0.12.3" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7714a157da7991e23d90686b9524b9e12e0407a108647f52e9328f4b3d51ac7f" +checksum = "081e3f0755c1f380c2d010481b6fa2e02973586d5f2b24eebb7a2a1d98b143d8" dependencies = [ + "camino", "cargo-platform", "semver 0.11.0", "semver-parser 0.10.2", @@ -570,9 +578,12 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.67" +version = "1.0.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3c69b077ad434294d3ce9f1f6143a2a4b89a8a2d54ef813d85003a4fd1137fd" +checksum = "4a72c244c1ff497a746a7e1fb3d14bd08420ecda70c8f25c7112f2781652d787" +dependencies = [ + "jobserver", +] [[package]] name = "cfg-if" @@ -635,15 +646,6 @@ dependencies = [ "clap", ] -[[package]] -name = "clear_on_drop" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9cc5db465b294c3fa986d5bbb0f3017cd850bff6dd6c52f9ccff8b4d21b7b08" -dependencies = [ - "cc", -] - [[package]] name = "cloudabi" version = "0.0.3" @@ -664,7 +666,7 @@ dependencies = [ "http", "mime", "mime_guess", - "rand 0.8.3", + "rand 0.8.4", "thiserror", ] @@ -707,26 +709,19 @@ checksum = "ea221b5284a47e40033bf9b66f35f984ec0ea2931eb03505246cd27a963f981b" [[package]] name = "cpufeatures" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed00c67cb5d0a7d64a44f6ad2668db7e7530311dd53ea79bcd4fb022c64911c8" +checksum = "66c99696f6c9dd7f35d486b9d04d7e6e202aa3e8c40d553f2fdf5e7e0c6a71ef" dependencies = [ "libc", ] -[[package]] -name = "cpuid-bool" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8aebca1129a03dc6dc2b127edd729435bbc4a37e1d5f4d7513165089ceb02634" - [[package]] name = "crossbeam-utils" -version = "0.8.3" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7e9d99fa91428effe99c5c6d4634cdeba32b8cf784fc428a2a687f61a952c49" +checksum = "d82cfc11ce7f2c3faef78d8a684447b40d503d9681acebed6cb728d45940c4db" dependencies = [ - "autocfg 1.0.1", "cfg-if 1.0.0", "lazy_static", ] @@ -773,20 +768,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5e98e2ad1a782e33928b96fc3948e7c355e5af34ba4de7670fe8bac2a3b2006d" dependencies = [ "quote 1.0.9", - "syn 1.0.68", -] - -[[package]] -name = "curve25519-dalek" -version = "1.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57c0d59fed08e452f286b251f88b2fc64a01f50a7b263aa09557ad7285d9e7fa" -dependencies = [ - "byteorder", - "clear_on_drop", - "digest 0.8.1", - "rand_core 0.3.1", - "subtle 2.4.0", + "syn 1.0.73", ] [[package]] @@ -799,20 +781,20 @@ dependencies = [ "digest 0.8.1", "rand_core 0.5.1", "subtle 2.4.0", - "zeroize 1.2.0", + "zeroize", ] [[package]] name = "curve25519-dalek" -version = "3.0.2" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f627126b946c25a4638eec0ea634fc52506dea98db118aae985118ce7c3d723f" +checksum = "639891fde0dbea823fc3d798a0fdf9d2f9440a42d64a78ab3488b0ca025117b3" dependencies = [ "byteorder", "digest 0.9.0", "rand_core 0.5.1", "subtle 2.4.0", - "zeroize 1.2.0", + "zeroize", ] [[package]] @@ -823,14 +805,14 @@ checksum = "3ee2393c4a91429dffb4bedf19f4d6abf27d8a732c8ce4980305d782e5426d57" [[package]] name = "derive_more" -version = "0.99.13" +version = "0.99.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f82b1b72f1263f214c0f823371768776c4f5841b942c9883aa8e5ec584fd0ba6" +checksum = "5cc7b9cef1e351660e5443924e4f43ab25fbbed3e9a5f052df3677deb4d6b320" dependencies = [ "convert_case", "proc-macro2", "quote 1.0.9", - "syn 1.0.68", + "syn 1.0.73", ] [[package]] @@ -867,30 +849,36 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fd78930633bd1c6e35c4b42b1df7b0cbc6bc191146e512bb3bedf243fcc3901" dependencies = [ "libc", - "redox_users", + "redox_users 0.3.5", "winapi 0.3.9", ] [[package]] name = "dirs" -version = "3.0.1" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "142995ed02755914747cc6ca76fc7e4583cd18578746716d0508ea6ed558b9ff" +checksum = "30baa043103c9d0c2a57cf537cc2f35623889dc0d405e6c3cccfadbc81c71309" dependencies = [ "dirs-sys", ] [[package]] name = "dirs-sys" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e93d7f5705de3e49895a2b5e0b8855a1c27f080192ae9c32a6432d50741a57a" +checksum = "03d86534ed367a67548dc68113a0f5db55432fdfbb6e6f9d77704397d95d5780" dependencies = [ "libc", - "redox_users", + "redox_users 0.4.0", "winapi 0.3.9", ] +[[package]] +name = "downcast-rs" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" + [[package]] name = "dyn-clonable" version = "0.9.0" @@ -909,7 +897,7 @@ checksum = "558e40ea573c374cf53507fd240b7ee2f5477df7cfebdb97323ec61c719399c5" dependencies = [ "proc-macro2", "quote 1.0.9", - "syn 1.0.68", + "syn 1.0.73", ] [[package]] @@ -920,9 +908,9 @@ checksum = "ee2626afccd7561a06cf1367e2950c4718ea04565e20fb5029b6c7d8ad09abcf" [[package]] name = "ed25519" -version = "1.0.3" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37c66a534cbb46ab4ea03477eae19d5c22c01da8258030280b7bd9d8433fb6ef" +checksum = "8d0860415b12243916284c67a9be413e044ee6668247b99ba26d94b2bc06c8f6" dependencies = [ "signature", ] @@ -933,12 +921,12 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d" dependencies = [ - "curve25519-dalek 3.0.2", + "curve25519-dalek 3.1.0", "ed25519", "rand 0.7.3", "serde", - "sha2 0.9.3", - "zeroize 1.2.0", + "sha2 0.9.5", + "zeroize", ] [[package]] @@ -968,15 +956,37 @@ dependencies = [ "atty", "humantime 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.4.5", + "regex 1.5.4", + "termcolor 1.1.2", +] + +[[package]] +name = "env_logger" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a19187fea3ac7e84da7dacf48de0c45d63c6a76f9490dae389aead16c243fce3" +dependencies = [ + "atty", + "humantime 2.1.0", + "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.5.4", "termcolor 1.1.2", ] [[package]] name = "environmental" -version = "1.1.2" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68b91989ae21441195d7d9b9993a2f9295c7e1a8c96255d8b729accddc124797" + +[[package]] +name = "erased-serde" +version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6576a1755ddffd988788025e75bce9e74b018f7cc226198fe931d077911c6d7e" +checksum = "3de9ad4541d99dc22b59134e7ff8dc3d6c988c89ecd7324bf10a8362b07a2afa" +dependencies = [ + "serde", +] [[package]] name = "event-listener" @@ -1002,7 +1012,7 @@ checksum = "aa4da3c766cd7a0db8242e326e9e4e081edd567072893ed320008189715366a4" dependencies = [ "proc-macro2", "quote 1.0.9", - "syn 1.0.68", + "syn 1.0.73", "synstructure", ] @@ -1014,18 +1024,18 @@ checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" [[package]] name = "fastrand" -version = "1.4.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca5faf057445ce5c9d4329e382b2ce7ca38550ef3b73a5348362d5f24e0c7fe3" +checksum = "77b705829d1e87f762c2df6da140b26af5839e1033aa84aa5f56bb688e4e1bdb" dependencies = [ "instant", ] [[package]] name = "finality-grandpa" -version = "0.14.0" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6447e2f8178843749e8c8003206def83ec124a7859475395777a28b5338647c" +checksum = "74a1bfdcc776e63e49f741c7ce6116fa1b887e8ac2e3ccb14dd4aa113e54feb9" dependencies = [ "either", "futures 0.3.15", @@ -1055,7 +1065,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfcf0ed7fe52a17a03854ec54a9f76d6d84508d1c0e66bc1793301c73fc8493c" dependencies = [ "byteorder", - "rand 0.8.3", + "rand 0.8.4", "rustc-hex", "static_assertions", ] @@ -1099,129 +1109,131 @@ dependencies = [ [[package]] name = "frame-benchmarking" -version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" +version = "3.1.0" +source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" dependencies = [ "frame-support", "frame-system", "linregress", + "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", "parity-scale-codec 2.1.3", - "paste 1.0.5", + "paste", "sp-api", "sp-io 3.0.0", "sp-runtime", - "sp-runtime-interface", - "sp-std", - "sp-storage", + "sp-runtime-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-storage 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", ] [[package]] name = "frame-executive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" +source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" dependencies = [ "frame-support", "frame-system", "parity-scale-codec 2.1.3", - "serde", - "sp-core", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", "sp-io 3.0.0", "sp-runtime", - "sp-std", - "sp-tracing", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-tracing 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", ] [[package]] name = "frame-metadata" version = "13.0.0" -source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" +source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" dependencies = [ "parity-scale-codec 2.1.3", "serde", - "sp-core", - "sp-std", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", ] [[package]] name = "frame-support" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" +source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" dependencies = [ "bitflags", "frame-metadata", "frame-support-procedural", "impl-trait-for-tuples", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", - "once_cell 1.7.2", + "max-encoded-len 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "once_cell 1.8.0", "parity-scale-codec 2.1.3", - "paste 1.0.5", + "paste", "serde", "smallvec 1.6.1", "sp-arithmetic", - "sp-core", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", "sp-inherents", "sp-io 3.0.0", "sp-runtime", "sp-staking", "sp-state-machine", - "sp-std", - "sp-tracing", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-tracing 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", ] [[package]] name = "frame-support-procedural" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" +source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" dependencies = [ "Inflector", "frame-support-procedural-tools", "proc-macro2", "quote 1.0.9", - "syn 1.0.68", + "syn 1.0.73", ] [[package]] name = "frame-support-procedural-tools" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" +source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" dependencies = [ "frame-support-procedural-tools-derive", - "proc-macro-crate 0.1.5", + "proc-macro-crate 1.0.0", "proc-macro2", "quote 1.0.9", - "syn 1.0.68", + "syn 1.0.73", ] [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" +source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" dependencies = [ "proc-macro2", "quote 1.0.9", - "syn 1.0.68", + "syn 1.0.73", ] [[package]] name = "frame-system" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" +source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" dependencies = [ "frame-support", "impl-trait-for-tuples", + "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", "parity-scale-codec 2.1.3", "serde", - "sp-core", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", "sp-io 3.0.0", "sp-runtime", - "sp-std", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", "sp-version", ] [[package]] name = "frame-system-rpc-runtime-api" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" +source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" dependencies = [ "parity-scale-codec 2.1.3", "sp-api", @@ -1312,14 +1324,14 @@ checksum = "acc499defb3b348f8d8f3f66415835a9131856ff7714bf10dadfc4ec4bdb29a1" [[package]] name = "futures-lite" -version = "1.11.3" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4481d0cd0de1d204a4fa55e7d45f07b1d958abcb06714b3446438e2eff695fb" +checksum = "7694489acd39452c77daa48516b894c153f192c3578d5a839b62c58099fcbf48" dependencies = [ "fastrand", "futures-core", "futures-io", - "memchr 2.3.4", + "memchr 2.4.0", "parking", "pin-project-lite 0.2.6", "waker-fn", @@ -1335,7 +1347,7 @@ dependencies = [ "proc-macro-hack", "proc-macro2", "quote 1.0.9", - "syn 1.0.68", + "syn 1.0.73", ] [[package]] @@ -1370,7 +1382,7 @@ dependencies = [ "futures-macro", "futures-sink", "futures-task", - "memchr 2.3.4", + "memchr 2.4.0", "pin-project-lite 0.2.6", "pin-utils", "proc-macro-hack", @@ -1402,15 +1414,6 @@ dependencies = [ "typenum", ] -[[package]] -name = "generic-array" -version = "0.13.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f797e67af32588215eaaab8327027ee8e71b9dd0b2b26996aedf20c030fce309" -dependencies = [ - "typenum", -] - [[package]] name = "generic-array" version = "0.14.4" @@ -1445,9 +1448,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9495705279e7140bf035dde1f6e750c162df8b625267cd52cc44e0b156732c8" +checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753" dependencies = [ "cfg-if 1.0.0", "libc", @@ -1456,21 +1459,21 @@ dependencies = [ [[package]] name = "gimli" -version = "0.23.0" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6503fe142514ca4799d4c26297c4248239fe8838d827db6bd6065c6ed29a6ce" +checksum = "0e4075386626662786ddb0ec9081e7c7eeb1ba31951f447ca780ef9f5d568189" [[package]] name = "globset" -version = "0.4.6" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c152169ef1e421390738366d2f796655fec62621dabbd0fd476f905934061e4a" +checksum = "10463d9ff00a2a068db14231982f5132edebad0d7660cd956a1c30292dbcbfbd" dependencies = [ - "aho-corasick 0.7.15", + "aho-corasick 0.7.18", "bstr", "fnv", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.4.5", + "regex 1.5.4", ] [[package]] @@ -1508,9 +1511,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc018e188373e2777d0ef2467ebff62a08e66c3f5857b23c8fbec3018210dc00" +checksum = "825343c4eef0b63f541f8903f395dc5beb362a979b5799a84062527ef1e37726" dependencies = [ "bytes 1.0.1", "fnv", @@ -1520,8 +1523,8 @@ dependencies = [ "http", "indexmap", "slab", - "tokio 1.6.1", - "tokio-util 0.6.5", + "tokio 1.7.1", + "tokio-util 0.6.7", "tracing", ] @@ -1562,22 +1565,22 @@ dependencies = [ [[package]] name = "hashbrown_tstd" version = "0.9.0" -source = "git+https://github.com/apache/teaclave-sgx-sdk.git?rev=v1.1.3#ed9e7cce4fd40efd7a256d5c4be1c5f00778a5bb" +source = "git+https://github.com/apache/teaclave-sgx-sdk.git?rev=v1.1.3#a6a172e652b4db4eaa17e4faa078fda8922abdd0" [[package]] name = "heck" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cbf45460356b7deeb5e3415b5563308c0a9b057c85e12b06ad551f98d0a6ac" +checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" dependencies = [ "unicode-segmentation", ] [[package]] name = "hermit-abi" -version = "0.1.18" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "322f4de77956e22ed0e5032c359a0f1273f1f7f0d79bfa3b8ffbc730d7fbcc5c" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" dependencies = [ "libc", ] @@ -1590,9 +1593,9 @@ checksum = "805026a5d0141ffc30abb3be3173848ad46a1b1664fe632428479619a3644d77" [[package]] name = "hex" -version = "0.4.2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "644f9158b2f133fd50f5fb3242878846d9eb792e445c893805ff0e3824006e35" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hmac" @@ -1627,9 +1630,9 @@ dependencies = [ [[package]] name = "http" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7245cd7449cc792608c3c8a9eaf69bd4eabbabf802713748fd739c98b82f0747" +checksum = "527e8c9ac747e28542699a951517aa9a6945af506cd1f2e1b53a576c17b6cc11" dependencies = [ "bytes 1.0.1", "fnv", @@ -1648,9 +1651,9 @@ dependencies = [ [[package]] name = "http-body" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfb77c123b4e2f72a2069aeae0b4b4949cc7e966df277813fc16347e7549737" +checksum = "60daa14be0e0786db0f03a9e57cb404c9d756eed2b6c62b9ea98ec5743ec75a9" dependencies = [ "bytes 1.0.1", "http", @@ -1659,9 +1662,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.3.5" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "615caabe2c3160b313d52ccc905335f4ed5f10881dd63dc5699d47e90be85691" +checksum = "f3a87b616e37e93c22fb19bcd386f02f3af5ea98a25670ad0fce773de23c5e68" [[package]] name = "httpdate" @@ -1669,6 +1672,12 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "494b4d60369511e7dea41cf646832512a94e542f68bb9c49e54518e0f468eb47" +[[package]] +name = "httpdate" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6456b8a6c8f33fee7d958fcd1b60d55b11940a79e63ae87013e6d22e26034440" + [[package]] name = "humantime" version = "1.3.0" @@ -1687,6 +1696,12 @@ dependencies = [ "quick-error 1.2.3", ] +[[package]] +name = "humantime" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" + [[package]] name = "hyper" version = "0.13.10" @@ -1701,9 +1716,9 @@ dependencies = [ "http", "http-body 0.3.1", "httparse", - "httpdate", + "httpdate 0.3.2", "itoa", - "pin-project 1.0.6", + "pin-project 1.0.7", "tokio 0.2.25", "tower-service", "tracing", @@ -1712,23 +1727,23 @@ dependencies = [ [[package]] name = "hyper" -version = "0.14.5" +version = "0.14.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bf09f61b52cfcf4c00de50df88ae423d6c02354e385a86341133b5338630ad1" +checksum = "07d6baa1b441335f3ce5098ac421fb6547c46dda735ca1bc6d0153c838f9dd83" dependencies = [ "bytes 1.0.1", "futures-channel", "futures-core", "futures-util", - "h2 0.3.2", + "h2 0.3.3", "http", - "http-body 0.4.1", + "http-body 0.4.2", "httparse", - "httpdate", + "httpdate 1.0.1", "itoa", - "pin-project 1.0.6", + "pin-project-lite 0.2.6", "socket2", - "tokio 1.6.1", + "tokio 1.7.1", "tower-service", "tracing", "want", @@ -1744,7 +1759,7 @@ dependencies = [ "common-multipart-rfc7578", "futures 0.3.15", "http", - "hyper 0.14.5", + "hyper 0.14.9", ] [[package]] @@ -1755,11 +1770,11 @@ checksum = "5f9f7a97316d44c0af9b0301e65010573a853a9fc97046d7331d7f6bc0fd5a64" dependencies = [ "ct-logs", "futures-util", - "hyper 0.14.5", + "hyper 0.14.9", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", "rustls", "rustls-native-certs", - "tokio 1.6.1", + "tokio 1.7.1", "tokio-rustls", "webpki 0.21.4", ] @@ -1771,25 +1786,25 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" dependencies = [ "bytes 1.0.1", - "hyper 0.14.5", + "hyper 0.14.9", "native-tls", - "tokio 1.6.1", + "tokio 1.7.1", "tokio-native-tls", ] [[package]] name = "ias-verify" version = "0.1.4" -source = "git+https://github.com/scs/pallet-substratee-registry.git#860097f21141fb6cd5eb455d8ca9e8adb7031c7d" +source = "git+https://github.com/scs/pallet-substratee-registry.git?branch=feature-gate-ias-check#8fc938ba1d78678552acd8b7f0a5b73521c4f48e" dependencies = [ "base64 0.11.0", "chrono", "frame-support", "parity-scale-codec 2.1.3", "serde_json", - "sp-core", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", "sp-io 3.0.0", - "sp-std", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", "webpki 0.21.0", ] @@ -1806,9 +1821,9 @@ dependencies = [ [[package]] name = "idna" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89829a5d69c23d348314a7ac337fe39173b61149a9864deabd260983aed48c21" +checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" dependencies = [ "matches", "unicode-bidi", @@ -1850,7 +1865,7 @@ checksum = "d5dacb10c5b3bb92d46ba347505a9041e676bb20ad220101326bffb0c93031ee" dependencies = [ "proc-macro2", "quote 1.0.9", - "syn 1.0.68", + "syn 1.0.73", ] [[package]] @@ -1907,19 +1922,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c3824538e42e84c792988098df4ad5a35b47be98b19e31454e09f4e322f00fc" dependencies = [ "bytes 1.0.1", - "dirs 3.0.1", + "dirs 3.0.2", "failure", "futures 0.3.15", "http", - "hyper 0.14.5", + "hyper 0.14.9", "hyper-multipart-rfc7578", "hyper-tls", "parity-multiaddr", "serde", "serde_json", "serde_urlencoded", - "tokio 1.6.1", - "tokio-util 0.6.5", + "tokio 1.7.1", + "tokio-util 0.6.7", "tracing", "typed-builder", "walkdir", @@ -1934,17 +1949,35 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69ddb889f9d0d08a67338271fa9b62996bc788c7796a5c18cf057420aaed5eaf" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736" +[[package]] +name = "jobserver" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "972f5ae5d1cb9c6ae417789196c803205313edde988685da5e3aae0827b9e7fd" +dependencies = [ + "libc", +] + [[package]] name = "js-sys" -version = "0.3.50" +version = "0.3.51" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d99f9e3e84b8f67f846ef5b4cbbc3b1c29f6c759fcbce6f01aa0e73d932a24c" +checksum = "83bdfbace3a0e81a4253f73b49e960b053e396a11012cbd49b9b74d6a2b67062" dependencies = [ "wasm-bindgen", ] @@ -2002,7 +2035,7 @@ dependencies = [ "proc-macro-crate 0.1.5", "proc-macro2", "quote 1.0.9", - "syn 1.0.68", + "syn 1.0.73", ] [[package]] @@ -2041,7 +2074,7 @@ checksum = "e7275601ba6f9f6feaa82d3c66b51e34d190e75f1cf23d5c40f7801f3a7610a6" dependencies = [ "async-trait", "fnv", - "hyper 0.14.5", + "hyper 0.14.9", "hyper-rustls", "jsonrpsee-types", "jsonrpsee-utils", @@ -2049,7 +2082,7 @@ dependencies = [ "serde", "serde_json", "thiserror", - "url 2.2.1", + "url 2.2.2", ] [[package]] @@ -2061,7 +2094,7 @@ dependencies = [ "futures-channel", "futures-util", "globset", - "hyper 0.14.5", + "hyper 0.14.9", "jsonrpsee-types", "jsonrpsee-utils", "lazy_static", @@ -2070,7 +2103,7 @@ dependencies = [ "serde_json", "socket2", "thiserror", - "tokio 1.6.1", + "tokio 1.7.1", "unicase", ] @@ -2084,7 +2117,7 @@ dependencies = [ "proc-macro-crate 1.0.0", "proc-macro2", "quote 1.0.9", - "syn 1.0.68", + "syn 1.0.73", ] [[package]] @@ -2097,7 +2130,7 @@ dependencies = [ "beef", "futures-channel", "futures-util", - "hyper 0.14.5", + "hyper 0.14.9", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", "serde", "serde_json", @@ -2113,11 +2146,11 @@ checksum = "47554ecaacb479285da68799d9b6afc258c32b332cc8b85829c6a9304ee98776" dependencies = [ "futures-channel", "futures-util", - "hyper 0.14.5", + "hyper 0.14.9", "jsonrpsee-types", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.11.1", - "rand 0.8.3", + "rand 0.8.4", "rustc-hash", "serde", "serde_json", @@ -2135,17 +2168,17 @@ dependencies = [ "futures 0.3.15", "jsonrpsee-types", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", - "pin-project 1.0.6", + "pin-project 1.0.7", "rustls", "rustls-native-certs", "serde", "serde_json", "soketto", "thiserror", - "tokio 1.6.1", + "tokio 1.7.1", "tokio-rustls", - "tokio-util 0.6.5", - "url 2.2.1", + "tokio-util 0.6.7", + "url 2.2.2", ] [[package]] @@ -2164,9 +2197,9 @@ dependencies = [ "serde_json", "soketto", "thiserror", - "tokio 1.6.1", + "tokio 1.7.1", "tokio-stream", - "tokio-util 0.6.5", + "tokio-util 0.6.7", ] [[package]] @@ -2221,9 +2254,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.92" +version = "0.2.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56d855069fafbb9b344c0f962150cd2c1187975cb1c22c1522c240d8c4986714" +checksum = "12b8adadd720df158f4d70dfe7ccc6adb0472d7c55ca83445f6a5ab3e36f8fb6" [[package]] name = "libm" @@ -2233,29 +2266,29 @@ checksum = "c7d73b3f436185384286bd8098d17ec07c9a7d2388a6599f824d8502b529702a" [[package]] name = "libp2p" -version = "0.34.0" +version = "0.37.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5133112ce42be9482f6a87be92a605dd6bbc9e93c297aee77d172ff06908f3a" +checksum = "08053fbef67cd777049ef7a95ebaca2ece370b4ed7712c3fa404d69a88cb741b" dependencies = [ "atomic", "bytes 1.0.1", "futures 0.3.15", "lazy_static", "libp2p-core", - "libp2p-core-derive", "libp2p-swarm", + "libp2p-swarm-derive", "parity-multiaddr", "parking_lot 0.11.1", - "pin-project 1.0.6", + "pin-project 1.0.7", "smallvec 1.6.1", "wasm-timer", ] [[package]] name = "libp2p-core" -version = "0.27.1" +version = "0.28.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a2d56aadc2c2bf22cd7797f86e56a65b5b3994a0136b65be3106938acae7a26" +checksum = "554d3e7e9e65f939d66b75fd6a4c67f258fe250da61b91f46c545fc4a89b51d9" dependencies = [ "asn1_der", "bs58", @@ -2271,35 +2304,25 @@ dependencies = [ "multistream-select", "parity-multiaddr", "parking_lot 0.11.1", - "pin-project 1.0.6", + "pin-project 1.0.7", "prost", "prost-build", "rand 0.7.3", "ring 0.16.20", "rw-stream-sink", - "sha2 0.9.3", + "sha2 0.9.5", "smallvec 1.6.1", "thiserror", "unsigned-varint 0.7.0", "void", - "zeroize 1.2.0", -] - -[[package]] -name = "libp2p-core-derive" -version = "0.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4bc40943156e42138d22ed3c57ff0e1a147237742715937622a99b10fbe0156" -dependencies = [ - "quote 1.0.9", - "syn 1.0.68", + "zeroize", ] [[package]] name = "libp2p-swarm" -version = "0.27.2" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7955b973e1fd2bd61ffd43ce261c1223f61f4aacd5bae362a924993f9a25fd98" +checksum = "1e04d8e1eef675029ec728ba14e8d0da7975d84b6679b699b4ae91a1de9c3a92" dependencies = [ "either", "futures 0.3.15", @@ -2311,6 +2334,16 @@ dependencies = [ "wasm-timer", ] +[[package]] +name = "libp2p-swarm-derive" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "365b0a699fea5168676840567582a012ea297b1ca02eee467e58301b9c9c5eed" +dependencies = [ + "quote 1.0.9", + "syn 1.0.73", +] + [[package]] name = "libsecp256k1" version = "0.3.5" @@ -2329,11 +2362,11 @@ dependencies = [ [[package]] name = "linregress" -version = "0.4.0" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d0ad4b5cc8385a881c561fac3501353d63d2a2b7a357b5064d71815c9a92724" +checksum = "b1ff7f341d23e1275eec0656a9a07225fcc86216c4322392868adffe59023d1a" dependencies = [ - "nalgebra", + "nalgebra 0.27.1", "statrs", ] @@ -2357,9 +2390,9 @@ dependencies = [ [[package]] name = "lock_api" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a3c91c24eae6777794bb1997ad98bbb87daf92890acab859f7eaa4320333176" +checksum = "0382880606dff6d15c9476c416d18690b72742aa7b605bb6dd6ec9030fbf07eb" dependencies = [ "scopeguard 1.1.0", ] @@ -2409,13 +2442,57 @@ checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" [[package]] name = "matrixmultiply" -version = "0.2.4" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "916806ba0031cd542105d916a97c8572e1fa6dd79c9c51e7eb43a09ec2dd84c1" +checksum = "5a8a15b776d9dfaecd44b03c5828c2199cddff5247215858aac14624f8d6b741" dependencies = [ "rawpointer", ] +[[package]] +name = "max-encoded-len" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" +dependencies = [ + "impl-trait-for-tuples", + "max-encoded-len-derive 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "parity-scale-codec 2.1.3", + "primitive-types 0.9.0", +] + +[[package]] +name = "max-encoded-len" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git#bab9deca26db20bfc914263e0542a7a1b0d8f174" +dependencies = [ + "impl-trait-for-tuples", + "max-encoded-len-derive 3.0.0 (git+https://github.com/paritytech/substrate.git)", + "parity-scale-codec 2.1.3", + "primitive-types 0.9.0", +] + +[[package]] +name = "max-encoded-len-derive" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" +dependencies = [ + "proc-macro-crate 1.0.0", + "proc-macro2", + "quote 1.0.9", + "syn 1.0.73", +] + +[[package]] +name = "max-encoded-len-derive" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git#bab9deca26db20bfc914263e0542a7a1b0d8f174" +dependencies = [ + "proc-macro-crate 1.0.0", + "proc-macro2", + "quote 1.0.9", + "syn 1.0.73", +] + [[package]] name = "maybe-uninit" version = "2.0.0" @@ -2434,9 +2511,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.3.4" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525" +checksum = "b16bd47d9e329435e309c58469fe0791c2d0d1ba96ec0954152a5ae2b04387dc" [[package]] name = "memory-db" @@ -2455,18 +2532,6 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "71d96e3f3c0b6325d8ccd83c33b28acb183edcb6c67938ba104ec546854b0882" -[[package]] -name = "merlin" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b0942b357c1b4d0dc43ba724674ec89c3218e6ca2b3e8269e7cb53bcecd2f6e" -dependencies = [ - "byteorder", - "keccak", - "rand_core 0.4.2", - "zeroize 1.2.0", -] - [[package]] name = "merlin" version = "2.0.1" @@ -2476,7 +2541,7 @@ dependencies = [ "byteorder", "keccak", "rand_core 0.5.1", - "zeroize 1.2.0", + "zeroize", ] [[package]] @@ -2526,9 +2591,9 @@ dependencies = [ [[package]] name = "mio" -version = "0.7.11" +version = "0.7.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf80d3e903b34e0bd7282b218398aec54e082c840d9baf8339e0080a0c542956" +checksum = "8c2bdb6314ec10835cd3293dd268473a835c02b7b352e788be788b3c6ca6bb16" dependencies = [ "libc", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2599,21 +2664,21 @@ dependencies = [ "digest 0.9.0", "generic-array 0.14.4", "multihash-derive", - "sha2 0.9.3", + "sha2 0.9.5", "unsigned-varint 0.5.1", ] [[package]] name = "multihash-derive" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85ee3c48cb9d9b275ad967a0e96715badc13c6029adb92f34fa17b9ff28fd81f" +checksum = "424f6e86263cd5294cbd7f1e95746b95aca0e0d66bff31e5a40d6baa87b4aa99" dependencies = [ - "proc-macro-crate 0.1.5", + "proc-macro-crate 1.0.0", "proc-macro-error", "proc-macro2", "quote 1.0.9", - "syn 1.0.68", + "syn 1.0.73", "synstructure", ] @@ -2632,29 +2697,55 @@ dependencies = [ "bytes 1.0.1", "futures 0.3.15", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", - "pin-project 1.0.6", + "pin-project 1.0.7", "smallvec 1.6.1", "unsigned-varint 0.7.0", ] [[package]] name = "nalgebra" -version = "0.21.1" +version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6b6147c3d50b4f3cdabfe2ecc94a0191fd3d6ad58aefd9664cf396285883486" +checksum = "476d1d59fe02fe54c86356e91650cd892f392782a1cb9fc524ec84f7aa9e1d06" dependencies = [ - "approx", - "generic-array 0.13.3", + "approx 0.4.0", "matrixmultiply", - "num-complex", - "num-rational", + "num-complex 0.3.1", + "num-rational 0.3.2", "num-traits", - "rand 0.7.3", + "rand 0.8.4", "rand_distr", - "simba", + "simba 0.4.0", + "typenum", +] + +[[package]] +name = "nalgebra" +version = "0.27.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "462fffe4002f4f2e1f6a9dcf12cc1a6fc0e15989014efc02a941d3e0f5dc2120" +dependencies = [ + "approx 0.5.0", + "matrixmultiply", + "nalgebra-macros", + "num-complex 0.4.0", + "num-rational 0.4.0", + "num-traits", + "simba 0.5.1", "typenum", ] +[[package]] +name = "nalgebra-macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01fcc0b8149b4632adc89ac3b7b31a12fb6099a0317a4eb2ebff574ef7de7218" +dependencies = [ + "proc-macro2", + "quote 1.0.9", + "syn 1.0.73", +] + [[package]] name = "native-tls" version = "0.2.7" @@ -2673,16 +2764,6 @@ dependencies = [ "tempfile", ] -[[package]] -name = "nb-connect" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a19900e7eee95eb2b3c2e26d12a874cc80aaf750e31be6fcbe743ead369fa45d" -dependencies = [ - "libc", - "socket2", -] - [[package]] name = "net2" version = "0.2.37" @@ -2722,16 +2803,24 @@ dependencies = [ [[package]] name = "num-complex" -version = "0.2.4" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6b19411a9719e753aff12e5187b74d60d3dc449ec3f4dc21e3989c3f554bc95" +checksum = "747d632c0c558b87dbabbe6a82f3b4ae03720d0646ac5b7b4dae89394be5f2c5" dependencies = [ - "autocfg 1.0.1", "num-traits", ] [[package]] -name = "num-integer" +name = "num-complex" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26873667bbbb7c5182d4a37c1add32cdf09f841af72da53318fdb81543c15085" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-integer" version = "0.1.44" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db" @@ -2752,6 +2841,28 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-rational" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12ac428b1cb17fce6f731001d307d351ec70a6d202fc2e60f7d4c5e42d8f4f07" +dependencies = [ + "autocfg 1.0.1", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-rational" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d41702bd167c2df5520b384281bc111a4b5efcf7fbc4c9c222c815b07e0a6a6a" +dependencies = [ + "autocfg 1.0.1", + "num-integer", + "num-traits", +] + [[package]] name = "num-traits" version = "0.2.14" @@ -2774,9 +2885,12 @@ dependencies = [ [[package]] name = "object" -version = "0.23.0" +version = "0.25.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9a7ab5d64814df0fe4a4b5ead45ed6c5f181ee3ff04ba344313a6c80446c5d4" +checksum = "a38f2be3697a57b4060074ff41b44c16870d916ad7877c17696e063257482bc7" +dependencies = [ + "memchr 2.4.0", +] [[package]] name = "once_cell" @@ -2789,9 +2903,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.7.2" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af8b08b04175473088b46763e51ee54da5f9a164bc162f615b91bc179dbf15a3" +checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56" dependencies = [ "parking_lot 0.11.1", ] @@ -2810,29 +2924,29 @@ checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" [[package]] name = "openssl" -version = "0.10.33" +version = "0.10.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a61075b62a23fef5a29815de7536d940aa35ce96d18ce0cc5076272db678a577" +checksum = "549430950c79ae24e6d02e0b7404534ecf311d94cc9f861e9e4020187d13d885" dependencies = [ "bitflags", "cfg-if 1.0.0", "foreign-types", "libc", - "once_cell 1.7.2", + "once_cell 1.8.0", "openssl-sys", ] [[package]] name = "openssl-probe" -version = "0.1.2" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de" +checksum = "28988d872ab76095a6e6ac88d99b54fd267702734fd7ffe610ca27f533ddb95a" [[package]] name = "openssl-sys" -version = "0.9.61" +version = "0.9.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "313752393519e876837e09e1fa183ddef0be7735868dced3196f4472d536277f" +checksum = "7a7907e3bfa08bb85105209cdfcb6c63d109f8f6c1ed6ca318fff5c1853fbc1d" dependencies = [ "autocfg 1.0.1", "cc", @@ -2844,108 +2958,107 @@ dependencies = [ [[package]] name = "pallet-aura" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" +source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" dependencies = [ "frame-support", "frame-system", "pallet-session", "pallet-timestamp", "parity-scale-codec 2.1.3", - "serde", "sp-application-crypto", "sp-consensus-aura", "sp-runtime", - "sp-std", - "sp-timestamp", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", ] [[package]] name = "pallet-authorship" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" +source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" dependencies = [ "frame-support", "frame-system", "impl-trait-for-tuples", "parity-scale-codec 2.1.3", "sp-authorship", - "sp-inherents", "sp-runtime", - "sp-std", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", ] [[package]] name = "pallet-balances" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" +source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", + "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", + "max-encoded-len 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", "parity-scale-codec 2.1.3", - "serde", "sp-runtime", - "sp-std", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", ] [[package]] name = "pallet-grandpa" -version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" +version = "3.1.0" +source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", + "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", "pallet-authorship", "pallet-session", "parity-scale-codec 2.1.3", - "serde", "sp-application-crypto", - "sp-core", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", "sp-finality-grandpa", + "sp-io 3.0.0", "sp-runtime", "sp-session", "sp-staking", - "sp-std", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", ] [[package]] name = "pallet-randomness-collective-flip" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" +source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" dependencies = [ "frame-support", "frame-system", "parity-scale-codec 2.1.3", "safe-mix", "sp-runtime", - "sp-std", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", ] [[package]] name = "pallet-session" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" +source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" dependencies = [ "frame-support", "frame-system", "impl-trait-for-tuples", + "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", "pallet-timestamp", "parity-scale-codec 2.1.3", - "serde", - "sp-core", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", "sp-io 3.0.0", "sp-runtime", "sp-session", "sp-staking", - "sp-std", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", "sp-trie", ] [[package]] name = "pallet-substratee-registry" -version = "0.8.0" -source = "git+https://github.com/scs/pallet-substratee-registry.git#860097f21141fb6cd5eb455d8ca9e8adb7031c7d" +version = "0.9.0" +source = "git+https://github.com/scs/pallet-substratee-registry.git?branch=feature-gate-ias-check#8fc938ba1d78678552acd8b7f0a5b73521c4f48e" dependencies = [ "frame-support", "frame-system", @@ -2954,63 +3067,62 @@ dependencies = [ "pallet-timestamp", "parity-scale-codec 2.1.3", "serde", - "sp-core", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", "sp-io 3.0.0", "sp-runtime", - "sp-std", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", ] [[package]] name = "pallet-sudo" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" +source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" dependencies = [ "frame-support", "frame-system", "parity-scale-codec 2.1.3", - "serde", "sp-io 3.0.0", "sp-runtime", - "sp-std", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", ] [[package]] name = "pallet-timestamp" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" +source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", "impl-trait-for-tuples", + "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", "parity-scale-codec 2.1.3", - "serde", "sp-inherents", "sp-runtime", - "sp-std", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", "sp-timestamp", ] [[package]] name = "pallet-transaction-payment" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" +source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" dependencies = [ "frame-support", "frame-system", "parity-scale-codec 2.1.3", "serde", "smallvec 1.6.1", - "sp-core", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", "sp-io 3.0.0", "sp-runtime", - "sp-std", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", ] [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" +source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" dependencies = [ "pallet-transaction-payment", "parity-scale-codec 2.1.3", @@ -3033,7 +3145,7 @@ dependencies = [ "serde", "static_assertions", "unsigned-varint 0.7.0", - "url 2.2.1", + "url 2.2.2", ] [[package]] @@ -3055,7 +3167,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b310f220c335f9df1b3d2e9fbe3890bbfeef5030dad771620f48c5c229877cd3" dependencies = [ "arrayvec 0.7.1", - "bitvec 0.20.2", + "bitvec 0.20.4", "byte-slice-cast 1.0.0", "parity-scale-codec-derive", "serde", @@ -3070,7 +3182,7 @@ dependencies = [ "proc-macro-crate 1.0.0", "proc-macro2", "quote 1.0.9", - "syn 1.0.68", + "syn 1.0.73", ] [[package]] @@ -3095,7 +3207,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f557c32c6d268a07c921471619c0295f5efad3a0e76d4f97a05c091a51d110b2" dependencies = [ "proc-macro2", - "syn 1.0.68", + "syn 1.0.73", "synstructure", ] @@ -3110,9 +3222,9 @@ dependencies = [ [[package]] name = "parity-wasm" -version = "0.41.0" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddfc878dac00da22f8f61e7af3157988424567ab01d9920b962ef7dcbd7cd865" +checksum = "be5e13c266502aadf83426d87d81a0f5d1ef45b8027f5a471c360abfe4bfae92" [[package]] name = "parking" @@ -3147,7 +3259,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6d7744ac029df22dca6284efe4e898991d28e3085c706c972bcd7da4a27a15eb" dependencies = [ "instant", - "lock_api 0.4.3", + "lock_api 0.4.4", "parking_lot_core 0.8.3", ] @@ -3187,36 +3299,17 @@ dependencies = [ "cfg-if 1.0.0", "instant", "libc", - "redox_syscall 0.2.5", + "redox_syscall 0.2.9", "smallvec 1.6.1", "winapi 0.3.9", ] -[[package]] -name = "paste" -version = "0.1.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45ca20c77d80be666aef2b45486da86238fabe33e38306bd3118fe4af33fa880" -dependencies = [ - "paste-impl", - "proc-macro-hack", -] - [[package]] name = "paste" version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "acbf547ad0c65e31259204bd90935776d1c693cec2f4ff7abb7a1bbbd40dfe58" -[[package]] -name = "paste-impl" -version = "0.1.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d95a7db200b97ef370c8e6de0088252f7e0dfff7d047a28528e47456c0fc98b6" -dependencies = [ - "proc-macro-hack", -] - [[package]] name = "pbkdf2" version = "0.3.0" @@ -3278,11 +3371,11 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.0.6" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc174859768806e91ae575187ada95c91a29e96a98dc5d2cd9a1fed039501ba6" +checksum = "c7509cc106041c40a4518d2af7a61530e1eed0e6285296a3d8c5472806ccc4a4" dependencies = [ - "pin-project-internal 1.0.6", + "pin-project-internal 1.0.7", ] [[package]] @@ -3293,18 +3386,18 @@ checksum = "3be26700300be6d9d23264c73211d8190e755b6b5ca7a1b28230025511b52a5e" dependencies = [ "proc-macro2", "quote 1.0.9", - "syn 1.0.68", + "syn 1.0.73", ] [[package]] name = "pin-project-internal" -version = "1.0.6" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a490329918e856ed1b083f244e3bfe2d8c4f336407e4ea9e1a9f479ff09049e5" +checksum = "48c950132583b500556b1efd71d45b319029f2b71518d979fcc208e16b42426f" dependencies = [ "proc-macro2", "quote 1.0.9", - "syn 1.0.68", + "syn 1.0.73", ] [[package]] @@ -3333,14 +3426,14 @@ checksum = "3831453b3449ceb48b6d9c7ad7c96d5ea673e9b470a1dc578c2ce6521230884c" [[package]] name = "polling" -version = "2.0.3" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fc12d774e799ee9ebae13f4076ca003b40d18a11ac0f3641e6f899618580b7b" +checksum = "92341d779fa34ea8437ef4d82d440d5e1ce3f3ff7f824aa64424cd481f9a1f25" dependencies = [ "cfg-if 1.0.0", "libc", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", - "wepoll-sys", + "wepoll-ffi", "winapi 0.3.9", ] @@ -3401,7 +3494,7 @@ dependencies = [ "proc-macro-error-attr", "proc-macro2", "quote 1.0.9", - "syn 1.0.68", + "syn 1.0.73", "version_check", ] @@ -3430,11 +3523,11 @@ checksum = "bc881b2c22681370c6a780e47af9840ef841837bc98118431d4e1868bd0c1086" [[package]] name = "proc-macro2" -version = "1.0.26" +version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a152013215dca273577e18d2bf00fa862b89b24169fb78c4c95aeb07992c9cec" +checksum = "f0d8caf72986c1a598726adc988bb5984792ef84f5ee5aa50209145ee8077038" dependencies = [ - "unicode-xid 0.2.1", + "unicode-xid 0.2.2", ] [[package]] @@ -3447,7 +3540,7 @@ dependencies = [ "fnv", "lazy_static", "parking_lot 0.11.1", - "regex 1.4.5", + "regex 1.5.4", "thiserror", ] @@ -3469,7 +3562,7 @@ checksum = "32d3ebd75ac2679c2af3a92246639f9fcc8a442ee420719cc4fe195b98dd5fa3" dependencies = [ "bytes 1.0.1", "heck", - "itertools", + "itertools 0.9.0", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", "multimap", "petgraph", @@ -3486,10 +3579,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "169a15f3008ecb5160cba7d37bcd690a7601b6d30cfb87a117d45e59d52af5d4" dependencies = [ "anyhow", - "itertools", + "itertools 0.9.0", "proc-macro2", "quote 1.0.9", - "syn 1.0.68", + "syn 1.0.73", ] [[package]] @@ -3598,14 +3691,14 @@ dependencies = [ [[package]] name = "rand" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ef9e7e66b4468674bfcb0c81af8b7fa0bb154fa9f28eb840da5c447baeb8d7e" +checksum = "2e7573632e6454cf6b99d7aac4ccca54be06da05aca2ef7423d22d27d4d4bcd8" dependencies = [ "libc", - "rand_chacha 0.3.0", - "rand_core 0.6.2", - "rand_hc 0.3.0", + "rand_chacha 0.3.1", + "rand_core 0.6.3", + "rand_hc 0.3.1", ] [[package]] @@ -3630,12 +3723,12 @@ dependencies = [ [[package]] name = "rand_chacha" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e12735cf05c9e10bf21534da50a147b924d555dc7a547c42e6bb2d5b6017ae0d" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core 0.6.2", + "rand_core 0.6.3", ] [[package]] @@ -3664,20 +3757,21 @@ dependencies = [ [[package]] name = "rand_core" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34cf66eb183df1c5876e2dcf6b13d57340741e8dc255b48e40a26de954d06ae7" +checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" dependencies = [ - "getrandom 0.2.2", + "getrandom 0.2.3", ] [[package]] name = "rand_distr" -version = "0.2.2" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96977acbdd3a6576fb1d27391900035bf3863d4a16422973a409b488cf29ffb2" +checksum = "051b398806e42b9cd04ad9ec8f81e355d0a382c543ac6672c62f5a5b452ef142" dependencies = [ - "rand 0.7.3", + "num-traits", + "rand 0.8.4", ] [[package]] @@ -3700,11 +3794,11 @@ dependencies = [ [[package]] name = "rand_hc" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3190ef7066a446f2e7f42e239d161e905420ccab01eb967c9eb27d21b2322a73" +checksum = "d51e9f596de227fda2ea6c84607f5558e196eeaf43c986b724ba4fb8fdf497e7" dependencies = [ - "rand_core 0.6.2", + "rand_core 0.6.3", ] [[package]] @@ -3801,9 +3895,9 @@ checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" [[package]] name = "redox_syscall" -version = "0.2.5" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94341e4e44e24f6b591b59e47a8a027df12e008d73fd5672dbea9cc22f4507d9" +checksum = "5ab49abadf3f9e1c4bc499e8845e152ad87d2ad2d30371841171169e9d75feee" dependencies = [ "bitflags", ] @@ -3819,6 +3913,16 @@ dependencies = [ "rust-argon2", ] +[[package]] +name = "redox_users" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "528532f3d801c87aec9def2add9ca802fe569e44a544afe633765267840abe64" +dependencies = [ + "getrandom 0.2.3", + "redox_syscall 0.2.9", +] + [[package]] name = "ref-cast" version = "1.0.6" @@ -3836,7 +3940,7 @@ checksum = "4c38e3aecd2b21cb3959637b883bb3714bc7e43f0268b9a29d3743ee3e55cdd2" dependencies = [ "proc-macro2", "quote 1.0.9", - "syn 1.0.68", + "syn 1.0.73", ] [[package]] @@ -3853,23 +3957,22 @@ dependencies = [ [[package]] name = "regex" -version = "1.4.5" +version = "1.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "957056ecddbeba1b26965114e191d2e8589ce74db242b6ea25fc4062427a5c19" +checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461" dependencies = [ - "aho-corasick 0.7.15", - "memchr 2.3.4", - "regex-syntax 0.6.23", + "aho-corasick 0.7.18", + "memchr 2.4.0", + "regex-syntax 0.6.25", ] [[package]] name = "regex-automata" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae1ded71d66a4a97f5e961fd0cb25a5f366a42a41570d16a763a69c092c26ae4" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" dependencies = [ - "byteorder", - "regex-syntax 0.6.23", + "regex-syntax 0.6.25", ] [[package]] @@ -3882,9 +3985,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.6.23" +version = "0.6.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d5f089152e60f62d28b835fbff2cd2e8dc0baf1ac13343bef92ab7eed84548" +checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" [[package]] name = "remove_dir_all" @@ -3916,7 +4019,7 @@ checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" dependencies = [ "cc", "libc", - "once_cell 1.7.2", + "once_cell 1.8.0", "spin", "untrusted", "web-sys", @@ -3950,9 +4053,9 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.18" +version = "0.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e3bad0ee36814ca07d7968269dd4b7ec89ec2da10c4bb613928d3077083c232" +checksum = "dead70b0b5e03e9c814bcb6b01e03e68f7c57a80aa48c72ec92152ab3e818d49" [[package]] name = "rustc-hash" @@ -4006,6 +4109,16 @@ dependencies = [ "security-framework", ] +[[package]] +name = "ruzstd" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d425143485a37727c7a46e689bbe3b883a00f42b4a52c4ac0f44855c1009b00" +dependencies = [ + "byteorder", + "twox-hash", +] + [[package]] name = "rw-stream-sink" version = "0.2.1" @@ -4044,19 +4157,19 @@ dependencies = [ [[package]] name = "sc-keystore" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" +source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" dependencies = [ "async-trait", "derive_more", "futures 0.3.15", "futures-util", - "hex 0.4.2", - "merlin 2.0.1", + "hex 0.4.3", + "merlin", "parking_lot 0.11.1", "rand 0.7.3", "serde_json", "sp-application-crypto", - "sp-core", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", "sp-keystore", "subtle 2.4.0", ] @@ -4064,7 +4177,7 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" +source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" dependencies = [ "derive_more", "futures 0.3.15", @@ -4078,9 +4191,10 @@ dependencies = [ "serde", "serde_json", "sp-chain-spec", - "sp-core", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", "sp-rpc", "sp-runtime", + "sp-tracing 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", "sp-transaction-pool", "sp-version", ] @@ -4095,23 +4209,6 @@ dependencies = [ "winapi 0.3.9", ] -[[package]] -name = "schnorrkel" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eacd8381b3c37840c9c9f40472af529e49975bdcbc24f83c31059fd6539023d3" -dependencies = [ - "curve25519-dalek 1.2.6", - "failure", - "merlin 1.3.0", - "rand 0.6.5", - "rand_core 0.4.2", - "rand_os", - "sha2 0.8.2", - "subtle 2.4.0", - "zeroize 0.9.3", -] - [[package]] name = "schnorrkel" version = "0.9.1" @@ -4122,13 +4219,12 @@ dependencies = [ "arrayvec 0.5.2", "curve25519-dalek 2.1.2", "getrandom 0.1.16", - "merlin 2.0.1", + "merlin", "rand 0.7.3", "rand_core 0.5.1", - "serde", "sha2 0.8.2", "subtle 2.4.0", - "zeroize 1.2.0", + "zeroize", ] [[package]] @@ -4159,14 +4255,14 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0673d6a6449f5e7d12a1caf424fd9363e2af3a4953023ed455e3c4beef4597c0" dependencies = [ - "zeroize 1.2.0", + "zeroize", ] [[package]] name = "security-framework" -version = "2.2.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3670b1d2fdf6084d192bc71ead7aabe6c06aa2ea3fbd9cc3ac111fa5c2b1bd84" +checksum = "23a2ac85147a3a11d77ecf1bc7166ec0b92febfa4461c37944e180f319ece467" dependencies = [ "bitflags", "core-foundation", @@ -4177,9 +4273,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3676258fd3cfe2c9a0ec99ce3038798d847ce3e4bb17746373eb9f0f1ac16339" +checksum = "7e4effb91b4b8b6fb7732e670b6cee160278ff8e6bf485c7805d9e319d76e284" dependencies = [ "core-foundation-sys", "libc", @@ -4230,9 +4326,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.125" +version = "1.0.126" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "558dc50e1a5a5fa7112ca2ce4effcb321b0300c0d4ccf0776a9f60cd89031171" +checksum = "ec7505abeacaec74ae4778d9d9328fe5a5d04253220a85c4ee022239fc996d03" dependencies = [ "serde_derive", ] @@ -4249,13 +4345,13 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.125" +version = "1.0.126" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b093b7a2bb58203b5da3056c05b4ec1fed827dcfdb37347a8841695263b3d06d" +checksum = "963a7dbc9895aeac7ac90e74f34a5d5261828f79df35cbed41e10189d3804d43" dependencies = [ "proc-macro2", "quote 1.0.9", - "syn 1.0.68", + "syn 1.0.73", ] [[package]] @@ -4284,7 +4380,7 @@ dependencies = [ [[package]] name = "sgx-externalities" version = "0.3.0" -source = "git+https://github.com/scs/sgx-runtime#3638c9d23f107d9dae7b9e6643af93e27da517bf" +source = "git+https://github.com/scs/sgx-runtime#468f1eb1b9add37ff0265a917ae0acb4ce7db2e7" dependencies = [ "environmental", "log 0.4.14 (git+https://github.com/mesalock-linux/log-sgx)", @@ -4297,7 +4393,7 @@ dependencies = [ [[package]] name = "sgx-runtime" version = "0.8.0" -source = "git+https://github.com/scs/sgx-runtime#3638c9d23f107d9dae7b9e6643af93e27da517bf" +source = "git+https://github.com/scs/sgx-runtime#468f1eb1b9add37ff0265a917ae0acb4ce7db2e7" dependencies = [ "frame-executive", "frame-support", @@ -4315,12 +4411,12 @@ dependencies = [ "sp-api", "sp-block-builder", "sp-consensus-aura", - "sp-core", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", "sp-inherents", "sp-offchain", "sp-runtime", "sp-session", - "sp-std", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", "sp-transaction-pool", "sp-version", ] @@ -4328,12 +4424,12 @@ dependencies = [ [[package]] name = "sgx_alloc" version = "1.1.3" -source = "git+https://github.com/apache/teaclave-sgx-sdk.git?rev=v1.1.3#ed9e7cce4fd40efd7a256d5c4be1c5f00778a5bb" +source = "git+https://github.com/apache/teaclave-sgx-sdk.git?rev=v1.1.3#a6a172e652b4db4eaa17e4faa078fda8922abdd0" [[package]] name = "sgx_backtrace_sys" version = "1.1.3" -source = "git+https://github.com/apache/teaclave-sgx-sdk.git?rev=v1.1.3#ed9e7cce4fd40efd7a256d5c4be1c5f00778a5bb" +source = "git+https://github.com/apache/teaclave-sgx-sdk.git?rev=v1.1.3#a6a172e652b4db4eaa17e4faa078fda8922abdd0" dependencies = [ "cc", "sgx_build_helper", @@ -4343,14 +4439,14 @@ dependencies = [ [[package]] name = "sgx_build_helper" version = "0.1.3" -source = "git+https://github.com/apache/teaclave-sgx-sdk.git?rev=v1.1.3#ed9e7cce4fd40efd7a256d5c4be1c5f00778a5bb" +source = "git+https://github.com/apache/teaclave-sgx-sdk.git?rev=v1.1.3#a6a172e652b4db4eaa17e4faa078fda8922abdd0" [[package]] name = "sgx_crypto_helper" version = "1.1.3" -source = "git+https://github.com/apache/teaclave-sgx-sdk.git?rev=v1.1.3#ed9e7cce4fd40efd7a256d5c4be1c5f00778a5bb" +source = "git+https://github.com/apache/teaclave-sgx-sdk.git?rev=v1.1.3#a6a172e652b4db4eaa17e4faa078fda8922abdd0" dependencies = [ - "itertools", + "itertools 0.10.1", "libc", "serde", "serde-big-array", @@ -4362,12 +4458,12 @@ dependencies = [ [[package]] name = "sgx_demangle" version = "1.1.3" -source = "git+https://github.com/apache/teaclave-sgx-sdk.git?rev=v1.1.3#ed9e7cce4fd40efd7a256d5c4be1c5f00778a5bb" +source = "git+https://github.com/apache/teaclave-sgx-sdk.git?rev=v1.1.3#a6a172e652b4db4eaa17e4faa078fda8922abdd0" [[package]] name = "sgx_libc" version = "1.1.3" -source = "git+https://github.com/apache/teaclave-sgx-sdk.git?rev=v1.1.3#ed9e7cce4fd40efd7a256d5c4be1c5f00778a5bb" +source = "git+https://github.com/apache/teaclave-sgx-sdk.git?rev=v1.1.3#a6a172e652b4db4eaa17e4faa078fda8922abdd0" dependencies = [ "sgx_types", ] @@ -4375,7 +4471,7 @@ dependencies = [ [[package]] name = "sgx_serialize" version = "1.1.3" -source = "git+https://github.com/apache/teaclave-sgx-sdk.git?rev=v1.1.3#ed9e7cce4fd40efd7a256d5c4be1c5f00778a5bb" +source = "git+https://github.com/apache/teaclave-sgx-sdk.git?rev=v1.1.3#a6a172e652b4db4eaa17e4faa078fda8922abdd0" dependencies = [ "sgx_tstd", ] @@ -4383,7 +4479,7 @@ dependencies = [ [[package]] name = "sgx_serialize_derive" version = "1.1.3" -source = "git+https://github.com/apache/teaclave-sgx-sdk.git?rev=v1.1.3#ed9e7cce4fd40efd7a256d5c4be1c5f00778a5bb" +source = "git+https://github.com/apache/teaclave-sgx-sdk.git?rev=v1.1.3#a6a172e652b4db4eaa17e4faa078fda8922abdd0" dependencies = [ "quote 0.3.15", "sgx_serialize_derive_internals", @@ -4393,7 +4489,7 @@ dependencies = [ [[package]] name = "sgx_serialize_derive_internals" version = "1.1.3" -source = "git+https://github.com/apache/teaclave-sgx-sdk.git?rev=v1.1.3#ed9e7cce4fd40efd7a256d5c4be1c5f00778a5bb" +source = "git+https://github.com/apache/teaclave-sgx-sdk.git?rev=v1.1.3#a6a172e652b4db4eaa17e4faa078fda8922abdd0" dependencies = [ "syn 0.11.11", ] @@ -4401,7 +4497,7 @@ dependencies = [ [[package]] name = "sgx_tprotected_fs" version = "1.1.3" -source = "git+https://github.com/apache/teaclave-sgx-sdk.git?rev=v1.1.3#ed9e7cce4fd40efd7a256d5c4be1c5f00778a5bb" +source = "git+https://github.com/apache/teaclave-sgx-sdk.git?rev=v1.1.3#a6a172e652b4db4eaa17e4faa078fda8922abdd0" dependencies = [ "sgx_trts", "sgx_types", @@ -4410,7 +4506,7 @@ dependencies = [ [[package]] name = "sgx_trts" version = "1.1.3" -source = "git+https://github.com/apache/teaclave-sgx-sdk.git?rev=v1.1.3#ed9e7cce4fd40efd7a256d5c4be1c5f00778a5bb" +source = "git+https://github.com/apache/teaclave-sgx-sdk.git?rev=v1.1.3#a6a172e652b4db4eaa17e4faa078fda8922abdd0" dependencies = [ "sgx_libc", "sgx_types", @@ -4419,7 +4515,7 @@ dependencies = [ [[package]] name = "sgx_tstd" version = "1.1.3" -source = "git+https://github.com/apache/teaclave-sgx-sdk.git?rev=v1.1.3#ed9e7cce4fd40efd7a256d5c4be1c5f00778a5bb" +source = "git+https://github.com/apache/teaclave-sgx-sdk.git?rev=v1.1.3#a6a172e652b4db4eaa17e4faa078fda8922abdd0" dependencies = [ "hashbrown_tstd", "sgx_alloc", @@ -4435,12 +4531,12 @@ dependencies = [ [[package]] name = "sgx_types" version = "1.1.3" -source = "git+https://github.com/apache/teaclave-sgx-sdk.git?rev=v1.1.3#ed9e7cce4fd40efd7a256d5c4be1c5f00778a5bb" +source = "git+https://github.com/apache/teaclave-sgx-sdk.git?rev=v1.1.3#a6a172e652b4db4eaa17e4faa078fda8922abdd0" [[package]] name = "sgx_ucrypto" version = "1.1.3" -source = "git+https://github.com/apache/teaclave-sgx-sdk.git?rev=v1.1.3#ed9e7cce4fd40efd7a256d5c4be1c5f00778a5bb" +source = "git+https://github.com/apache/teaclave-sgx-sdk.git?rev=v1.1.3#a6a172e652b4db4eaa17e4faa078fda8922abdd0" dependencies = [ "libc", "rand_core 0.3.1", @@ -4451,7 +4547,7 @@ dependencies = [ [[package]] name = "sgx_unwind" version = "0.1.1" -source = "git+https://github.com/apache/teaclave-sgx-sdk.git?rev=v1.1.3#ed9e7cce4fd40efd7a256d5c4be1c5f00778a5bb" +source = "git+https://github.com/apache/teaclave-sgx-sdk.git?rev=v1.1.3#a6a172e652b4db4eaa17e4faa078fda8922abdd0" dependencies = [ "sgx_build_helper", ] @@ -4459,7 +4555,7 @@ dependencies = [ [[package]] name = "sgx_urts" version = "1.1.3" -source = "git+https://github.com/apache/teaclave-sgx-sdk.git?rev=v1.1.3#ed9e7cce4fd40efd7a256d5c4be1c5f00778a5bb" +source = "git+https://github.com/apache/teaclave-sgx-sdk.git?rev=v1.1.3#a6a172e652b4db4eaa17e4faa078fda8922abdd0" dependencies = [ "libc", "sgx_types", @@ -4528,13 +4624,13 @@ dependencies = [ [[package]] name = "sha2" -version = "0.9.3" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa827a14b29ab7f44778d14a88d3cb76e949c45083f7dbfa507d0cb699dc12de" +checksum = "b362ae5752fd2137731f9fa25fd4d9058af34666ca1966fb969119cc35719f12" dependencies = [ "block-buffer 0.9.0", "cfg-if 1.0.0", - "cpuid-bool", + "cpufeatures", "digest 0.9.0", "opaque-debug 0.3.0", ] @@ -4550,9 +4646,9 @@ dependencies = [ [[package]] name = "signal-hook" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef33d6d0cd06e0840fba9985aab098c147e67e05cee14d412d3345ed14ff30ac" +checksum = "470c5a6397076fae0094aaf06a08e6ba6f37acb77d3b1b91ea92b4d6c8650c39" dependencies = [ "libc", "signal-hook-registry", @@ -4560,9 +4656,9 @@ dependencies = [ [[package]] name = "signal-hook-registry" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16f1d0fef1604ba8f7a073c7e701f213e056707210e9020af4528e0101ce11a6" +checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" dependencies = [ "libc", ] @@ -4575,21 +4671,42 @@ checksum = "0f0242b8e50dd9accdd56170e94ca1ebd223b098eb9c83539a6e367d0f36ae68" [[package]] name = "simba" -version = "0.1.5" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb931b1367faadea6b1ab1c306a860ec17aaa5fa39f367d0c744e69d971a1fb2" +checksum = "5132a955559188f3d13c9ba831e77c802ddc8782783f050ed0c52f5988b95f4c" dependencies = [ - "approx", - "num-complex", + "approx 0.4.0", + "num-complex 0.3.1", "num-traits", - "paste 0.1.18", + "paste", +] + +[[package]] +name = "simba" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e82063457853d00243beda9952e910b82593e4b07ae9f721b9278a99a0d3d5c" +dependencies = [ + "approx 0.5.0", + "num-complex 0.4.0", + "num-traits", + "paste", ] [[package]] name = "slab" -version = "0.4.2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" +checksum = "f173ac3d1a7e3b28003f40de0b5ce7fe2710f9b9dc3fc38664cebee46b3b6527" + +[[package]] +name = "slog" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8347046d4ebd943127157b94d63abb990fcf729dc4e9978927fdf4ac3c998d06" +dependencies = [ + "erased-serde", +] [[package]] name = "smallvec" @@ -4627,22 +4744,23 @@ dependencies = [ "futures 0.3.15", "httparse", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.8.3", + "rand 0.8.4", "sha-1 0.9.6", ] [[package]] name = "sp-api" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" +source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" dependencies = [ "hash-db", + "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", "parity-scale-codec 2.1.3", "sp-api-proc-macro", - "sp-core", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", "sp-runtime", "sp-state-machine", - "sp-std", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", "sp-version", "thiserror", ] @@ -4650,67 +4768,70 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" +source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" dependencies = [ "blake2-rfc", - "proc-macro-crate 0.1.5", + "proc-macro-crate 1.0.0", "proc-macro2", "quote 1.0.9", - "syn 1.0.68", + "syn 1.0.73", ] [[package]] name = "sp-application-crypto" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" +source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" dependencies = [ + "max-encoded-len 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", "parity-scale-codec 2.1.3", "serde", - "sp-core", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", "sp-io 3.0.0", - "sp-std", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", ] [[package]] name = "sp-arithmetic" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" +source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" dependencies = [ "integer-sqrt", "num-traits", "parity-scale-codec 2.1.3", "serde", - "sp-debug-derive", - "sp-std", + "sp-debug-derive 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "static_assertions", ] [[package]] name = "sp-authorship" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" +source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" dependencies = [ + "async-trait", "parity-scale-codec 2.1.3", "sp-inherents", "sp-runtime", - "sp-std", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", ] [[package]] name = "sp-block-builder" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" +source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" dependencies = [ "parity-scale-codec 2.1.3", "sp-api", "sp-inherents", "sp-runtime", - "sp-std", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", ] [[package]] name = "sp-blockchain" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" +source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" dependencies = [ "futures 0.3.15", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4728,7 +4849,7 @@ dependencies = [ [[package]] name = "sp-chain-spec" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" +source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" dependencies = [ "serde", "serde_json", @@ -4737,8 +4858,9 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" +source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" dependencies = [ + "async-trait", "futures 0.3.15", "futures-timer", "libp2p", @@ -4747,11 +4869,11 @@ dependencies = [ "parking_lot 0.11.1", "serde", "sp-api", - "sp-core", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", "sp-inherents", "sp-runtime", "sp-state-machine", - "sp-std", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", "sp-trie", "sp-utils", "sp-version", @@ -4763,22 +4885,24 @@ dependencies = [ [[package]] name = "sp-consensus-aura" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" +source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" dependencies = [ + "async-trait", "parity-scale-codec 2.1.3", "sp-api", "sp-application-crypto", + "sp-consensus", "sp-consensus-slots", "sp-inherents", "sp-runtime", - "sp-std", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", "sp-timestamp", ] [[package]] name = "sp-consensus-slots" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" +source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" dependencies = [ "parity-scale-codec 2.1.3", "sp-arithmetic", @@ -4788,7 +4912,52 @@ dependencies = [ [[package]] name = "sp-core" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" +source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" +dependencies = [ + "base58", + "blake2-rfc", + "byteorder", + "dyn-clonable", + "ed25519-dalek", + "futures 0.3.15", + "hash-db", + "hash256-std-hasher", + "hex 0.4.3", + "impl-serde", + "lazy_static", + "libsecp256k1", + "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", + "max-encoded-len 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "merlin", + "num-traits", + "parity-scale-codec 2.1.3", + "parity-util-mem", + "parking_lot 0.11.1", + "primitive-types 0.9.0", + "rand 0.7.3", + "regex 1.5.4", + "schnorrkel", + "secrecy", + "serde", + "sha2 0.9.5", + "sp-debug-derive 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-externalities 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-runtime-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-storage 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "substrate-bip39", + "thiserror", + "tiny-bip39 0.8.0", + "tiny-keccak 2.0.2", + "twox-hash", + "wasmi", + "zeroize", +] + +[[package]] +name = "sp-core" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git#bab9deca26db20bfc914263e0542a7a1b0d8f174" dependencies = [ "base58", "blake2-rfc", @@ -4798,41 +4967,42 @@ dependencies = [ "futures 0.3.15", "hash-db", "hash256-std-hasher", - "hex 0.4.2", + "hex 0.4.3", "impl-serde", "lazy_static", "libsecp256k1", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", - "merlin 2.0.1", + "max-encoded-len 3.0.0 (git+https://github.com/paritytech/substrate.git)", + "merlin", "num-traits", "parity-scale-codec 2.1.3", "parity-util-mem", "parking_lot 0.11.1", "primitive-types 0.9.0", "rand 0.7.3", - "regex 1.4.5", - "schnorrkel 0.9.1", + "regex 1.5.4", + "schnorrkel", "secrecy", "serde", - "sha2 0.9.3", - "sp-debug-derive", - "sp-externalities", - "sp-runtime-interface", - "sp-std", - "sp-storage", - "substrate-bip39 0.4.2", + "sha2 0.9.5", + "sp-debug-derive 3.0.0 (git+https://github.com/paritytech/substrate.git)", + "sp-externalities 0.9.0 (git+https://github.com/paritytech/substrate.git)", + "sp-runtime-interface 3.0.0 (git+https://github.com/paritytech/substrate.git)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git)", + "sp-storage 3.0.0 (git+https://github.com/paritytech/substrate.git)", + "substrate-bip39", "thiserror", "tiny-bip39 0.8.0", "tiny-keccak 2.0.2", "twox-hash", "wasmi", - "zeroize 1.2.0", + "zeroize", ] [[package]] name = "sp-database" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" +source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" dependencies = [ "kvdb", "parking_lot 0.11.1", @@ -4841,28 +5011,49 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" +source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" +dependencies = [ + "proc-macro2", + "quote 1.0.9", + "syn 1.0.73", +] + +[[package]] +name = "sp-debug-derive" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git#bab9deca26db20bfc914263e0542a7a1b0d8f174" dependencies = [ "proc-macro2", "quote 1.0.9", - "syn 1.0.68", + "syn 1.0.73", ] [[package]] name = "sp-externalities" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" +source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" dependencies = [ "environmental", "parity-scale-codec 2.1.3", - "sp-std", - "sp-storage", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-storage 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", +] + +[[package]] +name = "sp-externalities" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate.git#bab9deca26db20bfc914263e0542a7a1b0d8f174" +dependencies = [ + "environmental", + "parity-scale-codec 2.1.3", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git)", + "sp-storage 3.0.0 (git+https://github.com/paritytech/substrate.git)", ] [[package]] name = "sp-finality-grandpa" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" +source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" dependencies = [ "finality-grandpa", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4870,28 +5061,30 @@ dependencies = [ "serde", "sp-api", "sp-application-crypto", - "sp-core", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", "sp-keystore", "sp-runtime", - "sp-std", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", ] [[package]] name = "sp-inherents" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" +source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" dependencies = [ + "async-trait", + "impl-trait-for-tuples", "parity-scale-codec 2.1.3", - "parking_lot 0.11.1", - "sp-core", - "sp-std", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-runtime", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", "thiserror", ] [[package]] name = "sp-io" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" +source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" dependencies = [ "futures 0.3.15", "hash-db", @@ -4899,15 +5092,16 @@ dependencies = [ "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", "parity-scale-codec 2.1.3", "parking_lot 0.11.1", - "sp-core", - "sp-externalities", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-externalities 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=master)", "sp-keystore", - "sp-runtime-interface", + "sp-maybe-compressed-blob", + "sp-runtime-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", "sp-state-machine", - "sp-std", - "sp-tracing", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-tracing 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", "sp-trie", - "sp-wasm-interface", + "sp-wasm-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", "tracing", "tracing-core", ] @@ -4915,7 +5109,7 @@ dependencies = [ [[package]] name = "sp-io" version = "3.1.0" -source = "git+https://github.com/scs/sgx-runtime#3638c9d23f107d9dae7b9e6643af93e27da517bf" +source = "git+https://github.com/scs/sgx-runtime#468f1eb1b9add37ff0265a917ae0acb4ce7db2e7" dependencies = [ "environmental", "hash-db", @@ -4924,11 +5118,11 @@ dependencies = [ "sgx-externalities", "sgx_tstd", "sgx_types", - "sp-core", - "sp-runtime-interface", - "sp-std", - "sp-tracing", - "sp-wasm-interface", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-runtime-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-tracing 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-wasm-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", "tracing", "tracing-core", ] @@ -4936,10 +5130,10 @@ dependencies = [ [[package]] name = "sp-keyring" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" +source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" dependencies = [ "lazy_static", - "sp-core", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", "sp-runtime", "strum", ] @@ -4947,34 +5141,43 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" +source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" dependencies = [ "async-trait", "derive_more", "futures 0.3.15", - "merlin 2.0.1", + "merlin", "parity-scale-codec 2.1.3", "parking_lot 0.11.1", - "schnorrkel 0.9.1", + "schnorrkel", "serde", - "sp-core", - "sp-externalities", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-externalities 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=master)", +] + +[[package]] +name = "sp-maybe-compressed-blob" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" +dependencies = [ + "ruzstd", + "zstd", ] [[package]] name = "sp-offchain" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" +source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" dependencies = [ "sp-api", - "sp-core", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", "sp-runtime", ] [[package]] name = "sp-panic-handler" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" +source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" dependencies = [ "backtrace", ] @@ -4982,89 +5185,121 @@ dependencies = [ [[package]] name = "sp-rpc" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" +source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" dependencies = [ + "rustc-hash", "serde", - "sp-core", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "tracing-core", ] [[package]] name = "sp-runtime" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" +source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" dependencies = [ "either", "hash256-std-hasher", "impl-trait-for-tuples", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", + "max-encoded-len 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", "parity-scale-codec 2.1.3", "parity-util-mem", - "paste 1.0.5", + "paste", "rand 0.7.3", "serde", "sp-application-crypto", "sp-arithmetic", - "sp-core", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", "sp-io 3.0.0", - "sp-std", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", +] + +[[package]] +name = "sp-runtime-interface" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" +dependencies = [ + "impl-trait-for-tuples", + "parity-scale-codec 2.1.3", + "primitive-types 0.9.0", + "sp-externalities 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-runtime-interface-proc-macro 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-storage 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-tracing 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-wasm-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "static_assertions", ] [[package]] name = "sp-runtime-interface" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" +source = "git+https://github.com/paritytech/substrate.git#bab9deca26db20bfc914263e0542a7a1b0d8f174" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec 2.1.3", "primitive-types 0.9.0", - "sp-externalities", - "sp-runtime-interface-proc-macro", - "sp-std", - "sp-storage", - "sp-tracing", - "sp-wasm-interface", + "sp-externalities 0.9.0 (git+https://github.com/paritytech/substrate.git)", + "sp-runtime-interface-proc-macro 3.0.0 (git+https://github.com/paritytech/substrate.git)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git)", + "sp-storage 3.0.0 (git+https://github.com/paritytech/substrate.git)", + "sp-tracing 3.0.0 (git+https://github.com/paritytech/substrate.git)", + "sp-wasm-interface 3.0.0 (git+https://github.com/paritytech/substrate.git)", "static_assertions", ] [[package]] name = "sp-runtime-interface-proc-macro" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" +source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" dependencies = [ "Inflector", - "proc-macro-crate 0.1.5", + "proc-macro-crate 1.0.0", + "proc-macro2", + "quote 1.0.9", + "syn 1.0.73", +] + +[[package]] +name = "sp-runtime-interface-proc-macro" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git#bab9deca26db20bfc914263e0542a7a1b0d8f174" +dependencies = [ + "Inflector", + "proc-macro-crate 1.0.0", "proc-macro2", "quote 1.0.9", - "syn 1.0.68", + "syn 1.0.73", ] [[package]] name = "sp-session" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" +source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" dependencies = [ "parity-scale-codec 2.1.3", "sp-api", - "sp-core", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", "sp-runtime", "sp-staking", - "sp-std", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", ] [[package]] name = "sp-staking" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" +source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" dependencies = [ "parity-scale-codec 2.1.3", "sp-runtime", - "sp-std", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", ] [[package]] name = "sp-state-machine" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" +source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" dependencies = [ "hash-db", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", @@ -5073,12 +5308,13 @@ dependencies = [ "parking_lot 0.11.1", "rand 0.7.3", "smallvec 1.6.1", - "sp-core", - "sp-externalities", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-externalities 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=master)", "sp-panic-handler", - "sp-std", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", "sp-trie", "thiserror", + "tracing", "trie-db", "trie-root", ] @@ -5086,43 +5322,87 @@ dependencies = [ [[package]] name = "sp-std" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" +source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" + +[[package]] +name = "sp-std" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git#bab9deca26db20bfc914263e0542a7a1b0d8f174" [[package]] name = "sp-storage" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" +source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" dependencies = [ "impl-serde", "parity-scale-codec 2.1.3", "ref-cast", "serde", - "sp-debug-derive", - "sp-std", + "sp-debug-derive 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", +] + +[[package]] +name = "sp-storage" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git#bab9deca26db20bfc914263e0542a7a1b0d8f174" +dependencies = [ + "impl-serde", + "parity-scale-codec 2.1.3", + "ref-cast", + "serde", + "sp-debug-derive 3.0.0 (git+https://github.com/paritytech/substrate.git)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git)", ] [[package]] name = "sp-timestamp" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" +source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" dependencies = [ - "impl-trait-for-tuples", + "async-trait", + "futures-timer", + "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", "parity-scale-codec 2.1.3", "sp-api", "sp-inherents", "sp-runtime", - "sp-std", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "thiserror", "wasm-timer", ] [[package]] name = "sp-tracing" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" +source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" +dependencies = [ + "erased-serde", + "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 2.1.3", + "parking_lot 0.10.2", + "serde", + "serde_json", + "slog", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "tracing", + "tracing-core", + "tracing-subscriber", +] + +[[package]] +name = "sp-tracing" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git#bab9deca26db20bfc914263e0542a7a1b0d8f174" dependencies = [ + "erased-serde", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", "parity-scale-codec 2.1.3", - "sp-std", + "parking_lot 0.10.2", + "serde", + "serde_json", + "slog", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git)", "tracing", "tracing-core", "tracing-subscriber", @@ -5131,7 +5411,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" +source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" dependencies = [ "derive_more", "futures 0.3.15", @@ -5147,13 +5427,13 @@ dependencies = [ [[package]] name = "sp-trie" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" +source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" dependencies = [ "hash-db", "memory-db", "parity-scale-codec 2.1.3", - "sp-core", - "sp-std", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", "trie-db", "trie-root", ] @@ -5161,7 +5441,7 @@ dependencies = [ [[package]] name = "sp-utils" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" +source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" dependencies = [ "futures 0.3.15", "futures-core", @@ -5173,23 +5453,47 @@ dependencies = [ [[package]] name = "sp-version" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" +source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" dependencies = [ "impl-serde", "parity-scale-codec 2.1.3", "serde", "sp-runtime", - "sp-std", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-version-proc-macro", +] + +[[package]] +name = "sp-version-proc-macro" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" +dependencies = [ + "parity-scale-codec 2.1.3", + "proc-macro-crate 1.0.0", + "proc-macro2", + "quote 1.0.9", + "syn 1.0.73", ] [[package]] name = "sp-wasm-interface" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" +source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec 2.1.3", - "sp-std", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "wasmi", +] + +[[package]] +name = "sp-wasm-interface" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git#bab9deca26db20bfc914263e0542a7a1b0d8f174" +dependencies = [ + "impl-trait-for-tuples", + "parity-scale-codec 2.1.3", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git)", "wasmi", ] @@ -5207,11 +5511,15 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "statrs" -version = "0.12.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cce16f6de653e88beca7bd13780d08e09d4489dbca1f9210e041bc4852481382" +checksum = "1e0c1f144861fbfd2a8cc82d564ccbf7fb3b7834d4fa128b84e9c2a73371aead" dependencies = [ - "rand 0.7.3", + "approx 0.4.0", + "lazy_static", + "nalgebra 0.26.2", + "num-traits", + "rand 0.8.4", ] [[package]] @@ -5238,19 +5546,19 @@ dependencies = [ "heck", "proc-macro2", "quote 1.0.9", - "syn 1.0.68", + "syn 1.0.73", ] [[package]] name = "substrate-api-client" -version = "0.5.0" -source = "git+https://github.com/scs/substrate-api-client#b4ccb09405bb49b2609f20d5ef19db05834a5a02" +version = "0.6.0" +source = "git+https://github.com/scs/substrate-api-client?branch=master#3c8c04cd785b383dfbacb48a374503e644d13a08" dependencies = [ "env_logger 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "frame-metadata", "frame-support", "frame-system", - "hex 0.4.2", + "hex 0.4.3", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", "pallet-balances", "parity-scale-codec 2.1.3", @@ -5258,26 +5566,14 @@ dependencies = [ "sc-rpc-api", "serde", "serde_json", - "sp-core", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", "sp-runtime", - "sp-std", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", "sp-version", "thiserror", "ws 0.9.1", ] -[[package]] -name = "substrate-bip39" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3be511be555a3633e71739a79e4ddff6a6aaa6579fa6114182a51d72c3eb93c5" -dependencies = [ - "hmac 0.7.1", - "pbkdf2 0.3.0", - "schnorrkel 0.8.5", - "sha2 0.8.2", -] - [[package]] name = "substrate-bip39" version = "0.4.2" @@ -5286,23 +5582,23 @@ checksum = "bed6646a0159b9935b5d045611560eeef842b78d7adc3ba36f5ca325a13a0236" dependencies = [ "hmac 0.7.1", "pbkdf2 0.3.0", - "schnorrkel 0.9.1", + "schnorrkel", "sha2 0.8.2", - "zeroize 1.2.0", + "zeroize", ] [[package]] name = "substrate-client-keystore" -version = "0.1.0" -source = "git+https://github.com/scs/substrate-api-client#b4ccb09405bb49b2609f20d5ef19db05834a5a02" +version = "0.6.0" +source = "git+https://github.com/scs/substrate-api-client?branch=master#3c8c04cd785b383dfbacb48a374503e644d13a08" dependencies = [ "async-trait", - "hex 0.4.2", + "hex 0.4.3", "parking_lot 0.10.2", "sc-keystore", "serde_json", "sp-application-crypto", - "sp-core", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", "sp-keyring", "sp-keystore", ] @@ -5310,7 +5606,7 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" +source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" dependencies = [ "async-std", "derive_more", @@ -5324,12 +5620,13 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate.git#743accbe3256de2fc615adcaa3ab03ebdbbb4dbd" +source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" dependencies = [ "ansi_term 0.12.1", "atty", "build-helper", "cargo_metadata", + "sp-maybe-compressed-blob", "tempfile", "toml", "walkdir", @@ -5341,7 +5638,7 @@ name = "substratee-api-client-extensions" version = "0.8.0" dependencies = [ "parity-scale-codec 2.1.3", - "sp-core", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", "sp-finality-grandpa", "sp-runtime", "substrate-api-client", @@ -5360,7 +5657,7 @@ dependencies = [ "env_logger 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "frame-system", "geojson", - "hex 0.4.2", + "hex 0.4.3", "json", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", "pallet-balances", @@ -5371,11 +5668,11 @@ dependencies = [ "serde_json", "sgx_crypto_helper", "sp-application-crypto", - "sp-core", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", "sp-keyring", "sp-runtime", "substrate-api-client", - "substrate-bip39 0.3.1", + "substrate-bip39", "substrate-client-keystore", "substratee-api-client-extensions", "substratee-node-primitives", @@ -5403,14 +5700,14 @@ version = "0.8.0" dependencies = [ "parity-scale-codec 2.1.3", "sgx_tstd", - "sp-core", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", "substratee-node-runtime", ] [[package]] name = "substratee-node-runtime" version = "0.8.0" -source = "git+https://github.com/scs/substraTEE-node#1a0ad62ba0965c2f4a79b8e6d83b7d6669b59c88" +source = "git+https://github.com/scs/substraTEE-node?branch=feature-gate-ias-verify#102dee0f031a1aca16962dc9899db0607a6e9515" dependencies = [ "frame-executive", "frame-support", @@ -5426,16 +5723,15 @@ dependencies = [ "pallet-transaction-payment", "pallet-transaction-payment-rpc-runtime-api", "parity-scale-codec 2.1.3", - "serde", "sp-api", "sp-block-builder", "sp-consensus-aura", - "sp-core", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", "sp-inherents", "sp-offchain", "sp-runtime", "sp-session", - "sp-std", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", "sp-transaction-pool", "sp-version", "substrate-wasm-builder", @@ -5456,7 +5752,7 @@ dependencies = [ "env_logger 0.7.1 (git+https://github.com/mesalock-linux/env_logger-sgx)", "frame-support", "frame-system", - "hex 0.4.2", + "hex 0.4.3", "log 0.4.14 (git+https://github.com/mesalock-linux/log-sgx)", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", "pallet-balances", @@ -5467,7 +5763,7 @@ dependencies = [ "sgx-runtime", "sgx_tstd", "sp-application-crypto", - "sp-core", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", "sp-io 3.1.0", "sp-keyring", "sp-runtime", @@ -5508,7 +5804,7 @@ dependencies = [ "sgx_types", "sgx_urts", "sha2 0.7.1", - "sp-core", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", "sp-finality-grandpa", "sp-keyring", "sp-runtime", @@ -5523,7 +5819,7 @@ dependencies = [ "substratee-worker-primitives", "substratee-worker-rpc-server", "thiserror", - "tokio 1.6.1", + "tokio 1.7.1", "ws 0.7.9", ] @@ -5551,7 +5847,7 @@ dependencies = [ "serde_derive", "serde_json", "sgx_tstd", - "sp-core", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", "sp-keyring", "sp-runtime", ] @@ -5561,15 +5857,15 @@ name = "substratee-worker-rpc-server" version = "0.8.0" dependencies = [ "anyhow", - "env_logger 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", + "env_logger 0.8.4", "jsonrpsee", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", "parity-scale-codec 2.1.3", "serde_json", - "sp-core", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git)", "substratee-enclave-api", "substratee-worker-primitives", - "tokio 1.6.1", + "tokio 1.7.1", ] [[package]] @@ -5597,13 +5893,13 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.68" +version = "1.0.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ce15dd3ed8aa2f8eeac4716d6ef5ab58b6b9256db41d7e1a0224c2788e8fd87" +checksum = "f71489ff30030d2ae598524f61326b902466f72a0fb1a8564c001cc63425bcc7" dependencies = [ "proc-macro2", "quote 1.0.9", - "unicode-xid 0.2.1", + "unicode-xid 0.2.2", ] [[package]] @@ -5623,8 +5919,8 @@ checksum = "b834f2d66f734cb897113e34aaff2f1ab4719ca946f9a7358dba8f8064148701" dependencies = [ "proc-macro2", "quote 1.0.9", - "syn 1.0.68", - "unicode-xid 0.2.1", + "syn 1.0.73", + "unicode-xid 0.2.2", ] [[package]] @@ -5641,8 +5937,8 @@ checksum = "dac1c663cfc93810f88aed9b8941d48cabf856a1b111c29a40439018d870eb22" dependencies = [ "cfg-if 1.0.0", "libc", - "rand 0.8.3", - "redox_syscall 0.2.5", + "rand 0.8.4", + "redox_syscall 0.2.9", "remove_dir_all", "winapi 0.3.9", ] @@ -5690,7 +5986,7 @@ checksum = "8a36768c0fbf1bb15eca10defa29526bda730a2376c2ab4393ccfa16fb1a318d" dependencies = [ "proc-macro2", "quote 1.0.9", - "syn 1.0.68", + "syn 1.0.73", ] [[package]] @@ -5708,7 +6004,7 @@ version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8018d24e04c95ac8790716a5987d0fec4f8b27249ffa0f7d33f1369bdfb88cbd" dependencies = [ - "once_cell 1.7.2", + "once_cell 1.8.0", ] [[package]] @@ -5744,14 +6040,14 @@ checksum = "d9e44c4759bae7f1032e286a7ef990bd9ed23fe831b7eeba0beb97484c2e59b8" dependencies = [ "anyhow", "hmac 0.8.1", - "once_cell 1.7.2", + "once_cell 1.8.0", "pbkdf2 0.4.0", "rand 0.7.3", "rustc-hash", - "sha2 0.9.3", + "sha2 0.9.5", "thiserror", "unicode-normalization", - "zeroize 1.2.0", + "zeroize", ] [[package]] @@ -5796,23 +6092,23 @@ dependencies = [ "bytes 0.5.6", "fnv", "futures-core", - "memchr 2.3.4", + "memchr 2.4.0", "pin-project-lite 0.1.12", ] [[package]] name = "tokio" -version = "1.6.1" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a38d31d7831c6ed7aad00aa4c12d9375fd225a6dd77da1d25b707346319a975" +checksum = "5fb2ed024293bb19f7a5dc54fe83bf86532a44c12a2bb8ba40d64a4509395ca2" dependencies = [ "autocfg 1.0.1", "bytes 1.0.1", "libc", - "memchr 2.3.4", - "mio 0.7.11", + "memchr 2.4.0", + "mio 0.7.13", "num_cpus", - "once_cell 1.7.2", + "once_cell 1.8.0", "parking_lot 0.11.1", "pin-project-lite 0.2.6", "signal-hook-registry", @@ -5828,7 +6124,7 @@ checksum = "c49e3df43841dafb86046472506755d8501c5615673955f6aa17181125d13c37" dependencies = [ "proc-macro2", "quote 1.0.9", - "syn 1.0.68", + "syn 1.0.73", ] [[package]] @@ -5838,7 +6134,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7d995660bd2b7f8c1568414c1126076c13fbb725c40112dc0120b78eb9b717b" dependencies = [ "native-tls", - "tokio 1.6.1", + "tokio 1.7.1", ] [[package]] @@ -5848,7 +6144,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc6844de72e57df1980054b38be3a9f4702aba4858be64dd700181a8a6d0e1b6" dependencies = [ "rustls", - "tokio 1.6.1", + "tokio 1.7.1", "webpki 0.21.4", ] @@ -5860,7 +6156,7 @@ checksum = "f8864d706fdb3cc0843a49647ac892720dac98a6eeb818b77190592cf4994066" dependencies = [ "futures-core", "pin-project-lite 0.2.6", - "tokio 1.6.1", + "tokio 1.7.1", ] [[package]] @@ -5879,9 +6175,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.6.5" +version = "0.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5143d049e85af7fbc36f5454d990e62c2df705b3589f123b71f441b6b59f443f" +checksum = "1caa0b0c8d94a049db56b5acf8cba99dc0623aab1b26d5b5f5e2d945846b3592" dependencies = [ "bytes 1.0.1", "futures-core", @@ -5889,7 +6185,7 @@ dependencies = [ "futures-sink", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", "pin-project-lite 0.2.6", - "tokio 1.6.1", + "tokio 1.7.1", ] [[package]] @@ -5909,9 +6205,9 @@ checksum = "360dfd1d6d30e05fda32ace2c8c70e9c0a9da713275777f5a4dbb8a1893930c6" [[package]] name = "tracing" -version = "0.1.25" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01ebdc2bb4498ab1ab5f5b73c5803825e60199229ccba0698170e3be0e7f959f" +checksum = "09adeb8c97449311ccd28a427f96fb563e7fd31aabf994189879d9da2394b89d" dependencies = [ "cfg-if 1.0.0", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", @@ -5928,14 +6224,14 @@ checksum = "c42e6fa53307c8a17e4ccd4dc81cf5ec38db9209f59b222210375b54ee40d1e2" dependencies = [ "proc-macro2", "quote 1.0.9", - "syn 1.0.68", + "syn 1.0.73", ] [[package]] name = "tracing-core" -version = "0.1.17" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f50de3927f93d202783f4513cda820ab47ef17f624b03c096e86ef00c67e6b5f" +checksum = "a9ff14f98b1a4b289c6248a023c1c2fa1491062964e9fed67ab29c4e4da4a052" dependencies = [ "lazy_static", ] @@ -5946,7 +6242,7 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" dependencies = [ - "pin-project 1.0.6", + "pin-project 1.0.7", "tracing", ] @@ -5973,15 +6269,15 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.2.17" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "705096c6f83bf68ea5d357a6aa01829ddbdac531b357b45abeca842938085baa" +checksum = "aa5553bf0883ba7c9cbe493b085c29926bd41b66afc31ff72cf17ff4fb60dcd5" dependencies = [ "ansi_term 0.12.1", "chrono", "lazy_static", "matchers", - "regex 1.4.5", + "regex 1.5.4", "serde", "serde_json", "sharded-slab", @@ -5995,9 +6291,9 @@ dependencies = [ [[package]] name = "trie-db" -version = "0.22.3" +version = "0.22.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec051edf7f0fc9499a2cb0947652cab2148b9d7f61cee7605e312e9f970dacaf" +checksum = "cd81fe0c8bc2b528a51c9d2c31dae4483367a26a723a3c9a4a8120311d7774e3" dependencies = [ "hash-db", "hashbrown 0.9.1", @@ -6028,7 +6324,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04f8ab788026715fa63b31960869617cba39117e520eb415b0139543e325ab59" dependencies = [ "cfg-if 0.1.10", - "rand 0.7.3", + "rand 0.3.23", "static_assertions", ] @@ -6040,7 +6336,7 @@ checksum = "345426c7406aa355b60c5007c79a2d1f5b605540072795222f17f6443e6a9c6f" dependencies = [ "proc-macro2", "quote 1.0.9", - "syn 1.0.68", + "syn 1.0.73", ] [[package]] @@ -6075,7 +6371,7 @@ checksum = "e11fe9a9348741cf134085ad57c249508345fe16411b3d7fb4ff2da2f1d6382e" dependencies = [ "byteorder", "crunchy", - "hex 0.4.2", + "hex 0.4.3", "static_assertions", ] @@ -6090,18 +6386,18 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" +checksum = "eeb8be209bb1c96b7c177c7420d26e04eccacb0eeae6b980e35fcb74678107e0" dependencies = [ "matches", ] [[package]] name = "unicode-normalization" -version = "0.1.17" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07fbfce1c8a97d547e8b5334978438d9d6ec8c20e38f56d4a4374d181493eaef" +checksum = "d54590932941a9e9266f0832deed84ebe1bf2e4c9e4a3554d393d18f5e854bf9" dependencies = [ "tinyvec", ] @@ -6126,9 +6422,9 @@ checksum = "8c1f860d7d29cf02cb2f3f359fd35991af3d30bac52c57d265a3c461074cb4dc" [[package]] name = "unicode-xid" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" +checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" [[package]] name = "unsigned-varint" @@ -6161,36 +6457,31 @@ dependencies = [ [[package]] name = "url" -version = "2.2.1" +version = "2.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ccd964113622c8e9322cfac19eb1004a07e636c545f325da085d5cdde6f1f8b" +checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c" dependencies = [ "form_urlencoded", - "idna 0.2.2", + "idna 0.2.3", "matches", "percent-encoding 2.1.0", ] [[package]] name = "value-bag" -version = "1.0.0-alpha.6" +version = "1.0.0-alpha.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b676010e055c99033117c2343b33a40a30b91fecd6c49055ac9cd2d6c305ab1" +checksum = "dd320e1520f94261153e96f7534476ad869c14022aee1e59af7c778075d840ae" dependencies = [ "ctor", + "version_check", ] [[package]] name = "vcpkg" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b00bca6106a5e23f3eee943593759b7fcddb00554332e856d990c893966879fb" - -[[package]] -name = "vec-arena" -version = "1.1.0" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34b2f665b594b07095e3ac3f718e13c2197143416fae4c5706cffb7b1af8d7f1" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] name = "vec_map" @@ -6251,9 +6542,9 @@ checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" [[package]] name = "wasm-bindgen" -version = "0.2.73" +version = "0.2.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83240549659d187488f91f33c0f8547cbfef0b2088bc470c116d1d260ef623d9" +checksum = "d54ee1d4ed486f78874278e63e4069fc1ab9f6a18ca492076ffb90c5eb2997fd" dependencies = [ "cfg-if 1.0.0", "wasm-bindgen-macro", @@ -6261,24 +6552,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.73" +version = "0.2.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae70622411ca953215ca6d06d3ebeb1e915f0f6613e3b495122878d7ebec7dae" +checksum = "3b33f6a0694ccfea53d94db8b2ed1c3a8a4c86dd936b13b9f0a15ec4a451b900" dependencies = [ "bumpalo", "lazy_static", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", "proc-macro2", "quote 1.0.9", - "syn 1.0.68", + "syn 1.0.73", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.23" +version = "0.4.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81b8b767af23de6ac18bf2168b690bed2902743ddf0fb39252e36f9e2bfc63ea" +checksum = "5fba7978c679d53ce2d0ac80c8c175840feb849a161664365d1287b41f2e67f1" dependencies = [ "cfg-if 1.0.0", "js-sys", @@ -6288,9 +6579,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.73" +version = "0.2.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e734d91443f177bfdb41969de821e15c516931c3c3db3d318fa1b68975d0f6f" +checksum = "088169ca61430fe1e58b8096c24975251700e7b1f6fd91cc9d59b04fb9b18bd4" dependencies = [ "quote 1.0.9", "wasm-bindgen-macro-support", @@ -6298,22 +6589,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.73" +version = "0.2.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d53739ff08c8a68b0fdbcd54c372b8ab800b1449ab3c9d706503bc7dd1621b2c" +checksum = "be2241542ff3d9f241f5e2cb6dd09b37efe786df8851c54957683a49f0987a97" dependencies = [ "proc-macro2", "quote 1.0.9", - "syn 1.0.68", + "syn 1.0.73", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.73" +version = "0.2.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9a543ae66aa233d14bb765ed9af4a33e81b8b58d1584cf1b47ff8cd0b9e4489" +checksum = "d7cff876b8f18eed75a66cf49b65e7f967cb354a7aa16003fb55dbfd25b44b4f" [[package]] name = "wasm-gc-api" @@ -6343,32 +6634,33 @@ dependencies = [ [[package]] name = "wasmi" -version = "0.6.2" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf617d864d25af3587aa745529f7aaa541066c876d57e050c0d0c85c61c92aff" +checksum = "d2ee05bba3d1d994652079893941a2ef9324d2b58a63c31b40678fb7eddd7a5a" dependencies = [ + "downcast-rs", "libc", "memory_units", - "num-rational", + "num-rational 0.2.4", "num-traits", - "parity-wasm 0.41.0", + "parity-wasm 0.42.2", "wasmi-validation", ] [[package]] name = "wasmi-validation" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea78c597064ba73596099281e2f4cfc019075122a65cdda3205af94f0b264d93" +checksum = "a2eb8e860796d8be48efef530b60eebf84e74a88bce107374fffb0da97d504b8" dependencies = [ - "parity-wasm 0.41.0", + "parity-wasm 0.42.2", ] [[package]] name = "web-sys" -version = "0.3.50" +version = "0.3.51" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a905d57e488fec8861446d3393670fb50d27a262344013181c2cdf9fff5481be" +checksum = "e828417b379f3df7111d3a2a9e5753706cae29c41f7c4029ee9fd77f3e09e582" dependencies = [ "js-sys", "wasm-bindgen", @@ -6395,10 +6687,10 @@ dependencies = [ ] [[package]] -name = "wepoll-sys" -version = "3.0.1" +name = "wepoll-ffi" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fcb14dea929042224824779fbc82d9fab8d2e6d3cbc0ac404de8edf489e77ff" +checksum = "d743fdedc5c64377b5fc2bc036b01c7fd642205a0d96356034ae3404d49eb7fb" dependencies = [ "cc", ] @@ -6501,7 +6793,7 @@ dependencies = [ "rand 0.7.3", "sha-1 0.8.2", "slab", - "url 2.2.1", + "url 2.2.2", ] [[package]] @@ -6528,27 +6820,50 @@ checksum = "e66366e18dc58b46801afbf2ca7661a9f59cc8c5962c29892b6039b4f86fa992" [[package]] name = "zeroize" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45af6a010d13e4cf5b54c94ba5a2b2eba5596b9e46bf5875612d332a1f2b3f86" - -[[package]] -name = "zeroize" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81a974bcdd357f0dca4d41677db03436324d45a4c9ed2d0b873a5a360ce41c36" +checksum = "4756f7db3f7b5574938c3eb1c117038b8e07f95ee6718c0efad4ac21508f1efd" dependencies = [ "zeroize_derive", ] [[package]] name = "zeroize_derive" -version = "1.0.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3f369ddb18862aba61aa49bf31e74d29f0f162dec753063200e1dc084345d16" +checksum = "a2c1e130bebaeab2f23886bf9acbaca14b092408c452543c857f66399cd6dab1" dependencies = [ "proc-macro2", "quote 1.0.9", - "syn 1.0.68", + "syn 1.0.73", "synstructure", ] + +[[package]] +name = "zstd" +version = "0.6.1+zstd.1.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5de55e77f798f205d8561b8fe2ef57abfb6e0ff2abe7fd3c089e119cdb5631a3" +dependencies = [ + "zstd-safe", +] + +[[package]] +name = "zstd-safe" +version = "3.0.1+zstd.1.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1387cabcd938127b30ce78c4bf00b30387dddf704e3f0881dbc4ff62b5566f8c" +dependencies = [ + "libc", + "zstd-sys", +] + +[[package]] +name = "zstd-sys" +version = "1.4.20+zstd.1.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebd5b733d7cf2d9447e2c3e76a5589b4f5e5ae065c22a2bc0b023cbc331b6c8e" +dependencies = [ + "cc", + "libc", +] diff --git a/primitives/enclave-api/Cargo.toml b/primitives/enclave-api/Cargo.toml index ec5cb6b1bd..84432b351b 100644 --- a/primitives/enclave-api/Cargo.toml +++ b/primitives/enclave-api/Cargo.toml @@ -10,4 +10,4 @@ codec = { package = "parity-scale-codec", version = "2.0.0", features = ["derive sgx_types = { rev = "v1.1.3", git = "https://github.com/apache/teaclave-sgx-sdk.git" } -frame-support = { git = "https://github.com/paritytech/substrate.git", version = "3.0.0" } \ No newline at end of file +frame-support = { version = "3.0.0", git = "https://github.com/paritytech/substrate.git", branch = "master" } \ No newline at end of file From 97550243a3d48ad1ab14ad20d6743834086a2e06 Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Fri, 25 Jun 2021 08:54:04 +0200 Subject: [PATCH 40/80] fix duplicate substrate deps --- Cargo.lock | 55 ++++++++++++++++++------------------ worker/rpc/server/Cargo.toml | 2 +- 2 files changed, 29 insertions(+), 28 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 401f8c86c3..f3af271131 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -935,18 +935,6 @@ version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" -[[package]] -name = "env_logger" -version = "0.7.1" -source = "git+https://github.com/mesalock-linux/env_logger-sgx#839ef5144497dd61e7a5dc99ace41c561b576f20" -dependencies = [ - "humantime 1.3.0 (git+https://github.com/mesalock-linux/humantime-sgx)", - "log 0.4.14 (git+https://github.com/mesalock-linux/log-sgx)", - "regex 1.3.1", - "sgx_tstd", - "termcolor 1.0.5", -] - [[package]] name = "env_logger" version = "0.7.1" @@ -960,6 +948,18 @@ dependencies = [ "termcolor 1.1.2", ] +[[package]] +name = "env_logger" +version = "0.7.1" +source = "git+https://github.com/mesalock-linux/env_logger-sgx#839ef5144497dd61e7a5dc99ace41c561b576f20" +dependencies = [ + "humantime 1.3.0 (git+https://github.com/mesalock-linux/humantime-sgx)", + "log 0.4.14 (git+https://github.com/mesalock-linux/log-sgx)", + "regex 1.3.1", + "sgx_tstd", + "termcolor 1.0.5", +] + [[package]] name = "env_logger" version = "0.8.4" @@ -1681,19 +1681,19 @@ checksum = "6456b8a6c8f33fee7d958fcd1b60d55b11940a79e63ae87013e6d22e26034440" [[package]] name = "humantime" version = "1.3.0" -source = "git+https://github.com/mesalock-linux/humantime-sgx#c5243dfa36002c01adbc9aade288ead1b2c411cc" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f" dependencies = [ - "quick-error 1.2.2", - "sgx_tstd", + "quick-error 1.2.3", ] [[package]] name = "humantime" version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f" +source = "git+https://github.com/mesalock-linux/humantime-sgx#c5243dfa36002c01adbc9aade288ead1b2c411cc" dependencies = [ - "quick-error 1.2.3", + "quick-error 1.2.2", + "sgx_tstd", ] [[package]] @@ -2400,20 +2400,20 @@ dependencies = [ [[package]] name = "log" version = "0.4.14" -source = "git+https://github.com/mesalock-linux/log-sgx#2ca9039a9ebba0ed90ed2ad57425917d4b3a2a24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" dependencies = [ "cfg-if 1.0.0", - "sgx_tstd", + "value-bag", ] [[package]] name = "log" version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" +source = "git+https://github.com/mesalock-linux/log-sgx#2ca9039a9ebba0ed90ed2ad57425917d4b3a2a24" dependencies = [ "cfg-if 1.0.0", - "value-bag", + "sgx_tstd", ] [[package]] @@ -4380,7 +4380,7 @@ dependencies = [ [[package]] name = "sgx-externalities" version = "0.3.0" -source = "git+https://github.com/scs/sgx-runtime#468f1eb1b9add37ff0265a917ae0acb4ce7db2e7" +source = "git+https://github.com/scs/sgx-runtime?branch=version-update#de9fc665a1e5268e53432841d642d61ddc793db2" dependencies = [ "environmental", "log 0.4.14 (git+https://github.com/mesalock-linux/log-sgx)", @@ -4393,7 +4393,7 @@ dependencies = [ [[package]] name = "sgx-runtime" version = "0.8.0" -source = "git+https://github.com/scs/sgx-runtime#468f1eb1b9add37ff0265a917ae0acb4ce7db2e7" +source = "git+https://github.com/scs/sgx-runtime?branch=version-update#de9fc665a1e5268e53432841d642d61ddc793db2" dependencies = [ "frame-executive", "frame-support", @@ -5109,7 +5109,7 @@ dependencies = [ [[package]] name = "sp-io" version = "3.1.0" -source = "git+https://github.com/scs/sgx-runtime#468f1eb1b9add37ff0265a917ae0acb4ce7db2e7" +source = "git+https://github.com/scs/sgx-runtime?branch=version-update#de9fc665a1e5268e53432841d642d61ddc793db2" dependencies = [ "environmental", "hash-db", @@ -5701,6 +5701,7 @@ dependencies = [ "parity-scale-codec 2.1.3", "sgx_tstd", "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-runtime", "substratee-node-runtime", ] @@ -5753,8 +5754,8 @@ dependencies = [ "frame-support", "frame-system", "hex 0.4.3", - "log 0.4.14 (git+https://github.com/mesalock-linux/log-sgx)", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.14 (git+https://github.com/mesalock-linux/log-sgx)", "pallet-balances", "parity-scale-codec 2.1.3", "sc-keystore", diff --git a/worker/rpc/server/Cargo.toml b/worker/rpc/server/Cargo.toml index 04b59de877..650647cec5 100644 --- a/worker/rpc/server/Cargo.toml +++ b/worker/rpc/server/Cargo.toml @@ -22,4 +22,4 @@ std = [] [dev-dependencies] env_logger = { version = "*" } -sp-core = { git = "https://github.com/paritytech/substrate.git" } \ No newline at end of file +sp-core = { git = "https://github.com/paritytech/substrate.git", branch = "master" } \ No newline at end of file From 3b3f801dff9e2bc2e65dade84410a8eef8e1d866 Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Fri, 25 Jun 2021 09:04:04 +0200 Subject: [PATCH 41/80] [primitives/node] define SignedBlock ourselves, as its no longer defined in the runtime --- Cargo.lock | 526 +++++++++++++------------------------ primitives/node/src/lib.rs | 2 +- 2 files changed, 182 insertions(+), 346 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f3af271131..e912d45dc3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -935,6 +935,18 @@ version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" +[[package]] +name = "env_logger" +version = "0.7.1" +source = "git+https://github.com/mesalock-linux/env_logger-sgx#839ef5144497dd61e7a5dc99ace41c561b576f20" +dependencies = [ + "humantime 1.3.0 (git+https://github.com/mesalock-linux/humantime-sgx)", + "log 0.4.14 (git+https://github.com/mesalock-linux/log-sgx)", + "regex 1.3.1", + "sgx_tstd", + "termcolor 1.0.5", +] + [[package]] name = "env_logger" version = "0.7.1" @@ -948,18 +960,6 @@ dependencies = [ "termcolor 1.1.2", ] -[[package]] -name = "env_logger" -version = "0.7.1" -source = "git+https://github.com/mesalock-linux/env_logger-sgx#839ef5144497dd61e7a5dc99ace41c561b576f20" -dependencies = [ - "humantime 1.3.0 (git+https://github.com/mesalock-linux/humantime-sgx)", - "log 0.4.14 (git+https://github.com/mesalock-linux/log-sgx)", - "regex 1.3.1", - "sgx_tstd", - "termcolor 1.0.5", -] - [[package]] name = "env_logger" version = "0.8.4" @@ -1110,7 +1110,7 @@ dependencies = [ [[package]] name = "frame-benchmarking" version = "3.1.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" +source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" dependencies = [ "frame-support", "frame-system", @@ -1121,9 +1121,9 @@ dependencies = [ "sp-api", "sp-io 3.0.0", "sp-runtime", - "sp-runtime-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", - "sp-storage 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-runtime-interface", + "sp-std", + "sp-storage", ] [[package]] @@ -1134,55 +1134,55 @@ dependencies = [ "frame-support", "frame-system", "parity-scale-codec 2.1.3", - "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-core", "sp-io 3.0.0", "sp-runtime", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", - "sp-tracing 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-std", + "sp-tracing", ] [[package]] name = "frame-metadata" version = "13.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" +source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" dependencies = [ "parity-scale-codec 2.1.3", "serde", - "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-core", + "sp-std", ] [[package]] name = "frame-support" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" +source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" dependencies = [ "bitflags", "frame-metadata", "frame-support-procedural", "impl-trait-for-tuples", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", - "max-encoded-len 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "max-encoded-len", "once_cell 1.8.0", "parity-scale-codec 2.1.3", "paste", "serde", "smallvec 1.6.1", "sp-arithmetic", - "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-core", "sp-inherents", "sp-io 3.0.0", "sp-runtime", "sp-staking", "sp-state-machine", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", - "sp-tracing 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-std", + "sp-tracing", ] [[package]] name = "frame-support-procedural" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" +source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" dependencies = [ "Inflector", "frame-support-procedural-tools", @@ -1194,7 +1194,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" +source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate 1.0.0", @@ -1206,7 +1206,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" +source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" dependencies = [ "proc-macro2", "quote 1.0.9", @@ -1216,17 +1216,17 @@ dependencies = [ [[package]] name = "frame-system" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" +source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" dependencies = [ "frame-support", "impl-trait-for-tuples", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", "parity-scale-codec 2.1.3", "serde", - "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-core", "sp-io 3.0.0", "sp-runtime", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-std", "sp-version", ] @@ -1681,19 +1681,19 @@ checksum = "6456b8a6c8f33fee7d958fcd1b60d55b11940a79e63ae87013e6d22e26034440" [[package]] name = "humantime" version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f" +source = "git+https://github.com/mesalock-linux/humantime-sgx#c5243dfa36002c01adbc9aade288ead1b2c411cc" dependencies = [ - "quick-error 1.2.3", + "quick-error 1.2.2", + "sgx_tstd", ] [[package]] name = "humantime" version = "1.3.0" -source = "git+https://github.com/mesalock-linux/humantime-sgx#c5243dfa36002c01adbc9aade288ead1b2c411cc" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f" dependencies = [ - "quick-error 1.2.2", - "sgx_tstd", + "quick-error 1.2.3", ] [[package]] @@ -1802,9 +1802,9 @@ dependencies = [ "frame-support", "parity-scale-codec 2.1.3", "serde_json", - "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-core", "sp-io 3.0.0", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-std", "webpki 0.21.0", ] @@ -2400,20 +2400,20 @@ dependencies = [ [[package]] name = "log" version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" +source = "git+https://github.com/mesalock-linux/log-sgx#2ca9039a9ebba0ed90ed2ad57425917d4b3a2a24" dependencies = [ "cfg-if 1.0.0", - "value-bag", + "sgx_tstd", ] [[package]] name = "log" version = "0.4.14" -source = "git+https://github.com/mesalock-linux/log-sgx#2ca9039a9ebba0ed90ed2ad57425917d4b3a2a24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" dependencies = [ "cfg-if 1.0.0", - "sgx_tstd", + "value-bag", ] [[package]] @@ -2452,21 +2452,10 @@ dependencies = [ [[package]] name = "max-encoded-len" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" -dependencies = [ - "impl-trait-for-tuples", - "max-encoded-len-derive 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", - "parity-scale-codec 2.1.3", - "primitive-types 0.9.0", -] - -[[package]] -name = "max-encoded-len" -version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git#bab9deca26db20bfc914263e0542a7a1b0d8f174" +source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" dependencies = [ "impl-trait-for-tuples", - "max-encoded-len-derive 3.0.0 (git+https://github.com/paritytech/substrate.git)", + "max-encoded-len-derive", "parity-scale-codec 2.1.3", "primitive-types 0.9.0", ] @@ -2474,18 +2463,7 @@ dependencies = [ [[package]] name = "max-encoded-len-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" -dependencies = [ - "proc-macro-crate 1.0.0", - "proc-macro2", - "quote 1.0.9", - "syn 1.0.73", -] - -[[package]] -name = "max-encoded-len-derive" -version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git#bab9deca26db20bfc914263e0542a7a1b0d8f174" +source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" dependencies = [ "proc-macro-crate 1.0.0", "proc-macro2", @@ -2968,7 +2946,7 @@ dependencies = [ "sp-application-crypto", "sp-consensus-aura", "sp-runtime", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-std", ] [[package]] @@ -2982,22 +2960,22 @@ dependencies = [ "parity-scale-codec 2.1.3", "sp-authorship", "sp-runtime", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-std", ] [[package]] name = "pallet-balances" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" +source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", - "max-encoded-len 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "max-encoded-len", "parity-scale-codec 2.1.3", "sp-runtime", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-std", ] [[package]] @@ -3013,13 +2991,13 @@ dependencies = [ "pallet-session", "parity-scale-codec 2.1.3", "sp-application-crypto", - "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-core", "sp-finality-grandpa", "sp-io 3.0.0", "sp-runtime", "sp-session", "sp-staking", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-std", ] [[package]] @@ -3032,7 +3010,7 @@ dependencies = [ "parity-scale-codec 2.1.3", "safe-mix", "sp-runtime", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-std", ] [[package]] @@ -3046,12 +3024,12 @@ dependencies = [ "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", "pallet-timestamp", "parity-scale-codec 2.1.3", - "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-core", "sp-io 3.0.0", "sp-runtime", "sp-session", "sp-staking", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-std", "sp-trie", ] @@ -3067,10 +3045,10 @@ dependencies = [ "pallet-timestamp", "parity-scale-codec 2.1.3", "serde", - "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-core", "sp-io 3.0.0", "sp-runtime", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-std", ] [[package]] @@ -3083,7 +3061,7 @@ dependencies = [ "parity-scale-codec 2.1.3", "sp-io 3.0.0", "sp-runtime", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-std", ] [[package]] @@ -3099,7 +3077,7 @@ dependencies = [ "parity-scale-codec 2.1.3", "sp-inherents", "sp-runtime", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-std", "sp-timestamp", ] @@ -3113,10 +3091,10 @@ dependencies = [ "parity-scale-codec 2.1.3", "serde", "smallvec 1.6.1", - "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-core", "sp-io 3.0.0", "sp-runtime", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-std", ] [[package]] @@ -4157,7 +4135,7 @@ dependencies = [ [[package]] name = "sc-keystore" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" +source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" dependencies = [ "async-trait", "derive_more", @@ -4169,7 +4147,7 @@ dependencies = [ "rand 0.7.3", "serde_json", "sp-application-crypto", - "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-core", "sp-keystore", "subtle 2.4.0", ] @@ -4177,7 +4155,7 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" +source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" dependencies = [ "derive_more", "futures 0.3.15", @@ -4191,10 +4169,10 @@ dependencies = [ "serde", "serde_json", "sp-chain-spec", - "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-core", "sp-rpc", "sp-runtime", - "sp-tracing 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-tracing", "sp-transaction-pool", "sp-version", ] @@ -4411,12 +4389,12 @@ dependencies = [ "sp-api", "sp-block-builder", "sp-consensus-aura", - "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-core", "sp-inherents", "sp-offchain", "sp-runtime", "sp-session", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-std", "sp-transaction-pool", "sp-version", ] @@ -4751,16 +4729,16 @@ dependencies = [ [[package]] name = "sp-api" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" +source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" dependencies = [ "hash-db", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", "parity-scale-codec 2.1.3", "sp-api-proc-macro", - "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-core", "sp-runtime", "sp-state-machine", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-std", "sp-version", "thiserror", ] @@ -4768,7 +4746,7 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" +source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" dependencies = [ "blake2-rfc", "proc-macro-crate 1.0.0", @@ -4780,27 +4758,27 @@ dependencies = [ [[package]] name = "sp-application-crypto" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" +source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" dependencies = [ - "max-encoded-len 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "max-encoded-len", "parity-scale-codec 2.1.3", "serde", - "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-core", "sp-io 3.0.0", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-std", ] [[package]] name = "sp-arithmetic" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" +source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" dependencies = [ "integer-sqrt", "num-traits", "parity-scale-codec 2.1.3", "serde", - "sp-debug-derive 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-debug-derive", + "sp-std", "static_assertions", ] @@ -4813,7 +4791,7 @@ dependencies = [ "parity-scale-codec 2.1.3", "sp-inherents", "sp-runtime", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-std", ] [[package]] @@ -4825,13 +4803,13 @@ dependencies = [ "sp-api", "sp-inherents", "sp-runtime", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-std", ] [[package]] name = "sp-blockchain" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" +source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" dependencies = [ "futures 0.3.15", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4849,7 +4827,7 @@ dependencies = [ [[package]] name = "sp-chain-spec" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" +source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" dependencies = [ "serde", "serde_json", @@ -4858,7 +4836,7 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" +source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" dependencies = [ "async-trait", "futures 0.3.15", @@ -4869,11 +4847,11 @@ dependencies = [ "parking_lot 0.11.1", "serde", "sp-api", - "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-core", "sp-inherents", "sp-runtime", "sp-state-machine", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-std", "sp-trie", "sp-utils", "sp-version", @@ -4895,7 +4873,7 @@ dependencies = [ "sp-consensus-slots", "sp-inherents", "sp-runtime", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-std", "sp-timestamp", ] @@ -4912,52 +4890,7 @@ dependencies = [ [[package]] name = "sp-core" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" -dependencies = [ - "base58", - "blake2-rfc", - "byteorder", - "dyn-clonable", - "ed25519-dalek", - "futures 0.3.15", - "hash-db", - "hash256-std-hasher", - "hex 0.4.3", - "impl-serde", - "lazy_static", - "libsecp256k1", - "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", - "max-encoded-len 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", - "merlin", - "num-traits", - "parity-scale-codec 2.1.3", - "parity-util-mem", - "parking_lot 0.11.1", - "primitive-types 0.9.0", - "rand 0.7.3", - "regex 1.5.4", - "schnorrkel", - "secrecy", - "serde", - "sha2 0.9.5", - "sp-debug-derive 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", - "sp-externalities 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=master)", - "sp-runtime-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", - "sp-storage 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", - "substrate-bip39", - "thiserror", - "tiny-bip39 0.8.0", - "tiny-keccak 2.0.2", - "twox-hash", - "wasmi", - "zeroize", -] - -[[package]] -name = "sp-core" -version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git#bab9deca26db20bfc914263e0542a7a1b0d8f174" +source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" dependencies = [ "base58", "blake2-rfc", @@ -4972,7 +4905,7 @@ dependencies = [ "lazy_static", "libsecp256k1", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", - "max-encoded-len 3.0.0 (git+https://github.com/paritytech/substrate.git)", + "max-encoded-len", "merlin", "num-traits", "parity-scale-codec 2.1.3", @@ -4985,11 +4918,11 @@ dependencies = [ "secrecy", "serde", "sha2 0.9.5", - "sp-debug-derive 3.0.0 (git+https://github.com/paritytech/substrate.git)", - "sp-externalities 0.9.0 (git+https://github.com/paritytech/substrate.git)", - "sp-runtime-interface 3.0.0 (git+https://github.com/paritytech/substrate.git)", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git)", - "sp-storage 3.0.0 (git+https://github.com/paritytech/substrate.git)", + "sp-debug-derive", + "sp-externalities", + "sp-runtime-interface", + "sp-std", + "sp-storage", "substrate-bip39", "thiserror", "tiny-bip39 0.8.0", @@ -5002,7 +4935,7 @@ dependencies = [ [[package]] name = "sp-database" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" +source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" dependencies = [ "kvdb", "parking_lot 0.11.1", @@ -5011,17 +4944,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" -dependencies = [ - "proc-macro2", - "quote 1.0.9", - "syn 1.0.73", -] - -[[package]] -name = "sp-debug-derive" -version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git#bab9deca26db20bfc914263e0542a7a1b0d8f174" +source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" dependencies = [ "proc-macro2", "quote 1.0.9", @@ -5031,23 +4954,12 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" -dependencies = [ - "environmental", - "parity-scale-codec 2.1.3", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", - "sp-storage 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", -] - -[[package]] -name = "sp-externalities" -version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git#bab9deca26db20bfc914263e0542a7a1b0d8f174" +source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" dependencies = [ "environmental", "parity-scale-codec 2.1.3", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git)", - "sp-storage 3.0.0 (git+https://github.com/paritytech/substrate.git)", + "sp-std", + "sp-storage", ] [[package]] @@ -5061,30 +4973,30 @@ dependencies = [ "serde", "sp-api", "sp-application-crypto", - "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-core", "sp-keystore", "sp-runtime", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-std", ] [[package]] name = "sp-inherents" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" +source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" dependencies = [ "async-trait", "impl-trait-for-tuples", "parity-scale-codec 2.1.3", - "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-core", "sp-runtime", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-std", "thiserror", ] [[package]] name = "sp-io" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" +source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" dependencies = [ "futures 0.3.15", "hash-db", @@ -5092,16 +5004,16 @@ dependencies = [ "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", "parity-scale-codec 2.1.3", "parking_lot 0.11.1", - "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", - "sp-externalities 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-core", + "sp-externalities", "sp-keystore", "sp-maybe-compressed-blob", - "sp-runtime-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-runtime-interface", "sp-state-machine", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", - "sp-tracing 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-std", + "sp-tracing", "sp-trie", - "sp-wasm-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-wasm-interface", "tracing", "tracing-core", ] @@ -5118,11 +5030,11 @@ dependencies = [ "sgx-externalities", "sgx_tstd", "sgx_types", - "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", - "sp-runtime-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", - "sp-tracing 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", - "sp-wasm-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-core", + "sp-runtime-interface", + "sp-std", + "sp-tracing", + "sp-wasm-interface", "tracing", "tracing-core", ] @@ -5130,10 +5042,10 @@ dependencies = [ [[package]] name = "sp-keyring" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" +source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" dependencies = [ "lazy_static", - "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-core", "sp-runtime", "strum", ] @@ -5141,7 +5053,7 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" +source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" dependencies = [ "async-trait", "derive_more", @@ -5151,14 +5063,14 @@ dependencies = [ "parking_lot 0.11.1", "schnorrkel", "serde", - "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", - "sp-externalities 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-core", + "sp-externalities", ] [[package]] name = "sp-maybe-compressed-blob" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" +source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" dependencies = [ "ruzstd", "zstd", @@ -5170,14 +5082,14 @@ version = "3.0.0" source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" dependencies = [ "sp-api", - "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-core", "sp-runtime", ] [[package]] name = "sp-panic-handler" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" +source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" dependencies = [ "backtrace", ] @@ -5185,24 +5097,24 @@ dependencies = [ [[package]] name = "sp-rpc" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" +source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" dependencies = [ "rustc-hash", "serde", - "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-core", "tracing-core", ] [[package]] name = "sp-runtime" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" +source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" dependencies = [ "either", "hash256-std-hasher", "impl-trait-for-tuples", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", - "max-encoded-len 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "max-encoded-len", "parity-scale-codec 2.1.3", "parity-util-mem", "paste", @@ -5210,61 +5122,32 @@ dependencies = [ "serde", "sp-application-crypto", "sp-arithmetic", - "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-core", "sp-io 3.0.0", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", -] - -[[package]] -name = "sp-runtime-interface" -version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" -dependencies = [ - "impl-trait-for-tuples", - "parity-scale-codec 2.1.3", - "primitive-types 0.9.0", - "sp-externalities 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=master)", - "sp-runtime-interface-proc-macro 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", - "sp-storage 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", - "sp-tracing 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", - "sp-wasm-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", - "static_assertions", + "sp-std", ] [[package]] name = "sp-runtime-interface" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git#bab9deca26db20bfc914263e0542a7a1b0d8f174" +source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec 2.1.3", "primitive-types 0.9.0", - "sp-externalities 0.9.0 (git+https://github.com/paritytech/substrate.git)", - "sp-runtime-interface-proc-macro 3.0.0 (git+https://github.com/paritytech/substrate.git)", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git)", - "sp-storage 3.0.0 (git+https://github.com/paritytech/substrate.git)", - "sp-tracing 3.0.0 (git+https://github.com/paritytech/substrate.git)", - "sp-wasm-interface 3.0.0 (git+https://github.com/paritytech/substrate.git)", + "sp-externalities", + "sp-runtime-interface-proc-macro", + "sp-std", + "sp-storage", + "sp-tracing", + "sp-wasm-interface", "static_assertions", ] [[package]] name = "sp-runtime-interface-proc-macro" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" -dependencies = [ - "Inflector", - "proc-macro-crate 1.0.0", - "proc-macro2", - "quote 1.0.9", - "syn 1.0.73", -] - -[[package]] -name = "sp-runtime-interface-proc-macro" -version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git#bab9deca26db20bfc914263e0542a7a1b0d8f174" +source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" dependencies = [ "Inflector", "proc-macro-crate 1.0.0", @@ -5280,26 +5163,26 @@ source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f17 dependencies = [ "parity-scale-codec 2.1.3", "sp-api", - "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-core", "sp-runtime", "sp-staking", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-std", ] [[package]] name = "sp-staking" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" +source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" dependencies = [ "parity-scale-codec 2.1.3", "sp-runtime", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-std", ] [[package]] name = "sp-state-machine" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" +source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" dependencies = [ "hash-db", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", @@ -5308,10 +5191,10 @@ dependencies = [ "parking_lot 0.11.1", "rand 0.7.3", "smallvec 1.6.1", - "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", - "sp-externalities 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-core", + "sp-externalities", "sp-panic-handler", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-std", "sp-trie", "thiserror", "tracing", @@ -5322,37 +5205,19 @@ dependencies = [ [[package]] name = "sp-std" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" - -[[package]] -name = "sp-std" -version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git#bab9deca26db20bfc914263e0542a7a1b0d8f174" - -[[package]] -name = "sp-storage" -version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" -dependencies = [ - "impl-serde", - "parity-scale-codec 2.1.3", - "ref-cast", - "serde", - "sp-debug-derive 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", -] +source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" [[package]] name = "sp-storage" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git#bab9deca26db20bfc914263e0542a7a1b0d8f174" +source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" dependencies = [ "impl-serde", "parity-scale-codec 2.1.3", "ref-cast", "serde", - "sp-debug-derive 3.0.0 (git+https://github.com/paritytech/substrate.git)", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git)", + "sp-debug-derive", + "sp-std", ] [[package]] @@ -5367,7 +5232,7 @@ dependencies = [ "sp-api", "sp-inherents", "sp-runtime", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-std", "thiserror", "wasm-timer", ] @@ -5375,25 +5240,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" -dependencies = [ - "erased-serde", - "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-scale-codec 2.1.3", - "parking_lot 0.10.2", - "serde", - "serde_json", - "slog", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", - "tracing", - "tracing-core", - "tracing-subscriber", -] - -[[package]] -name = "sp-tracing" -version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git#bab9deca26db20bfc914263e0542a7a1b0d8f174" +source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" dependencies = [ "erased-serde", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", @@ -5402,7 +5249,7 @@ dependencies = [ "serde", "serde_json", "slog", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git)", + "sp-std", "tracing", "tracing-core", "tracing-subscriber", @@ -5411,7 +5258,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" +source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" dependencies = [ "derive_more", "futures 0.3.15", @@ -5427,13 +5274,13 @@ dependencies = [ [[package]] name = "sp-trie" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" +source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" dependencies = [ "hash-db", "memory-db", "parity-scale-codec 2.1.3", - "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-core", + "sp-std", "trie-db", "trie-root", ] @@ -5441,7 +5288,7 @@ dependencies = [ [[package]] name = "sp-utils" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" +source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" dependencies = [ "futures 0.3.15", "futures-core", @@ -5453,20 +5300,20 @@ dependencies = [ [[package]] name = "sp-version" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" +source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" dependencies = [ "impl-serde", "parity-scale-codec 2.1.3", "serde", "sp-runtime", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-std", "sp-version-proc-macro", ] [[package]] name = "sp-version-proc-macro" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" +source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" dependencies = [ "parity-scale-codec 2.1.3", "proc-macro-crate 1.0.0", @@ -5478,22 +5325,11 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" -dependencies = [ - "impl-trait-for-tuples", - "parity-scale-codec 2.1.3", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", - "wasmi", -] - -[[package]] -name = "sp-wasm-interface" -version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git#bab9deca26db20bfc914263e0542a7a1b0d8f174" +source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec 2.1.3", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git)", + "sp-std", "wasmi", ] @@ -5566,9 +5402,9 @@ dependencies = [ "sc-rpc-api", "serde", "serde_json", - "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-core", "sp-runtime", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-std", "sp-version", "thiserror", "ws 0.9.1", @@ -5598,7 +5434,7 @@ dependencies = [ "sc-keystore", "serde_json", "sp-application-crypto", - "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-core", "sp-keyring", "sp-keystore", ] @@ -5606,7 +5442,7 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#bab9deca26db20bfc914263e0542a7a1b0d8f174" +source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" dependencies = [ "async-std", "derive_more", @@ -5638,7 +5474,7 @@ name = "substratee-api-client-extensions" version = "0.8.0" dependencies = [ "parity-scale-codec 2.1.3", - "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-core", "sp-finality-grandpa", "sp-runtime", "substrate-api-client", @@ -5668,7 +5504,7 @@ dependencies = [ "serde_json", "sgx_crypto_helper", "sp-application-crypto", - "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-core", "sp-keyring", "sp-runtime", "substrate-api-client", @@ -5700,7 +5536,7 @@ version = "0.8.0" dependencies = [ "parity-scale-codec 2.1.3", "sgx_tstd", - "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-core", "sp-runtime", "substratee-node-runtime", ] @@ -5727,12 +5563,12 @@ dependencies = [ "sp-api", "sp-block-builder", "sp-consensus-aura", - "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-core", "sp-inherents", "sp-offchain", "sp-runtime", "sp-session", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-std", "sp-transaction-pool", "sp-version", "substrate-wasm-builder", @@ -5754,8 +5590,8 @@ dependencies = [ "frame-support", "frame-system", "hex 0.4.3", - "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.14 (git+https://github.com/mesalock-linux/log-sgx)", + "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", "pallet-balances", "parity-scale-codec 2.1.3", "sc-keystore", @@ -5764,7 +5600,7 @@ dependencies = [ "sgx-runtime", "sgx_tstd", "sp-application-crypto", - "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-core", "sp-io 3.1.0", "sp-keyring", "sp-runtime", @@ -5805,7 +5641,7 @@ dependencies = [ "sgx_types", "sgx_urts", "sha2 0.7.1", - "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-core", "sp-finality-grandpa", "sp-keyring", "sp-runtime", @@ -5848,7 +5684,7 @@ dependencies = [ "serde_derive", "serde_json", "sgx_tstd", - "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-core", "sp-keyring", "sp-runtime", ] @@ -5863,7 +5699,7 @@ dependencies = [ "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", "parity-scale-codec 2.1.3", "serde_json", - "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git)", + "sp-core", "substratee-enclave-api", "substratee-worker-primitives", "tokio 1.7.1", diff --git a/primitives/node/src/lib.rs b/primitives/node/src/lib.rs index 0a9ad48ff4..2880668c2c 100644 --- a/primitives/node/src/lib.rs +++ b/primitives/node/src/lib.rs @@ -17,7 +17,7 @@ pub type PalletString = Vec; pub type PalletString = String; #[cfg(feature = "std")] -pub use my_node_runtime::SignedBlock; +pub type SignedBlock = sp_runtime::generic::SignedBlock; pub use sp_core::crypto::AccountId32 as AccountId; From 30c657fbf5d92debb57680dc11237c011667e7cf Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Fri, 25 Jun 2021 09:22:18 +0200 Subject: [PATCH 42/80] [worker & clien] update code for version bumps --- worker/src/main.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/worker/src/main.rs b/worker/src/main.rs index c1e39a0b4f..00a97c20a1 100644 --- a/worker/src/main.rs +++ b/worker/src/main.rs @@ -34,7 +34,7 @@ use codec::{Decode, Encode}; use lazy_static::lazy_static; use log::*; use my_node_runtime::{ - substratee_registry::ShardIdentifier, Event, Hash, Header, UncheckedExtrinsic + substratee_registry::ShardIdentifier, Event, Hash, Header }; use parking_lot::RwLock; use sp_core::{ @@ -58,6 +58,7 @@ use std::time::{Duration, SystemTime}; use substratee_api_client_extensions::{AccountApi, ChainApi}; use substratee_worker_primitives::block::SignedBlock as SignedSidechainBlock; +use substratee_node_primitives::SignedBlock; use substratee_enclave_api::{Enclave, EnclaveApi}; use substratee_worker_rpc_server::{RpcServer}; use substratee_node_primitives::SignedBlock; From 7fe17d78c5329f1c6cc08f83ce32fdf479780517 Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Fri, 25 Jun 2021 09:48:58 +0200 Subject: [PATCH 43/80] [enclave] bump deps --- enclave/Cargo.lock | 36 ++++++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/enclave/Cargo.lock b/enclave/Cargo.lock index 76446c073f..84677d9a85 100644 --- a/enclave/Cargo.lock +++ b/enclave/Cargo.lock @@ -1,7 +1,5 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 - [[package]] name = "Inflector" version = "0.11.4" @@ -973,16 +971,22 @@ dependencies = [ "sgx_tstd", ] +[[package]] +name = "itoa" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736" + [[package]] name = "jsonrpc-core" version = "16.1.0" -source = "git+https://github.com/scs/jsonrpc?branch=no_std#9c9f399f801f68636e56c973654424f2ac2747fb" +source = "git+https://github.com/scs/jsonrpc?branch=no_std#e5ee60bc30dedf513743843be2523dc384bbcae1" dependencies = [ "futures 0.3.8", "log", "serde 1.0.118", "serde_derive", - "serde_json", + "serde_json 1.0.60", "sp-std", ] @@ -1867,16 +1871,27 @@ name = "serde_json" version = "1.0.60" source = "git+https://github.com/mesalock-linux/serde-json-sgx#380893814ad2a057758d825bab798aa117f7362a" dependencies = [ - "itoa", + "itoa 0.4.5", "ryu", "serde 1.0.118", "sgx_tstd", ] +[[package]] +name = "serde_json" +version = "1.0.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "799e97dc9fdae36a5c8b8f2cae9ce2ee9fdce2058c57a93e6099d919fd982f79" +dependencies = [ + "itoa 0.4.7", + "ryu", + "serde 1.0.126", +] + [[package]] name = "sgx-externalities" version = "0.3.0" -source = "git+https://github.com/scs/sgx-runtime?branch=master#bb0b6a206006299ab773a375197c4846a4c83a30" +source = "git+https://github.com/scs/sgx-runtime?branch=version-update#de9fc665a1e5268e53432841d642d61ddc793db2" dependencies = [ "environmental", "log", @@ -1889,7 +1904,7 @@ dependencies = [ [[package]] name = "sgx-runtime" version = "0.8.0" -source = "git+https://github.com/scs/sgx-runtime?branch=master#bb0b6a206006299ab773a375197c4846a4c83a30" +source = "git+https://github.com/scs/sgx-runtime?branch=version-update#de9fc665a1e5268e53432841d642d61ddc793db2" dependencies = [ "frame-executive", "frame-support", @@ -2334,7 +2349,7 @@ dependencies = [ [[package]] name = "sp-io" version = "3.1.0" -source = "git+https://github.com/scs/sgx-runtime?branch=master#bb0b6a206006299ab773a375197c4846a4c83a30" +source = "git+https://github.com/scs/sgx-runtime?branch=version-update#de9fc665a1e5268e53432841d642d61ddc793db2" dependencies = [ "environmental", "hash-db", @@ -2563,7 +2578,7 @@ dependencies = [ [[package]] name = "substrate-api-client" version = "0.6.0" -source = "git+https://github.com/scs/substrate-api-client?branch=master#731a3a5c3a16ed3ce7f1f6b50593a2cdfd08a39f" +source = "git+https://github.com/scs/substrate-api-client?branch=master#3c8c04cd785b383dfbacb48a374503e644d13a08" dependencies = [ "frame-metadata", "frame-support", @@ -2639,7 +2654,7 @@ dependencies = [ "rustls", "serde 1.0.118", "serde_derive", - "serde_json", + "serde_json 1.0.60", "sgx-externalities", "sgx_rand", "sgx_serialize", @@ -2677,6 +2692,7 @@ dependencies = [ "chrono 0.4.19", "parity-scale-codec", "primitive-types", + "serde_json 1.0.64", "sgx_tstd", "sp-core", "sp-runtime", From 6c49c56a08236419cb1ecec08af9508b8a44e969 Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Fri, 25 Jun 2021 10:39:14 +0200 Subject: [PATCH 44/80] Cargo.lock (fmt changes after rustc update) --- enclave/Cargo.lock | 83 +++++++++++++++++++++++++--------------------- 1 file changed, 45 insertions(+), 38 deletions(-) diff --git a/enclave/Cargo.lock b/enclave/Cargo.lock index 84677d9a85..e8604055d6 100644 --- a/enclave/Cargo.lock +++ b/enclave/Cargo.lock @@ -1,5 +1,7 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. +version = 3 + [[package]] name = "Inflector" version = "0.11.4" @@ -505,7 +507,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", "sp-tracing", ] @@ -516,7 +518,7 @@ source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f17 dependencies = [ "parity-scale-codec", "sp-core", - "sp-std", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", ] [[package]] @@ -539,7 +541,7 @@ dependencies = [ "sp-io", "sp-runtime", "sp-staking", - "sp-std", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", "sp-tracing", ] @@ -589,7 +591,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", "sp-version", ] @@ -987,7 +989,7 @@ dependencies = [ "serde 1.0.118", "serde_derive", "serde_json 1.0.60", - "sp-std", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git)", ] [[package]] @@ -1281,7 +1283,7 @@ dependencies = [ "sp-application-crypto", "sp-consensus-aura", "sp-runtime", - "sp-std", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", ] [[package]] @@ -1295,7 +1297,7 @@ dependencies = [ "parity-scale-codec", "sp-authorship", "sp-runtime", - "sp-std", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", ] [[package]] @@ -1309,7 +1311,7 @@ dependencies = [ "max-encoded-len", "parity-scale-codec", "sp-runtime", - "sp-std", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", ] [[package]] @@ -1330,7 +1332,7 @@ dependencies = [ "sp-runtime", "sp-session", "sp-staking", - "sp-std", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", ] [[package]] @@ -1343,7 +1345,7 @@ dependencies = [ "parity-scale-codec", "safe-mix", "sp-runtime", - "sp-std", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", ] [[package]] @@ -1362,7 +1364,7 @@ dependencies = [ "sp-runtime", "sp-session", "sp-staking", - "sp-std", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", ] [[package]] @@ -1375,7 +1377,7 @@ dependencies = [ "parity-scale-codec", "sp-io", "sp-runtime", - "sp-std", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", ] [[package]] @@ -1390,7 +1392,7 @@ dependencies = [ "parity-scale-codec", "sp-inherents", "sp-runtime", - "sp-std", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", "sp-timestamp", ] @@ -1406,7 +1408,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", ] [[package]] @@ -1927,7 +1929,7 @@ dependencies = [ "sp-offchain", "sp-runtime", "sp-session", - "sp-std", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", "sp-transaction-pool", "sp-version", ] @@ -2191,7 +2193,7 @@ dependencies = [ "sp-api-proc-macro", "sp-core", "sp-runtime", - "sp-std", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", "sp-version", ] @@ -2216,7 +2218,7 @@ dependencies = [ "parity-scale-codec", "sp-core", "sp-io", - "sp-std", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", ] [[package]] @@ -2228,7 +2230,7 @@ dependencies = [ "num-traits 0.2.14", "parity-scale-codec", "sp-debug-derive", - "sp-std", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", "static_assertions", ] @@ -2240,7 +2242,7 @@ dependencies = [ "parity-scale-codec", "sp-inherents", "sp-runtime", - "sp-std", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", ] [[package]] @@ -2252,7 +2254,7 @@ dependencies = [ "sp-api", "sp-inherents", "sp-runtime", - "sp-std", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", ] [[package]] @@ -2266,7 +2268,7 @@ dependencies = [ "sp-consensus-slots", "sp-inherents", "sp-runtime", - "sp-std", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", "sp-timestamp", ] @@ -2304,7 +2306,7 @@ dependencies = [ "sha2 0.9.5", "sp-debug-derive", "sp-runtime-interface", - "sp-std", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", "sp-storage", "tiny-keccak", "twox-hash", @@ -2332,7 +2334,7 @@ dependencies = [ "sp-application-crypto", "sp-core", "sp-runtime", - "sp-std", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", ] [[package]] @@ -2343,7 +2345,7 @@ dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", "sp-core", - "sp-std", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", ] [[package]] @@ -2360,7 +2362,7 @@ dependencies = [ "sgx_types", "sp-core", "sp-runtime-interface", - "sp-std", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", "sp-tracing", "sp-wasm-interface", "tracing", @@ -2394,7 +2396,7 @@ dependencies = [ "sp-arithmetic", "sp-core", "sp-io", - "sp-std", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", ] [[package]] @@ -2406,7 +2408,7 @@ dependencies = [ "parity-scale-codec", "primitive-types", "sp-runtime-interface-proc-macro", - "sp-std", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", "sp-storage", "sp-tracing", "sp-wasm-interface", @@ -2434,7 +2436,7 @@ dependencies = [ "sp-api", "sp-core", "sp-staking", - "sp-std", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", ] [[package]] @@ -2444,7 +2446,7 @@ source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f17 dependencies = [ "parity-scale-codec", "sp-runtime", - "sp-std", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", ] [[package]] @@ -2452,6 +2454,11 @@ name = "sp-std" version = "3.0.0" source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" +[[package]] +name = "sp-std" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git#8a9a8f170f556beb7c86e996f0576ae3df632f9b" + [[package]] name = "sp-storage" version = "3.0.0" @@ -2460,7 +2467,7 @@ dependencies = [ "parity-scale-codec", "ref-cast", "sp-debug-derive", - "sp-std", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", ] [[package]] @@ -2472,7 +2479,7 @@ dependencies = [ "sp-api", "sp-inherents", "sp-runtime", - "sp-std", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", ] [[package]] @@ -2481,7 +2488,7 @@ version = "3.0.0" source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" dependencies = [ "parity-scale-codec", - "sp-std", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", "tracing", "tracing-core", ] @@ -2504,7 +2511,7 @@ dependencies = [ "memory-db", "parity-scale-codec", "sp-core", - "sp-std", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", "trie-db", "trie-root", ] @@ -2528,7 +2535,7 @@ source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f17 dependencies = [ "parity-scale-codec", "sp-runtime", - "sp-std", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", "sp-version-proc-macro", ] @@ -2551,7 +2558,7 @@ source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f17 dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", - "sp-std", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", ] [[package]] @@ -2578,7 +2585,7 @@ dependencies = [ [[package]] name = "substrate-api-client" version = "0.6.0" -source = "git+https://github.com/scs/substrate-api-client?branch=master#3c8c04cd785b383dfbacb48a374503e644d13a08" +source = "git+https://github.com/scs/substrate-api-client?branch=fix-hex-crate#b76eb4603ded4a9bc88b37806e67e519e4071e62" dependencies = [ "frame-metadata", "frame-support", @@ -2586,7 +2593,7 @@ dependencies = [ "parity-scale-codec", "sp-core", "sp-runtime", - "sp-std", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", ] [[package]] @@ -2672,7 +2679,7 @@ dependencies = [ "sp-finality-grandpa", "sp-io", "sp-runtime", - "sp-std", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", "sp-utils", "sp-version", "substrate-api-client", From 253e02c41e9b9043ecee39ae3c0521abf52e0e35 Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Fri, 25 Jun 2021 11:42:34 +0200 Subject: [PATCH 45/80] Cargo.lock after rebase on `bump-deps` branch. --- Cargo.lock | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e912d45dc3..a6c54d5414 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -935,18 +935,6 @@ version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" -[[package]] -name = "env_logger" -version = "0.7.1" -source = "git+https://github.com/mesalock-linux/env_logger-sgx#839ef5144497dd61e7a5dc99ace41c561b576f20" -dependencies = [ - "humantime 1.3.0 (git+https://github.com/mesalock-linux/humantime-sgx)", - "log 0.4.14 (git+https://github.com/mesalock-linux/log-sgx)", - "regex 1.3.1", - "sgx_tstd", - "termcolor 1.0.5", -] - [[package]] name = "env_logger" version = "0.7.1" @@ -960,6 +948,18 @@ dependencies = [ "termcolor 1.1.2", ] +[[package]] +name = "env_logger" +version = "0.7.1" +source = "git+https://github.com/mesalock-linux/env_logger-sgx#839ef5144497dd61e7a5dc99ace41c561b576f20" +dependencies = [ + "humantime 1.3.0 (git+https://github.com/mesalock-linux/humantime-sgx)", + "log 0.4.14 (git+https://github.com/mesalock-linux/log-sgx)", + "regex 1.3.1", + "sgx_tstd", + "termcolor 1.0.5", +] + [[package]] name = "env_logger" version = "0.8.4" @@ -1681,19 +1681,19 @@ checksum = "6456b8a6c8f33fee7d958fcd1b60d55b11940a79e63ae87013e6d22e26034440" [[package]] name = "humantime" version = "1.3.0" -source = "git+https://github.com/mesalock-linux/humantime-sgx#c5243dfa36002c01adbc9aade288ead1b2c411cc" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f" dependencies = [ - "quick-error 1.2.2", - "sgx_tstd", + "quick-error 1.2.3", ] [[package]] name = "humantime" version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f" +source = "git+https://github.com/mesalock-linux/humantime-sgx#c5243dfa36002c01adbc9aade288ead1b2c411cc" dependencies = [ - "quick-error 1.2.3", + "quick-error 1.2.2", + "sgx_tstd", ] [[package]] @@ -2400,20 +2400,20 @@ dependencies = [ [[package]] name = "log" version = "0.4.14" -source = "git+https://github.com/mesalock-linux/log-sgx#2ca9039a9ebba0ed90ed2ad57425917d4b3a2a24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" dependencies = [ "cfg-if 1.0.0", - "sgx_tstd", + "value-bag", ] [[package]] name = "log" version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" +source = "git+https://github.com/mesalock-linux/log-sgx#2ca9039a9ebba0ed90ed2ad57425917d4b3a2a24" dependencies = [ "cfg-if 1.0.0", - "value-bag", + "sgx_tstd", ] [[package]] @@ -5590,8 +5590,8 @@ dependencies = [ "frame-support", "frame-system", "hex 0.4.3", - "log 0.4.14 (git+https://github.com/mesalock-linux/log-sgx)", "log 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.14 (git+https://github.com/mesalock-linux/log-sgx)", "pallet-balances", "parity-scale-codec 2.1.3", "sc-keystore", From 720dc51490565876f3b5791b799d9ce396a53f00 Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Fri, 25 Jun 2021 11:44:11 +0200 Subject: [PATCH 46/80] fix minor rebase errors --- worker/src/main.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/worker/src/main.rs b/worker/src/main.rs index 00a97c20a1..1faafe39b2 100644 --- a/worker/src/main.rs +++ b/worker/src/main.rs @@ -60,8 +60,6 @@ use substratee_api_client_extensions::{AccountApi, ChainApi}; use substratee_worker_primitives::block::SignedBlock as SignedSidechainBlock; use substratee_node_primitives::SignedBlock; use substratee_enclave_api::{Enclave, EnclaveApi}; -use substratee_worker_rpc_server::{RpcServer}; -use substratee_node_primitives::SignedBlock; use substratee_worker_api::direct_client::DirectClient; use config::Config; From fb2562c846b56a3af1f60a53763e09a77d0c7f2d Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Fri, 25 Jun 2021 13:53:55 +0200 Subject: [PATCH 47/80] [local-setup] prevent nonce clash while bootstrapping the enclaves. --- local-setup/launch.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/local-setup/launch.py b/local-setup/launch.py index ca0654cfbd..12925aae66 100755 --- a/local-setup/launch.py +++ b/local-setup/launch.py @@ -4,6 +4,7 @@ """ import signal from subprocess import Popen, STDOUT +from time import sleep from typing import Union, IO from py.worker import Worker @@ -40,6 +41,9 @@ def main(processes): print('Starting worker 1 in background') processes.append(w1.run_in_background(log_file=worker1_log, flags=['-P', '2001'], subcommand_flags=['--skip-ra'])) + + # prevent nonce clash, when bootstrapping the enclave's account + sleep(5) print('Starting worker 2 in background') processes.append(w2.run_in_background(log_file=worker2_log, subcommand_flags=['--skip-ra'])) # keep script alive until terminated From 8d5cdd05322861e043c0b3703c74da2787b6bc2e Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Fri, 25 Jun 2021 14:26:44 +0200 Subject: [PATCH 48/80] [local-setup] port setup --- local-setup/launch.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/local-setup/launch.py b/local-setup/launch.py index 12925aae66..3bb8de87d6 100755 --- a/local-setup/launch.py +++ b/local-setup/launch.py @@ -40,12 +40,12 @@ def main(processes): w2 = setup_worker(w2_working_dir, worker2_log) print('Starting worker 1 in background') - processes.append(w1.run_in_background(log_file=worker1_log, flags=['-P', '2001'], subcommand_flags=['--skip-ra'])) + processes.append(w1.run_in_background(log_file=worker1_log, flags=['-P', '2000'], subcommand_flags=['--skip-ra'])) # prevent nonce clash, when bootstrapping the enclave's account sleep(5) print('Starting worker 2 in background') - processes.append(w2.run_in_background(log_file=worker2_log, subcommand_flags=['--skip-ra'])) + processes.append(w2.run_in_background(log_file=worker2_log, flags=['-P', '3000'], subcommand_flags=['--skip-ra'])) # keep script alive until terminated signal.pause() From b96c748d0a5f9aa1730eee84d8a787796597e99c Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Fri, 25 Jun 2021 14:26:59 +0200 Subject: [PATCH 49/80] [local-setup] fix purging of chain_relay_db --- local-setup/py/worker.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/local-setup/py/worker.py b/local-setup/py/worker.py index 1cbe92fc90..fff722534f 100644 --- a/local-setup/py/worker.py +++ b/local-setup/py/worker.py @@ -113,11 +113,11 @@ def purge_shard(self, shard=None): else: shutil.rmtree(self._shard_path(shard)) - @staticmethod - def purge_chain_relay_db(): - db = pathlib.Path('./chain_relay_db.bin') - if db.exists(): - db.unlink() + def purge_chain_relay_db(self): + print(f'remove chain relay db') + for db in pathlib.Path(self.cwd).glob('chain_relay_db.bin*'): + print(f'remove chain relay db: {db}') + db.unlink() def mrenclave(self): """ Returns the mrenclave and caches it. """ From 099c4ae9789cf42797c9fb7cce7ed54664b5bd56 Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Fri, 25 Jun 2021 14:41:37 +0200 Subject: [PATCH 50/80] [main] move worker config print into run, such that it does not intervene with python commands that want to extract information. --- worker/src/main.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/worker/src/main.rs b/worker/src/main.rs index 1faafe39b2..308a542fa4 100644 --- a/worker/src/main.rs +++ b/worker/src/main.rs @@ -102,7 +102,6 @@ fn main() { let matches = App::from_yaml(yml).get_matches(); let mut config = Config::from(&matches); - println!("Worker Config: {:?}", config); *NODE_URL.lock().unwrap() = config.node_url(); @@ -116,7 +115,8 @@ fn main() { .map(ToString::to_string) .unwrap_or_else(|| format!("ws://127.0.0.1:{}", config.worker_rpc_port)) ); - println!("Advertising worker api at {}", config.ext_api_url.as_ref().unwrap()); + + println!("Worker Config: {:?}", config); let skip_ra = smatches.is_present("skip-ra"); worker( config.clone(), @@ -297,7 +297,7 @@ async fn worker( let uxt = if skip_ra { println!("[!] skipping remote attestation. Registering enclave without attestation report."); - enclave.mock_register_enclave_xt(nonce, &config.ext_api_url.unwrap()).unwrap() + enclave.mock_register_enclave_xt(api.genesis_hash, nonce, &config.ext_api_url.unwrap()).unwrap() } else { enclave_perform_ra(eid, genesis_hash, nonce, config.ext_api_url.unwrap().as_bytes().to_vec()).unwrap() }; @@ -307,7 +307,7 @@ async fn worker( // send the extrinsic and wait for confirmation println!("[>] Register the enclave (send the extrinsic)"); - let tx_hash = api.send_extrinsic(xthex, XtStatus::InBlock).unwrap(); + let tx_hash = api.send_extrinsic(xthex, XtStatus::Finalized).unwrap(); println!("[<] Extrinsic got finalized. Hash: {:?}\n", tx_hash); let latest_head = init_chain_relay(eid, &api); From dd069c5fbe7e7cfdbee64766d251a01b75fb3d01 Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Fri, 25 Jun 2021 14:43:16 +0200 Subject: [PATCH 51/80] [local-setup] be more verbose about file deletion. --- local-setup/py/worker.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/local-setup/py/worker.py b/local-setup/py/worker.py index fff722534f..dd660146f4 100644 --- a/local-setup/py/worker.py +++ b/local-setup/py/worker.py @@ -108,15 +108,17 @@ def purge_shard(self, shard=None): if not shard: shard = self.mrenclave() + print(f'Purging shard: {shard}') + if not self.shard_exists(shard): print('The shard to be purged does not exist.') else: shutil.rmtree(self._shard_path(shard)) def purge_chain_relay_db(self): - print(f'remove chain relay db') + print(f'purging chain_relay_db') for db in pathlib.Path(self.cwd).glob('chain_relay_db.bin*'): - print(f'remove chain relay db: {db}') + print(f'remove: {db}') db.unlink() def mrenclave(self): From d97336b922c7cc93e54610be1c723d0bdbeef3a7 Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Fri, 25 Jun 2021 15:36:45 +0200 Subject: [PATCH 52/80] [local-setup] adjust worker log-level --- local-setup/py/worker.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/local-setup/py/worker.py b/local-setup/py/worker.py index dd660146f4..9729f4cd6c 100644 --- a/local-setup/py/worker.py +++ b/local-setup/py/worker.py @@ -1,3 +1,4 @@ +import os import pathlib import shutil import subprocess @@ -142,8 +143,13 @@ def run_in_background(self, log_file: TextIO, flags: [str] = None, subcommand_fl :return: process handle for the spawned background process. """ + + # Todo: make this configurable + env = dict(os.environ, RUST_LOG='debug,ws=warn,sp_io=warn,substrate_api_client=info') + return Popen( self._assemble_cmd(flags=flags, subcommand_flags=subcommand_flags), + env=env, stdout=log_file, stderr=STDOUT, bufsize=1, From d4bd261f84616f73163cb9a24705eb04ca31eef5 Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Fri, 25 Jun 2021 16:01:21 +0200 Subject: [PATCH 53/80] successfully register on-chain without extrinsics --- enclave/Enclave.edl | 1 + primitives/enclave-api/src/ffi.rs | 2 ++ primitives/enclave-api/src/lib.rs | 7 ++++++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/enclave/Enclave.edl b/enclave/Enclave.edl index 722f555ce7..16395ec999 100644 --- a/enclave/Enclave.edl +++ b/enclave/Enclave.edl @@ -68,6 +68,7 @@ enclave { ); public sgx_status_t mock_register_enclave_xt( + [in, size=genesis_hash_size] uint8_t* genesis_hash, uint32_t genesis_hash_size, [in] uint32_t* nonce, [in, size=w_url_size] uint8_t* w_url, uint32_t w_url_size, [out, size=unchecked_extrinsic_size] uint8_t* unchecked_extrinsic, uint32_t unchecked_extrinsic_size diff --git a/primitives/enclave-api/src/ffi.rs b/primitives/enclave-api/src/ffi.rs index 395433e833..d3920956e4 100644 --- a/primitives/enclave-api/src/ffi.rs +++ b/primitives/enclave-api/src/ffi.rs @@ -13,6 +13,8 @@ extern "C" { pub fn mock_register_enclave_xt( eid: sgx_enclave_id_t, retval: *mut sgx_status_t, + genesis_hash: *const u8, + genesis_hash_size: u32, nonce: *const u32, w_url: *const u8, w_url_size: u32, diff --git a/primitives/enclave-api/src/lib.rs b/primitives/enclave-api/src/lib.rs index c49efe9182..3095c15fe6 100644 --- a/primitives/enclave-api/src/lib.rs +++ b/primitives/enclave-api/src/lib.rs @@ -5,6 +5,7 @@ use frame_support::ensure; use crate::error::Error; use codec::Encode; +use frame_support::sp_runtime::app_crypto::sp_core::H256; pub mod ffi; pub mod error; @@ -26,7 +27,7 @@ pub trait EnclaveApi: Send + Sync + 'static { // Todo: Vec shall be replaced by D: Decode, E: Encode but this is currently // not compatible with the direct_api_server... fn rpc(&self, request: Vec) -> EnclaveResult>; - fn mock_register_enclave_xt(&self, nonce: u32, w_url: &str) -> EnclaveResult>; + fn mock_register_enclave_xt(&self, genesis_hash: H256, nonce: u32, w_url: &str) -> EnclaveResult>; } impl EnclaveApi for Enclave { @@ -54,6 +55,7 @@ impl EnclaveApi for Enclave { fn mock_register_enclave_xt( &self, + genesis_hash: H256, nonce: u32, w_url: &str, ) -> EnclaveResult> { @@ -62,11 +64,14 @@ impl EnclaveApi for Enclave { let mut response: Vec = vec![0u8; response_len as usize]; let url = w_url.encode(); + let gen = genesis_hash.as_bytes().to_vec(); let res = unsafe { ffi::mock_register_enclave_xt( self.eid, &mut retval, + gen.as_ptr(), + gen.len() as u32, &nonce, url.as_ptr(), url.len() as u32, From a813ccdebef30946bc344bdfbc1462bcff65a28f Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Fri, 25 Jun 2021 16:01:59 +0200 Subject: [PATCH 54/80] [local-setup] node log downgrade: debug -> info --- local-setup/launch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/local-setup/launch.py b/local-setup/launch.py index 3bb8de87d6..6bd888e5c7 100755 --- a/local-setup/launch.py +++ b/local-setup/launch.py @@ -33,7 +33,7 @@ def setup_worker(work_dir: str, std_err: Union[None, int, IO]): def main(processes): print('Starting substraTee-node-process in background') processes.append( - Popen([node_bin, '--tmp', '--dev', '-lruntime=debug'], stdout=node_log, stderr=STDOUT, bufsize=1) + Popen([node_bin, '--tmp', '--dev', '-lruntime=info'], stdout=node_log, stderr=STDOUT, bufsize=1) ) w1 = setup_worker(w1_working_dir, worker1_log) From eefb850d34a4fd8eb76344fa2171cff758e0f58a Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Fri, 25 Jun 2021 16:02:19 +0200 Subject: [PATCH 55/80] fix local-setup: works perfectly know. --- worker/src/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/worker/src/main.rs b/worker/src/main.rs index 308a542fa4..e8397d3ef6 100644 --- a/worker/src/main.rs +++ b/worker/src/main.rs @@ -685,7 +685,7 @@ pub unsafe extern "C" fn ocall_worker_request( /// /// FFI are always unsafe #[no_mangle] -pub async unsafe extern "C" fn ocall_send_block_and_confirmation( +pub unsafe extern "C" fn ocall_send_block_and_confirmation( confirmations: *const u8, confirmations_size: u32, signed_blocks_ptr: *const u8, @@ -738,8 +738,8 @@ pub async unsafe extern "C" fn ocall_send_block_and_confirmation( println! {"Received blocks: {:?}", signed_blocks}; - let w = WORKER.read(); - w.as_ref().unwrap().gossip_blocks(signed_blocks).await.unwrap(); + // let w = WORKER.read(); + // w.as_ref().unwrap().gossip_blocks(signed_blocks).await.unwrap(); // TODO: M8.3: Store blocks status } From b5b96cc40aeb851a9da9c39408a7bd05f044f6b8 Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Fri, 25 Jun 2021 16:19:53 +0200 Subject: [PATCH 56/80] [primitives/enclave-api] extract ffi to separate crate --- Cargo.lock | 8 ++++++++ Cargo.toml | 1 + primitives/enclave-api/Cargo.toml | 4 +++- primitives/enclave-api/ffi/Cargo.toml | 9 +++++++++ primitives/enclave-api/{src/ffi.rs => ffi/src/lib.rs} | 0 primitives/enclave-api/src/lib.rs | 3 ++- 6 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 primitives/enclave-api/ffi/Cargo.toml rename primitives/enclave-api/{src/ffi.rs => ffi/src/lib.rs} (100%) diff --git a/Cargo.lock b/Cargo.lock index a6c54d5414..210e666a02 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5527,9 +5527,17 @@ dependencies = [ "frame-support", "parity-scale-codec 2.1.3", "sgx_types", + "substratee-enclave-api-ffi", "thiserror", ] +[[package]] +name = "substratee-enclave-api-ffi" +version = "0.1.0" +dependencies = [ + "sgx_types", +] + [[package]] name = "substratee-node-primitives" version = "0.8.0" diff --git a/Cargo.toml b/Cargo.toml index 78cf54d6a2..38d1d195d7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,6 +7,7 @@ members = [ "client", "primitives/api-client-extensions", "primitives/enclave-api", + "primitives/enclave-api/ffi", "primitives/node", "primitives/settings", "primitives/worker", diff --git a/primitives/enclave-api/Cargo.toml b/primitives/enclave-api/Cargo.toml index 84432b351b..c69a2aa752 100644 --- a/primitives/enclave-api/Cargo.toml +++ b/primitives/enclave-api/Cargo.toml @@ -10,4 +10,6 @@ codec = { package = "parity-scale-codec", version = "2.0.0", features = ["derive sgx_types = { rev = "v1.1.3", git = "https://github.com/apache/teaclave-sgx-sdk.git" } -frame-support = { version = "3.0.0", git = "https://github.com/paritytech/substrate.git", branch = "master" } \ No newline at end of file +frame-support = { version = "3.0.0", git = "https://github.com/paritytech/substrate.git", branch = "master" } + +substratee-enclave-api-ffi = { path = "ffi" } diff --git a/primitives/enclave-api/ffi/Cargo.toml b/primitives/enclave-api/ffi/Cargo.toml new file mode 100644 index 0000000000..808504da5a --- /dev/null +++ b/primitives/enclave-api/ffi/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "substratee-enclave-api-ffi" +version = "0.1.0" +edition = "2018" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +sgx_types = { rev = "v1.1.3", git = "https://github.com/apache/teaclave-sgx-sdk.git" } \ No newline at end of file diff --git a/primitives/enclave-api/src/ffi.rs b/primitives/enclave-api/ffi/src/lib.rs similarity index 100% rename from primitives/enclave-api/src/ffi.rs rename to primitives/enclave-api/ffi/src/lib.rs diff --git a/primitives/enclave-api/src/lib.rs b/primitives/enclave-api/src/lib.rs index 3095c15fe6..47aefa4ab5 100644 --- a/primitives/enclave-api/src/lib.rs +++ b/primitives/enclave-api/src/lib.rs @@ -7,7 +7,8 @@ use crate::error::Error; use codec::Encode; use frame_support::sp_runtime::app_crypto::sp_core::H256; -pub mod ffi; +use substratee_enclave_api_ffi as ffi; + pub mod error; #[derive(Clone, Copy, PartialEq, Eq)] From 58aa2bbbe204a41eeb8a699a7bdda9c1973c7f27 Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Fri, 25 Jun 2021 18:21:41 +0200 Subject: [PATCH 57/80] successfully gossip blocks, but rpc returns invalid params error. --- Cargo.lock | 2 +- enclave/src/lib.rs | 6 ++++-- worker/src/main.rs | 11 +++++++++-- worker/src/worker.rs | 5 ++--- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 210e666a02..6c9b9e7260 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6169,7 +6169,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04f8ab788026715fa63b31960869617cba39117e520eb415b0139543e325ab59" dependencies = [ "cfg-if 0.1.10", - "rand 0.3.23", + "rand 0.7.3", "static_assertions", ] diff --git a/enclave/src/lib.rs b/enclave/src/lib.rs index e4c9d24024..b3cd79e87b 100644 --- a/enclave/src/lib.rs +++ b/enclave/src/lib.rs @@ -94,6 +94,7 @@ pub mod top_pool; use substratee_settings::node::{BLOCK_CONFIRMED, CALL_CONFIRMED, RUNTIME_SPEC_VERSION, RUNTIME_TRANSACTION_VERSION, SUBSTRATEE_REGISTRY_MODULE, CALL_WORKER, SHIELD_FUNDS, REGISTER_ENCLAVE}; use substratee_settings::enclave::{CALL_TIMEOUT, GETTER_TIMEOUT}; +use codec::alloc::string::String; pub const CERTEXPIRYDAYS: i64 = 90i64; @@ -204,7 +205,8 @@ pub unsafe extern "C" fn mock_register_enclave_xt( let genesis_hash_slice = slice::from_raw_parts(genesis_hash, genesis_hash_size as usize); let genesis_hash = hash_from_slice(genesis_hash_slice); - let url_slice = slice::from_raw_parts(w_url, w_url_size as usize); + let mut url_slice = slice::from_raw_parts(w_url, w_url_size as usize); + let url: String = Decode::decode(&mut url_slice).unwrap(); let extrinsic_slice = slice::from_raw_parts_mut(unchecked_extrinsic, unchecked_extrinsic_size as usize); @@ -214,7 +216,7 @@ pub unsafe extern "C" fn mock_register_enclave_xt( let xt = compose_extrinsic_offline!( signer, - (call, Vec::::new(), url_slice.to_vec()), + (call, Vec::::new(), url.clone()), *nonce, Era::Immortal, genesis_hash, diff --git a/worker/src/main.rs b/worker/src/main.rs index e8397d3ef6..88405f9cce 100644 --- a/worker/src/main.rs +++ b/worker/src/main.rs @@ -71,6 +71,7 @@ use substratee_settings::files::{ use worker::{Worker as WorkerGen}; use crate::utils::{extract_shard, hex_encode, check_files, write_slice_and_whitespace_pad}; use crate::worker::WorkerT; +use futures::executor::block_on; mod enclave; mod ipfs; @@ -738,8 +739,14 @@ pub unsafe extern "C" fn ocall_send_block_and_confirmation( println! {"Received blocks: {:?}", signed_blocks}; - // let w = WORKER.read(); - // w.as_ref().unwrap().gossip_blocks(signed_blocks).await.unwrap(); + let w = WORKER.read(); + + // make it sync sgx ffi do not support async/await + block_on( + w.as_ref().unwrap() + .gossip_blocks(signed_blocks) + ) + .unwrap(); // TODO: M8.3: Store blocks status } diff --git a/worker/src/worker.rs b/worker/src/worker.rs index 27304bbdca..4f8baa369f 100644 --- a/worker/src/worker.rs +++ b/worker/src/worker.rs @@ -64,9 +64,8 @@ where info!("Gossiping sidechain blocks to peers: {:?}", peers); for p in peers.iter() { - let url = format!("ws://{}", p.url); - info!("Gossiping block to peer with address: {:?}", url); - let client = WsClientBuilder::default().build(&url).await?; + info!("Gossiping block to peer with address: {:?}", p.url); + let client = WsClientBuilder::default().build(&p.url).await?; let response: Vec = client .request( "sidechain_importBlock", From 1991d9679e15c06e5ca33218e2aa66a81bc8d013 Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Mon, 28 Jun 2021 07:43:33 +0200 Subject: [PATCH 58/80] remove unwrap in ocall_send_block_and_confirmation. The worker can't recover from it. --- worker/src/main.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/worker/src/main.rs b/worker/src/main.rs index 88405f9cce..8a1633d901 100644 --- a/worker/src/main.rs +++ b/worker/src/main.rs @@ -742,11 +742,11 @@ pub unsafe extern "C" fn ocall_send_block_and_confirmation( let w = WORKER.read(); // make it sync sgx ffi do not support async/await - block_on( - w.as_ref().unwrap() - .gossip_blocks(signed_blocks) - ) - .unwrap(); + if let Err(e) = block_on(w.as_ref().unwrap().gossip_blocks(signed_blocks)) { + error!("Error gossiping blocks: {:?}", e); + // Fixme: returning an error here results in a `HeaderAncestryMismatch` error. + // status = sgx_status_t::SGX_ERROR_UNEXPECTED; + }; // TODO: M8.3: Store blocks status } From e5342ad5bea2355f721dc1b7dd5b480fcb074156 Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Mon, 28 Jun 2021 08:33:55 +0200 Subject: [PATCH 59/80] [worker] add `WorkerError::Custom(Box), } \ No newline at end of file From 6e45a5c1daebe1f2cac5ff637cd5ac1f730c741e Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Mon, 28 Jun 2021 09:18:40 +0200 Subject: [PATCH 60/80] [worker] fix gossip blocks correctly to new async worker api --- worker/src/main.rs | 5 ++--- worker/src/worker.rs | 32 ++++++++++++++++++++++++++++++-- 2 files changed, 32 insertions(+), 5 deletions(-) diff --git a/worker/src/main.rs b/worker/src/main.rs index 8a1633d901..5da7422871 100644 --- a/worker/src/main.rs +++ b/worker/src/main.rs @@ -70,7 +70,7 @@ use substratee_settings::files::{ use worker::{Worker as WorkerGen}; use crate::utils::{extract_shard, hex_encode, check_files, write_slice_and_whitespace_pad}; -use crate::worker::WorkerT; +use crate::worker::{WorkerT, worker_url_into_async_rpc_port}; use futures::executor::block_on; mod enclave; @@ -273,9 +273,8 @@ async fn worker( // listen for sidechain_block import request. Later the `start_worker_api_direct_server` // should be merged into this one. let enclave = Enclave::new(eid); - let port: i32 = config.worker_rpc_port.parse().unwrap(); substratee_worker_rpc_server::run_server( - format!("{}:{}", config.worker_ip, (port + 1)), + &worker_url_into_async_rpc_port(&config.worker_url()).unwrap(), enclave, ).await.unwrap(); diff --git a/worker/src/worker.rs b/worker/src/worker.rs index 4f8baa369f..8744856ada 100644 --- a/worker/src/worker.rs +++ b/worker/src/worker.rs @@ -12,6 +12,7 @@ use substratee_worker_primitives::block::SignedBlock as SignedSidechainBlock; use crate::config::Config; use crate::error::Error; +use std::num::ParseIntError; pub type WorkerResult = Result; @@ -64,8 +65,10 @@ where info!("Gossiping sidechain blocks to peers: {:?}", peers); for p in peers.iter() { - info!("Gossiping block to peer with address: {:?}", p.url); - let client = WsClientBuilder::default().build(&p.url).await?; + // Todo: once this is the two direct servers are merged, remove this. + let url = worker_url_into_async_rpc_port(&p.url)?; + info!("Gossiping block to peer with address: {:?}", url); + let client = WsClientBuilder::default().build(&url).await?; let response: Vec = client .request( "sidechain_importBlock", @@ -78,6 +81,31 @@ where } } +/// Temporary method that transforms the workers rpc port of the direct api defined in rpc/direct_client +/// to the new version in rpc/server. Remove this, when all the methods have been migrated to the new one +/// in rpc/server. +pub fn worker_url_into_async_rpc_port(url: &str) -> WorkerResult { + // [Option("ws"), //ip, port] + let mut url_vec: Vec<&str> = url.split(":").collect(); + log::warn!("URL vec: {:?}", url_vec ); + log::warn!("URL vec len: {:?}", url_vec.len()); + + match url_vec.len() { + 3 | 2 => (), + _ => Err(Error::Custom("Invalid worker url format".into()))?, + }; + + let ip = if url_vec.len() == 3 { + format!("{}:{}", url_vec.remove(0), url_vec.remove(0)) + } else { + url_vec.remove(0).into() + }; + + let port: i32 = url_vec.remove(0).parse().map_err(|e:ParseIntError| Error::Custom(e.into()))?; + + Ok(format!("{}:{}", ip, (port + 1))) +} + #[cfg(test)] mod tests { use jsonrpsee::{ws_server::WsServerBuilder, RpcModule}; From bc3db54537046a62942d39f14643da5c296cd35d Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Mon, 28 Jun 2021 10:17:06 +0200 Subject: [PATCH 61/80] [worker] fix return value of rpc. Successfully broadcast blocks --- worker/src/worker.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/worker/src/worker.rs b/worker/src/worker.rs index 8744856ada..902288bf93 100644 --- a/worker/src/worker.rs +++ b/worker/src/worker.rs @@ -69,7 +69,7 @@ where let url = worker_url_into_async_rpc_port(&p.url)?; info!("Gossiping block to peer with address: {:?}", url); let client = WsClientBuilder::default().build(&url).await?; - let response: Vec = client + let response: Vec = client .request( "sidechain_importBlock", vec![to_json_value(blocks.clone())?].into(), @@ -87,9 +87,6 @@ where pub fn worker_url_into_async_rpc_port(url: &str) -> WorkerResult { // [Option("ws"), //ip, port] let mut url_vec: Vec<&str> = url.split(":").collect(); - log::warn!("URL vec: {:?}", url_vec ); - log::warn!("URL vec len: {:?}", url_vec.len()); - match url_vec.len() { 3 | 2 => (), _ => Err(Error::Custom("Invalid worker url format".into()))?, From 5f0fad15a433aab5e701104a4675e422338fb5f0 Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Mon, 28 Jun 2021 10:18:18 +0200 Subject: [PATCH 62/80] [worker] extrate peers() method --- worker/src/worker.rs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/worker/src/worker.rs b/worker/src/worker.rs index 902288bf93..c61b7cfd48 100644 --- a/worker/src/worker.rs +++ b/worker/src/worker.rs @@ -13,6 +13,7 @@ use substratee_worker_primitives::block::SignedBlock as SignedSidechainBlock; use crate::config::Config; use crate::error::Error; use std::num::ParseIntError; +use substratee_node_primitives::Enclave as EnclaveMetadata; pub type WorkerResult = Result; @@ -49,6 +50,7 @@ impl Worker>) -> WorkerResult<()>; async fn gossip_blocks(&self, blocks: Vec) -> WorkerResult<()>; + fn peers(&self) -> WorkerResult>; } #[async_trait] @@ -60,10 +62,9 @@ where WorkerApiDirect: Send + Sync, { async fn gossip_blocks(&self, blocks: Vec) -> WorkerResult<()> { - let mut peers = self.node_api.all_enclaves()?; - peers.retain(|e| e.url != self.config.worker_url()); - + let peers = self.peers()?; info!("Gossiping sidechain blocks to peers: {:?}", peers); + for p in peers.iter() { // Todo: once this is the two direct servers are merged, remove this. let url = worker_url_into_async_rpc_port(&p.url)?; @@ -79,6 +80,12 @@ where } Ok(()) } + + fn peers(&self) -> WorkerResult> { + let mut peers = self.node_api.all_enclaves()?; + peers.retain(|e| e.url.trim_start_matches("ws://") != self.config.worker_url()); + Ok(peers) + } } /// Temporary method that transforms the workers rpc port of the direct api defined in rpc/direct_client From c11fdfcb6296403586fd528c87e7e992dcc3dce8 Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Mon, 28 Jun 2021 11:03:31 +0200 Subject: [PATCH 63/80] [local-setup] fix 1/10th change of noce clash --- local-setup/launch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/local-setup/launch.py b/local-setup/launch.py index 6bd888e5c7..0a7f536956 100755 --- a/local-setup/launch.py +++ b/local-setup/launch.py @@ -43,7 +43,7 @@ def main(processes): processes.append(w1.run_in_background(log_file=worker1_log, flags=['-P', '2000'], subcommand_flags=['--skip-ra'])) # prevent nonce clash, when bootstrapping the enclave's account - sleep(5) + sleep(6) print('Starting worker 2 in background') processes.append(w2.run_in_background(log_file=worker2_log, flags=['-P', '3000'], subcommand_flags=['--skip-ra'])) # keep script alive until terminated From 4d6c145b9bc92fb8a7e79a166bf6d82dd968b1f8 Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Mon, 28 Jun 2021 11:08:48 +0200 Subject: [PATCH 64/80] [worker] fix: wait until tokio::runtime is available. --- worker/src/main.rs | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/worker/src/main.rs b/worker/src/main.rs index 5da7422871..18bf5f1c9d 100644 --- a/worker/src/main.rs +++ b/worker/src/main.rs @@ -72,6 +72,7 @@ use worker::{Worker as WorkerGen}; use crate::utils::{extract_shard, hex_encode, check_files, write_slice_and_whitespace_pad}; use crate::worker::{WorkerT, worker_url_into_async_rpc_port}; use futures::executor::block_on; +use tokio::runtime::Handle; mod enclave; mod ipfs; @@ -93,6 +94,7 @@ lazy_static! { // todo: replace with &str, but use &str in api-client first static ref NODE_URL: Mutex = Mutex::new("".to_string()); static ref WORKER: RwLock> = RwLock::new(None); + static ref TOKIO_HANDLE: Mutex> = Default::default(); } fn main() { @@ -221,8 +223,7 @@ fn main() { } } -#[tokio::main] -async fn worker( +fn worker( config: Config, shard: &ShardIdentifier, skip_ra: bool, @@ -244,6 +245,8 @@ async fn worker( println!("MRENCLAVE={}", mrenclave.to_base58()); let eid = enclave.geteid(); + let rt = tokio::runtime::Runtime::new().unwrap(); + *TOKIO_HANDLE.lock().unwrap() = Some(rt.handle().clone()); *WORKER.write() = Some( Worker::new( config.clone(), @@ -273,11 +276,15 @@ async fn worker( // listen for sidechain_block import request. Later the `start_worker_api_direct_server` // should be merged into this one. let enclave = Enclave::new(eid); - substratee_worker_rpc_server::run_server( - &worker_url_into_async_rpc_port(&config.worker_url()).unwrap(), - enclave, - ).await.unwrap(); - + let url = worker_url_into_async_rpc_port(&config.worker_url()).unwrap(); + + let handle = TOKIO_HANDLE.lock().unwrap().as_ref().unwrap().clone(); + handle.spawn(async move { + substratee_worker_rpc_server::run_server( + &url, + enclave, + ).await.unwrap() + }); // ------------------------------------------------------------------------ // start the substrate-api-client to communicate with the node let mut api = Api::new(NODE_URL.lock().unwrap().clone()) @@ -740,8 +747,9 @@ pub unsafe extern "C" fn ocall_send_block_and_confirmation( let w = WORKER.read(); - // make it sync sgx ffi do not support async/await - if let Err(e) = block_on(w.as_ref().unwrap().gossip_blocks(signed_blocks)) { + // make it sync, as sgx ffi does not support async/await + let handle = TOKIO_HANDLE.lock().unwrap().as_ref().unwrap().clone(); + if let Err(e) = handle.block_on(w.as_ref().unwrap().gossip_blocks(signed_blocks)) { error!("Error gossiping blocks: {:?}", e); // Fixme: returning an error here results in a `HeaderAncestryMismatch` error. // status = sgx_status_t::SGX_ERROR_UNEXPECTED; From 0b9a10b81356e760e6d13d4a61b506f191e99e0c Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Mon, 28 Jun 2021 11:40:19 +0200 Subject: [PATCH 65/80] [worker] remove unused imports --- worker/src/main.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/worker/src/main.rs b/worker/src/main.rs index 18bf5f1c9d..1a5c467d09 100644 --- a/worker/src/main.rs +++ b/worker/src/main.rs @@ -71,8 +71,6 @@ use substratee_settings::files::{ use worker::{Worker as WorkerGen}; use crate::utils::{extract_shard, hex_encode, check_files, write_slice_and_whitespace_pad}; use crate::worker::{WorkerT, worker_url_into_async_rpc_port}; -use futures::executor::block_on; -use tokio::runtime::Handle; mod enclave; mod ipfs; From e704905259643a282e2e620f679546009a7575d1 Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Mon, 28 Jun 2021 11:59:29 +0200 Subject: [PATCH 66/80] [worker] print rpc response in strings instead of bytes --- worker/src/error.rs | 2 ++ worker/src/worker.rs | 7 ++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/worker/src/error.rs b/worker/src/error.rs index ffe536f9ca..31a33d4fe7 100644 --- a/worker/src/error.rs +++ b/worker/src/error.rs @@ -11,6 +11,8 @@ pub enum Error { JsonRpSeeClient(#[from] jsonrpsee::types::Error), #[error("{0}")] Serialization(#[from] serde_json::Error), + #[error("{0}")] + FromUtf8Error(#[from] std::string::FromUtf8Error), #[error("Custom Error: {0}")] Custom(Box), } \ No newline at end of file diff --git a/worker/src/worker.rs b/worker/src/worker.rs index c61b7cfd48..400547452a 100644 --- a/worker/src/worker.rs +++ b/worker/src/worker.rs @@ -70,12 +70,13 @@ where let url = worker_url_into_async_rpc_port(&p.url)?; info!("Gossiping block to peer with address: {:?}", url); let client = WsClientBuilder::default().build(&url).await?; - let response: Vec = client - .request( + let response: String = client + .request::>( "sidechain_importBlock", vec![to_json_value(blocks.clone())?].into(), ) - .await?; + .await + .map(String::from_utf8)??; info!("sidechain_importBlock response: {:?}", response); } Ok(()) From c9c2359ae959173a89f5cb04b4c4ab041448a231 Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Tue, 29 Jun 2021 08:54:57 +0200 Subject: [PATCH 67/80] [primitives/enclave-api] extract mock_register to TeeRexApi --- primitives/enclave-api/src/lib.rs | 14 +++++++++++--- worker/src/main.rs | 4 ++-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/primitives/enclave-api/src/lib.rs b/primitives/enclave-api/src/lib.rs index 47aefa4ab5..ac7cb2fec6 100644 --- a/primitives/enclave-api/src/lib.rs +++ b/primitives/enclave-api/src/lib.rs @@ -28,9 +28,14 @@ pub trait EnclaveApi: Send + Sync + 'static { // Todo: Vec shall be replaced by D: Decode, E: Encode but this is currently // not compatible with the direct_api_server... fn rpc(&self, request: Vec) -> EnclaveResult>; - fn mock_register_enclave_xt(&self, genesis_hash: H256, nonce: u32, w_url: &str) -> EnclaveResult>; } + +pub trait TeeRexApi : Send + Sync + 'static { + /// Register enclave xt with an empty attestation report. + fn mock_register_xt(&self, genesis_hash: H256, nonce: u32, w_url: &str) -> EnclaveResult>; +} + impl EnclaveApi for Enclave { fn rpc(&self, request: Vec) -> EnclaveResult> { let mut retval = sgx_status_t::SGX_SUCCESS; @@ -53,8 +58,10 @@ impl EnclaveApi for Enclave { Ok(response) } +} - fn mock_register_enclave_xt( +impl TeeRexApi for Enclave { + fn mock_register_xt( &self, genesis_hash: H256, nonce: u32, @@ -86,4 +93,5 @@ impl EnclaveApi for Enclave { Ok(response) } -} \ No newline at end of file +} + diff --git a/worker/src/main.rs b/worker/src/main.rs index 1a5c467d09..3793f8b842 100644 --- a/worker/src/main.rs +++ b/worker/src/main.rs @@ -59,7 +59,7 @@ use std::time::{Duration, SystemTime}; use substratee_api_client_extensions::{AccountApi, ChainApi}; use substratee_worker_primitives::block::SignedBlock as SignedSidechainBlock; use substratee_node_primitives::SignedBlock; -use substratee_enclave_api::{Enclave, EnclaveApi}; +use substratee_enclave_api::{Enclave, TeeRexApi}; use substratee_worker_api::direct_client::DirectClient; use config::Config; @@ -302,7 +302,7 @@ fn worker( let uxt = if skip_ra { println!("[!] skipping remote attestation. Registering enclave without attestation report."); - enclave.mock_register_enclave_xt(api.genesis_hash, nonce, &config.ext_api_url.unwrap()).unwrap() + enclave.mock_register_xt(api.genesis_hash, nonce, &config.ext_api_url.unwrap()).unwrap() } else { enclave_perform_ra(eid, genesis_hash, nonce, config.ext_api_url.unwrap().as_bytes().to_vec()).unwrap() }; From 36daa76588c4877933a0513ccbb4f8d925afa434 Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Tue, 29 Jun 2021 08:55:24 +0200 Subject: [PATCH 68/80] [worker] fix tests --- Cargo.lock | 1 + worker/Cargo.toml | 3 ++- worker/src/tests/mock.rs | 4 ++-- worker/src/worker.rs | 29 ++++++++++++++++++++--------- 4 files changed, 25 insertions(+), 12 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6c9b9e7260..57e43e0b09 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5629,6 +5629,7 @@ dependencies = [ "clap", "dirs 1.0.5", "env_logger 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", + "frame-support", "frame-system", "futures 0.3.15", "hex 0.3.2", diff --git a/worker/Cargo.toml b/worker/Cargo.toml index be7e488780..264d28d192 100644 --- a/worker/Cargo.toml +++ b/worker/Cargo.toml @@ -106,4 +106,5 @@ default = [] production = ['substratee-settings/production'] [dev-dependencies] -anyhow = "1.0.40" \ No newline at end of file +anyhow = "1.0.40" +frame-support = { git = "https://github.com/paritytech/substrate.git", branch = "master" } \ No newline at end of file diff --git a/worker/src/tests/mock.rs b/worker/src/tests/mock.rs index 9b1cc7728e..e84f4d2125 100644 --- a/worker/src/tests/mock.rs +++ b/worker/src/tests/mock.rs @@ -12,13 +12,13 @@ pub fn enclaves() -> Vec { [0;32].into(), [1;32].into(), 1, - W1_URL.into(), + format!("ws://{}", W1_URL), ), Enclave::new( [2;32].into(), [3;32].into(), 2, - W2_URL.into(), + format!("ws://{}", W2_URL), ), ] } diff --git a/worker/src/worker.rs b/worker/src/worker.rs index 400547452a..61894fdb26 100644 --- a/worker/src/worker.rs +++ b/worker/src/worker.rs @@ -1,3 +1,10 @@ + +///! Substratee worker. Inspiration for this design came from parity's substrate Client. +/// +/// This should serve as a proof of concept for a design I have in mind. Ultimately, everything +/// from the main.rs should be covered by the worker struct here - hidden and split across +/// multiple traits. + use async_trait::async_trait; use jsonrpsee::{ types::{to_json_value, traits::Client}, @@ -7,7 +14,7 @@ use log::info; use std::sync::Arc; use substratee_api_client_extensions::SubstrateeRegistryApi; -// use substratee_worker_api::direct_client::WorkerToWorkerApi; +// use substratee_worker_primitives::block::SignedBlock as SignedSidechainBlock; use crate::config::Config; @@ -17,9 +24,12 @@ use substratee_node_primitives::Enclave as EnclaveMetadata; pub type WorkerResult = Result; +// don't put any trait bounds here. It is good practise to only enforce them where needed. This +// also serves a guide when traits should be split into subtraits. pub struct Worker { config: Config, node_api: NodeApi, + // unused yet, but will be used when more methods are migrated to the worker _enclave_api: Enclave, _worker_api_direct: Arc, } @@ -66,7 +76,7 @@ where info!("Gossiping sidechain blocks to peers: {:?}", peers); for p in peers.iter() { - // Todo: once this is the two direct servers are merged, remove this. + // Todo: once the two direct servers are merged, remove this. let url = worker_url_into_async_rpc_port(&p.url)?; info!("Gossiping block to peer with address: {:?}", url); let client = WsClientBuilder::default().build(&url).await?; @@ -116,6 +126,7 @@ mod tests { use jsonrpsee::{ws_server::WsServerBuilder, RpcModule}; use log::debug; use std::net::SocketAddr; + use frame_support::assert_ok; use substratee_worker_primitives::block::SignedBlock as SignedSidechainBlock; use tokio::net::ToSocketAddrs; @@ -123,7 +134,7 @@ mod tests { commons::{local_worker_config, test_sidechain_block}, mock::{TestNodeApi, W1_URL, W2_URL}, }; - use crate::worker::{Worker, WorkerT}; + use crate::worker::{Worker, WorkerT, worker_url_into_async_rpc_port}; fn init() { let _ = env_logger::builder().is_test(true).try_init(); @@ -135,8 +146,8 @@ mod tests { module.register_method("sidechain_importBlock", |params, _| { debug!("sidechain_importBlock params: {:?}", params); - let blocks: Vec = params.one()?; - Ok(blocks) + let _blocks: Vec = params.one()?; + Ok("ok".as_bytes().to_vec()) })?; server.register_module(module).unwrap(); @@ -149,13 +160,13 @@ mod tests { #[tokio::test] async fn gossip_blocks_works() { init(); - run_server(W2_URL).await.unwrap(); + run_server(worker_url_into_async_rpc_port(W2_URL).unwrap()).await.unwrap(); let worker = Worker::new(local_worker_config(W1_URL.into()), TestNodeApi, (), ()); - worker + let resp = worker .gossip_blocks(vec![test_sidechain_block()]) - .await - .unwrap(); + .await; + assert_ok!(resp); } } From e4a1ef889189f5602c8f2d5bac205ede909aaa27 Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Tue, 29 Jun 2021 09:07:06 +0200 Subject: [PATCH 69/80] [primitives/enclave-api] add some docs --- primitives/enclave-api/src/lib.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/primitives/enclave-api/src/lib.rs b/primitives/enclave-api/src/lib.rs index ac7cb2fec6..9e6d1c525c 100644 --- a/primitives/enclave-api/src/lib.rs +++ b/primitives/enclave-api/src/lib.rs @@ -1,4 +1,16 @@ -//! some definitions and traits that facilitate interaction with the enclave. +//! Some definitions and traits that facilitate interaction with the enclave. +//! +//! This serves as a proof of concept on how we could design the interface between the worker and +//! the enclave. +//! +//! Design principle here should be to keep the interfaces as slim as possible - because then the +//! worker can also define slim interfaces with less demanding trait bounds. +//! +//! This can further be simplified once https://github.com/integritee-network/worker/issues/254 +//! is implemented. Then we can replace the several ffi:: and the boilerplate code +//! around it with a simple `fn ecall(call: CallEnum) -> Result`, which wraps one single +//! ffi function. +//! use sgx_types::{sgx_enclave_id_t, sgx_status_t}; use frame_support::ensure; From d81ab2f8592ef2aeb56f848dddce44e59acd5f85 Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Tue, 29 Jun 2021 09:26:03 +0200 Subject: [PATCH 70/80] minor cleanup --- worker/rpc/client/src/direct_client.rs | 12 ++++++------ worker/src/tests/mock.rs | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/worker/rpc/client/src/direct_client.rs b/worker/rpc/client/src/direct_client.rs index bca1b61d27..ee40105075 100644 --- a/worker/rpc/client/src/direct_client.rs +++ b/worker/rpc/client/src/direct_client.rs @@ -1,3 +1,9 @@ +///! Interface for direct access to a workers rpc. +/// +/// This is should be replaced with the `jsonrpsee::WsClient` it is async an removes a lot of +/// boilerplate code. +/// + use log::*; use std::sync::mpsc::channel; use std::sync::mpsc::Sender as MpscSender; @@ -48,12 +54,6 @@ pub trait DirectApi { fn get_rsa_pubkey(&self) -> Result; } -pub trait WorkerToWorkerApi { - // If I understand correctly, this should never be more than one block. - // Will migrate to that later - fn send_blocks(&self, block: Vec) -> Result<(), ()>; -} - impl DirectClient { pub fn new(url: String) -> Self { Self { url } diff --git a/worker/src/tests/mock.rs b/worker/src/tests/mock.rs index e84f4d2125..e20e7a7dc5 100644 --- a/worker/src/tests/mock.rs +++ b/worker/src/tests/mock.rs @@ -4,7 +4,7 @@ use substratee_node_primitives::{Enclave, ShardIdentifier}; pub struct TestNodeApi; pub const W1_URL: &str = "127.0.0.1:2222"; -pub const W2_URL: &str = "127.0.0.1:2223"; +pub const W2_URL: &str = "127.0.0.1:3333"; pub fn enclaves() -> Vec { vec![ From 6261088f8ce5bf67ef9ed2a0bc5dd3032aaac9d2 Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Tue, 29 Jun 2021 11:03:03 +0200 Subject: [PATCH 71/80] Cargo.lock after rebase --- Cargo.lock | 14 +++++++------- enclave/Cargo.lock | 10 +++++----- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 57e43e0b09..7b783dcb96 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1795,7 +1795,7 @@ dependencies = [ [[package]] name = "ias-verify" version = "0.1.4" -source = "git+https://github.com/scs/pallet-substratee-registry.git?branch=feature-gate-ias-check#8fc938ba1d78678552acd8b7f0a5b73521c4f48e" +source = "git+https://github.com/scs/pallet-substratee-registry.git?branch=master#10f13173d2a07b3eb1062a956cda0e9dcd99a541" dependencies = [ "base64 0.11.0", "chrono", @@ -3036,7 +3036,7 @@ dependencies = [ [[package]] name = "pallet-substratee-registry" version = "0.9.0" -source = "git+https://github.com/scs/pallet-substratee-registry.git?branch=feature-gate-ias-check#8fc938ba1d78678552acd8b7f0a5b73521c4f48e" +source = "git+https://github.com/scs/pallet-substratee-registry.git?branch=master#10f13173d2a07b3eb1062a956cda0e9dcd99a541" dependencies = [ "frame-support", "frame-system", @@ -4358,7 +4358,7 @@ dependencies = [ [[package]] name = "sgx-externalities" version = "0.3.0" -source = "git+https://github.com/scs/sgx-runtime?branch=version-update#de9fc665a1e5268e53432841d642d61ddc793db2" +source = "git+https://github.com/scs/sgx-runtime?branch=master#bb0b6a206006299ab773a375197c4846a4c83a30" dependencies = [ "environmental", "log 0.4.14 (git+https://github.com/mesalock-linux/log-sgx)", @@ -4371,7 +4371,7 @@ dependencies = [ [[package]] name = "sgx-runtime" version = "0.8.0" -source = "git+https://github.com/scs/sgx-runtime?branch=version-update#de9fc665a1e5268e53432841d642d61ddc793db2" +source = "git+https://github.com/scs/sgx-runtime?branch=master#bb0b6a206006299ab773a375197c4846a4c83a30" dependencies = [ "frame-executive", "frame-support", @@ -5021,7 +5021,7 @@ dependencies = [ [[package]] name = "sp-io" version = "3.1.0" -source = "git+https://github.com/scs/sgx-runtime?branch=version-update#de9fc665a1e5268e53432841d642d61ddc793db2" +source = "git+https://github.com/scs/sgx-runtime?branch=master#bb0b6a206006299ab773a375197c4846a4c83a30" dependencies = [ "environmental", "hash-db", @@ -5551,8 +5551,8 @@ dependencies = [ [[package]] name = "substratee-node-runtime" -version = "0.8.0" -source = "git+https://github.com/scs/substraTEE-node?branch=feature-gate-ias-verify#102dee0f031a1aca16962dc9899db0607a6e9515" +version = "0.9.0" +source = "git+https://github.com/scs/substraTEE-node?branch=master#d0df8591618ca175cf03970a26b1ab1e52aef4a5" dependencies = [ "frame-executive", "frame-support", diff --git a/enclave/Cargo.lock b/enclave/Cargo.lock index e8604055d6..0f9092656c 100644 --- a/enclave/Cargo.lock +++ b/enclave/Cargo.lock @@ -1893,7 +1893,7 @@ dependencies = [ [[package]] name = "sgx-externalities" version = "0.3.0" -source = "git+https://github.com/scs/sgx-runtime?branch=version-update#de9fc665a1e5268e53432841d642d61ddc793db2" +source = "git+https://github.com/scs/sgx-runtime?branch=master#bb0b6a206006299ab773a375197c4846a4c83a30" dependencies = [ "environmental", "log", @@ -1906,7 +1906,7 @@ dependencies = [ [[package]] name = "sgx-runtime" version = "0.8.0" -source = "git+https://github.com/scs/sgx-runtime?branch=version-update#de9fc665a1e5268e53432841d642d61ddc793db2" +source = "git+https://github.com/scs/sgx-runtime?branch=master#bb0b6a206006299ab773a375197c4846a4c83a30" dependencies = [ "frame-executive", "frame-support", @@ -2351,7 +2351,7 @@ dependencies = [ [[package]] name = "sp-io" version = "3.1.0" -source = "git+https://github.com/scs/sgx-runtime?branch=version-update#de9fc665a1e5268e53432841d642d61ddc793db2" +source = "git+https://github.com/scs/sgx-runtime?branch=master#bb0b6a206006299ab773a375197c4846a4c83a30" dependencies = [ "environmental", "hash-db", @@ -2457,7 +2457,7 @@ source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f17 [[package]] name = "sp-std" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git#8a9a8f170f556beb7c86e996f0576ae3df632f9b" +source = "git+https://github.com/paritytech/substrate.git#3f7d2b7658cb87de61b75e3a782d17abd8a915d1" [[package]] name = "sp-storage" @@ -2585,7 +2585,7 @@ dependencies = [ [[package]] name = "substrate-api-client" version = "0.6.0" -source = "git+https://github.com/scs/substrate-api-client?branch=fix-hex-crate#b76eb4603ded4a9bc88b37806e67e519e4071e62" +source = "git+https://github.com/scs/substrate-api-client?branch=master#3c8c04cd785b383dfbacb48a374503e644d13a08" dependencies = [ "frame-metadata", "frame-support", From 649c78852a75d4c09d4d5849531106f6e7ff0f78 Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Tue, 29 Jun 2021 11:33:26 +0200 Subject: [PATCH 72/80] some cleanup --- enclave/src/rpc/worker_api_direct.rs | 4 ++++ primitives/enclave-api/src/lib.rs | 2 +- stf/src/sgx.rs | 2 +- worker/rpc/client/src/direct_client.rs | 3 +-- worker/src/enclave/mod.rs | 2 +- worker/src/worker.rs | 7 +++---- 6 files changed, 11 insertions(+), 9 deletions(-) diff --git a/enclave/src/rpc/worker_api_direct.rs b/enclave/src/rpc/worker_api_direct.rs index 73966bcbfb..a8c77a9985 100644 --- a/enclave/src/rpc/worker_api_direct.rs +++ b/enclave/src/rpc/worker_api_direct.rs @@ -360,6 +360,10 @@ fn init_io_handler() -> IoHandler { let sidechain_import_import_name: &str = "sidechain_importBlock"; rpc_methods_vec.push(sidechain_import_import_name); io.add_sync_method(sidechain_import_import_name, |sidechain_blocks: Params| { + // Todo: actually do something with the block, i.e., apply the state diff. + // However, this requires importing the stf here. So, before doing that and increase + // the size of init_io_handler even more. We should think about how we can do that more + // modularized. debug!("sidechain_importBlock rpc. Params: {:?}", sidechain_blocks); let block_vec: Vec = sidechain_blocks.parse()?; let blocks: Vec = Decode::decode(&mut block_vec.as_slice()) diff --git a/primitives/enclave-api/src/lib.rs b/primitives/enclave-api/src/lib.rs index 9e6d1c525c..9e0c837465 100644 --- a/primitives/enclave-api/src/lib.rs +++ b/primitives/enclave-api/src/lib.rs @@ -3,7 +3,7 @@ //! This serves as a proof of concept on how we could design the interface between the worker and //! the enclave. //! -//! Design principle here should be to keep the interfaces as slim as possible - because then the +//! Design principle here should be to keep the traits as slim as possible - because then the //! worker can also define slim interfaces with less demanding trait bounds. //! //! This can further be simplified once https://github.com/integritee-network/worker/issues/254 diff --git a/stf/src/sgx.rs b/stf/src/sgx.rs index 41cc717b1f..455ca0cca0 100644 --- a/stf/src/sgx.rs +++ b/stf/src/sgx.rs @@ -432,12 +432,12 @@ impl Stf { } pub fn apply_state_diff(ext: &mut impl StfTrait, state_payload: &mut StatePayload) -> StfResult<()> { + // Todo: how do we ensure that the apriori state hash matches? ensure!(ext.hash() == state_payload.state_hash_apriori(), StfError::StorageHashMismatch); let mut ext2 = ext.clone(); Self::update_storage(&mut ext2, &StateTypeDiff::decode(state_payload.state_update.clone())); ensure!(ext2.hash() == state_payload.state_hash_aposteriori(), StfError::InvalidStorageDiff); *ext = ext2; - // If the apriori state hash matches, we should not prune any state_diffs we want to gossip. ext.prune_state_diff(); Ok(()) } diff --git a/worker/rpc/client/src/direct_client.rs b/worker/rpc/client/src/direct_client.rs index ee40105075..94cba6cb52 100644 --- a/worker/rpc/client/src/direct_client.rs +++ b/worker/rpc/client/src/direct_client.rs @@ -1,7 +1,7 @@ ///! Interface for direct access to a workers rpc. /// /// This is should be replaced with the `jsonrpsee::WsClient` it is async an removes a lot of -/// boilerplate code. +/// boilerplate code. Example usage in worker/worker.rs. /// use log::*; @@ -16,7 +16,6 @@ use ws::{connect, CloseCode, Handler, Handshake, Message, Result as ClientResult use substratee_worker_primitives::{DirectRequestStatus, RpcRequest, RpcResponse, RpcReturnValue}; use sgx_crypto_helper::rsa3072::Rsa3072PubKey; -use substratee_worker_primitives::block::SignedBlock; pub struct WsClient { pub out: Sender, diff --git a/worker/src/enclave/mod.rs b/worker/src/enclave/mod.rs index 942e1cdc97..6d53fba9da 100644 --- a/worker/src/enclave/mod.rs +++ b/worker/src/enclave/mod.rs @@ -1,4 +1,4 @@ pub mod api; pub mod attestation_ocalls; pub mod tls_ra; -pub mod worker_api_direct_server; \ No newline at end of file +pub mod worker_api_direct_server; diff --git a/worker/src/worker.rs b/worker/src/worker.rs index 61894fdb26..50025edaba 100644 --- a/worker/src/worker.rs +++ b/worker/src/worker.rs @@ -11,7 +11,6 @@ use jsonrpsee::{ ws_client::WsClientBuilder, }; use log::info; -use std::sync::Arc; use substratee_api_client_extensions::SubstrateeRegistryApi; // @@ -28,10 +27,10 @@ pub type WorkerResult = Result; // also serves a guide when traits should be split into subtraits. pub struct Worker { config: Config, - node_api: NodeApi, + node_api: NodeApi, // todo: Depending on system design, all the api fields should be Arc // unused yet, but will be used when more methods are migrated to the worker _enclave_api: Enclave, - _worker_api_direct: Arc, + _worker_api_direct: WorkerApiDirect, } impl Worker { @@ -45,7 +44,7 @@ impl Worker Date: Tue, 29 Jun 2021 12:02:46 +0200 Subject: [PATCH 73/80] bump jsonrpc-core and thereby remove duplicate st-std dep --- enclave/Cargo.lock | 81 ++++++++++++++++++++++------------------------ 1 file changed, 38 insertions(+), 43 deletions(-) diff --git a/enclave/Cargo.lock b/enclave/Cargo.lock index 0f9092656c..f29a2a905f 100644 --- a/enclave/Cargo.lock +++ b/enclave/Cargo.lock @@ -507,7 +507,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-std", "sp-tracing", ] @@ -518,7 +518,7 @@ source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f17 dependencies = [ "parity-scale-codec", "sp-core", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-std", ] [[package]] @@ -541,7 +541,7 @@ dependencies = [ "sp-io", "sp-runtime", "sp-staking", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-std", "sp-tracing", ] @@ -591,7 +591,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-std", "sp-version", ] @@ -982,14 +982,14 @@ checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736" [[package]] name = "jsonrpc-core" version = "16.1.0" -source = "git+https://github.com/scs/jsonrpc?branch=no_std#e5ee60bc30dedf513743843be2523dc384bbcae1" +source = "git+https://github.com/scs/jsonrpc?branch=no_std#9c9f399f801f68636e56c973654424f2ac2747fb" dependencies = [ "futures 0.3.8", "log", "serde 1.0.118", "serde_derive", "serde_json 1.0.60", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git)", + "sp-std", ] [[package]] @@ -1283,7 +1283,7 @@ dependencies = [ "sp-application-crypto", "sp-consensus-aura", "sp-runtime", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-std", ] [[package]] @@ -1297,7 +1297,7 @@ dependencies = [ "parity-scale-codec", "sp-authorship", "sp-runtime", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-std", ] [[package]] @@ -1311,7 +1311,7 @@ dependencies = [ "max-encoded-len", "parity-scale-codec", "sp-runtime", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-std", ] [[package]] @@ -1332,7 +1332,7 @@ dependencies = [ "sp-runtime", "sp-session", "sp-staking", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-std", ] [[package]] @@ -1345,7 +1345,7 @@ dependencies = [ "parity-scale-codec", "safe-mix", "sp-runtime", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-std", ] [[package]] @@ -1364,7 +1364,7 @@ dependencies = [ "sp-runtime", "sp-session", "sp-staking", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-std", ] [[package]] @@ -1377,7 +1377,7 @@ dependencies = [ "parity-scale-codec", "sp-io", "sp-runtime", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-std", ] [[package]] @@ -1392,7 +1392,7 @@ dependencies = [ "parity-scale-codec", "sp-inherents", "sp-runtime", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-std", "sp-timestamp", ] @@ -1408,7 +1408,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-std", ] [[package]] @@ -1929,7 +1929,7 @@ dependencies = [ "sp-offchain", "sp-runtime", "sp-session", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-std", "sp-transaction-pool", "sp-version", ] @@ -2193,7 +2193,7 @@ dependencies = [ "sp-api-proc-macro", "sp-core", "sp-runtime", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-std", "sp-version", ] @@ -2218,7 +2218,7 @@ dependencies = [ "parity-scale-codec", "sp-core", "sp-io", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-std", ] [[package]] @@ -2230,7 +2230,7 @@ dependencies = [ "num-traits 0.2.14", "parity-scale-codec", "sp-debug-derive", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-std", "static_assertions", ] @@ -2242,7 +2242,7 @@ dependencies = [ "parity-scale-codec", "sp-inherents", "sp-runtime", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-std", ] [[package]] @@ -2254,7 +2254,7 @@ dependencies = [ "sp-api", "sp-inherents", "sp-runtime", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-std", ] [[package]] @@ -2268,7 +2268,7 @@ dependencies = [ "sp-consensus-slots", "sp-inherents", "sp-runtime", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-std", "sp-timestamp", ] @@ -2306,7 +2306,7 @@ dependencies = [ "sha2 0.9.5", "sp-debug-derive", "sp-runtime-interface", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-std", "sp-storage", "tiny-keccak", "twox-hash", @@ -2334,7 +2334,7 @@ dependencies = [ "sp-application-crypto", "sp-core", "sp-runtime", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-std", ] [[package]] @@ -2345,7 +2345,7 @@ dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", "sp-core", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-std", ] [[package]] @@ -2362,7 +2362,7 @@ dependencies = [ "sgx_types", "sp-core", "sp-runtime-interface", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-std", "sp-tracing", "sp-wasm-interface", "tracing", @@ -2396,7 +2396,7 @@ dependencies = [ "sp-arithmetic", "sp-core", "sp-io", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-std", ] [[package]] @@ -2408,7 +2408,7 @@ dependencies = [ "parity-scale-codec", "primitive-types", "sp-runtime-interface-proc-macro", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-std", "sp-storage", "sp-tracing", "sp-wasm-interface", @@ -2436,7 +2436,7 @@ dependencies = [ "sp-api", "sp-core", "sp-staking", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-std", ] [[package]] @@ -2446,7 +2446,7 @@ source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f17 dependencies = [ "parity-scale-codec", "sp-runtime", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-std", ] [[package]] @@ -2454,11 +2454,6 @@ name = "sp-std" version = "3.0.0" source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" -[[package]] -name = "sp-std" -version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git#3f7d2b7658cb87de61b75e3a782d17abd8a915d1" - [[package]] name = "sp-storage" version = "3.0.0" @@ -2467,7 +2462,7 @@ dependencies = [ "parity-scale-codec", "ref-cast", "sp-debug-derive", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-std", ] [[package]] @@ -2479,7 +2474,7 @@ dependencies = [ "sp-api", "sp-inherents", "sp-runtime", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-std", ] [[package]] @@ -2488,7 +2483,7 @@ version = "3.0.0" source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f170f556beb7c86e996f0576ae3df632f9b" dependencies = [ "parity-scale-codec", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-std", "tracing", "tracing-core", ] @@ -2511,7 +2506,7 @@ dependencies = [ "memory-db", "parity-scale-codec", "sp-core", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-std", "trie-db", "trie-root", ] @@ -2535,7 +2530,7 @@ source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f17 dependencies = [ "parity-scale-codec", "sp-runtime", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-std", "sp-version-proc-macro", ] @@ -2558,7 +2553,7 @@ source = "git+https://github.com/paritytech/substrate.git?branch=master#8a9a8f17 dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-std", ] [[package]] @@ -2593,7 +2588,7 @@ dependencies = [ "parity-scale-codec", "sp-core", "sp-runtime", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-std", ] [[package]] @@ -2679,7 +2674,7 @@ dependencies = [ "sp-finality-grandpa", "sp-io", "sp-runtime", - "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=master)", + "sp-std", "sp-utils", "sp-version", "substrate-api-client", From cd22c4aa29f0a4fcc2561123dc34199638e1489c Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Tue, 29 Jun 2021 12:04:26 +0200 Subject: [PATCH 74/80] bump api-client --- enclave/Cargo.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/enclave/Cargo.lock b/enclave/Cargo.lock index f29a2a905f..b195497697 100644 --- a/enclave/Cargo.lock +++ b/enclave/Cargo.lock @@ -2580,7 +2580,7 @@ dependencies = [ [[package]] name = "substrate-api-client" version = "0.6.0" -source = "git+https://github.com/scs/substrate-api-client?branch=master#3c8c04cd785b383dfbacb48a374503e644d13a08" +source = "git+https://github.com/scs/substrate-api-client?branch=master#731a3a5c3a16ed3ce7f1f6b50593a2cdfd08a39f" dependencies = [ "frame-metadata", "frame-support", From 9b2fa2ee759311e95cedde019811699042e86bc5 Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Tue, 29 Jun 2021 13:42:57 +0200 Subject: [PATCH 75/80] Cargo.lock after rebase --- Cargo.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 7b783dcb96..f9405a7ea7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6170,7 +6170,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04f8ab788026715fa63b31960869617cba39117e520eb415b0139543e325ab59" dependencies = [ "cfg-if 0.1.10", - "rand 0.7.3", + "rand 0.3.23", "static_assertions", ] From 02fc88b1fb900bd1d999d51c12f6ab7c1aae3622 Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Tue, 29 Jun 2021 13:44:13 +0200 Subject: [PATCH 76/80] remove obsolete Cargo feature --- Cargo.toml | 3 --- 1 file changed, 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 38d1d195d7..d05443bcd2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,3 @@ -# this can be removed when the enclave's toolchain is > rustc 1.50 -cargo-features = ["resolver"] - [workspace] resolver = "2" members = [ From e805a05611f494820b4acb46bf1641db3efa465f Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Tue, 29 Jun 2021 14:00:24 +0200 Subject: [PATCH 77/80] cleanup --- local-setup/launch.py | 2 +- worker/rpc/client/src/direct_client.rs | 2 +- worker/rpc/server/src/mock.rs | 2 ++ worker/src/main.rs | 4 ++-- worker/src/worker.rs | 13 ++++++------- 5 files changed, 12 insertions(+), 11 deletions(-) diff --git a/local-setup/launch.py b/local-setup/launch.py index 0a7f536956..1c7d869ec8 100755 --- a/local-setup/launch.py +++ b/local-setup/launch.py @@ -42,7 +42,7 @@ def main(processes): print('Starting worker 1 in background') processes.append(w1.run_in_background(log_file=worker1_log, flags=['-P', '2000'], subcommand_flags=['--skip-ra'])) - # prevent nonce clash, when bootstrapping the enclave's account + # sleep to prevent nonce clash when bootstrapping the enclave's account sleep(6) print('Starting worker 2 in background') processes.append(w2.run_in_background(log_file=worker2_log, flags=['-P', '3000'], subcommand_flags=['--skip-ra'])) diff --git a/worker/rpc/client/src/direct_client.rs b/worker/rpc/client/src/direct_client.rs index 94cba6cb52..d66ac0cd20 100644 --- a/worker/rpc/client/src/direct_client.rs +++ b/worker/rpc/client/src/direct_client.rs @@ -1,6 +1,6 @@ ///! Interface for direct access to a workers rpc. /// -/// This is should be replaced with the `jsonrpsee::WsClient` it is async an removes a lot of +/// This should be replaced with the `jsonrpsee::WsClient` it is async an removes a lot of /// boilerplate code. Example usage in worker/worker.rs. /// diff --git a/worker/rpc/server/src/mock.rs b/worker/rpc/server/src/mock.rs index 0d4d4023a9..ce5bbbd732 100644 --- a/worker/rpc/server/src/mock.rs +++ b/worker/rpc/server/src/mock.rs @@ -17,6 +17,8 @@ impl EnclaveApi for TestEnclave { } } +// todo: this is a duplicate that is also defined in the worker. We should extract an independent +// test-utils crate because here we don't want to depend on the worker itself. pub fn test_sidechain_block() -> SignedBlock { use sp_core::{H256, Pair}; diff --git a/worker/src/main.rs b/worker/src/main.rs index 3793f8b842..be5511054b 100644 --- a/worker/src/main.rs +++ b/worker/src/main.rs @@ -70,7 +70,7 @@ use substratee_settings::files::{ use worker::{Worker as WorkerGen}; use crate::utils::{extract_shard, hex_encode, check_files, write_slice_and_whitespace_pad}; -use crate::worker::{WorkerT, worker_url_into_async_rpc_port}; +use crate::worker::{WorkerT, worker_url_into_async_rpc_url}; mod enclave; mod ipfs; @@ -274,7 +274,7 @@ fn worker( // listen for sidechain_block import request. Later the `start_worker_api_direct_server` // should be merged into this one. let enclave = Enclave::new(eid); - let url = worker_url_into_async_rpc_port(&config.worker_url()).unwrap(); + let url = worker_url_into_async_rpc_url(&config.worker_url()).unwrap(); let handle = TOKIO_HANDLE.lock().unwrap().as_ref().unwrap().clone(); handle.spawn(async move { diff --git a/worker/src/worker.rs b/worker/src/worker.rs index 50025edaba..a4006fc0e8 100644 --- a/worker/src/worker.rs +++ b/worker/src/worker.rs @@ -11,15 +11,14 @@ use jsonrpsee::{ ws_client::WsClientBuilder, }; use log::info; +use std::num::ParseIntError; use substratee_api_client_extensions::SubstrateeRegistryApi; -// use substratee_worker_primitives::block::SignedBlock as SignedSidechainBlock; +use substratee_node_primitives::Enclave as EnclaveMetadata; use crate::config::Config; use crate::error::Error; -use std::num::ParseIntError; -use substratee_node_primitives::Enclave as EnclaveMetadata; pub type WorkerResult = Result; @@ -76,7 +75,7 @@ where for p in peers.iter() { // Todo: once the two direct servers are merged, remove this. - let url = worker_url_into_async_rpc_port(&p.url)?; + let url = worker_url_into_async_rpc_url(&p.url)?; info!("Gossiping block to peer with address: {:?}", url); let client = WsClientBuilder::default().build(&url).await?; let response: String = client @@ -101,7 +100,7 @@ where /// Temporary method that transforms the workers rpc port of the direct api defined in rpc/direct_client /// to the new version in rpc/server. Remove this, when all the methods have been migrated to the new one /// in rpc/server. -pub fn worker_url_into_async_rpc_port(url: &str) -> WorkerResult { +pub fn worker_url_into_async_rpc_url(url: &str) -> WorkerResult { // [Option("ws"), //ip, port] let mut url_vec: Vec<&str> = url.split(":").collect(); match url_vec.len() { @@ -133,7 +132,7 @@ mod tests { commons::{local_worker_config, test_sidechain_block}, mock::{TestNodeApi, W1_URL, W2_URL}, }; - use crate::worker::{Worker, WorkerT, worker_url_into_async_rpc_port}; + use crate::worker::{Worker, WorkerT, worker_url_into_async_rpc_url}; fn init() { let _ = env_logger::builder().is_test(true).try_init(); @@ -159,7 +158,7 @@ mod tests { #[tokio::test] async fn gossip_blocks_works() { init(); - run_server(worker_url_into_async_rpc_port(W2_URL).unwrap()).await.unwrap(); + run_server(worker_url_into_async_rpc_url(W2_URL).unwrap()).await.unwrap(); let worker = Worker::new(local_worker_config(W1_URL.into()), TestNodeApi, (), ()); From d29e216bc1357d605e756b1e1facc458db03122c Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Tue, 29 Jun 2021 14:20:44 +0200 Subject: [PATCH 78/80] [primitives/enclave-api] add documentation to ffi --- primitives/enclave-api/ffi/src/lib.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/primitives/enclave-api/ffi/src/lib.rs b/primitives/enclave-api/ffi/src/lib.rs index d3920956e4..93dc5e3bb0 100644 --- a/primitives/enclave-api/ffi/src/lib.rs +++ b/primitives/enclave-api/ffi/src/lib.rs @@ -1,3 +1,6 @@ +///! FFI's that call into the enclave. These functions need to be added to the +/// enclave edl file and be implemented within the enclave. + use sgx_types::{sgx_enclave_id_t, sgx_status_t}; extern "C" { From 4686d2d4b8fc68dbb6dfc498f3b74434e64029fc Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Tue, 29 Jun 2021 14:27:05 +0200 Subject: [PATCH 79/80] typos --- enclave/src/rpc/worker_api_direct.rs | 2 +- worker/rpc/client/src/direct_client.rs | 2 +- worker/src/worker.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/enclave/src/rpc/worker_api_direct.rs b/enclave/src/rpc/worker_api_direct.rs index a8c77a9985..4cad4a48e6 100644 --- a/enclave/src/rpc/worker_api_direct.rs +++ b/enclave/src/rpc/worker_api_direct.rs @@ -362,7 +362,7 @@ fn init_io_handler() -> IoHandler { io.add_sync_method(sidechain_import_import_name, |sidechain_blocks: Params| { // Todo: actually do something with the block, i.e., apply the state diff. // However, this requires importing the stf here. So, before doing that and increase - // the size of init_io_handler even more. We should think about how we can do that more + // the size of init_io_handler even more, we should think about how we can do that more // modularized. debug!("sidechain_importBlock rpc. Params: {:?}", sidechain_blocks); let block_vec: Vec = sidechain_blocks.parse()?; diff --git a/worker/rpc/client/src/direct_client.rs b/worker/rpc/client/src/direct_client.rs index d66ac0cd20..098bf88e6c 100644 --- a/worker/rpc/client/src/direct_client.rs +++ b/worker/rpc/client/src/direct_client.rs @@ -1,6 +1,6 @@ ///! Interface for direct access to a workers rpc. /// -/// This should be replaced with the `jsonrpsee::WsClient` it is async an removes a lot of +/// This should be replaced with the `jsonrpsee::WsClient`. It is async an removes a lot of /// boilerplate code. Example usage in worker/worker.rs. /// diff --git a/worker/src/worker.rs b/worker/src/worker.rs index a4006fc0e8..936bcfc2c2 100644 --- a/worker/src/worker.rs +++ b/worker/src/worker.rs @@ -1,7 +1,7 @@ ///! Substratee worker. Inspiration for this design came from parity's substrate Client. /// -/// This should serve as a proof of concept for a design I have in mind. Ultimately, everything +/// This should serve as a proof of concept for a potential refactoring design. Ultimately, everything /// from the main.rs should be covered by the worker struct here - hidden and split across /// multiple traits. From 6fe34b9e1f8fde141458d2cb98f06ad05fe7aeb8 Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Tue, 29 Jun 2021 14:27:46 +0200 Subject: [PATCH 80/80] Makefile: default to SG_MODE=HW --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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