Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Fix transaction pool & network issues #6288

Merged
merged 3 commits into from
Jun 8, 2020
Merged

Fix transaction pool & network issues #6288

merged 3 commits into from
Jun 8, 2020

Conversation

NikVolf
Copy link
Contributor

@NikVolf NikVolf commented Jun 8, 2020

  • Network has too short memory of what peer has what transaction (needs to remember at least 2 full block of transactions).
  • We should not resubmit transactions that are found both in enacted and retracted block since they are included in the chain despite being part of the retracted block.

@NikVolf NikVolf added the A0-please_review Pull request needs code review. label Jun 8, 2020
Copy link
Member

@bkchr bkchr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While this is a nice optimization, it already worked before like this, because validate_transaction would reject a transaction that would already included before.

Your test did not worked before, because validate_transaction never returns InvalidTransaction in the test transaction pool. This should be fixed.

@@ -440,6 +440,7 @@ async fn prune_known_txs_for_block<Block: BlockT, Api: ChainApi<Block = Block>>(
block_id: BlockId<Block>,
api: &Api,
pool: &sc_transaction_graph::Pool<Api>,
pruned_log: &mut HashSet<ExtrinsicHash<Api>>,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You remove this and return a Vec<ExtrinsicHash<Api>> as function result.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should at least try to avoid allocations?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already allocate this vector in the function and just use the slice. So, we don't do any double allocations.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right 🤦‍♀️

client/transaction-pool/src/lib.rs Outdated Show resolved Hide resolved
let tx_hash = pool.hash_of(&tx);
let contains = pruned_log.contains(&tx_hash);
if !contains {
log::debug!(target: "txpool", "[{:?}]: Resubmitting from retracted block {:?}", tx_hash, hash);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More a trace log?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nah, needed for debugging why transaction is reentered the pool

@NikVolf
Copy link
Contributor Author

NikVolf commented Jun 8, 2020

it already worked before like this

not true in general case, runtime is not obliged reject duplicated transactions

@bkchr
Copy link
Member

bkchr commented Jun 8, 2020

it already worked before like this

not true in general case, runtime is not obliged reject duplicated transactions

I did not say that this is a bad pr, however all frame runtime's would reject duplicates. Okay not for some unsigned transactions, but that is the reason I said "nice optimization" ;)

@bkchr bkchr added the B0-silent Changes should not be mentioned in any release notes label Jun 8, 2020
@bkchr bkchr merged commit 85cd556 into master Jun 8, 2020
@bkchr bkchr deleted the nv-txpool-tweaks-2 branch June 8, 2020 21:58
const MAX_KNOWN_EXTRINSICS: usize = 4096; // ~128kb per peer + overhead
///
/// This should be approx. 2 blocks full of transactions for the network to function properly.
const MAX_KNOWN_EXTRINSICS: usize = 10240; // ~300kb per peer + overhead.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about chains with longer block time / larger tx per block?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xlc let's make an issue for that

This should not be a const but rather some sort of configuration (runtime/cli or deduced from other values)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

larger tx per block

It only stores the hash of a transaction.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean larger number of tx per block

drewstone added a commit to hicommonwealth/substrate that referenced this pull request Jun 23, 2020
* Fix typo: eror -> error (paritytech#6293)

* Fix typo: PRORITY -> PRIORITY (paritytech#6291)

* Intent to release rc3 (paritytech#6290)

* Fix transaction pool & network issues (paritytech#6288)

* fix & tweaks

* address review

* line width

* Use `sign_with` for signing grandpa's outgoing message (paritytech#6178)

* Use sign_with and stop using `Pair`

* PR feedback

* Remove clone

* Transfer ownership of public to sign_message

* Use Option

* Simplify code

* Fix error message

* Pass keystore as ref

* Pass keystore properly

* Fix tests

* Revalidation tweak & logging for transaction pool (paritytech#6258)

* updates and logging

* fix length

* Update client/transaction-pool/src/lib.rs

* rename

* Update client/transaction-pool/src/lib.rs

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

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

* Update README.md

* Allow adding a prefix to the informant (paritytech#6174)

* Initial commit

Forked at: 49b1561
Parent branch: origin/master

* Add a Service Configuration's field + adapt informant + provide means to CLI

* CLEANUP

Forked at: 49b1561
Parent branch: origin/master

* fix tests

* fixed bad path to object

* Change OutputFormat enum to struct

* Add informant_prefix to builder and service

* Revert "Change OutputFormat enum to struct"

This reverts commit cd86c58.

* Revert "fix tests"

This reverts commit a3c306e.

* Revert "Add a Service Configuration's field + adapt informant + provide means to CLI"

This reverts commit 9c2e726.

* Implementation using the ServiceBuilder

* reduce line length

* fix line width again

* WIP

Forked at: 49b1561
Parent branch: origin/master

* WIP

Forked at: 49b1561
Parent branch: origin/master

* WIP

Forked at: 49b1561
Parent branch: origin/master

* use struct instead of enum

* WIP

Forked at: 49b1561
Parent branch: origin/master

* Update client/service/src/lib.rs

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

* improve doc

* Update client/service/src/builder.rs

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

* Update client/service/src/builder.rs

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

* change code

* Update client/informant/src/lib.rs

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

* enable_color

* reorg log

* remove macro

* Removed builder for informant prefix

* fix doc

* Update client/informant/src/lib.rs

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

* Update client/informant/src/lib.rs

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

* Update client/informant/src/lib.rs

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

* Update client/informant/src/lib.rs

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

* Update client/service/src/builder.rs

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

* Update client/service/src/builder.rs

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

* Update client/service/src/builder.rs

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

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

* Transaction pool added missed comment (paritytech#6308)

* Add a test for lots of nodes connecting at the same time (paritytech#6247)

* Add a test for lots of nodes connecting at the same time

* Do small change

* Introduce frozen indices. (paritytech#6307)

* Introduce frozen indices.

* Fix.

* Bump runtime

* Benchmark for freeze

* Fix

* fix benchmarks

* update freeze weights

* remove copy pasta

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

* new crate sc-light (paritytech#6235)

* sc-light

* remove unused deps

* fix line width

* move more fns to sc_light

* Fix ui tests for latest rust stable (paritytech#6310)

* Expose light client. (paritytech#6313)

* Fix nits in rpc error display. (paritytech#6302)

* Improve rpc error display.

* Apply review suggestion.

* Apply review suggestion.

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

* Fix custom.

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

* "OR gate" for EnsureOrigin (paritytech#6237)

* 'OR gate' for EnsureOrigin.

* Formatting.

* More formatting.

* Add docstring; Update 'Success' type.

* Bump runtime impl_version.

* Fix successful_origin.

* Add either into std feature list.

* Update docs.

* New CI image (paritytech#6223)

* fix (ci): hotfix Docker release

* change (ci): moving to the tested CI image with a proper name

* change (ci): rename substrate-ci-linux

* Reduce the lots_of_incoming_peers_works test load (paritytech#6314)

* change (ci): moving to the tested CI image with a proper name

* change (ci): rename substrate-ci-linux

* Reduce the lots_of_incoming_peers_works test load (paritytech#6314)

Co-authored-by: Bastian Köcher <git@kchr.de>
Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>

* Add a feature to create automatically a random temporary directory for base path & remove `Clone` (paritytech#6221)

* Initial commit

Forked at: 342caad
Parent branch: origin/master

* Add a feature to create automatically a temporary directory for base path

* doc fix and todos

* use parking_lot instead

* use refcell instead since we stay in the main thread

* remove Clone derives

* add test

* solving dependency issue

* clarifying doc

* conflict argument with base-path

* WIP

Forked at: 342caad
Parent branch: origin/master

* revert dep deletion

* fixing test and making base_path optional

* hold basepath while the service is running

* fixes

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

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

* Update client/service/Cargo.toml

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

* Update client/cli/src/commands/mod.rs

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

* Update client/service/src/config.rs

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

* WIP

Forked at: 342caad
Parent branch: origin/master

* improve doc

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

* Add a [prefix]_process_start_time_seconds metric (paritytech#6315)

* Make NumberOrHex a common primitive. (paritytech#6321)

* Make NumberOrHex a common primitive.

* Update primitives/rpc/src/number.rs

Co-authored-by: Nikolay Volf <nikvolf@gmail.com>

Co-authored-by: Nikolay Volf <nikvolf@gmail.com>

* Avoid self-lookups in Authority Discovery (paritytech#6317)

* Ensure authority discovery avoids self-lookups.

Thereby additionally guard the `NetworkService` against
adding the local peer to the PSM or registering a
"known address" for the local peer.

* Clarify comments.

* See if returning errors is ok.

* Fix quadratic iterations in transaction pool ready set (paritytech#6256)

* refactor ready set size calc

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

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

* remove pub

* update to new variat

* rename

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

* Find the alive incoming entry on disconnect. (paritytech#6320)

When a peer in `Incoming` state disconnects, the "alive" entry
in the `incoming` list for that peer must be updated (set to `false`).
Currently the entry that is updated may be an earlier entry for the
same peer that is already no longer alive. This can happen if a
peer repeatedly connects (incoming) and disconnects between invocations to
`poll()` of the behaviour.

* Impl Debug and Display for Ss58AddressFormat when compiled with std (paritytech#6327)

* Initial commit

Forked at: 606c56d
Parent branch: origin/master

* Impl Debug and Display for Ss58AddressFormat when compiled with std

Fixes paritytech#6289

* Use write! instead of writeln!

* transaction-pool: expose blocking api for tx submission (paritytech#6325)

* transaction-pool: expose blocking api for tx submission

* service: separate ServiceBuilder::build for full and light

* service: add ServiceBuilder::build_common

* transaction-pool: extend docs

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

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

* Pruned and resubmitted metrics in transaction pool (paritytech#6322)

* pruned and resubmitted metrics

* update counter once

* Enable wasmtime on node-template (paritytech#6336)

* Enable wasmtime on node-template

* Apply suggestions from code review

syntax

Co-authored-by: Nikolay Volf <nikvolf@gmail.com>

Co-authored-by: Nikolay Volf <nikvolf@gmail.com>

* Adds support for storage parameter types (paritytech#6296)

* Adds support for storage parameter types

This pr adds a new parameter types type, the storage parameter types.
This parameter type supports loading the value from the storage or
returning the given default value.

* Use twox_128

* Update docs

* Update frame/support/src/lib.rs

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

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

* Basic documentation for Scheduler pallet (paritytech#6338)

Closes paritytech#5912

* Fix check-line-width CI script (paritytech#6326)

* Compare lines to the hash that the PR branched off from

* Use git merge-base to determine common ancestor

* Fixup

* client: use appropriate ExecutionContext for initial sync / regular import (paritytech#6180)

* client: use appropriate ExecutionContext for sync/import

* client: remove dead code

* client: ExecutionContext: distinguish between own and foreign imports

* client: fix cli parameter doc

* Revert "client: ExecutionContext: distinguish between own and foreign imports"

This reverts commit 0fac115.

* primitives: add docs for ExecutionContext

* cli: execution strategy docs

* cli: use different execution context for importing block on validator

* cli: remove defaults from execution context flags

* Fix transaction pool event sending (paritytech#6341)

This pr fixes a bug with the transaction pool not sending certain events
like finalized and also fixes the order of events. The problem with the
finalized event was that we did not extracted pruned extrinsics if there
were not ready transactions in the pool. However this is wrong, if we
have a re-org, a tx is clearly not ready anymore and we still need to
send a pruned event for it because it is in a new block included. This
also lead to sending "ready" events and tx being re-validated. The
listener also only send the "finalized" event if it has seen a block as
being included, which did not happen before with the old code.

The second fix of the pr is the order of events. If we prune and retract the
same transaction in the same block, we first need to send the "retract"
event and after that the "pruned" event, because finalization takes
longer and this would lead to the UI showing "retract" while it actually
is included.

* Deprecate FunctionOf and remove its users (paritytech#6340)

* Deprecate FunctionOf and remove users

* Remove unused import

* Add events for balance reserve and unreserve functions (paritytech#6330)

* almost works

* add clone to BalanceStatus

* reserve event

* fix staking tests

* fix balances tests

* Update frame/balances/src/tests.rs

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

* restore tests and move event emission

* move repatriate reserved event outside of mutate_account

* clean up events in tests

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

* Update contributing guide with new label policy (paritytech#6333)

* mention C and M labels in contributing guide

* update PR template with more specific instructions

* update PR template with updated label rules and contributing guide link

* update contibuting guide

* adding a ss58 format for Stafi Network (paritytech#6347)

* add extend_lock for StorageLock (paritytech#6323)

* add extend_lock for StorageLock

* changes

* changes

* Introduce in-origin filtering (paritytech#6318)

* impl filter in origin

* remove IsCallable usage. Breaking: utility::batch(root, calls) no longer bypass BasicCallFilter

* rename BasicCallFilter -> BaseCallFilter

* refactor code

* Apply suggestions from code review

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

* remove forgotten temporar comment

* better add suggestion in another PR

* refactor: use Clone instead of mem::replace

* fix tests

* fix tests

* fix tests

* fix benchmarks

* Make root bypass filter in utility::batch

* fix unused imports

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

* pallet-evm add get(fn) to AccountStorages (paritytech#6279)

* Add IPC support (paritytech#6348)

This is useful for both security and performance reasons. IPC is faster
than TCP, and it is subject to OS access controls.

* expose constants of pallet_recovery trait (paritytech#6363)

* Impl integrity test for runtime (paritytech#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>

* historical slashing w ocw w adhoc tree creation (paritytech#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 paritytech#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>

* [CI] Auto-label new PRs according to draft status (paritytech#6361)

* add auto-label github action

* Add missing 'remove-labels' line

* Split the service initialisation up into seperate functions (paritytech#6332)

* Seperate out the complexity in ServiceBuilder::build_common into seperate functions

* Fix line widths

* Move some functions to their respective crates

* [CI] Add label enforcement (paritytech#6365)

* Add label enforcement

* fix .gitlab-ci.yml

* update check_labels.sh

* vesting: Force Vested Transfer (paritytech#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>

* client/authority-discovery: Don't add own address to priority group (paritytech#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 70cfeff.

* client/authority-discovery: Remove unused import PeerId

* client/authority-discovery/tests: Add tcp protocol to multiaddresses

* .gitlab-ci.yml: Run promtool on Prometheus alerting rules (paritytech#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

* Use /dns/ instead of /dns4/ (paritytech#6369)

* add system_dryRun (paritytech#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

* fix BlockAttributes encoding (paritytech#6281)

* Allow Sudo to do anything (paritytech#6375)

* All Sudo to do anything.

* Rename old labels.

* Stored call in multisig (paritytech#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>

* Fix the broken weight multiplier update function (paritytech#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>

* Restrict remove_proxies (paritytech#6383)

* Remove penalty on duplicate Status message (paritytech#6377)

* `decl_module!` print better error on duplicate reserved keyword (paritytech#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

* FixedPointNumber: zero is not positive. (paritytech#6385)

* Allow empty values in the storage (paritytech#6364)

* Allow empty values in the storage

* Bump trie-bench

* Bump trie-bench

* Pallet: Atomic Swap (paritytech#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>

* Runtime interface to add support for tracing from wasm (paritytech#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 cff0aa2.

* 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>

* Block packet size limit

* Revert "Block packet size limit"

This reverts commit 9a5892e.

* Update s3 artifact url (paritytech#6399)

* Increase network buffer sizes even more (paritytech#6080)

* Remove pallet-balances from non-dev-deps (paritytech#6407)

* Babe VRF Signing in keystore (paritytech#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

* Update `libp2p-ping`. (paritytech#6412)

Bugfix release, see [CHANGELOG].

[CHANGELOG]: https://github.com/libp2p/rust-libp2p/blob/master/protocols/ping/CHANGELOG.md

* Remove --legacy-network-protocol CLI flag (paritytech#6411)

* Scale and increase validator count (paritytech#6417)

* Expose constants from Proxy Pallet (paritytech#6420)

* .maintain/monitoring: Add alerting rule tests (paritytech#6343)

* .maintain/monitoring: Add alerting rule tests

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

* .gitlab-ci.yml: Add promtool rule testing step

* [CI] Label PRs if polkadot companion build fails (paritytech#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).

* Print bad mandatory error (paritytech#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>

* Track last blocks in informant display (paritytech#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.

* Simple Docs for Atomic Swap Pallet (paritytech#6434)

* Simple Docs for Atomic Swap Pallet

* Fix copy-and-paste error

* More descriptive error message when invalid slot duration is used (paritytech#6430)

* Initial commit

Forked at: d735e4d
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 a9e9820.

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

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

* Root origin use no filter by default. Scheduler and Democracy dispatch without asserting BaseCallFilter (paritytech#6408)

* make system root origin build runtime origin with no filter

* additional doc

* llow decl-module to have a where clause with trailing comma (paritytech#6431)

* .gitlab-ci.yml: Use promtool from paritytech/tools:latest image (paritytech#6425)

* Update sync chain info on own block import (paritytech#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.

* client/authority-discovery: Compare PeerIds and not Multihashes (paritytech#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] libp2p/rust-libp2p#555

* add network propagated metrics (paritytech#6438)

* change (ci): add interruptible to kubernetes jobs (paritytech#6441)

* Avoid multisig reentrancy (paritytech#6445)

* Validate encoding of extrinsics passed to runtime (paritytech#6442)

* Validate encoding of extrinsics passed to runtime

* Bump codec version explicitly

* Fix Babe secondary plain slots claiming (paritytech#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.

* sp-npos-elections should not depend on itself (paritytech#6444)

This removes the `dev-dependency` onto `sp-npos-elections` from itself.
A crate should not depend on itself directly, especially not to make any
macros work.

* Don't autolabel insubstantial PRs 'pleasereview' (paritytech#6447)

* change everything to transaction (paritytech#6440)

* node: spawn block authoring and grandpa voter as blocking tasks (paritytech#6446)

* service: add spawner for essential tasks

* node: spawn block authoring and grandpa voter as blocking tasks

* Apply suggestions from code review

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

* pallet-atomic-swap: generialized swap action (paritytech#6421)

* pallet-atomic-swap: generialized swap action

* Bump spec_version

* Fix weight calculation

* Remove unnecessary type aliases

* Fix issues with `Operational` transactions validity and prioritization. (paritytech#6435)

* Fix weight limit for operational transactions.

* Include BlockExecutionWeight.

* `pallet-staking`: Expose missing consts (paritytech#6456)

* `pallet-staking`: Expose missing consts

* Apply suggestions from code review

Co-authored-by: Nikolay Volf <nikvolf@gmail.com>
Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* Update the source docs

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
Co-authored-by: Nikolay Volf <nikvolf@gmail.com>
Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* update collective events docs to be consistent with changes (paritytech#6463)

* [CI] Don't tag PRs on companion job cancels (paritytech#6470)

* network: remove unused variable (paritytech#6460)

* Avoid panic on dropping a `sc_network::service::out_events::Receiver`. (paritytech#6458)

* Avoid panic on dropping a `Receiver`.

* CI

* Implement nested storage transactions (paritytech#6269)

* Add transactional storage functionality to OverlayChanges

A collection already has a natural None state. No need to
wrap it with an option.

* Add storage transactions runtime interface

* Add frame support for transactions

* Fix committed typo

* Rename 'changes' variable to 'overlay'

* Fix renaming change

* Fixed strange line break

* Rename clear to clear_where

* Add comment regarding delete value on mutation

* Add comment which changes are covered by a transaction

* Do force the arg to with_transaction return a Result

* Use rust doc comments on every documentable place

* Fix wording of insert_diry doc

* Improve doc on start_transaction

* Rename value to overlayed in close_transaction

* Inline negation

* Improve wording of close_transaction comments

* Get rid of an expect by using get_or_insert_with

* Remove trailing whitespace

* Rename should to expected in tests

* Rolling back a transaction must mark the overlay as dirty

* Protect client initiated storage tx from being droped by runtime

* Review nits

* Return Err when entering or exiting runtime fails

* Documentation fixup

* Remove close type

* Move enter/exit runtime to excute_aux in the state-machine

* Rename Discard -> Rollback

* Move child changeset creation to constructor

* Move child spawning into the closure

* Apply suggestions from code review

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

* Fixup for code suggestion

* Unify re-exports

* Rename overlay_changes to mod.rs and move into subdir

* Change proof wording

* Adapt a new test from master to storage-tx

* Suggestions from the latest round of review

* Fix warning message

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

* Optimize offchain worker api by re-using http-client (paritytech#6454)

* Fix typo in offchain's docs

* Use Self keyword in AsyncApi::new()

* Move httpclient to be part of OffchainWorkers to optimize block import

* Fix compilation errors for tests

* Add wrapper struct for HyperClient

* Use lazy_static share SharedClient amongst OffchainWorkers. Remove the need to raise the fd limit

* Revert "Use lazy_static share SharedClient amongst OffchainWorkers. Remove the need to raise the fd limit"

This reverts commit 7af9749.

* Add lazy_static for tests

* Remove lingering runtime upgrades (paritytech#6476)

* Remove lingering runtime upgrades

* remove unused warnings

* remove tests

* impl Debug for sc_service::Configuration (paritytech#6400)

* Initial commit

Forked at: d735e4d
No parent branch.

* Make sc_service::Configuration derive Debug

* Replace task_executor fn's input by proper TaskExecutor type (cleaner)

* impl From<Fn> for TaskExecutor

* Update client/cli/src/runner.rs

* Add some doc, examples and tests

* Replace Deref by fn spawn as suggested

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

* Fix `sp-api` handling of multiple arguments (paritytech#6484)

With the switch to `decode_all_with_depth_limit` we silently broken
support for functions with multiple arguments. The old generated code
tried to decode each parameter separately, which does not play well with
`decode_all`.

This pr adds a test to ensure that this does not happen again and fixes
the bug by decoding everything at once by wrapping it into tuples.

* Fix the browser node and ensure it doesn't colour the informant output (paritytech#6457)

* Fix browser informant

* Fix documentation

* Add an informant_output_format function to the cli config

* Wrap informant output format in an option

* Revert batch verifier

* Remove wasm-timer from primitives io cargo lock

* Drop informant_output_format function

* derive debug for output format

* bound some missing bound for elevated trait (paritytech#6487)

* `pallet-scheduler`: Check that `when` is not in the past (paritytech#6480)

* `pallet-scheduler`: Check that `when` is not in the past

* Break some lines

* client/network/service: Add primary dimension to connection metrics (paritytech#6472)

* client/network/service: Add primary dimension to connection metrics

Two nodes can be interconnected via one or more connections. The first
of those connections is called the primary connection.

This commit adds another dimension to the
`sub_libp2p_connections_{closed,opened}_total` metrics to differentiate
primary and non-primary connections being opened / closed.

By intuition more than one connection between two nodes is rare.
Tracking the fact whether a connection is primary or not will help prove
or disprove this intuition.

* .maintain/monitoring: Ensure to sum over all connections_closed variants

* client/network/service: Rename is_primary to is_first

* client/network/service: Split by metric name with two additional metrics

* Revert ".maintain/monitoring: Ensure to sum over all connections_closed variants"

This reverts commit 2d2f93e.

* client/network/service: Remove labels from distinct metrics

* Ensure the listen addresses are consistent with the transport (paritytech#6436)

* Initial commit

Forked at: 0c42ced
No parent branch.

* Ensure the listen addresses are consistent with the transport

* Update client/network/src/error.rs

* Update client/network/src/service.rs

* Better implementation

* Fix bad previous impl

* add boot_nodes

* reserved nodes

* test boot nodes

* reserved nodes tests

* add public_addresses and make specific error type

* Update client/network/src/error.rs

Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>

Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>

* pallet-contracts: migrate to nested storage transaction mechanism (paritytech#6382)

* Add a simple direct storage access module

* WIP

* Completely migrate to the transactional system.

* Format

* Fix wasm compilation

* Get rid of account_db module

* Make deposit event eager

* Make restore_to eager

* It almost compiles.

* Make it compile.

* Make the tests compile

* Get rid of account_db

* Drop the result.

* Backport the book keeping.

* Fix all remaining tests.

* Make it compile for std

* Remove a stale TODO marker

* Remove another stale TODO

* Add proof for `terminate`

* Remove a stale comment.

* Make restoration diverging.

* Remove redudnant trait: `ComputeDispatchFee`

* Update frame/contracts/src/exec.rs

Co-authored-by: Alexander Theißen <alex.theissen@me.com>

* Introduce proper errors into the storage module.

* Adds comments for contract storage module.

* Inline `ExecutionContext::terminate`.

* Restore_to should not let sacrifice itself if the contract present on the stack.

* Inline `transfer` function

* Update doc - add "if succeeded"

* Adapt to TransactionOutcome changes

* Updates the docs for `ext_restore_to`

* Add a proper assert.

* Update frame/contracts/src/wasm/runtime.rs

Co-authored-by: Alexander Theißen <alex.theissen@me.com>

Co-authored-by: Alexander Theißen <alex.theissen@me.com>
Co-authored-by: Alexander Theißen <alexander.theissen@parity.io>

* Update lock

Co-authored-by: Subsocial <62490051+subsocialdev@users.noreply.github.com>
Co-authored-by: Benjamin Kampmann <ben@gnunicorn.org>
Co-authored-by: Nikolay Volf <nikvolf@gmail.com>
Co-authored-by: Rakan Alhneiti <rakan.alhneiti@gmail.com>
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: Gavin Wood <gavin@parity.io>
Co-authored-by: Cecile Tonglet <cecile@parity.io>
Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
Co-authored-by: Seun Lanlege <seunlanlege@gmail.com>
Co-authored-by: David Craven <david@craven.ch>
Co-authored-by: Marcio Diaz <marcio.diaz@gmail.com>
Co-authored-by: Shaopeng Wang <spxwang@gmail.com>
Co-authored-by: Denis Pisarev <denis.pisarev@parity.io>
Co-authored-by: Bastian Köcher <git@kchr.de>
Co-authored-by: Sergei Shulepov <sergei@parity.io>
Co-authored-by: Roman Borschel <romanb@users.noreply.github.com>
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>
Co-authored-by: Dan Forbes <dan@danforbes.dev>
Co-authored-by: Alexander Theißen <alex.theissen@me.com>
Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
Co-authored-by: Tore19 <289649077@qq.com>
Co-authored-by: wangjj9219 <183318287@qq.com>
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>
Co-authored-by: tgmichel <telmo@purestake.com>
Co-authored-by: Demi Obenour <demi@parity.io>
Co-authored-by: Bernhard Schuster <bernhard@ahoi.io>
Co-authored-by: Bernhard Schuster <bernhard@parity.io>
Co-authored-by: s3krit <pugh@s3kr.it>
Co-authored-by: Ashley <ashley.ruglys@gmail.com>
Co-authored-by: Max Inden <mail@max-inden.de>
Co-authored-by: Xiliang Chen <xlchen1291@gmail.com>
Co-authored-by: Svyatoslav Nikolsky <svyatonik@gmail.com>
Co-authored-by: Arkadiy Paronyan <arkady.paronyan@gmail.com>
Co-authored-by: Wei Tang <hi@that.world>
Co-authored-by: mattrutherford <44339188+mattrutherford@users.noreply.github.com>
Co-authored-by: Matt Rutherford <mattrutherford@users.noreply.github.com>
Co-authored-by: ddorgan <david@parity.io>
Co-authored-by: Toralf Wittner <tw@dtex.org>
Co-authored-by: pscott <30843220+pscott@users.noreply.github.com>
Co-authored-by: Alexander Theißen <alexander.theissen@parity.io>
drewstone added a commit to hicommonwealth/substrate that referenced this pull request Aug 11, 2020
* Disconnect node after sync request cancelled (#5945)

* Make sure `config_mut` returns a mutable reference (#5942)

* Remove "simple declaration of the `Module` type" comments (#5944)

* Remove "simple declaration of the `Module` type" comments

* Bump runtime impl version

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

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

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

* Fix light clients in manual seal nodes (#5955)

* WIP

* WIP

* Updates lock file

* Bump wasmtime again (#5950)

* Update wasmtime (#5822)

* update wasmtime

* update tests

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

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

* wip

* use master-candidate

* update with patches

* update versions

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

* Bump version

* Added parallel execution test

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

* Expose BlockHashCount on system metadata constants (#5960)

* Add database type for import benchmarks (#5959)

* add database type for impot benchmarks

* add backend to name

* weight adjustments for identity and timestamp pallets (#5946)

* Refactor network transactions handling (#5939)

* change propagation

* add bound

* Fix very wrong staking test (#5952)

* fix this damn wrong staking test.

* Update frame/staking/src/tests.rs

* assert on balnce as well

* Make it a bit better.

* Don't repeatedly lookup keys in `babe_epochAuthorship` rpc function (#5962)

* babe: don't repeatedly lookup keys in authorship rpc function

Expose a new function `claim_slot_using_keypars` in Babe so that the `babe_epochAuthorship` can
lookup authorship for all slots in the epoch without repeatedly looking up keys in the keystore.

Time to run the `babe_epochAuthorship` RPC call goes from 7s to 25ms on a local dev chain on my
machine.

* babe: pass reference to slice instead of ref to Vec

* babe: fix bunch of clippy warnings

* hotfix Docker release (#5968)

* Properly log when we discard a sync response (#5969)

* Add crypto identifier to RuntimeAppPublic (#5965)

* Add crypto identifier to RuntimeAppPublic

* Update primitives/application-crypto/src/traits.rs

Co-authored-by: Gavin Wood <github@gavwood.com>

Co-authored-by: Gavin Wood <github@gavwood.com>

* Small fix to block response completion reporting (#5967)

* Small fix to block response completion reporting

* while -> if

* Minor update on example-offchain-worker code and comment (#5970)

* Minor update on example-offchain-worker code and comment

Signed-off-by: Jimmy Chu <jimmychu0807@gmail.com>

* Update frame/system/src/offchain.rs

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

* Update initialize tests for latest rust stable (#5971)

* Update initialize tests for latest rust stable

* Update more tests

* AHHH

* Fix `runtime-interface` test

* ------------------------______________----------------------

* ...

* Allow passing multiple --log CLI options (#5982)

* Allow passing multiple --log CLI options

* Comment typo

* Optimize `decode_len` (#5975)

* Optimize `decode_len`

Instead of reading the full storage value into the runtime, we only read
at maximum `5bytes` from the storage into the runtime. Furthermore this
drops any handling with regards to set default values in
`decl_storage!`. If the value does not exists or the decoding of the
length fails, it will return `None`. To prevent people from messing
stuff up, this feature relies on the `StorageDecodeLength` trait that is
sealed by `frame-support` (aka only implementable inside this crate).

* Some clean ups

* Update frame/support/src/storage/mod.rs

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

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

* Split Operational and Normal weight (#5954)

* Split operational and normal weight

* Update other parts of the code

* relatively minor changes to add/fix behavior

* Limit reported block weight for fee adjustment

* fix test

* explicit match

* Move common logic out

* Update frame/system/src/lib.rs

Co-authored-by: Gavin Wood <gavin@parity.io>

* API improvement @bkchr

Co-authored-by: Gavin Wood <gavin@parity.io>

* client/finality-granpda/until_imported: Rework pinning (#5983)

An `UntilImported` stream wraps a `Stream` of incoming messages and
waits for blocks those messages are based on before passing the messages
on.

The above `Stream` of incoming messages implements `Unpin`, thus there
is no need to use `pin_project` on the `UntilImported` struct. Instead
one only has to add the `Unpin` trait bound on the `I` trait parameter.

* grandpa: update to finality-grandpa v0.12.3 (#5972)

* grandpa: missing equivocation reporting nits (#5953)

* primitives: move reporting key type to common key types

* session: remove useless methods on MembershipProof

* grandpa: remove std special-casing when checking signatures

* grandpa: add some more docs

* grandpa: use proper error types rather than strings

* Update and pin node-browser-testing wasm-bindgen version (#5987)

* babe: minor rpc nits (#5974)

* babe: fix formatting

* babe: re-use same epoch data in epoch_authorship rpc method

* get tx_hashes from watcher (#5981)

* Restore the reputation penalty for timeouts (#5984)

* Spawn the network worker with spawn_blocking (#5909)

* Spawn the network worker with spawn_blocking

* Some comment adjustments

* Fix shutdown not working

* client/network: Remove default Kademlia DHT in favor of per protocol DHT (#5993)

Substrate was previously running both a chain specific Kademlia DHT as
well as the `/ipfs/kad/1.0.0` Kademlia DHT for backwards compatibility.
(See 710722f for details.)

With the end of the transition period this commit removes the former
only leaving the latter and thus preventing the discovery of
incompatible nodes via Kademlia.

* Turn an error! into a debug! (#6000)

* Fix minor typos in im-online documentation (#5997)

* Fix minor typos on im-online documentation

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

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

* Only send last finalized block to telemetry (#6003)

Instead of informing the telemetry about each block that is finalized,
we only need to send the last finalized block. This removes log spam on
initial sync.

* Change BlockHashCount Parameter in Node/Node Template (#5990)

* change BlockHashCount param

* fix test and lock

* Fix gitlab line-width CI check (#5994)

* Run script in strict mode

* Add proper seperator between revision and file

* Fix copy paste error

* Do not repeat limit number in error text

* Fix bad revision error

* Do not mask pipe errors

* Fix typo

* Remove unnecessary ... syntax

* Do not fetch all commits of master

* Fetching one commit is enough

* Monitor transactions rejected from the pool as invalid (#5992)

* Give more meaningful error on missing feature when opening a db (#5999)

* Add CRYPTO_ID to AppKey (#6011)

* Add mitigation for the state inconsistency issue (#5996)

* Add mitigation for the state inconsistency issue

* Add logging

* Fix minor clippy lints in grandpa (#5988)

* grandpa: fix clippy lints about identity conversions

* grandpa: fix clippy lints about unwrap_or_default

* grandpa: fix clippy lints about explicit return

* grandpa: fix clippy lints about unnecessary intermediary

* grandpa: fix clippy lints about to_string

* grandpa: fix clippy lints about unused imports

* grandpa: fix clippy lints about increments

* grandpa: fix clippy lints about unnecessary matches

* grandpa: fix clippy lints about struct arguments

* Fix clippy::redundant_clone

* Fix clippy::clone_on_copy

* Fix clippy::or_fun_call

* Fix clippy::identity_conversion

* Handle clap errors manually and don't reset `SIGPIPE` (#6012)

Instead of resetting `SIGPIPE` to the system default handler, we now
handle a clap error manually and ignore any error when writing to
`stdout`/`stderr`. In this way, the node does not silently stops when it
encounters a `SIGPIPE` in normal mode and we still support piping of the
cli output.

* Convert `Public` to `CryptoTypePublicPair` (#6014)

* Tabify code

* Implement CryptoTypePublicPair in app_crypto

* Cleanup redundancy

* Introduce to_public_crypto_pair to Public trait

* Implement method for test

* Fix potential state mismatch in behaviour.rs (#6013)

* Fix state mismatch in behaviour.rs

* Add TODO

* properly handle different block content (#6007)

* Add tests to Sudo Pallet (#5963)

* transition treasury to configurable moduleids

* make election module id configurable

* convert runtime and pallet to accept module id config elections-phragmen

* add ModuleId to evm pallet

* change society pallet to configurable module id

* delete commented out module_id

* fix merge residual compile errors

* setup initial mock structure

* establish privelleged function test

* save progress

* first pass new_test_ext

* test sudo to make sure it error when non-root

* add set keys tests

* fix unused result from set_key call

* remove unused imports warnings

* pre master merge

* Expose BlockHashCount on system metadata constants (#5960)

* squash

* fix whitespace

* spelling and whitespace

* a single pesky space

* add logger module to mock

* add logger dispatch to privlleged function

* sub logger in for dummy functions

* create first of several event tests

* first pass at test coverage for events

* comment house keeping

* spell check

* Expose BlockHashCount on system metadata constants (#5960)

* establish privelleged function test

* save progress

* first pass new_test_ext

* test sudo to make sure it error when non-root

* add set keys tests

* fix unused result from set_key call

* remove unused imports warnings

* pre master merge

* squash

* fix whitespace

* spelling and whitespace

* a single pesky space

* add logger module to mock

* add logger dispatch to privlleged function

* sub logger in for dummy functions

* create first of several event tests

* first pass at test coverage for events

* comment house keeping

* implement last_seen_account storage item, event, and, logger function

* create vec account log and use in tests

* allow weight to be passed into account log

* refactor all log dispatchables

* save progress

* complete initial transition to refactored logger

* cleaning

* fix merge residual compile errors

setup initial mock structure

establish privelleged function test

save progress

first pass new_test_ext

test sudo to make sure it error when non-root

add set keys tests

fix unused result from set_key call

parent 5151bd784545ededa6153052a93fcc309f7b3885
author zeke <emostov@middlebury.edu> 1589076740 -0700
committer zeke <emostov@middlebury.edu> 1589350443 -0700

parent 5151bd784545ededa6153052a93fcc309f7b3885
author zeke <emostov@middlebury.edu> 1589076740 -0700
committer zeke <emostov@middlebury.edu> 1589350442 -0700

remove unused imports warnings

fix unused result from set_key call

remove unused imports warnings

pre master merge

Expose BlockHashCount on system metadata constants (#5960)

squash

fix whitespace

spelling and whitespace

a single pesky space

add logger module to mock

add logger dispatch to privlleged function

sub logger in for dummy functions

create first of several event tests

first pass at test coverage for events

comment house keeping

pre master merge

Expose BlockHashCount on system metadata constants (#5960)

Expose BlockHashCount on system metadata constants (#5960)

fix whitespace

spell check

implement last_seen_account storage item, event, and, logger function

create vec account log and use in tests

allow weight to be passed into account log

refactor all log dispatchables

save progress

complete initial transition to refactored logger

cleaning

* clean up

* cleaning

* condense non_privileged logs into 1 fn

* Apply suggestions from code review

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

* Improve `BadProof` docs (#6019)

* Improve `BadProof` docs

* Update primitives/runtime/src/transaction_validity.rs

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

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

* Fix escaping of the wasm file path (#6018)

* Fix escaping of the wasm file path

* Add separate methods for escaped paths

* ci: fix merge on polkadot companion job (#6020)

* [CI] Fix a few issues with .gitlab-ci.yml (#6016)

* Fix RPC tests for machines with a high number of cores (#6021)

* Collective weights (#5802)

* Don't log the yamux errors by default (#6034)

* Add ‘transaction_version’ to the signed transaction (#5979)

* Add ‘transaction_version’ to the signed transaction

This allows hardware wallets to know which transactions they can safely
sign.  To reduce transaction size, I reduced it to a ‘u8’ from a ‘u32’.

Fixes #5951.

* Restore transaction_version to a u32

* Fix comments

`transaction_version` is not part of a tx, but is still signed.

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

* Fix the test suite

I had forgotten to change the production of transactions in the test
code.

* Fix benchmarks

* Improve docs for `CheckTxVersion` in `frame_system`

Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>

* Remove spurious cast

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>

* ci: github api use token for pull requests (#6037)

* Update Staking Weights (#5964)

* bump kvdb-* versions (#6017)

* Relax substrate licensing scheme (#5947)

* Democracy weight (#5828)

* Fix lots of small nits in sc-network (#6028)

* Fix lots of small nits in sc-network

* Update client/network/src/protocol/sync/blocks.rs

Co-authored-by: Arkadiy Paronyan <arkady.paronyan@gmail.com>

* Fix warning

* Yes. The line width.

Co-authored-by: Arkadiy Paronyan <arkady.paronyan@gmail.com>

* Put some graphics in the README?  (#5930)

* Update README.md

I didn't do a good job at making the gif, but this is just a proposal.

If accepted, I can make a better one or ask Max to help with it.

* better gif file

* New file

* Benchmarks for elections-phragmen pallet (#5845)

* Fist benchmark barely working

* Debug checkpoint

* add rest of benchmarks

* Add to runtime

* Fix build

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

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

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

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

* major imp

* Make them run on release

* Help finish phragmen benchmarks (#5886)

* update caller, account, and member/runner-up creation

* remove stuff

* ocd

* make it work with real run

* relax the numbers a bit

* New and improved version

* Make elections-phragmen weighable and secure. (#5949)

* Make elections-phragmen weighable.

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

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

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

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

* Fix all tests

* Fix everything

* Add note

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

* Doc update

* Fix some complexity params

* Once more ready to benchmark

* ready for bench

* final tunes

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

* Fix fix

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

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

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

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

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

* Update to latest weights

* Some fixes

* Fix dual voter read from @thiolliere

* Remove todos

* review from @shawntabrizi

* Fix bench tests.

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>

* Use `sign_with` in consensus (#6008)

* Add derive_more to sp_core

* Convert Vec to Signature

* Use sign_with in AURA and BABE

* Signing errors

* Update slots to return consensus result

* Fix use

* Clone public key

* Match block_params

* WIP

* Use to_public_crypto_pair

* Pass public key only to block import params

* Address PR review

* Fix consensus RPC

* Fix babe tests

* adjust uses

* Fix line widths

* Added RuntimePublic for ecdsa public key. (#6029)

* add generate ecdsa, etc to keystore

* impl ecdsa needed traits

* add ecdsa to sr_io

* add ecdsa to application-crypto

* add ecdsa to test-utils

* add ecdsa debug derive

* fix ecdsa public

* Meter block import results via prometheus (#6025)

* Releasing Alpha.8 (#6048)

* Remove on_block_imported (#6039)

* remove on_block_imported

* Update client/network/src/service.rs

Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>

Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>

* Aura fix: make sure the key exists locally (#6054)

* Fix AURA

* Add test to make sure claim slot works as expected

* resetting to -dev (#6050)

* Remove file accounts.scale (#6053)

* Fail test on warnings (#6043)

* fix (ci): hotfix Docker release

* change (ci): fail test on warnings

* change (config): stderr msgs

* Fix the warnings properly

Co-authored-by: Bastian Köcher <git@kchr.de>

* fix whitespace (#6062)

* grandpa: minor cleanup for gossip round start instant (#5976)

* grandpa: move gossip round start instant to LocalView

* grandpa: round duration is 2 gossip periods

* Add block construction prometheus metrics (#6030)

* Add basic authorship metrics

* fixes

* no arc

* move to crate

* Update client/proposer-metrics/Cargo.toml

Co-authored-by: Max Inden <mail@max-inden.de>

* remove prefix

* use HistogramTimer

* Update client/proposer-metrics/src/lib.rs

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

* Update client/basic-authorship/src/basic_authorship.rs

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

* Update client/basic-authorship/src/basic_authorship.rs

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

* Update client/basic-authorship/src/basic_authorship.rs

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

* Update client/basic-authorship/src/basic_authorship.rs

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

* Update client/basic-authorship/src/basic_authorship.rs

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

* Update client/proposer-metrics/src/lib.rs

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

* Update client/proposer-metrics/src/lib.rs

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

Co-authored-by: Max Inden <mail@max-inden.de>
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* chore: updates the license badge (#6058)

* Fix parallel code execution in wasmtime (#6055)

* Bump wasmtime version

* Proper test

* Print an error if we discover our own network identity (#6047)

* Add an error if we discover our own network identity

* Fix tests

* Refactor EVM operations to module functions (#6056)

* Refactor EVM operations to module functions

* Bump impl version

* Make decl_storage generated code respect clippy (#6065)

* fix clippy for code generated by decl_storage

* use as_ref

* Fix benchmarks and add check so that they won't break again (#6061)

* fix benchmarks and add check

* address review

* fix line width

* Include post dispatch corrected weight in extrinsic events (#6024)

* Include post dispatch corrected weight in extrinsic events

* Drop the 'Post' from ApplyExtrinsicResultWithPostInfo to make it less verbose

* Apply suggestions from code review

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

* Use proper Event type in pallet_system tests

* Add test that the actual weight is returned by events

* Make fn extract_actual_weight cap at pre dispatch weight

* Bump spec version

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: Gavin Wood <gavin@parity.io>

* Upgrade to libp2p v0.19 - Changes the default PeerId representation (#6064)

* Upgrade to libp2p v0.19

* Listen on IPv6 by default

* Increase channels sizes

* Use spec-compliant noise protocol

* Show legacy PeerId

* Switch order of Noise protocols

* Switch to crates.io version

* Fix subkey's version

* Fix line width and Wasm build

* I think Wasm is fixed for real this time

* Make GrandpaBlockImport public (#6068)

* service: fix RPC unsafe exposed address detection (#6070)

* Clean a number of sp_io imports (#6072)

* Detect obsolete block responses (#6077)

* Refactor OverlayedChanges (#5989)

* Hide internal structure of OverlayChanges

* Fix tests for OverlayChanges refactor

* Do not clone pending changes

Discarding prospective changes should be equivalent as a state machine
is not to be called with peding changes.

This will be replaced by a storage transaction that is rolled back before
executing the call the second time removing this constraint.

* Doc fixes

* Remove overlong line

* Revert "Do not clone pending changes"

This reverts commit 4799491f4ac16f8517287a0fcf4a3f84ad56f46e.

* Deduplicate chield tries returned from child_infos()

* Remove redundant type annotation

* Avoid changing the storage root in tests

* Preserve extrinsic indices in trie build test

* Swap order of comitted and prospective in fn child_infos

This is only for consistency and does not impact the result.

* Rename set_pending to replace_pending for clearity

* Bump wasmtime version (#6081)

* Refactor resource and error handling in wasm (#6074)

* Refactor resource and error handling in wasm

* Fixes based on review

* Maximum extrinsic weight limit (#6067)

* Only check single extrinsics weight limit in validate_transaction.

* Add missing parameter to all pallets.

* Add tests, fix default configuration.

* Bump spec version.

* Use AvailableBlockRation to calculate MaxExtrinsicWeight

* Restore the empty line after the license (#6088)

* Turn a SmallVec into VecDeque for performances (#6091)

* Turn a SmallVec into VecDeque for performances

* Fix the other SmallVecs

* evm: allow setting pre-defined accounts in genesis (#6086)

* evm: allow setting pre-defined accounts in genesis

* Only build GenesisAccount in std

* Make planning epoch config change in BABE easier (#5776)

* Make planning epoch config change in BABE easier

* Bump node runtime version

* Update frame/babe/src/lib.rs

Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>

* BabeEpochConfiguration -> NextConfigDescriptor

* Add tests for babe config changes

Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
Co-authored-by: André Silva <andre.beat@gmail.com>

* Allow fee calculation to happen off-chain (#6076)

* Emit a PaymentParameters event once per block

This contains per-block paramaters need to calculate
fees off-chain.

* Add WeightToFee trait

* Add documentation to polynomial types

* Ignore pseudo code snippet for doc tests

* Use `Mul` implementation of Perbill

* Add tests for WeightToFeePolynomial

* Revert "Emit a PaymentParameters event once per block"

This reverts commit 6c4763baff3d8179676a3c1660fe7063fd56a8ca.

Co-authored-by: Gavin Wood <gavin@parity.io>

* Handle piping error for commands that output to stdout (#6098)

* Handle piping error for commands that output to stdout

* Apply suggestions from code review

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

* Allow operational recovery path if on_initialize use fullblock. (#6089)

* note_preimage using operational

* Update frame/democracy/src/lib.rs

Co-authored-by: Gavin Wood <gavin@parity.io>

* Optimize network poll (#6099)

* Increase precision of benchmarking results summary (#6092)

Co-authored-by: Matt Rutherford <mattrutherford@users.noreply.github.com>

* Add notes about safe uses of twox (#6082)

* Add notes about safe uses of twox

* Update frame/grandpa/src/lib.rs

Co-authored-by: Nikolay Volf <nikvolf@gmail.com>

* Update frame/elections/src/lib.rs

* Apply suggestions from code review

Co-authored-by: Gavin Wood <gavin@parity.io>
Co-authored-by: Nikolay Volf <nikvolf@gmail.com>

* babe: treat epoch_authorship RPC method as unsafe (#6069)

* service: pass DenyUnsafe to rpc extensions

* node: add DenyUnsafe to rpc full node dependencies

* client: fix whitespace in rpc policy file

* babe: treat epochAuthorship rpc method as unsafe

* babe: add test for unsafe rpc method

* babe: rename babe rpc handler

* service: traitify rpc extension builder

* service: make the rpc extensions builder api non-breaking

* service: revert changes from light node rpc extensions builder

* node: remove unnecessary type in service creation

* service: cleanup with_rpc_extensions implementation

* service: add missing docs to RpcExtensionBuilder

* Offences Weight for OnInitialize (#5961)

* Weight accounting for on_offence.

* Try to compute weight.

* Guesstimate upper bounds on db read/writes for slashing

* greater than or equal to

* add new trait

* Update mock.rs

* Add basic weight test

* one more test

* Update frame/staking/src/lib.rs

Co-authored-by: thiolliere <gui.thiolliere@gmail.com>

* Update frame/staking/src/lib.rs

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

* Add test for offences queue

Co-authored-by: Tomasz Drwięga <tomasz@parity.io>
Co-authored-by: thiolliere <gui.thiolliere@gmail.com>
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>

* Keep `BlockWeight` in Storage (#6046)

* keep block weight in storage

* Update lib.rs

* rename to `BlockWeight`, update tests

* remove println

* make test better

* keep extrinsics length clean

* clarify docs on query_info and partial_fee (#6090)

* .maintain/monitoring: Add an initial set of Prometheus alerting rules (#6095)

Create a place to collaborate on Prometheus alerting rules for
Substrate starting with a basic set of rules covering:

- Resource usage
- Block production
- Block finalization
- Transaction queue
- Networking
- ... Others

* Add Keccak hasher (#6101)

* fix keccak hasher

* Update hasher.rs

Co-authored-by: Gavin Wood <i@gavwood.com>

* Implement FixedPoint trait. (#5877)

* Implement Fixed trait.

* Fix tests

* Fix tests

* Fix tests 2

* Address review comment regarding from_i129.

* Remove precision by using log10() as suggested in review.

* Add small comments.

* Use checked versions + panic for ops::*.

* Remove repeated test.

* Uncomment test.

* Remove casts.

* Add more comments.

* Add tests.

* Panic on saturating_div_int

* More tests.

* More docs.

* Saturating renames.

* Fix to_bound doc.

* Move some impl to trait.

* Add range

* Add macro pre.

* More round() tests.

* Delete confusion.

* More impl to trait

* Add doc for fixedpoint op.

* Remove trailing spaces.

* Suggested docs changes.

* More tests and comments for roundings.

* Some quickcheck tests.

* Add missing panic, more test/comments.

* Nits.

* Rename.

* Remove primitives-types import.

* Apply review suggestions

* Fix long lines and add some fuzz.

* fix long line

* Update fuzzer

* Bump impl

* fix warnings

Co-authored-by: Gavin Wood <gavin@parity.io>
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>

* chore(client): remove the unnecessary clap dep (#6107)

* make calls public (#6109)

* Add a note about the deprecation of register_notifications_protocol (#6111)

* Fix some flaky offchain HTTP tests (#6038)

* http: Use assert_eq in tests for better debuggability

* http: Use matches! macro instead of if let ...

* http: Simplify some bits and pieces

* http: Don't answer immediately in HTTP test server

Sometimes it can happen that we receive the response immediately
when testing the HTTP api due to kernel scheduling. Because of it, we
add a marginal 10ms async-friendly delay to minimize the risk.

* http: Use the same async runtime when testing HTTP API/worker

* http: Return a future Delay only for non-zero Duration

This allows to short-circuit in the response_wait logic and only
send/not wait for response.

* Add JSON format to import blocks and set it as default (#5816)

* Add BlockStream Enum and utility fn

* WIP: Modify import closure to work with BlockStream

* Fix trait bounds

* Working prototype

* Revamp block importing

* Add export_import_flow tests

* Add comments and clean code

* Add more comments in the import fn

* Add link code to import function

* Add condition when returning Ready(Ok(()) to make sure we've imported every block

* Add check for imported blocks in JSON case

* Use rest pattern

* Fix compilation error for undeclared variable

* Add polling and waker before pending

* Print read_block_count instead of count

* Simplify binary cli option with structopt

* Update test to reflect changes in CLI api

* Change Stream to take SignedBlock<B> instead of B

* Add comments to BlockStream

* Move out logic to smaller functions for clearer code

* Remove result over import_blocks return type

* Check for error in command output rather than simply checking command exit status

* Revamp export/import/revert testing

* Fix minor typos and formatting errors

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

* Remove unnecessary if condition in terminating condition

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

* Explicit error instead of returning it as a string

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

* Pass BlockStream to log_importing_status_updates and simplify matching arms for block stream

* Use .contains() instead of regex match

* Line break in match block; return future::ready instead of poll_fn

* Update Cargo.lock

* Add check so that queue doesn't grow too big

* Use Iterator instead of Stream

* Remove allow dead_code

* Remove outdated comments

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

* Return Errors instead of logging them

* Simplify match arms

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

* Remove check before terminating block import

* Apply suggestions from code review

* Check that queue is not full BEFORE calling

* Revert "Remove check before terminating block import"

This reverts commit 377823c0a648a3eb2e61185a257a61023067893d.

* Improve unit tests to make sure we actually import blocks

* Remove Unpin implementation for BlockIter

* Add prototype of enum for ImportStates

* Add working prototype for StateMachine

* Add comments for clearer code

* Add sleep before calling Waker when waiting for import queue

* Add Speedometer

* add dbg!(&log) for test debugging

* Fix lines with more than 100 cols

* Fix regex capture for test

* Update regexes to take to capture the whole number

* Rename Cmd to Command

Co-authored-by: Gavin Wood <gavin@parity.io>

* Actually rename Cmd to Command

* Apply suggestions from code review

Co-authored-by: Gavin Wood <gavin@parity.io>

* Fix compilation errors for tests

* Fix compilation errors from code review suggestion

* Update bin/node/cli/tests/export_import_flow.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: Gavin Wood <gavin@parity.io>
Co-authored-by: Benjamin Kampmann <ben@gnunicorn.org>

* put max votes into metadata (#6114)

* Don't clone values when calculating storage root (#6108)

* Don't clone values when calculating storage root

Instead of cloning all the keys and values of the overlay when
calculating the storage root, we pass all the values by reference. This
should probably bring some performance improvements when calculating the
storage root.

* no cow version (#6113)

Co-authored-by: cheme <emericchevalier.pro@gmail.com>

* First draft of offchain phragmen weights (#6032)

* Fist draft of offchain weights

* Round of review feedback

* Update frame/staking/src/lib.rs

* Fix fuzzer

* Remove some redundant comment

* Weight refund for submit solution -- potentially revert.

* First version with custom trimming of the result.

* Update frame/staking/src/benchmarking.rs

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

* Update frame/staking/src/benchmarking.rs

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

* Apply suggestions from code review

Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>
Co-authored-by: thiolliere <gui.thiolliere@gmail.com>

* Update frame/staking/src/benchmarking.rs

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

* Update frame/staking/src/benchmarking.rs

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

* Some improvements

* Benchmark submit solution without phragmen (PR for First draft of offchain phragmen weights) (#6073)

* implementation of new benchmark

* address comments

* replace test

* Update frame/staking/src/lib.rs

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

* update weight

* Fix refund

* Clean and rady for final bench

* Fix line-wdith

* Fix gitlab build

* Fix line-wdith

* Fix test macro

* Update frame/staking/src/lib.rs

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

* Update frame/staking/src/benchmarking.rs

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

* Better length check

* Update frame/staking/src/lib.rs

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

* Update final weight coefficients

* Update frame/staking/src/lib.rs

* Apply suggestions from code review

* Update frame/staking/src/testing_utils.rs

* Try and fix the line-width

* Revert "Try and fix the line-width"

This reverts commit b4e284727220085b9b3daf7682c4bbf29621da09.

* Try and fix the line-width the correct way

* Revert "Try and fix the line-width the correct way"

This reverts commit 04fce128e851c9584f9f0d708a5a73cae799d8c8.

Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>
Co-authored-by: thiolliere <gui.thiolliere@gmail.com>
Co-authored-by: Gavin Wood <gavin@parity.io>

* Fix default base path on windows (#6120)

* Use directories instead of app_dirs

* Use local data dir

* Benchmarks sanity checks  (#6119)

* add read-only externalities

* sanity checks

* cleanup

* Update primitives/state-machine/src/read_only.rs

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

* fix typo

* add error exit code if nothing was run

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

* Events and better log for staking. (#6118)

* Events and better log for staking.

* Fix build

* Update frame/staking/src/lib.rs

Co-authored-by: Marcio Diaz <marcio.diaz@gmail.com>

Co-authored-by: Marcio Diaz <marcio.diaz@gmail.com>

* Tidy tests a bit. (#6122)

* Remove sleep in import blocks (#6124)

* Add Delay and info logging

* Switch from Duration to Delay in enum declaration

* Remove sleep from import_blocks fn

* Set back constans and remove unnecessary code

* Fix hot loop

* Reset timer once poll is ready, not when it's pending

* Bump to libp2p v0.19.1 (#6125)

* Tagging as rc1

* Make sure fixed arithmetic tests don't rely on debug assertions (#6126)

* Add Changelog for rc1 (#6128)

* Filter calls in utility (#6131)

* Filter calls.

* Remove old proxy code

* Docs and repot

* Update frame/utility/src/tests.rs

Co-authored-by: Marcio Diaz <marcio.diaz@gmail.com>

* fix test

* Grumble

* Bump runtime version

* fix

* Attempt general fix

Co-authored-by: Marcio Diaz <marcio.diaz@gmail.com>
Co-authored-by: NikVolf <nikvolf@gmail.com>

* Releasing rc2 (#6136)

* Fix mul_acc. (#6145)

* Don't iterate over peers in generic_proto::behaviour::poll (#6142)

* Don't iterate over peers in generic_proto::behaviour::poll

* Improve comment

* Rework to use DelayIds

* Fixes `wasm-builder` rerun if changed logic (#6144)

There was a bug which related in required files not being tracked of
being modified. This pr fixes this bug by making sure we ignore version
requirements for path dependencies and git dependencies. This also
ensures that we only track `.rs` or `.toml` files. Another improvement
is that we only include paths which don't contain a `Cargo.toml` if this
`Cargo.toml` does not belongs to the package being processed. This
prevents that sub-crates are added to the tracked files, while not being
part of the dependencies.

* CLI: Make `--dev` conflict with `--chain` (#6146)

If we are running `--dev` chain, we should forbid the `--chain`
argument. The `--dev` chain is always special by only having one
authority etc and some other chain spec is probably not setup for this
correctly. In the end `--dev` is just a shortcut for `--validator --alice`.

* Make `wasm-builder` check before copy/write files if the content is the same (#6149)

* Make `wasm-builder` check before copy/write files if the content is the
same

* Update utils/wasm-builder/src/lib.rs

Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>

Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>

* fix lstrip in biguint (#6151)

* add failing test for multiply_by_rational

* fix BigUint

* fix length

* bump version

* merge tests

* remover ancient code (#6157)

* Add subkey inspect-node-key (#6153)

* Make Get<T> const friendly + Clean the runtime files a bit. (#6132)

* Make Get const friendly

* Better doc

* Grumble

* Better doc

* Clean runtime files more

* Peerset cleanup (#6078)

* Move methods from Peerset to peers structs

* Remove priority_only from peersstate

* Refactor PSM

* Don't test private fields

* Update sc_network

* Remove wrong comment

* Also fix small stupidity when setting reserved_only

* Put back priority_group

* Restore priority groups as before

* Apply suggestions from code review

Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>

* Do the reserved only change

* Update client/peerset/src/lib.rs

Co-authored-by: Arkadiy Paronyan <arkady.paronyan@gmail.com>

* Use HashSet::difference

Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
Co-authored-by: Arkadiy Paronyan <arkady.paronyan@gmail.com>

* Improve logging for transaction pool (#6152)

* improve logging

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

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

* address review and make uniform

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

* Add test for Transaction Payment on zero balance account (#6161)

* Test zero balance account with pays::no

* Update frame/transaction-payment/src/lib.rs

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

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

* Add a warning when the user passes a legacy PeerId (#6158)

* Add a warning when the user passes a legacy PeerId

* Update client/network/src/config.rs

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

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

* Improve the log messages printed when a listener closes (#6162)

* Improve the log messages printed when a listener closes

* Oops, didn't finish the expired listen addrs thing

* Fix Election when ForceNone V1 (#6166)

* Clean

* Better doc

* Better better doc

* Again better doc

* Fix indemt

* Update frame/staking/src/lib.rs

* Update frame/staking/src/lib.rs

* Better test

Co-authored-by: Gavin Wood <gavin@parity.io>

* Update locks on upgrade (#6172)

* offchain storage lock (#6010)

* feat/offchain/storage: add remove interface method

* feat/offchain/storeage: add remote to StorageValueRef

* feat/offchain/storage: add storage lock

* fix/review: Apply suggestions from code review

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

* refactor/offchain/storage/lock: introduce `Lockable` trait part 1 of 2

* chore/offchain/rename: _remove -> clean

* feat/offchain/storage/lock: add TimeAndBlock based part 2 of 2

* fix/offchain/storage/lock: block and time expiry must be && not ||

* chore/offchain/storage: minor fmt doc comments

* doc/comment: prefer markdown emphasis over CAPS

* doc/comment: rewrap multiline module level docs

* doc/comment: rephrase

* impl sleep_until and use the actual time for the test env

* feat/test: add more tests, ignore some sample impl doctests

* fix/review: Apply suggestions from code review

Co-authored-by: Nikolay Volf <nikvolf@gmail.com>

* doc/comment: better description

* fix/review: Apply suggestions from code review

Co-authored-by: Nikolay Volf <nikvolf@gmail.com>

* chore/storage: lifetime cleanup

* fix/cleanup: trait bounds, cargo-spellcheck + extra explanations

* fix/doc: periods +-

* fix/review: Apply suggestions from code review

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

* cleanup: remove explicit lifetime bound, copy -> clone

* fix/review: make trait Lockable contain only static, try_lock should not return Err(Option<L>),

* chore/lifetimes: remove a couple of lifetime bounds which the compiler can figure out

* refactor: migrate to an instant based

* fix/feedback: fix, reduce, rename, docs update pending

* docs/reword: adjust to changed code

* fix/offchain/testing: timestamp and sleep_until shall not block

* chore/lines: lines must < 100 chars

* fix/docs: add missing pub field doc comments

* refactor/x: try_lock does not need to return an Option<_>

* refactor/simplify: a better way of waiting for a lock to resolve

* docs: consistency

* fix/line: < 100

* fix/doctest/use: avoid crate::

* fix/doctest: *

* fix/review: remove unused trait bound

* fix/review: pretty by const fn

* fix/review: reduce default timeout to 20s

* docs: grammar

* fix/review: add with_block_deadline

* doc: revamp BlockNumberProvider documentation to be less frame centric

* chore: fmt

* docs: add missing doc comment

Co-authored-by: Bernhard Schuster <bernhard@parity.io>
Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
Co-authored-by: Peter Goodspeed-Niklaus <coriolinus@users.noreply.github.com>
Co-authored-by: Nikolay Volf <nikvolf@gmail.com>

* Make post dispatch fee consistent with a direct calculation (#6165)

* Make post dispatch fee consistent with a direct calculation

* Remove unnecessary `saturated_into` calls

* Add test with negative multipliers

* Added regression test

* Test improvements

* pallet-contracts: State rent fixes (#6147)

* Don't store the storage size offset in the contract itself.

* Clean the AccountDb code a bit

* Use `storage_size: 0` when creating AliveContractInfo

* Count empty storage items.

* Update frame/contracts/src/account_db.rs

Co-authored-by: Nikolay Volf <nikvolf@gmail.com>

* Use more clear wording.

Co-authored-by: Alexander Theißen <athei@users.noreply.github.com>

* Change the order of decrement and increment for storage size

Co-authored-by: Nikolay Volf <nikvolf@gmail.com>
Co-authored-by: Alexander Theißen <athei@users.noreply.github.com>

* Allow over-weight collective proposals to be closed (#6163)

* split `finalize_proposal` to approve and disapprove

* Add test

* Add root `disapprove_proposal`

* Update approve logic after voting period passes

* Remove the update lock on upgrade iterator (#6179)

* Wasm-builder `runtime-wasm` feature (#6177)

* Enable the `runtime-wasm` for wasm builds

This enables the `runtime-wasm` feature for wasm builds. The feature is
not mandatory and will only be activated if it exists in the
`Cargo.toml`.

* Fix compilation

* Update docs

* Uprgade version

* Apply suggestions from code review

* fix/review: remove doc hidden on private item (#6186)

Co-authored-by: Bernhard Schuster <bernhard@parity.io>

* Make `Proposer` consume its reference on `propose` (#6190)

* Make `Proposer` consume its reference on `propose`

A proposer must be created per new round, so it makes sense to have the
proposer consume its own reference.

* Remove `ProposerInner`

* Pin async-std to <1.6 (#6193)

* Add a Substrate networking Grafana dashboard template (#6171)

* Add a substrate-networking grafana dashboard

* Capitalize data source

* Do changes

* Update import metrics and add verification time (#6170)

* refactor import reporting and add time

* Update primitives/consensus/common/src/metrics.rs

Co-authored-by: Max Inden <mail@max-inden.de>

* remove (crate)

* fix longer lines

* swap names to avoid api breaking

Co-authored-by: Max Inden <mail@max-inden.de>

* report only on successfull block (#6187)

* Fix Rustdoc Build (#6207)

* impl FindAuthor<T::AuthorityId> for Aura (#6205)

* Something compiles

* compiles _and_ maintains old version

* Comments

* try to pass CI

* Update frame/aura/src/lib.rs

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

* Update frame/aura/src/lib.rs

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

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

* Remove ReportHandle (#6213)

* pallet-evm ensure gas_price + Storage getter  (#6191)

* evm: move gas price check to top-level dispatchable

* Add AccountCodes get fn and account_exists helper

* Remove account_exists, evm handles non-existing accounts

* Runtime bump impl_version 251/2

* Fix Runtime impl_version and spec_version

Co-authored-by: Wei Tang <hi@that.world>

* Allow ExistentialDeposit = 0 (#6185)

* Allow ExistentialDeposit = 0

* there are better ways to check is an account exists

* fix StorageMapShim

* test account events and fix some bugs

* Accept new Phragmén solutions if they are epsilon better + Better pre-inclusion checks. (#6173)

* part1: Accept inly epsilon better solutions

* Fix pre-dispatch check

* Fix build

* review grumbles

* Epsilon -> Threshold

* refactor CI (#6176)

* fix (ci): hotfix Docker release

* test (ci): run full ci  [skip ci]

* change (ci): check stage; add default variables because they were overriden; test-dep-rules goes k8s

* change (ci): move companion job to another stage

* change (ci): no good way to avoid artifacts downloads without dependencies

* fix (ci): typo

* change (ci): all CI images were moved to paritytech registry

* fix (ci): return to the prev image, new needs more testing

* Generalised proxies (#6156)

* Initial work

* It should work

* Fix node

* Fix tests

* Initial test

* Tests

* Expunge proxy functionality from democracy and elections

* Allow different proxy types

* Repotted

* Build

* Build

* Making a start on weights

* Undo breaking change

* Line widths.

* Fix

* fix tests

* finish benchmarks?

* Storage name!

* Utility -> Proxy

* proxy weight

* add proxy weight

* remove weights

* Update transfer constraint

* Again, fix constraints

* Fix negation

* Update frame/proxy/Cargo.toml

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

* Remove unneeded event.

* Grumbles

* Apply suggestions from code review

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

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

* block.tx[0] is not invalid if on_initialize is too heavy (#6217)

* fix millis display (#6227)

* Make dev profile faster by compiling deps with opt-level=3 (#6228)

* Make dev profile faster by compiling deps with opt-level=3

* More comment

* More comment refinment

* Remove soketto as it doesn't fit criterias

* Fix style

* Fix libp2p features (#6229)

* Fix libp2p features

* Remove the opt-level of some now-unused crates

* Split tx pool and offchain notification handling (#6231)

Instead of having the tx pool and offchain worker being feed from the
same import notification stream, this pr splits them to use two
different streams. The first advantage of this split is that the tx pool
will not be spawned anymore in another task and instead will directly
process the notification in the same task. This has the advantage of
being faster when the system is being under load, as the tx pool will
not be waiting for being scheduled to handle the notification.

* Add run_full_node, run_light_node and print_node_infos to the API  (#6233)

* Initial commit

Forked at: 2743ed4b26b786efdcb5d1123a277f21da0c29c0
Parent branch: origin/master

* Add run_full_node, run_light_node and print_node_infos to the API

* Update runner.rs

* The link to getting-started was obsolete. (#6238)

* The link to getting-started was obsolete.

* link to installation and tutorials

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

* Use Subscription Manager from `jsonrpc-pubsub` (#6208)

* Bump jsonrpc pubsub, core, http, and ws

Right now these are the packages which _need_ to be updated
so I can just the latest `jsonrpc-pubsub` code. Once a release
it cut upstream the rest of the dependencies should be updated
as well.

* Use jsonrpc-pubsub's SubscriptionManager

This places sc-rpc-api::Subscriptions

* Bump jsonrpc-core outside of sc-rpc-*

* Update client/rpc tests

Right now one of the `author` tests is failing, I
need to think a bit about how best to fix it.

* Remove Subscriptions manager

There's no need for this implementation since we're
using the one from `jsonrpc-pubsub` now

* Fix author RPC test

This test used to check for a numerial subscription ID,
whereas now it uses a string based ID which is the default
provided by `jsonrpc-pubsub`'s subscription manager.

* Remove unused NumericIdProvider

* Add missing bracket

Removed one too many with that last one, lol

* Bump `jsonrpc` to v14.2

There's an exception though. `jsonrpc-derive` cannot be bumped
past v14.0.5 just yet since it has a dependency on `quote` pinned
to v1.0.1. This means that at the moment it won't build on Substrate
since it's using v1.0.3.

* Track `jsonrpc-derive` master branch

* Bump `quote` version to v1.0.6

* Bump `jsonrpc-derive` to v14.2.1

This includes support for `quote` v1.0.6

* Fix peerset not filtering incoming connections in reserved-only (#6249)

* Fix service tests not calling update_chain (#6232)

* Revert "Use Subscription Manager from `jsonrpc-pubsub` (#6208)" (#6252)

This reverts commit f028a509789289a34c468f42b4361c49279893f2.

* Revert "Remove balances migration. (#5224)"

This reverts commit e1fcc9796a576a9fb78e0a5e23830ae87171015b.

* impl_opaque_keys should allow doc comments (#6255)

* Use number of downloaded blocks for test (#6234)

* Sentry nodes and validator nodes also imply reserved (#6251)

* Remove pre-simple-payout code from staking (#6253)

* Remove some dead code

* fix

* Kill warnings

* Rename all the election operations (#6245)

* Rename and move sp-phragmen

* More renames for equalise

* Update main module doc

* Fix line width

* Line width

* Make transaction pool prune transactions only of canonical blocks (#6123)

* Make tx pool aware of retracted fork blocks

* Make it compile

* Update client/transaction-pool/src/lib.rs

Co-authored-by: Nikolay Volf <nikvolf@gmail.com>

* Fix doc test

* Simplify the implementation

* Send tree route as arc to prevent heavy clones

* Switch to use `ExtrinsicHash` to make it more clear

* Fix benchmark

Co-authored-by: Nikolay Volf <nikvolf@gmail.com>

* Allow "anonymous" proxied accounts (#6236)

* Anonymous proxiers

* More testing

* More testing

* Build fix

* Build fix

* Benchmarks.

* fix benchmarking

* add weights

* fix line width

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

* Enable fixed point u128 (#6214)

* Add fixed u128.

* remove move

* Change sat_from_integer impl.

* checked_pow is always positive

* Revert.

* rename fixed file

* Rename to FixedI

* rename fixed file

* Add newline.

* Use Multiplier in impls.

* Renames negate() to saturating_negate().

* Uncomment test.

* Add Signed to macro.

* Add some tests for Saturating trait.

* Fix the metered unbounded sender/recievers (#6246)

* Fix the metered unbounded sender/recievers

* Use a counter instead

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

* Add an is_terminated check

* Add FusedStream impl

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

* Fix transaction pruning in tx-pool (#6276)

The `tree_route` generated by the import notification is only from the
old best block to the new best parent. This means, it does not contain
the new best block in `enacted()`. We need to prune the transactions of
the new best block "manually" to fix this bug.

Besides that, this pr also changed the `id` parameter of the `NewBlock`
chain event to `hash`. The hash of a block is unique in contrast to the
block number. (Block id can either be number or hash)

* Introduce stacked filtering (#6273)

* Introduce stacked filtering.

* Benchmarks

* Remove unneeded crates

* Fix proxy type's permissiveness checks.

* Repot multisig to make utility stateless.

* Repot filter stack impl into macro

* Fix wasm build

* Tests

* Final test.

* Tests for the macro

* Fix test

* Line width

* Fix

* Update frame/multisig/src/benchmarking.rs

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

* Update primitives/std/with_std.rs

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

* Grumble

* Update frame/support/src/traits.rs

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

* Update frame/support/src/traits.rs

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

* Update frame/support/src/traits.rs

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

* Update frame/support/src/traits.rs

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

* Update frame/support/src/traits.rs

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

* Update frame/multisig/src/tests.rs

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

* Update frame/multisig/src/tests.rs

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

* Grumble

* Migration

* Grumble

* Comments

* Migration

* Fix

* Fix

* Line width

* Allow unused

* Update frame/multisig/src/lib.rs

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

* Fix up grumble.

* Remove Utility constraint in NonTransfer

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>

* client/api: fix possible deadlock when comparing with itself (#6277)

* Make all features explicit (#6267)

* make all features explicit

* Change to -feature suffix to with- prefix

* Add newline at the end of the Cargo.toml file

* Remove rhd feature

* Remove some features from Cargo.toml

* Remove test-helpers feature in tx pool

* Return db_open_error("with-"..

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

* Rename subdb feature to with-subdb

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

* Remove 'strict' feature and cfg_attr

* Check for with-subdb feature instead of subdb

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

* Use Subscription Manager from `jsonrpc-pubsub`: The Sequel (#6254)

* Bump jsonrpc pubsub, core, http, and ws

Right now these are the packages which _need_ to be updated
so I can just the latest `jsonrpc-pubsub` code. Once a release
it cut upstream the rest of the dependencies should be updated
as well.

* Use jsonrpc-pubsub's SubscriptionManager

This places sc-rpc-api::Subscriptions

* Bump jsonrpc-core outside of sc-rpc-*

* Update client/rpc tests

Right now one of the `author` tests is failing, I
need to think a bit about how best to fix it.

* Remove Subscriptions manager

There's no need for this implementation since we're
using the one from `jsonrpc-pubsub` now

* Fix author RPC test

This test used to check for a numerial subscription ID,
whereas now it uses a string based ID which is the default
provided by `jsonrpc-pubsub`'s subscription manager.

* Remove unused NumericIdProvider

* Add missing bracket

Removed one too many with that last one, lol

* Bump `jsonrpc` to v14.2

There's an exception though. `jsonrpc-derive` cannot be bumped
past v14.0.5 just yet since it has a dependency on `quote` pinned
to v1.0.1. This means that at the moment it won't build on Substrate
since it's using v1.0.3.

* Track `jsonrpc-derive` master branch

* Bump `quote` version to v1.0.6

* Bump `jsonrpc-derive` to v14.2.1

This includes support for `quote` v1.0.6

* Use exact version for jsonrpc crates

Doing this to make sure any updates in jsonrpc don't
accidently trickle down to Polkadot.

Co-authored-by: André Silva <andre.beat@gmail.com>

* Temporary and Heavy Weights for Society Pallet (#6283)

* temporary weights for society

* on_initialize weight

* Weights for Indices Pallet (#6282)

* fix multisig benchmarking

* add indices benchmarks

* fix compile

* Weights for indices

* setting to rc3

* adding Changelog

* adjust type imports and remove test

* Assign unique storage names to pallets. (#5010)

* Assign unique storage names to pallets.

* Bump spec

* Upgrade logic for finality tracker (untested)

* Logic for migrating Identity (untested)

* Logic for migrating transaction-payment

* Fix tests

* Fix `decl_storage` build

* Contract -> Contracts

* Update Cargo.lock

* bump spec

* update migration

* Fix merge error

* Migration for contracts

* Remove serde

* Remove some illegal spaces and Options

* Fix types in identity.

* Minor variable rename

Co-authored-by: Gavin Wood <gavin@parity.io>

* add weights to runtime migrations

* use max block weight for balances migration

* temporarily remove failing contracts migration

* add more logging for migrations

* fix transaction-payment migration by converting multiplier type

* add more logging to balance migration

* more balance migration logging

* format balance migration

* even more balance migration logging

* remove logging in loop and change upgrade flag type to bool

* cherry-pick #5226 (dd97b1478b31a4715df7e88a5ebc6664425fb6c6)

massage the code and fix anything failing compilation

* use test accounts for account migration

* move balances and accounts migrations out for custom calling

* make migration mods public

* fix transaction-payment migration based on https://github.com/paritytech/substrate/pull/5673

* Drew.merge upstream (#9)

* Fix typo: eror -> error (#6293)

* Fix typo: PRORITY -> PRIORITY (#6291)

* Intent to release rc3 (#6290)

* Fix transaction pool & network issues (#6288)

* fix & tweaks

* address review

* line width

* Use `sign_with` for signing grandpa's outgoing message (#6178)

* Use sign_with and stop using `Pair`

* PR feedback

* Remove clone

* Transfer ownership of public to sign_message

* Use Option

* Simplify code

* Fix error message

* Pass keystore as ref

* Pass keystore properly

* Fix tests

* Revalidation tweak & logging for transaction pool (#6258)

* updates and logging

* fix length

* Update client/transaction-pool/src/lib.rs

* rename

* Update client/transaction-pool/src/lib.rs

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

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

* Update README.md

* Allow adding a prefix to the informant (#6174)

* Initial commit

Forked at: 49b15615184fad010749d3e34282f70a3845da34
Parent branch: origin/master

* Add a Service Configuration's field + adapt informant + provide means to CLI

* CLEANUP

Forked at: 49b15615184fad010749d3e34282f70a3845da34
Parent branch: origin/master

* fix tests

* fixed bad path to object

* Change OutputFormat enum to struct

* Add informant_prefix to builder and service

* Revert "Change OutputFormat enum to struct"

This reverts commit cd86c583c92668426c35cc174401155bf2880c1f.

* Revert "fix tests"

This reverts commit a3c306ebe94720f350c5bc74b9c5fcde2565d340.

* Revert "Add a Service Configuration's field + adapt informant + provide means to CLI"

This reverts commit 9c2e7267423305705916c30d605893524113c8e3.

* Implementation using the ServiceBuilder

* reduce line length

* fix line width again

* WIP

Forked at: 49b15615184fad010749d3e34282f70a3845da34
Parent branch: origin/master

* WIP

Forked at: 49b15615184fad010749d3e34282f70a3845da34
Parent branch: origin/master

* WIP

Forked at: 49b15615184fad010749d3e34282f70a3845da34
Parent branch: origin/master

* use struct instead of enum

* WIP

Forked at: 49b15615184fad010749d3e34282f70a3845da34
Parent branch: origin/master

* Update client/service/src/lib.rs

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

* improve doc

* Update client/service/src/builder.rs

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

* Update client/service/src/builder.rs

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

* change code

* Update client/informant/src/lib.rs

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

* enable_color

* reorg log

* remove macro

* Removed builder for informant prefix

* fix doc

* Update client/informant/src/lib.rs

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

* Update client/informant/src/lib.rs

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

* Update client/informant/src/lib.rs

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

* Update client/informant/src/lib.rs

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

* Update client/service/src/builder.rs

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

* Update client/service/src/builder.rs

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

* Update client/service/src/builder.rs

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

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

* Transaction pool added missed comment (#6308)

* Add a test for lots of nodes connecting at the same time (#6247)

* Add a test for lots of nodes connecting at the same time

* Do small change

* Introduce frozen indices. (#6307)

* Introduce frozen indices.

* Fix.

* Bump runtime

* Benchmark for freeze

* Fix

* fix benchmarks

* update freeze weights

* remove copy pasta

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

* new crate sc-light (#6235)

* sc-light

* re…
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-please_review Pull request needs code review. B0-silent Changes should not be mentioned in any release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants