Commit Graph

16007 Commits

Author SHA1 Message Date
Bastian Köcher 10b032bb0d Make sure that on_before_session_ending is called (#3487)
* Make sure that `on_before_session_ending` is called

* Move the call above the validtor set being set

* Bump spec_version
2019-08-27 11:57:35 +02:00
Pierre Krieger 5b8ebf7baf Service factory refactor (#3382)
* 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 😩
2019-08-27 11:18:41 +02:00
Bastian Köcher 144bd228af Improve insert_key error message on unsupported key type (#3490) 2019-08-27 10:59:33 +02:00
Tomasz Drwięga 0128d0db84 Introduce capabilities filtering for off-chain runtime calls. (#3454)
* Introduce capabilities filtering for calls.

* Bump impl version.

* Allow RichOffchainCall to only read offchain db.

* Fix code.

* Panic on invalid calls.

* Merge execution contexts and expose capabilities.

* Fix repr

* Re-enable keystore for offchain calls.
2019-08-27 10:07:30 +02:00
Bastian Köcher d81df14391 Make node-template-release create a workspace (#3484) 2019-08-27 07:43:10 +02:00
Svyatoslav Nikolsky 8f29199076 init cache on restart (#3486) 2019-08-26 20:30:09 +02:00
joe petrowski b80e611218 fix typos in readme (#3481) 2019-08-26 10:56:00 +02:00
Andrew Jones aae31831fb Custom deserialize impl for ApisVec (#3471) 2019-08-26 09:37:42 +02:00
Chevdor 7612b7b56e Better filter to speed and reduce the size passed to the first stage image (#405) 2019-08-25 08:59:34 -07:00
Xiliang Chen da03850eed add Copy to Moment type (#3476)
* add Copy to Moment type

* bump version

* add Copy to support::Traits::Time::Moment and removed few clones
2019-08-25 12:57:31 +02:00
Gavin Wood 974b400020 Update substrate (#404) 2019-08-24 20:41:16 +02:00
Gavin Wood 672e62fe0f Allow root to force transfers (#3475)
* Allow root to force transfers

* Bump version

* Avoid changing pre-existing encodings
2019-08-24 20:12:29 +02:00
Gavin Wood 6c4ac65f5f Spelling and update (#402) 2019-08-24 18:58:20 +02:00
Kian Paimani c14afe4352 Clean runtime constants (#3459)
* Remove bogus constants.

* Bump.
2019-08-24 18:00:26 +02:00
Svyatoslav Nikolsky e9273329ae fix digest in check_execution_proof (#3469) 2019-08-24 17:42:57 +02:00
thiolliere a528b7dc56 improve error msg on wrong closure signature (#3467) 2019-08-24 17:41:45 +02:00
Robert Habermeier b50596428e GRANDPA links set IDs to sessions. (#3472)
* 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
2019-08-24 17:17:01 +02:00
Logan Saether a554e72e91 Add Kusama to the README (#399) 2019-08-24 13:42:15 +02:00
Gavin Wood ccfa2b1828 Bump all versions to 0.6.0 (#397) 2019-08-24 13:40:57 +02:00
Gav Wood 4ee086f80a Bump runtime version 2019-08-24 03:06:08 -07:00
Gavin Wood 9011168ee1 Fix up bonding period. (#396) 2019-08-24 12:04:16 +02:00
Bastian Köcher bdd6bba20a Show the available key management RPC calls in README (#3474)
* Show the available key management RPC calls in README

* minor fixes
2019-08-24 11:53:44 +02:00
Arkadiy Paronyan 908473c26b Allow parallel parachain validation (#370)
* Allow parallel parachain validation

* Fixed test interference

* Switch to pooled implementation

* Apply suggestions from code review

Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>

* Update validation_host.rs

* Minor cleanups

* Fixed build
2019-08-24 11:52:00 +02:00
Tomasz Drwięga 7df089241c Implement HTTP request in offchain workers (#3461)
* Implement HTTP request in offchain workers

* Bump impl_version

* Don't compile offchain workers for WASM anymore

* Initialize HttpConnector as a fallback.

* Apply review suggestions 😳
2019-08-24 06:54:14 +02:00
Tomasz Drwięga 986876e174 Pluralise newHead (#3463) 2019-08-24 06:52:22 +02:00
thiolliere a3e2a710c8 Fix linkemap swap (#3468)
* fix linkedmap swap

* version bump
2019-08-24 06:51:40 +02:00
André Silva 725aa0aec8 grandpa: observer doesn't send catch up messages (#3460)
* grandpa: don't send catch up requests when running GRANDPA observer

* grandpa: fix tests

* grandpa: add tests for catch up requests
2019-08-23 15:13:01 +02:00
Kian Paimani 94243e66b3 Remove MakePayment and introduce SignedExtension docs/examples (#3464)
* New doc for signed extensions.

* Cleanup.

* review nits.
2019-08-23 14:12:39 +02:00
Gavin Wood 7ae4f606c1 Kusama CC1 chain spec(!) (#395)
* CC-1 chain spec

* Name tweak
2019-08-23 12:14:34 +02:00
Marcio Diaz 9c4843315c Fix cargo description. (#3458) 2019-08-22 12:45:48 +02:00
thiolliere 716e6fa7f4 avoid silent ignore (#3450) 2019-08-22 11:49:22 +02:00
André Silva 5359206aae grandpa: validate honest out of scope catch ups are for the previous set (#3453) 2019-08-22 10:35:45 +02:00
thiolliere 2f3e7cbe80 decl_module doc (#3451) 2019-08-21 17:38:41 +02:00
thiolliere 591e27e4ab typo (#3455) 2019-08-21 17:35:08 +02:00
Jaco Greeff 9a32065c74 Add networkId to Kusama chain spec (#393)
* Add networkId to Kusama chain spec

* ss58Format
2019-08-21 17:24:48 +02:00
Gavin Wood 823aaabb60 Tweak treasury params (#392)
* Tweak treasury params

* Revert clobber
2019-08-21 16:47:08 +02:00
Jim Posen 974b341b14 srml-contracts: Apply contract removals immediately (#3417)
* Add ability to destroy a contract in the overlay.

* Don't allow contracts to be destroyed in recursive execution.

* Tests for contract self-destruction.

* Don't allow constructor to exit with insufficient balance.

* Remove dead code.

* Bump node runtime spec version.
2019-08-21 16:44:27 +02:00
André Silva 895c872a09 aura: keystore is required for authoring (#3449) 2019-08-21 16:42:04 +02:00
Toralf Wittner 43c3a682e0 Update soketto to version 0.2.3 (#3448)
This version fixes an issue with lifetime elision which causes
compilation to fail on recent rustc versions (e.g. 1.39.0-nightly
(bea0372a1 2019-08-20)).

See https://github.com/paritytech/soketto/pull/1 for more information.
2019-08-21 16:41:45 +02:00
Bryant Eisenbach f3649e3856 docs: Added more correct documentation for using genesis config (#3445) 2019-08-20 20:34:18 +02:00
André Silva 6876c50af8 sync: don't return on fork tree revert (#3444) 2019-08-20 20:32:26 +02:00
Robert Habermeier 320fb38a2f pay out slashes to the treasury (#3446) 2019-08-20 20:32:14 +02:00
thiolliere 71cee78d85 Fix srml-balance burn implementation (#3443)
* tests

* fix

* bump version
2019-08-20 20:32:00 +02:00
Robert Habermeier 7d78d9ace6 pay out slashes to the treasury (#391) 2019-08-20 18:33:14 +02:00
Max Inden 2c0e73b78c srml/authority-discovery: Introduce srml module to sign and verify (#3385)
In order to have authorities (validators) discover each other, they need
to publish their public addresses by their ip address on the Kademlia
Dht indexed by their public key. This payload needs to be signed by a
key identifying them as a valid authority.

Code inside `/core` does not know the current set of authorities nor
can it assume what kind of cryptography primitives are currently in use.
Instead it can retrieve its public key and the current set of
authorities from the runtime and have it sign and verify Dht payloads.

This commit enables code in `/core` to do so by introducing a srml
module and runtime api to:

1. Retrieve own public key.

2. Retrieve public keys of current authority set.

3. Sign a Dht payload.

4. Verify a Dht payload.

This commit makes the logic from the previous commit
(`core/consensus/common/primitives.ConsensusApi`)
cf80af9255 obsolete and thus removes it.
2019-08-20 17:39:14 +02:00
Federico Gimenez 2a78213040 fix Dockerfile (#386) 2019-08-20 15:09:23 +02:00
André Silva ac672a7881 runtime: disable grandpa offline fallback (#390) 2019-08-20 14:14:28 +02:00
Gavin Wood 6bcb0e57bf Update substrate and add some sensible values (#387)
* Update substrate

* Update substrate and some chain spec

* Undo old change

* Use hex ser/de for ethereum addresses

* Add docs.

* Accidental line

* incorrect fix

* Fix build
2019-08-20 13:29:05 +02:00
Pierre Krieger fdd014b862 Bump multistream-select to fix a debug_assert! (#389) 2019-08-20 13:16:06 +02:00
André Silva 5ff10aece8 grandpa: don't recreate SharedVoterSetState (#3441) 2019-08-20 13:01:24 +02:00