From bad3ce4e176a829c94230fba6177bf6ebe71441a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20K=C3=B6cher?= Date: Mon, 29 Apr 2019 16:55:20 +0200 Subject: [PATCH] Cumulus changes version 2 (#2313) * ensure imbalances are properly accounted for (#2183) * ensure imbalances are properly accounted for * bump runtime version * Update node/runtime/src/lib.rs * implement contract events (#2161) * implement contract events * update runtime * renaming * update test code hash * improve complexity details * add deposit event base cost * add test * Revert "add deposit event base cost" This reverts commit 58ec010c0f4f4f0e16935ad41da32aedd17a8c57. * update test * Revert "update test" This reverts commit 6fe61a593ccf0d41f09a0b97472b28ed8751a999. * Revert "Revert "add deposit event base cost"" This reverts commit 145e8a9bac15313a4c380aa66b94fd4d36fa3f6d. * Fix format a bit * Replace Vec with [u8; 32] for contract storage key (#2184) * Replace Vec with [u8; 32] for contract storage key * Read storage keys from sandbox memory into fixed size buffer * Increment `impl_version` * Remove redundant Ok(()) and explicitly specify StorageKey buffer type (#2188) * Switch to `derive(Encode, Decode)` for `Call` (#2178) * Add some tests * More tests * Switch to `derive(Encode, Decode)` for `Call` * Update lock files * Simplify the macro cases * Cache changes trie config in db storage (#2170) * cache changes trie config in db storage * Update core/client/db/src/lib.rs Co-Authored-By: svyatonik * Update core/client/db/src/lib.rs Co-Authored-By: svyatonik * Fix version check for renamed runtime api methods (#2190) * Add feature to disable including the test-runtime wasm blob * Enable `std` feature for `consensus_authorities` * Implement `skip_initialize_block` and `initialize_block` for runtime api * Add test and fixes bug * Begin to implement support for passing the `ProofRecorder` * Make sure proof generation works as intended * Fixes tests * Make `BlockBuilder` generate proofs on request. * Adds `TestClientBuilder` to simplify creating a test client * Add `include-wasm-blob` to `test-client` as well * Make `test-client` compile without including the wasm file * Disable more stuff in test-client without wasm * Reorganize the re-exports * Use correct bounds * Update docs * Update core/client/src/block_builder/block_builder.rs Co-Authored-By: bkchr * Extend test to actually generated proof * Switch to enum for `skip_initialize_block` * Some wasm files updates --- substrate/Cargo.lock | 2 + .../basic-authorship/src/basic_authorship.rs | 5 +- .../client/src/block_builder/block_builder.rs | 69 ++++++-- substrate/core/client/src/call_executor.rs | 136 ++++++++------- substrate/core/client/src/client.rs | 76 ++++++--- .../core/client/src/light/call_executor.rs | 52 ++++-- substrate/core/client/src/runtime_api.rs | 55 +++++- .../core/executor/src/native_executor.rs | 3 +- substrate/core/finality-grandpa/src/tests.rs | 8 + substrate/core/service/src/components.rs | 15 +- substrate/core/sr-api-macros/Cargo.toml | 2 + .../sr-api-macros/src/decl_runtime_apis.rs | 70 ++++++-- .../sr-api-macros/src/impl_runtime_apis.rs | 42 ++++- .../core/sr-api-macros/tests/runtime_calls.rs | 80 ++++++++- substrate/core/sr-primitives/src/traits.rs | 6 + substrate/core/state-machine/src/lib.rs | 9 +- .../core/state-machine/src/proving_backend.rs | 27 ++- substrate/core/test-client/Cargo.toml | 15 +- substrate/core/test-client/src/client_ext.rs | 34 +++- substrate/core/test-client/src/lib.rs | 160 ++++++++++++++---- substrate/core/test-runtime/Cargo.toml | 7 +- substrate/core/test-runtime/src/genesismap.rs | 9 +- substrate/core/test-runtime/src/lib.rs | 43 ++++- substrate/core/test-runtime/src/system.rs | 16 +- substrate/core/test-runtime/wasm/Cargo.lock | 42 ++--- .../node-template/runtime/wasm/Cargo.lock | 42 ++--- substrate/node/runtime/wasm/Cargo.lock | 42 ++--- 27 files changed, 800 insertions(+), 267 deletions(-) diff --git a/substrate/Cargo.lock b/substrate/Cargo.lock index 0e83b961ca..fd55b572e8 100644 --- a/substrate/Cargo.lock +++ b/substrate/Cargo.lock @@ -3160,12 +3160,14 @@ version = "1.0.0" dependencies = [ "blake2-rfc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)", "criterion 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 3.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "proc-macro-crate 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "proc-macro2 0.4.28 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", "sr-primitives 1.0.0", "sr-version 1.0.0", "substrate-client 1.0.0", + "substrate-consensus-common 1.0.0", "substrate-primitives 1.0.0", "substrate-state-machine 1.0.0", "substrate-test-client 1.0.0", diff --git a/substrate/core/basic-authorship/src/basic_authorship.rs b/substrate/core/basic-authorship/src/basic_authorship.rs index 6dee9be4a2..9f0db708da 100644 --- a/substrate/core/basic-authorship/src/basic_authorship.rs +++ b/substrate/core/basic-authorship/src/basic_authorship.rs @@ -296,13 +296,12 @@ mod tests { use test_client::{self, runtime::{Extrinsic, Transfer}, AccountKeyring}; fn extrinsic(nonce: u64) -> Extrinsic { - let tx = Transfer { + Transfer { amount: Default::default(), nonce, from: AccountKeyring::Alice.into(), to: Default::default(), - }; - tx.into_signed_tx() + }.into_signed_tx() } #[test] diff --git a/substrate/core/client/src/block_builder/block_builder.rs b/substrate/core/client/src/block_builder/block_builder.rs index 5c168b2f05..4d40bed9b0 100644 --- a/substrate/core/client/src/block_builder/block_builder.rs +++ b/substrate/core/client/src/block_builder/block_builder.rs @@ -24,10 +24,9 @@ use runtime_primitives::traits::{ }; use primitives::{H256, ExecutionContext}; use crate::blockchain::HeaderBackend; -use crate::runtime_api::Core; +use crate::runtime_api::{Core, ApiExt}; use crate::error; - /// Utility for building new (valid) blocks from a stream of extrinsics. pub struct BlockBuilder<'a, Block, A: ProvideRuntimeApi> where Block: BlockT { header: ::Header, @@ -44,12 +43,22 @@ where { /// Create a new instance of builder from the given client, building on the latest block. pub fn new(api: &'a A) -> error::Result { - api.info().and_then(|i| Self::at_block(&BlockId::Hash(i.best_hash), api)) + api.info().and_then(|i| + Self::at_block(&BlockId::Hash(i.best_hash), api, false) + ) } - /// Create a new instance of builder from the given client using a particular block's ID to - /// build upon. - pub fn at_block(block_id: &BlockId, api: &'a A) -> error::Result { + /// Create a new instance of builder from the given client using a + /// particular block's ID to build upon with optional proof recording enabled. + /// + /// While proof recording is enabled, all accessed trie nodes are saved. + /// These recorded trie nodes can be used by a third party to proof the + /// output of this block builder without having access to the full storage. + pub fn at_block( + block_id: &BlockId, + api: &'a A, + proof_recording: bool + ) -> error::Result { let number = api.block_number_from_id(block_id)? .ok_or_else(|| error::Error::UnknownBlock(format!("{}", block_id)))? + One::one(); @@ -63,8 +72,17 @@ where parent_hash, Default::default() ); - let api = api.runtime_api(); - api.initialize_block_with_context(block_id, ExecutionContext::BlockConstruction, &header)?; + + let mut api = api.runtime_api(); + + if proof_recording { + api.record_proof(); + } + + api.initialize_block_with_context( + block_id, ExecutionContext::BlockConstruction, &header + )?; + Ok(BlockBuilder { header, extrinsics: Vec::new(), @@ -77,13 +95,15 @@ where /// /// This will ensure the extrinsic can be validly executed (by executing it); pub fn push(&mut self, xt: ::Extrinsic) -> error::Result<()> { - use crate::runtime_api::ApiExt; - let block_id = &self.block_id; let extrinsics = &mut self.extrinsics; self.api.map_api_result(|api| { - match api.apply_extrinsic_with_context(block_id, ExecutionContext::BlockConstruction, xt.clone())? { + match api.apply_extrinsic_with_context( + block_id, + ExecutionContext::BlockConstruction, + xt.clone() + )? { Ok(ApplyOutcome::Success) | Ok(ApplyOutcome::Fail) => { extrinsics.push(xt); Ok(()) @@ -97,13 +117,34 @@ where /// Consume the builder to return a valid `Block` containing all pushed extrinsics. pub fn bake(mut self) -> error::Result { - self.header = self.api.finalize_block_with_context(&self.block_id, ExecutionContext::BlockConstruction)?; + self.bake_impl()?; + Ok(::new(self.header, self.extrinsics)) + } + + fn bake_impl(&mut self) -> error::Result<()> { + self.header = self.api.finalize_block_with_context( + &self.block_id, ExecutionContext::BlockConstruction + )?; debug_assert_eq!( self.header.extrinsics_root().clone(), - HashFor::::ordered_trie_root(self.extrinsics.iter().map(Encode::encode)), + HashFor::::ordered_trie_root( + self.extrinsics.iter().map(Encode::encode) + ), ); - Ok(::new(self.header, self.extrinsics)) + Ok(()) + } + + /// Consume the builder to return a valid `Block` containing all pushed extrinsics + /// and the generated proof. + /// + /// The proof will be `Some(_)`, if proof recording was enabled while creating + /// the block builder. + pub fn bake_and_extract_proof(mut self) -> error::Result<(Block, Option>>)> { + self.bake_impl()?; + + let proof = self.api.extract_proof(); + Ok((::new(self.header, self.extrinsics), proof)) } } diff --git a/substrate/core/client/src/call_executor.rs b/substrate/core/client/src/call_executor.rs index 4f6f02c94c..9a47d1ac21 100644 --- a/substrate/core/client/src/call_executor.rs +++ b/substrate/core/client/src/call_executor.rs @@ -14,21 +14,25 @@ // You should have received a copy of the GNU General Public License // along with Substrate. If not, see . -use std::{sync::Arc, cmp::Ord, panic::UnwindSafe, result}; +use std::{sync::Arc, cmp::Ord, panic::UnwindSafe, result, cell::RefCell, rc::Rc}; use parity_codec::{Encode, Decode}; -use runtime_primitives::generic::BlockId; -use runtime_primitives::traits::{Block as BlockT, RuntimeApiInfo}; +use runtime_primitives::{ + generic::BlockId, traits::Block as BlockT, +}; use state_machine::{ - self, OverlayedChanges, Ext, CodeExecutor, ExecutionManager, ExecutionStrategy, NeverOffchainExt, + self, OverlayedChanges, Ext, CodeExecutor, ExecutionManager, + ExecutionStrategy, NeverOffchainExt, backend::Backend as _, }; use executor::{RuntimeVersion, RuntimeInfo, NativeVersion}; use hash_db::Hasher; use trie::MemoryDB; -use primitives::{H256, Blake2Hasher, NativeOrEncoded, NeverNativeValue, OffchainExt}; +use primitives::{ + H256, Blake2Hasher, NativeOrEncoded, NeverNativeValue, OffchainExt +}; +use crate::runtime_api::{ProofRecorder, InitializeBlock}; use crate::backend; use crate::error; -use crate::runtime_api::Core as CoreApi; /// Method call executor. pub trait CallExecutor @@ -60,8 +64,9 @@ where /// Before executing the method, passed header is installed as the current header /// of the execution context. fn contextual_call< + 'a, O: OffchainExt, - PB: Fn() -> error::Result, + IB: Fn() -> error::Result<()>, EM: Fn( Result, Self::Error>, Result, Self::Error> @@ -70,15 +75,16 @@ where NC: FnOnce() -> result::Result + UnwindSafe, >( &self, + initialize_block_fn: IB, at: &BlockId, method: &str, call_data: &[u8], - changes: &mut OverlayedChanges, - initialized_block: &mut Option>, - prepare_environment_block: PB, + changes: &RefCell, + initialize_block: InitializeBlock<'a, B>, execution_manager: ExecutionManager, native_call: Option, side_effects_handler: Option<&mut O>, + proof_recorder: &Option>>>, ) -> error::Result> where ExecutionManager: Clone; /// Extract RuntimeVersion of given block @@ -119,7 +125,10 @@ where call_data: &[u8] ) -> Result<(Vec, Vec>), error::Error> { let trie_state = state.try_into_trie_backend() - .ok_or_else(|| Box::new(state_machine::ExecutionError::UnableToGenerateProof) as Box)?; + .ok_or_else(|| + Box::new(state_machine::ExecutionError::UnableToGenerateProof) + as Box + )?; self.prove_at_trie_state(&trie_state, overlay, method, call_data) } @@ -172,7 +181,8 @@ where { type Error = E::Error; - fn call(&self, + fn call( + &self, id: &BlockId, method: &str, call_data: &[u8], @@ -200,8 +210,9 @@ where } fn contextual_call< + 'a, O: OffchainExt, - PB: Fn() -> error::Result, + IB: Fn() -> error::Result<()>, EM: Fn( Result, Self::Error>, Result, Self::Error> @@ -210,64 +221,75 @@ where NC: FnOnce() -> result::Result + UnwindSafe, >( &self, + initialize_block_fn: IB, at: &BlockId, method: &str, call_data: &[u8], - changes: &mut OverlayedChanges, - initialized_block: &mut Option>, - prepare_environment_block: PB, + changes: &RefCell, + initialize_block: InitializeBlock<'a, Block>, execution_manager: ExecutionManager, native_call: Option, - mut side_effects_handler: Option<&mut O>, + side_effects_handler: Option<&mut O>, + recorder: &Option>>>, ) -> Result, error::Error> where ExecutionManager: Clone { + match initialize_block { + InitializeBlock::Do(ref init_block) + if init_block.borrow().as_ref().map(|id| id != at).unwrap_or(true) => { + initialize_block_fn()?; + }, + // We don't need to initialize the runtime at a block. + _ => {}, + } + let state = self.backend.state_at(*at)?; - let core_version = self.runtime_version(at)?.apis.iter().find(|a| a.0 == CoreApi::::ID).map(|a| a.1); - let init_block_function = if core_version < Some(2) { - "Core_initialise_block" - } else { - "Core_initialize_block" - }; + match recorder { + Some(recorder) => { + let trie_state = state.try_into_trie_backend() + .ok_or_else(|| + Box::new(state_machine::ExecutionError::UnableToGenerateProof) + as Box + )?; - if method != init_block_function && initialized_block.map(|id| id != *at).unwrap_or(true) { - let header = prepare_environment_block()?; - state_machine::new( + let backend = state_machine::ProvingBackend::new_with_recorder( + &trie_state, + recorder.clone() + ); + + state_machine::new( + &backend, + self.backend.changes_trie_storage(), + side_effects_handler, + &mut *changes.borrow_mut(), + &self.executor, + method, + call_data, + ) + .execute_using_consensus_failure_handler( + execution_manager, + false, + native_call, + ) + .map(|(result, _, _)| result) + .map_err(Into::into) + } + None => state_machine::new( &state, self.backend.changes_trie_storage(), - side_effects_handler.as_mut().map(|x| &mut **x), - changes, + side_effects_handler, + &mut *changes.borrow_mut(), &self.executor, - init_block_function, - &header.encode(), - ).execute_using_consensus_failure_handler::<_, R, fn() -> _>( - execution_manager.clone(), + method, + call_data, + ) + .execute_using_consensus_failure_handler( + execution_manager, false, - None, - )?; - *initialized_block = Some(*at); + native_call, + ) + .map(|(result, _, _)| result) + .map_err(Into::into) } - - let result = state_machine::new( - &state, - self.backend.changes_trie_storage(), - side_effects_handler, - changes, - &self.executor, - method, - call_data, - ).execute_using_consensus_failure_handler( - execution_manager, - false, - native_call, - ).map(|(result, _, _)| result)?; - - // If the method is `initialize_block` we need to set the `initialized_block` - if method == init_block_function { - *initialized_block = Some(*at); - } - - self.backend.destroy_state(state)?; - Ok(result) } fn runtime_version(&self, id: &BlockId) -> error::Result { diff --git a/substrate/core/client/src/client.rs b/substrate/core/client/src/client.rs index 2b4465f19c..d028037b67 100644 --- a/substrate/core/client/src/client.rs +++ b/substrate/core/client/src/client.rs @@ -16,7 +16,10 @@ //! Substrate Client -use std::{marker::PhantomData, collections::{HashSet, BTreeMap, HashMap}, sync::Arc, panic::UnwindSafe, result}; +use std::{ + marker::PhantomData, collections::{HashSet, BTreeMap, HashMap}, sync::Arc, + panic::UnwindSafe, result, cell::RefCell, rc::Rc, +}; use crate::error::Error; use futures::sync::mpsc; use parking_lot::{Mutex, RwLock}; @@ -26,16 +29,23 @@ use runtime_primitives::{ generic::{BlockId, SignedBlock}, }; use consensus::{ - Error as ConsensusError, ErrorKind as ConsensusErrorKind, ImportBlock, ImportResult, - BlockOrigin, ForkChoiceStrategy, well_known_cache_keys::Id as CacheKeyId, + Error as ConsensusError, ErrorKind as ConsensusErrorKind, ImportBlock, + ImportResult, BlockOrigin, ForkChoiceStrategy, + well_known_cache_keys::Id as CacheKeyId, }; use runtime_primitives::traits::{ - Block as BlockT, Header as HeaderT, Zero, As, NumberFor, CurrentHeight, BlockNumberToHash, - ApiRef, ProvideRuntimeApi, Digest, DigestItem + Block as BlockT, Header as HeaderT, Zero, As, NumberFor, CurrentHeight, + BlockNumberToHash, ApiRef, ProvideRuntimeApi, Digest, DigestItem }; use runtime_primitives::BuildStorage; -use crate::runtime_api::{CallRuntimeAt, ConstructRuntimeApi}; -use primitives::{Blake2Hasher, H256, ChangesTrieConfiguration, convert_hash, NeverNativeValue, ExecutionContext}; +use crate::runtime_api::{ + CallRuntimeAt, ConstructRuntimeApi, Core as CoreApi, ProofRecorder, + InitializeBlock, +}; +use primitives::{ + Blake2Hasher, H256, ChangesTrieConfiguration, convert_hash, + NeverNativeValue, ExecutionContext +}; use primitives::storage::{StorageKey, StorageData}; use primitives::storage::well_known_keys; use parity_codec::{Encode, Decode}; @@ -49,8 +59,8 @@ use hash_db::Hasher; use crate::backend::{self, BlockImportOperation, PrunableStateChangesTrieStorage}; use crate::blockchain::{ - self, Info as ChainInfo, Backend as ChainBackend, HeaderBackend as ChainHeaderBackend, - ProvideCache, Cache, + self, Info as ChainInfo, Backend as ChainBackend, + HeaderBackend as ChainHeaderBackend, ProvideCache, Cache, }; use crate::call_executor::{CallExecutor, LocalCallExecutor}; use executor::{RuntimeVersion, RuntimeInfo}; @@ -610,7 +620,23 @@ impl Client where Self: ProvideRuntimeApi, ::Api: BlockBuilderAPI { - block_builder::BlockBuilder::at_block(parent, &self) + block_builder::BlockBuilder::at_block(parent, &self, false) + } + + /// Create a new block, built on top of `parent` with proof recording enabled. + /// + /// While proof recording is enabled, all accessed trie nodes are saved. + /// These recorded trie nodes can be used by a third party to proof the + /// output of this block builder without having access to the full storage. + pub fn new_block_at_with_proof_recording( + &self, parent: &BlockId + ) -> error::Result> where + E: Clone + Send + Sync, + RA: Send + Sync, + Self: ProvideRuntimeApi, + ::Api: BlockBuilderAPI + { + block_builder::BlockBuilder::at_block(parent, &self, true) } /// Lock the import lock, and run operations inside. @@ -1340,27 +1366,36 @@ impl ProvideRuntimeApi for Client where impl CallRuntimeAt for Client where B: backend::Backend, E: CallExecutor + Clone + Send + Sync, - Block: BlockT + Block: BlockT, { fn call_api_at< + 'a, R: Encode + Decode + PartialEq, NC: FnOnce() -> result::Result + UnwindSafe, + C: CoreApi, >( &self, + core_api: &C, at: &BlockId, function: &'static str, args: Vec, - changes: &mut OverlayedChanges, - initialized_block: &mut Option>, + changes: &RefCell, + initialize_block: InitializeBlock<'a, Block>, native_call: Option, context: ExecutionContext, + recorder: &Option>>>, ) -> error::Result> { let manager = match context { - ExecutionContext::BlockConstruction => self.execution_strategies.block_construction.get_manager(), - ExecutionContext::Syncing => self.execution_strategies.syncing.get_manager(), - ExecutionContext::Importing => self.execution_strategies.importing.get_manager(), - ExecutionContext::OffchainWorker(_) => self.execution_strategies.offchain_worker.get_manager(), - ExecutionContext::Other => self.execution_strategies.other.get_manager(), + ExecutionContext::BlockConstruction => + self.execution_strategies.block_construction.get_manager(), + ExecutionContext::Syncing => + self.execution_strategies.syncing.get_manager(), + ExecutionContext::Importing => + self.execution_strategies.importing.get_manager(), + ExecutionContext::OffchainWorker(_) => + self.execution_strategies.offchain_worker.get_manager(), + ExecutionContext::Other => + self.execution_strategies.other.get_manager(), }; let mut offchain_extensions = match context { @@ -1369,15 +1404,16 @@ impl CallRuntimeAt for Client where }; self.executor.contextual_call::<_, _, fn(_,_) -> _,_,_>( + || core_api.initialize_block(at, &self.prepare_environment_block(at)?), at, function, &args, changes, - initialized_block, - || self.prepare_environment_block(at), + initialize_block, manager, native_call, offchain_extensions.as_mut(), + recorder, ) } diff --git a/substrate/core/client/src/light/call_executor.rs b/substrate/core/client/src/light/call_executor.rs index cbe179b605..0863b17aaa 100644 --- a/substrate/core/client/src/light/call_executor.rs +++ b/substrate/core/client/src/light/call_executor.rs @@ -17,17 +17,24 @@ //! Light client call executor. Executes methods on remote full nodes, fetching //! execution proof and checking it locally. -use std::{collections::HashSet, sync::Arc, panic::UnwindSafe, result, marker::PhantomData}; +use std::{ + collections::HashSet, sync::Arc, panic::UnwindSafe, result, + marker::PhantomData, cell::RefCell, rc::Rc, +}; use futures::{IntoFuture, Future}; use parity_codec::{Encode, Decode}; use primitives::{H256, Blake2Hasher, convert_hash, NativeOrEncoded, OffchainExt}; use runtime_primitives::generic::BlockId; use runtime_primitives::traits::{As, Block as BlockT, Header as HeaderT}; -use state_machine::{self, Backend as StateBackend, CodeExecutor, OverlayedChanges, ExecutionStrategy, - create_proof_check_backend, execution_proof_check_on_trie_backend, ExecutionManager, NeverOffchainExt}; +use state_machine::{ + self, Backend as StateBackend, CodeExecutor, OverlayedChanges, + ExecutionStrategy, create_proof_check_backend, + execution_proof_check_on_trie_backend, ExecutionManager, NeverOffchainExt +}; use hash_db::Hasher; +use crate::runtime_api::{ProofRecorder, InitializeBlock}; use crate::backend::RemoteBackend; use crate::blockchain::Backend as ChainBackend; use crate::call_executor::CallExecutor; @@ -104,8 +111,9 @@ where } fn contextual_call< + 'a, O: OffchainExt, - PB: Fn() -> ClientResult, + IB: Fn() -> ClientResult<()>, EM: Fn( Result, Self::Error>, Result, Self::Error> @@ -114,18 +122,26 @@ where NC, >( &self, + _initialize_block_fn: IB, at: &BlockId, method: &str, call_data: &[u8], - changes: &mut OverlayedChanges, - initialized_block: &mut Option>, - _prepare_environment_block: PB, + changes: &RefCell, + initialize_block: InitializeBlock<'a, Block>, execution_manager: ExecutionManager, _native_call: Option, side_effects_handler: Option<&mut O>, + _recorder: &Option>>>, ) -> ClientResult> where ExecutionManager: Clone { + let block_initialized = match initialize_block { + InitializeBlock::Do(ref init_block) => { + init_block.borrow().is_some() + }, + InitializeBlock::Skip => false, + }; + // it is only possible to execute contextual call if changes are empty - if !changes.is_empty() || initialized_block.is_some() { + if !changes.borrow().is_empty() || block_initialized { return Err(ClientError::NotAvailableOnLightClient.into()); } @@ -231,8 +247,9 @@ impl CallExecutor for } fn contextual_call< + 'a, O: OffchainExt, - PB: Fn() -> ClientResult, + IB: Fn() -> ClientResult<()>, EM: Fn( Result, Self::Error>, Result, Self::Error> @@ -241,15 +258,16 @@ impl CallExecutor for NC: FnOnce() -> result::Result + UnwindSafe, >( &self, + initialize_block_fn: IB, at: &BlockId, method: &str, call_data: &[u8], - changes: &mut OverlayedChanges, - initialized_block: &mut Option>, - prepare_environment_block: PB, + changes: &RefCell, + initialize_block: InitializeBlock<'a, Block>, _manager: ExecutionManager, native_call: Option, side_effects_handler: Option<&mut O>, + recorder: &Option>>>, ) -> ClientResult> where ExecutionManager: Clone { // there's no actual way/need to specify native/wasm execution strategy on light node // => we can safely ignore passed values @@ -266,15 +284,16 @@ impl CallExecutor for NC >( &self.local, + initialize_block_fn, at, method, call_data, changes, - initialized_block, - prepare_environment_block, + initialize_block, ExecutionManager::NativeWhenPossible, native_call, side_effects_handler, + recorder, ).map_err(|e| ClientError::Execution(Box::new(e.to_string()))), false => CallExecutor::contextual_call::< _, @@ -287,15 +306,16 @@ impl CallExecutor for NC >( &self.remote, + initialize_block_fn, at, method, call_data, changes, - initialized_block, - prepare_environment_block, + initialize_block, ExecutionManager::NativeWhenPossible, native_call, side_effects_handler, + recorder, ).map_err(|e| ClientError::Execution(Box::new(e.to_string()))), } } diff --git a/substrate/core/client/src/runtime_api.rs b/substrate/core/client/src/runtime_api.rs index 68eed3b73c..f5c8a59a90 100644 --- a/substrate/core/client/src/runtime_api.rs +++ b/substrate/core/client/src/runtime_api.rs @@ -24,7 +24,10 @@ pub use state_machine::OverlayedChanges; pub use primitives::NativeOrEncoded; #[doc(hidden)] pub use runtime_primitives::{ - traits::{AuthorityIdFor, Block as BlockT, GetNodeBlockType, GetRuntimeBlockType, Header as HeaderT, ApiRef, RuntimeApiInfo}, + traits::{ + AuthorityIdFor, Block as BlockT, GetNodeBlockType, GetRuntimeBlockType, + Header as HeaderT, ApiRef, RuntimeApiInfo, Hash as HashT, + }, generic::BlockId, transaction_validity::TransactionValidity, }; #[doc(hidden)] @@ -42,8 +45,16 @@ use crate::error; use sr_api_macros::decl_runtime_apis; use primitives::OpaqueMetadata; #[cfg(feature = "std")] -use std::panic::UnwindSafe; +use std::{panic::UnwindSafe, cell::RefCell, rc::Rc}; use rstd::vec::Vec; +#[cfg(feature = "std")] +use primitives::Hasher as HasherT; + +#[cfg(feature = "std")] +/// A type that records all accessed trie nodes and generates a proof out of it. +pub type ProofRecorder = state_machine::ProofRecorder< + <<<::Header as HeaderT>::Hashing as HashT>::Hasher as HasherT>::Out +>; /// Something that can be constructed to a runtime api. #[cfg(feature = "std")] @@ -87,6 +98,35 @@ pub trait ApiExt { /// Returns the runtime version at the given block id. fn runtime_version_at(&self, at: &BlockId) -> error::Result; + + /// Start recording all accessed trie nodes for generating proofs. + fn record_proof(&mut self); + + /// Extract the recorded proof. + /// This stops the proof recording. + fn extract_proof(&mut self) -> Option>>; +} + +/// Before calling any runtime api function, the runtime need to be initialized +/// at the requested block. However, some functions like `execute_block` or +/// `initialize_block` itself don't require to have the runtime initialized +/// at the requested block. +/// +/// `call_api_at` is instructed by this enum to do the initialization or to skip +/// it. +#[cfg(feature = "std")] +#[derive(Clone, Copy)] +pub enum InitializeBlock<'a, Block: BlockT> { + /// Skip initializing the runtime for a given block. + /// + /// This is used by functions who do the initialization by themself or don't + /// require it. + Skip, + /// Initialize the runtime for a given block. + /// + /// If the stored `BlockId` is `Some(_)`, the runtime is currently initialized + /// at this block. + Do(&'a RefCell>>), } /// Something that can call into the runtime at a given block. @@ -95,17 +135,21 @@ pub trait CallRuntimeAt { /// Calls the given api function with the given encoded arguments at the given block /// and returns the encoded result. fn call_api_at< + 'a, R: Encode + Decode + PartialEq, NC: FnOnce() -> result::Result + UnwindSafe, + C: Core, >( &self, + core_api: &C, at: &BlockId, function: &'static str, args: Vec, - changes: &mut OverlayedChanges, - initialized_block: &mut Option>, + changes: &RefCell, + initialize_block: InitializeBlock<'a, Block>, native_call: Option, context: ExecutionContext, + recorder: &Option>>>, ) -> error::Result>; /// Returns the runtime version at the given block. @@ -120,9 +164,12 @@ decl_runtime_apis! { /// Returns the version of the runtime. fn version() -> RuntimeVersion; /// Execute the given block. + #[skip_initialize_block] fn execute_block(block: Block); /// Initialize a block with the given header. #[renamed("initialise_block", 2)] + #[skip_initialize_block] + #[initialize_block] fn initialize_block(header: &::Header); /// Returns the authorities. #[deprecated(since = "1.0", note = "Please switch to `AuthoritiesApi`.")] diff --git a/substrate/core/executor/src/native_executor.rs b/substrate/core/executor/src/native_executor.rs index 586073c0d2..0a702a5a1b 100644 --- a/substrate/core/executor/src/native_executor.rs +++ b/substrate/core/executor/src/native_executor.rs @@ -53,11 +53,11 @@ fn fetch_cached_runtime_version<'a, E: Externalities>( ext: &mut E, default_heap_pages: Option, ) -> Result<(&'a WasmModuleInstanceRef, &'a Option)> { - let code_hash = match ext.original_storage_hash(well_known_keys::CODE) { Some(code_hash) => code_hash, None => return Err(ErrorKind::InvalidCode(vec![]).into()), }; + let maybe_runtime_preproc = cache.borrow_mut().entry(code_hash.into()) .or_insert_with(|| { let code = match ext.original_storage(well_known_keys::CODE) { @@ -84,6 +84,7 @@ fn fetch_cached_runtime_version<'a, E: Externalities>( } } }); + match maybe_runtime_preproc { RuntimePreproc::InvalidCode => { let code = ext.original_storage(well_known_keys::CODE).unwrap_or(vec![]); diff --git a/substrate/core/finality-grandpa/src/tests.rs b/substrate/core/finality-grandpa/src/tests.rs index 93d68af01b..3607ae04d8 100644 --- a/substrate/core/finality-grandpa/src/tests.rs +++ b/substrate/core/finality-grandpa/src/tests.rs @@ -306,6 +306,14 @@ impl ApiExt for RuntimeApi { fn runtime_version_at(&self, _: &BlockId) -> Result { unimplemented!("Not required for testing!") } + + fn record_proof(&mut self) { + unimplemented!("Not required for testing!") + } + + fn extract_proof(&mut self) -> Option>> { + unimplemented!("Not required for testing!") + } } impl GrandpaApi for RuntimeApi { diff --git a/substrate/core/service/src/components.rs b/substrate/core/service/src/components.rs index e9fb7c9b19..db2aae4c46 100644 --- a/substrate/core/service/src/components.rs +++ b/substrate/core/service/src/components.rs @@ -570,15 +570,12 @@ mod tests { fn should_remove_transactions_from_the_pool() { let client = Arc::new(substrate_test_client::new()); let pool = TransactionPool::new(Default::default(), ::transaction_pool::ChainApi::new(client.clone())); - let transaction = { - let transfer = Transfer { - amount: 5, - nonce: 0, - from: AccountKeyring::Alice.into(), - to: Default::default(), - }; - transfer.into_signed_tx() - }; + let transaction = Transfer { + amount: 5, + nonce: 0, + from: AccountKeyring::Alice.into(), + to: Default::default(), + }.into_signed_tx(); // store the transaction in the pool pool.submit_one(&BlockId::hash(client.best_block_header().unwrap().hash()), transaction.clone()).unwrap(); diff --git a/substrate/core/sr-api-macros/Cargo.toml b/substrate/core/sr-api-macros/Cargo.toml index eef8f8e111..19db6dab86 100644 --- a/substrate/core/sr-api-macros/Cargo.toml +++ b/substrate/core/sr-api-macros/Cargo.toml @@ -22,6 +22,8 @@ runtime_primitives = { package = "sr-primitives", path = "../sr-primitives" } sr-version = { path = "../sr-version" } substrate-primitives = { path = "../primitives" } criterion = "0.2" +consensus_common = { package = "substrate-consensus-common", path = "../consensus/common" } +codec = { package = "parity-codec", version = "3.5.1" } [[bench]] name = "bench" diff --git a/substrate/core/sr-api-macros/src/decl_runtime_apis.rs b/substrate/core/sr-api-macros/src/decl_runtime_apis.rs index 109b37d875..c2501220b6 100644 --- a/substrate/core/sr-api-macros/src/decl_runtime_apis.rs +++ b/substrate/core/sr-api-macros/src/decl_runtime_apis.rs @@ -57,9 +57,21 @@ const CHANGED_IN_ATTRIBUTE: &str = "changed_in"; /// /// Is used when a trait method was renamed. const RENAMED_ATTRIBUTE: &str = "renamed"; +/// The `skip_initialize_block` attribute. +/// +/// Is used when a trait method does not require that the block is initialized +/// before being called. +const SKIP_INITIALIZE_BLOCK_ATTRIBUTE: &str = "skip_initialize_block"; +/// The `initialize_block` attribute. +/// +/// A trait method tagged with this attribute, initializes the runtime at +/// certain block. +const INITIALIZE_BLOCK_ATTRIBUTE: &str = "initialize_block"; /// All attributes that we support in the declaration of a runtime api trait. const SUPPORTED_ATTRIBUTE_NAMES: &[&str] = &[ - CORE_TRAIT_ATTRIBUTE, API_VERSION_ATTRIBUTE, CHANGED_IN_ATTRIBUTE, RENAMED_ATTRIBUTE + CORE_TRAIT_ATTRIBUTE, API_VERSION_ATTRIBUTE, CHANGED_IN_ATTRIBUTE, + RENAMED_ATTRIBUTE, SKIP_INITIALIZE_BLOCK_ATTRIBUTE, + INITIALIZE_BLOCK_ATTRIBUTE, ]; /// The structure used for parsing the runtime api declarations. @@ -338,7 +350,12 @@ fn generate_call_api_at_calls(decl: &ItemTrait) -> Result { if attrs.contains_key(RENAMED_ATTRIBUTE) && attrs.contains_key(CHANGED_IN_ATTRIBUTE) { return Err(Error::new( - fn_.span(), format!("`{}` and `{}` are not supported at once.", RENAMED_ATTRIBUTE, CHANGED_IN_ATTRIBUTE) + fn_.span(), + format!( + "`{}` and `{}` are not supported at once.", + RENAMED_ATTRIBUTE, + CHANGED_IN_ATTRIBUTE + ) )); } @@ -347,6 +364,15 @@ fn generate_call_api_at_calls(decl: &ItemTrait) -> Result { continue; } + let skip_initialize_block = attrs.contains_key(SKIP_INITIALIZE_BLOCK_ATTRIBUTE); + let update_initialized_block = if attrs.contains_key(INITIALIZE_BLOCK_ATTRIBUTE) { + quote!( + || *initialized_block.borrow_mut() = Some(*at) + ) + } else { + quote!(|| ()) + }; + // Parse the renamed attributes. let mut renames = Vec::new(); if let Some((_, a)) = attrs @@ -375,43 +401,63 @@ fn generate_call_api_at_calls(decl: &ItemTrait) -> Result { NC: FnOnce() -> ::std::result::Result + ::std::panic::UnwindSafe, Block: #crate_::runtime_api::BlockT, T: #crate_::runtime_api::CallRuntimeAt, + C: #crate_::runtime_api::Core, >( call_runtime_at: &T, + core_api: &C, at: &#crate_::runtime_api::BlockId, args: Vec, - changes: &mut #crate_::runtime_api::OverlayedChanges, - initialized_block: &mut Option<#crate_::runtime_api::BlockId>, + changes: &std::cell::RefCell<#crate_::runtime_api::OverlayedChanges>, + initialized_block: &std::cell::RefCell>>, native_call: Option, context: #crate_::runtime_api::ExecutionContext, + recorder: &Option>>>, ) -> #crate_::error::Result<#crate_::runtime_api::NativeOrEncoded> { let version = call_runtime_at.runtime_version_at(at)?; + use #crate_::runtime_api::InitializeBlock; + let initialize_block = if #skip_initialize_block { + InitializeBlock::Skip + } else { + InitializeBlock::Do(&initialized_block) + }; + let update_initialized_block = #update_initialized_block; #( // Check if we need to call the function by an old name. if version.apis.iter().any(|(s, v)| { s == &ID && *v < #versions }) { - return call_runtime_at.call_api_at:: _>( + let ret = call_runtime_at.call_api_at:: _, _>( + core_api, at, #old_names, args, changes, - initialized_block, + initialize_block, None, - context - ); + context, + recorder, + )?; + + update_initialized_block(); + return Ok(ret); } )* - call_runtime_at.call_api_at( + let ret = call_runtime_at.call_api_at( + core_api, at, #trait_fn_name, args, changes, - initialized_block, + initialize_block, native_call, - context - ) + context, + recorder, + )?; + + update_initialized_block(); + Ok(ret) } )); } diff --git a/substrate/core/sr-api-macros/src/impl_runtime_apis.rs b/substrate/core/sr-api-macros/src/impl_runtime_apis.rs index 903f3e4028..0099b7aacb 100644 --- a/substrate/core/sr-api-macros/src/impl_runtime_apis.rs +++ b/substrate/core/sr-api-macros/src/impl_runtime_apis.rs @@ -263,9 +263,10 @@ fn generate_runtime_api_base_structures(impls: &[ItemImpl]) -> Result + 'static> { call: &'static C, - commit_on_success: ::std::cell::RefCell, - initialized_block: ::std::cell::RefCell>, - changes: ::std::cell::RefCell<#crate_::runtime_api::OverlayedChanges>, + commit_on_success: std::cell::RefCell, + initialized_block: std::cell::RefCell>, + changes: std::cell::RefCell<#crate_::runtime_api::OverlayedChanges>, + recorder: Option>>>, } // `RuntimeApi` itself is not threadsafe. However, an instance is only available in a @@ -299,6 +300,22 @@ fn generate_runtime_api_base_structures(impls: &[ItemImpl]) -> Result #crate_::error::Result<#crate_::runtime_api::RuntimeVersion> { self.call.runtime_version_at(at) } + + fn record_proof(&mut self) { + self.recorder = Some(Default::default()); + } + + fn extract_proof(&mut self) -> Option>> { + self.recorder + .take() + .map(|r| { + r.borrow_mut() + .drain() + .into_iter() + .map(|n| n.data.to_vec()) + .collect() + }) + } } #[cfg(any(feature = "std", test))] @@ -315,6 +332,7 @@ fn generate_runtime_api_base_structures(impls: &[ItemImpl]) -> Result Result>, - ) -> #crate_::error::Result<#crate_::runtime_api::NativeOrEncoded> + &Self, + &std::cell::RefCell<#crate_::runtime_api::OverlayedChanges>, + &std::cell::RefCell>>, + &Option>>>, + ) -> #crate_::error::Result<#crate_::runtime_api::NativeOrEncoded>, >( &self, call_api_at: F, @@ -335,8 +355,10 @@ fn generate_runtime_api_base_structures(impls: &[ItemImpl]) -> Result Fold for ApiRuntimeImplToApiRuntimeApiImpl<'a> { #( #error )* self.call_api_at( - |call_runtime_at, changes, initialized_block| { + |call_runtime_at, core_api, changes, initialized_block, recorder| { #runtime_mod_path #call_api_at_call( call_runtime_at, + core_api, at, params_encoded, changes, @@ -493,6 +516,7 @@ impl<'a> Fold for ApiRuntimeImplToApiRuntimeApiImpl<'a> { ) }), context, + recorder, ) } ) diff --git a/substrate/core/sr-api-macros/tests/runtime_calls.rs b/substrate/core/sr-api-macros/tests/runtime_calls.rs index d26bed134e..df1be11a74 100644 --- a/substrate/core/sr-api-macros/tests/runtime_calls.rs +++ b/substrate/core/sr-api-macros/tests/runtime_calls.rs @@ -14,9 +14,20 @@ // You should have received a copy of the GNU General Public License // along with Substrate. If not, see . -use test_client::runtime::{TestAPI, DecodeFails}; -use runtime_primitives::{generic::BlockId, traits::ProvideRuntimeApi}; -use state_machine::ExecutionStrategy; +use test_client::{ + AccountKeyring, runtime::{TestAPI, DecodeFails, Transfer, Header}, + NativeExecutor, LocalExecutor, +}; +use runtime_primitives::{ + generic::BlockId, + traits::{ProvideRuntimeApi, Header as HeaderT, Hash as HashT}, +}; +use state_machine::{ + ExecutionStrategy, create_proof_check_backend, + execution_proof_check_on_trie_backend, +}; + +use codec::Encode; fn calling_function_with_strat(strat: ExecutionStrategy) { let client = test_client::new_with_execution_strategy(strat); @@ -114,3 +125,66 @@ fn use_trie_function() { let block_id = BlockId::Number(client.info().unwrap().chain.best_number); assert_eq!(runtime_api.use_trie(&block_id).unwrap(), 2); } + +#[test] +fn initialize_block_works() { + let client = test_client::new_with_execution_strategy(ExecutionStrategy::Both); + let runtime_api = client.runtime_api(); + let block_id = BlockId::Number(client.info().unwrap().chain.best_number); + assert_eq!(runtime_api.get_block_number(&block_id).unwrap(), 1); +} + +#[test] +fn initialize_block_is_called_only_once() { + let client = test_client::new_with_execution_strategy(ExecutionStrategy::Both); + let runtime_api = client.runtime_api(); + let block_id = BlockId::Number(client.info().unwrap().chain.best_number); + assert_eq!(runtime_api.take_block_number(&block_id).unwrap(), Some(1)); + assert_eq!(runtime_api.take_block_number(&block_id).unwrap(), None); +} + +#[test] +fn initialize_block_is_skipped() { + let client = test_client::new_with_execution_strategy(ExecutionStrategy::Both); + let runtime_api = client.runtime_api(); + let block_id = BlockId::Number(client.info().unwrap().chain.best_number); + assert!(runtime_api.without_initialize_block(&block_id).unwrap()); +} + +#[test] +fn record_proof_works() { + let client = test_client::new_with_execution_strategy(ExecutionStrategy::Both); + + let block_id = BlockId::Number(client.info().unwrap().chain.best_number); + let storage_root = client.best_block_header().unwrap().state_root().clone(); + + let transaction = Transfer { + amount: 1000, + nonce: 0, + from: AccountKeyring::Alice.into(), + to: Default::default(), + }.into_signed_tx(); + + // Build the block and record proof + let mut builder = client + .new_block_at_with_proof_recording(&block_id) + .expect("Creates block builder"); + builder.push(transaction.clone()).unwrap(); + let (block, proof) = builder.bake_and_extract_proof().expect("Bake block"); + + let backend = create_proof_check_backend::<<
::Hashing as HashT>::Hasher>( + storage_root, + proof.expect("Proof was generated"), + ).expect("Creates proof backend."); + + // Use the proof backend to execute `execute_block`. + let mut overlay = Default::default(); + let executor = NativeExecutor::::new(None); + execution_proof_check_on_trie_backend( + &backend, + &mut overlay, + &executor, + "Core_execute_block", + &block.encode(), + ).expect("Executes block while using the proof backend"); +} \ No newline at end of file diff --git a/substrate/core/sr-primitives/src/traits.rs b/substrate/core/sr-primitives/src/traits.rs index 9e43ddc60f..e765748b4f 100644 --- a/substrate/core/sr-primitives/src/traits.rs +++ b/substrate/core/sr-primitives/src/traits.rs @@ -748,6 +748,12 @@ impl<'a, T> rstd::ops::Deref for ApiRef<'a, T> { } } +impl<'a, T> rstd::ops::DerefMut for ApiRef<'a, T> { + fn deref_mut(&mut self) -> &mut T { + &mut self.0 + } +} + /// Something that provides a runtime api. pub trait ProvideRuntimeApi { /// The concrete type that provides the api. diff --git a/substrate/core/state-machine/src/lib.rs b/substrate/core/state-machine/src/lib.rs index bd9d9284e5..b1d0b24721 100644 --- a/substrate/core/state-machine/src/lib.rs +++ b/substrate/core/state-machine/src/lib.rs @@ -24,7 +24,9 @@ use log::warn; use hash_db::Hasher; use heapsize::HeapSizeOf; use parity_codec::{Decode, Encode}; -use primitives::{storage::well_known_keys, NativeOrEncoded, NeverNativeValue, OffchainExt}; +use primitives::{ + storage::well_known_keys, NativeOrEncoded, NeverNativeValue, OffchainExt +}; pub mod backend; mod changes_trie; @@ -52,7 +54,10 @@ pub use changes_trie::{ oldest_non_pruned_trie as oldest_non_pruned_changes_trie }; pub use overlayed_changes::OverlayedChanges; -pub use proving_backend::{create_proof_check_backend, create_proof_check_backend_storage}; +pub use proving_backend::{ + create_proof_check_backend, create_proof_check_backend_storage, + Recorder as ProofRecorder, ProvingBackend, +}; pub use trie_backend_essence::{TrieBackendStorage, Storage}; pub use trie_backend::TrieBackend; diff --git a/substrate/core/state-machine/src/proving_backend.rs b/substrate/core/state-machine/src/proving_backend.rs index 4d85791faf..c869f61efe 100644 --- a/substrate/core/state-machine/src/proving_backend.rs +++ b/substrate/core/state-machine/src/proving_backend.rs @@ -16,12 +16,16 @@ //! Proving state machine backend. -use std::cell::RefCell; +use std::{cell::RefCell, rc::Rc}; use log::debug; use hash_db::Hasher; use heapsize::HeapSizeOf; use hash_db::HashDB; -use trie::{Recorder, MemoryDB, PrefixedMemoryDB, TrieError, default_child_trie_root, read_trie_value_with, read_child_trie_value_with, record_all_keys}; +use trie::{ + MemoryDB, PrefixedMemoryDB, TrieError, default_child_trie_root, + read_trie_value_with, read_child_trie_value_with, record_all_keys +}; +pub use trie::Recorder; use crate::trie_backend::TrieBackend; use crate::trie_backend_essence::{Ephemeral, TrieBackendEssence, TrieBackendStorage}; use crate::{Error, ExecutionError, Backend}; @@ -87,7 +91,7 @@ impl<'a, S, H> ProvingBackendEssence<'a, S, H> /// These can be sent to remote node and used as a proof of execution. pub struct ProvingBackend<'a, S: 'a + TrieBackendStorage, H: 'a + Hasher> { backend: &'a TrieBackend, - proof_recorder: RefCell>, + proof_recorder: Rc>>, } impl<'a, S: 'a + TrieBackendStorage, H: 'a + Hasher> ProvingBackend<'a, S, H> { @@ -95,14 +99,27 @@ impl<'a, S: 'a + TrieBackendStorage, H: 'a + Hasher> ProvingBackend<'a, S, H> pub fn new(backend: &'a TrieBackend) -> Self { ProvingBackend { backend, - proof_recorder: RefCell::new(Recorder::new()), + proof_recorder: Rc::new(RefCell::new(Recorder::new())), + } + } + + /// Create new proving backend with the given recorder. + pub fn new_with_recorder( + backend: &'a TrieBackend, + proof_recorder: Rc>>, + ) -> Self { + ProvingBackend { + backend, + proof_recorder, } } /// Consume the backend, extracting the gathered proof in lexicographical order /// by value. pub fn extract_proof(self) -> Vec> { - self.proof_recorder.into_inner().drain() + self.proof_recorder + .borrow_mut() + .drain() .into_iter() .map(|n| n.data.to_vec()) .collect() diff --git a/substrate/core/test-client/Cargo.toml b/substrate/core/test-client/Cargo.toml index 50031809a1..7ff1ae9153 100644 --- a/substrate/core/test-client/Cargo.toml +++ b/substrate/core/test-client/Cargo.toml @@ -14,5 +14,18 @@ consensus = { package = "substrate-consensus-common", path = "../consensus/commo keyring = { package = "substrate-keyring", path = "../../core/keyring" } primitives = { package = "substrate-primitives", path = "../primitives" } state_machine = { package = "substrate-state-machine", path = "../state-machine" } -runtime = { package = "substrate-test-runtime", path = "../test-runtime" } +runtime = { package = "substrate-test-runtime", path = "../test-runtime", default-features = false } runtime_primitives = { package = "sr-primitives", path = "../sr-primitives" } + +[features] +default = [ + "include-wasm-blob", + "std", +] +std = [ + "runtime/std", +] +# If enabled, the WASM blob is added to the `GenesisConfig`. +include-wasm-blob = [ + "runtime/include-wasm-blob", +] \ No newline at end of file diff --git a/substrate/core/test-client/src/client_ext.rs b/substrate/core/test-client/src/client_ext.rs index 70e7feb078..d285bb726b 100644 --- a/substrate/core/test-client/src/client_ext.rs +++ b/substrate/core/test-client/src/client_ext.rs @@ -17,7 +17,10 @@ //! Client extension for tests. use client::{self, Client}; -use consensus::{ImportBlock, BlockImport, BlockOrigin, Error as ConsensusError, ForkChoiceStrategy}; +use consensus::{ + ImportBlock, BlockImport, BlockOrigin, Error as ConsensusError, + ForkChoiceStrategy, +}; use runtime_primitives::Justification; use runtime_primitives::generic::BlockId; use primitives::Blake2Hasher; @@ -31,11 +34,19 @@ pub trait TestClient: Sized { -> Result<(), ConsensusError>; /// Import block with justification, finalizes block. - fn import_justified(&self, origin: BlockOrigin, block: runtime::Block, justification: Justification) - -> Result<(), ConsensusError>; + fn import_justified( + &self, + origin: BlockOrigin, + block: runtime::Block, + justification: Justification + ) -> Result<(), ConsensusError>; /// Finalize a block. - fn finalize_block(&self, id: BlockId, justification: Option) -> client::error::Result<()>; + fn finalize_block( + &self, + id: BlockId, + justification: Option, + ) -> client::error::Result<()>; /// Returns hash of the genesis block. fn genesis_hash(&self) -> runtime::Hash; @@ -64,9 +75,12 @@ impl TestClient for Client self.import_block(import, HashMap::new()).map(|_| ()) } - fn import_justified(&self, origin: BlockOrigin, block: runtime::Block, justification: Justification) - -> Result<(), ConsensusError> - { + fn import_justified( + &self, + origin: BlockOrigin, + block: runtime::Block, + justification: Justification, + ) -> Result<(), ConsensusError> { let import = ImportBlock { origin, header: block.header, @@ -81,7 +95,11 @@ impl TestClient for Client self.import_block(import, HashMap::new()).map(|_| ()) } - fn finalize_block(&self, id: BlockId, justification: Option) -> client::error::Result<()> { + fn finalize_block( + &self, + id: BlockId, + justification: Option, + ) -> client::error::Result<()> { self.finalize_block(id, justification, true) } diff --git a/substrate/core/test-client/src/lib.rs b/substrate/core/test-client/src/lib.rs index 4a99df65a5..6b68f0ecde 100644 --- a/substrate/core/test-client/src/lib.rs +++ b/substrate/core/test-client/src/lib.rs @@ -19,29 +19,30 @@ #![warn(missing_docs)] pub mod client_ext; +#[cfg(feature = "include-wasm-blob")] pub mod trait_tests; mod block_builder_ext; pub use client_ext::TestClient; pub use block_builder_ext::BlockBuilderExt; -pub use client; -pub use client::ExecutionStrategies; -pub use client::blockchain; -pub use client::backend; -pub use executor::NativeExecutor; +pub use client::{ExecutionStrategies, blockchain, backend, self}; +pub use executor::{NativeExecutor, self}; pub use runtime; pub use consensus; pub use keyring::{AuthorityKeyring, AccountKeyring}; -use std::sync::Arc; +use std::{sync::Arc, collections::HashMap}; use futures::future::FutureResult; use primitives::Blake2Hasher; use runtime_primitives::StorageOverlay; -use runtime_primitives::traits::{Block as BlockT, Header as HeaderT, Hash as HashT, NumberFor}; +use runtime_primitives::traits::{ + Block as BlockT, Header as HeaderT, Hash as HashT, NumberFor +}; use runtime::genesismap::{GenesisConfig, additional_storage_with_genesis}; use state_machine::ExecutionStrategy; use client::LocalCallExecutor; +#[cfg(feature = "include-wasm-blob")] mod local_executor { #![allow(missing_docs)] use runtime; @@ -56,12 +57,14 @@ mod local_executor { } /// Native executor used for tests. +#[cfg(feature = "include-wasm-blob")] pub use local_executor::LocalExecutor; /// Test client database backend. pub type Backend = client_db::Backend; /// Test client executor. +#[cfg(feature = "include-wasm-blob")] pub type Executor = client::LocalCallExecutor< Backend, executor::NativeExecutor, @@ -78,6 +81,7 @@ pub type LightBackend = client::light::backend::Backend< pub struct LightFetcher; /// Test client light executor. +#[cfg(feature = "include-wasm-blob")] pub type LightExecutor = client::light::call_executor::RemoteOrLocalCallExecutor< runtime::Block, LightBackend, @@ -98,12 +102,112 @@ pub type LightExecutor = client::light::call_executor::RemoteOrLocalCallExecutor > >; +/// A builder for creating a test client instance. +pub struct TestClientBuilder { + execution_strategies: ExecutionStrategies, + genesis_extension: HashMap, Vec>, + support_changes_trie: bool, +} + +impl TestClientBuilder { + /// Create a new instance of the test client builder. + pub fn new() -> Self { + TestClientBuilder { + execution_strategies: ExecutionStrategies::default(), + genesis_extension: HashMap::default(), + support_changes_trie: false, + } + } + + /// Set the execution strategy that should be used by all contexts. + pub fn set_execution_strategy( + mut self, + execution_strategy: ExecutionStrategy + ) -> Self { + self.execution_strategies = ExecutionStrategies { + syncing: execution_strategy, + importing: execution_strategy, + block_construction: execution_strategy, + offchain_worker: execution_strategy, + other: execution_strategy, + }; + self + } + + /// Set an extension of the genesis storage. + pub fn set_genesis_extension( + mut self, + extension: HashMap, Vec> + ) -> Self { + self.genesis_extension = extension; + self + } + + /// Enable/Disable changes trie support. + pub fn set_support_changes_trie(mut self, enable: bool) -> Self { + self.support_changes_trie = enable; + self + } + + /// Build the test client. + #[cfg(feature = "include-wasm-blob")] + pub fn build(self) -> client::Client< + Backend, Executor, runtime::Block, runtime::RuntimeApi + > { + let backend = Arc::new(Backend::new_test(std::u32::MAX, std::u64::MAX)); + self.build_with_backend(backend) + } + + /// Build the test client with the given backend. + #[cfg(feature = "include-wasm-blob")] + pub fn build_with_backend(self, backend: Arc) -> client::Client< + B, + client::LocalCallExecutor>, + runtime::Block, + runtime::RuntimeApi + > where B: backend::LocalBackend { + let executor = NativeExecutor::new(None); + let executor = LocalCallExecutor::new(backend.clone(), executor); + + client::Client::new( + backend, + executor, + genesis_storage(self.support_changes_trie, self.genesis_extension), + self.execution_strategies + ).expect("Creates new client") + } + + /// Build the test client with the given native executor. + pub fn build_with_native_executor( + self, + executor: executor::NativeExecutor + ) -> client::Client< + Backend, + client::LocalCallExecutor>, + runtime::Block, + runtime::RuntimeApi + > where E: executor::NativeExecutionDispatch + { + let backend = Arc::new(Backend::new_test(std::u32::MAX, std::u64::MAX)); + let executor = LocalCallExecutor::new(backend.clone(), executor); + + client::Client::new( + backend, + executor, + genesis_storage(self.support_changes_trie, self.genesis_extension), + self.execution_strategies + ).expect("Creates new client") + } +} + /// Creates new client instance used for tests. +#[cfg(feature = "include-wasm-blob")] pub fn new() -> client::Client { new_with_backend(Arc::new(Backend::new_test(::std::u32::MAX, ::std::u64::MAX)), false) } /// Creates new light client instance used for tests. +#[cfg(feature = "include-wasm-blob")] pub fn new_light() -> client::Client { let storage = client_db::light::LightStorage::new_test(); let blockchain = Arc::new(client::light::blockchain::Blockchain::new(storage)); @@ -113,42 +217,28 @@ pub fn new_light() -> client::Client client::Client { - let backend = Arc::new(Backend::new_test(::std::u32::MAX, ::std::u64::MAX)); - let executor = NativeExecutor::new(None); - let executor = LocalCallExecutor::new(backend.clone(), executor); - - let execution_strategies = ExecutionStrategies { - syncing: execution_strategy, - importing: execution_strategy, - block_construction: execution_strategy, - offchain_worker: execution_strategy, - other: execution_strategy, - }; - - client::Client::new( - backend, - executor, - genesis_storage(false), - execution_strategies - ).expect("Creates new client") + TestClientBuilder::new().set_execution_strategy(execution_strategy).build() } /// Creates new test client instance that suports changes trie creation. +#[cfg(feature = "include-wasm-blob")] pub fn new_with_changes_trie() -> client::Client { - new_with_backend(Arc::new(Backend::new_test(::std::u32::MAX, ::std::u64::MAX)), true) + TestClientBuilder::new().set_support_changes_trie(true).build() } /// Creates new client instance used for tests with an explicitly provided backend. /// This is useful for testing backend implementations. +#[cfg(feature = "include-wasm-blob")] pub fn new_with_backend( backend: Arc, support_changes_trie: bool @@ -159,8 +249,9 @@ pub fn new_with_backend( runtime::RuntimeApi > where B: backend::LocalBackend { - let executor = NativeExecutor::new(None); - client::new_with_backend(backend, executor, genesis_storage(support_changes_trie)).unwrap() + TestClientBuilder::new() + .set_support_changes_trie(support_changes_trie) + .build_with_backend(backend) } fn genesis_config(support_changes_trie: bool) -> GenesisConfig { @@ -177,9 +268,16 @@ fn genesis_config(support_changes_trie: bool) -> GenesisConfig { ) } -fn genesis_storage(support_changes_trie: bool) -> StorageOverlay { +fn genesis_storage( + support_changes_trie: bool, + extension: HashMap, Vec> +) -> StorageOverlay { let mut storage = genesis_config(support_changes_trie).genesis_map(); - let state_root = <<::Header as HeaderT>::Hashing as HashT>::trie_root(storage.clone().into_iter()); + storage.extend(extension.into_iter()); + + let state_root = <<::Header as HeaderT>::Hashing as HashT>::trie_root( + storage.clone().into_iter() + ); let block: runtime::Block = client::genesis::construct_genesis_block(state_root); storage.extend(additional_storage_with_genesis(&block)); storage diff --git a/substrate/core/test-runtime/Cargo.toml b/substrate/core/test-runtime/Cargo.toml index 6b3d6f7d9f..49767c30b9 100644 --- a/substrate/core/test-runtime/Cargo.toml +++ b/substrate/core/test-runtime/Cargo.toml @@ -31,7 +31,10 @@ substrate-executor = { path = "../executor" } substrate-test-client = { path = "../test-client" } [features] -default = ["std"] +default = [ + "std", + "include-wasm-blob" +] std = [ "log", "serde", @@ -54,3 +57,5 @@ std = [ "executive/std", "consensus_authorities/std", ] +# If enabled, the WASM blob is added to the `GenesisConfig`. +include-wasm-blob = [] diff --git a/substrate/core/test-runtime/src/genesismap.rs b/substrate/core/test-runtime/src/genesismap.rs index be1c784a52..849b67b678 100644 --- a/substrate/core/test-runtime/src/genesismap.rs +++ b/substrate/core/test-runtime/src/genesismap.rs @@ -32,7 +32,12 @@ pub struct GenesisConfig { } impl GenesisConfig { - pub fn new(support_changes_trie: bool, authorities: Vec, endowed_accounts: Vec, balance: u64) -> Self { + pub fn new( + support_changes_trie: bool, + authorities: Vec, + endowed_accounts: Vec, + balance: u64 + ) -> Self { GenesisConfig { changes_trie_config: match support_changes_trie { true => Some(super::changes_trie_config()), @@ -44,11 +49,13 @@ impl GenesisConfig { } pub fn genesis_map(&self) -> HashMap, Vec> { + #[cfg(feature = "include-wasm-blob")] let wasm_runtime = include_bytes!("../wasm/target/wasm32-unknown-unknown/release/substrate_test_runtime.compact.wasm").to_vec(); let mut map: HashMap, Vec> = self.balances.iter() .map(|&(ref account, balance)| (account.to_keyed_vec(b"balance:"), vec![].and(&balance))) .map(|(k, v)| (blake2_256(&k[..])[..].to_vec(), v.to_vec())) .chain(vec![ + #[cfg(feature = "include-wasm-blob")] (well_known_keys::CODE.into(), wasm_runtime), (well_known_keys::HEAP_PAGES.into(), vec![].and(&(16 as u64))), (well_known_keys::AUTHORITY_COUNT.into(), vec![].and(&(self.authorities.len() as u32))), diff --git a/substrate/core/test-runtime/src/lib.rs b/substrate/core/test-runtime/src/lib.rs index 9e8617c592..f3cc321003 100644 --- a/substrate/core/test-runtime/src/lib.rs +++ b/substrate/core/test-runtime/src/lib.rs @@ -102,8 +102,7 @@ pub enum Extrinsic { } #[cfg(feature = "std")] -impl serde::Serialize for Extrinsic -{ +impl serde::Serialize for Extrinsic { fn serialize(&self, seq: S) -> Result where S: ::serde::Serializer { self.using_encoded(|bytes| seq.serialize_bytes(bytes)) } @@ -240,6 +239,13 @@ cfg_if! { fn use_trie() -> u64; fn benchmark_indirect_call() -> u64; fn benchmark_direct_call() -> u64; + /// Returns the initialized block number. + fn get_block_number() -> u64; + /// Takes and returns the initialized block number. + fn take_block_number() -> Option; + /// Returns if no block was initialized. + #[skip_initialize_block] + fn without_initialize_block() -> bool; } } } else { @@ -264,6 +270,13 @@ cfg_if! { fn use_trie() -> u64; fn benchmark_indirect_call() -> u64; fn benchmark_direct_call() -> u64; + /// Returns the initialized block number. + fn get_block_number() -> u64; + /// Takes and returns the initialized block number. + fn take_block_number() -> Option; + /// Returns if no block was initialized. + #[skip_initialize_block] + fn without_initialize_block() -> bool; } } } @@ -417,6 +430,18 @@ cfg_if! { fn benchmark_direct_call() -> u64 { (0..1000).fold(0, |p, i| p + benchmark_add_one(i)) } + + fn get_block_number() -> u64 { + system::get_block_number().expect("Block number is initialized") + } + + fn without_initialize_block() -> bool { + system::get_block_number().is_none() + } + + fn take_block_number() -> Option { + system::take_block_number() + } } impl consensus_aura::AuraApi for Runtime { @@ -537,10 +562,20 @@ cfg_if! { fn benchmark_direct_call() -> u64 { (0..10000).fold(0, |p, i| p + benchmark_add_one(i)) } + + fn get_block_number() -> u64 { + system::get_block_number().expect("Block number is initialized") + } + + fn without_initialize_block() -> bool { + system::get_block_number().is_none() + } + + fn take_block_number() -> Option { + system::take_block_number() + } } - - impl consensus_aura::AuraApi for Runtime { fn slot_duration() -> u64 { 1 } } diff --git a/substrate/core/test-runtime/src/system.rs b/substrate/core/test-runtime/src/system.rs index 51f12966dc..75cd1dddf6 100644 --- a/substrate/core/test-runtime/src/system.rs +++ b/substrate/core/test-runtime/src/system.rs @@ -35,7 +35,7 @@ const BALANCE_OF: &[u8] = b"balance:"; storage_items! { ExtrinsicData: b"sys:xtd" => required map [ u32 => Vec ]; // The current block number being processed. Set by `execute_block`. - Number: b"sys:num" => required BlockNumber; + Number: b"sys:num" => BlockNumber; ParentHash: b"sys:pha" => required Hash; NewAuthorities: b"sys:new_auth" => Vec; } @@ -70,6 +70,14 @@ pub fn initialize_block(header: &Header) { storage::unhashed::put(well_known_keys::EXTRINSIC_INDEX, &0u32); } +pub fn get_block_number() -> Option { + Number::get() +} + +pub fn take_block_number() -> Option { + Number::take() +} + /// Actually execute all transitioning for `block`. pub fn polish_block(block: &mut Block) { let header = &mut block.header; @@ -167,7 +175,9 @@ pub fn validate_transaction(utx: Extrinsic) -> TransactionValidity { let mut deps = Vec::new(); deps.push(hash(&tx.from, tx.nonce - 1)); deps - } else { Vec::new() }; + } else { + Vec::new() + }; let provides = { let mut p = Vec::new(); @@ -200,7 +210,7 @@ pub fn finalize_block() -> Header { let txs = txs.iter().map(Vec::as_slice).collect::>(); let extrinsics_root = enumerated_trie_root::(&txs).into(); - let number = ::take(); + let number = ::take().expect("Number is set by `initialize_block`"); let parent_hash = ::take(); let storage_root = BlakeTwo256::storage_root(); let storage_changes_root = BlakeTwo256::storage_changes_root(parent_hash, number - 1); diff --git a/substrate/core/test-runtime/wasm/Cargo.lock b/substrate/core/test-runtime/wasm/Cargo.lock index e8b4072b43..e22fc83e18 100644 --- a/substrate/core/test-runtime/wasm/Cargo.lock +++ b/substrate/core/test-runtime/wasm/Cargo.lock @@ -79,7 +79,7 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -463,7 +463,7 @@ dependencies = [ "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -570,7 +570,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)", "synstructure 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -959,7 +959,7 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1474,7 +1474,7 @@ dependencies = [ "proc-macro-crate 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1592,7 +1592,7 @@ dependencies = [ "proc-macro-hack 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1649,7 +1649,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2015,7 +2015,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2153,7 +2153,7 @@ dependencies = [ "proc-macro-crate 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2252,7 +2252,7 @@ dependencies = [ "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", "sr-api-macros 1.0.0", "srml-support-procedural-tools 1.0.0", - "syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2263,7 +2263,7 @@ dependencies = [ "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", "srml-support-procedural-tools-derive 1.0.0", - "syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2272,7 +2272,7 @@ version = "1.0.0" dependencies = [ "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2325,7 +2325,7 @@ dependencies = [ "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2340,7 +2340,7 @@ dependencies = [ "serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)", "sha1 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2369,7 +2369,7 @@ dependencies = [ "heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2636,7 +2636,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "syn" -version = "0.15.31" +version = "0.15.33" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2651,7 +2651,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3065,7 +3065,7 @@ dependencies = [ "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)", "wasm-bindgen-shared 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3095,7 +3095,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)", "wasm-bindgen-backend 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", "wasm-bindgen-shared 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3115,7 +3115,7 @@ dependencies = [ "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)", "wasm-bindgen-backend 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", "weedle 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3503,7 +3503,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum substrate-bip39 0.2.0 (git+https://github.com/paritytech/substrate-bip39)" = "" "checksum subtle 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2d67a5a62ba6e01cb2192ff309324cb4875d0c451d55fe2319433abe7a05a8ee" "checksum subtle 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "702662512f3ddeb74a64ce2fbbf3707ee1b6bb663d28bb054e0779bbc720d926" -"checksum syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)" = "d2b4cfac95805274c6afdb12d8f770fa2d27c045953e7b630a81801953699a9a" +"checksum syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)" = "ec52cd796e5f01d0067225a5392e70084acc4c0013fa71d55166d38a8b307836" "checksum synstructure 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "73687139bf99285483c96ac0add482c3776528beac1d97d444f6e91f203a2015" "checksum take_mut 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f764005d11ee5f36500a149ace24e00e3da98b0158b3e2d53a7495660d3f4d60" "checksum termcolor 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "4096add70612622289f2fdcdbd5086dc81c1e2675e6ae58d6c4f62a16c6d7f2f" diff --git a/substrate/node-template/runtime/wasm/Cargo.lock b/substrate/node-template/runtime/wasm/Cargo.lock index f061884222..221aa72729 100644 --- a/substrate/node-template/runtime/wasm/Cargo.lock +++ b/substrate/node-template/runtime/wasm/Cargo.lock @@ -79,7 +79,7 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -463,7 +463,7 @@ dependencies = [ "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -570,7 +570,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)", "synstructure 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -959,7 +959,7 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1508,7 +1508,7 @@ dependencies = [ "proc-macro-crate 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1626,7 +1626,7 @@ dependencies = [ "proc-macro-hack 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1683,7 +1683,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2049,7 +2049,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2187,7 +2187,7 @@ dependencies = [ "proc-macro-crate 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2391,7 +2391,7 @@ dependencies = [ "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", "sr-api-macros 1.0.0", "srml-support-procedural-tools 1.0.0", - "syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2402,7 +2402,7 @@ dependencies = [ "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", "srml-support-procedural-tools-derive 1.0.0", - "syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2411,7 +2411,7 @@ version = "1.0.0" dependencies = [ "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2477,7 +2477,7 @@ dependencies = [ "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2492,7 +2492,7 @@ dependencies = [ "serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)", "sha1 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2521,7 +2521,7 @@ dependencies = [ "heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2755,7 +2755,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "syn" -version = "0.15.31" +version = "0.15.33" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2770,7 +2770,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3184,7 +3184,7 @@ dependencies = [ "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)", "wasm-bindgen-shared 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3214,7 +3214,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)", "wasm-bindgen-backend 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", "wasm-bindgen-shared 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3234,7 +3234,7 @@ dependencies = [ "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)", "wasm-bindgen-backend 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", "weedle 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3622,7 +3622,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum substrate-bip39 0.2.0 (git+https://github.com/paritytech/substrate-bip39)" = "" "checksum subtle 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2d67a5a62ba6e01cb2192ff309324cb4875d0c451d55fe2319433abe7a05a8ee" "checksum subtle 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "702662512f3ddeb74a64ce2fbbf3707ee1b6bb663d28bb054e0779bbc720d926" -"checksum syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)" = "d2b4cfac95805274c6afdb12d8f770fa2d27c045953e7b630a81801953699a9a" +"checksum syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)" = "ec52cd796e5f01d0067225a5392e70084acc4c0013fa71d55166d38a8b307836" "checksum synstructure 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "73687139bf99285483c96ac0add482c3776528beac1d97d444f6e91f203a2015" "checksum take_mut 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f764005d11ee5f36500a149ace24e00e3da98b0158b3e2d53a7495660d3f4d60" "checksum termcolor 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "4096add70612622289f2fdcdbd5086dc81c1e2675e6ae58d6c4f62a16c6d7f2f" diff --git a/substrate/node/runtime/wasm/Cargo.lock b/substrate/node/runtime/wasm/Cargo.lock index bf68ab8f3f..c5f7018fcc 100644 --- a/substrate/node/runtime/wasm/Cargo.lock +++ b/substrate/node/runtime/wasm/Cargo.lock @@ -79,7 +79,7 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -463,7 +463,7 @@ dependencies = [ "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -570,7 +570,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)", "synstructure 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -959,7 +959,7 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1530,7 +1530,7 @@ dependencies = [ "proc-macro-crate 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1648,7 +1648,7 @@ dependencies = [ "proc-macro-hack 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1705,7 +1705,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2081,7 +2081,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2219,7 +2219,7 @@ dependencies = [ "proc-macro-crate 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2513,7 +2513,7 @@ dependencies = [ "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", "sr-api-macros 1.0.0", "srml-support-procedural-tools 1.0.0", - "syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2524,7 +2524,7 @@ dependencies = [ "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", "srml-support-procedural-tools-derive 1.0.0", - "syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2533,7 +2533,7 @@ version = "1.0.0" dependencies = [ "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2612,7 +2612,7 @@ dependencies = [ "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2627,7 +2627,7 @@ dependencies = [ "serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)", "sha1 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2656,7 +2656,7 @@ dependencies = [ "heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2901,7 +2901,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "syn" -version = "0.15.31" +version = "0.15.33" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2916,7 +2916,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3330,7 +3330,7 @@ dependencies = [ "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)", "wasm-bindgen-shared 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3360,7 +3360,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)", "wasm-bindgen-backend 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", "wasm-bindgen-shared 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3380,7 +3380,7 @@ dependencies = [ "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)", "wasm-bindgen-backend 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", "weedle 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3778,7 +3778,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum substrate-bip39 0.2.0 (git+https://github.com/paritytech/substrate-bip39)" = "" "checksum subtle 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2d67a5a62ba6e01cb2192ff309324cb4875d0c451d55fe2319433abe7a05a8ee" "checksum subtle 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "702662512f3ddeb74a64ce2fbbf3707ee1b6bb663d28bb054e0779bbc720d926" -"checksum syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)" = "d2b4cfac95805274c6afdb12d8f770fa2d27c045953e7b630a81801953699a9a" +"checksum syn 0.15.33 (registry+https://github.com/rust-lang/crates.io-index)" = "ec52cd796e5f01d0067225a5392e70084acc4c0013fa71d55166d38a8b307836" "checksum synstructure 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "73687139bf99285483c96ac0add482c3776528beac1d97d444f6e91f203a2015" "checksum take_mut 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f764005d11ee5f36500a149ace24e00e3da98b0158b3e2d53a7495660d3f4d60" "checksum termcolor 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "4096add70612622289f2fdcdbd5086dc81c1e2675e6ae58d6c4f62a16c6d7f2f"