* First baby steps
* Split scheduler into several modules
* Towards a more modular approach for scheduling
* move free_cores; IntoInterator -> BTreeMap
* Move clear()
* Move more functions out of scheduler
* Change weight composition
* More abstraction
* Further refactor
* clippy
* fmt
* fix test-runtime
* Add parathreads pallet to construct_runtime!
* Make all runtimes use (Parachains, Parathreads) scheduling
* Delete commented out code
* Remove parathreads scheduler from westend, rococo, and kusama
* fix rococo, westend, and kusama config
* Revert "fix rococo, westend, and kusama config"
This reverts commit 59e4de380d5c7d17eaaba5e2c2b81405de3465e3.
* Revert "Remove parathreads scheduler from westend, rococo, and kusama"
This reverts commit 4c44255296083ac5670560790ed77104917890a4.
* Remove CoreIndex from free_cores
* Remove unnecessary struct for parathreads
* parathreads provider take 1
* Comment out parathread tests
* Pop into lookahead
* fmt
* Fill lookahead with two entries for parachains
* fmt
* Current stage
* Towards ab parathreads
* no AB use
* Make tests typecheck
* quick hack to set scheduling lookahead to 1
* Fix scheduler tests
* fix paras_inherent tests
* misc
* Update more of a test
* cfg(test)
* some cleanup
* Undo paras_inherent changes
* Adjust paras inherent tests
* Undo changes to v2 primitives
* Undo v2 mod changes to tests
* minor
* Remove parathreads assigner and pallet
* minor
* minor
* more cleanup
* fmt
* minor
* minor
* minor
* Remove on_new_session from assignment provider
* Make adder collator integration test pass
* disable failing unit tests
* minor
* minor
* re-enable one unit test
* minor
* handle retries, add concluded para to pop interface
* comment out unused code
* Remove core_para from interface
* Remove first claimqueue element on clear if None instead removing all Nones
* Move claimqueue get out of loop
* Use VecDeque instead of Ved in ClaimQueue
* Make occupied() AB ready(?)
* handle freed disputed in clear_and_fill_claimqueue
* clear_and_fill_claimqueue returns scheduled Vec
* Rename and minor refactor
* return position of assignment taken from claimqueue
* minor
* Fix session boundary parachains number change + extended test
* Fix runtimes
* Fix polkadot runtime
* Remove polkadot pallet from benchmarks
* fix test runtime
* Add storage migration
* Minor refactor
* Minor
* migratin typechecks
* Add migration to runtimes
* Towards modular scheduling II (#6568)
* Add post migration check
* pebkac
* Disable migrations but mine
* Revert "Disable migrations but mine"
This reverts commit 4fa5c5a370c199944a7e0926f50b08626bfbad4c.
* Move scheduler migration
* Revert "Move scheduler migration"
This reverts commit a16b1659a907950bae048a9f7010f2aa76e02b6d.
* Fix migration
* cleanup
* Don't lose retries value anymore
* comment out test function
* Remove retries value from Assignment again
* minor
* Make collator for parathreads optional
* data type refactor
* update scheduler tests
* Change test function cfg
* comment out test function
* Try cfg(test) only
* fix cfg flags
* Add get_max_retries function to provider interface (#7047)
* Fix merge commit
* pebkac
* fix merge
* update cargo.lock
* fix merge
* fix merge
* Use btreemap instead of vec, fix scheduler calls.
* Use imported `ScheduledCore`
* Remove unused import in inclusion tests
* Use keys() instead of mapping over a BTreeMap
* Fix migrations for parachains scheduler
* Use BlockNumberFor<T> everywhere in scheduler
* Add on demand assignment provider pallet (#7110)
* Address some PR comments
* minor
* more cleanup
* find_map and timeout availability fixes
* Change default scheduling_lookahead to 1
* Add on demand assignment provider pallet
* Move test-runtime to new assignment provider
* Run cargo format on scheduler tests
* minor
* Mutate cores in single loop
* timeout predicate simplification
* claimqueue desired size fix
* Replace expect by ok_or
* More improvements
* Fix push back order and next_up_on_timeout
* minor
* session change docs
* Add pre_new_session call to hand pre session updates
* Remove sc_network dependency and PeerId from unnecessary data structures
* Remove unnecessary peer_ids
* Add OnDemandOrdering proxy (#7156)
* Add OnDemandBidding proxy
* Fix names
* OnDemandAssigner for rococo only
* Check PeerId in collator protocol before fetching collation
* On occupied, remove non occupied cores from the claimqueue front and refill
* Add missing docs
* Comment out unused field
* fix ScheduledCore in tests
* Fix the fix
* pebkac
* fmt
* Fix occupied dropping
* Remove double import
* ScheduledCore fixes
* Readd sc-network dep
* pebkac
* OpaquePeerId -> PeerId in can_collate interface
* Cargo.lock update for interface change
* Remove checks not needed anymore?
* Drop occupied core on session change if it would time out after the new session
* Add on demand assignment provider pallet
* Move test-runtime to new assignment provider
* Run cargo format on scheduler tests
* Add OnDemandOrdering proxy (#7156)
* Add OnDemandBidding proxy
* Fix names
* OnDemandAssigner for rococo only
* Remove unneeded config values
* Update comments
* Use and_then for queue position
* Return the max size of the spot queue on error
* Add comments to add_parathread_entry
* Add module comments
* Add log for when can_collate fails
* Change assigner queue type to `Assignment`
* Update assignment provider tests
* More logs
* Remove unused keyring import
* disable can_collate
* comment out can_collate
* Can collate first checks set if empty
* Move can_collate call to collation advertisement
* Fix backing test
* map to loop
* Remove obsolete check
* Move invalid collation test from backing to collator-protocol
* fix unused imports
* fix test
* fix Debug derivation
* Increase time limit on zombienet predicates
* Increase zombienet timeout
* Minor
* Address some PR comments
* Address PR comments
* Comment out failing assert due to on-demand assigner missing
* remove collator_restrictions info from backing
* Move can_collate to ActiveParas
* minor
* minor
* Update weight information for on demand config
* Add ttl to parasentry
* Fix tests missing parasentry ttl
* Adjust scheduler tests to use ttl default values
* Use match instead of if let for ttl drop
* Use RuntimeDebug trait for `ParasEntry` fields
* Add comments to on demand assignment pallet
* Fix spot traffic calculation
* Revert runtimedebug changes to primitives
* Remove runtimedebug derivation from `ParasEntry`
* Mention affinity in pallet level docs
* Use RuntimeDebug trait for ParasEntry child types
* Remove collator restrictions
* Fix primitive versioning and other merge issues
* Fix tests post merge
* Fix node side tests
* Edit parascheduler migration for clarity
* Move parascheduler migration up to next release
* Remove vestiges from merge
* Fix tests
* Refactor ttl handling
* Remove unused things from scheduler tests
* Move on demand assigner to own directory
* Update documentation
* Remove unused sc-network dependency in primitives
Was used for collator restrictions
* Remove unused import
* Reenable scheduler test
* Remove unused storage value
* Enable timeout predicate test and fix fn
Turns out that the issue with the compiler is fixed and we can now
use impl Trait in the manner used here.
* Remove unused imports
* Add benchmarking entry for perbill in config
* Correct typo
* Address review comments
* Log out errors when calculating spot traffic.
* Change parascheduler's log target name
* Update scheduler_common documentation
* Use mutate for affinity fns, add tests
* Add another on demand affinity test
* Unify parathreads and parachains in HostConfig (take 2) (#7452)
* Unify parathreads and parachains in HostConfig
* Fixed missed occurences
* Remove commented out lines
* `HostConfiguration v7`
* Fix version check
* Add `MigrateToV7` to `Unreleased`
* fmt
* fmt
* Fix compilation errors after the rebase
* Update runtime/parachains/src/scheduler/tests.rs
Co-authored-by: Anton Vilhelm Ásgeirsson <antonva@users.noreply.github.com>
* Update runtime/parachains/src/scheduler/tests.rs
Co-authored-by: Anton Vilhelm Ásgeirsson <antonva@users.noreply.github.com>
* fmt
* Fix migration test
* Fix tests
* Remove unneeded assert from tests
* parathread_cores -> on_demand_cores; parathread_retries -> on_demand_retries
* Fix a compilation error in tests
* Remove unused `use`
* update colander image version
---------
Co-authored-by: alexgparity <alex.gremm@parity.io>
Co-authored-by: Anton Vilhelm Ásgeirsson <antonva@users.noreply.github.com>
Co-authored-by: Javier Viola <javier@parity.io>
* Fix branch after merge with master
* Refactor out duplicate checks into a helper fn
* Fix tests post merge
* Rename add_parathread_assignment, add test
* Update docs
* Remove unused on_finalize function
* Add weight info to on demand pallet
* Update runtime/parachains/src/configuration.rs
Co-authored-by: Tsvetomir Dimitrov <tsvetomir@parity.io>
* Update runtime/parachains/src/scheduler_common/mod.rs
Co-authored-by: Tsvetomir Dimitrov <tsvetomir@parity.io>
* Update runtime/parachains/src/assigner_on_demand/mod.rs
Co-authored-by: Tsvetomir Dimitrov <tsvetomir@parity.io>
* Add benchmarking to on demand pallet
* Make place_order test check for success
* Add on demand benchmarks
* Add local test weights to rococo runtime
* Modify TTL drop behaviour to not skip claims
Previous behaviour would jump a new claim from the assignment provider
ahead in the claimqueue, assuming lookahead is larger than 1.
* Refactor ttl test to test claimqueue order
* Disable place_order ext. when no on_demand cores
* Use default genesis config for benchmark tests
* Refactor config builder param
* Move lifecycle test from scheduler to on demand
* Remove unneeded lifecycle test
Paras module via the parachain assignment provider doesn't provide
new assignments if a parachain loses it's lease. The on demand
assignment provider doesn't provide an assignment that is not a
parathread.
* Re enable validator shuffle test
* More realistic weights for place_order
* Remove redundant import
* Fix backwards compatibility (hopefully)
* ".git/.scripts/commands/bench/bench.sh" --subcommand=runtime --runtime=rococo --target_dir=polkadot --pallet=runtime_parachains::assigner_on_demand
* Fix tests.
* Fix off-by-one.
* Re enable claimqueue fills test
* Re enable schedule_rotates_groups test
* Fix fill_claimqueue_fills test
* Re enable next_up_on_timeout test, move fn
* Do not pop from assignment provider when retrying
* Fix tests missing collator in scheduledcore
* Add comment about timeout predicate.
* Rename parasentry retries to availability timeouts
* Re enable schedule_schedules... test
* Refactor prune retried test to new scheduler
* Have all scheduler tests use genesis_cfg fn
* Update docs
* Update copyright notices on new files
* Rename is_parachain_core to is_bulk_core
* Remove erroneous TODO
* Simplify import
* ".git/.scripts/commands/bench/bench.sh" --subcommand=runtime --runtime=rococo --target_dir=polkadot --pallet=runtime_parachains::configuration
* Revert AdvertiseCollation order shuffle
* Refactor place_order into keepalive and allowdeath
* Revert rename of hrmp max inbound channels
parachain encompasses both on demand and slot auction / bulk.
* Restore availability_timeout_predicate function
* Clean up leftover comments
* Update runtime/parachains/src/scheduler/tests.rs
Co-authored-by: Tsvetomir Dimitrov <tsvetomir@parity.io>
* ".git/.scripts/commands/bench/bench.sh" --subcommand=runtime --runtime=westend --target_dir=polkadot --pallet=runtime_parachains::configuration
---------
Co-authored-by: alexgparity <alex.gremm@parity.io>
Co-authored-by: alexgparity <115470171+alexgparity@users.noreply.github.com>
Co-authored-by: Tsvetomir Dimitrov <tsvetomir@parity.io>
Co-authored-by: Javier Viola <javier@parity.io>
Co-authored-by: eskimor <eskimor@no-such-url.com>
Co-authored-by: command-bot <>
* On Demand - update weights and small nits (#7605)
* Remove collator restriction test in inclusion
On demand parachains won't have collator restrictions implemented in
this way but will instead use a preferred collator registered to a
`ParaId` in `paras_registrar`.
* Remove redundant config guard for test fns
* Update weights
* Update WeightInfo for on_demand assigner
* Unify assignment provider parameters into one call (#7606)
* Combine assignmentprovider params into one fn call
* Move scheduler_common to a module under scheduler
* Fix ttl handling in benchmark builder
* Run cargo format
* Remove obsolete test.
* Small improvement.
* Use same migration pattern as config module
* Remove old TODO
* Change log target name for assigner on demand
* Fix migration
* Fix clippy warnings
* Add HostConfiguration storage migration to V8
* Add `MigrateToV8` to unreleased migrations for all runtimes
* Fix storage version check for config v8
* Set `StorageVersion` to 8 in `MigrateToV8`
* Remove dups.
* Update primitives/src/v5/mod.rs
Co-authored-by: Bastian Köcher <git@kchr.de>
---------
Co-authored-by: alexgparity <alex.gremm@parity.io>
Co-authored-by: alexgparity <115470171+alexgparity@users.noreply.github.com>
Co-authored-by: antonva <anton.asgeirsson@parity.io>
Co-authored-by: Tsvetomir Dimitrov <tsvetomir@parity.io>
Co-authored-by: Anton Vilhelm Ásgeirsson <antonva@users.noreply.github.com>
Co-authored-by: Javier Viola <javier@parity.io>
Co-authored-by: eskimor <eskimor@no-such-url.com>
Co-authored-by: Bastian Köcher <git@kchr.de>
* Happy New Year!
* Remove year entierly
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Remove years from copyright notice in the entire repo
---------
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Add clippy config and remove .cargo from gitignore
* first fixes
* Clippyfied
* Add clippy CI job
* comment out rusty-cachier
* minor
* fix ci
* remove DAG from check-dependent-project
* add DAG to clippy
Co-authored-by: alvicsam <alvicsam@gmail.com>
* Don't import backing statements directly
into the dispute coordinator. This also gets rid of a redundant
signature check. Both should have some impact on backing performance.
In general this PR should make us scale better in the number of parachains.
Reasoning (aka why this is fine):
For the signature check: As mentioned, it is a redundant check. The
signature has already been checked at this point. This is even made
obvious by the used types. The smart constructor is not perfect as
discussed [here](https://github.com/paritytech/polkadot/issues/3455),
but is still a reasonable security.
For not importing to the dispute-coordinator: This should be good as the
dispute coordinator does scrape backing votes from chain. This suffices
in practice as a super majority of validators must have seen a backing
fork in order for a candidate to get included and only included
candidates pose a threat to our system. The import from chain is
preferable over direct import of backing votes for two reasons:
1. The import is batched, greatly improving import performance. All
backing votes for a candidate are imported with a single import.
And indeed we were able to see in metrics that importing votes
from chain is fast.
2. We do less work in general as not every candidate for which
statements are gossiped might actually make it on a chain. The
dispute coordinator as with the current implementation would still
import and keep those votes around for six sessions.
While redundancy is good for reliability in the event of bugs, this also
comes at a non negligible cost. The dispute-coordinator right now is the
subsystem with the highest load, despite the fact that it should not be
doing much during mormal operation and it is only getting worse
with more parachains as the load is a direct function of the number of statements.
We'll see on Versi how much of a performance improvement this PR
* Get rid of dead code.
* Dont send approval vote
* Make it pass CI
* Bring back tests for fixing them later.
* Explicit signature check.
* Resurrect approval-voting tests (not fixed yet)
* Send out approval votes in dispute-distribution.
Use BTreeMap for ordered dispute votes.
* Bring back an important warning.
* Fix approval voting tests.
* Don't send out dispute message on import + test
+ Some cleanup.
* Guide changes.
Note that the introduced complexity is actually redundant.
* WIP: guide changes.
* Finish guide changes about dispute-coordinator
conceputally. Requires more proof read still.
Also removed obsolete implementation details, where the code is better
suited as the source of truth.
* Finish guide changes for now.
* Remove own approval vote import logic.
* Implement logic for retrieving approval-votes
into approval-voting and approval-distribution subsystems.
* Update roadmap/implementers-guide/src/node/disputes/dispute-coordinator.md
Co-authored-by: asynchronous rob <rphmeier@gmail.com>
* Review feedback.
In particular: Add note about disputes of non included candidates.
* Incorporate Review Remarks
* Get rid of superfluous space.
* Tidy up import logic a bit.
Logical vote import is now separated, making the code more readable and
maintainable.
Also: Accept import if there is at least one invalid signer that has not
exceeded its spam slots, instead of requiring all of them to not exceed
their limits. This is more correct and a preparation for vote batching.
* We don't need/have empty imports.
* Fix tests and bugs.
* Remove error prone redundancy.
* Import approval votes on dispute initiated/concluded.
* Add test for approval vote import.
* Make guide checker happy (hopefully)
* Another sanity check + better logs.
* Reasoning about boundedness.
* Use `CandidateIndex` as opposed to `CoreIndex`.
* Remove redundant import.
* Review remarks.
* Add metric for calls to request signatures
* More review remarks.
* Add metric on imported approval votes.
* Include candidate hash in logs.
* More trace log
* Break cycle.
* Add some tracing.
* Cleanup allowed messages.
* fmt
* Tracing + timeout for get inherent data.
* Better error.
* Break cycle in all places.
* Clarified comment some more.
* Typo.
* Break cycle approval-distribution - approval-voting.
Co-authored-by: asynchronous rob <rphmeier@gmail.com>
* split metrics from collation generation
* move metrics to separate file out of backing
* split bitfield signing metrics
* split candidate validation metrics
* split chain api metrics
* split metrics from runtime API
* util is not used in backed metrics mod
* fmt
* missing types
* sure
* Don't wait for dispute coordinator
in backing and approval-voting - we are single threaded there, so this
is blocking everything.
* Add missing import.
* Don't warn on dropped receiver.
* remove v0 primitives from polkadot-primitives
* first pass: remove v0
* fix fallout in erasure-coding
* remove v1 primitives, consolidate to v2
* the great import update
* update runtime_api_impl_v1 to v2 as well
* guide: add `Version` request for runtime API
* add version query to runtime API
* reintroduce OldV1SessionInfo in a limited way
* First step in implementing https://github.com/paritytech/polkadot/issues/4386
This PR:
- Reduces MAX_UNSHARED_UPLOAD_TIME to 150ms
- Increases timeout on collation fetching to 1200ms
- Reduces limit on needed backing votes in the runtime
This PR does not yet reduce the number of needed backing votes on the
node as this can only be meaningfully enacted once the changed limit in
the runtime is live.
* Fix tests.
* Guide updates.
* Review remarks.
* Bump minimum required backing votes to 2 in runtime.
* Make sure node side code won't make runtime vomit.
* cargo +nightly fmt
* Companion PR for removing Prometheus metrics prefix
* Was missing some metrics
* Fix missing renames
* Fix test
* Fixes
* Update test
* Update Substrate
* Second time
* remove prefix from intergration test for zombienet
* update zombienet image
* Update Substrate
Co-authored-by: Bastian Köcher <info@kchr.de>
Co-authored-by: Javier Viola <pepoviola@gmail.com>
* pvf: make execution timeout configurable
* guide: add timeouts to candidate validation params
* add timeouts to candidate validation messages
* fmt
* port backing to use the backing pvf timeout
* port approval-voting to use the execution timeout
* port dispute participation to use the correct timeout
* fmt
* address grumbles & test failure
* CI: add spellcheck
* revert me
* CI: explicit command for spellchecker
* spellcheck: edit misspells
* CI: run spellcheck on diff
* spellcheck: edits
* spellcheck: edit misspells
* spellcheck: add rules
* spellcheck: mv configs
* spellcheck: more edits
* spellcheck: chore
* spellcheck: one more thing
* spellcheck: and another one
* spellcheck: seems like it doesn't get to an end
* spellcheck: new words after rebase
* spellcheck: new words appearing out of nowhere
* chore
* review edits
* more review edits
* more edits
* wonky behavior
* wonky behavior 2
* wonky behavior 3
* change git behavior
* spellcheck: another bunch of new edits
* spellcheck: new words are koming out of nowhere
* CI: finding the master
* CI: fetching master implicitly
* CI: undebug
* new errors
* a bunch of new edits
* and some more
* Update node/core/approval-voting/src/approval_db/v1/mod.rs
Co-authored-by: Andronik Ordian <write@reusable.software>
* Update xcm/xcm-executor/src/assets.rs
Co-authored-by: Andronik Ordian <write@reusable.software>
* Apply suggestions from code review
Co-authored-by: Andronik Ordian <write@reusable.software>
* Suggestions from the code review
* CI: scan only changed files
Co-authored-by: Andronik Ordian <write@reusable.software>
* Create validator_side module
* Subsume Candidate Selection
* Add test to ensure candidate backing logic is correct
* Ensure secondings are adequately cleaned up and address test flakyness
* Address Feedback
* guide: reversion safety
* guide: manage reversion safety in subsystems
* add leaf status to ActivatedLeaf
* add an LRU-cache to overseer for staleness detection
* update ActivatedLeaf usages in tests to contain status field
* add variant where missed accidentally
* add some helpers to LeafStatus
* address grumbles
* Remove signature verification in backing.
`SignedFullStatement` now signals that the signature has already been
checked.
* Remove unused check_payload function.
* Introduced unchecked signed variants.
* Fix inclusion to use unchecked variant.
* More unchecked variants.
* Use unchecked variants in protocols.
* Start fixing statement-distribution.
* Fixup statement distribution.
* Fix inclusion.
* Fix warning.
* Fix backing properly.
* Fix bitfield distribution.
* Make crypto store optional for `RuntimeInfo`.
* Factor out utility functions.
* get_group_rotation_info
* WIP: Collator cleanup + check signatures.
* Convenience signature checking functions.
* Check signature on collator-side.
* Fix warnings.
* Fix collator side tests.
* Get rid of warnings.
* Better Signed/UncheckedSigned implementation.
Also get rid of Encode/Decode for Signed! *party*
* Get rid of dead code.
* Move Signed in its own module.
* into_checked -> try_into_checked
* Fix merge.
with the MaxValidators parameter set, this meant that only validators participating in parachain consensus would be able to author relay-chain blocks containing backed candidates
* tests/av-store: use future::join instead of future::select
* tests/backing: use future::join instead of future::select
* tests/provisioner: use future::join instead of future::select
* tests/av-dist: use future::join instead of future::select
* tests/av-recovery: use future::join instead of future::select
* tests/bridge: use future::join instead of future::select
* tests/collator-protocol: use future::join instead of future::select
* tests/stmt-dist: use future::join instead of future::select
* fix tests
* Remove stuff out of the runtime that does not belong there.
There might be more, but it is a start.
* White space fixes.
* Fix tests.
* Leave whitespace in ui tests alone.
* Add back zstd for no reason.
* Fix browser wasm (hopefully)