Commit Graph

2231 Commits

Author SHA1 Message Date
Arkadiy Paronyan 30e3012270 Companion PR for warp sync support. (#3382)
* Update for the new GrandpaAPI

* Update substrate

* Update substrate
2021-08-02 09:59:50 +00:00
Shawn Tabrizi 3445cbecd0 Companion for #9373 (Refactor Benchmarks for Wasm Memory) (#3549)
* cargo update -p sp-io

* fix benchmarking

* fix bridge benchmarks
2021-08-02 09:17:19 +00:00
Shaun W 1b0baab401 XCM simulator (#3538)
* Add xcm-simulator and xcm-simulator-example.

* Abstract xcmp and dmp handling.

* Use mock message queue.

* Xcm simulator example unit tests.

* Use relay chain block number on sending msg.

* Fix typo.

* fmt

* more fmt

* Fix deps.
2021-08-01 15:16:14 +00:00
ferrell-code c615761379 Parachains scheduler.rs to FrameV2 (#3529)
* migration

* migrate runtimes

* storage visability

* Remove unused Call part

* Remove Call part import from parachain mock runtime

* Remove Call part import from test-runtime

Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
2021-07-31 15:54:01 +00:00
ferrell-code c251e1e0a0 Parachains session_info.rs to FrameV2 (#3521)
* migration

* storage visability

* migrate runtimes

* runtimes

* Update runtime/parachains/src/session_info.rs

* Remove Call part import from all runtimes for ParaSessionInfo

* Remove Call part import from runtime/test-runtime/src/lib.rs

* Remove Call part import from parachain mocks

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
2021-07-31 12:17:42 +00:00
Squirrel 4c5b73097c Companion for substrate #9319 (#3456)
* move client consensus code out of primitives

* merging crates

* import tweak

* Fixing build: ServiceFactory is a word...

* updating lock file

* Fixed typo in error message

(to bump build)

* update Substrate

Co-authored-by: parity-processbot <>
2021-07-30 14:02:43 +00:00
ferrell-code 84ca3b2b3b Parachains configuration.rs FrameV2 (#3516)
* migration

* genesis build correctly

* migrate runtimes

* add genesis builds

* expose GenesisBuild

* chainspec migration

* fmt

* check before insert

* Reduce visibility of storage items to crate

Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
2021-07-28 04:56:35 +00:00
ferrell-code 3b87d363e9 Parachains ump.rs to FrameV2 (#3528)
* migrate

* migrate runtimes
2021-07-27 23:07:50 +00:00
Bastian Köcher f5a7affb94 Companion for Substrate#9165 (#3526)
* Companion for Substrate#9165

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

* update Substrate

Co-authored-by: parity-processbot <>
2021-07-27 21:58:59 +00:00
Andronik Ordian e1be821fe1 change ActiveLeaves to contain at most one activated (#3525)
* change ActiveLeaves to contain at most one activated

* fix test
2021-07-27 16:45:15 +02:00
Bernhard Schuster 6519ba987c integrate dispute finality (#3484)
* finality_target adjustments

* fn finality_target

* partially address review comments

* fixins

* more rustic if condition

* fix tests

* fixins

* Update node/core/approval-voting/src/lib.rs

Co-authored-by: Andronik Ordian <write@reusable.software>

* Update node/core/approval-voting/src/lib.rs

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

* review comments part one

* rename candidates -> block_descriptions

* testing outline (incomplete, WIP)

* test foo

* split RelayChainSelection into RelayChainSelection{,WithFallback}, introduce HeaderProvider{,Provider}

* make some stuff public (revert this soon™)

* some test improvements

* slips of pens

* test fixins

* add another trait abstraction

* pending edge case tests + warnings fixes

* more test cases

* fin

* chore fmt

* fix cargo.lock

* Undo obsolete changes

* // comments

* make mod pub(crate)

* fix

* minimize static bounds

* resolve number() as before

* fmt

* post merge fix

* address some nits

Co-authored-by: Andronik Ordian <write@reusable.software>
Co-authored-by: Robert Habermeier <rphmeier@gmail.com>
2021-07-26 17:54:50 +02:00
Andronik Ordian bd9b743872 enable disputes (#3478)
* initial integration and migration code

* fix tests

* fix counting test

* assume the current version on missing file

* use SelectRelayChain

* remove duplicate metric

* Update node/service/src/lib.rs

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

* remove ApprovalCheckingVotingRule

* address my concern

* never mode for StagnantCheckInterval

* REVERTME: some logs

* w00t

* it's ugly but it works

* Revert "REVERTME: some logs"

This reverts commit e210505a2e83e31c381394924500b69277bb042e.

* it's handle, not handler

* fix a few typos

Co-authored-by: Robert Habermeier <rphmeier@gmail.com>
2021-07-26 14:46:31 +02:00
Koute 8fbd3a4f62 Do not leak active head data in statement distribution (#3519) 2021-07-26 13:58:24 +02:00
Alexander Popiak 86f6a173e4 Fix TransactAsset Implementation (#3345)
* convert local AssetNotFound errors into XcmError::AssetNotFound

aims allow the tuple implementation of TransactAsset to iterate properly

* add more XcmError descriptions

* adjust the rest of the TransactAsset tuple implementation to the behavior of can_check_in

* fix copy paste errors

* keep iterating tuple on Unimplemented error in TransactAsset

* add tests for tuple implementation of TransactAsset

* Update xcm/src/v0/traits.rs

Co-authored-by: Andronik Ordian <write@reusable.software>

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
Co-authored-by: Andronik Ordian <write@reusable.software>
2021-07-26 10:43:14 +00:00
Zeke Mostov aac9d77ee2 Reduce staking miner reward (companion substrate/pull/9395) (#3465)
* Reduce staking miner reward

* Add EOF

* Fix stuff

* remove import

* Add tyoe

* remove redundant stuff

* update Substrate

Co-authored-by: kianenigma <kian@parity.io>
Co-authored-by: parity-processbot <>
2021-07-23 09:58:29 +00:00
ferrell-code 7788de8164 Parachains shared.rs to Frame V2 (#3425)
* gotta migrate them all

* migrate rococo construct_runtime

* trigger ci

* fix warnings

* get mocks to work

* add pallet to test runtime

* comments

* calm down mr tabrizi lol
2021-07-22 21:59:31 +00:00
ferrell-code 26330640d2 Parachains hrmp.rs to Frame V2 (#3475)
* migrate

* migrate runtimes

* runtimes compile

* ci

* trigger ci
2021-07-22 10:21:22 +00:00
Shaun W 4bb487985a Migrate slots pallet to pallet attribute macro. (#3218)
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
2021-07-22 09:19:58 +00:00
Guillaume Thiolliere 5e320614c4 Improve test in bridge (#3507)
* improve test

* better doc
2021-07-22 07:39:32 +00:00
ferrell-code 18f467c865 parachain dmp.rs to Frame V2 (#3426)
* migration

* fix warning

* change runtimes

* extra line

* another double space lol

* add dmp in test runtime

* test runtime

* Adjust visibility on storage items

Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
2021-07-22 04:49:21 +00:00
ferrell-code cf904c209f Parachains inclusion.rs to Frame V2 (#3440)
* frame v2

* migrate runtimes

* migrate more

* comments

* docs

* cleanup

* Adjust visibility on storage items

Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
2021-07-22 04:36:29 +00:00
Lldenaurois 1858ff57fc Dispute coordinator - Recover disputes on startup (#3481)
* node/dispute-coordinator: Introduce resume capability

This commit introduces a resume capability for the
dispute coordinator subsystem. Specifically, this will allow
to recover data for disputes for which we have no local statements.

* node/dispute-coordinator: Add resume function to TestState and modify Harness

This commit modifies the TestHarness to return a TestState. We subsequently
define a resume function on TestState that allows to interrupt the test and
test specifically for behavior on startup of the subsystem.

* node/dispute-coordinator: Implement resume functionality

This commit implements the resume functionality for the subsystem.
In addition, we will forward any DisputeParticipation::Participate
message in order to ensure that disputes for which we do not have
local statements may be recovered in due time.

* Address Feedback

* Modify to run handle_leaf on first import

* Modify missing_local_statement logic

* node/dispute-coordinator: Add simple test to ensure we adequately
handle local_statements that are not missing.

* Add missing keystore tests
2021-07-21 16:36:43 -05:00
Hernando Castano 7aaaa9ec08 Use correct syntax for owning all files in a folder (#3510)
From the GitHub docs:

> # The `docs/*` pattern will match files like
> # `docs/getting-started.md` but not further nested files like
> # `docs/build-app/troubleshooting.md`.
> docs/*  docs@example.com
>
> # In this example, @octocat owns any file in an apps directory
> # anywhere in your repository.
> apps/ @octocat
2021-07-21 20:27:23 +00:00
Andreas Doerr 310aa6f321 Add wococo-local chain spec (#3509) 2021-07-21 22:19:26 +02:00
Robert Habermeier 675f71a882 Dispute vote filtering for block authors (#3498)
* guide: filter_multi_dispute_data

* guide: elaborate

* Implementation of dispute data filtering

* tests for filtering

* don't use std, you fool!

* use swap_remove

* Update runtime/parachains/src/disputes.rs

Co-authored-by: Andronik Ordian <write@reusable.software>

* use btreeste

* address API nit

Co-authored-by: Andronik Ordian <write@reusable.software>
2021-07-21 21:48:07 +02:00
dependabot[bot] 1fd956079a Bump indexmap from 1.6.1 to 1.7.0 (#3497)
Bumps [indexmap](https://github.com/bluss/indexmap) from 1.6.1 to 1.7.0.
- [Release notes](https://github.com/bluss/indexmap/releases)
- [Commits](https://github.com/bluss/indexmap/compare/1.6.1...1.7.0)

---
updated-dependencies:
- dependency-name: indexmap
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-07-21 10:56:14 +00:00
Xiliang Chen 88a4fd0351 Companion for substrate #9315 (#3477)
* fix

* update
2021-07-20 20:59:54 +00:00
Bastian Köcher b94f294f4d Update secp256k1 and remove unrequired usage (#3502)
* Update secp256k1 and remove unrequired usage

* Rename missed old crate names

* Enable required feature
2021-07-20 12:21:27 -05:00
dependabot[bot] d3adc575a6 Bump libc from 0.2.91 to 0.2.98 (#3496)
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.91 to 0.2.98.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.91...0.2.98)

---
updated-dependencies:
- dependency-name: libc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-07-19 19:31:55 +00:00
dependabot[bot] 6ba5d53621 Bump slotmap from 1.0.2 to 1.0.5 (#3495)
Bumps [slotmap](https://github.com/orlp/slotmap) from 1.0.2 to 1.0.5.
- [Release notes](https://github.com/orlp/slotmap/releases)
- [Changelog](https://github.com/orlp/slotmap/blob/master/RELEASES.md)
- [Commits](https://github.com/orlp/slotmap/compare/v1.0.2...v1.0.5)

---
updated-dependencies:
- dependency-name: slotmap
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-07-19 18:54:58 +00:00
Andreas Doerr 67e671ff75 Gossip rebroadcast rate limiter (#3494) 2021-07-19 18:20:29 +00:00
Andronik Ordian d5b5bd23bc dependabot: ignore another git dep (#3493) 2021-07-19 20:17:51 +02:00
Bernhard Schuster 97dc1de782 add rustfmt toml (#3491)
* feat: rustfmt.toml

Copied from substrate.

* avoid normalize

It has some odd side effects converting // to /* */ instead of the other way round. See https://github.com/rust-lang/rustfmt/issues/4909 .
2021-07-19 19:12:54 +02:00
Robert Habermeier ec98120f0e Disputes runtime (#2947)
* disputes module skeleton and storage

* implement dispute module initialization logic

* implement disputes session change logic

* provide dispute skeletons

* deduplication & ancient check

* fix a couple of warnings

* begin provide_dispute_data impl

* flesh out statement set import somewhat

* move ApprovalVote to shared primitives

* add a signing-payload API to explicit dispute statements

* implement statement signature checking

* some bitflags glue for observing changes in disputes

* implement dispute vote import logic

* flesh out everything except slashing

* guide: tweaks

* declare and use punishment trait

* punish validators for inconclusive disputes

* guide: tiny fix

* guide: update docs

* add disputes getter fn

* guide: small change to spam slots handling

* improve spam slots handling and fix some bugs

* finish API of disputes runtime

* define and deposit `RevertTo` log

* begin integrating disputes into para_inherent

* use precomputed slash_for/against

* return candidate hash from process_bitfields

* implement inclusion::collect_disputed

* finish integration into rest of runtime

* add Disputes to initializer

* address suggestions

* use pallet macro

* fix typo

* Update runtime/parachains/src/disputes.rs

* add test: fix pruning

* document specific behavior

* deposit events on dispute changes

* add an allow(unused) on fn disputes

* add a dummy PunishValidators implementation

* add disputes module to Rococo

* add disputes module to westend runtime

* add disputes module to test runtime

* add disputes module to kusama runtime

* guide: prepare for runtime API for checking frozenness

* remove revert digests in favor of state variable

* merge reversions

* Update runtime/parachains/src/disputes.rs

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

* Update runtime/parachains/src/disputes.rs

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

* Update runtime/parachains/src/disputes.rs

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

* add byzantine_threshold and supermajority_threshold utilities to primitives

* use primitive helpers

* deposit revert event when freezing chain

* deposit revert log when freezing chain

* test revert event and log are generated when freezing

* add trait to decouple disputes handling from paras inherent handling

* runtime: fix compilation and setup dispute handler

* disputes: add hook for filtering out dispute statements

* disputes: add initializer hooks to DisputesHandler

* runtime: remove disputes pallet from all runtimes

* tag TODOs

* don't import any dispute statements just yet...

* address grumbles

* fix spellcheck, hopefully

* maybe now?

* last spellcheck round

* fix runtime tests

* fix test-runtime

Co-authored-by: thiolliere <gui.thiolliere@gmail.com>
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
Co-authored-by: André Silva <andrerfosilva@gmail.com>
2021-07-19 16:49:19 +00:00
dependabot[bot] 4636daa7ce Bump async-process from 1.0.1 to 1.1.0 (#3122)
Bumps [async-process](https://github.com/smol-rs/async-process) from 1.0.1 to 1.1.0.
- [Release notes](https://github.com/smol-rs/async-process/releases)
- [Changelog](https://github.com/smol-rs/async-process/blob/master/CHANGELOG.md)
- [Commits](https://github.com/smol-rs/async-process/compare/v1.0.1...v1.1.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-07-19 11:27:15 -05:00
Pierre Besson 661cfbcfd3 remove the kubernetes helm chart (#3483) 2021-07-19 09:32:48 +02:00
Denis Tsai 633dfbcfb0 added pallet-proxy in rococo feature dependencies (#3486) 2021-07-19 08:52:27 +02:00
Tomasz Drwięga 79174e0b7e Update BEEFY+MMR integration. (#3480)
* Update MMR leaf.

* Revert to older substrate.

* Add version docs.

* Fix spellcheck.
2021-07-16 15:13:20 +02:00
Seun Lanlege 2c53f686f2 more verbose asserts (#3476)
Co-authored-by: CI system <>
2021-07-15 21:12:15 +01:00
Chevdor 2ff88ec225 ci: use srtool-actions to build runtimes (#3423)
* ci: use chevdor/srtool-actions to build runtimes

* cleanup
2021-07-15 19:32:55 +02:00
Bernhard Schuster c30774a264 overseer gen minor chore fixes (#3479) 2021-07-15 16:51:04 +02:00
Andreas Doerr afa1b53910 Fix noting rounds for non-authorities (#3474) 2021-07-15 08:25:13 +00:00
Zeke Mostov ed9208b749 Upgrade staking-miner to use jsonrpsee v0.3 (#3466) 2021-07-14 17:30:46 +00:00
Denis Pisarev fc253e6e4d WIP: CI: add spellcheck (#3421)
* 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>
2021-07-14 19:22:58 +02:00
Qinxuan Chen f6305d29be runtime(rococo): remove useless Call of pallet-mmr (#3350)
Signed-off-by: koushiro <koushiro.cqx@gmail.com>
2021-07-14 09:26:12 +00:00
Seun Lanlege ab9c86d5e7 Introduce test runner biolerplate (#2609)
* adds test-runner boilerplate

* revert to master

* Update node/test/runtime/Cargo.toml

Co-authored-by: Andronik Ordian <write@reusable.software>

* fix warning

* use polkadot_development_config

* remove vestigial code

* ...

* remove unused dependencies

* adds simnet binary

* adds simnet binary

* merged with remote

* dummy to check pipeline

* add 2 docker files and a build cmd

* adds logging

* atempt to use binary from build host

* fix simnet-binary

* fix docker commands

* switch branches

* ...

* update docker file

* update the dockerfile 2

* add some message in the cheatsheet

* add repo to chaches stage also

* update paths

* do only 1 stage build

* add time when build cmd started

* remove debugg commands

* polkadot-simnet-substrate-working-version-v1

* reduce size of polkadot-simnet image

* update test runner api

* update test-runner

* ...

* revert to master

* Merge branch 'master' of github.com:paritytech/polkadot into substrate-test-runner

* bump impl version

* remove unused imports, fix test

* was_binary.to_vec()

* Apply suggestions from code review

Co-authored-by: Andronik Ordian <write@reusable.software>

* ...

* remove unused import

* remove unused import

* adds post upgrade test

* dry code

* revert spec_version

* update Cargo.lock

* tested and it works

* compare runtime spec version

* fix spaces, remove docker files

* replace spaces with tabs

* Update runtime/polkadot/src/lib.rs

Co-authored-by: Andronik Ordian <write@reusable.software>

* ...

* revert Cargo.lock

* bump cargo.lock

Co-authored-by: Andronik Ordian <write@reusable.software>
Co-authored-by: radupopa2010 <radupopa2010@yahoo.com>
Co-authored-by: CI system <>
2021-07-13 16:45:27 +01:00
Qinxuan Chen 41045d891a Companion for substrate#9197 (#3359)
* Companion for substrate#9197

Signed-off-by: koushiro <koushiro.cqx@gmail.com>

* update Substrate

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
Co-authored-by: parity-processbot <>
2021-07-13 08:05:48 +00:00
Lldenaurois dc0927787e Dispute coordinator overlay (#3462)
* node/dispute-coordinator: Modify db to return SubsystemResult.

In preparation of moving to the overlayed backend pattern, this commit
moves the db to return SubsystemResult values.

* node/dispute-coordinator: Add the Backend and OverlayedBackend.

This commit adds the backend and overlayed backend structs to the
dispute-coordinator subsystem.

* node/dispute-coordinator: Implement backend and overlayed-backend.

This commit finalizes the move from the previous transactional model
to the common overlay pattern in subsystem persistency. This can be
observed in the ApprovalVoting and ChainSelection subsystems.

* Add module docs + license

* Touchup merge
2021-07-12 23:42:51 -04:00
Kian Paimani 7948eae54b Small tweaks to staking miner (#3460)
* Fix miner

* fix miner

* Update utils/staking-miner/src/monitor.rs

* Fix width
2021-07-13 02:02:25 +00:00
Lldenaurois 2d66b8f256 Dispute Coordinator: Batch queries (#3459)
* disputes: Allow batch queries in dispute-coordinator

This commit moves to batch queries when responding to QueryCandidateVotes
messages. This simplifies the code in the provisioner and dispute-coordinator
by no longer requiring to make use of a FuturesOrdered when awaiting multiple
quries. Instead, the provisioner need only request the batch itself.

* node/approval-voting: Address Feedback to fail on query element missing.

* Address feedback

* Fix implementer's guide
2021-07-12 20:06:14 -05:00