* Ensure that we inform all tasks to stop before starting the 60 seconds shutdown
The change of waiting in maximum 60 seconds for the node to shutdown actually introduced a bug. We
were actually waiting always 60 seconds as we didn't informed our tasks to shutdown. The solution to
this problem is to drop the task manager as this will then inform all tasks to end. It also adds
tests to ensure that the behaviors work as expected. (This should already have been done in the
first pr! :()
* ".git/.scripts/fmt.sh" 1
Co-authored-by: command-bot <>
* Move import queue out of `sc-network`
Add supplementary asynchronous API for the import queue which means
it can be run as an independent task and communicated with through
the `ImportQueueService`.
This commit removes removes block and justification imports from
`sc-network` and provides `ChainSync` with a handle to import queue so
it can import blocks and justifications. Polling of the import queue is
moved complete out of `sc-network` and `sc_consensus::Link` is
implemented for `ChainSyncInterfaceHandled` so the import queue
can still influence the syncing process.
* Fix tests
* Apply review comments
* Apply suggestions from code review
Co-authored-by: Bastian Köcher <git@kchr.de>
* Update client/network/sync/src/lib.rs
Co-authored-by: Bastian Köcher <git@kchr.de>
Co-authored-by: Bastian Köcher <git@kchr.de>
* zombinet tests: add some timeout to allow net spin-up
Sometimes tests are failing at first try, as the pods were not up yet.
Adding timeout should allow the network to spin up properly.
* initial timeout increased to 30s
* Don't indefinitely on shutting down Tokio
Now we wait in maximum 60 seconds before we shutdown the node. Tasks are may be leaked and leading
to some data corruption.
* Drink less :thinking_face:
* cli: Improve pruning documentation
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* cli: Keep `finalized` notation and remove `canonical` one
* cli: Fix cargo doc
* cli: `PruningModeClap` IR enum
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* cli: Convert PruningModeClap into pruning modes
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* cli: Use `PruningModeClap`
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* cli: Rename to `DatabasePruningMode`
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* cli: Implement `FromStr` instead of `clap::ValueEnum`
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* Update client/cli/src/params/pruning_params.rs
Co-authored-by: Bastian Köcher <git@kchr.de>
* Fix clippy
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* cli: Add option documentation back
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* Apply suggestions from code review
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Co-authored-by: Bastian Köcher <git@kchr.de>
* zombienet: warp-sync integration test added
* spelling
* Readme corrected
* dir name updated
* Check second phase of warp sync
* zombienet pipeline enable + naive test network
* zombienet stage added
* paritypr/substrate-debug image added for zombienet testing
* debugs added
* debugs added
* buildah problem fixed
* rollback
* runner tag
* test name corrected
* dir renamed (regex problem)
* common code clean up
* common code clean up
* fix
* warp sync test improvements
* full sha used
as short is too short (https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/2051228#L38)
* disable tracing for nodes
* COMMON_USER -> DOCKERIO_USER
* refs reworked
* paritypr/substrate image used
* DOCKERIO -> DOCKER
* generate-ws-db toml cleanup
* improvements
* fix
* raw chain spec used
* zombienet v1.3.18 used
* zombienet: warp sync test enabled
* chain-spec path corrected
* log parsing improved
Checking if log does not container error or verification failed messages
* warp sync test: removed validators
* fix
* review remarks applied
* dir test name changed: 0000_block_building -> 0000-block-building
* transaction finalized test added
* transaction finalized test: error handling improved
* trigger CI job
* trigger CI job
* trigger CI job
* trigger CI job
* Explicitly touch `version.rs` to invalidate the related cache
* zombienet add logs as artifacts
* Revert "Explicitly touch `version.rs` to invalidate the related cache"
This reverts commit 9d00ccfe897a280581156c281961a32665dba6d5.
* file naming changed
Co-authored-by: parity-processbot <>
Co-authored-by: Vladimir Istyufeev <vladimir@parity.io>
Co-authored-by: Javier Viola <javier@parity.io>
* implement crate publishing from CI
* fix indentation
* use resource_group for job exclusivity
ensure that at most one instance of the publish-crates job is running at any given time to prevent race conditions
* correct publish = false
* Remove YAML anchors as GitLab's `extends:` doesn't need it
* Temporarily force cache upload for the new jobs
* Revert `RUSTY_CACHIER_FORCE_UPLOAD`
* pin libp2p-tcp=0.37.0 for sc-telemetry
* Revert "pin libp2p-tcp=0.37.0 for sc-telemetry"
This reverts commit 29146bfad6c31e8cf0e2f17ad92a71bb81a373af.
* always collect generated crates
* increase timeout for publish-crates-template
* Force upload the new job cache again
* Revert "Force upload the new job cache again"
This reverts commit 5a5feee1b2c51fdef768b25a76be4c3949ec1c99.
* reformat
* improve timeout explanation
* s/usual/average
Co-authored-by: Vladimir Istyufeev <vladimir@parity.io>
client/mmr: persisting gadget state across runs
Fixes#12780
* client/mmr: on init do canonicalization catch-up
* client/mmr: add more tests
* client/mmr: persist gadget progress in aux db
* client/mmr: add more tests
* client/mmr: replace async_std with tokio
* remove leftover comment
* address review comments
Signed-off-by: acatangiu <adrian@parity.io>
* frame-support: Introduce `EnsureOriginOrHigherPrivilege`
This adds a new `EnsureOrigin` implementation that checks if a given origin matches or if the origin
is has a higher or equal origin matches or if the origin is has a higher or equal privilege.
* FMT
* Add per local weight for function call
* ".git/.scripts/bench-bot.sh" pallet dev pallet_contracts
* Update frame/contracts/src/benchmarking/mod.rs
Co-authored-by: Alexander Theißen <alex.theissen@me.com>
* apply suggestions from code review
* ".git/.scripts/bench-bot.sh" pallet dev pallet_contracts
* Update frame/contracts/src/benchmarking/mod.rs
Co-authored-by: Alexander Theißen <alex.theissen@me.com>
* tune the benchmark
* ".git/.scripts/bench-bot.sh" pallet dev pallet_contracts
* fix benches
* ".git/.scripts/bench-bot.sh" pallet dev pallet_contracts
Co-authored-by: command-bot <>
Co-authored-by: Alexander Theißen <alex.theissen@me.com>
Introduce bounds on the justifications and votes queues, so they do not grow forever if voter cannot make progress and consume from them. When bounds are hit, new votes or justifications get dropped.
* use a BTreeMap and check for bounds
* cargo fmt
* use usize
Co-authored-by: Adrian Catangiu <adrian@parity.io>
* pallet-balances: Fix inactive funds migration
Fixes the inactive funds migration. It was missing to set the `storage_version` attribute for the
`Pallet` struct. Besides that it also removes the old `StorageVersion` representation and adds support
for instances of pallet-balances.
* Fix test
* Replace deprecated libp2p feature specs with correct ones
* Bump tokio to 1.21.2
* Replace async-std libp2p primitives with tokio ones
* minor: rustfmt
* Fix TestNet to run initialization in the tokio context
* Convert telemetry test from async-std to tokio
* Convert notifications tests from async-std to tokio
* Convert chain sync tests from async-std to tokio
* Ditch async-std completely
* Make executor mandatory
* Bump tokio to 1.22.0
* minor: rustfmt
* Explicitly use tokio runtime in tests
* Move more tests to explicit tokio runtime
* Explicitly set multithreaded runtime in tokio test
* minor: rustfmt
* minor: fix comment
* Replace async-std with tokio in MMR tests
* frame-executive: Reject invalid inherents in the executive
We already had support for making a block fail if an inherent returned, but it was part of the
signed extension `CheckWeight`. Rejecting blocks with invalid inherents should happen on the
`frame-executive` level without requiring any special signed extension. This is crucial to prevent
any kind of spamming of the network that could may happen with blocks that include failing inherents.
* FMT
* Update frame/executive/src/lib.rs
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
* Update primitives/runtime/src/transaction_validity.rs
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
Co-authored-by: parity-processbot <>
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
* Move create_inherent_data call to use side
* Make provide_inherent_data async
* Fix tests
* Apply suggestions from code review
Co-authored-by: Bastian Köcher <git@kchr.de>
* Log errors
* Fix test
* Fix test
* fix
* Deduplicate test code
* fix
* flag
* Update client/consensus/slots/src/lib.rs
Co-authored-by: Bastian Köcher <git@kchr.de>
* Revert "Deduplicate test code"
This reverts commit ba46adbe089329c78cd69ccdb08e27ed67bd77cf.
* Fix test
* remove commented out code
* minor to start CI run
* start CI
* Update client/consensus/slots/src/lib.rs
Co-authored-by: Marcin S. <marcin@bytedude.com>
* Apply PR suggestions
* Apply PR suggestions
* Update client/consensus/slots/src/lib.rs
Co-authored-by: Bastian Köcher <git@kchr.de>
* minor
* kickoff CI
* PR suggestions
* Compute remaining duration instead of using slot_info.duration
* Don't rely on sub implementation for Instant
* Apply PR suggestions
* Use saturating_duration_since
Co-authored-by: Bastian Köcher <git@kchr.de>
Co-authored-by: Marcin S. <marcin@bytedude.com>
Co-authored-by: parity-processbot <>
* Remove Default, HasCompact, and TypeInfo trait bounds on AssetId
* don't use default in benchmarking
* add helper trait
* add helper to assets tx payment test
* docs fixes
* i'm confused
* aha, cargo
* move affected dispatchable calls into new indices
* Helper -> BenchmarkHelper
* benchmark use of helper
* actually, don't break every call interface
* use into on AssetIdParameter
* Remove From from AssetIdParameter and use it in BenchmarkHelper
* include from
Co-authored-by: parity-processbot <>
* client/beefy: fix on-demand justif sync for old blocks
When receiving BEEFY justifications for old blocks the state might
be pruned for them, in which case justification verification fails
because BEEFY validator set cannot be retrieved from runtime state.
Fix this by having the voter give the validator set to the
`OnDemandJustificationsEngine` as request information. On receiving
a BEEFY justification for requested block, the provided validator
set will be used to validate the justification.
Signed-off-by: acatangiu <adrian@parity.io>
* Apply suggestions from code review
Co-authored-by: Bastian Köcher <git@kchr.de>
* impl review suggestions
* client/beefy: fail initialization if state unavailable
* beefy: remove spammy log
Signed-off-by: acatangiu <adrian@parity.io>
Co-authored-by: parity-processbot <>
Co-authored-by: Bastian Köcher <git@kchr.de>
* ed25519_verify: Support using dalek for historical blocks
The switch from `ed25519-dalek` to `ed25519-zebra` was actually a breaking change. `ed25519-zebra`
is more permissive. To support historical blocks when syncing a chain this pull request introduces
an externalities extension `UseDalekExt`. This extension is just used as a signaling mechanism to
`ed25519_verify` to use `ed25519-dalek` when it is present. Together with `ExtensionBeforeBlock` it
can be used to setup a node in way to sync historical blocks that require `ed25519-dalek`, because
they included a transaction that verified differently as when using `ed25519-zebra`.
This feature can be enabled in the following way. In the chain service file, directly after the
client is created, the following code should be added:
```
use sc_client_api::ExecutorProvider;
client.execution_extensions().set_extensions_factory(
sc_client_api::execution_extensions::ExtensionBeforeBlock::<Block, sp_io::UseDalekExt>::new(BLOCK_NUMBER_UNTIL_DALEK_SHOULD_BE_USED)
);
```
* Fix doc
* More fixes
* Update client/api/src/execution_extensions.rs
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
* Fix merge and warning
* Fix docs
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>