Commit Graph

61 Commits

Author SHA1 Message Date
Alexander Popiak f499617c01 update Substrate and Polkadot (to include new transaction priority) (#645)
* update Substrate and Polkadot

* Update parachain-template/runtime/src/lib.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
2021-10-05 11:48:33 +00:00
Keith Yeung 1aab3349cc Use DecodeLimit for decoding XCM messages (#605)
* Use DecodeLimit for decoding XCM messages

* Use decode_all_with_depth_limit in appropriate places

* Use decode_all while decoding byte vector

* cargo fmt
2021-09-19 15:29:34 +03:00
Chevdor 1dd000a011 ci: add quick-check with rustfmt (#615)
* ci: add quick-check with clippy and rustfmt

* chore: rustfmt round

* chore: set the same rustfmt config than substrate

* chore: fix formatting

* cI: remove clippy

* ci: switch to nightly for the checks

* ci: fix toolchains and naming

* ci: Limit the check to formatting

* chore: fix formatting

* Update .rustfmt.toml

* Update .rustfmt.toml

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
2021-09-16 16:57:52 +02:00
Andrew Jones 035a576008 Metadata v14 (companion to #3336) (#564)
* Remove event pallet::metadata attributes

* Add scale-info deps, TypeInfo derives, update call variants

* Update metadata runtime APIs

* Add missing scale_info dependency, update rococo runtime API

* Add missing scale_info dependency

* Remove pushed diener patches

* Cargo.lock

* Add missing scale-info dependencies

* Fixes

* Statemint runtime fixes

* Call struct variant empty matches

* Add missing scale-info dependency

* Fixes

* scale-info 1.0

* cargo update -p xcm

* update lock

* Update Cargo.lock

* update to latest polkadot

* remove rpc_http_threads

https://github.com/paritytech/substrate/pull/9737

* replace task executor with tokio handler

https://github.com/paritytech/substrate/pull/9737

* fix test compilation?

* Update Cargo.lock

* cargo update

* remove unused

* Update substrate and polkadot

* Update test/client/src/lib.rs

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
2021-09-16 12:11:05 +02:00
Squirrel a0532634e1 less deps (#606) 2021-09-12 23:22:14 +02:00
Gavin Wood b3c38f0926 Companion to #9514 (Remove Filter and use Contains instead) (#566)
* Remove Filter and use Contains instead

* Fixes

* Remove patch

* Bump Polkadot

* bump
2021-08-09 18:07:37 +02:00
Bastian Köcher 594f2f4347 Update Substrate & Polkadot (#540) 2021-07-20 16:11:56 +02:00
Shawn Tabrizi a3c33fd31d make parachain system config consistent (#538) 2021-07-14 23:44:39 -04:00
Bastian Köcher a2a97be872 Bring back runtime upgrade test (#525)
This brings back the runtime upgrade test and also updates Substrate &
Polkadot.
2021-07-06 16:21:19 +02:00
Bastian Köcher d0b57c1ad4 Update Substrate & Polkadot (#523) 2021-07-05 23:35:28 +02:00
Shawn Tabrizi 70b39acf94 Fix Max Block Weight (#501)
* fix max block weight

* fix milli per block too
2021-06-19 14:47:05 +02:00
Sergei Shulepov fe21865d12 WIP: Update Substrate & Polkadot (#496)
* WIP: Update Substrate

* Update Substrate & Polkadot

* fixes

* more fixes

* few missing origins

* use spawn_essential_handle

* bump polkadot dep

* remove newlines

* fix test

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
2021-06-17 09:37:03 +02:00
Bastian Köcher d3b4279f14 Adds support for checking the timestamp inherent while validating a block (#494)
* Adds support for checking the timestamp inherent while validating a block

This adds support for checking the timestamp inherent while validating a
block. This will use the relay chain slot number * relay chain slot
duration to calculate a timestamp. This timestamp is used to check the
timestamp in the timestamp inherent.

* Update polkadot-parachains/rococo-runtime/src/lib.rs

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>

* Update polkadot-parachains/statemine-runtime/src/lib.rs

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>

* Update primitives/timestamp/src/lib.rs

Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>

* Fix warnings

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
2021-06-16 10:53:47 +02:00
Bastian Köcher d54fdd788e Bring support for calling check_inherents (#490)
* Start

* More work

* Add proc-macro for `validate_block`

* Make everything compile

* Add some test
2021-06-12 20:21:46 +02:00
Bastian Köcher 794bc23de4 Do not include :code in the storage proof if not required (#480)
This is basically a hack that prevents the inclusion of `:code` in the
storage proof. A proper fix requires some changes to the trie crate to
not include nodes that aren't read.
2021-06-07 16:17:19 +02:00
Xiliang Chen 33908c1414 update substrate & polkadot (#472)
* update substrate

* try again
2021-06-04 16:43:29 +02:00
Sergei Shulepov 70afaae2cf Slap runtime_version macro everywhere (#444)
* Slap runtime_version macro everywhere

* Update Substrate

This includes the fix of compilation for macOS platforms.
2021-05-19 12:34:02 +02:00
Bastian Köcher 6674430f6e Introduce CollectCollationInfo runtime api (#443)
* Introduce `CollectCollationInfo` runtime api

Instead of using well known keys to communicate information about a
collation between the runtime and the collator, we now use a runtime api
for this.

* Fixes bug

* Apply suggestions from code review

Co-authored-by: Sergei Shulepov <sergei@parity.io>

* Doc update

Co-authored-by: Sergei Shulepov <sergei@parity.io>
2021-05-17 16:33:33 +02:00
Bastian Köcher b9056fed59 Update Substrate & Polkadot (#428) 2021-05-04 22:32:06 +02:00
Bastian Köcher 6364eeeef1 Update Substrate & Polkadot (#427)
* Update Substrate & Polkadot

* Fixes
2021-05-04 09:48:41 +02:00
Gavin Wood 3f687171c2 DMP Queue pallet (#416)
* Introduce the converter into the hub

* Parachain recognises Rococo governance body as admin

* Whitespace

* Use UsingComponents for fee payment in XCM

* Fixes

* Fixes for XCM permissions

* Remove encode_call test

* Fixes

* Rococo Collator supports Shell runtime

* Fixes

* Fixes

* Initial draft of DMP Queue pallet

* DMP Queue builds.

* Companion for Polkadot gav-allow-xcm-exec

* Bump

* Fix std

* Fixes

* fix and improve docs

* fix compile errors in tests

* add test for try_service_message

* update cargo.lock

* Fixes

* Make test name read well

* Fixes

* Add a couple of simple tests

* Tests

* Tests

* Update pallets/dmp-queue/src/lib.rs

Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>

* Update pallets/dmp-queue/src/lib.rs

Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>

* Update pallets/dmp-queue/src/lib.rs

Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>

* Update pallets/dmp-queue/src/lib.rs

Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>

* Update pallets/dmp-queue/src/lib.rs

Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>

* Update pallets/dmp-queue/src/lib.rs

Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>

* Update pallets/dmp-queue/src/lib.rs

Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>

* Chain ID and ParaID don't collide

* Fixes

* Update pallets/dmp-queue/src/lib.rs

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>

* Update pallets/dmp-queue/src/lib.rs

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>

* Fixes

Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
2021-05-02 16:11:58 +02:00
Cecile Tonglet 8c37b0d450 Runtime upgrade test (#364) 2021-04-16 09:48:13 +02:00
Gavin Wood 5fe32eb0d4 XCM revamp & Ping pallet (#391)
* Add spambot

* Fixes

* Add some extra functions to spambot, bump version

* Lock..

* Aggregate HRMP (XCMP/HMP) messages. Payloads for spambot.

* Fix tests, bump Polkadot.

* Fix HMP tests

* Rename Hrmp -> Xcmp for handler/sender

* Use master branch

* Test Xcm message passing & rename away from HMP

* Docs

* Introduce fee payment mechanics into XCM.

* Rename spambot -> ping

* Lock

* XCMP message dispatch system reimagining

- Moved most of the logic into xcm-handler pallet
- Altered the outgoing XCMP API from push to pull
- Changed underlying outgoing queue data structures to avoid multi-page read/writes
- Introduced queuing for incoming messages
- Introduced signal messages as a flow-control sub-stream
- Introduced flow-control with basic threshold back-pressure
- Introduced overall weight limitation on messages executed
- Additonal alterations to XCM APIs for the new system

* Should process any remaining XCM messages when we're not doing anything else.

* Update API usage and preparation for the big build.

* Some build fixes

* Build fixes

* xcm-handler builds

* Fix warnings

* Docs

* Parachains system builds

* Parachain runtime building

* Fix build

* Introduce transfer_asset specialisation.

* Fixes

* Two-stage upgrade for parachains.

* Fixes

* Fixes

* Updates for message sending.

* Repotting/renaming. Add primitives/utility.

* Remove real-overseer and bump refs

* Configure & document Rococo XCM runtime.

* Add shell runtime, some companion changes for #8589

* Bumps & fixes

* Fix test

* Build fix

* Update pallets/xcmp-queue/src/lib.rs

Co-authored-by: Amar Singh <asinghchrony@protonmail.com>

* Make tests compile

* Apply suggestions from code review

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* remove unused

* remove unused event stuff

* Adds proper validation-worker to make integration tests work

* Apply suggestions from code review

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* import saturating

* remove panic test

Co-authored-by: Robert Habermeier <rphmeier@gmail.com>
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: Amar Singh <asinghchrony@protonmail.com>
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
Co-authored-by: Bastian Köcher <info@kchr.de>
2021-04-14 09:36:59 +02:00
Bastian Köcher 1d4c02cc4e Update Substrate & Polkadot (#387)
* Update Substrate & Polkadot

* Enforce `ParachainSetCode`
2021-04-02 16:17:04 +02:00
Bastian Köcher a8bf0e1a7f Update Substrate & Polkadot (#375)
* Update Substrate & Polkadot

* Remove `can_set_code` for now
2021-03-23 15:54:40 +01:00
Cecile Tonglet a3d50f2dd7 Adapt code to new sc-telemetry (#362) 2021-03-11 13:45:02 +01:00
Cecile Tonglet 5cdbd7c42d Add a command to purge the relay chain only (#306)
* 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>
2021-03-03 13:40:22 +01:00
Bastian Köcher f511757069 Change the way we store, handle and validate the validation data (#342)
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
2021-02-27 18:46:25 +01:00
Bastian Köcher fbacfe7937 The great refactor (#325)
* 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
2021-02-10 13:07:21 +01:00
Cecile Tonglet 6438d328b8 Complete telemetry for parachain & relaychain (#301)
* Complete telemetry for parachain & relaychain

* Update Substrate & Polkadot
2021-01-29 16:02:31 +01:00
Sergei Shulepov b5f6580da1 parachain-system (#296)
* 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
2021-01-21 15:53:00 +01:00
Black3HDF 8b815c759b eliminate space (#288) 2021-01-14 17:06:57 +01:00
Sergei Shulepov 464e54affd Inform the PVF with the latest relevant relay chain state (#279)
* 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>
2021-01-13 14:40:26 +01:00
lumir-mrkva 44dbe6aa9e upgrade to latest polkadot (#278)
* upgrade to latest polkadot

* ss58 in tests

* format

* removed unused import
2021-01-04 00:22:17 +01:00
Alexander Krupenkin ea10fa8230 Upgdate to latest polkadot & substrate (#263)
* Upgdate to latest polkadot & substrate

* Fix code formatting (cargo fmt)

* Fix unit tests
2020-12-10 14:28:02 +01:00
Sergei Shulepov ba1fa36411 Update polkadot to the latest master (#251)
* update cumulus to latest polkadot

* s/Trait/Config

To be more consistent with the new naming.

* Update Cargo.lock

* fix network tests
2020-12-01 19:21:40 +01:00
Bastian Köcher c75b59758d Update everything to latest master (#247) 2020-11-25 15:45:49 +01:00
Bastian Köcher 63efcc49c3 Wait for relay chain block import before validatiing a block announcement (#227)
* Start with something

* Whatever

* Update

* MOARE

* Make cumulus-network compile and tests work

* Update more and fixes

* More stuff

* More fixes

* Make collator build

* Make test almost work

* Remove contracts runtime

* More test work

* Make service compile

* Fix test-service

* Fix test client

* More fixes

* Fix collator test

* Fix network tests (again)

* Make everything compile, finally

* Fix tests

* Write test that should fail

* Add `WaitOnRelayChainBlock`

* Update git versions

* Make it all work

* Update logging

* Switch to provided method for pushing an extrinsic

* Try to debug CI

* Aaaa

* Only use Debug

* Updates

* Use native execution to hopefully make CI happy...
2020-11-23 00:21:02 +01:00
Bastian Köcher 182109ef5f Switch to polkadot master branch (#230)
* Switch to polkadot master branch

* Fix compilation
2020-11-09 13:05:00 +01:00
Bastian Köcher 76f9ecae47 Update Cumulus for Parachains V1 (#224)
* Start with something

* Whatever

* Update

* MOARE

* Make cumulus-network compile and tests work

* Update more and fixes

* More stuff

* More fixes

* Make collator build

* Make test almost work

* Remove contracts runtime

* More test work

* Make service compile

* Fix test-service

* Fix test client

* More fixes

* Fix collator test

* Fix network tests (again)

* Make everything compile, finally

* Fix tests

* Update to latest masters

* Remove ignore

* Switch to different branch in polkadot for now

* Update reference

* Make it compile with latest changes

* Update collator/src/lib.rs

Co-authored-by: Robert Habermeier <rphmeier@gmail.com>

* Update to latest upstream

* Update to latest master

* Fix test

Co-authored-by: Robert Habermeier <rphmeier@gmail.com>
2020-11-08 22:18:09 +01:00
Cecile Tonglet 4d150a0199 Uniformize tests (#220)
* Initial commit

Forked at: 5bbab68f02
Parent branch: origin/master

* Copy runtime module from rococo

Forked at: 5bbab68f02
Parent branch: origin/master

* Also copy dependencies pallets and primitives

Forked at: 5bbab68f02
Parent branch: origin/master

* WIP

Forked at: 5bbab68f02
Parent branch: origin/master

* WIP

Forked at: 5bbab68f02
Parent branch: origin/master

* test-service

* Move integration test

* CLEANUP

Forked at: 5bbab68f02
Parent branch: origin/master

* Not sure what went wrong...

* WIP

Forked at: 5bbab68f02
Parent branch: origin/master

* WIP

Forked at: 5bbab68f02
Parent branch: origin/master

* CLEANUP

Forked at: 5bbab68f02
Parent branch: origin/master

* fmt

* CLEANUP

Forked at: 5bbab68f02
Parent branch: origin/master

* CLEANUP

Forked at: 5bbab68f02
Parent branch: origin/master

* Remove pallet contracts (not used)

* Remove pallet parachain-info and token-dealer (not used)

* Sort dependencies alphabetically

* CLEANUP

Forked at: 5bbab68f02
Parent branch: origin/master

* CumulusTestNode for testing

* Speed up block generation

* Fix improper shutdown

* rustfmt

* runtime: replace const by storage

* Fix for previous commit

* Remove some generics

* Move generate_genesis_state to cumulus-primitives

* fmt

* Remove message_example

* fixup! Remove message_example

* WIP

Forked at: 5bbab68f02
Parent branch: origin/master

* Half the solution to previous commit :(

* Revert "Fix for previous commit"

This reverts commit 60010bab6797487093ac8c790b3a536f7ca0895b.

* Revert "runtime: replace const by storage"

This reverts commit c64b3a46f0325a98922015e0cbf3570e2e431774.

Not working for some reason...

* Use helper

Forked at: 5bbab68f02
Parent branch: origin/master

* WIP

Forked at: 5bbab68f02
Parent branch: origin/master

* Remove test-primitives

* Revert "Half the solution to previous commit :("

This reverts commit 9a8f89f9f06252198e6405057043c6b313f1aea4.

* Revert "Revert "Half the solution to previous commit :(""

This reverts commit 6a93f0f09d74ccdc3738dd78a777c483427c03ce.

* Test with some extra extrinsics

* WIP

Forked at: 5bbab68f02
Parent branch: origin/master

* CLEANUP

Forked at: 5bbab68f02
Parent branch: origin/master

* WIP

Forked at: 5bbab68f02
Parent branch: origin/master

* WIP

Forked at: 5bbab68f02
Parent branch: origin/master

* WIP

Forked at: 5bbab68f02
Parent branch: origin/master

* WIP

Forked at: 5bbab68f02
Parent branch: origin/master

* WIP

Forked at: 5bbab68f02
Parent branch: origin/master

* WIP

Forked at: 5bbab68f02
Parent branch: origin/master

* WIP

Forked at: 5bbab68f02
Parent branch: origin/master

* CLEANUP

Forked at: 5bbab68f02
Parent branch: origin/master

* Remove message broker
2020-10-07 08:51:01 +00:00
Bastian Köcher 6f50d0928d Add parachains for rococo (#144)
* Add parachains for rococo

* Fix chain specs

* Update to revert log rotation

* Support selecting the chain in `export-genesis-state`

* Add subcommand for exporting the genesis wasm of a Parachain

* Update stuff

* Fix `export-genesis-wasm`

* Update the polkadot ref

* Add bootNodes address

* Add bootNodes address - track

* Add bootNodes address - trick

* Fix incorrect peer id (trick)

* Fixes https://github.com/paritytech/cumulus/issues/157

* Update chainspecs

* Update specs again

* Set correct sudo account

* Update properties

* Update readme

* Update `Cargo.lock`

* Switch to rococo-branch

Co-authored-by: Evaldo <contato@evaldofelipe.com>
Co-authored-by: Cecile Tonglet <cecile.tonglet@cecton.com>
2020-08-04 17:33:20 +02:00
Bastian Köcher 1f83a231c2 Fix block announcement validation (#171)
* Fix block announce

* Fix compilation
2020-08-04 15:19:36 +02:00
Cecile Tonglet f26dd45e78 Collate only if --validator is given (#161) 2020-07-29 20:49:31 +02:00
Cecile Tonglet bcc627799a Fix integration test (#124) 2020-07-23 16:12:11 +02:00
Bastian Köcher 62c22b88b9 Implement basic upward & downward messages (#118)
* Start by replacing branch names and set `DownwardMessage`

* Add the upward-message crate

* Add Kusama & Polkadot

* More work on getting the upward messages working

* Fix build

* Begin to integrate it into the test Parachain

* Update

* Make everything compile again

* Switch to westend and print parachain account on startup

* Use MultiSignature etc

* Fix validate block

* Some downward messages work

* Update git reference

* More downward messages integration

* Update test runtime for downward messages

* Enable downward message handler and withdraw send tokens

* Add some docs

* Begin to implement simple XCMP

* More work

* Fixes and make parachain id configurable

* Make parachain ID be part of the genesis

* Finishing the XCMP message demo

* Update and fixes tests

* Update branch
2020-06-18 12:10:20 +02:00
Bastian Köcher b3603d1c13 Update to latest Substrate & Polkadot (#107)
* Update to latest Substrate & Polkadot

* Replace --unsafe-rpc-export with --unsafe-rpc-external

* Add --rpc-methods=Unsafe

Documented in substrate 24486f52929e9e518eeccbc6ad6da70e9e5bdf8a

* typos

* more typo

* fixed rpc expose

* Disable the integration test

Co-authored-by: Cecile Tonglet <cecile.tonglet@cecton.com>
2020-06-05 16:57:02 +02:00
Bastian Köcher 461b971ccc Update to latest Polkadot & Substrate (#75)
* Start fixing compilation errors

* Switch to git version of `WasmBuilder`

* Fix compilation

* More updates

* Adapt to latest Substrate/Polkadot changes
2020-04-06 21:55:32 +02:00
Bastian Köcher 0c3fb0dde7 Update Polkadot chain-spec and switch to new wasm builder (#60) 2020-02-14 11:44:27 +01:00
Cecile Tonglet e880fe43e9 Update polkadot & substrate (#55) 2020-02-10 18:01:59 +01:00