Commit Graph

6641 Commits

Author SHA1 Message Date
Bastian Köcher dcb8a8504e InMemoryBackend: Make it generic over the key hasher (#11488)
* InMemoryBackend: Make it generic over the key hasher

* Update primitives/state-machine/src/in_memory_backend.rs

Co-authored-by: cheme <emericchevalier.pro@gmail.com>

* Update primitives/state-machine/src/in_memory_backend.rs

Co-authored-by: cheme <emericchevalier.pro@gmail.com>

* FMT

Co-authored-by: cheme <emericchevalier.pro@gmail.com>
2022-05-21 07:24:24 +02:00
Alexandru Vasile 87de1e7e0d RPC: Mark storage methods as blocking (#11459)
* client/api: Make `storage_keys` blocking

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* client/api: Ensure `state_*` RPC methods are blocking

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* client/rpc: Ensure `childstate_*` RPC methods are blocking

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* client/rpc: `ChainApi` make RPC methods sync

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* Remove unused async-traits

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* client/rpc-api: Make chain RPC methods blocking

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* Update client/rpc/src/state/state_full.rs

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

* Add `blocking` to `state_getKeysPaged` RPC call

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* Fix build and warning

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* Remove `async_trait` tidyup

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
2022-05-20 19:16:35 +00:00
dependabot[bot] 4a71017dd3 Bump gaurav-nelson/github-action-markdown-link-check from 1.0.9 to 1.0.14 (#11464)
* Bump gaurav-nelson/github-action-markdown-link-check

Bumps [gaurav-nelson/github-action-markdown-link-check](https://github.com/gaurav-nelson/github-action-markdown-link-check) from 1.0.9 to 1.0.14.
- [Release notes](https://github.com/gaurav-nelson/github-action-markdown-link-check/releases)
- [Commits](https://github.com/gaurav-nelson/github-action-markdown-link-check/compare/7481451f70251762f149d69596e3e276ebf2b236...58f84fd654812d0d8da4e4d4a559eda087daf8ce)

---
updated-dependencies:
- dependency-name: gaurav-nelson/github-action-markdown-link-check
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

* Update .github/workflows/md-link-check.yml

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Denis Pisarev <denis.pisarev@parity.io>
2022-05-20 16:22:01 +02:00
dependabot[bot] 7ce079a6fd Bump actions/checkout from 2 to 3 (#11463)
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-20 15:48:27 +03:00
Alexander Gryaznov c0fb033206 Stabilize ecdsa_ functions (#11486) 2022-05-20 11:20:41 +00:00
Shawn Tabrizi 927019a734 Add Score to Bags List (#11357)
* Add Score to Bags List

* fix ordering

* make compile

* in progress migration

* make migration compile

* remove old check

* remove runtime specific migration

* fix warning

* Apply suggestions from code review

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

* improve migration

* fix

* fix merge

* fmt

* Update migrations.rs

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
2022-05-19 16:40:31 +00:00
Jegor Sidorenko 807a95230b Fix renaming artifacts (#11455) 2022-05-19 13:39:43 +00:00
Kian Paimani 20ef36f1b2 add missing events to elections fallback (#11436)
* add missing events to elections fallback

* Update frame/election-provider-multi-phase/src/lib.rs

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

* Update frame/election-provider-multi-phase/src/lib.rs

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

* add test

* fix

* fmt

* Update frame/support/src/storage/types/nmap.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
2022-05-19 11:54:40 +00:00
kostekIV ba1f31d040 Make fields of EraRewardPoints public (#11422) 2022-05-19 11:10:49 +02:00
Koute dd854c16e2 Switch to pooling copy-on-write instantiation strategy for WASM (#11232)
* Switch to pooling copy-on-write instantiation strategy for WASM

* Fix benchmark compilation

* Fix `cargo fmt`

* Fix compilation of another benchmark I've missed

* Cleanups according to review comments

* Move `max_memory_size` to `Semantics`

* Set `memory_guaranteed_dense_image_size` to `max_memory_size`

* Rename `wasm_instantiation_strategy` to `wasmtime_instantiation_strategy`

* Update the doc-comments regarding the instantiation strategy

* Extend the integration tests to test every instantiation strategy

* Don't drop the temporary directory until the runtime is dropped in benchmarks

* Don't drop the temporary directory until the runtime is dropped in tests
2022-05-19 07:32:53 +00:00
Alexander Theißen b3b7b4ddc7 contracts: Add set_code root dispatchable (#11451)
* Add `set_code` dispatchable

* cargo run --quiet --profile=production  --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark pallet --chain=dev --steps=50 --repeat=20 --pallet=pallet_contracts --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/contracts/src/weights.rs --template=./.maintain/frame-weight-template.hbs

Co-authored-by: Parity Bot <admin@parity.io>
2022-05-18 23:50:22 +00:00
Sergejs Kostjucenko bd225c7938 add GHA support to dependabot (#11448)
* add GHA support to dependabot

* fix formatting

* add labels

* add label
2022-05-19 00:26:44 +03:00
Bastian Köcher 516a8fa433 trie: Optimize keys function (#11457)
* trie: Optimize `keys` function

Instead of iterating the entire state and collecting all keys that match the given prefix, we can
directly use the optimized prefix iterator.

* Add a test
2022-05-18 21:20:47 +02:00
João Paulo Silva de Souza 9dd9a98eff disable check-dependent-cumulus (#11450) 2022-05-18 11:35:15 +00:00
Jegor Sidorenko 236cc98be2 Allow to set the max supply for collection (#11441)
* Allow to set the max supply for collection

* Update error

* Add weights info

* cargo run --quiet --profile=production  --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark pallet --chain=dev --steps=50 --repeat=20 --pallet=pallet_uniques --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/uniques/src/weights.rs --template=./.maintain/frame-weight-template.hbs

* Update frame/uniques/src/lib.rs

Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

Co-authored-by: Parity Bot <admin@parity.io>
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
2022-05-18 11:23:44 +00:00
Alexander Samusev ce77cb1735 [ci] Adjust job order in pipeline test stage with Gitlab DAG (#11442)
* [Do Not Merge] Test gitlab DAG in pipeline

* add jobs for pipeline cancel

* add check-tracing to cancel-pipeline
2022-05-18 13:14:25 +02:00
Nathan Whitaker 3502bc5c1d Return a successful response on repeated small block request (#11429) 2022-05-18 09:42:53 +02:00
Alexander Theißen ef46d84aed contracts: Get rid of #[pallet::without_storage_info] (#11414)
* Implement `MaxEncodeLen` for pallet-contracts storage

* Remove redundant debug println

* Move code len check to PrefabWasmModule::from_code
2022-05-18 07:40:53 +00:00
Qinxuan Chen fe4acb7924 Prune some duplicated dependencies in the dep graph (#11433)
Signed-off-by: koushiro <koushiro.cqx@gmail.com>
2022-05-18 07:23:15 +00:00
Bastian Köcher 74428fa8ac generate_storage_alias: Rewrite as proc macro attribute (#11387)
* generate_storage_alias: Rewrite as proc macro attribute

This rewrites the `generate_storage_alias!` declarative macro as proc-macro attribute. While doing
this the name is changed to `storage_alias`. The prefix can now also be the name of a pallet. This
makes storage aliases work in migrations for all kind of chains and not just for the ones that use
predefined prefixes.

* Fix compilation and FMT

* Moare fixes

* 🤦

* ......

* Rework the syntax and support instancing

* FMT

* Prefix variants with `Storage`

* Make it compile

* Fix where clause on rust stable
2022-05-17 18:45:56 -04:00
Shawn Tabrizi 27f08fec3a Explicitly note that existing AccountIdConversion is truncating and add fallible try_into... (#10719)
* note truncating, add fallible try_into

* fmt

* migrate all to `truncating`

* typo

* uno mas

* Update primitives/runtime/src/traits.rs

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

* check the bytes before and after are sensible

* fmt

* Update lib.rs

* Update primitives/runtime/src/traits.rs

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

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
2022-05-17 21:12:02 +00:00
Nazar Mokrynskyi 558daec697 Remove unnecessary RPC boxing (#11434) 2022-05-17 20:12:59 +00:00
Qinxuan Chen 8bce841d70 frame_support::pallet_prelude: reexport StorageVersion (#11408)
* frame_support::pallet_prelude: reexport StorageVersion

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

* cargo fmt

Signed-off-by: koushiro <koushiro.cqx@gmail.com>
2022-05-17 20:28:34 +02:00
Ross Bulat f64470529e Add MinPointsToBalance to nomination pools (#11377)
* add MinPointsToBalance to pools

* add min_points_to_balance to benchmark mock

* fmt

* comments

Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* check min_points_to_balance.is_zero

* comment

* comment

* storage to constant

* fix

* comment

Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: parity-processbot <>
2022-05-17 14:16:04 -04:00
Qinxuan Chen 8f78f4bb89 Migrate abandoned prettytable-rs to comfy-table (#11430)
* Migrate to comfy-table

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

* disable the default features

Signed-off-by: koushiro <koushiro.cqx@gmail.com>
2022-05-17 16:38:51 +00:00
Niklas Adolfsson 96006322bb fix: regression of sync_state_genSyncSpec #11435 (#11437)
* fix: #11435

* address grumbles: better safe than sorry
2022-05-17 16:29:21 +00:00
Oliver Tale-Yazdi 32d6d1b37c More benchmark machine args (#11428)
* Add ExecutionLimits to sc-sysinfo and return float

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Increase benchmarking duration and add options

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Fix tests

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Fix tests

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
2022-05-17 13:57:08 +00:00
mikolaichuk 8fb6919c84 Small typo (#11392)
Small typo
2022-05-17 12:03:03 +02:00
Shawn Tabrizi 101debbffa remove deprecated (#11432) 2022-05-17 09:50:03 +00:00
Jegor Sidorenko ed7d1e7ac0 Use 'Items' and 'Collections' in uniques pallet (#11389)
* Rename class to collection

* Use "assets collection" instead of "asset collection"

* Rename 'instance' to 'asset'

* Change "asset `collection`" to "`collection`"

* A bit more clean up

* Rename Asset to Item

* Add a storage hack

* Typos

* fix compile

* fmt

* Fix

* cargo run --quiet --profile=production  --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark pallet --chain=dev --steps=50 --repeat=20 --pallet=pallet_uniques --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/uniques/src/weights.rs --template=./.maintain/frame-weight-template.hbs

* Update frame/uniques/src/lib.rs

* cargo run --quiet --profile=production  --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark pallet --chain=dev --steps=50 --repeat=20 --pallet=pallet_uniques --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/uniques/src/weights.rs --template=./.maintain/frame-weight-template.hbs

* Change 'items collection' to 'collection'

* Apply suggestions

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
Co-authored-by: Parity Bot <admin@parity.io>
2022-05-16 13:38:12 +00:00
Koute 359849b169 Make sure the commit hash is always of the same length in impl_version (#11404)
* Make sure the commit hash is always of the same length in `impl_version`

* Add a comment regarding the length of the commit hash
2022-05-16 12:25:15 +00:00
dependabot[bot] 83b774fa7f Bump prost from 0.9.0 to 0.10.3 (#11425)
Bumps [prost](https://github.com/tokio-rs/prost) from 0.9.0 to 0.10.3.
- [Release notes](https://github.com/tokio-rs/prost/releases)
- [Commits](https://github.com/tokio-rs/prost/compare/v0.9.0...v0.10.3)

---
updated-dependencies:
- dependency-name: prost
  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>
2022-05-16 13:09:12 +02:00
Dmitriy Shabanov 9d6a4c4dbd serde::{Serialize, Deserialize} for BoundedVec (#11314)
* serde::{Serialize, Deserialize} for BoundedVec

* Apply suggestions from code review

* FMT

* 🤦

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: Bastian Köcher <info@kchr.de>
2022-05-16 13:03:22 +02:00
dependabot[bot] 4f542131fc Bump ss58-registry from 1.17.0 to 1.18.0 (#11419)
Bumps [ss58-registry](https://github.com/paritytech/ss58-registry) from 1.17.0 to 1.18.0.
- [Release notes](https://github.com/paritytech/ss58-registry/releases)
- [Changelog](https://github.com/paritytech/ss58-registry/blob/main/CHANGELOG.md)
- [Commits](https://github.com/paritytech/ss58-registry/compare/v1.17.0...v1.18.0)

---
updated-dependencies:
- dependency-name: ss58-registry
  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>
2022-05-16 10:01:12 +00:00
yjh bf694d3c0e remove unused error InvalidCode and improve docs (#11383) 2022-05-16 10:25:34 +02:00
dependabot[bot] a5d0a65bf4 Bump scale-info from 2.0.1 to 2.1.1 (#11420)
Bumps [scale-info](https://github.com/paritytech/scale-info) from 2.0.1 to 2.1.1.
- [Release notes](https://github.com/paritytech/scale-info/releases)
- [Changelog](https://github.com/paritytech/scale-info/blob/master/CHANGELOG.md)
- [Commits](https://github.com/paritytech/scale-info/commits/v2.1.1)

---
updated-dependencies:
- dependency-name: scale-info
  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>
2022-05-16 10:07:00 +02:00
dependabot[bot] 4a3758d9b8 Bump log from 0.4.16 to 0.4.17 (#11369)
* Bump log from 0.4.16 to 0.4.17

Bumps [log](https://github.com/rust-lang/log) from 0.4.16 to 0.4.17.
- [Release notes](https://github.com/rust-lang/log/releases)
- [Changelog](https://github.com/rust-lang/log/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/log/commits/0.4.17)

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

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

* Update Cargo.lock

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
2022-05-15 22:21:04 -04:00
dependabot[bot] ebc4c4417a Bump clap from 3.1.6 to 3.1.18 (#11376)
* Bump clap from 3.1.6 to 3.1.17

Bumps [clap](https://github.com/clap-rs/clap) from 3.1.6 to 3.1.17.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/v3.1.6...v3.1.17)

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

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

* Update utils/frame/try-runtime/cli/Cargo.toml

* Update frame/election-provider-support/solution-type/fuzzer/Cargo.toml

* use 3.1.18

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
2022-05-15 21:37:23 -04:00
Kian Paimani 88dbef8336 make pool roles optional (#11411)
* make pool roles optional

* undo lock file changes?

* add migration

* Fix

* fix review comments
2022-05-15 07:25:48 +00:00
Nazar Mokrynskyi 8a45870878 Network sync refactoring (part 3) (#11347)
* Move `light.v1.proto` schema into new crate `sc-network-light`

* Move `sc_network::light_client_requests` and submodule to `sc_network_light::light_client_requests`

* Fix apparently outdated reference in documentation and visibility modifier

* Fix rustdoc check

* Update lock file
2022-05-14 07:17:53 +00:00
Tarek Mohamed Abdalla 685162cfd6 [Tests] [pallet-timestamp] Add tests for OnTimestampSet. (#11323)
* NF: move tests mod to another file

* NF: separate test setup to mock mod

* test: check if OnTimestampSet ran correctly.

* docs: add license header.

* fixup! NF: separate test setup to mock mod

* NF: formatting changes
2022-05-13 17:21:21 +00:00
Bastian Köcher 9cb699bfe9 Make clippy happy on latest nightly (#11403)
Co-authored-by: Vladimir Istyufeev <vladimir@parity.io>
2022-05-12 14:02:29 +03:00
Oliver Tale-Yazdi 0873e1703b Whitelist Transactional key (#11394)
* Make constants public

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Whitelist the transactional layer

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* cargo run --quiet --profile=production  --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark pallet --chain=dev --steps=50 --repeat=20 --pallet=pallet_nomination_pools --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/nomination-pools/src/weights.rs --template=./.maintain/frame-weight-template.hbs

Co-authored-by: Parity Bot <admin@parity.io>
2022-05-12 01:34:38 +00:00
Kian Paimani d06d20d65b New sub-trait to mock staking miner (#11350)
* new separate config trait for staking miner

* fix some docs and stuff

* relax trait bounds

* some cleanup

* Update frame/election-provider-multi-phase/src/unsigned.rs

* add comment

* self review and fix build

* fix docs

Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com>
2022-05-11 17:45:59 +00:00
Shawn Tabrizi 479dc63af4 Only read storage after origin check (#11391)
* only read storage after origin check

* fmt
2022-05-11 11:27:26 +00:00
Niklas Adolfsson 79b1aa5677 jsonrpc http server: expose health endpoint (#11395) 2022-05-11 10:39:39 +00:00
Alexander Samusev 52d9bf24cc [ci] Divide .gitlab-ci.yml into several files (#11333)
* rebase

* update Cargo.lock

* revert Cargo.lock

* fix Cargo.lock from 11384
2022-05-11 11:01:02 +02:00
Kian Paimani ce2124795a fix a few more things with nomination pools (#11373)
* fix a few more things with nomination pools

* add bench

* use weight fn

* cargo run --quiet --profile=production  --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark pallet --chain=dev --steps=50 --repeat=20 --pallet=pallet_nomination_pools --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/nomination-pools/src/weights.rs --template=./.maintain/frame-weight-template.hbs

* allow real root to also set roles

* Update frame/nomination-pools/src/lib.rs

Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Update frame/nomination-pools/src/lib.rs

Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* move out of the closure

* fix a few more things

Co-authored-by: Parity Bot <admin@parity.io>
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
2022-05-10 16:34:59 +00:00
Niklas Adolfsson 6e0ba2da8b update Cargo.lock (#11384) 2022-05-10 16:20:42 +00:00
Joshy Orndorff f6b982d7bc sc-consensus-slots: rename client -> select_chain (#11375)
* rename `client` -> `select_chain`

* missed one

* `cargo fmt` (only the file I touched)

* Missed another one

* Revert "`cargo fmt` (only the file I touched)"

This reverts commit 96a0c6cd131cdc08013f7ddb9e7bf2af34ae3ee3.

* `cargo fmt` (again) (only the LINES I touched)
2022-05-10 18:18:56 +02:00