* generalize tree_root to remove client.backend dependency
* replace client.backend.blockchain.header with client.header
* move used_state_cache_size into client info
* Create intermediate Setup State. Fixes#1134
* remove client.backend from finality proof
* update node-template
* move memory backend into test helper mode
* move test helper into client
* starting the big refactor, remove unused functions
* apply_finality
* apply_finality
* replacing more .backend from environment with client directly
* remove .backend from grandpa by using traits
* remove .backend from babe
* remove .backend from tests where it is not needed
* remove .backend from tests
* fixing tests
* fixing tests
* fixing more tests
* fixing tests
* fix all forks test
* fix style
* fixing unnecessary allocation
* remove old test.
* fix service docs
* apply suggestion
* minor clean ups
* turns out the test-helper features actually is being used!
* fixing line length.
* fix line length
* minor cleaning
* Apply suggestions from code review
thanks, @Basti
Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>
* address grumbles
* simplify finalize block on client
* move block back into inner function
* Apply suggestions from code review
Co-Authored-By: DemiMarie-parity <48690212+DemiMarie-parity@users.noreply.github.com>
* use as.ref instead of match
* Update core/client/src/backend.rs
Co-Authored-By: DemiMarie-parity <48690212+DemiMarie-parity@users.noreply.github.com>
* Extract author API from the substrate-rpc crate.
* Split out API from RPC.
* Clean up naming.
* Fix tests.
* Shorten error translations.
* Update Cargo.lock
* Adds `WASM_TARGET_DIRECTORY` env variable to `wasm-builder`
* Create the `wasm-builder-runner`'s in a common workspace
* Make `wasm-builder` trigger less rebuilds
* Version up
* Adds script for building only the WASM files
* Apply suggestions from code review
Co-Authored-By: André Silva <andre.beat@gmail.com>
Co-Authored-By: DemiMarie-parity <48690212+DemiMarie-parity@users.noreply.github.com>
* grandpa: only send catch-up requests to authorities
* grandpa: fix gossip tests
* grandpa: test sending catch-up requests only to authorities
* grandpa: fix catch-up test
* grandpa: apply suggestions from code review
* Add ability to supply extra storage in test-client
* Don't use native_equivalent in tests.
* Get rid of native_equivalent
* Try to make fields private
* Apply Basti's suggestions
Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>
* Move Service::new to a macro
* Move function calls to macros
* Extract offchain_workers and start_rpc in separate function
In follow-up commits, we want to be able to directly call maintain_transaction_pool, offchain_workers, and start_rpc, without having to implement the Components trait.
This commit is a preliminary step: we extract the code to freestanding functions.
* Introduce an AbstractService trait
* Introduce NewService as an implementation detail of Service
* Implement traits on NewService instead
Instead of implementing AbstractService, Future, and Executor on Service, we implement them on NewService instead.
The implementations of AbstractService, Future, and Executor on Service still exist, but they just wrap to the respective implementations for NewService.
* Move components creation back to macro invocation
Instead of having multiple $build_ parameters passed to the macro, let's group them all into one.
This change is necessary for the follow-up commits, because we are going to call new_impl! only after all the components have already been built.
* Add a $block parameter to new_impl
This makes it possible to be explicit as what the generic parameter of the NewServiceis, without relying on type inference.
* Introduce the ServiceBuilder struct
Introduces a new builder-like ServiceBuilder struct that creates a NewService.
* Macro-ify import_blocks, export_blocks and revert_chain
Similar to the introduction of new_impl!, we extract the actual code into a macro, letting us get rid of the Components and Factory traits
* Add export_blocks, import_blocks and revert_chain methods on ServiceBuilder
Can be used as a replacement for the chain_ops::* methods
* Add run_with_builder
Instead of just run, adds run_with_builder to ParseAndPrepareExport/Import/Revert. This lets you run these operations with a ServiceBuilder instead of a ServiceFactory.
* Transition node and node-template to ServiceBuilder
* Transition transaction-factory to the new service factory
This is technically a breaking change, but the transaction-factory crate is only ever used from within substrate-node, which this commit updates as well.
* Remove old service factory
* Adjust the AbstractService trait to be more usable
We slightly change the trait bounds in order to make all the methods usable.
* Make substrate-service-test compile
* Fix the node-cli tests
* Remove the old API
* Remove the components module
* Fix indentation on chain_ops
* Line widths
* Fix bad line widths commit
* Line widths again 🤦
* Fix the sync test
* Apply suggestions from code review
Co-Authored-By: Gavin Wood <i@gavwood.com>
* Address some concerns
* Remove TelemetryOnConnect
* Remove informant::start
* Update jsonrpc
* Rename factory to builder
* Line widths 😩
* introduce some type aliases for round and set-id
* overhaul session "changed" flag and document better
* do_initialize in BABE when getting new session
* grandpa module tracks set IDs
* update runtime versions
* doc comment -> comment
* Include docs fixes from Gav
Co-Authored-By: Gavin Wood <gavin@parity.io>
* some more review changes
* fix srml-grandpa compilation