* babe: pass epoch data via intermediates
* Switch to use Box<dyn Any> for intermediates
* Set intermediate.epoch to be Option
* Fix proposer should put out an empty intermediate
* Remove unnecessary encode/decode
* Add EpochData to block_import_params in slot worker
* Fix aura compile
* Fix integration test
* Init epoch changes module
* Initial integration of new epoch changes module for BABE
* Fix all initial compile errors
* rename: digest -> digests
* Fix babe tests
* Bump impl_version
* Fix more test issues
* Remove test flag for tree
It unfortunately won't work for multiple crates.
* Update cargo lock
* Fix duplicate parking_lot version
* Add missing license header
These are a few changes I missed during the refactoring.
1. Initialization issue and boilerplate
Most importantly: part of the `Configuration` initialization was done in `sc_cli::init`. This means the user can not benefit from this initialization boilerplate if they have multiple `Configuration` since `sc_cli::init` can only be called once.
2. Boilerplate for `VersionInfo` and `Configuration`
I'm also answering to the critic of @bkchr on the initialization using version: https://github.com/paritytech/substrate/pull/4692/files/bea809d4c14a2ede953227ac885e3b3f9771c548#r372047238 This will allow initializing a `Configuration` and provide the version by default.
3. Loading the `chain_spec` explicitly
In the past it was done automatically but in some cases we want to delay this. I moved the code to `Configuration.load_spec()` so it can be called later on. `chain_spec` can also be written directly to the `Configuration` without using this `load_spec` helper.
4. [deleted]
5. Fixing issue that prevents the user to override the port
In the refactoring I introduced a bug by mistake that could potentially prevent the CLI user to override the ports if defaults where provided for these ports (only on cumulus).
6. Change task_executor from Box to Arc
This is useful for cumulus where we have 2 nodes with 2 separate Configuration that need to spawn tasks to the same runtime.
7. Renamed TasksExecutorRequired to TaskExecutor
For consistency.
This is related to https://github.com/paritytech/cumulus/issues/24
This is the continuation (and hopefully the end of) #4692
* block_import: switch to Box<dyn Any> for intermediates representation
* Use Cow and return Error instead of Option
* Remove unused error
* Distinguish NoIntermediate/InvalidIntermediate
* client/finality-grandpa: Add regression test observer polling network
Ensure `Future` implementation of `ObserverWork` is polling its
`NetworkBridge`. Regression test for bug introduced in d9837d7dd and
fixed in 504b4e89e.
When polled, `NetworkBridge` forwards reputation change requests from
the `GossipValidator` to the underlying `dyn Network`. This test
triggers a reputation change by calling `GossipValidator::validate` with
an invalid gossip message. After polling the `ObserverWork` which should
poll the `NetworkBridge`, the reputation change should be forwarded to
the test network.
* Nits
Co-authored-by: Max Inden <mail@max-inden.de>
It changes the way we extended the CLI functionalities of substrate to allow more flexibility. (If this was not clear, here is another version: it changes the `sc_cli` API to allow more flexibility).
This touches a few important things:
- the startup of the async task with tokei:
This was in node and node-template and I moved it to substrate. The idea is to have 1 time the code that handles unix signals (SIGTERM and SIGINT) properly. It is however possible to make this more generic to wait for a future instead and provide only a helper for the basic handling of SIGTERM and SIGINT.
- increased the version of structopt and tokei
- no more use of structopt internal's API
- less use of generics
Related to #4643 and https://github.com/paritytech/cumulus/pull/42: the implementation of "into_configuration" and "get_config" are similar but with better flexibility so it is now possible in cumulus to have the command-line arguments only of the run command for polkadot if we want
Related to https://github.com/paritytech/cumulus/issues/24 and https://github.com/paritytech/cumulus/issues/34 : it will now be possible to make a configuration struct for polkadot with some overrides of the default parameters much more easily.
Patch d9837d7dd reintegrated the periodic neighbor packet worker, by
moving its logic into a `Future` implementation on `NetworkBridge` which
needs to be polled by its upper layer.
Polling by the upper layer was implemented within the `Future`
implementation of the `VoterWork` struct but not within the `Future`
implementation of the `ObserverWork` struct. This patch adds polling of
the `NetworkBridge` to the latter.
* Make sure to destroy state in case of error.
* Update client/src/call_executor.rs
* Update client/src/call_executor.rs
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
* WASM runtime switch to import memory
Up to now runtimes have exported their memory. To unify it with
sandboxing, this pr switches runtimes to import memory as well.
From a functional perspective, exporting/importing memory makes no
difference to the runtime.
To provide backwards compatibility, WASM exported memory is still supported.
* Revert debug stuff
* Revert some stuff
* instant/manual seal
unbounded queues are evil
Apply suggestions from code review
Co-Authored-By: Robert Habermeier <rphmeier@gmail.com>
add fork tests, docs, remove todos
moar docs
Update client/consensus/manual-seal/src/rpc.rs
Co-Authored-By: Robert Habermeier <rphmeier@gmail.com>
remove unbound generic, parameter, docs, deps, code style changes
Apply suggestions from code review
Co-Authored-By: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
code style chnges
remove unused deps, remove dep renames, check if block is empty before importing, use ? for error propagation
fix tests
log errors for instant seal
use debug
code style changes, updated copyright dates
use txpool::Pool instead of BasicPool, code style changes
fixed tests
* fix tests
* requested changes from review
* check inherents len
* rebase
* Introduces `author_hasKey` and `author_hasSessionKeys` rpc endpoints
Both endpoints can be used to check if a key is present in the keystore.
- `hasKey` works on with an individual public key and key type. It
checks if a private key for the given combination exists in the
keystore.
- `hasSessionKeys` works with the full encoded session key blob stored
on-chain in `nextKeys`. This requires that the given blob can be decoded
by the runtime. It will return `true`, iff all public keys of the
session key exist in the storage.
Fixes: https://github.com/paritytech/substrate/issues/4696
* Update client/rpc-api/src/author/error.rs
Co-Authored-By: Nikolay Volf <nikvolf@gmail.com>
* Indentation
Co-authored-by: Nikolay Volf <nikvolf@gmail.com>
* Switch GrandPa to new futures
* Work on making tests work
* until_imported tests working again
* Work on switching tests to stable futures
* Modifications
* Re-add test as #[ignore]
* Don't ignore
* Add manual unpins
* Remove Header import
* Return concrete Sink type
* Switch to crates.io finality-grandpa version
* Remove use statement that slipped in
* Fix some nitpicks
* Remove unpin from i
* Fixed typo
* Move futures01 to dev-deps
* Fix nitpicks
* Update client/finality-grandpa/src/communication/mod.rs
Co-Authored-By: André Silva <andre.beat@gmail.com>
* nitpicking
Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
Co-authored-by: André Silva <andre.beat@gmail.com>
* clinet/finality-grandpa: Make round_communication use bounded channel
`round_communication` returns a `Sink` and a `Stream` for outgoing and
incoming messages. The messages send into the `Sink` are forwarded down
to the network as well as send back into the `Stream` to ensure the node
processes its own messages.
So far, to send messages into the `Sink` back into the `Stream`, an
unbounded channel was used. This patch updates `round_communication` and
`OutgoingMessages` to use a bounded channel.
This is part of a greater effort to reduce the number of owners of
components within `finality-grandpa` and `network` as well as to reduce
the amount of unbounded channels. For details see d9837d7dd and
5f80929dc.
* client/finality-grandpa: Import futures03::future::ready at the top
* client/finality-grandpa: Make tests use compat of future 03
* client/finality-grandpa: Do not import ready into scope
Instead of importing futures03::future::ready into the scope, only
import futures::future03 into scope and call ready as furure03::ready.
* consensus, pow: intermediate separation and fail
* Fix compiles
* Update primitives/consensus/common/src/block_import.rs
Co-Authored-By: Robert Habermeier <rphmeier@gmail.com>
* Update primitives/consensus/common/src/block_import.rs
Co-Authored-By: Robert Habermeier <rphmeier@gmail.com>
* Document what None means for `fork_choice` in block import params
Co-authored-by: Robert Habermeier <rphmeier@gmail.com>