Commit Graph

6259 Commits

Author SHA1 Message Date
Bastian Köcher 82c9690c3e Remove some last AccountId32::default() leftovers (#10655)
* Remove some last `AccountId32::default()` leftovers

As we removed `Default` of account id, we have overseen some last bits. This pr removes these last
bits.

* Fix
2022-01-21 20:21:36 +01:00
Jimmy Chu 39d5c357af Script for publishing rustdocs at gh-pages (#10604)
* wip

Signed-off-by: Jimmy Chu <jimmychu0807@gmail.com>

* Added the rustdocs-release script

Signed-off-by: Jimmy Chu <jimmychu0807@gmail.com>

* updated gitlab-ci script

Signed-off-by: Jimmy Chu <jimmychu0807@gmail.com>

* Updated to set NIGHTLY to false by default

Signed-off-by: Jimmy Chu <jimmychu0807@gmail.com>

* Added documentation

Signed-off-by: Jimmy Chu <jimmychu0807@gmail.com>
2022-01-21 18:32:45 +01:00
Oliver Tale-Yazdi 4880741eaa Add MaxEncodeLen to implement_per_thing! (#10715)
* fix doc

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

* Add MaxEncodedLen to implement_per_thing!

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

* Test that Percent et.al. can be used in Storage.

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

* Add comment

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

* Revert "Test that Percent et.al. can be used in Storage."

This reverts commit 52558afea6f9b53fb07521f1b6393bc320d21dfc.

* Test MaxEncodedLen in implement_per_thing!

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

* Revert "Add comment"

This reverts commit 27a96f6e527f71a57ace289c041de514edbe9104.
2022-01-21 17:08:35 +00:00
Bastian Köcher f41ef340e5 wasm-builder: Improve workspace handling (#10700)
When building a wasm binary from a different repo inside a local workspace, we did not used the
correct `Cargo.toml` to find the correct patches and features. The solution to this is to just walk
up from the target directory until we find the workspace we are currently compiling. If this
heuristic isn't working, we print a warning and let the user set an env variable
`WASM_BUILD_WORKSPACE_HINT` to tell the `wasm-builder` where the actual workspace is.
2022-01-21 16:43:21 +00:00
Sacha Lansky e1cc9c2d5b Fix typo (#10714) 2022-01-21 16:28:43 +00:00
Shawn Tabrizi 4d7d1eaaf8 dont increase the allocated size of vec (#10701) 2022-01-20 18:17:16 +00:00
Oliver Tale-Yazdi 362a6d9b28 Require MaxEncodedLen per default (#10662)
* Remove generate_storage_info

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

* Add without_storage_info where needed

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

* Update doc tests

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

* Add more without_storage_info

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

* fix TryBuild

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

* fix TryBuild tests

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
2022-01-20 11:16:04 +00:00
Nazar Mokrynskyi 6b60c3dbff Relax types on DigestItemRef, such that byte slices can be used in addition to vector references (#10536)
* Relax types on `DigestItemRef`, such that byte slices can be used in addition to vector references

* Apply clippy suggestions
2022-01-20 11:02:22 +01:00
Kian Paimani 1344e43d2d Remove all stale on_runtime_upgrade hooks in the runtime (#10650)
* Remove all stale on_runtime_upgrade hooks in the runtime

* add docs

* cleanup

* fix warn

* fix more warnings

* fix offence test

* overwrite the damn UItest
2022-01-19 20:58:47 +01:00
Oliver Tale-Yazdi c8c46fea96 Improve usability of add+list_benchmark! (#10592)
* Improve usability of add_benchmark and list_benchmark.

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

* node-template: use new define_benchmarks syntax

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

* make CI happy

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

* remove old imports

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

* fix TryBuild tests

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

* Revert "fix TryBuild tests"

This reverts commit 82ea52fd25c0ef5efa46669217694835a7404d4e.

* review: remove blank lines

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
2022-01-19 15:31:14 +00:00
Gavin Wood f2c8fe35a3 Allow the treasury to have a maximum bound on the bond (#10689)
* Allow the treasury to have a maximum bound on the bond

* Update frame/treasury/src/lib.rs

Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>

Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
2022-01-19 14:08:53 +00:00
Pierre Krieger 2c3787288a Split peer slots between full and light nodes (#10688)
* Split peer slots between full and light nodes

* Rustfmt

* Oops, accidentally removed a comma

* Remove else
2022-01-19 10:58:40 +00:00
Sacha Lansky fcfc70eaa2 Minor syntax and typo edits (#10693) 2022-01-18 19:05:12 +00:00
dharjeezy ed92624821 bench/cli: extend --extrinsic name filtering (#10677)
* implement benchmarking multiple extrinsics

* ran cargo +nightly fmt

* remove contains check and made it an equals check
2022-01-18 08:18:52 +00:00
Zeke Mostov afdec55069 Migration for over locked accounts in phgragmen elections (#10649)
* use free balance rather than total balance

* Docs

* Migration for over-locked phrag voters

* New line

* comment

* Update frame/elections-phragmen/src/migrations/v5.rs

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

* Only set lock, don't remove it

* delete commented out

* docs

* Update migration to just take a set of accounts

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
2022-01-18 03:06:25 +00:00
Guillaume Thiolliere 137628b4d7 Add feature: no-metadata-doc which removes doc from metadata and full-metadata which build metadata with all doc (#10493)
* add features to remove or add doc

* fmt

* add test for event/error/call

* fmt
2022-01-17 22:21:19 +01:00
Alexander Theißen 2a122c44b1 Switch from pwasm-utils to wasm-instrument (#10680)
* Switch executor to wasm-instrument

* Switch pallet-contracts to wasm-instrument
2022-01-17 15:00:17 +00:00
Nazar Mokrynskyi d174ff8a61 Update wasmtime to 0.33.0 (#10674)
Also disable memory64 support in wasmtime
2022-01-17 14:39:24 +01:00
James Wilson 751c072ca4 Bump sp-keyring to 4.1.0-dev (#10681) 2022-01-17 12:52:10 +00:00
Alexander Theißen 89194f0e70 contracts: Get rid of the dreaded Other error (#10595)
* Print more detailed error when instrumentation fails

* Apply suggestions from code review

Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com>

* Check contents of debug buffer

* Fix test

Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com>
2022-01-17 09:45:28 +00:00
Joey 8aefbb9f2f the report mod and REPORTING keyType is no longer used (#10679) 2022-01-17 09:31:45 +00:00
Shawn Tabrizi d511cc8cfb Improve BoundedVec API (extracted from #10195) (#10656)
* Gav wrote this code in pull #10195. Extracting to simplify that PR.

* fix potential panics

* prevent panics in slide

* update doc

* fmt

* Update frame/support/src/storage/bounded_vec.rs

Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>

Co-authored-by: Gav Wood <gavin@parity.io>
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
2022-01-17 10:28:11 +01:00
Zeke Mostov 16212851c6 Move EraIndex to sp-staking (#10671)
* Move `EraIndex` to sp-staking

* Fix imports in mocks

* Run cargo +nightly-2021-10-29 fmt
2022-01-17 02:15:18 +00:00
Nazar Mokrynskyi 0bca06a483 Minor tweaks suggested by clippy (#10673)
* Minor tweaks suggested by clippy

* Fix typo caused by last commit

* Apply review suggestions
2022-01-15 21:00:12 +01:00
Bastian Köcher a534274c6f runtime-interface: Implement register_only functions (#10640)
* runtime-interface: Implement `register_only` functions

The runtime interface supports versioning of functions. Currently, if you add a new function it will
be used by the runtime automatically. This results in requiring all nodes of a network to upgrade
before the runtime is upgraded, otherwise they will fail to instantiate the new runtime because of
missing host functions. This pr introduces `register_only` functions. This can be used when a new
runtime interface function should be introduced, but the actual usage can be deferred. This means
that nodes will have the host function for this, but the runtime will still use the old version of
the function when being compiled for wasm. However, when a runtime is enacted that uses the new host
function, the "old nodes" will already have the host function and will continue to work.

* Update primitives/runtime-interface/src/lib.rs

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

* Update primitives/runtime-interface/proc-macro/src/utils.rs

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

* FMT

Co-authored-by: cheme <emericchevalier.pro@gmail.com>
2022-01-15 10:46:20 +00:00
Arkadiy Paronyan c33fb8db76 Increase default rocksdb cache (#10659) 2022-01-14 11:02:53 +00:00
Shawn Tabrizi e9860b9c1e Use free balance rather than total balance for elections phragmen (#10646)
* use free balance rather than total balance

* Docs

Co-authored-by: emostov <32168567+emostov@users.noreply.github.com>
2022-01-14 01:43:00 +00:00
Arkadiy Paronyan 4d477ea9b4 Fast/warp sync fixes (#10562)
* Fast sync fixes

* Fix gap blocks validation

* Updated test

* Formatting

* Networking test
2022-01-13 15:26:06 +00:00
Alexander Samusev 3a88215fca [ci] pipeline chores (#10624)
* [Do not merge] pipeline chores

* disable condition publish-rustdoc

* revert rules

* remove PIPELINE_SCRIPTS_TAG
2022-01-12 09:33:25 +01:00
Xiliang Chen d346028a9d reset events before apply runtime upgrade (#10620)
* reset events before apply runtime upgrade

* fix tests

* add test

* update comment

* Update frame/system/src/lib.rs

* trigger CI

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
2022-01-12 08:22:29 +00:00
dependabot[bot] 79cab81364 Bump twox-hash from 1.6.1 to 1.6.2 (#10575)
Bumps [twox-hash](https://github.com/shepmaster/twox-hash) from 1.6.1 to 1.6.2.
- [Release notes](https://github.com/shepmaster/twox-hash/releases)
- [Commits](https://github.com/shepmaster/twox-hash/compare/v1.6.1...v1.6.2)

---
updated-dependencies:
- dependency-name: twox-hash
  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>
2022-01-12 09:18:23 +01:00
Oliver Tale-Yazdi 1f28f72790 followup #10594: re-benchmark pallet-lottery (#10637)
* pallet-preimage: fix crate doc

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

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

Co-authored-by: Parity Bot <admin@parity.io>
2022-01-11 18:13:06 +00:00
Oliver Tale-Yazdi b630f1b0e6 pallet-lottery: add generate_storage_info (#10594)
* pallet-lottery: add generate_storage_info

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

* pallet-lottery: test call_to_indices with TooManyCalls

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

* review: move try_push above transfer

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

* pallet-lottery: test stop_repeat

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

* pallet-lottery: test do_buy_ticket as white-box

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

* pallet-lottery: use BoundedVec in bechmarks

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

* pallet-lottery: fix zero div panic

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

* review: extend buy_ticket tests

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

* review: test buy_ticket AlreadyParticipating

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

* fmt

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

* review: use /// comments on private functions

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

* review: use with_bounded_capacity

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
2022-01-11 14:22:27 +00:00
João Paulo Silva de Souza 5e4035dcaa delete process.json (#10629)
The feature was removed in https://github.com/paritytech/parity-processbot/pull/358
2022-01-11 12:29:42 +01:00
Vladimir Istyufeev bdd7a44bec Remove the bench-test-full-crypto-feature GHA & GitLab jobs (#10628)
* Remove the `bench-test-full-crypto-feature` job

* Remove the relevant GHA job
2022-01-11 11:29:35 +01:00
Oliver Tale-Yazdi 0071bd7bac frame/bench-cli: fix log formatting (#10627)
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
2022-01-11 03:18:30 +00:00
Seun Lanlege a4057bb9e2 Adds AuraConsensusDataProvider (#10503)
* adds support for parachains to test-runner

* adds file header

* Apply suggestions from code review

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

* proper docs, remove unused _client

* fixes

* Update client/consensus/manual-seal/src/consensus/timestamp.rs

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

* Update client/consensus/manual-seal/src/consensus/timestamp.rs

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

* pr fixes

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
2022-01-10 14:39:04 +00:00
Joshy Orndorff 2178cb1939 Manual Seal: Calculate the block's post hash (#10498)
* calculate the post hash

* Add test

Co-authored-by: tgmichel <telmo@purestake.com>
2022-01-10 11:55:05 +00:00
Bastian Köcher 3093bed933 code-substitute: Switch from block_hash to block_number (#10600)
* code-substitute: Switch from `block_hash` to `block_number`

This will make it easier for light clients to work with the code-substitute.

For more information on this see: https://github.com/paritytech/substrate/issues/10589

Closes: https://github.com/paritytech/substrate/issues/10589

* FMT

* Update client/service/src/client/wasm_substitutes.rs

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

* Update client/service/src/builder.rs

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

Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
2022-01-09 20:48:24 +01:00
Alex Pozhylenkov 03a7738ed8 add into function for PrefixIterator (#10614)
* add into function for PrefixIterator

* update with comments

* update with comments
2022-01-09 20:12:21 +01:00
Kian Paimani 02468b803f Add Ord implementation for BoundedVec (#10615)
* Add Ord implementation for BoundedVec

* Update frame/support/src/storage/bounded_vec.rs

* Update frame/support/src/storage/bounded_vec.rs

* Update frame/support/src/storage/bounded_vec.rs

* Update frame/support/src/storage/bounded_vec.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
2022-01-09 09:03:21 +00:00
Bastian Köcher e254fd59f2 frame-support: Use logging for printing corrupted state (#10612)
`runtime_print!` is printed by default using `debug`, aka not being visible. With `log::error!` it
will be printed directly to the user. Production networks like Polkadot disable logging, but for
them we run special nodes that have logging enabled.
2022-01-08 16:13:54 +00:00
Alexander Theißen 46e38e8288 Add additionally functionality to contracts storage interface (#10497)
* Add new versions for storage access host functions

* Improve docs
2022-01-08 12:19:23 +00:00
Gavin Wood 4b9818a06a Fix docs (#10606) 2022-01-07 19:33:52 +00:00
Adrian Catangiu fe8d2bc7f4 Add BEEFY latestFinalized RPC and deduplicate code between BEEFY and GRANDPA (#10568)
* beefy: add dummy latest_finalized() RPC

* beefy: rpc latest_best_beefy() using shared mem

* beefy: rpc populate latest_best_beefy()

* beefy: rpc handle readiness

* beefy: best block over channel - wip

Not working because channel can't be simply opened and receiver passed
to `rpc_extensions_builder` because `rpc_extensions_builder` has to be
`Fn` and not `FnOnce`... and and Receiver side of mpsc can't be cloned

yay!..

* beefy: make notification channels payload-agnostic

* beefy: use notification mechanism instead of custom channel

* beefy: add tracing key to notif channels

* sc-utils: add notification channel - wip

* beefy: use sc-utils generic notification channel

* grandpa: use sc-utils generic notification channel

* fix grumbles

* beefy-rpc: get best block header instead of number

* beefy-rpc: rename to `beefy_getFinalizedHead`

* fix nitpicks

* client-rpc-notifications: move generic Error from struct to fn

* beefy: use header from notification instead of getting from database

* beefy-rpc: get best block hash instead of header

* beefy-rpc: fix and improve latestHead test

* beefy-rpc: bubble up errors from rpc-handler instantiation

* update lockfile

* Apply suggestions from code review

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

* fix errors and warnings

* fix nit

Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
2022-01-06 13:43:11 +00:00
Alexander Theißen 4ca4df644e contracts: Improve documentation of lazy deletion config (#10582)
* Improve documentation of lazy deletion config

* Apply suggestions from code review

Co-authored-by: Sacha Lansky <sacha@parity.io>

* Update frame/contracts/src/lib.rs

Co-authored-by: Andrew Jones <ascjones@gmail.com>

* Improve wording

Co-authored-by: Sacha Lansky <sacha@parity.io>
Co-authored-by: Andrew Jones <ascjones@gmail.com>
2022-01-06 11:03:18 +00:00
Kian Paimani c3add6ee09 some improvements to bounded vec API (#10590)
* some improvements to bounded vec

* revert license tweak

* more tests

* fix

* Update frame/support/src/storage/bounded_vec.rs

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

* add the same stuff for btree map and set as well

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
2022-01-06 10:55:21 +00:00
wigy 50d1666d33 Exclude big changes from file annotations (#10588) 2022-01-06 10:12:54 +00:00
Zeke Mostov 0ca23e0a6c Add benchmark tests for pallet bags list (#10593)
* Add benchmark tests for pallet bags list

* Make sure to set active balance for new ledgers

* fmt

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

Co-authored-by: Parity Bot <admin@parity.io>
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
2022-01-06 09:41:18 +00:00
dependabot[bot] cabfd35649 Bump proc-macro2 from 1.0.32 to 1.0.36 (#10564)
* Bump proc-macro2 from 1.0.32 to 1.0.36

Bumps [proc-macro2](https://github.com/dtolnay/proc-macro2) from 1.0.32 to 1.0.36.
- [Release notes](https://github.com/dtolnay/proc-macro2/releases)
- [Commits](https://github.com/dtolnay/proc-macro2/compare/1.0.32...1.0.36)

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

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

* Fix ui tests

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Bastian Köcher <info@kchr.de>
2022-01-06 09:22:35 +00:00