Commit Graph

1488 Commits

Author SHA1 Message Date
Gavin Wood 615dc00702 Migration fix (#5174) 2020-03-06 21:23:14 +01:00
Joshy Orndorff 91c1e1a85e Increase node template max block weight (#5171) 2020-03-06 18:32:00 +01:00
Bastian Köcher c244b1d036 Revert "Build block without checking signatures (#4916)" (#5159)
* Revert "Build block without checking signatures (#4916)"

This reverts commit e50f610907.

* Some further clean ups
2020-03-06 15:27:59 +01:00
Gavin Wood f5dc69b404 Don't remove invalid transactions when skipping. (#5121)
* Don't remove invalid transactions when skipping.

* Use a special kind of extrinsic instead of arbitrary limit.

* Fix txpool tests.

* Attempt to create more blocks.

* Bump lock

Co-authored-by: Gavin Wood <github@gavwood.com>
Co-authored-by: Nikolay Volf <nikvolf@gmail.com>
2020-03-05 17:00:31 +01:00
Benjamin Kampmann 99ae5342eb removes use of sc_client::Client from sc-rpc (#5063)
* removes use of sc_client::Client from sc-rpc

* remove Client impl from sc-finality-benches

* remove client impl from sc-finality-grandpa

* read_proof accepts iterator

* remove generic Executor param from ExecutorProvider

* fix long ass line

* code style changes

* merge with master

Co-authored-by: Arkadiy Paronyan <arkady.paronyan@gmail.com>
2020-03-05 16:41:10 +01:00
Gavin Wood dc85ccb7df Expose the runtime-benchmarks feature to the cli crate (#5143)
This exposes the `runtime-benchmarks` feature via the cli crate and
makes sure the benchmarking can be enabled. This requires that the user
goes to `bin/node/cli` and runs `cargo build --features
runtime-benchmarks` to build a node that has the feature enabled.
2020-03-05 15:57:38 +01:00
Gavin Wood 0573f1408d Introduce default-setting prime for collective (#5137)
* Introduce default-setting prime for collective

* Docs.

* Elections phragmen supports prime

* Fix

* Membership supports prime

* Fix

* Update frame/collective/src/lib.rs

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

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
2020-03-05 15:57:03 +01:00
Benjamin Kampmann d3208aa7bc Better wasm instance cache (#5109)
* Wasm instance cache

* Reduce slot locking

* Fixed test

* Dispose of instance in case of error

* Fixed benches

* Style, comments, some renames

* Replaced upgradable lock with mutex

* Bump dependencies

* Re-export CallInWasm

* Update client/executor/src/wasm_runtime.rs

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

* Update client/executor/src/native_executor.rs

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

* Update client/executor/src/native_executor.rs

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

* Update client/executor/src/wasm_runtime.rs

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

* Update client/executor/wasmtime/src/runtime.rs

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

* Update client/executor/src/wasm_runtime.rs

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

* Update client/executor/src/wasm_runtime.rs

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

* Update client/executor/src/wasm_runtime.rs

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

* Indents

* Whitespace

* Formatting

* Added issue link

Co-authored-by: Benjamin Kampmann <ben.kampmann@googlemail.com>
Co-authored-by: Gavin Wood <github@gavwood.com>
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
2020-03-05 14:02:04 +01:00
Gavin Wood 906e08ee2a Pass Prometheus Registry into Client (#5120)
* Add a few metrics to Client

* Improve PrometheusConfig

* Fix client docs
2020-03-05 13:40:33 +01:00
Gavin Wood ab58a08a53 remove on_exit from grandpa (#5098) 2020-03-05 13:38:16 +01:00
Gavin Wood 91b44299d8 Adds a session getter to historical proofs (#5125)
* Adds a session getter to historical proofs

* Bump spec_version

* Adds some useful trait derives to Proof
2020-03-05 13:37:59 +01:00
Gavin Wood ddbcefe928 Adds vested_transfer to Vesting pallet (#5029)
* Add the vested_transfer function with tests

* Add VestingDeposit for minimum amount to create a new schedule

* Remove irrelevant file commit

* Bump spec

* Add weight comment

* Fix CI build

* Make the check before the transfer

* Update frame/vesting/src/lib.rs

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

* Update frame/vesting/src/lib.rs

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

* Update frame/vesting/src/lib.rs

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

* Update frame/vesting/src/lib.rs

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

* Update frame/vesting/src/lib.rs

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

* Add tab to line 249

* Rename to `MinVestedTransfer` for clarity

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
2020-03-05 12:03:20 +01:00
Arkadiy Paronyan 9a1b3b53f2 Revert "Don't include :code by default in storage proofs (#5060)" (#5136)
This reverts commit 6ee39261c8.
2020-03-05 10:55:05 +01:00
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
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
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
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
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
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
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
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
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
Benjamin Kampmann e2776f42f9 prepare version to alpha.1 (#5055)
bump version to -alpha.1
2020-02-25 21:44: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
André Silva c498f246ec aura: remove unused tx pool (#5046)
* aura: remove unused transaction pool parameter

* node-template: remove transaction pool from aura

* aura: fix tests
2020-02-25 15:49:06 +01:00
Cecile Tonglet 2478046021 Fix: CI failing for some CLI tests (#5043)
* Initial commit

Forked at: ad90ab7ec9
Parent branch: origin/master

* Increase killing grace period of CLI tests and display more info

* Use --dev everywhere possible

* Put pruning mode to its own params struct

* Add pruning params to export-blocks command

* Added missing file

* Removed not-dev mode in tests

* Add pruning mode to the revert command

* Decrease killing grace period again

* Move back unsafe_pruning to import_params

* Applied proposed changes
2020-02-25 15:48:50 +01:00
Benjamin Kampmann 6abed97394 adding unleash to ci (#5020)
* adding unleash to ci

* fixing formatting

* with a dot please

* alpha.3 now

* do not publish testing helpers

* remove old test-helpers cruft

* fix cargo.lock

* with alpha 4

* do not publish runtime-interface-test either

* disable more test crates from publishing

* switch to alpha.5

* replace tempdir with tempfile

* update lru

* switch to bytes 0.5

* release script fixes

* switch on and to latest alpha

* BUT THE SPACES
2020-02-25 15:48:29 +01:00
Gavin Wood afa5861f3b Lazy reaping (#4895)
* Squash and rebase from gav-lazy-reaping

* Bump version

* Bump runtime again

* Docs.

* Remove old functions

* Update frame/balances/src/lib.rs

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

* Update frame/contracts/src/lib.rs

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

* Warnings

* Bump runtime version

* Update frame/democracy/src/lib.rs

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

* Update frame/system/src/lib.rs

* Clean up OnReapAccount

* Use frame_support debug

* Bump spec

* Renames and fix

* Fix

* Fix rename

* Fix

* Increase time for test

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
Co-authored-by: Benjamin Kampmann <ben.kampmann@googlemail.com>
2020-02-24 18:04:42 +01:00
Benjamin Kampmann c412c6230e Cargo.toml fixups for the release (#4975)
* setting versions to development pre-release

fixing version in dependencies

* unset already released wasm-builder

* do not publish test crates

* adding licenses

* setting homepage metadata

* set repository url
2020-02-21 17:07:00 +01:00
Robert Habermeier 0090fe979b Remove NetworkSpecialization (#4665)
* remove networkspecialization

* Fix most of the fallout

* get all tests compiling

Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
2020-02-21 14:02:12 +01:00
Cecile Tonglet e8000e7429 Add tests & Service's Configuration has optional fields that shouldn't be optional (#4842)
Related to #4776 
Related to https://github.com/paritytech/polkadot/pull/832

To summarize the changes:
1. I did not manage to validate with types the service's Configuration. But I did reduce the possibility of errors by moving all the "fill" functions to their respective structopts
2. I split params.rs to multiple modules: one module params for just CLI parameters and one module commands for CLI subcommands (and RunCmd). Every command and params are in their own file so things are grouped better together and easier to remove
3. I removed the run and run_subcommand helpers as they are not helping much anymore. Running a command is always a set of 3 commands: 1. init 2. update config 3. run. This still allow the user to change the config before arguments get parsed or right after.
4. I added tests for all subcommands.
5. [deleted]

Overall the aim is to improve the situation with the Configuration and the optional parameters, add tests, make the API more consistent and simpler.
2020-02-21 13:53:01 +01:00
Seun Lanlege 832b2ef642 Removes use of sc_client::Client from sc_consensus_babe (#5014)
* removes use of sc_client::Client from sc_consensus_babe

* Update client/consensus/babe/src/lib.rs

Co-authored-by: Benjamin Kampmann <ben.kampmann@googlemail.com>
2020-02-21 12:13:16 +01:00
André Silva f0043055cc node, node-template: disable GRANDPA observer (#5011)
* node-template: disable grandpa observer

* node: disable grandpa observer

* node: add doc about grandpa-voter infallible task

* grandpa: remove grandpa observer from public API

* grandpa: ignore observer_enabled field in config
2020-02-21 10:50:42 +01:00
Pierre Krieger ab1351c5d9 Make sure we use libp2p 0.16.1 (#5017) 2020-02-21 10:48:42 +01:00
Wei Tang 47f209a7a5 aura: remove unneeded SlotDuration struct and rename digest -> digests (#4958)
* aura: remove unneeded SlotDuration struct and rename digest -> digests

* aura: add alias type for SlotDuration

* aura: fix tests

* Fix missing parameters in get_or_compute

* Use special function for fetching aura slot_duration
2020-02-21 10:48:18 +01:00
Tomasz Drwięga e8871e0327 Un-deprecate ValidateUnsigned (#5003)
* Un-deprecate ValidateUnsigned.

* Bump runtime.

* Bump runtime.

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
2020-02-21 10:42:55 +01:00
Gavin Wood f5176ba377 Benchmark macro (#4962)
* MAcro benchamrks

* Iterative macro

* Tidying it up.

* Macro improvements

* Bits..

* Last benchmaks.

* Repo benchmark macro

* Add the possibility of evaluating arbitrary expressions in a
benchmaark

* Better syntax and docs

* Update `BenchmarkParameter`

* Add `ignore` to sudo-code in docs

* First try of timestamp implementation.

* Fix macro docs, remove warnings.

* Use macro in balances pallet.

* Make some space in frame benchmarking.

* Remove _benchmarks_seed variable.

* Bump impl_version.

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
Co-authored-by: Marcio Diaz <marcio@parity.io>
2020-02-20 17:20:16 +01:00
Stanislav Tkach 504914b0a6 Remove deprecated API (#4993)
* Remove deprecated API

* Remove (some) allow(dead_code)

* Bump spec_version

* Fix import, remove allow dead code.

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
2020-02-20 17:03:33 +01:00
Kian Paimani b368736be4 Unsigned transactions should also note weight (#4998)
* Make unsigned also note weight

* Bump.

* Fix tests

* Better fee test

* Fix another test

* Update lock file
2020-02-20 16:46:11 +01:00
Tomasz Drwięga 9a0b8b5be5 Offchain Workers: Example Pallet (#4989)
* Example of offchain worker pallet.

* Fix compilation issues.

* Use serde_json to parse JSON.

* Add some basic tests.

* Working on docs.

* Fix compilation

* Finish docs for signed.

* Work on unsigned send.

* Add some tests and missing docs.

* Add example of StorageValueRef

* Add weight.

* Extra \n

* Fix im-online test.

* Bump runtime.

* Fix tests.

* Apply suggestions from code review

Co-Authored-By: Joshy Orndorff <JoshOrndorff@users.noreply.github.com>
Co-Authored-By: Gavin Wood <gavin@parity.io>

* Address review comments.

Co-authored-by: Joshy Orndorff <JoshOrndorff@users.noreply.github.com>
Co-authored-by: Gavin Wood <github@gavwood.com>
2020-02-20 15:21:34 +01:00
Shawn Tabrizi 8cdf98c773 vesting_balance returns Option (#4987)
* `vesting_balance` returns `Option`

* bump impl
2020-02-20 13:25:52 +01:00
Nikolay Volf 9cb35b9788 Speedup import benchmark (#4995)
* use lazy matrix

* speedup

* Update bin/node/testing/benches/import.rs

Co-Authored-By: Kian Paimani <5588131+kianenigma@users.noreply.github.com>

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
2020-02-20 11:58:41 +03:00