Commit Graph

2057 Commits

Author SHA1 Message Date
TriplEight 84f4d54e53 Logs will be saved to the job artifacts only in case of failure. (#3110)
* Logs will be saved to the job artifacts only in case of failure.

* Logs will be partly shown at the end in case of failure.

* expiration and parsing
2019-07-15 16:37:31 +02:00
Pierre Krieger 5bd806bd9b Improvements to the import queue (#3101)
* Remove block_imported

* Move blocks results processing to sync

* Remove methods from Link

* Better errors

* Allow cancelling the import queue

* Restore the import trace

* Fix network tests

* Line widths

* Use has_error instead

* Minor style
2019-07-14 13:22:32 +01:00
Pierre Krieger 7ae6556a02 Switch the peerset to new futures (#3108)
* Switch the peerset to new futures

* Fuse the peerset rx
2019-07-13 10:55:01 +02:00
Bastian Köcher c42d73d302 Make parameter types implementation more flexible (#3112)
* Make parameter types implementation more flexible

* Bump `impl_version`
2019-07-13 10:54:41 +02:00
Toralf Wittner 9ee79d5c5e Remove sync::Context trait. (#3105)
Instead of passing a context around to each method, thereby introducing
side-effecting I/O actions everywhere, with this PR `sync::ChainSync`
only contains state which is updated by invoking various callback
methods (`on_*`) and actionable items are returned as regular results
from method calls, often iterators yielding requests that should be
issued to peers. It is up to the caller to handle these in an
appropriate way, currently `protocol` will send those as messages.
2019-07-12 20:37:38 +02:00
Gavin Wood e4d4548121 Convert unnecessary storage item to static. (#3093)
* Convert unnecessary storage item to static.

* Polish

* 6 second blocks.

* Compile fixes

* Bump runtime

* Fix

* Another fix

* Import `srml_support::traits::Get`

* Export MinimumPeriod from `decl_module!`

* Remove `config` from Timestamp

* Clean up warnings
2019-07-11 23:03:33 +02:00
Pierre Krieger b3dc472a9b Switch the telemetry to new futures (#3100)
* Switch the telemetry to new futures

* Line widths

* Apply suggestions from code review

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

* Fix Cargo.lock
2019-07-11 18:11:55 +02:00
Pierre Krieger bf2551a854 Switch the client to new futures (#3103)
* Switch the client to new futures

* No need for compat in the client

* Fix client tests

* Address review
2019-07-11 16:58:30 +02:00
Bastian Köcher f5e921281e Cleanup CLI and introduce execution-all (#3098)
* Cleanup CLI and introduce `execution-all`

`--execution-all` sets the execution strategies for all available
execution contexts.

* Rename parameter
2019-07-11 16:57:59 +02:00
Xiliang Chen b3dd034cce GenericAsset module (#2790)
* added generic asset module

* Update srml/generic-asset/Cargo.toml

* Update srml/generic-asset/Cargo.toml

* revert Cargo.lock changes

* cleanup line width

* rename srml_support to support

* Update srml/generic-asset/src/lib.rs

Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* Update srml/generic-asset/src/lib.rs

Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* Update srml/generic-asset/src/lib.rs

Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* Update srml/generic-asset/src/lib.rs

Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* Update srml/generic-asset/src/lib.rs

Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* Update srml/generic-asset/src/lib.rs

Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* Update srml/generic-asset/src/lib.rs

Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* Update srml/generic-asset/src/lib.rs

Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* Update srml/generic-asset/src/lib.rs

Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* Update srml/generic-asset/src/lib.rs

Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* Update srml/generic-asset/src/lib.rs

Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* Update srml/generic-asset/src/lib.rs

Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* Update srml/generic-asset/src/lib.rs

Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* Update srml/generic-asset/src/lib.rs

Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* Update srml/generic-asset/src/lib.rs

Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* Update srml/generic-asset/src/lib.rs

Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* Update srml/generic-asset/src/lib.rs

Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* Update srml/generic-asset/src/lib.rs

Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* Update srml/generic-asset/src/lib.rs

Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* Update srml/generic-asset/src/lib.rs

Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* update comments

* more docs

* update Cargo.lock

* fix tests

* update headers and fix missing events

* Update srml/generic-asset/Cargo.toml

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

* Update srml/generic-asset/src/lib.rs

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

* Update srml/generic-asset/src/lib.rs

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

* Update srml/generic-asset/src/lib.rs

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

* Update srml/generic-asset/src/lib.rs

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

* Apply suggestions from code review

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

* fix issues

* avoid duplicated code

* fix build issue

* cleanup Cargo.toml

* update based on reviews

* remove not used method

* update parity-codec version

* fix test build issue

* update Cargo.lock

* update with latest substrate changes

* refactor PermissionVersions encoding
2019-07-11 16:36:48 +02:00
André Silva e7edc1ee9d node: pass stash accounts to session module config (#3095)
* node: pass stash accounts to session module

* node: pass stash accounts to staking invulnerables
2019-07-11 10:21:57 +02:00
Pierre Krieger efed2e3098 Remove set_finality_proof_request_builder (#3087)
* Remove set_finality_proof_request_builder

* Fix Babe

* Fix Grandpa

* Fix service doctests
2019-07-11 09:44:32 +02:00
Kian Peymani 814b9056b3 Sensible locking for staking and council. (#3050)
* Sensible locking for staking and council.

* Bump.
2019-07-10 20:03:14 +02:00
Kian Peymani ddfc761dbf srml-staking: Force minimum bond amount + proper cleanup. (#3048)
* enforce minimum bond amount.

* Bump.

* Improve doc.

* Update srml/staking/src/lib.rs

Co-Authored-By: Shawn Tabrizi <shawntabrizi@gmail.com>

* Update srml/staking/src/lib.rs

Co-Authored-By: Gavin Wood <gavin@parity.io>

* Doc update.
2019-07-10 17:49:16 +02:00
Black3HDF 0feb91d045 srml-contracts: minor documentation improvements (#3086)
* fix typos

* update information about ink

* fix typos

* fix typo

* fix typos
2019-07-10 17:49:00 +02:00
Bastian Köcher 26606eb492 Expose Aura storage and calls (#3089) 2019-07-10 16:56:49 +02:00
Gavin Wood 920221fa02 Remove unconventional unit struct (#3084) 2019-07-10 15:36:25 +02:00
satellitex e9d41feb1c Add ExtCurrentBlockNumber in SRML::Contract (#3047)
* add block number

* add ext_current_block

* add ext_current_block test

* Update srml/contracts/src/wasm/mod.rs

Co-Authored-By: Sergei Pepyakin <s.pepyakin@gmail.com>

* Update srml/contracts/src/wasm/mod.rs

Co-Authored-By: Sergei Pepyakin <s.pepyakin@gmail.com>

* change valid comment

* use BlockNumberOf<T>

* Update srml/contracts/src/exec.rs

Co-Authored-By: André Silva <andre.beat@gmail.com>

* return types copy, not reference

* version up spec_version and impl_version

* change method name current_block -> block_number

* Update srml/contracts/src/exec.rs

Co-Authored-By: Sergei Pepyakin <s.pepyakin@gmail.com>
2019-07-10 15:42:36 +03:00
Bastian Köcher 0366f7b35c Check that validator set is not empty at genesis (#3083)
* Check that the returned validator set is not empty

* Move assert to session module

* Clean up
2019-07-10 14:38:07 +02:00
Gavin Wood df93867620 Technical Committee (#3041)
* Add copy of council seats as elections module.

* Split council into collective and elections modules.

Make collective instanceable.

* Propagate changes to the runtime and fix origin/event

* insert_ref and put_ref to avoid copies.

* Add tests

* Fix up collective's tests

* One more test

* Fix elections module tests

* Missed merge line

* Minor fix

* Test fixes

* Line widths

* Line widths

* Rntime version

* Remove comment

* Deduplicate

* Bump runtime again

* Fix test
2019-07-10 14:29:14 +02:00
André Silva 8f81bd90e7 network: don't announce genesis block (#3081) 2019-07-10 13:36:27 +02:00
Max Inden ab761f7a09 scripts/sentry-node: Ensure release mode and reserved connection for A (#3077)
Ensure all nodes in the sentry setup run in release mode. In addition
configure sentry-a as a reserved node for validator-a.
2019-07-10 10:15:23 +01:00
Max Inden c2491ed20b core/network: Log when ignoring genesis block announcement (#3078)
Instead of logging the fact that a generic invalid block announcement is
ignored, log that the given block is the genesis block.
2019-07-10 10:12:36 +01:00
Pierre Krieger 01060df459 Some documentation for discovery.rs (#3024)
* Some documentation for discovery.rs

* Typos

* Address concerns

* Fix doc after imports
2019-07-10 10:01:56 +02:00
thiolliere d00a2b28ac Make use of child storage for testExternalities and basicExternalities (#3009)
* impl test using both storage and child_storage

* few fixes

* remove unused code

* impl PartialEq with children keys

* fmt

* implementation of basic with children + rename new

* assert and test

* no panic in runtime

* address comments

* fix
2019-07-09 21:07:58 +02:00
Max Inden 6639ab339a Introduce flag to enable sentry nodes to participate in grandpa gossip (#3018)
Given the following situation: A validator 'A' is not supposed to be
connected to the public internet to protect it from e.g. a DoS attack.
Instead it connects to a sentry node 'sentry-A' which connects to the
public internet. Validator 'B' can reach validator 'A' via sentry node
'sentry-A' and vice versa.

A sentry node needs to participate in the grandpa gossip without
becoming a validator itself in order to forward these message to its
validator. This commit adds a new command line flag (`--grandpa-voter`)
forcing a node to participate in the grandpa voting process even though
no `--key` was specified. Due to the fact that it does not have a key,
it does not become a validator in the network.

In order to simulate the above situation this commit also adds a Docker
Compose file (`scripts/sentry-node/docker-compose.yml`) with further
documentation.
2019-07-09 18:35:37 +02:00
Gavin Wood 2c5a3b84db Allow sub accounts to be derived from an TypeId. (#3039)
* Allow sub accounts to be derived from an TypeId.

* Deduplicate

* Fix

* Rephrase.
2019-07-09 18:01:08 +02:00
Pierre Krieger d7b6720663 Change the import queue traits to take &mut self instead of &self (#3058)
* SharedFinalityProofRequestBuilder -> BoxFinalityProofRequestBuilder

* SharedThings -> BoxThings

* Fix tests

* build_request_data now takes &mut self

* The other traits now also take &mut self

* More or less fix tests

* Fix tests

* Fix more tests

* Moar tests

* Don't call make_block_import multiple time

* Fix doctest
2019-07-09 17:11:25 +02:00
Tomasz Drwięga e729dbabbe [offchain] Support for sign & verify for crypto keys (#3023)
* Implement sign & verify.

* Use phrases and password.

* Sign & verify with authority keys.

* Fix tests.

* WiP

* WiP

* Allow the caller to decide on 'CryptoKind'.

* Remove TODO.

* Make seed private back.

* Fix non-std build and bump version.

* Use Into<u32> instead of asses.

* Add missing typedef.
2019-07-09 17:09:14 +02:00
André Silva ed630e5eda srml: system: prune block hash mapping (#3062)
* srml: system: prune block number to hash mapping

* srml: system: add test for block hash mapping pruning

* node: bump runtime version

* srml: system: wrap long line

* srml: system: use parameter type for block hash count

* srml: system: prune block hash mapping before storage root calculation

* srml: system: keep the genesis hash in block number map
2019-07-09 17:07:38 +02:00
Pierre Krieger 459eb94c38 Hide the Kademlia warnings when offline (#3065) 2019-07-08 20:52:42 +01:00
David Craven 22ad6be01c Update deps. (#3060) 2019-07-08 18:00:34 +02:00
Robert Habermeier 13b9e49688 Dispatch on-disabled digests from consensus modules (#3055)
* on-disable primitives for engines

* dispatch on-disabled digests from SRML consensus

* bump runtime versions

* use find_map
2019-07-08 16:22:15 +02:00
Shawn Tabrizi 3d72844710 Make priviledged functions explicity use origin (#3045)
* Make priviledged functions explicity use `origin`

* Fix typo in docs

* Fix more tests

* Remove `root` pathway, add semicolons
2019-07-08 15:51:54 +02:00
Bastian Köcher 29311e98b4 Make RUSTFLAGS configurable in wasm-builder (#3057)
* Make `RUSTFLAGS` configurable in `wasm-builder`

* Version ups

* Update `Cargo.lock`
2019-07-08 15:37:42 +02:00
Pierre Krieger 3a002a9100 Specialization::on_message now takes Vec<u8> (#3054) 2019-07-08 15:34:05 +02:00
Pierre Krieger 1e126eab2f Network crate cleanups (#3049)
* Remove useless internal messages

* Remove NetworkService::disconnect_peer

* Remove NetworkMsg altogether

* Rename ProtocolMsg ServerToWorkerMsg

* Remove useless code

* Add example for parse_str_addr

* Move parse_str_addr and ProtocolId to config

* Don't reexport the content of config

* Rework the imports

* More reexports rework

* Add documentation

* Move finalization report to network future

* Move on_block_imported to worker

* get_value/put_value no longer locking

* local_peer_id() no longer locks

* Remove FetchFuture

* Service imports cleanup

* Produce the network state in the network task

* Merge network task and RPC network task

* Move network methods to NetworkWorker

* Remove Arc peers system from network

* add_reserved_peer now goes through the channel

* Remove Mutex around network swarm

* Remove the FnOnce alias traits

* Replace is_offline with num_connected

* Improve style of poll()

* Fix network tests

* Some doc in service module

* Remove macro export

* Minor doc changes

* Remove the synchronized() method of the import queue

* Line width

* Line widths

* Fix import queue tests

* Fix CLI tests
2019-07-08 15:33:29 +02:00
Robert Habermeier 7df8e52cfe Slash and prove membership of prior sessions (#2970)
* skeleton for tracking historical sessions

* refactor OpaqueKeys

* some more skeleton work

* adjust session to new OpaqueKeys API

* further refactoring of key-type-ids

* session gets validator ID parameter

* run up against compiler

* tweak staking to support new session changes

* first run at child storage for deduplication

* Make session use `AccountId` as `ValidatorId`

* run up against child trie issues

* switch to using normal trie but with a fixed prefix

* clear out some println

* add dedup test

* flesh out historical module more

* introduce ExposureOf for staking

* test the historical module

* WASM compiles

* tests all compile

* do some mock change

* fix bulk of tests

* fix staking tests

* test obsolecence mechanic

* Apply suggestions from code review

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

* some more style nits

* a couple more nits

* tweak tries

* fix typo thie -> this
2019-07-08 14:36:46 +02:00
Arkadiy Paronyan bb7ff32e77 Fixed block import command error handling (#3056) 2019-07-08 14:00:09 +02:00
Stanislav Tkach 1fdf315348 Fix ui tests (E0308 error) (#3040) 2019-07-07 22:37:27 +02:00
Pierre Krieger d0a48212a6 Split the import queue in three files (#3031)
* Split the import queue in three files

* Move import_single_block to root
2019-07-06 15:58:20 +01:00
Bastian Köcher c7e7b8b012 Document limitations of decl_storage! with instancing (#3044) 2019-07-06 13:56:55 +02:00
Bastian Köcher c03d3531d2 Make wasm-builder work with cargo install (#3043)
* Make `wasm-builder` work with `cargo install`

* Update `Cargo.lock`
2019-07-06 00:29:16 +02:00
Max Inden 6d995d24ba README: Replace outdated period with minimumPeriod (#3042)
Block period was renamed to minimum period. This commit updates the
README accordingly.
2019-07-05 19:20:10 +02:00
Pierre Krieger 489a5ce9d7 Merge Protocol and ProtocolBehaviour (#2962)
* Pass the peerset config to ProtocolBehaviour

* Don't pass the protocol versions

* Move fields from protocol_behaviour.rs to protocol.rs

* Remove LocalNetworkOut

* Move CustomProtos from protocol_behaviour.rs to protocol.rs

* Remove ProtocolBehaviour

* Inline poll()

* Force Behaviour to use Protocol

* Don't even attempt to have working tests

* Remove NetworkOut trait

* Line widths
2019-07-05 16:06:07 +02:00
Max Inden 6761ef1655 core/finality: Ref run_grandpa_voter instead of deprecated func in doc (#3035) 2019-07-05 15:43:16 +02:00
Bastian Köcher 0e8c4de4b5 Implement SelectInitialValidators for () (#3037)
This is quite more idiomatic substrate :D
2019-07-05 15:41:51 +02:00
Bastian Köcher 0ed2b26c96 End build when wasm-builder does not find a prerequisite (#3030)
* End build when `wasm-builder` does not find a prerequisite

Using `compile_error!` was a stupid idea by me, as rust would not
re-execute the build.rs.

* Increment the `wasm-builder` version

* Update core/utils/wasm-builder/src/lib.rs

Co-Authored-By: André Silva <andre.beat@gmail.com>
2019-07-05 15:02:14 +02:00
Pierre Krieger 22ec13cf65 Rewrite the network TestNet (#3016)
* Add a memory-only option for the network

* Tests cleanup

* Make grandpa/aura/babe compile

* Aura and Babe tests now passing

* More work on tests rewrite

* Attempt to fix grandpa

* Make more grandpa tests pass

* More grandpa tests work

* Work on sync tests

* More work

* light_peer_imports_header_from_announce passes

* can_sync_small_non_best_forks passes

* syncing_node_not_major_syncing_when_disconnected passes

* blocks_are_not_announced_by_light_nodes passing

* All sync tests passing 🎉

* Some TestNet cleanup

* Work on grandpa tests

* More grandpa work

* GrandPa work

* Add check about block_import

* Remove the temporarily added Sync

* Fix network tests warnings

* voter_persists_its_votes passes

* Fix imports in network tests

* Fix service tests

* Call on_block_imported 🤷

* Add shortcut

* Finish using shortcut
2019-07-05 11:19:03 +01:00
Pierre Krieger abf33fe479 Use bip39 from crates.io (#3029) 2019-07-05 10:11:58 +02:00