* Add a command to purge the relay chain only
* WIP
* Update rococo-parachains/src/cli.rs
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
* Move cli stuff to its own crate
* Copyright dates
* Test not working for some reason...
* WIP
* Revert "WIP"
This reverts commit f97cd63742c7df822e4a6e52a29db5e0f56b7bfa.
* Fix test to use provided relay chain
* Apply suggestions from code review
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
* Add hint about which database could not be purged
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Currently validation data is shared by using a well known key between
the parachain system pallet and the validate block implementation. This
pr changes this by passing the parachain system directly to the validate
block implementation to make use of it. Besides that, we also store the
validation params in some thread local variable to make it inspectable
by parachain system. This moves the validation of validation data and
validation params to the parachain system pallet directly, instead of
having this hidden inside the validate block implementation.
Fixes: https://github.com/paritytech/cumulus/issues/217
* Move consensus to consensus-common crate
* Move the parachain consensus out of the collator
* Add first relay chain consensus stuff
* Remove some warnings
* Fix more stuff
* Fix collator test
* Change `ParachainConsensus` to take a mutable self
* Make everything compile
* Feedback
This renames and moves the `SystemInherentData` into its own crate.
The struct is now called `ParachainInherentData`. Besides moving the
struct, this also moves the code for creating this struct into this crate.
* Move pallets to pallets folder and rename them
* Move genesis file to service
* Rename primitives to primitives-core
* Delete cumulus-runtime
* Move stuff to client folder and rename
* Update polkadot
* Migrate all uses of MQC heads to merkle proofs
* Mass rename `relay_parent_storage_root`
* Restore parachain-system tests
* Update polkadot and libp2p swarm for testing
* Collapse match into an if let
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
* Fix compilation error in test-service
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
* MQC auth
Update polkadot
WIP
* Update polkadot
* Silly syntax errors
* Fix typo
* Leave some comments and docs
* Apply suggestions from code review
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
* Introduce the MessageQueueChain structure
* Move the HRMP channel relevance check below
* Fix the `receive_hrmp_after_pause` test
* ValidationData is passed by reference
* Replace "to cumulus" with "to the collator"
* Update the test so that they are same as in polkadot
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
* Block announce validation should use the correct `Validation` result
The error variant is just for internal errors and we need to return
`Failure` always when the other node send us an invalid statement.
* Update network/src/lib.rs
Co-authored-by: Sergei Shulepov <sergei@parity.io>
Co-authored-by: Sergei Shulepov <sergei@parity.io>
This changes the collator to print an error if the block that we can not
find is the genesis block, instead of only logging this as a `debug`
message. This should help people when they have registered the wrong
genesis state on the relay chain.
* Switch to custom `BlockAnnounceData`
Instead of sending a `SignedFullStatement` this switches to a new struct
`BlockAnnounceData` that is being send alongside the block announcement.
The signed full statement contains the candidate commitments, meaning it
could be a full runtime upgrade that we send alongside a block
announcement... To prevent this, we now only send the candidate receipt
and the compact statement.
* Update to latest polkadot
* rename parachain-{upgrade -> system}
* Merge message-broker into parachain-system
* Remove message-broker and clean up
* Update docs
* Test upward messages sending
And also update the relay-sproof-builder so that it allows to set the
relay dispatch queue size for the given parachain.
* Test horizontal message sending
* Remove old inherent definitions
* Update polkadot
* Extend cumulus primitives with some relay chain exports
Follow https://github.com/paritytech/polkadot/pull/2194 to see the
polkadot PR
* collator: collect the state proof
This commit changes cumulus-collator so that it takes the relay chain
state at the relay parent and creates a storage proof that contains all
the required data for PVF.
* parachain-upgrade: use the proofs instead
This change is needed to make cumulus logic to not longer depend on the
transient validation data. As part of this change, in order to preserve
the current behavior `code_upgrade_allowed` now is computed on the
parachain side, rather than provided by polkadot.
Turned out that this requires to know the self parachain id so it was
added where needed.
* message-broker: use relay state to track limits
this should make sending messages safe from accidentally running over
the relay chain limits that were previously unknown.
* Update polkadot
So that `relay_storage_root` is available through `ValidationParams`
* Check `relay_storage_root` matches expected
Check that `relay_storage_root` submitted by the collator matches the
one that we receive in `validate_block` through `ValidationParams`
* Add a missing check for `dmq_mqc_head` while we are at it
* Update polkadot
* Fix tests that use the relay storage root
* Apply suggestions from code review
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
* Update message-broker/src/lib.rs
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
* Remove unneeded (&_)
* Fix unwraps
* Polish basti's suggestion
* Fix merge
* Bring back the System::can_set_code check
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
* Wait for block import in parachain consensus
There was a bug in the parachain consensus that when importing a relay
chain block that sets a new best parachain block, but the required
parachain block was not yet imported. This pr fixes this by waiting for
the block to be imported.
* Finish docs
* The problem in the nutshell
* Make it compile
* make tests pass
* Update the parachain-upgrade module
* Fix collator tests
Co-authored-by: Bastian Köcher <git@kchr.de>
* HRMP message ingestion
* Plumb hrmp_watermark to build_collation
* Plumb hrmp_watermark to ValidationResult
* Plumb hrmp outbound messages
* Implement message-broker part of HRMP
* Kill UPWARD_MESSAGES as well
Otherwise, they will get resent each block
* Add sudo versions for easier testing
* Remove the xcmp module
Not useful for the moment
* Doc for HRMP message handler
* Estimate the weight upper bound for on_finalize
* Remove a redundant type annotation
* fix spelling of a method
* Apply suggestions from code review
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
* Deabbreviate dmp and hrmp in the message ingestion type
* Don't use binary_search since it's broken by a following rotate
Instead use the linear search. We can afford linear search here since
due to limited scalability of HRMP we can only have at most a couple of
dozens of channels.
* Fix the watermark
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
* plumb polkadot_client into Collator
* plumb para_id into Collator
* promote retrieve_dmq_contents to a method
* remove the retrieve_dmq_contents closure