Commit Graph

3496 Commits

Author SHA1 Message Date
André Silva 3a136bdcf9 Internal version dependencies cleanup (#5401)
* always depend on latest alpha version

* integrate arithmetic fuzzer into root workspace
2020-03-25 15:02:39 +01:00
Tomasz Drwięga 04ccb179e9 Pass transaction source to validate_transaction (#5366)
* WiP

* Support source in the runtime API.

* Finish implementation in txpool.

* Fix warning.

* Fix tests.

* Apply suggestions from code review

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

* Extra changes.

* Fix test and benches.

* fix test

* Fix test & benches again.

* Fix tests.

* Update bumpalo

* Fix doc test.

* Fix doctest.

* Fix doctest.

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
Co-authored-by: Nikolay Volf <nikvolf@gmail.com>
2020-03-25 14:09:23 +01:00
Bastian Köcher 601ac11e52 Upgrade bumpalo to make cargo deny happy (#5398) 2020-03-25 13:17:42 +01:00
Nikolay Volf e85d7a4ba7 Fix propagation in network (#5395)
* fix propagation in network

* Update client/service/src/lib.rs

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

* fix suggestion

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
2020-03-25 13:03:58 +01:00
Sergei Pepyakin e61ca13cb1 Remove XX hash from contract API. (#5383) 2020-03-25 10:53:27 +01:00
Bernhard Schuster d4093af110 frame: base 2 pow is just a shift left op (#5393) 2020-03-25 10:50:22 +01:00
thiolliere 8a41ac664b on_initialize return weight consumed and default cost to default DispatchInfo instead of zero (#5382)
* frame update

* doc

* move offchain worker trait also

* fix weigh merge

* indentation

* reorder for better git diff

* comment

* fix benchmark

* remove test
2020-03-24 19:51:04 +01:00
Wei Tang 2e558908e6 Split PrimaryPreDigest and SecondaryPreDigest (#5373)
* Split PrimaryPreDigest and SecondaryPreDigest

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

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

* Update primitives/consensus/babe/src/digests.rs

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

* Update primitives/consensus/babe/src/digests.rs

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

* Update primitives/consensus/babe/src/digests.rs

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

Co-authored-by: André Silva <andre.beat@gmail.com>
2020-03-24 18:07:51 +01:00
Denis Pisarev 06525e2b47 add cargo-deny job (#5347)
* add cargo-deny job

* feat(ci): add cargo-deny CI job, checks registries, licenses, dependencies dupes and advisories
2020-03-24 18:07:28 +01:00
Marcio Diaz 22e23b0103 Benchmark Collective Pallet (#5343)
* Init

* Fix execute.

* Duplicate macro for instances temporarilly

* Add propose.

* Add vote, close.

* Propose from own module

* Add old members to set_members.

* Add previous proposals to propose.

* Compress a bit the macro.

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
2020-03-24 18:06:29 +01:00
Nikolay Volf 27fe4206ed Update schnorrkel with versioning (#5358)
* use versioning for deprecated api, remove deprecated api from regular verification

* Update primitives/core/src/sr25519.rs

* add test to transaction pool

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
2020-03-24 18:05:57 +01:00
Bastian Köcher 6beb6acbd5 Print an error when a bootnode is on a different chain (#5377)
* Print an error when a bootnode is on a different chain

* Fix tests
2020-03-24 14:24:09 +00:00
Benjamin Kampmann ba06d5ef64 Releasing 2.0.0-alpha.5 (#5340)
* bump pre-version

* Changelog alpha.4->alpha.5

* repo + homepage to sp-consensus-vrf

* Add default rocksdb feature to `frame-benchmarking-cli` (#5367)

* Add default rocksdb feature

* Update Cargo.toml

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
2020-03-24 15:08:02 +01:00
gabriel klawitter 75123f051e check polkadot for companion pull requests (#5262)
* check_polkadot: move to external script

* check_polkadot: check for companion pr

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: Bastian Köcher <git@kchr.de>
2020-03-24 18:29:11 +05:30
Stanislav Tkach 4414d00082 Get rid of rustc_hex in favor of hex (#5370)
* Get rid of rustc_hex in favor of hex

* Use HexDisplay
2020-03-24 11:48:23 +01:00
Alexander Theißen 5345407783 Update COMPLEXITY.md for ext_terminate (#5275) 2020-03-24 11:40:58 +01:00
Shawn Tabrizi 9fbbdfdfd4 Add runtime-benchmarks compile/test in CI pipeline (#5371)
* Add `runtime-benchmarks` compile

* Use cargo check and no wasm build
2020-03-23 21:57:36 +01:00
Bastian Köcher fde05dd236 Show an error when we connect to a bootnode with a different peer id (#5365)
Currently when we connect to a bootnode and it returns a different peer
id, than the one we provided, we disconnect silently. This pr changes
the behavior to printing an error when a bootnode returns a different
peer id than the provided one.
2020-03-23 18:49:49 +01:00
Nikolay Volf 4d3557d5a1 Versioning for #[runtime-interface] (#5328)
* versionned runtime-interface

* use only one additional wasm blob

* alter docs

* formatting, naming and docs

* add comment for test

* version duplicate err

* RuntimeInterfaceItem -> RuntimeInterfaceFunction<

* test naming

* version checking

* remove spaces

* Update primitives/runtime-interface/proc-macro/src/runtime_interface/bare_function_interface.rs

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

* remove sanity checks and reduce coverage

* add doc comment

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
2020-03-23 15:09:05 +01:00
Toralf Wittner fe68d6fd8c Update yamux to version 0.4.5 (#5354) 2020-03-23 14:11:46 +01:00
Marcio Diaz 0c10687022 Regression algorithm for runtime benchmarks (#5288)
* Add linregress

* Regression, initial stuff.

* More analytics

* whitespace

* Fix

* Median slopes regression algo

* Warnings

* Update to lastest benchmark changes.

* Use both algorithms temp.

* Move analysis to frame.

* Fix tests.

* Only build analysis in std

Co-authored-by: Gav Wood <gavin@parity.io>
2020-03-23 14:07:25 +01:00
Wei Tang 14249913a6 pallet-evm: configurable gasometer config (#5320)
* pallet-evm: configurable gasometer config

* Bump runtime impl_version

* Update evm to 0.16.1

Documentation updates

Co-authored-by: Gavin Wood <gavin@parity.io>
2020-03-23 13:30:40 +01:00
Shawn Tabrizi ad1876bf94 Switch Treasury to on_initialize, Tips KeepAlive (#5352)
* Switch Treasury to `on_initialize`

* Fix bench compile
2020-03-23 13:19:15 +01:00
Wei Tang 9c7261fab3 Simplify BABE pre-digest definitions (#5289)
* Init vrf crate without type alias

* Generic PreDigest definition for BABE

* Fix BABE vrf interface change

* Missing default-features def in sp-consensus-babe

* Fix sp-consensus-babe compile

* frame-babe: fix type inference

* Unify type definitions of vrf output/proof and randomness

* frame-babe: fix tests

* Bump node impl version

* Update cargo lock

* Derive Copy for RawVRFOutput and RawVRFProof

* Fix duplicated derive

Co-authored-by: Gavin Wood <gavin@parity.io>
2020-03-23 11:53:41 +01:00
Gavin Wood 95d1d668c3 Sensible way of selecting Prime member (#5346)
* Calculate prime votes only during the election

* Migration

* Fix build, enable migration

* Fix tests

* Bump runtime version

* Update frame/elections-phragmen/src/lib.rs

Co-Authored-By: Marcio Diaz <marcio.diaz@gmail.com>

Co-authored-by: Marcio Diaz <marcio.diaz@gmail.com>
2020-03-23 11:52:44 +01:00
Pierre Krieger 1da48b3b3f Rewrite reconnect_after_disconnect test (#5351) 2020-03-23 11:50:11 +01:00
Max Inden 26a204da21 client/network-gossip/state_machine: Fix log message (#5350)
A gossip validator returns `ValidationResult::Discard` for messages that
should not be processed nor kept due to not being useful for the node.
Examples are out-of-scope messages or messages with bad signatures. The
corresponding log message did not reflect this, thus the update through
this patch.

One caveat is a finality grandpa neighbor packet. Given that the concept
of neighbor packets is handled in the finality grandpa gossip validator
only, valid neighbor packets are always discarded on the
`client/network-gossip` layer.
2020-03-23 11:04:48 +01:00
Andronik Ordian 28ae4042fd deduplicate parity-util-mem (#5348) 2020-03-22 20:37:40 +01:00
Stanislav Tkach 41a8d43161 Rename ExecutionContext::parent to caller (#5285) 2020-03-21 22:17:06 +01:00
ddorgan 56264ad1fc Make pushing consensus message loglevel trace (#5342) 2020-03-21 15:49:51 +00:00
Gavin Wood 22f88bf9d1 Redesign Democracy pallet (#5294)
* Repot a bit of democracy code

* Basic logic is drafted

* Lazy democracy builds.

* Add non-locked split-voting and instant-scheduling.

* Introduce delegation that works.

* Builds again.

* Indentation

* Building.

* Docs and migration

* Fix half of the tests

* Fix up & repot tests

* Fix runtime build

* Update docs

* Docs

* Nits.

* Turnout counts full capital

* Delegations could towards capital

* proxy delegation & proxy unvoting

* Fix

* Tests for split-voting

* Add missing file

* Persistent locking.
2020-03-21 16:08:48 +01:00
joe petrowski 40f57f8ffa Minor fixes to CLI arg docs (#5339)
* minor fixes to CLI arg docs

* Update client/cli/src/params/shared_params.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
2020-03-21 08:52:57 +01:00
Benjamin Kampmann 71aef91099 latest unleash and on all ci-release-prefixed tags (#5334) 2020-03-20 20:03:19 +01:00
Bastian Köcher 7693bd5ee5 Adds new event phase Initialization (#5302)
* Adds new event phase `Initialization`

Every event that was deposited inside of `on_initialize` was assigned to
the `ApplyExtrinsic(0)` phase which wasn't correct. This pr introduces a
new phase `Initialization`. This is the new phase while initializing
a block. After initialization we switch to `ApplyExtrinsic(N)` and at
the end to `Finalization` as before.

* Set `ExecutionPhase` in `initialize`

* Increment `spec_version`
2020-03-20 19:34:51 +01:00
André Silva 459557aadc grandpa: allow noting same set in gossip with different authorities (#5323)
* grandpa: allow noting same set in gossip with different authorities

* grandpa: add test for note_set behavior
2020-03-20 19:07:10 +01:00
Bastian Köcher 5688f0b293 Update sysinfo to fix compilation on Windows (#5338) 2020-03-20 19:00:39 +01:00
Hero Bird 017f218926 Implement ext_ hashes for contracts (issue #5258) (#5326)
* Implement ext_ hashes for contracts (issue #5258)

* load cryto hash .wat from raw string literal instead of file

* update .wat contents for testing crypto hashes

* remove unnecessary 'static

* fix bug in input (call_indirect required 1+ at least it seems)

* no longer use scratch buffer for crypto hash functions

* improve doc comments of ext_ hash functions

* remove unnecessary comment in .wat test file

* add return value (const 0) to contract test to hopefully enable result buffer

* fix bug in contract assertion

* implement proper output_len in contract

* implement proper test for crypto hashes

* bump spec_version 238 -> 239

* fix COMPLEXITY description

* remove final invalid instances of scratch buffer from docs
2020-03-20 18:46:51 +01:00
Bastian Köcher 46458f4082 Make sure frame examples compile for wasm (#5332)
* Make sure frame examples compile for wasm

This makes sure that `frame-example` and `frame-example-offchain-worker`
compile for wasm.

This also fixes compilation for these crates. The offchain worker
example doesn't use serde-json anymore as that is too heavy and breaks
`no_std` compilation.

* Apply suggestions from code review

Co-Authored-By: Nikolay Volf <nikvolf@gmail.com>

Co-authored-by: Nikolay Volf <nikvolf@gmail.com>
2020-03-20 16:57:39 +01:00
Pierre Krieger 57af4facbd Remove the #[doc(hidden)] reexports of sc_network (#5264)
* Remove the #[doc(hidden)] reexports of sc_network

* Fix tests not building
2020-03-20 16:42:00 +01:00
Benjamin Kampmann 62b3e57470 Ensure schnorrkel is always _at least_ 0.9.1 (#5333) 2020-03-20 16:41:35 +01:00
Shawn Tabrizi ca3cbbfc14 Benchmark Treasury Pallet (#5287)
* Start benchmarks

* try_origin or root

* More benches

* stuck

* Custom trait functions for benchmarks

* finish benchmarks

* Bump impl

* More comments

* Bump spec

* Remove import

* Update frame/elections-phragmen/src/lib.rs

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

* Update frame/support/src/traits.rs

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

* Fix merge

Co-authored-by: thiolliere <gui.thiolliere@gmail.com>
2020-03-20 15:08:16 +01:00
Peter Goodspeed-Niklaus a9b9ca5fa8 Factor out can_set_code (#5317)
* Factor out can_set_code

The motivation for this feature is parachain runtime upgrades, which
happen in two different moments: the initial call, when the checks
should be performed, and at the actual upgrade block. It's much
better and more maintainable to just call `can_set_code` in the
function than to manually copy those checks.

I'm not entirely thrilled with the interface, which requires
cloning the entire code vector in `set_code`. However, it looks
like something in `decl_module!` does not play nicely with
references in its function arguments. If `code` has a lifetime,
it _must_ be named, which gives us this signature.

```rust
pub fn can_set_code<'a>(origin, code: &'a [u8]) {
```

Unfortunately, attempting to compile with that signature generates
a very large and baffling collection of build errors, so I decided
to abandon that path for now.

* make can_set_code non-dispatchable per PR revew

Not only can we now borrow the `code` slice, but we also no longer
need to worry about people sending a `can_set_code` transaction because
of some misunderstanding.

* move into existing impl block
2020-03-20 15:00:01 +01:00
joe petrowski 589c279adf fix lone txqueue log target (#5331) 2020-03-20 14:15:02 +01:00
Shawn Tabrizi 400a62680f Benchmark Im Online Pallet (#5318)
* Initial benchmarking setup

* Add keystore

* validate unsigned

* Update frame/im-online/src/benchmarking.rs

Co-Authored-By: Marcio Diaz <marcio.diaz@gmail.com>

* Fix verify_unsigned benchmark

* add variable for teting the external addresss length

* Update frame/im-online/src/benchmarking.rs

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

* Update utils/frame/benchmarking-cli/src/lib.rs

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

Co-authored-by: Marcio Diaz <marcio.diaz@gmail.com>
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
Co-authored-by: Benjamin Kampmann <ben@gnunicorn.org>
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
2020-03-20 12:42:00 +01:00
Gavin Wood 7947cbf915 Remove migration code. (#5291)
* Remove migration code.

* Fix cargo

* Bump spec version
2020-03-19 23:01:13 +01:00
lwshang 81da73475c Prompt error if vanity pattern is not valid base58 (#5308)
* Prompt error if vanity pattern is not valid base58

* Update bin/utils/subkey/src/vanity.rs

* Add tests for validating pattern of subkey vanity

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
2020-03-19 22:05:49 +01:00
Bastian Köcher 1b1eea1590 Make ChainSpec implement Send (#5315) 2020-03-19 17:24:31 +01:00
Benjamin Kampmann 0cc54008c8 Update dependencies (#5316)
* switching to released wasmtime

* update depdencies in general

* Update fdlimit

* Update parity common deps

* Also update schnorrkel

* update kvdb-rocksdb

* update further dependents

* also update primitive types

* update cargo.lock

* update merlin

* Bumping evm version
2020-03-19 16:03:26 +01:00
Arkadiy Paronyan a66615446d Fixed a couple of syncing issues (#5277)
* Don't queue duplicate blocks

* Keep queue_blocks on restart
2020-03-19 14:02:07 +01:00
Roman Borschel cfa179f2ce Safe logger initialisation in test. (#5311)
env_logger::init() can lead to panics on concurrent test execution.

See: https://gitlab.parity.io/parity/substrate/-/jobs/422283
2020-03-19 13:53:16 +01:00