Commit Graph

50 Commits

Author SHA1 Message Date
Robert Habermeier 57aef8eef5 Remove v0 parachains runtime (#1501)
* remove v0 parachains modules and switch to v1 primitives

* get tests compiling for runtime-common

* remove registrar module

* Add a dummy module

* remove runtime-parachains

* mostly remove old parachains code from polkadot-runtime

* remove slots::Trait implementation

* remove sp_std prelude import

* add a ZeroSizedTypeDifferentiator to dummy

* finish porting over polkadot runtime

* ZeroSizedTypeDifferentiator was actually unnecessary

* westend

* kusama

* test-runtime (no dummy modules)

* fix warning

* fix chain-specs

* fix test-service

* test-client

* remove dead import

* remove unused needed_extrinsics parameter

* runtimes compile

* remove rococo-v0

* remove remaining references to Rococo

* bump versions
2020-08-13 15:55:27 +02:00
Shawn Tabrizi 73f09e5154 Unalias Substrate Imports (#1530)
* cargo.toml updates

* session and system

* more

* more

* more

* more

* more

* fix

* compiles

* fix tests

* fix more tests

* fix mock

* fix deleted space

* Update validation/Cargo.toml

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

* Update Cargo.lock

* update rococo

* remove unused warning

* update add benchmarks

* rename weight file

* forgot a file

* Update chain_spec.rs

* Revert "remove unused warning"

This reverts commit 4227cd0d1525286fb466dccb817564c9b37f8645.

* fix merge

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
2020-08-04 13:23:33 +00:00
Kian Paimani c36b47c242 Companion for substrate/6782 (#1523)
* Fix test-runtime

* Remove duplicate tests
2020-08-03 15:26:24 +02:00
Bastian Köcher 277fd75179 Fix transaction payment runtime api companion (#1519)
* Fix transaction payment runtime api companion

Companion for Substrate pr: https://github.com/paritytech/substrate/pull/6792

* 'Update substrate'

Co-authored-by: parity-processbot <>
2020-08-03 09:06:03 +00:00
André Silva a2527913a6 Update latest substrate master (#1468)
* update substrate to latest master

* runtime: bump spec versions
2020-07-24 21:45:03 +00:00
Wei Tang b8de0ff16f Companion PR for #6569 (#1394)
* Update wasm-builder version to 2.0.0

* Fix all crate compile

* Update cargo lock

* Bump runtime impl_version
2020-07-24 12:00:34 +00:00
Robert Habermeier 09f602f8de Include a reference to the validation data in the candidate descriptor (#1442)
* rename GlobalValidationSchedule to GlobalValidationData

* guide: update candidate descriptor to contain validation data hash

* guide: add note in inclusion module about checking validation data hash

* primitives: update CandidateDescriptor to contain new hash

* fix payload computation

* add helpers for computing validation data to runtime modules

* guide: note routines

* inclusion: check validation data hash and fix local_validation_data bug

* add a case to candidate_checks and improve that test substantially

* bump versions

* address review comments

* add a test for including code upgrade

* bump kusama version

* bump westend & polkadot versions
2020-07-23 15:02:24 -04:00
André Silva 0a049e81de runtime: update grandpa equivocation reporting api (#1407)
* runtime: update grandpa equivocation reporting api

* Bump

Co-authored-by: Gav Wood <gavin@parity.io>
2020-07-17 13:01:02 +02:00
Robert Habermeier 3b13cd9a85 Refactor primitives (#1383)
* create a v1 primitives module

* Improve guide on availability types

* punctuate

* new parachains runtime uses new primitives

* tests of new runtime now use new primitives

* add ErasureChunk to guide

* export erasure chunk from v1 primitives

* subsystem crate uses v1 primitives

* node-primitives uses new v1 primitives

* port overseer to new primitives

* new-proposer uses v1 primitives (no ParachainHost anymore)

* fix no-std compilation for primitives

* service-new uses v1 primitives

* network-bridge uses new primitives

* statement distribution uses v1 primitives

* PoV distribution uses v1 primitives; add PoV::hash fn

* move parachain to v0

* remove inclusion_inherent module and place into v1

* remove everything from primitives crate root

* remove some unused old types from v0 primitives

* point everything else at primitives::v0

* squanch some warns up

* add RuntimeDebug import to no-std as well

* port over statement-table and validation

* fix final errors in validation and node-primitives

* add dummy Ord impl to committed candidate receipt

* guide: update CandidateValidationMessage

* add primitive for validationoutputs

* expand CandidateValidationMessage further

* bikeshed

* add some impls to omitted-validation-data and available-data

* expand CandidateValidationMessage

* make erasure-coding generic over v1/v0

* update usages of erasure-coding

* implement commitments.hash()

* use Arc<Pov> for CandidateValidation

* improve new erasure-coding method names

* fix up candidate backing

* update docs a bit

* fix most tests and add short-circuiting to make_pov_available

* fix remainder of candidate backing tests

* squanching warns

* squanch it up

* some fallout

* overseer fallout

* free from polkadot-test-service hell
2020-07-09 21:23:03 -04:00
Cecile Tonglet a4fa71ed17 Make a test crate to make the runtime-test usable (#1258)
Fixes #833
2020-07-09 15:12:52 +02:00
Shawn Tabrizi 099e41dc9e Companion for #6575 (Add WeightInfo) (#1352)
* Add `WeightInfo`

* fix test

* fix tests

* fix more tests
2020-07-08 18:22:22 +02:00
Bastian Köcher 72d0f09659 Companion for #6576 (#1351)
* Companion for #6576

* 'Update substrate'

Co-authored-by: parity-processbot <>
2020-07-06 13:36:00 +02:00
André Silva 19ef40a7c9 babe: enable equivocation reporting on all runtimes (#1330)
* enable BABE equivocation reporting on all runtimes

* runtime: fix parachains mock test runtime

* cargo update -p sp-io

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
2020-07-04 15:19:58 +02:00
Bastian Köcher 934f27d92b Downward & Upward messages (#1266)
* Downward messages, the front-end.

* Move types around to make them accessible from Parachains

* Fix compilation

* Fix branch

* Make it compile for Cumulus

* Update the branch names

* Add default generic parameter

* Implement `Partialeq`

* Move upward messages into the `ValidationResult`

* Support disabling of the runtime api

* Update branch

* Adds support for handling downward messages

* Implement sending XCMP messages as up/downward messages

* service: update to latest ServiceBuilder changes

* Make it compile

* Initial commit

Forked at: ef2aa428d7
Parent branch: origin/master

* Update substrate branch to cecton-update-polkadot-substrate

* Update substrate & polkadot to cumulus-branch

* Reset branch

* Update primitives/src/parachain.rs

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

* Update runtime/common/src/parachains.rs

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

* Update runtime/common/src/parachains.rs

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

* Minor fixes

* Fix wasm build

Co-authored-by: Gav Wood <gavin@parity.io>
Co-authored-by: André Silva <andre.beat@gmail.com>
Co-authored-by: Cecile Tonglet <cecile.tonglet@cecton.com>
Co-authored-by: Robert Habermeier <rphmeier@gmail.com>
2020-07-01 10:20:38 -04:00
Tomasz Drwięga 3d692491a8 CheckEra -> CheckMortality (#1306)
* CheckEra -> CheckMortality

* Update substrate.
2020-06-24 17:25:02 +02:00
Kian Paimani 3c9d72fb57 Companion for substrate/pull/6334 (#1263)
* fix all runtimes and add test'

* Fix build

* Undo changes to lock file?

* Fix runtime test

* Remove unused imports

* cargo update -p sp-io

* Update Cargo.lock

* bump spec version

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
2020-06-18 09:41:39 +02:00
Guillaume Thiolliere 8492e622ae Companion: remove IsCallable make use of introduced in-origin filtering (#1226)
* remove IsCallable make use of in-origin filter

* update lock

* bump version for runtimes as spec as changed

* trigger CI

* Revert "trigger CI"

This reverts commit 5ac58fd42ac50dfb2fcd41ca866c7f6a605c5112.
2020-06-16 10:32:19 +02:00
Gavin Wood 3e5e67855b Admin facility to move claims with council permission. (#1198) 2020-06-09 11:09:17 +02:00
Kian Paimani 491f3bcb88 Comanion for substrate/pull/6173 (#1184)
* Make it work

* Upsub
2020-06-02 19:52:19 +02:00
Kian Paimani 357ed9f3ec companion for substrate/pull/6132 (#1159)
* companion for https://github.com/paritytech/substrate/pull/6132

* Fix more tests

* upsub

* Bump

* Update runtime/common/src/lib.rs

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

* remove cleanup

* Update runtime/westend/src/lib.rs

* Apply suggestions from code review

* Fix build

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
2020-05-27 19:13:56 +02:00
Shawn Tabrizi b407af2672 Companion for Substrate #5961 (on_offence weight) (#1103)
* Add new trait to offences

* companion for substrate#6069

* update to latest changes

* Update Cargo.lock

Co-authored-by: André Silva <andre.beat@gmail.com>
Co-authored-by: Gav Wood <gavin@parity.io>
2020-05-21 14:32:25 +01:00
Alexander Theißen b6829b6d21 Companion for #6076 (Allow fee calculation to happen off-chain) (#1111)
* Switch from Convert to WeightToFeePolynomial

* Bump

Co-authored-by: Gav Wood <gavin@parity.io>
2020-05-21 13:47:55 +02:00
Tomasz Drwięga e08e5ff462 Companion for #6067 (#1110)
* Companion to #6067

* Fix tests?

* Use AvailableBlockLimit instead of hardcoding the value.

* Bump substrate.
2020-05-20 16:03:28 +02:00
Demi Obenour c45b14d1f3 Add ‘transaction_version’ to the signed transaction (#1092)
This allows hardware wallets to know which transactions they can safely
sign.
2020-05-15 00:58:25 +02:00
André Silva 41699f5d6e grandpa: report equivocations on all runtimes (#1000)
* grandpa: report equivocations on all runtimes

* runtime: fix test-runtime compilation

* runtime: enable historical session manager on all runtimes

* runtime: fix indentation

* runtime: use strong key types in KeyOwnerProofSystem definitions

* update substrate

* bump spec_version of runtimes
2020-05-06 19:27:28 +01:00
Shawn Tabrizi f64c2a940f Update Runtime Weights and Fee Calculation (#1064)
* Update Runtime Weights and Fee Calculation

* bump spec

* Order of operations avoids saturation

* Update runtime/polkadot/src/constants.rs

* Use frame consts

* Update Cargo.lock

* Update Cargo.lock

* Update Cargo.lock

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
2020-05-05 09:41:41 +02:00
Kian Paimani 7076651c75 Companion Substaret/5683 (#1039)
* update polkadot

* Fix build

* Bump Substrate

Co-authored-by: Gav Wood <gavin@parity.io>
2020-04-27 20:34:46 +02:00
Shawn Tabrizi 0a10e37c99 Introduce BlockExecutionWeight and ExtrinsicBaseWeight (#1023)
* Update to changes in Substrate

* Fix trait

* Remove `TransactionBaseFee`

* add temporary values for extrinsic base weight and block execution weight

* Update Cargo.lock
2020-04-25 10:04:35 +02:00
Wei Tang 5733869389 Companion PR for #5501 and #5680 (#1012)
* Companion PR for #5501

* Bump runtime versions

* add MaxRegistrars config

* Pull substrate master in PR-5501

* Attempt to fix pin commit again

* update to substrate master

Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>
Co-authored-by: André Silva <andre.beat@gmail.com>
2020-04-24 16:39:40 +01:00
Rakan Alhneiti 2e521d30ea Companion PR to #5182 - Substrate offchain signing (#985)
* Implement offchain::SendTransactionTypes

* Fix test-runtime

* Fix Kusama

* Add SendTransactiontypes to Kusama

* impl SendTransactiontypes for parachains and registrar

* Fix typos

* Provided extrinsic type

* Implement AppCrypto for signing transactions

* Add signing capabilities to runtime

* Fix test runtimes

* Implement CreateSignedtransaction for Test

* Implement signing types for test runtimes

* Fix test runtime create transaction impl

* Fix build

* Bump kusama's spec version

* Update substrate

* Use all_accounts
2020-04-21 18:50:32 +02:00
Bastian Köcher 765c456a10 Fix building master (#1014)
* Fix building master

* Fix westend chainspec
2020-04-21 16:21:11 +02:00
Ashley 14766804c0 Remove usage of substrate-test-runtime. (#969)
* Switch from using the substrate_test_runtime Extrinsic to the polkadot_test_runtime one

* Copy genesismap into test-runtime

* Add UncheckedExtrinsics

* Fix tests :^)

* Remove unused functions from genesismap

* DRY, clean up

* Clean up

* Update service/src/grandpa_support.rs

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

* Fix indentation

* Update runtime/test-runtime/src/genesismap.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
2020-04-21 12:56:22 +02:00
cheme 1a4db93c50 Companion to child trie api change #4857 (#950) 2020-04-21 10:39:35 +02:00
Gavin Wood e303f92f20 Companion for Runtime Semver (#987)
* Companion for Runtime Semver

* Fix
2020-04-17 12:10:58 +02:00
Fedor Sakharov cf7cf4bd7d Adds an offchain call to submit double vote reports (#966)
* Adds an offchain call to submit double vote reports

* Some tweaks

* Remove unnecessary IdentifyAccount impls

* Adds ValidateDoubleVoteReports to test runtime

* sp-application-crypto is only a dev dependency
2020-04-16 16:19:51 +01:00
Shawn Tabrizi 58f992fa33 Companion PR for substrate#5446 (Update Weights to u64) (#994) 2020-04-16 11:31:41 +02:00
Robert Habermeier a5034dbe98 Use strong types in runtime for parachain heads and validation code (#964)
* use stronger types for HeadData and ValidationCode in runtime

* fix weird debug compile error

* fix runtime build

* update invocations invalidation.rs

* fix tests
2020-04-13 10:24:25 +02:00
Pierre Krieger 75ebe7fb2e Companion PR to #5560 - Also includes polkadot#979 and polkadot#986 (#982)
* Companion PR to #5560

* Set priorities.

* Update substrate.

* Fix tests.

* Update Substrate

* Companion of SignedExtension refactor (#5540)

Co-authored-by: Tomasz Drwięga <tomasz@parity.io>
Co-authored-by: Alexander Theißen <alexander.theissen@parity.io>
2020-04-08 16:12:28 +02:00
Kian Paimani 011528278b Enable validate unsigned (#974) 2020-04-06 18:01:30 +02:00
Robert Habermeier 10cec3b591 Upgradeable validation functions (#918)
* upgrade primitives to allow changing validation function

* set up storage schema for old parachains code

* fix compilation errors

* fix test compilation

* add some tests for past code meta

* most of the runtime logic for code upgrades

* implement old-code pruning

* add a couple tests

* clean up remaining TODOs

* add a whole bunch of tests for runtime functionality

* remove unused function

* fix runtime compilation

* extract some primitives to parachain crate

* add validation-code upgrades to validation params and result

* extend validation params with code upgrade fields

* provide maximums to validation params

* port test-parachains

* add a code-upgrader test-parachain and tests

* fix collator tests

* move test-parachains to own folder to work around compilation errors

* fix test compilation

* update the Cargo.lock

* fix parachains tests

* remove dbg! invocation

* use new pool in code-upgrader

* bump lockfile

* link TODO to issue
2020-04-06 10:43:19 -04:00
Bastian Köcher c021f854a2 Ensure that table router is always built (#952)
* Ensure that table router is always build

This pr ensures that the table router is always build, aka the future is
resolved. This is important, as the table router internally spawns tasks
to handle gossip messages. Handling gossip messages is not only required
on parachain validators, but also on relay chain validators to receive collations.

Tests are added to ensure that the assumptions hold.

* Fix compilation

* Switch to closures

* Remove empty line

* Revert "Remove empty line"

This reverts commit 0d4aaba1780aec1c8d61e1d5dcf7768918af02d9.

* Revert "Switch to closures"

This reverts commit d128c4ecc02c911552a3bfd2142b5a4f7b1338ba.

* Hybrid approach

* Rename test

* Make trait crate local
2020-04-03 16:33:52 -04:00
Kian Paimani caa405e1eb Enable Offchain Phragmén. (#940)
* fix for offchain phragmen

* Update unix time stuff
2020-03-26 17:52:10 +01:00
thiolliere 775ce50cc2 Upgrade substrate for new staking API and Telemtry API (#941)
* upgrade substrate

* fix telemetry endpoint

* improve msg
2020-03-26 15:16:55 +01:00
Tomasz Drwięga c8150e1d33 Transaction source (#5366) companion PR (#938)
* Add transaction source.

* Bump substrate.

* Fix tests.
2020-03-26 10:38:01 +01:00
Fedor Sakharov dbb4e987fa Remove Parent Hash to Session mapping (#928)
* Adds a SigningContext type

* Bump spec versions

* Fixes requested changes

* Bump ParachainHost api_version and guard signing_context call

* Improve error message

* If there is no signing_context api use default value

Co-authored-by: Robert Habermeier <rphmeier@gmail.com>
2020-03-25 17:04:05 -04:00
thiolliere 62cddd6fcb Update substrate for new on_initialize syntax and update on_initialize weight (#937)
* update new on_initialize syntax

* update substrate

* update spec_version
2020-03-25 14:10:11 +01:00
Fedor Sakharov 88ba024489 Parachains double vote handler initial implementation. (#840)
* Parachains double vote handler initial implementation.

* Make tests test the actual slashing.

* Implement SignedExtension validation of double vote reports.

* Fixes build after merge

* Review fixes

* Adds historical session proofs

* Review fixes.

* Bump runtime spec_version

* Get the session number from the proof

* Check that proof matches session

* Change signature type on DoubleVoteReport

* Adds docs and removes blank lines

* Removes leftover code

* Fix build

* Fix build after a merge

* Apply suggestions from code review

Co-Authored-By: Robert Habermeier <rphmeier@gmail.com>

* Prune ParentToSessionIndex

* Remove a clone and a warning

Co-authored-by: Robert Habermeier <rphmeier@gmail.com>
Co-authored-by: Gavin Wood <gavin@parity.io>
2020-03-22 09:48:35 +03:00
Gavin Wood 6a7374aca3 Remove migration code. (#910)
* Remove migration code.

* Bump Substrate

* Bump runtime
2020-03-21 13:37:55 +01:00
Gavin Wood a9a1034af5 Refactor storage hashing away from opaque types (#903)
* Refactor storage of various modules.

* The real list of claims

* Migration away from opaque maps

* Fix

* Fix for task executor API change
2020-03-17 11:54:13 +01:00
Ashley 1736c2d576 Add a testnet similar to sc_network_test. (#852)
* Copy over files

* Most network tests work

* Fix copyrights

* Strip out unneeded pallets

* Update test-runtime and remove unused network test things

* Upgrade test runtime

* Strip more things out of the test runtime

* Bump kusama impl version
2020-03-10 15:36:21 +01:00