Commit Graph

2155 Commits

Author SHA1 Message Date
Bastian Köcher d124c90734 sc-tracing: Only print events for whitelisted targets (#14487)
* sc-tracing: Only print events for whitelisted targets

We should only print events for whitelisted targets, otherwise we may run into some stack overflow
while printing the event.

* Update client/tracing/src/lib.rs

Co-authored-by: Koute <koute@users.noreply.github.com>

* Fix

---------

Co-authored-by: Koute <koute@users.noreply.github.com>
2023-07-03 09:47:42 +00:00
Bastian Köcher 83caca85b6 frame-benchmarking-cli: Remove native dispatch requirement (#14474)
* frame-benchmarking-cli: Remove native dispatch requirement

No need for this, we can just use the `WasmExecutor` directly.

* Fixes

* Pass benchmarking host functions

* Ensure we can pass custom host functions
2023-06-29 17:56:25 +02:00
Aaro Altonen 0e58bd91b6 Inject FromSwarm::NewListenAddr to mDNS (#14478) 2023-06-29 17:28:32 +02:00
Nazar Mokrynskyi ff7e8b6b17 Unify SyncMode data structures under one (#14465) 2023-06-29 17:25:41 +02:00
Bastian Köcher b4e863c472 sc-network: Improve invalid boot node reporting (#14455)
This improves the reporting of invalid boot nodes. First, it will only report each boot node once
as invalid and not every time we try to connect to the node. Second, the node will only report for
addresses that we added as startup and not for addresses of the boot node that the node learned from
other nodes.

Closes: https://github.com/paritytech/substrate/issues/13584
Closes: https://github.com/paritytech/polkadot/issues/7385
2023-06-28 13:21:05 +02:00
Sebastian Kunert ede49c7ae6 Remove unused dependencies (#14464) 2023-06-27 13:33:42 +00:00
Davide Galassi 13cb7ccc57 Added missing BLS feature (#14461) 2023-06-26 19:10:16 +02:00
Squirrel 0750b03300 once_cell in std from 1.70 (#14402)
* once_cell now stable

* cargo fmt

---------

Co-authored-by: parity-processbot <>
2023-06-24 06:45:28 +00:00
Dmitry Markin 7d4fd6a442 [minor] Extend logging with SetId in ProtocolController where missing (#14433) 2023-06-22 15:23:21 +03:00
klbrvik 1d2f16ab1f expose setting kademlia replication factor through node CLI (#14391)
* expose kademlia replication factor through node CLI

* set default CLI flag value for kademlia_replication_factor

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

* wrap CLI value as Option

* make kademlia replication factor non-optional

---------

Co-authored-by: Bastian Köcher <git@kchr.de>
2023-06-22 00:21:54 +02:00
Koute 9d1741eb3c Bump parity-scale-codec to 3.6.1 (#14428) 2023-06-21 11:37:11 +00:00
Oliver Tale-Yazdi 05592a84eb Refactor BlockBuilder::propose_with (#14405)
* Add log target

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Factor out apply_inherents

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Factor out apply_extrinsics

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Factor out print_summary

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Pimp print_summary

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Cleanup

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Fixes

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

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

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

---------

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Bastian Köcher <git@kchr.de>
2023-06-19 10:12:43 +00:00
Dmitry Markin 4652eaeef8 [network] Extend Notifications logs with SetId where missing (#14406)
* Extend `Notifications` logs with `SetId` where missing

* Downgrade "Ignoring request to disconnect reserved peer"

* minor: log formatting
2023-06-16 17:01:26 +00:00
Adrian Catangiu 4311411133 sc-consensus-beefy: fix flaky test beefy_reports_equivocations (#14382)
Test was using too small a timeout of 250ms to verify equivocation is reported.

If the test machine is loaded with many async tasks running, the voters work
and subsequent gossiping does not fit within the 250ms window.

Do multiple tries to verify equivocation reporting with exponential timeouts,
most times it will be within 250ms, but the test will retry several times up
to 5seconds total before giving up.

Signed-off-by: Adrian Catangiu <adrian@parity.io>
2023-06-16 10:00:11 +03:00
Anton 6cd2c8b395 [frame/im-online] remove network state from heartbeats (#14251)
* [frame/im-online] remove `external_addresses` from heartbeats

Users should use DHT for discovering new nodes. The reason for adding external addresses was
unstable work of authority discovery (see https://github.com/paritytech/substrate/issues/2719),
which is now stable. Hence we can safely remove `external_addresses`.

Refs https://github.com/paritytech/polkadot/issues/7181

* remove unused import

* run benchmark

* remove external_addresses from offchain NetworkState

* add missing fn to TestNetwork

* Revert "run benchmark"

This reverts commit a282042c2d6bf8bae2c383f6e2699c3fe2970a3d.

* update weights

* address @bkchr comments

* remove duplicate fn

* cleanup benchmarking.rs

* fix executor tests

* remove peer_id from hearbeat as well

https://github.com/paritytech/substrate/pull/14251#discussion_r1210887220

* remove MaxPeerDataEncodingSize

* change storage value type to `()`

https://github.com/paritytech/substrate/pull/14251#discussion_r1214268931

* scaffold storage migration

* no need to check the type actually

* remove unnecessary types from v0 mod

* add a test for migration

* expose Config types

+ pre_upgrade and post_upgrade working fn

* fix test

* replace dummy type with ConstU32

* add some comments to migration test

* fix comment

* respond to @bkchr comments

* use BoundedOpaqueNetworkState::default

intead of using default for each field
2023-06-15 09:42:36 +00:00
Bastian Köcher 1eb3b31ad0 sc-executor-wasmtime: Do not use absolute path to Cargo.toml in test (#14370)
* sc-executor-wasmtime: Do not use absolute path to `Cargo.toml` in test

As the test is executed inside the workspace, `cargo metadata` will automatically detect the correct
`Cargo.toml`. This is required for the mono repo.

* ".git/.scripts/commands/fmt/fmt.sh"

---------

Co-authored-by: command-bot <>
2023-06-13 21:14:53 +02:00
dependabot[bot] 11cf3e0b10 Bump hyper-rustls from 0.23.2 to 0.24.0 (#14233)
Bumps [hyper-rustls](https://github.com/ctz/hyper-rustls) from 0.23.2 to 0.24.0.
- [Commits](https://github.com/ctz/hyper-rustls/compare/v/0.23.2...v/0.24.0)

---
updated-dependencies:
- dependency-name: hyper-rustls
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: parity-processbot <>
2023-06-13 13:27:47 +00:00
Squirrel cadc92b893 fix new warning in nightly (#14334)
* fix new warning

* Too soon

* Explicitly import
2023-06-13 09:36:54 +02:00
Arkadiy Paronyan 881fd1e0dc Fix RPC error code conflict (#14315)
* Base error code module

* Base error code module

* fmt
2023-06-09 18:24:49 +02:00
yjh ddb46a8aa0 refactor: define trait HashOutput for some Hash associate type (#14220)
* define trait `HashOutput`

* improve

* improve

* Update primitives/runtime/src/traits.rs

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

* remove `Block::Hash: Ord`

* fmt

* add `MaybeFromStr`

* cleanup

* fix

* remove useless `HashOutput`

---------

Co-authored-by: Bastian Köcher <git@kchr.de>
2023-06-08 02:02:13 +00:00
Davide Galassi b14238cb7d Finalized should be before best (#14308)
* Finalized block should not be after best block

* Remove unwrap

* Apply code review suggestion

Co-authored-by: Koute <koute@users.noreply.github.com>

* Add test

---------

Co-authored-by: Koute <koute@users.noreply.github.com>
2023-06-07 11:17:45 +02:00
Bastian Köcher 51c87d8525 sc-transaction-pool: Always use best block to check if we should skip enactment (#14285)
We will calculate the tree route always against the best block and thus, we also should use this one
to check if we should skip the checks.
2023-06-02 19:37:35 +01:00
Dmitry Markin 186423b695 Reduce logging verbosity when disconnecting an unknown peer (#14274) 2023-06-01 12:53:52 +03:00
dependabot[bot] 688ac3d1c7 Bump serde from 1.0.162 to 1.0.163 (#14271)
* Bump serde from 1.0.162 to 1.0.163

Bumps [serde](https://github.com/serde-rs/serde) from 1.0.162 to 1.0.163.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.162...v1.0.163)

---
updated-dependencies:
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* bump ci

* bump ci for cumulus

* bump ci again

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sam Johnson <sam@durosoft.com>
2023-05-31 17:10:00 +00:00
Liu-Cheng Xu 968795db28 Expose build_system_rpc_future and TransactionPoolAdapator in sc-service (#14238)
* Make block sync service customizable

This change allows user to have their own network block logic, for example, we'd like to disable
the builtin block sync service when using another syncing approach.

* Remove unnecessary Box

* Revert network_block

* Expose build_system_rpc_future() and TransactionPoolAdaptor

* fmt
2023-05-31 15:27:06 +01:00
Alexandru Vasile 3da9449067 Bump sp-crates from latest crates.io version + release (#14265)
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
2023-05-31 12:11:01 +00:00
Bastian Köcher 00e5ecdcf7 Make offchain tx pool creation reusable (#14230)
* Make offchain tx pool creation reusable

Introduces an `OffchainTransactionPoolFactory` for creating offchain transactions pools that can be
registered in the runtime externalities context. This factory will be required for a later pr to
make the creation of offchain transaction pools easier.

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

Co-authored-by: Anton <anton.kalyaev@gmail.com>

---------

Co-authored-by: Anton <anton.kalyaev@gmail.com>
2023-05-31 01:12:53 +00:00
dependabot[bot] a8edaf47d5 Bump quote from 1.0.27 to 1.0.28 (#14253)
* Bump quote from 1.0.27 to 1.0.28

Bumps [quote](https://github.com/dtolnay/quote) from 1.0.27 to 1.0.28.
- [Release notes](https://github.com/dtolnay/quote/releases)
- [Commits](https://github.com/dtolnay/quote/compare/1.0.27...1.0.28)

---
updated-dependencies:
- dependency-name: quote
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* bump ci

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sam Johnson <sam@durosoft.com>
2023-05-29 18:13:48 +00:00
Dmitry Markin d4b2bf7394 Incorporate sc-peerset into sc-network (#14236) 2023-05-29 20:56:57 +03:00
Alexandru Vasile 98a0550ea2 Release: Bump SP crates to release on crates.io (#14237)
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
2023-05-29 10:40:59 +00:00
Dmitry Markin ee3f2e1ebd minor: fix misleading comment in Notifications (#14239) 2023-05-29 13:16:49 +03:00
Bastian Köcher 6947b334b4 wasm-builder: Enforce runtime_version wasm section (#14228)
* wasm-builder: Enforce `runtime_version` wasm section

This pr changes the `wasm-builder` to enforce the `runtime_version` wasm section. This wasm section
is being created by the `sp_version::runtime_version` attribute macro. This attribute macro now
exists since quite some time and `runtime_version` also is the only way for parachains to support
reading the `RuntimeVersion` from the runtime.

\# Disabling the check

By default the `WasmBuilder` will now check for this wasm section and if not found, exit with an
error. However, there are situations where you may want to disable this check (like for tests). In
this case there exists the `disable_runtime_version_section_check` function.

```
WasmBuilder::new()
   ...
   ...
   ...
   .disable_runtime_version_section_check()
   .build()
```

By using this method you get back the old behavior.

* Review comment

* Fix

* Fix issue with `enum-as-inner`
2023-05-28 23:52:10 +00:00
dependabot[bot] 5402212358 Bump lru from 0.8.1 to 0.10.0 (#14211)
Bumps [lru](https://github.com/jeromefroe/lru-rs) from 0.8.1 to 0.10.0.
- [Changelog](https://github.com/jeromefroe/lru-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/jeromefroe/lru-rs/compare/0.8.1...0.10.0)

---
updated-dependencies:
- dependency-name: lru
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-28 13:17:10 +00:00
Alexandru Vasile ed499bdec1 chain_head: Rename runtimeUpdates flag to withRuntime (#14244)
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
2023-05-27 22:13:00 +02:00
Aaro Altonen 7b10153633 Don't start evicting peers right after SyncingEngine is started (#14216)
* Don't start evicting peers right after `SyncingEngine` is started

Parachain collators may need to wait to receive a relaychain block before
they can start producing blocks which can cause `SyncingEngine` to
incorrectly evict them.

When `SyncingEngine` is started, wait 2 minutes before the eviction is
activated to give collators a chance to produce a block.

* fix doc

* Use `continue` instead of `break`

* Trigger CI

---------

Co-authored-by: parity-processbot <>
2023-05-25 17:23:40 +03:00
Adrian Catangiu b907f52066 sc-consensus-beefy: graceful support for pallet-beefy reset (#14217)
BEEFY consensus can be restarted by resetting "genesisBlock" in
pallet-beefy, but we don't want to also reset authority set IDs so
that they are uniquely identified across the entire chain history
regardless of how many times BEEFY consensus has been reset/restarted.

This is why the client now also accepts initial authority_set_id != 0.

BEEFY client now detects pallet-beefy reset/reinit and errors-out and
asks for a restart.
BEEFY client persisted state should be discarded on client restarts
following pallet-beefy reset/reinit.

End result is BEEFY client/voter can now completely reinitialize using
"new" on-chain info following pallet-beefy reset/reinit, discarding old state.

Fixes #14203
Fixes #14204

Signed-off-by: acatangiu <adrian@parity.io>
2023-05-25 15:16:37 +03:00
zdave 7e8bfb7f55 Get rid of some pointless pin_project stuff (#14212) 2023-05-25 11:53:04 +01:00
Bastian Köcher 05da6d8e84 HoldReason: Improve usage (#13869)
* HoldReason: Improve usage

`HoldReason` was switched recently to use the `composite_enum` attribute that will merge the enums
from all pallets in the runtime to `RuntimeHoldReason`. `pallet-nis` was still requiring that the
variant was passed as constant to call `hold`. The proper implementation is to use the `HoldReason`
from inside the pallet directly when calling `hold`. This is done by adding a `RuntimeHoldReason` as
type to the `Config` trait and requiring that `Currency` is using the same reason. Besides that the
pr changes the name `HoldIdentifier` in `pallet_balances::Config` to `RuntimeHoldReason`.

* Update frame/nis/src/lib.rs

Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Review comment

* Fixes

---------

Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
2023-05-24 21:59:34 +00:00
Dmitry Markin db90f3b622 Replace request-response incoming requests queue with async-channel (#14199) 2023-05-24 09:24:09 +00:00
André Silva 4766ec5531 sc-client-db: add test for reverting finalized blocks (#14205) 2023-05-24 09:09:03 +00:00
Alexandru Vasile b73b698980 wasm: Update from v6.0.2 to v8.0.1 (#14178)
* wasm: Update from v6.0.2 to v8.0.1

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* Fix rustix version

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

---------

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
2023-05-24 09:08:21 +00:00
yjh b6a2948461 Remove wasmi backend from sc-executor (#13800)
* refactor: use builder api for all executors

* improve a lot

* remove unused args

* cleanup deps

* fix inconsistency about heap alloc

* add `heap_pages` back to try-runtime

* fix

* chore: reduce duplicated code for sc-service-test

* cleanup code

* fmt

* improve test executor

* improve

* use #[deprecated]

* set runtime_cache_size: 4

* wip

* fix and improve

* remove sc-executor-wasmi deps

* clean up bench and tests

* delete "client/executor/wasmi"

* cleanup

* refactor builder

* fix

* fix bench

* fix tests

* fix warnings

* fix warnings

* fix

* fix

* remove wasmi and fix tests

* unused imports

* improve by suggestions

* Update client/cli/src/arg_enums.rs

---------

Co-authored-by: Bastian Köcher <git@kchr.de>
Co-authored-by: parity-processbot <>
2023-05-23 17:31:45 +02:00
Squirrel ea21a495f8 Easy PR: Fix warnings from latest nightly (#14195)
* unneeded mut

* remove needless borrows
2023-05-23 17:06:48 +02:00
dependabot[bot] acadc6d147 Bump syn from 2.0.15 to 2.0.16 (#14196)
Bumps [syn](https://github.com/dtolnay/syn) from 2.0.15 to 2.0.16.
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/2.0.15...2.0.16)

---
updated-dependencies:
- dependency-name: syn
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-23 15:55:41 +02:00
Dmitry Markin 01107e9ca5 Split Peerset into PeerStore & ProtocolControllers (#13611) 2023-05-23 14:49:02 +03:00
Bastian Köcher 918d1ef80d WarpSync: Show number of required peers in informant (#14190)
This makes it for the user more obvious on what we are waiting and not just "waiting for peers".
2023-05-22 22:23:10 +02:00
Marcin S 2decceef76 Executor: Add create_runtime_from_artifact_bytes (#14184) 2023-05-22 11:43:51 -04:00
Bastian Köcher 110a4a56db RevertCmd: Expose database params via CLI (#14182)
* RevertCmd: Expose database params via CLI

This exposes the database params for the `RevertCmd` via CLI. So, users can use `revert` with ParityDb.

* ".git/.scripts/commands/fmt/fmt.sh"

---------

Co-authored-by: command-bot <>
2023-05-21 22:24:04 +02:00
dependabot[bot] 6b15ef1307 Bump tower-http from 0.3.5 to 0.4.0 (#14128)
Bumps [tower-http](https://github.com/tower-rs/tower-http) from 0.3.5 to 0.4.0.
- [Release notes](https://github.com/tower-rs/tower-http/releases)
- [Commits](https://github.com/tower-rs/tower-http/compare/tower-http-0.3.5...tower-http-0.4.0)

---
updated-dependencies:
- dependency-name: tower-http
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-16 08:18:13 +00:00
klbrvik 2453e25fb8 expose transport, peer_info and discovery in sc-network (#14132)
* expose transport, peer_info and discovery in sc-network

* fix fmt

* add missing module docs
2023-05-15 21:45:19 +00:00