Commit Graph

1869 Commits

Author SHA1 Message Date
Shawn Tabrizi 222520acc5 Companion for Substrate #6815 (Dynamic Whitelist) (#1612)
* Enable Dynamic Whitelisting

* "Update Substrate"

Co-authored-by: parity-processbot <>
2020-08-19 20:05:33 +00:00
Robert Habermeier 262574fc49 Implement validation data refactor (#1585)
* update primitives

* correct parent_head field

* make hrmp field pub

* refactor validation data: runtime

* refactor validation data: messages

* add arguments to full_validation_data runtime API

* port runtime API

* mostly port over candidate validation

* remove some parameters from ValidationParams

* guide: update candidate validation

* update candidate outputs

* update ValidationOutputs in primitives

* port over candidate validation

* add a new test for no-transient behavior

* update util runtime API wrappers

* candidate backing

* fix missing imports

* change some fields of validation data around

* runtime API impl

* update candidate validation

* fix backing tests

* grumbles from review

* fix av-store tests

* fix some more crates

* fix provisioner tests

* fix availability distribution tests

* port collation-generation to new validation data

* fix overseer tests

* Update roadmap/implementers-guide/src/node/utility/candidate-validation.md

Co-authored-by: Peter Goodspeed-Niklaus <coriolinus@users.noreply.github.com>

Co-authored-by: Peter Goodspeed-Niklaus <coriolinus@users.noreply.github.com>
2020-08-18 14:41:40 +02:00
Shawn Tabrizi ae37a00c17 Companion for Substrate 6868 (WeightInfo for System, Utility, and Timestamp) (#1606)
* fix compile warning

* remove tests for weights

* add custom weights

* "Update Substrate"

Co-authored-by: parity-processbot <>
2020-08-18 10:04:52 +02:00
Andronik Ordian dffefac54e move AssignmentKind and CoreAssigment to scheduler (#1571) 2020-08-17 19:26:13 +02:00
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
Fedor Sakharov bd85b3c7d3 Add an Origin to parachains v1 (#1542) 2020-08-05 22:24:20 +03:00
Gavin Wood 03e696ab76 Bump Substrate, version (#1541)
* Bump Substrate, version

* 0.8.22
2020-08-05 16:46:04 +02:00
Guillaume Thiolliere 106eee7bf1 Companion PR: add weightinfo for democracy (#1522)
* add weight for democracy

* update companion

* update companion

* remove democracy weight tests

* fix import

* fix name

* fix merge

* cargo update -p sp-io

* fix compile

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
2020-08-04 21:17:23 +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
Bastian Köcher c01aa8bae8 Rewrite client handling (#1531)
* Rewrite client handling

We are supporting muliple polkadot-like chains and all have different
client types. This pr reworks the client handling by having all of them
in one enum combined. Besides that, there is added a special trait
`ExecuteWithClient` to use the internal client.

* Apply suggestions from code review

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

* Up the versions

* Fix Cargo.lock

* Fix merge conflict

* ......................

* ....v2

* yep

* I'm dumb...

* Browser lol

Co-authored-by: Robert Habermeier <rphmeier@gmail.com>
2020-08-04 14:53:47 +02:00
Bastian Köcher 5a4bca765e Add Rococo test network (#1363)
* Add Rococo test network

* Correct license header

* Add bootNodes address

* Fix compile errors

* Change bootNodes

* Change rococo bootNodes

* Add new bootNodes

* Fix bootNodes typo

* Remove public telemetry

* Add rococo-local chain spec

* Remove staking

* Remove staking from chain spec

* use rococo-staging chain spec and preserve bootnodes

* Same but with --raw

* update chain name and remove telemetry

* Empty commit to re-trigger CI

* Fix revision (temp. until I merge master)

* Revert to branch = master to avoid conflicts

* Revert to branch = master to avoid conflicts

* Disable test (temp)

* Revert to branch = master to avoid conflicts

* Revert to branch = master to avoid conflicts

* Change bootNodes IPs for second rococo network

* Revert "Disable test (temp)"

This reverts commit a159f12e3131d1a25dabb1a4d2834642f2bcdc26.

* Revert purchase

* Update chain spec

* FUUU

* Update service/src/lib.rs

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

* Update runtime/rococo/src/lib.rs

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

* Fix compilation

Co-authored-by: Evaldo <contato@evaldofelipe.com>
Co-authored-by: David Dorgan <david@parity.io>
Co-authored-by: Cecile Tonglet <cecile.tonglet@cecton.com>
Co-authored-by: Robert Habermeier <rphmeier@gmail.com>
2020-08-04 09:41:39 +00:00
Fedor Sakharov 124c699cd4 Cleanup upcoming paras (#1527)
* Cleanup upcoming paras

* Also remove pending genesis

* Not there but here
2020-08-03 20:11:06 +00:00
Fedor Sakharov a9e3a1b11d Sudo wrapper for paras (#1517)
* Sudo wrapper for paras

* Move to separate module

* Add some docs
2020-08-03 21:32:57 +02: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
Robert Habermeier 94a6d6e65a rename merged rococo to rococo-v1 (#1521)
* rename rococo to rococo-v1

* update Cargo.lock
2020-08-02 23:36:07 +02:00
Fedor Sakharov 047e2fdb21 Parachains-runtime (#1505)
* Initial commit

* v0 to v1 primitives and remove attestations

* Review fixes

* implement candidate_events

* remove dead code
2020-07-31 23:42:10 +03:00
Robert Habermeier 64bf3a1e6e reduce slash defer durations (#1504)
* reduce slash defer durations

* update comments

* tests
2020-07-30 15:25:21 -04:00
Shawn Tabrizi 80303e99ea Companion for #6610 (Balances Weight Trait) (#1425)
* Update for balances weights

* remove unneeded tests

* Add file headers

* cargo update -p sp-io
2020-07-30 18:43:55 +02:00
Gavin Wood 756f95c407 Update Substrate, bump versions, clean up sort (#1496)
* Sort cleanups

* Bump versions
2020-07-29 14:31:31 +02:00
Bastian Köcher 8f3317d056 Update scale codec to latest version to fix bug in future rustc version (#1491)
* Update scale codec to latest version to fix bug in future rustc version

Companion of: https://github.com/paritytech/substrate/pull/6746

* 'Update substrate'

Co-authored-by: parity-processbot <>
2020-07-28 20:43:38 +00:00
joe petrowski 65797c001c update comments (#1445) 2020-07-27 12:51:18 +02:00
Bastian Köcher fa598f176b Companion for #6726 (#1469)
* Companion for #6726

* Spaces

* 'Update substrate'

Co-authored-by: parity-processbot <>
2020-07-26 13:16:09 +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
Gavin Wood 1ff810ee10 Bump Substrate, version (#1456)
* Bump Substrate

* Bump
2020-07-22 19:43:27 +02:00
Cecile Tonglet 42ddcada02 Companion PR (#1423) 2020-07-22 09:16:14 +02:00
Andronik Ordian e7a420be0f Scheduler: handle timeouts for no group rotation (#1439)
* runtime: rename parachain_rotation_frequency to group_rotation_frequency

* scheduler: handle timeouts for no group rotation

* scheduler: apply fixes from code review

* scheduler: remove my comments
2020-07-21 20:08:01 -04:00
Xiliang Chen 143f5600f4 update impl_outer_origin (#1444) 2020-07-21 20:02:41 +02:00
Gavin Wood 3f57b1c6e8 Enable transfers (#1443)
* Enable transfers

Also quash any conviction from Referendum Zero; Sudo was always
going to have been removed so lock-voting doesn't make sense in
this case.

* Add test for migration; remove superfluous comment.

* Fixes

* Bump

* Weekly elections
2020-07-21 12:19:23 +02:00
Gav Wood 9aadb5d499 Bump Polkadot runtime version 2020-07-20 19:13:09 +02:00
Gav Wood d14170c8e0 Fix typo in governance params 2020-07-20 19:11:26 +02:00
Gavin Wood 760d49c551 Remove Sudo (#1437)
* Remove Sudo

NOTE: To ensure minimal index changes to pre-existing pallet deployments,
this is done with a "swap_remove" style; the previous last pallet
(Purchase), which is hitherto unused, has been shifted into the old index
of Sudo.

* Remove CC1 designation.

* Fixes

* Bump

* Fixes

* Fixes

* Fixes

* Fixes

* Fixes

* Fixes

* Fixes

* Fixes

* Fixes

* Fixes
2020-07-20 17:47:09 +02:00
Gavin Wood c5bf161738 Bump version, enable full governance (#1433) 2020-07-20 12:18:27 +02:00
Robert Habermeier dddde219a2 Implement Runtime APIs (#1411)
* create a README on Runtime APIs

* add ParaId type

* write up runtime APIs

* more preamble

* rename

* rejig runtime APIs

* add occupied_since to `BlockNumber`

* skeleton crate for runtime API subsystem

* improve group_for_core

* improve docs on availability cores runtime API

* guide: freed -> free

* add primitives for runtime APIs

* create a v1 ParachainHost API trait

* guide: make validation code return `Option`al.

* skeleton runtime API helpers

* make parachain-host runtime-generic

* skeleton for most runtime API implementation functions

* guide: add runtime API helper methods

* implement new helpers of the inclusion module

* guide: remove retries check, as it is unneeded

* implement helpers for scheduler module for Runtime APIs

* clean up `validator_groups` implementation

* implement next_rotation_at and last_rotation_at

* guide: more helpers on GroupRotationInfo

* almost finish implementing runtime APIs

* add explicit block parameter to runtime API fns

* guide: generalize number parameter

* guide: add group_responsible to occupied-core

* update primitives due to guide changes

* finishing touches on runtime API implementation; squash warnings

* break out runtime API impl to separate file

* add tests for next_up logic

* test group rotation info

* point to filed TODO

* remove unused TODO [now]

* indentation

* guide: para -> para_id

* rename para field to para_id for core meta

* remove reference to outdated AvailabilityCores type

* add an event in `inclusion` for candidates being included or timing out

* guide: candidate events

* guide: adjust language

* Candidate events type from guide and adjust inclusion event

* implement `candidate_events` runtime API

* fix runtime test compilation

* max -> min

* fix typos

* guide: add `RuntimeAPIRequest::CandidateEvents`
2020-07-18 16:01:51 -04:00
Shawn Tabrizi 04f9c6ece8 Add purchase module to westend (#1429) 2020-07-17 15:18:02 +02:00
Shawn Tabrizi 3fa224bfa4 Pallet for Purchase (#1369)
* initial mock

* remove statement

* Merge branch 'master' into shawntabrizi-crowdsale

* only work for dead accounts

* Revert "Merge branch 'master' into shawntabrizi-crowdsale"

This reverts commit 5d26bc22f30fdbc58854dc64398bddc1f19c4d24.

* update storage name

* Re-mock

* Update comment

* payouts

* test signature verification

* Update wording

* fix tests

* support both free and locked balance

* Single statement set in configuration trait

* Configurable purchase limit, initiated status

* Account creation tests

* make note about `max_amount` check

* Update validity status tests

* update balance tests

* payment test

* finish tests

* enable in runtime

* Test and verify ed25519

* make purchase pallet more configurable on the fly

* Remove runtime check on purchase amount.

* clean up trait

* add basic weights

* add extra super saftey check for vesting

* Add vat tracking

* remove unused const

* Update to W3F Origins

* remove stale comment

* Support existing accounts w/o existing vesting schedule

* Update runtime/common/src/purchase.rs

Co-authored-by: Gavin Wood <gavin@parity.io>

* Add support for partially unlocked portion of purchased DOTs

* add trait import

* Expose constants from pallet

* Fixes

* Fixes

* Update runtime/polkadot/src/lib.rs

Co-authored-by: Gavin Wood <gavin@parity.io>
2020-07-17 14:23:56 +02: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
Gavin Wood 63a655afb0 Define BurnDestination, Kusama Treasury burns to Society (#6671) (#1421)
* Define BurnDestination, Kusama Treasury burns to Society.

* Fixes

* Remove the council elections enabling.

* Bump

* whitespace
2020-07-17 12:36:36 +02:00
Andronik Ordian 1ea2b27403 inclusion: split CandidatePendingAvailability according to the guide (#1413)
* inclusion: split PendingAvailability storage into descriptor and commitments

* inclusion: fix tests

* implementers-guide: update CandidatePendingAvailability type

* inclusion: simplify process_candidates a bit

* implementers-guide: more updates to the inclusion module

* inclusion: fix copy-paste errors in tests

* inclusion: revert some of the changes

* inclusion: lazy commitments loading and a test

* guide: revert enact_candidate changes

* inclusion: test process_bitfield for no commitments

* Grammar

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

Co-authored-by: Robert Habermeier <rphmeier@gmail.com>
2020-07-16 21:27:49 -04:00
Gavin Wood 786cbacb40 Enable council elections (#1422) 2020-07-16 14:19:36 -04:00
Gavin Wood 327ada997d Bump Substrate & versions (#1406) 2020-07-14 19:25:26 +02:00
Gavin Wood 7a8673f057 Tweak poll end block (#1397) 2020-07-13 13:08:32 +02:00
Gavin Wood 97acfa76d1 Introduce polling pallet (#1391)
* Initial draft

* Initial build

* Integrate into runtime

* Fix warnings.

* Initial tests

* Fixes and tests

* Update runtime/polkadot/src/poll.rs

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

* Expose End constant

* Docs

* Update runtime/polkadot/src/lib.rs

Co-authored-by: kaichao <kaichaosuna@gmail.com>

* Update runtime/polkadot/src/poll.rs

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>

* Clean up filters

* Warnings

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: kaichao <kaichaosuna@gmail.com>
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
2020-07-11 17:04:10 +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
Fedor Sakharov c119627835 CandidateBackingSubsystem (#1312)
* Updates guide for CandidateBacking

* Move assignment types to primitives

* Initial implementation.

* More functionality

* use assert_matches

* Changes to report misbehaviors

* Some fixes after a review

* Remove a blank line

* Update guide and some types

* Adds run_job function

* Some comments and refactorings

* Fix review

* Remove warnings

* Use summary in kicking off validation

* Parallelize requests

* Validation provides local and global validation params

* Test issued validity tracking

* Nits from review
2020-07-09 16:23:58 -04:00
Robert Habermeier 8130d8210e Delay session changes' effects on parachains by 1 block (#1354)
* note that the initializer is responsible for buffering session changes

* amend initializer definition to include session change buffering

* support buffered changes before `on_initialize`

* implement and test session buffering

* Update roadmap/implementors-guide/src/runtime/README.md

Co-authored-by: Bernhard Schuster <bernhard@ahoi.io>

* expand on how this affects misbehavior reports

* fix typo

Co-authored-by: Bernhard Schuster <bernhard@ahoi.io>
2020-07-09 09:43:26 -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