Commit Graph

4113 Commits

Author SHA1 Message Date
Bastian Köcher 62ba0cc714 Fix Babe secondary plain slots claiming (#6451)
We need to check that the public key of an authority exists in our
keystore before we can successfully claim a plain secondary slot.
2020-06-19 22:14:14 +01:00
Arkadiy Paronyan 7b34438178 Validate encoding of extrinsics passed to runtime (#6442)
* Validate encoding of extrinsics passed to runtime

* Bump codec version explicitly
2020-06-19 19:27:16 +00:00
Gavin Wood 9ee2427289 Avoid multisig reentrancy (#6445) 2020-06-19 20:12:42 +02:00
Denis Pisarev 8c1a23a08b change (ci): add interruptible to kubernetes jobs (#6441) 2020-06-19 18:53:43 +02:00
Nikolay Volf 6e85555e0b add network propagated metrics (#6438) 2020-06-19 17:40:39 +03:00
Max Inden cbfbad6fbb client/authority-discovery: Compare PeerIds and not Multihashes (#6414)
In order to tell whether an address is the local nodes address the
authority discovery module previously compared the Multihash within the
`p2p` Multiaddr protocol.

rust-libp2p recently switched to a new PeerId representation (see [1]).
Multihashes of the same PeerId in the new and the old format don't
equal.

Instead of comparing the Multihashes, this patch ensures the module
compares the PeerIds

[1] https://github.com/libp2p/rust-libp2p/issues/555
2020-06-19 16:01:16 +02:00
Bastian Köcher 7858828d98 Update sync chain info on own block import (#6424)
Before we only updated the chain info of sync when we have imported
something using the import queue. However, if you import your own
blocks, this is not done using the import queue and so sync is not
updated. If we don't do this, it can lead to sync switching to "major
sync" mode because sync is not informed about new blocks. This
especially happens on Cumulus, where a collator is selected multiple
times to include its block into the relay chain and thus, sync switches
to major sync mode while the node is still building blocks.
2020-06-19 16:00:58 +02:00
Max Inden 737ba2ea20 .gitlab-ci.yml: Use promtool from paritytech/tools:latest image (#6425) 2020-06-19 16:00:33 +02:00
Guillaume Thiolliere 6103e9854c llow decl-module to have a where clause with trailing comma (#6431) 2020-06-19 16:00:06 +02:00
Guillaume Thiolliere 780f8e09d7 Root origin use no filter by default. Scheduler and Democracy dispatch without asserting BaseCallFilter (#6408)
* make system root origin build runtime origin with no filter

* additional doc
2020-06-19 15:59:29 +02:00
Cecile Tonglet 2645659ab2 More descriptive error message when invalid slot duration is used (#6430)
* Initial commit

Forked at: 252416d385
No parent branch.

* Errors if slot_duration is zero

* Errors if slot_duration is zero

* Revert "Errors if slot_duration is zero"

This reverts commit a9e9820e124571f73d3e498e969a74d01fd3fe96.

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

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
2020-06-19 15:56:09 +02:00
Dan Forbes bce6a426f1 Simple Docs for Atomic Swap Pallet (#6434)
* Simple Docs for Atomic Swap Pallet

* Fix copy-and-paste error
2020-06-19 15:55:15 +02:00
Bastian Köcher 40e4868424 Track last blocks in informant display (#6429)
This implements tracking of the last seen blocks in informant display
to prevent printing the import message twice. In Cumulus we first import
blocks as part of the block building with `new_best == false` and set
the best block after we know which one was included by the relay chain.
This leads to printing the import messages two times. This pr solves the
problem by track the latest seen blocks to not print the message twice.
2020-06-19 15:48:09 +02:00
Bastian Köcher be7f1df327 Print bad mandatory error (#6416)
* Print bad mandatory error

This prints the error that leads to bad mandatory.

* Update frame/system/src/lib.rs

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>

* Adds missing trait import

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
2020-06-19 13:15:21 +02:00
s3krit ff6b39e51b [CI] Label PRs if polkadot companion build fails (#6410)
* add polkadot-companion-labels.yml

* fix polkadot companion job name

* add opened event to polkadot-companion-labels.yml

* Dont label on timeouts

* increase timeouts

* increase timeouts again... to be sure

* Switch to s3krit/await-status-action

Turns out Sibz/await-status-action looks at /ref/statuses, which lists ALL statuses (i.e., if you send a pending and a failure for the same context, it will see both and assume the job is still pending.). I forked and point at /ref/status, which shows a combined summary of each status (i.e., only ever shows the most recent status of a single context).
2020-06-19 06:59:59 +00:00
Max Inden fe76ebd548 .maintain/monitoring: Add alerting rule tests (#6343)
* .maintain/monitoring: Add alerting rule tests

* .maintain/monitoring/alerting-rules/alerting-rules.yaml: Break lines

* .gitlab-ci.yml: Add promtool rule testing step
2020-06-19 08:31:42 +02:00
Shawn Tabrizi 015693227b Expose constants from Proxy Pallet (#6420) 2020-06-19 08:26:06 +02:00
Gavin Wood 46627bbb7d Scale and increase validator count (#6417) 2020-06-19 08:25:09 +02:00
Pierre Krieger dd7830d481 Remove --legacy-network-protocol CLI flag (#6411) 2020-06-19 00:23:58 +02:00
Toralf Wittner e81b7f02de Update libp2p-ping. (#6412)
Bugfix release, see [CHANGELOG].

[CHANGELOG]: https://github.com/libp2p/rust-libp2p/blob/master/protocols/ping/CHANGELOG.md
2020-06-19 00:22:48 +02:00
Rakan Alhneiti d25f460b63 Babe VRF Signing in keystore (#6225)
* Introduce trait

* Implement VRFSigner in keystore

* Use vrf_sign from keystore

* Convert output to VRFInOut

* Simplify conversion

* vrf_sign secondary slot using keystore

* Fix RPC call to claim_slot

* Use Public instead of Pair

* Check primary threshold in signer

* Fix interface to return error

* Move vrf_sign to BareCryptoStore

* Fix authorship_works test

* Fix BABE logic leaks

* Acquire a read lock once

* Also fix RPC acquiring the read lock once

* Implement a generic way to construct VRF Transcript

* Use make_transcript_data to call sr25519_vrf_sign

* Make sure VRFTranscriptData is serializable

* Cleanup

* Move VRF to it's own module

* Implement & test VRF signing in testing module

* Remove leftover

* Fix feature requirements

* Revert removing vec macro

* Drop keystore pointer to prevent deadlock

* Nitpicks

* Add test to make sure make_transcript works

* Fix mismatch in VRF transcript

* Add a test to verify transcripts match in babe

* Return VRFOutput and VRFProof from keystore
2020-06-18 14:37:49 -04:00
Benjamin Kampmann 4b5a0680e3 Remove pallet-balances from non-dev-deps (#6407) 2020-06-18 17:01:23 +02:00
Pierre Krieger 527cc35afb Increase network buffer sizes even more (#6080) 2020-06-18 11:55:45 +00:00
ddorgan 1d364404e7 Update s3 artifact url (#6399) 2020-06-18 10:48:34 +01:00
arkpar 850ee8b43a Revert "Block packet size limit"
This reverts commit 08e0747d2b.
2020-06-18 10:43:03 +02:00
arkpar 08e0747d2b Block packet size limit 2020-06-18 10:39:54 +02:00
mattrutherford 74a989f353 Runtime interface to add support for tracing from wasm (#6381)
* Add span recording to tracing implementation

* Add tracing proxy

* switch to rustc_hash::FxHashMap

* Replace lazy_static and hashmap with thread_local and vec.

* fix marking valid span as invalid while removing invalid spans

* refactor, add wasm_tracing module in `support`

* update registered spans

* tidy up

* typos

* refactor

* update flag name to signal lost trace - `is_valid_trace`

* update flag name to signal lost trace - `is_valid_trace`

* update docs

* update docs

* Use tracing Field recording to store the actual `name` and `target`
from wasm traces.

* fix debug log in subscriber + small refactor

* add tests

* handle misuse in case trying to exit span not held

* Implement filter for wasm traces, simplify field recording for primitive types

* remove superfluous warning

* update docs

* Update primitives/tracing/src/proxy.rs

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

* Apply suggestions from code review

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

* update docs, apply suggestions

* move Proxy from thread_local to `Extension`, rename macro

* fix test

* unify native & wasm span macro calls

* implement wasm tracing control facility in primitives and frame

* add cli flag `--wasm-tracing`

* fix

* switch to `Option<u4>` (possible performance degradation), switch
to static mut bool

* performance improvement using u64 vs Option<u64>

* performance improvement moving concat to client

* update docs

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

Co-authored-by: Cecile Tonglet <cecile@parity.io>

* performance improvement

* Revert "performance improvement"

This reverts commit 55ff8817a86302cd93bb6197eb4ca5bc7f4fb524.

* small refactor

* formatting

* bump impl_version

* Update client/cli/src/config.rs

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

* update docs

* small fixes, remove pub static

* nit

* add integration tests and refactor Subscriber

* tests

* revert formatting

* try fix test that works locally but not in CI

* try fix test that works locally but not in CI

* debug test that works locally but not in CI

* fix test that works locally but not in CI

* remove pub visibility from bool in runtime

* make TracingSpanGuard #[cfg(not(feature = "std"))], update docs, comments

* make TracingProxy drop implementation conditional on !empty state

* add docs for TraceHandler

* remove blank line

* update expect message

* update tests

* rename cli option to tracing_enable_wasm

* rename cli option to tracing_enable_wasm

* fix

* ensure wasm-tracing features are wasm only

* bump impl_version

* bump impl_version

* add `"pallet-scheduler/std"` to `[features]` `std` in node/runtime

* refactor service to remove sp_tracing dependency

* refactor: line width, trait bounds

* improve LogTraceHandler output

* fix test

* improve tracing log output

* Apply suggestions from code review

* Apply suggestions from code review

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

* swap wasm indication from trace name to a separate value

* Update client/tracing/src/lib.rs

* add docs

* remove runtime features

remove wasm_tracing option from CLI

remove wasm_tracing flag from ProfilingSubscriber

Co-authored-by: Matt Rutherford <mattrutherford@users.noreply.github.com>
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: Cecile Tonglet <cecile@parity.io>
2020-06-18 09:44:03 +02:00
Wei Tang bd5ad9fd6d Pallet: Atomic Swap (#6349)
* Init atomic swap pallet

* Implement module swap operations

* Add successful swap test

* Bump node spec_version

* Fix storage name

* Add ProofLimit parameter to prevent proof size being too large

* Add missing events

* Basic weight support

* Add basic docs

* Mark swap on claim

This handles the additional case if `repatriate_reserved` fails.

* Add additional expire handler

* Update frame/atomic-swap/src/lib.rs

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>

* Add docs on ProofLimit

* Fix test

* Return Ok(()) even when the transfer fails

Because we need to mark the swap as claimed no matter what.

* Remove retry logic

It's overkill. Swap is about something being executed, not necessarily successful.
Although there should be logic (reserve and unreserve) to make it so that both parties *believes*
that the execution is successful.

* succeed -> succeeded

* Add docs on duration -- revealer should use duration shorter than counterparty

* Missing trait type

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
2020-06-18 09:42:31 +02:00
Arkadiy Paronyan f05ae63afa Allow empty values in the storage (#6364)
* Allow empty values in the storage

* Bump trie-bench

* Bump trie-bench
2020-06-18 09:36:52 +02:00
Shaopeng Wang a43a755a91 FixedPointNumber: zero is not positive. (#6385) 2020-06-18 09:35:49 +02:00
Bastian Köcher 325dab19cc decl_module! print better error on duplicate reserved keyword (#6384)
* `decl_module!` print better error on duplicate reserved keyword

This prints a better error message on duplicated reserved keywords,
instead of complaining because of missing `origin`.

* Review feedback
2020-06-18 09:35:18 +02:00
Pierre Krieger fec43fe6d7 Remove penalty on duplicate Status message (#6377) 2020-06-18 09:34:53 +02:00
Gavin Wood a0541e864c Restrict remove_proxies (#6383) 2020-06-18 09:33:51 +02:00
Kian Paimani 82bdf1a891 Fix the broken weight multiplier update function (#6334)
* Initial draft, has some todos left

* remove ununsed import

* Apply suggestions from code review

* Some refactors with migration

* Fix more test and cleanup

* Fix for companion

* Apply suggestions from code review

Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>

* Update bin/node/runtime/src/impls.rs

* Fix weight

* Add integrity test

* length is not affected.

Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>
2020-06-17 13:20:17 +00:00
Gavin Wood 67c9ac9393 Stored call in multisig (#6319)
* Stored call in multisig

* Docs.

* Benchmarks.

* Fix

* Update frame/multisig/src/lib.rs

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

* patch benchmarks

* Minor grumbles.

* Update as_multi weight

* Fixes and refactoring.

* Split out threshold=1 and opaquify Call.

* Compiles, tests pass, weights are broken

* Update benchmarks, add working tests

* Add benchmark to threshold 1, add event too

* suppress warning for now

* @xlc improvment nit

* Update weight and tests

* Test for weight check

* Fix line width

* one more line width error

* Apply suggestions from code review

Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>

* fix merge

* more @apopiak feedback

* Multisig handles no preimage

* Optimize return weight after dispatch

* Error on failed deposit.

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>
2020-06-17 12:24:32 +02:00
Gavin Wood 5f991ae9b8 Allow Sudo to do anything (#6375)
* All Sudo to do anything.

* Rename old labels.
2020-06-17 12:22:57 +02:00
Svyatoslav Nikolsky 194b3dfb17 fix BlockAttributes encoding (#6281) 2020-06-16 22:51:45 +02:00
Xiliang Chen 7d30ae7ba8 add system_dryRun (#6300)
* add system_dryRun

* fix build error

* delete unneeded code

* return ApplyExtrinsicResult directly

* line width

* mark dry run unsafe

* line width

* fix test

* add test

* update comment
2020-06-16 22:51:03 +02:00
Pierre Krieger 0787b189fa Use /dns/ instead of /dns4/ (#6369) 2020-06-16 22:49:44 +02:00
Max Inden b4221cc135 .gitlab-ci.yml: Run promtool on Prometheus alerting rules (#6344)
* .gitlab-ci.yml: Run promtool on Prometheus alerting rules

Add a CI stage to test the Prometheus alerting rules within
`.maintain/monitoring`.

* .gitlab-ci.yml: Switch Prometheus stage to paritytech/tools image

* .gitlab-ci.yml: Follow http redirects in Prometheus stage

* .gitlab-ci.yml: Fix Prometheus stage promtool folder name
2020-06-16 22:49:01 +02:00
Max Inden fb63a7c5bc client/authority-discovery: Don't add own address to priority group (#6370)
* client/authority-discovery: Don't add own address to priority group

In the scenario of a validator publishing the address of its sentry node
to the DHT, said sentry node should not add its own Multiaddr to the
peerset "authority" priority group.

Related to 273f31b.

* client/authority-discovery: Remove unused import PeerId

* client/authority-discovery/tests: Add tcp protocol to multiaddresses
2020-06-16 18:51:21 +02:00
Gavin Wood de656e7de5 vesting: Force Vested Transfer (#6368)
* force-vested-transfer

* Tweak weights

* Update frame/vesting/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-06-16 16:34:05 +02:00
s3krit 14ee618df0 [CI] Add label enforcement (#6365)
* Add label enforcement

* fix .gitlab-ci.yml

* update check_labels.sh
2020-06-16 15:50:50 +02:00
Ashley 761dbd7dcc Split the service initialisation up into seperate functions (#6332)
* Seperate out the complexity in ServiceBuilder::build_common into seperate functions

* Fix line widths

* Move some functions to their respective crates
2020-06-16 15:50:21 +02:00
s3krit c44947bbcb [CI] Auto-label new PRs according to draft status (#6361)
* add auto-label github action

* Add missing 'remove-labels' line
2020-06-16 12:12:43 +00:00
Bernhard Schuster 3f30f69b5b historical slashing w ocw w adhoc tree creation (#6220)
* draft

* steps

* chore: fmt

* step by step

* more details

* make test public

* refactor: split into on and offchain

* test stab

* tabs my friend

* offchain overlay: split key into prefix and true key

Simplifies inspection and makes key actually unique.

* test: share state

* fix & test

* docs improv

* address review comments

* cleanup test chore

* refactor, abbrev link text

* chore: linewidth

* fix prefix key split fallout

* minor fallout

* minor changes

* addresses review comments

* rename historical.rs -> historical/mod.rs

* avoid shared::* wildcard import

* fix: add missing call to store_session_validator_set_to_offchain

* fix/compile: missing shared:: prefix

* fix/test: flow

* fix/review: Apply suggestions from code review

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

* fix/review: more review comment fixes

* fix/review: make ValidatorSet private

* fix/include: core -> sp_core

* fix/review: fallout

* fix/visbility: make them public API

Ref #6358

* fix/review: review changes fallout - again

Co-authored-by: Bernhard Schuster <bernhard@parity.io>
Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
2020-06-16 13:14:49 +02:00
Guillaume Thiolliere 622dff9ca7 Impl integrity test for runtime (#6356)
* impl integrity test for runtime

* Update frame/support/src/traits.rs

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

* Update frame/support/procedural/src/construct_runtime/mod.rs

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

* use thread local

* update doc

* Apply suggestions from code review

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: Gavin Wood <gavin@parity.io>
2020-06-16 13:10:10 +02:00
wangjj9219 34f496eb3d expose constants of pallet_recovery trait (#6363) 2020-06-16 13:08:07 +02:00
Demi Obenour e2f5e4bd74 Add IPC support (#6348)
This is useful for both security and performance reasons. IPC is faster
than TCP, and it is subject to OS access controls.
2020-06-16 13:14:12 +03:00
tgmichel e99ff8ee96 pallet-evm add get(fn) to AccountStorages (#6279) 2020-06-15 17:05:54 +02:00