Commit Graph

2421 Commits

Author SHA1 Message Date
Ashley bb44f8fc24 Add a browser-utils crate (#4394)
* Squash

* Fix keystore on wasm

* Update utils/browser/Cargo.toml

Co-Authored-By: Benjamin Kampmann <ben@gnunicorn.org>

* export console functions

* Use an Option<PathBuf> in keystore instead of cfg flags

* Add a KeystoreConfig

* Update libp2p

* Bump kvdb-web version

* Fix cli

* Upgrade versions

* Update wasm-bindgen stuff

Co-authored-by: Benjamin Kampmann <ben.kampmann@googlemail.com>
2020-01-07 16:30:04 +01:00
Max Inden d76a33033d client/network-gossip: Remove GossipEngine::abort method (#4552)
`GossipEngine::abort` and thus `ConsensusGossip::abort` are never
called. This patch removes both.
2020-01-07 15:26:40 +01:00
Arkadiy Paronyan bc9676737f Expose load_spec (#4556) 2020-01-07 15:08:27 +01:00
Gavin Wood 3cc6249cdf Fix error message (#4549) 2020-01-07 01:57:32 +01:00
Joshy Orndorff 6b57c7181f typo: lead -> leave (#4546) 2020-01-06 20:55:39 +01:00
André Silva a89d87d708 client: add a block blacklist extension (#4544)
* client: add a block blacklist extension

* test-utils: fix client construction

* client: fix rustdoc test
2020-01-06 18:03:44 +00:00
André Silva c4e20af74d client: allow reverting finalized blocks (#4535)
* client: allow reverting blocks past finality

* client: fix leaves reversion

* client: extend docs on revert

* client: add comment on leaves revert
2020-01-06 14:58:43 +00:00
André Silva 4fa4dfb77b client: helper to create standalone client without service (#4536) 2020-01-06 14:52:14 +00:00
André Silva c72619ed71 client: hack around fork blocks deserialization issue (#4539) 2020-01-06 13:43:25 +01:00
Shawn Tabrizi 7efa62725e Update copyright year (#4532) 2020-01-05 14:05:44 +01:00
Max Inden c5fe4295f8 *: Register network event stream for authority discovery (#4344)
Previously one would create a sender and receiver channel pair, pass the
sender to the `build_network_future` through the service builder and
funnel network events returned from polling the network service into the
sender to be consumed by the authority discovery module owning the
receiver.

With recent changes it is now possible to register an `event_stream`
with the network service directly, thus one does not need to make the
detour through the `build_network_future`.
2020-01-03 20:47:12 +00:00
Nikolay Volf f0e21eff09 Update kvdb-* and trie (#4483) 2020-01-03 20:46:42 +00:00
Max Inden 5cf682cece client/authority-discovery: Limit number of connections to authorities (#4487)
* client/authority-discovery: Limit number of connections to authorities

Instead of connecting to all sentry nodes of all authorities, with this
patch the authority discovery module does the following:

- Choose one sentry node per authority at random.

- Choose MAX_NUM_AUTHORITY_CONN out of the above at random.

The module uses randomness to prevent hot spots, e.g. all nodes trying
to connect to a single node. If the authority discovery module would
choose the nodes to connect to at random on each new address that it
learns of, the node would go through a lot of connection churn.  Instead
it creates a random seed at start up and uses this seed for its RNG on
each update cycle.

* client/authority-discovery: Extract address cache into own module

* client/authority-discovery/src/addr_cache: Add basic unit tests

* client/authority-discovery: Replace unwrap with expect on [u8] cmp

* .maintain/sentry-node/docker-compose.yml: Prefix endpoint flags

* client/authority-discovery/src/addr_cache: Use sort_unstable and cmp

* client/authority-discovery: Use BTreeMap in addr_cache for sorted iter

To reduce connection churn it is preferrable to have `get_subset` of the
`addr_cache` to return the same result on repeated calls. `get_subset`
iterates a map. To make the process of iteration deterministic, use a
`BTreeMap` instead of a `HashMap`.
2020-01-03 20:40:19 +00:00
Pierre Krieger 0b606613b1 ServerToWorkerMsg -> ServiceToWorkerMsg (#4519) 2020-01-03 11:47:31 +01:00
Nikolay Volf 508f94acdf Update libp2p to fix build (#4522)
* update libp2p

* update toml files also
2020-01-02 18:37:42 +01:00
Nikolay Volf 6d06a19f41 Refactor to use only chain info (#4516) 2020-01-02 12:46:07 +01:00
Nikolay Volf 585f0c0811 update libsecp256k1 (#4513) 2019-12-30 11:26:34 -08:00
Bastian Köcher 56355879be Fix cli for structopt 0.3.7 and pin to that version (#4509)
* Fix cli for structopt 0.3.7 and pin to that version

This is just some hotfix to make everything compile. In the future it
will require another pr to not depend on internals of StructOpt, but
that will probably also require some additions to StructOpt itself. To
not break the code again with another StructOpt, this also pins the
StructOpt version.

* Fix benches

* Fix for fix
2019-12-28 22:52:18 +01:00
Nikolay Volf 96744926b2 Check aura slot numbers are strictly increasing (#4020)
* initial block import handler

* fix node template

* fix error message

* fix error message again

* final fixes

* fix node template again
2019-12-26 14:04:07 +01:00
Weiliang Li fe587c72ec Use sc_network::NetworkStateInfo instead of implementing redundant traits (#4436)
* Implement local_peer_id for gossip

* refactor local_peer_id

* fix

* reset gossip

* Update tests.rs

* fix ci

* fix review

* fix Cargo.lock

* fix Cargo.lock
2019-12-24 16:17:19 +01:00
Sergei Pepyakin 1782fbbbba Extract execution engines definitions into their own crates (#4489)
* Clean imports in wasmi_execution

* Replace `interpret_runtime_api_result` with `pointer_and_len_from_u64`.

* Extract sc-executor-common crate

* Extract `sc-executor-wasmi` into its own crate

* Extract `sc-executor-wasmtime` into its own crate.

* Add missing headers.

* Clean and docs

* Docs for sc-executor-wasmi

* Expand a comment about sandboxing

* Fix assert_matches

* Rename (un)pack_ptr_and_len and move them into util module

* Remove wasmtime errors in sc-executor-common
2019-12-24 13:17:41 +01:00
Tomasz Drwięga b214b3f3e9 Fix replace_previous of Ready Transaction Queue. (#4488)
* Fix transaction replacements.

* Test.

* Fix typo.

* Update client/transaction-pool/graph/src/ready.rs

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

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
2019-12-24 11:13:29 +01:00
Stanislav Tkach f4a3056167 Change log level for DhtEvent::ValueNotFound from warn to debug (#4485) 2019-12-23 17:23:35 +01:00
Joshy Orndorff f6cbf4421f Rename ChainSpec field (#4471)
* initial rename

* nitpick: add space in "chain spec"

* Add comment to client spec.
2019-12-20 21:50:18 +01:00
Arkadiy Paronyan 9950ea98fc Shared params in CLI API (#4466)
* Common shared parames getter

* Expose more types from `service-builder`

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
2019-12-20 16:05:01 +01:00
Bastian Köcher bfad5f3ffc Fix warnings and make CI working again (#4469)
* Fix warnings and make CI working again

* Fix test
2019-12-20 14:47:19 +01:00
Bastian Köcher 054607f092 Subkey add support for interactive password (#4465)
* Subkey add support for interactive password

* Support inserting the URI from tty as well
2019-12-20 12:36:55 +01:00
André Silva dfe87ec61e babe: remove unused slot_duration variable (#4461) 2019-12-19 17:38:01 +00:00
Stanislav Tkach d46eaf79aa Warn about using --rpc-external and --ws-external options (#4448)
* Warn about using --rpc-external and --ws-external options

* Apply review comments

* Remove links placeholders

* Add links to wiki
2019-12-19 17:57:42 +01:00
Tomasz Drwięga 216f77d91f Document TransactionStatus and fix termination conditions. (#4446)
* Document TransactionStatus and fix termination conditions.

* Update client/rpc-api/src/author/mod.rs

Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>
2019-12-18 21:28:25 +01:00
André Silva 1e550b3dac grandpa: fix slow gossip test (#4440) 2019-12-18 14:32:09 +01:00
André Silva 1fc3060feb grandpa: log everything under afg target (#4443) 2019-12-18 14:18:29 +01:00
Robert Habermeier 8f1b5b840d client: Do not set fork sync request via network-gossip (#4439)
The finality-grandpa module needs two sets of functionalities from the
network:

1. Everything gossip related, e.g. event_stream, write_notification, ...

2. The ability to set a fork sync request for a specific block hash.

Instead of embedding (2) inside of (1) this patch extracts (2) from (1)
having finality-grandpa depend on a `Network` that fulfills the
`network_gossip::Network` trait and that can set block sync requests.

On the one hand this improves the overall structure splitting things
that don't logically belong together. On the other hand it does
reintroduce a lot of trait bounds within finality-grandpa.
2019-12-18 14:17:13 +01:00
Robert Habermeier da87c3c1e3 RPCs for reserved peers (#4423)
* RPC forwarders for adding reserved peers

* implement service side of reserved-peer RPCs

* Clean up unnecessary format! invocation

Co-Authored-By: Niklas Adolfsson <niklasadolfsson1@gmail.com>

* add some tests for the new RPC methods

* remove redundant `data` field

Co-Authored-By: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
2019-12-18 14:12:15 +01:00
Weiliang Li 637d95e5ea Add dyn for slog::SerdeValue in telemetry (#4435) 2019-12-18 13:13:59 +01:00
Gavin Wood 9550c845f3 Fix the subkey error message (#4428)
* Fix the subkey error message

* Fix check_benchmarks
2019-12-18 12:48:34 +03:00
Benjamin Kampmann 9200bfa997 Setting versions locally towards 2.0 release (#4404)
* clean up cargo.toml syntax

* bumping versions to 2.0

* bump networking to 0.8

* move consensus down to 0.8

* bump consensus pallets to 0.8.0, too

* Upping babe and aura pallets

* add remaining, missing version definitions

* missed some
2019-12-17 22:05:50 +08:00
Wei Tang 33fa445db0 docs: fix link to babe (#4418) 2019-12-17 14:04:57 +01:00
Niklas Adolfsson 7c6ad9dd1c [client cli] generic blocknumber (#4376)
* rewrite me

* [cli]: make `BlockNumber` generic

* cleanup
2019-12-17 11:45:20 +01:00
Svyatoslav Nikolsky cd718cd77d recover light client integration tests (#4377) 2019-12-17 08:45:04 +01:00
Stanislav Tkach 7e9253d35d Use decl_error in the treasure module (#4370) 2019-12-17 14:03:08 +08:00
Tomasz Drwięga 8778ca7dc8 [big refactor] Remove crate aliasing. (#4395)
* Rename: Phase 1.

* Unify codec.

* Fixing: Phase 2

* Fixing: Phase 3.

* Fixing: Phase 4.

* Fixing: Phase 5.

* Fixing: Phase 6.

* Fixing: Phase 7.

* Fixing: Phase 8. Tests

* Fixing: Phase 9. Tests!!!

* Fixing: Phase 10. Moar tests!

* Finally done!

* More fixes.

* Rename primitives:: to sp_core::

* Apply renames in finality-grandpa.

* Fix benches.

* Fix benches 2.

* Revert node-template.

* Fix frame-system in our modules.
2019-12-16 20:36:49 +08:00
Robert Habermeier 16047e30bf babe: exponential backoff on missed blocks (#4397)
* fix srml-support compilation

* babe: exponential backoff on missed blocks.
2019-12-16 01:24:49 +09:00
cheme 0ece5d9e17 Fix key collision for child trie (#4162)
* In progress, runtime io must switch to future proof root +
child_specific (unique id) + u32 type.

* Switch interface, sr-io seems ok, rpc could use similar interface to
sr-io, genesis json broken if there is child trie in existing encoding
genesis.

* test from previous implementation.

* fix proving test.

* Restore Keyspacedb from other branch, only apply to child trie.

* Removing unneeded child_info from child root (child info are stored
if things changed, otherwhise the root does not change).

* Switch rpc to use same format as ext: more future proof.

* use root from child info for trie backend essence.

* Breaking long lines.

* Update doc and clean pr a bit.

* fix error type

* Restore removed doc on merge and update sr-io doc.

* Switch child storage api to use directly unique id, if managed id
where to be put in place, the api will change at this time.

* Clean deprecated host interface from child.

* Removing assertion on child info (can fail depending on root
memoization).

* merging child info in the overlay when possible.

* child iteration by prefix using child_info.

* Using ChainInfo in frame support. ChainInfo gets redesign to avoid
buffers allocation on every calls.

* Add length of root to the data of child info.

* comments

* Encode compact.

* Remove child info with root.

* Fix try_update condition.

* Comment Ext child root caching.

* Replace tuples by struct with field

* remove StorageTuple alias.

* Fix doc tests, and remove StorageOverlay and ChildStorageOverlay
aliases.
2019-12-14 11:11:19 +09:00
Pierre Krieger c66c191b68 Extract consensus_gossip.rs and put it in its own crate (#4284)
* Extract gossiping system from network

* Finish porting GRANDPA tests

* Try put correct engine ID

* Fix messages encoding

* Fix communication tests

* Use a threads pool to spawn stuff

* Fix compilation everywhere

* Fix bad merge conflict

* Remove dependency on async-std

* Apply suggestions from code review

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

* More suggestions

* Remove network startup GP future

* Update to futures_timer

* adjust wait_when_behind test

* Pass correct Roles after handshake

* Revert "adjust wait_when_behind test"

This reverts commit 23cb3a0a6d25ed732c2cd648607bc44ef2ab0919.

* Crate root documentation

* Remove MessageRecipient

* Address concerns

* Fix more concerns

* Forgot Cargo.lock
2019-12-13 19:16:10 +01:00
Benjamin Kampmann c5a709a882 Fix folder names in client and test (#4360)
* client/rpc/api -> client/rpc-api

* client/util/wasm-builder-runner -> utils/wasm-builder-runner

* client/grafana-data-source -> utils/grafana-data-source

* test/utils -> test-utils

* fix moved path

* Update Cargo.lock

* Update Cargo.lock
2019-12-11 16:41:38 +01:00
Benjamin Kampmann 7773daaf5b Clean up crate names and locations (#4361)
* rename crate: sp-transaction-pool-api -> sp-transaction-pool

* move primitives/core/derive-debug -> primitives/derive-debug; primitives/core/storage -> primitives/storage

* rename crate sp-core-storage -> sp-storage

* rename and move: test/utils/transaction-factory -> client/transaction-factory

* move transaction-factory -> node/transaction-factory

* fix missing rename

* Move chain-spec-builder into bin/utils

* move subkey into bin/utils

* Update new subkey location

* Update docs to reflect new location for utils

* fixing import name
2019-12-11 15:33:00 +01:00
Benjamin Kampmann df133d6be3 Fix folder names in primitives (#4358)
* sr-arithmetic -> arithmetic

* sr-sandbox -> sandbox

* primitives/sr-staking-primitives -> primitives/staking

* primitives/sr-version -> primitives/version

* primitives/block-builder/runtime-api -> primitives/block-builder
2019-12-11 11:36:29 +01:00
Benjamin Kampmann 605c0e655e Fix a bunch of low work dependency cycles (#4354)
* take test-client off sp-consensus

* use test primitives rather than test client in authority discovery tests

* move runtime-interface tests

* don't forget to remove the dev-dependency

* remove more unneeded dev deps

* add changes_trie_config to test prrimitives

* Separate network crates from its integration tests

* Fix up consensus crates for networking test changes

* remove unnecessary dependencies

* remove unused addition

* remove unnecessary dev-dependencies

* fixing finality grandpa tests

* removing unnecessary executor dependencies
2019-12-11 10:27:34 +01:00
Benjamin Kampmann f0cc89a4b0 Break appcrypto dep cycle (#4347)
* move application-crypto tests into seperate crate

* Fix crate name, update script and add docs

* pressing 'save' helps

* remove useless lines

* adding header

* split into actual modules
2019-12-10 22:12:57 +01:00