Commit Graph

1453 Commits

Author SHA1 Message Date
Arkadiy Paronyan 8d290f6110 Don't mark peers sending expired messages as useless (#1944) 2019-03-07 22:12:57 +01:00
Gav Wood 9f3b4468db Make subkey support Sr25519 crypto (#1933)
* Make subkey support Sr25519 crypto.

* Rebuild runtime.

* Build and rejig locks.

* Fix grumbles

* Derivations

* Introduce tests
2019-03-07 17:10:17 +01:00
Tomasz Drwięga 9ad06d57fc Extract specific transaction pool errors. (#1930)
* Extract specific transaction pool errors.

* Convert error codes to constants.
2019-03-07 10:53:53 +01:00
Bastian Köcher 7927054f86 Update copyrights to 2019 (#1932) 2019-03-06 15:04:28 +01:00
郭光华 b5f6a77d3b Delete unused import in finaly-tracker module (#1931)
* Delete unused import in finaly-tracker module

* Fix test build error

* Revert spec_version

* Rebuild wasm
2019-03-06 13:16:12 +01:00
Gav Wood ccc11974ee Aggregate all liquidity restrictions in a single place (#1921)
* Clean up session key rotation

* Fix build

* Bump version

* Introduce feature to balances.

* Move staking locking logic over to central point

* ^^^ rest

* First part of assimilation

* More assimilation

* More assimilation

* Fix most tests

* Fix build

* Move Balances to new locking system

* :q!

* Bump runtime version

* Build runtime

* Convenience function

* Test fix.

* Whitespace

* Improve type legibility.

* Fix comment.

* More tests.

* More tests.

* Bump version

* Caps

* Whitespace

* Whitespace

* Remove unneeded function.
2019-03-06 12:46:17 +01:00
renlulu 46541ec73c fix typo (#1928) 2019-03-06 08:39:49 +01:00
Pierre Krieger bcda2fafa0 Add even more diagnostic messages (#1925)
* Add even more diagnostic messages

* Fix
2019-03-05 22:44:55 +01:00
Robert Habermeier dfb48a2405 Offline fallback for GRANDPA (#1619)
Co-authored-by: André Silva <andre.beat@gmail.com>

* skeleton for finality tracker

* dispatch events when nothing finalized for a long time

* begin integrating finality tracker into grandpa

* add delay field to pending change

* add has_api_with function to sr_version for querying APIs

* partially integrate new force changes into grandpa

* implement forced changes

* get srml-grandpa compiling

* Update core/finality-grandpa/src/authorities.rs

Co-Authored-By: rphmeier <rphmeier@gmail.com>

* Update core/finality-grandpa/src/authorities.rs

Co-Authored-By: rphmeier <rphmeier@gmail.com>

* Update core/finality-grandpa/src/authorities.rs

Co-Authored-By: rphmeier <rphmeier@gmail.com>

* remove explicit dependence on CoreApi

* increase node runtime version

* integrate grandpa forced changes into node runtime

* add some tests to finality-tracker

* integrate finality tracking into node-runtime

* test forced-change logic

* test forced changes in the authority-set handler

* kill some unneeded bounds in client

* test forced-changes in finality-grandpa and fix logic

* build wasm and finality-tracker is no-std

* restart voter on forced change

* allow returning custom error type from lock_import_and_run

* extract out most DB logic to aux_schema and use atomic client ops

* unify authority set writing

* implement set pausing

* bump runtime version

* note on DB when we pause.

* core: grandpa: integrate forced changes with multiple pending standard changes

* core: grandpa: fix AuthoritySet tests

* runtime: bump impl_version

* core: clear pending justification requests after forced change import

* srml: finality-tracker: use FinalizedInherentData

* core: log requests for clearing justification requests

* core, node: update runtimes

* core: grandpa: fix tests

* core: grandpa: remove todos and add comments

* core: grandpa: use has_api_with from ApiExt

* core: fix tests

* core: grandpa: remove unnecessary mut modifier

* core: replace PostImportActions bitflags with struct

* core: grandpa: restrict genesis on forced authority set change

* core: grandpa: add more docs

* core: grandpa: prevent safety violations in Environment::finalize_block

* core: grandpa: register finality tracker inherent data provider

* core: grandpa: fix tests

* node: update runtime blobs

* core: grandpa: remove outdated todo

* core: aura: fix typo in log message

* core: grandpa: check re-finalization is on canonical chain

* srml: finality-tracker: fix initialization

* node: update runtime wasm

* srml: finality-tracker: don't re-initialize config keys
2019-03-05 15:41:35 +00:00
Hero Bird 128d164f2b Make use of parity-codec "derive" crate feature (#1919)
* Make use of parity-codec "derive" crate feature

* Bump impl_version

* Update wasm files and Cargo.lock files

* Transferred to parity_codec derive feature for the rest of the crates

* Update wasm binaries and lock files

* Update core and node wasm binaries
2019-03-05 09:00:37 +01:00
Gav Wood 755b53bd05 Clean up session key rotation (#1911)
* Clean up session key rotation

* Fix build

* Bump version
2019-03-04 18:03:44 +01:00
thiolliere b599556e21 remove unused code (#1920) 2019-03-04 17:10:31 +01:00
Michael Müller c485eb8fdc Get rid of wildcard imports (#1916)
* Get rid of wildcard imports

* Update core/service/src/lib.rs

Co-Authored-By: cmichi <mich@elmueller.net>

* Update core/client/src/client.rs

Co-Authored-By: cmichi <mich@elmueller.net>

* Import by namespace
2019-03-04 14:00:46 +01:00
thiolliere 66bc864f29 improve storage build type checking (#1914)
* force build closure in decl_storage! to return explicit type
* fix when type was different

Note: it breaks API but it is easy to upgrade: just do the conversion from encode type to the final type yourself in the build closure:

```rust
Encode::using_encoded(&value, |mut value| Decode::decode(&mut v)).unwrap();
```
2019-03-04 10:49:56 +01:00
Gregory Terzian a81f7f48a0 Refactor Sync status updates into a stream of updates (#1858)
* refactor sync provider

* relative use of interval

* typo

* set propagate timeout to 2500ms

* address comments

* fix instant calc

* update intervals
2019-03-02 14:35:16 +01:00
Gav Wood 828cd9580a Stash/controller model for staking (#1782)
* First steps to stash/controller separation

* More drafting

* More drafting

* Finish draft.

* Optimisation

* Remove accidental commit

* Make it build.

* Fix linked map for traits.

* Fix Option<_> variant.

*  Improve naming a tad

* Rebuild runtime

* Builds!

* First test.

* Bump RT version

* Minor fix

* Update Mock

* adds the correct reward testcase (+staking eras which was already ok)

* fixes the basic staking testcase to work properly (along with a small fix in the module)

* New logic to avoid controller transferring stash.

* Fix some build issues.

* adding some comments to tests

* Fix impls.

* adds a few more lines to explain the test case

* More fixes.

* gets the basic test up and running again

* Fix rest of build

* Rebuild wasm

* Fix docs.

* fix staking test with new chnages

* updating some tests, pending questions

* More working tests

* adds double staking test

* Docs

* remove invalid slashing test

* Payee stuff.

* Fix build

* Docs

* Fix test

* Fix a couple of tests

* Layout plan for finishing tests before Pragmen

* Add some working tests

* re-build staking and reward tests

* Add more tests

* fix offline grace test

* Nominator should have payee checked for cleanup

* adds more nomination tets

* adds validator prefs tests

* Fix and clean up some TODOs

* Fix a couple of issues

* Fix tests

* noting warnings from tests

* final fix of local tests

* Fix slot_stake bug

* Half baked test

* Add logic to limit `unstake_threshold` set in storage

* Make sure to check before writing!

Almost forgot this one

* Move a couple of comments

* fix last broken slot_stake test

* Ignore broken test
2019-03-02 14:31:48 +01:00
Pierre Krieger ff331e7fdc Bump libp2p to 0.4.2 (#1891)
* Bump libp2p to 0.4.2

* Update yamux
2019-03-01 19:12:50 +01:00
thiolliere b332c64e38 improve storage macro static checks (#1907) 2019-03-01 12:19:24 +01:00
Pierre Krieger 90eef10d5c Address review in #1884 (#1906) 2019-03-01 11:40:57 +01:00
Bastian Köcher 2e9b2be8fa Update parity-codec/-derive to 3.1 (#1900)
* Update parity-codec/-derive to 3.1

* Update wasm stuff
2019-03-01 09:04:53 +01:00
Robert Habermeier 4c8fec17fc Some gossip improvements (#1892)
* queue messages in future

* use new gossip API in GRANDPA

* implement message_expired for grandpa

* fix indent
2019-02-28 20:19:42 +01:00
Pierre Krieger c21d7436cc Add an RPC request for the state of the network (#1884)
* Add an RPC request for the state of the network

* Fix concerns

* Fix tests

* Replace comment with TODO

* Rename the RPC
2019-02-28 19:28:38 +01:00
Svyatoslav Nikolsky 72b9df8237 fixed instant finalization of genesis block on light client (#1898) 2019-02-28 19:26:34 +01:00
Michael Müller 90e5c5ddfb Telemetry improvements (#1886)
* Fix typo

* Support multiple telemetry endpoints and verbosity levels

* Bump substrate-telemetry version

* Telemetrify Aura consensus

* Telemetrify Grandpa

* Fix CI version conflicts

* Implement style remarks

* Fix fixture

* Implement style remarks

* Clone only when necessary

* Get rid of Arc for URL

* Handle connection issues better
2019-02-28 12:22:05 +01:00
Gregory Terzian 8a72abffdd Remove blocking sync -> import-queue operations (#1818)
* remove blocking sync -> import-queue operations

add specialization to testnet

remove add peer default impl on TestNetFactory

* remove empty brackets from dummy specialization

* nits

* make mut_peers take an fn once

* add SpecializationFactory trait in test

* remove add_peer imple in grandpa, fix typo

* use cmp::max for best importing number comparison

* remove import of non-existent create_peer

* add sender to start message
2019-02-28 12:11:18 +01:00
thiolliere 04fed82940 fix construct_runtime! macro error when no event (#1887)
* fix macro error when no event

* update impl version
2019-02-28 12:01:05 +01:00
gabriel klawitter 7c1d1268ef fix VERSION transport between stages (#1888) 2019-02-28 10:13:30 +01:00
Gregory Terzian bc15fa31ff Add connected peers to protocol, use in sync provider (#1857)
* add connected peers to protocol, use in sync provider

* use PeerId::random

* address comments`

* docs

* fix import of PeerId

* rewrite rpc tests using PeerId::random

* whitespace

* nits

* remove option around peer id and remove field

* further removal of the option around peer id

* fix rpc tests
2019-02-27 18:50:47 +01:00
gabriel klawitter ea7da0d4a4 allow the whole doc pipeline to fail (#1881) 2019-02-27 14:17:19 +01:00
gabriel klawitter f5c32f71f4 ci: add kubernetes helm chart and gcp deployment (#1854)
* ci: add kubernetes helm chart and gcp deployment

* use official or parity's docker images only
2019-02-27 12:37:10 +01:00
Gregory Terzian 5282615416 Use bounded channels for network -> sync -> import (#1874)
* use bounded channels for network -> sync -> import

* bound at 4

* indent

* use return value of handle_network_msg
2019-02-27 09:19:57 +01:00
Robert Habermeier 64685c0536 Prune leaves on finality (#1871)
* support multiple leaves at same height in leaves set

* prune leaves on finalization

* test leaves behavior in client-db

* fix no-std compilation
2019-02-26 15:50:55 -05:00
thiolliere 72a8927ea3 replace some encode by using_encoded (#1863)
* replace some encode by using_encoded

* update runtime

* improve readibility
2019-02-26 09:26:11 +01:00
Pierre Krieger 34fccecc02 Add names to tokio threads (#1866) 2019-02-25 15:40:51 -05:00
Gregory Terzian 077ed00951 Remove blocking operations in SyncOracle implementation (#1852)
* remove blocking operations in SyncOracle implementation

* docs

* docs
2019-02-25 14:00:13 +01:00
Pierre Krieger 733ce7d616 Split Substrate messages into multiple substreams (#1796)
* Split Substrate messages into multiple substreams

* Add back Clogged event
2019-02-25 11:55:45 +01:00
thiolliere dab5ad913f fix construct runtime module position bug (#1849)
* fix construct runtime module position

* Update srml/support/src/runtime.rs

Co-Authored-By: thiolliere <gui.thiolliere@gmail.com>

* Update srml/support/src/runtime.rs

Co-Authored-By: thiolliere <gui.thiolliere@gmail.com>

* Update srml/support/src/runtime.rs

Co-Authored-By: thiolliere <gui.thiolliere@gmail.com>

* Update srml/support/src/runtime.rs

Co-Authored-By: thiolliere <gui.thiolliere@gmail.com>

* Update srml/support/src/runtime.rs

Co-Authored-By: thiolliere <gui.thiolliere@gmail.com>
2019-02-25 11:41:40 +01:00
Marcio Diaz 43e4544884 Client provide uncles (#1609)
* feat: add children function to backend

* feat: add test for children hashes

* feat: add uncles function to client

* fix: improve uncles function adds few more tests

* fix: remove children when reverting

* fix: typo and spec version
2019-02-25 11:21:36 +01:00
Tomasz Drwięga 63ec8b335b Refactor state machine to avoid repetitions (#1844)
* Refactor state-machine stuff.

* Fix tests.

* Fix core/client tests.
2019-02-22 13:49:36 +01:00
Pierre Krieger eaa8f0c97f Add back logging when we ban a peer (#1843)
* Add back logging when we ban a peer

* Make it less verbose
2019-02-22 13:48:59 +01:00
Jordan Beauchamp f5ab24804f Let StorageDoubleMap use borrowed key types (#1804)
* Let StorageDoubleMap use borrowed key types

* Bump impl version
2019-02-21 19:26:31 +01:00
Toralf Wittner 4bf4b37185 Limit the set of known extrinsics and blocks. (#1842)
* Limit the set of known extrinsics and blocks.

* Update Cargo.lock

* Always insert and pop oldest entry if needed.

Always inserting first ensures that the element's LRU position is
updated.
2019-02-21 19:24:23 +01:00
Andrew Jones 22aa8482ae Use BandwidthLogging struct from libp2p (#1847)
* Delete existing

* Use bandwidth from libp2p
2019-02-21 19:19:25 +01:00
Arkadiy Paronyan 1fc2db5806 Fixed finalizing multiple blocks at once (#1837)
* Fixed finalizing multiple blocks at once

* Added a test

* Added a comment
2019-02-21 19:18:59 +01:00
Stanislav Tkach 93c19326c2 SRML staking: remove 'default-features = false' from balances dev-dependency (#1813) 2019-02-21 10:11:02 +01:00
Pierre Krieger 2b71b3e84b Update to libp2p v0.4 (#1836) 2019-02-21 10:04:53 +01:00
thiolliere 19ac5e1e95 fix construct runtime macro (#1838)
if system wasn't the first module then it crashed
2019-02-21 10:04:40 +01:00
Pierre Krieger f5ba8a2ad9 Report the network PeerId to the telemetry (#1835)
* Report the network PeerId to the telemetry

* Fix accidental paste
2019-02-21 10:03:47 +01:00
Pierre Krieger 8a3f52bdd8 Fix #1825 (#1828)
* Fix #1825

* Add comment
2019-02-21 10:02:27 +01:00
Gav Wood c3e6572886 Introduce new testnet ready for 0.10 (#1677)
* Introduce new testnet ready for 0.10

* Upgraded dd spec
2019-02-20 16:16:35 +01:00