Commit Graph

3343 Commits

Author SHA1 Message Date
Benjamin Kampmann ff2a36d7cb Hide benchmarks behind a feature flag (#5024)
* Hide benchmarks behind a feature flag

* Propage attributes in impl_runtime_apis macro

* Bump impl_version

* Fillter cfg attributes

* Hide more things under the feature

* Fix set_block_number availability

* Rename filter_attrs -> filter_cfg_attrs

* Rename runtime_benchmarks to runtime-benchmarks
2020-03-05 10:40:55 +01:00
Gavin Wood 8bf855b09d use fixed quote (#5135) 2020-03-05 10:29:38 +01:00
Gavin Wood 5bda7c5072 Task manager for background/async tasks in service (#5092)
* Reorganize tasks into task manager

* move to separate file and improve api

* address api issues

* fix spawning inside closures

* decouple executor

* tasks_setup -> tasks_builder

* remove drops

* add deprecatiion comment

* add pub(super)

* fix identation
2020-03-05 09:29:12 +01:00
Benjamin Kampmann 3bd088d41c Support enabling features with wasm-builder (#5131)
This adds support for enabling features in the wasm build. The `default` and
`std` feature are ignored in the build.
2020-03-05 08:52:23 +01:00
Benjamin Kampmann 5a33228ea9 Reduce usage of Blake2Hasher (#5132)
This reduces the usage of `Blake2Hasher` in the code base and replaces
it with `BlakeTwo256`. The most important change is the removal of the
custom extern function for `Blake2Hasher`. The runtime `Hash` trait is
now also simplified and directly requires that the implementing type
implements `Hashable`.
2020-03-05 08:51:03 +01:00
Gavin Wood 406fa981bb add ss58 prefix for Acala & Laminar (#5061) 2020-03-04 20:34:33 +01:00
Benjamin Kampmann 6ee39261c8 Don't include :code by default in storage proofs (#5060)
* Adds test to verify that the runtime currently is always contained in
the proof

* Start passing the runtime wasm code from the outside

* Fix compilation

* More build fixes

* Make the test work as expected now :)

* Last fixes

* Fixes benchmarks

* Review feedback

* Apply suggestions from code review

Co-Authored-By: Sergei Pepyakin <sergei@parity.io>

* Review feedback

* Fix compilation

Co-authored-by: Sergei Pepyakin <s.pepyakin@gmail.com>
2020-03-04 20:26:16 +01:00
Benjamin Kampmann 67837c6233 Forget peerset manager nodes after 5mn (#5108)
* Forget peerstore nodes after 5mn

* Bump to one hour

* Also bump on rediscover
2020-03-04 20:24:17 +01:00
Benjamin Kampmann 6cf944cf21 Drop db-cache default from 1gig to 32mb (#5128) 2020-03-04 17:22:02 +01:00
Shawn Tabrizi 3d6329a22d A Pallet for Benchmarking Common Runtime Operations (#4902)
* Benchmark pallet

* Add a bunch more benchmarks

* do nothing test

* new benchmarks

* Clean up extra tests

* Encode and Decode Vec<T::AccountId>

* Starting to migrate benchmarks to macro

* Use macro

* Remove call and storage

* Update Cargo.toml

* Add storage recalc benchmark

* Add support for custom functions in benchmark! macro

* Reset DB for storage recalc

* Feedback from review

* Add more comments

* Remove benchmark pallet from node

* Fix cargo files

* Fix comments

* Change `crate` to `super`

* missed one

* Use results of benchmark encode/decode

* Pass generic to extra functions

* reset macro to master

* Update lib.rs

* Update to use standard syntax
2020-03-04 17:21:42 +01:00
Jakub Pánik e366b5bd2c Added subscribe_all_heads RPC function (#4979)
* Added subscribe_all_heads RPC function

* Update client/rpc/src/chain/tests.rs

Fixed style ( spacing )

Co-Authored-By: Tomasz Drwięga <tomusdrw@users.noreply.github.com>

Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
2020-03-04 14:19:38 +01:00
Chevdor f5a797982f Fix substrate default storage location (#5064) 2020-03-04 14:17:50 +01:00
Logan Saether 009f354174 Adds more Democracy docs (#5077)
* Adding more democracy docs

* Remove Cargo.lock

* Update docs in democracy

* Update frame/democracy/src/lib.rs

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

* Update frame/democracy/src/lib.rs

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

* Update frame/democracy/src/lib.rs

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

* Update frame/democracy/src/lib.rs

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

* Update frame/democracy/src/lib.rs

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

* Update frame/democracy/src/lib.rs

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

* Update frame/democracy/src/lib.rs

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

* Update frame/democracy/src/lib.rs

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

* Update frame/democracy/src/lib.rs

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

* Resolve

* Remove cargo.lock again

* Add paragraph on AQB

* Update frame/democracy/src/lib.rs

* Update frame/democracy/src/lib.rs

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
2020-03-04 13:52:30 +01:00
Marcio Diaz f39e705523 Fix benchmarks! macro for non dispatchable code (#5100)
* Init allowing non dispatchable closure to be benchmarked.

* Remove example, add it in timestamp

* Fix nits.

* Move test to example.

* Update frame/example/src/lib.rs

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

* Update frame/example/src/lib.rs

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

* Apply review suggestion: move test to benchmarking crate.

* Update frame/benchmarking/src/lib.rs

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

* Remove unused imports.

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: Benjamin Kampmann <ben.kampmann@googlemail.com>
2020-03-04 10:13:14 +01:00
Gavin Wood 619f64efe9 Lazy payouts (#4474)
* TODOs

* Remove superfluous:

* partial implementation

* full implementation

* fix preferences

* update comments

* upgrade test WIP

* fix more tests

* fix cutoff

* fix saturation

* comment

* upgrade mock

* upgrade test

* WIP migration

* WIP migration

* remove slot stake stuff

* fix merge

* migration of ledger

* remove equalize from test

* add test

* fix

* update doc

* fix compilation

* improve test readibility

* improve doc

* fix most todo

* fix migration and test

* remove println

* WIP

* add test and spec

* weight

* update doc

* safer end_era

* fix exposure of conversion

* Revert "safer end_era"

This reverts commit 72ff737d27be67d87308514b13e2574bc5f09fce.

* fix useless put

* exposure clipped

* doc

* fix payout with clipped

* fix node runtime

* add doc

* pluggable and generalized staking module

* remove print

* update doc

* refactor

* improve documentation and implementation

* fix test

* Fix test

* fix test

* fix test

* fix remove lowest stake from exposure, not biggest.

* nomination index arguments in nominator_payout

* add test

* try to fix offence

* apply slashed and bond eras until active era

* doc

* update spec version

* add test upgrade from previous test environment

* Apply suggestions from code review

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

* nominators upgrade has been cleaned

* dynamic history depth implementation

* make current_era - history_depth included

* Change equality check to start era to less than or equal

* Use era specific validator prefs

* Add print statement and comment about start era if <

* fix next_reward overflow

* make more check for bad era claim for zero cost

* small refactor

* code refactor + fix use of deprecated storage

* fix wasm build

* add comment

* Fix tests

* remove outdated comment

* Apply suggestions from code review

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

* gather active era information into one storage

Co-authored-by: thiolliere <gui.thiolliere@gmail.com>
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
2020-03-03 14:48:20 +01:00
Bastian Köcher a1b53280b4 Update to SCALE 1.2.0 (#5113)
This updates `parity-scale-codec` to `1.2.0`, which includes multiple
performance improvements and a fix that bounds the capacity of a vector
at decoding.
2020-03-03 14:40:02 +01:00
Ashley 883ddfc897 Add more metrics to prometheus (#5034)
* Add a few things

* Add finality_grandpa_round

* fix fg tests

* Nitpicks

* Nitpicks

* Fix name of prometheus crate
2020-03-03 11:36:58 +01:00
joe petrowski b27a820032 Change extrinsic_count to extrinsic_index in pallet-utility (#5044)
Co-authored-by: Benjamin Kampmann <ben.kampmann@googlemail.com>
2020-03-03 10:52:38 +01:00
Bastian Köcher 4f852d6922 Expose state-db memory info (#5110)
This exposes memory statistics from the state-db.
2020-03-03 10:24:26 +01:00
Bastian Köcher d3244b728a Make sure we remove a peer on disconnect in gossip (#5104)
* Make sure we remove peers on disconnect in gossip state machine

* Clear up the code

* Add a comment
2020-03-02 18:20:04 +01:00
Pierre Krieger 9ab9134ea5 Remove request ID from the new protocol (#5049) 2020-03-02 13:43:29 +01:00
Pierre Krieger b19ea34773 Update to libp2p 0.16.2 (#5088) 2020-03-02 11:00:56 +01:00
Fedor Sakharov 8539b85c99 Offence reporting returns a result (#5082)
* Offence reporting returns a result

* Bump spec_version

* Use unwrap instead of assertions

* Fix more review grumbles
2020-03-02 11:00:38 +01:00
pscott d7e4aa41b9 Make export blocks default to json on stdout (#5090)
* Make export blocks default to json on stdout

* Multiline instead of single line to stay under 100 cols

* Change --json flag to --binary, defaulting to json
2020-03-02 10:59:39 +01:00
Ashley 9a925faf7d Remove more instances of futures01 (#4633)
* Start removing last few instances of futures01

* Use to_poll on wasm

* Revert "Use to_poll on wasm"

This reverts commit 1c61728f10d520df5f9b28c415a0db68e478b9c7.

* Fix fg test

* Upgrade network test futures

* Update offchain hyper version

* Update service test

* bump tokio to 0.2.10

* Removed some unneeded tokios

* fixes

* fix run_until_all_full

* Make service test debuggable

* Update client/offchain/src/api/http.rs

Co-Authored-By: Demi Obenour <48690212+DemiMarie-parity@users.noreply.github.com>

* Add service_test to test-int output

* nitpicking

* Finally fix test

* Give up and revert client/serviec/test

* Revert gitlab ci too

Co-authored-by: Demi Obenour <demi@parity.io>
2020-02-28 17:02:33 +01:00
Toralf Wittner c1bf4702e2 Update yamux to version 0.4.4. (#5086) 2020-02-28 15:41:10 +01:00
Marcio Diaz 347b5d641c Add options to overwrite range bounds in benchmark command. (#5072)
* Add --mins --maxs to benchmark command.

* Apply review suggestions.
2020-02-28 15:40:42 +01:00
Marcio Diaz d39605d9cd Propagate DispatchError for benchmarks. (#5075)
* Propagate DispatchError for benchmarks.

* Apply review suggestions.

* Use RuntimeString.

* fix expect

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

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
2020-02-28 12:05:27 +01:00
Benjamin Kampmann 25d1b7878a prepping for Alpha.3 (#5080)
* Bump to alpha.3

* update gitlab-ci
2020-02-27 22:06:08 +01:00
Ashley 7b88aada1d rename browser-utils to substrate-browser-utils (#5079) 2020-02-27 18:28:29 +01:00
Max Inden 9d49d917f6 *: Rename prometheus-exporter crate to substrate-prometheus-end… (#5076)
This patch renames the crate for the following two reasons:

1. The prometheus-exporter crate introduces native in-process Prometheus
style instrumentation to the Substrate project. Within the Prometheus
ecosystem the term "exporter" is used for external processes exposing
metrics for e.g. the Linux Kernel. In-process exposition would be
described via the term "endpoint".

2. "prometheus-exporter" is generic and ignores the fact that it is only
usable within the context of Substrate. In addition the name
"prometheus-exporter" is already taken on crates.io.
2020-02-27 17:48:26 +01:00
Sergei Pepyakin 9b67ac43ef pallet-transaction-payment clean up (#5070)
* Formatting clean up

* Introduce separate setters for the fees.
2020-02-27 17:25:28 +01:00
Seun Lanlege f26f703ad4 removes use of sc_client::Client from sc_basic_authorship (#5050)
* removes use of sc-client from sc-basic-authorship

* refactor use of ProposerFactory

* correct dep path
2020-02-27 17:12:00 +01:00
Bastian Köcher e5123166d4 Remove deprecated host functions (#5038)
Sadly we need to keep one function `ext_blake2_256`. This function is
manually defined in `sp-core`.
2020-02-27 13:38:55 +01:00
Seun Lanlege 5907b0d902 removes use of sc_client::Client from sc_finality_grandpa (#5030)
* removes use of sc_client::Client from sc_finality_grandpa

* code formatting

* code formatting

* removes use of sc_client::Client from sc_finality_grandpa
2020-02-27 12:19:07 +01:00
Nikolay Volf bad9647af9 Fix revalidation not revalidating multiple times (#5065) 2020-02-27 12:18:10 +01:00
Benjamin Kampmann d6aa8e954c set missing metadata fields, prepping alpha.2 (#5067)
* setting first batch of descriptions

* fix what I just broke

* next batch

* and pallets, too

* last batch

* set cargo.lock

* keep'em dev-deps

* bump version to alpha.2
2020-02-27 00:22:44 +01:00
Eric 01c6b7cdde Fix/div by zero (#5041)
* Handle gas_price being zero separately

* Bump spec_version

* Add a unit & integration tests for gas price = 0
2020-02-26 15:19:53 +01:00
s3krit a2ff54dfa9 Activate publishing of draft releases... (#5062)
* Activate publishing of draft releases...

... And fix the message sending (missing parameter).

* publish_draft_release.sh now checks latest...

... release on github rather than just a tag
2020-02-26 14:36:02 +01:00
Denis Pisarev 1f8c738000 Fix the issue with trybuild's ui tests (#4992)
* repro ui bug

* fix the tests

* test with the new image

* test without CARGO_HOME

* test without fixes

* test again

* fix trybuild old versions

* bump CArgo.lock

* fix trybuild newest versions

* bump Cargo.lock

* trying on the latest image

* bump Cargo.lock

* run with the old image

* ci will be green on the image from 2020-02-19 [skip ci]

* bump Cargo.lock
2020-02-26 12:41:39 +01:00
Bastian Köcher be1e247d57 Adds documentation for wipe and commit (#5053)
* Adds documentation for `wipe` and `commit`

This adds documentation to `wipe` and `commit` of `Externalities`.
Besides that it removes the default implementation that would just panic
and requires that all implementers of the trait implement the functions.

* Update primitives/externalities/src/lib.rs

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

Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
2020-02-26 12:14:07 +01:00
Chevdor 0dc9e615e0 Fix dockerfile (#5059) 2020-02-26 12:12:39 +01:00
Pierre Krieger 85959819dc Make these chainspecs fields private (#5031) 2020-02-26 12:11:32 +01:00
Arkadiy Paronyan 492a820c6c Sync: validate block responses for required data (#5052)
* Less verbose state-db logging

* Validate block responses for block bodies

* Update client/network/src/protocol.rs

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

* Added validation test

* Disconnect on missing header as well

* Typo

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

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: André Silva <andre.beat@gmail.com>
2020-02-25 22:17:42 +01:00
Benjamin Kampmann e2776f42f9 prepare version to alpha.1 (#5055)
bump version to -alpha.1
2020-02-25 21:44:23 +01:00
Benjamin Kampmann 327e4ad4ac do not check unleash on every PR, only master and tags (#5054)
* do not check unleash on every PR, only master and tags

* move scripts folder

* add signed-tag check to CI

* remove publish-to-crates-io dependencies

Co-authored-by: s3krit <pugh@s3kr.it>
2020-02-25 20:02:57 +01:00
Nikolay Volf aa41b93374 Fix documentation for "BlockBuilder::push_trusted" (#5051)
* fix doc

* rephrase
2020-02-25 17:58:23 +01:00
Shawn Tabrizi e2d50d558b Remove indices from node-template (#5025)
* Remove indices from node-template

* Use identity lookup instead

* Bump impl

* clean cargo.toml
2020-02-25 15:51:46 +01:00
Marcio Diaz d024364503 Add steps setting to benchmarking CLI (#5033)
* Add steps setting to CLI, use max value to hit worst case.

* Bump impl_version.

* Apply review suggestion.
2020-02-25 15:51:25 +01:00
Bastian Köcher 36770979bb Extend rust nightly detection in wasm-builder (#5021)
Instead of just testing `cargo` and `rustup run nightly`, we now test
the `CARGO` env variable and also scan non default nightlies. The user
is also now able to select the toolchain with `WASM_BUILD_TOOLCHAIN`.
2020-02-25 15:50:45 +01:00