* Make peer evictions less aggressive
The original implementation of peer eviction prioritized aliveness over
connection stability which made the peer count unstable for some users.
As this may cause discomfort or infrastructure alerts if stability is
tracked, adjust the eviction to be less aggressive by only evicting
peers when the node has fully stalled. This causes the node to have some
peers who are inactive and won't send any block announcements.
These nodes are removed if the local node is able to receive at least
one block announcement from one of its peers as the inactivity of the
substream is detected when a notification is sent.
If the node won't send or receive any block annoucements for 30 seconds,
it's considered stalled and it will evict all peers,
causing `ProtocolController` to accept and establish connections from new
peers.
* Update client/network/sync/src/engine.rs
Co-authored-by: Dmitry Markin <dmitry@markin.tech>
* Track last send and received notification simultaneously
---------
Co-authored-by: Dmitry Markin <dmitry@markin.tech>
Co-authored-by: parity-processbot <>
* set MaxPermanentSlots and MaxTemporarySlots with a extrinsic instead of a constant
* delete the MaxPermanentSlots and MaxTemporarySlots constants from config on Rococo and Westend
* migration code for assigned slots
* remove getters
* little refactor
* set values in the GenesisConfig
* refactor in the migration, adding it in the rococo runtime
* refactor: fmt
* Minor fix
* pre_upgrade check
* add migration to mod v1
* Logs following Substrate#12873
* fix: current storage version set to 1
* use enact when try-runtime
* Vec seems to be missing
* feature gate import
* fix as per #13993
* address comments
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* address comments
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* benchmarking for assign_perm_parachain_slot extrinsic
* benchmark all the extrinsics of the pallet
* cargo fmt for assigned slots
* migration added for westend
* licence in benchmarking file
* BuildGenesisConfig
* assigned_slots default in genesis
* cargo fmt
* assigned_slots fix tests config
* cargo fmt
* fix benchmarking compile error
* fix benchmarking imports
* benchmark worst case scenario for validation code and head data
* add assigned_slots in frame_benchmarking on Rococo and Westend
* modify values for para_id in benchmarking
* delete the assigned_slots in westend frame_benchmarking
* fix benchmarkings and add it to westend
* cargo fmt
* ".git/.scripts/commands/bench/bench.sh" --subcommand=runtime --runtime=rococo --target_dir=polkadot --pallet=runtime_common::assigned_slots
* ".git/.scripts/commands/bench/bench.sh" --subcommand=runtime --runtime=westend --target_dir=polkadot --pallet=runtime_common::assigned_slots
* use generated weights in assigned_slots pallet
* small changes in set_max_permanent_slots and set_max_temporary_slots
* revert last commit
* address some comments
* wrap migration with VersionCheckedMigrateToV1
* add experimental feature in pallet, and assers in post_upgrade migration
* clean warnings
* clean unnecesary experimental flag
* small typo in comments
* cargo fmt
* small comments fixes
---------
Co-authored-by: al3mart <11448715+al3mart@users.noreply.github.com>
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: command-bot <>
* chainHead/api: Make storage/body/call pure RPC methods
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* chainHead: Add mpsc channel between RPC methods
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* chainHead/subscriptions: Extract mpsc::Sender via BlockGuard
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* chainHead/subscriptions: Generate and provide the method operation ID
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* chainHead: Generate `chainHead_body` response
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* chainHead: Generate `chainHead_call` response
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* chainHead: Generate `chainHead_storage` responses
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* chainHead: Propagate responses of methods to chainHead_follow
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* chainHead/tests: Adjust `chainHead_body` responses
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* chainHead/tests: Adjust `chainHead_call` responses
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* chainHead/tests: Adjust `chainHead_call` responses
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* chainHead/tests: Ensure unique operation IDs across methods
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* chainHead/events: Remove old method events
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* chainHead/subscriptions: Add limit helper
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* chainHead/subscription: Expose limits to `BlockGuard`
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* chainHead/tests: Adjust testing to ongoing operations
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* chainHead: Make limits configurable via `ChainHeadConfig`
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* chainHead/tests: Adjust testing to `ChainHeadConfig`
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* chainHead/tests: Ensure operation limits discards items
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* chainHead: Improve documentation
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* chainHead: Rename `OngoingOperations` -> `LimitOperations`
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* chainHead: Rename reserve -> reserve_at_most
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* chainHead: Use duration const instead of u64
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* chainHead/subscription: Use tokio::sync::Semaphore for limits
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* Update client/rpc-spec-v2/src/chain_head/subscription/inner.rs
Co-authored-by: Sebastian Kunert <skunert49@gmail.com>
---------
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Co-authored-by: parity-processbot <>
Co-authored-by: Sebastian Kunert <skunert49@gmail.com>
* Remove superflous parameter `overseer_enable_anyways`
We don't need this flag, as we don't need the overseer enabled when the
node isn't a collator or validator.
* Rename `IsCollator` to `IsParachainNode`
`IsParachainNode` is more expressive and also encapsulates the state of
the parachain node being a full node. Some functionality like the
overseer needs to run always when the node runs alongside a parachain
node. The parachain node needs the overseer to e.g. recover PoVs. Other
things like candidate validation or pvf checking are only required for
when the node is running as validator.
* FMT
* Fix CI
* feat: Add try_state for message_queue
* Update frame/message-queue/src/lib.rs
change if let to while let and modify bump_service_head function
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* feat: update try_state, add checks for storage
* fix: add try_state builder for remaining tests
* Update frame/message-queue/src/mock.rs
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* chore: assert statement to ensure
* Fix tests
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Use ensure instead of assert
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Fix function signature and feature gate
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Cleanup code
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
---------
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Juan <juangirini@gmail.com>
- Update some places where `cargo run` was used
- Add note to error messages about `cargo build` before `cargo run`
- Fix call to `cargo install` in readme
If authority discovery is not enabled, `Overseer` is not enabled,
meaning `NetworkBridge` is not started. Validation/collation protocols
are, however, enabled even if the `NetworkBridge` is not started.
Currently this results in normal Polkadot full nodes advertising these
protocols, accepting inbound substreams and even establishing outbound
substreams for the validation protocol. Since the `NetworkBridge` is
not started and no protocol in Substrate is interested in these
protocol events, the events are relayed to all protocol handlers but
are getting discarded because no installed protocol is interested in them.
Co-authored-by: parity-processbot <>
* pvf: use test-utils feature to export test only
* adding comment to test-utils feature
* make prepare-worker and execute-worker as optional dependencies and add comments to test-utils
* remove doc hidden from pvf testing
* add prepare worker and execute worker entrypoints to test-utils feature
* pvf: add sp_tracing as optional dependency of test-utils
* add test-utils for polkadot and malus
* add test-utils feature to prepare and execute workers script
* remove required features from prepare and executing
* Try to trigger CI again to fix broken jobs
---------
Co-authored-by: Marcin S <marcin@realemail.net>
* companion 14754: no-beefy flag moved to sc-cli
Signed-off-by: Adrian Catangiu <adrian@parity.io>
* bump substrate ref
Signed-off-by: Adrian Catangiu <adrian@parity.io>
* bump polkadot ref
---------
Signed-off-by: Adrian Catangiu <adrian@parity.io>
When BEEFY voter is initialized from scratch (no aux db persistent data present),
it needs to find BEEFY genesis block and all subsequent Mandatory blocks and
sync justifications for them.
The initialization code was getting active validator sets for these older blocks
from state, but in cases such as 'fast sync', state is unavailable.
This commit adds a fallback initialization mechanism when state is unavailable:
parse header Digests looking for validator set change log deposits.
Signed-off-by: Adrian Catangiu <adrian@parity.io>
* WIP
* Add missing checkout
* Add debuggin
* Fix VAR name
* Bug fix
* Rework jobs
* Revert "Rework jobs"
This reverts commit 2bfa79fd3ae633c17403b838f9a5025f0f7fc3f3.
* Add cache
* Add temp default for testing
* Add missing checkout
* Fix patch
* Comment out the GPG check for now
* Rename polkadot_injected_release into a more appropriate polkadot_injected_debian
* Refactoring / renaming
* Introduce a generic image for binary injection
* Flag files to be deleted and changes to be done
* WIP
* Fix multi binaries images
* Add test build scripts
* Remove old file, add polkadot build-injected script
* Fix doc
* Fix tagging
* Add build of the injected container
* Fix for docker
* Remove the need for TTY
* Handling container publishing
* Fix owner and registry
* Fix vars
* Fix repo
* Fix var naming
* Fix case when there is no tag
* Fix case with no tag
* Handle error
* Fix spacings
* Fix tags
* Remove unnecessary grep that may fail
* Add final check
* Clean up and introduce GPG check
* Add doc
* Add doc
* Update doc/docker.md
Co-authored-by: Mira Ressel <mira@parity.io>
* type
Co-authored-by: Mira Ressel <mira@parity.io>
* Fix used VAR
* Improve doc
* ci: Update .build-push-image jobs to use the new build-injected.sh
* ci: fix path to build-injected.sh script
* Rename the release artifacts folder to prevent confusion due to a similar folder in the gitlab CI
* ci: check out polkadot repo in .build-push-image
This seems far cleaner than copying the entire scripts/ folder into our
job artifacts.
* feat(build-injected.sh): make PROJECT_ROOT configurable
This lets us avoid a dependency on git in our CI image.
* ci: build injected images with buildah
* ci: pass full image names to zombienet
* Add missing ignore
---------
Co-authored-by: Mira Ressel <mira@parity.io>
* Allow functions to work over both parachains and relay chains
* additional references
* import
* backup
* refactoring para and relay traits
* use runtime crates to build types
* decouple ProcessMessage
* decouple ProcessMessage 2
* dmp and xcmp handlers decouple
* backup
* refactor done
* common int values working
* added global ext with mutex
* works for two mutex
* single mutex and remove condvar
* global test ext done
* failing moving test_ext because relay block num
* relay_block_number issue fixed
* backup
* Test working with assertions
* assertions get Test as arg
* DispatchArgs as generic
* clean up
* backup
* teleports for asset-hub-kusama done
* improve assert_expected_events macro
* rename Test generics
* check assertions for tuples
* test assertions redone
* reserve_transfer_assets done
* send transact done
* hrmp test for paras
* hrmp channels test done
* hrmp channels test done 2
* before modifying test dispatch
* reserve tests done & Test dispatch fixed
* reserve transfer local asset
* force_create_and_mint_asset
* force create and mint done
* tests done
* fix imports in common
* common events refactored
* add option to events attributes
* asset-hub-polkadot tests done
* asset-hub-westend half done
* relay chain events move to common
* remove failing send tests for asset-hub-westend
* added events to bridge-hub-rococo
* added events to collectives-polkadot
* cargo clean up
* fix asset-hub-westend tests
* ".git/.scripts/commands/fmt/fmt.sh"
* fix clippy
* ".git/.scripts/commands/fmt/fmt.sh"
* Removed unnecessary deps
* Extracted some commonality for Kusama/Polkadot (which will be reused also for BridgeHubs) (#2971)
* Extracted some commonality for Kusama/Polkadot (which will be reused also for BridgeHubs)
* AssetHubRococo should better use AssetHubKusama runtime
* add fund_account
---------
Co-authored-by: NachoPal <ignacio.palacios.santos@gmail.com>
* address comments
* rename event assertion helpers
* clean comments
* address comments 2
* ".git/.scripts/commands/fmt/fmt.sh"
---------
Co-authored-by: Giles Cope <gilescope@gmail.com>
Co-authored-by: command-bot <>
Co-authored-by: Branislav Kontur <bkontur@gmail.com>