Commit Graph

5885 Commits

Author SHA1 Message Date
Koute 400f3e6579 Speed up timestamp generation when logging (#9933)
* Speed up timestamp generation when logging

* Align to review comments.

* Correct a typo
2021-10-05 12:15:18 +00:00
Squirrel d45aada6a7 First word should be Substrate not Polkadot (#9935)
(if we want something put in the substrate PR.)
2021-10-05 11:26:34 +00:00
Squirrel 3a53892e2f Improved file not found error message (#9931)
* Say where you looked for the file

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
2021-10-05 09:42:33 +01:00
Kian Paimani 626ca93383 don't read events in elections anymore. (#9898)
* dont read events in elections anymore.

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

* Fix test for Substrate#9898 (#9907)

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
Co-authored-by: Zeke Mostov <32168567+emostov@users.noreply.github.com>
2021-10-05 06:23:09 +00:00
Shawn Tabrizi 2272a0ed25 Remove incorrect sanity check (#9924)
* causes issue

* remove the bad error check
2021-10-04 22:19:21 +00:00
Bastian Köcher cb77e783b7 Require crypto scheme for insert-key (#9909)
* Require crypto scheme for `insert-key`

We should not "guess" the scheme as this can depend on the
implementation of the runtime etc.

* FMT
2021-10-04 20:55:36 +00:00
Chevdor 95cf70c62a chore: refresh of the substrate_builder image (#9808)
* chore: refresh of the substrate_builder image

fix #9715

* chore: renaming +  build script

* Fix spaces/tabs

* Add doc

* Remove non binary

* Update docker/substrate_builder.Dockerfile

Co-authored-by: Denis Pisarev <denis.pisarev@parity.io>
2021-10-04 21:19:17 +02:00
Tomasz Drwięga 8ae18720e6 Introduce block authorship soft deadline (#9663)
* Soft limit.

* Add soft deadline tests.

* cargo +nightly fmt --all

* Fix sc-service test.

* Improving tests
2021-10-04 14:30:46 +00:00
Tomasz Drwięga 374fb6a921 Rework Transaction Priority calculation (#9834)
* Add transaction validity docs.

* Re-work priority calculation.

* Fix tests.

* Update frame/transaction-payment/src/lib.rs

Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>

* cargo +nightly fmt --all

* Fix an obvious mistake :)

* Re-work again.

* Fix test.

* cargo +nightly fmt --all

* Make VirtualTip dependent on the transaction size.

* cargo +nightly fmt --all

* Update frame/transaction-payment/src/lib.rs

Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>

* Fix compilation.

* Update bin/node/runtime/src/lib.rs

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

Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
2021-10-04 14:25:18 +00:00
Koute 886c42c5c8 Do not propagate host RUSTFLAGS when checking for WASM toolchain (#9926)
* Do not propagate host RUSTFLAGS when checking for WASM toolchain

* Update utils/wasm-builder/src/prerequisites.rs

* Update utils/wasm-builder/src/prerequisites.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
2021-10-04 13:28:51 +00:00
Jaco 73d765ec30 Small quoting comment fix (#9927)
Tiny quotes fix that snuck in lately (something I picked up elsewhere in document generation)
2021-10-04 13:56:06 +02:00
Squirrel c9410186f1 add clippy to CI (#9694)
* Focus on correctness lints. This relies on a compiler patch that landed 8th July 2021.
If people are using an earlier version of the compiler everything will still work unless they try and run clippy.

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: Denis Pisarev <denis.pisarev@parity.io>
2021-10-03 17:09:26 +01:00
Robert Habermeier 06c4e20992 Ensure BeforeBestBlockBy voting rule accounts for base (#9920)
* Ensure BeforeBestBlockBy voting rule accounts for base

* fmt

Co-authored-by: Andronik Ordian <write@reusable.software>
2021-10-03 15:15:30 +02:00
Dan Shields b9c615c8d4 rm .maintain lock (#9919)
* rm maintain lock

* ignore template gen lockfile
2021-10-02 21:01:07 +02:00
Dan Shields 619b3a5a68 Downstream node-template pull (#9915)
* downstream node template pull: README updated, add shell.nix

* consistant cargo.toml style

* Update bin/node-template/shell.nix

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
2021-10-02 08:27:06 +00:00
Jay Pavlina b890a28ca3 Implement core::fmt::Debug for BoundedVec (#9914) 2021-10-02 08:11:37 +00:00
Tomasz Drwięga 085935dd0a Quickly skip invalid transactions during block authorship. (#9789)
* Support skipping invalid transactions in the iterator.

* Expose concrete iterator.

* cargo +nightly fmt --all

* More consistent placement.

* Update Cargo.lock

* Pass transaction to 'report_invalid'
2021-10-01 14:25:13 +00:00
RyuH1 29ff036463 Add SS58 prefix for Automata (#9805) 2021-10-01 11:22:13 +00:00
Liu-Cheng Xu 00973f5b62 Clean up sc-peerset (#9806)
* Clean up sc-peerset

* cargo +nightly fmt --all

* Nit

* Nit

* .

* Nit

* .

* Apply suggestions from code review

* .

* Update client/peerset/src/peersstate.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
2021-10-01 09:43:55 +00:00
ucover f8ce186496 Test each benchmark case in own #[test] (#9860)
* Generate one #[test] fn per bench case.

* Update benchmark macro syntax in frame pallets.

* Explain new benchmark macro syntax in example pallet.

* support with and without a semicolon

* update pallets to use individual tests

* migrate staking too

* migrate more pallets

* fix up democracy and use individual tests

* Fix comment

* Put println message in panic

* Remove `another_set_dummy` from doc

`another_set_dummy` is not present in the benchmarking.rs (anymore).

* Update doc for benchmarks macro

* Update doc for impl_benchmark_test_suite macro

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
2021-10-01 08:17:26 +00:00
Alexander Samusev a31ab1fc37 Add build with docker section to README (#9792)
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
2021-10-01 03:54:41 +00:00
Shawn Tabrizi 54617ef661 Simple Trait to Inspect Metadata (#9893)
* simple trait to inspect metadata

* import vec
2021-09-30 16:46:48 +00:00
Vincent Geddes 653f299b95 Pallet Assets: Create new asset classes from genesis config (#9742)
* Pallet Assets: Allow creating asset classes from genesis config

* Add accounts and metadata to genesis config

* whitespace fixes

* Update more chainspecs

* Run rustfmt over code

* More formatting fixes

* Update frame/assets/src/lib.rs

Improve error message

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>

* Update frame/assets/src/lib.rs

Improve error message

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
2021-09-30 16:32:29 +00:00
Denis Pisarev 74475e602b doc: subkey usage (#9905)
* CI: md styling

* CI: add container usage
2021-09-30 17:12:28 +02:00
Robert Klotzner aa311c3734 Silence alert about large-statement-fetcher (#9882)
* Silence alert about large-statement-fetcher

That task is not continuous and behaving exactly as desired.

* Get rid of rule completely

- Pierre thinks it does not add any value
- Basti rightly complains that Polkadot specific exceptions make little
  sense in the Substrate repo.
2021-09-30 16:42:08 +02:00
zjb0807 fc4c67161b Fix democracy on-initialize weight (#9890)
* fix democracy on-initialize weight

* fix tests

* add base weight on LaunchPeriod

* fix fmt check

* trigger GitHub actions

* trigger GitHub actions

* update weights
2021-09-30 13:22:54 +00:00
Bastian Köcher a58b5a947f Fix basic authorship flaky test (#9906)
The test is flaky because sometimes we hit the 9 seconds deadline when
the CI was probably on high load. To "solve" this we just use an huge
deadline that should never be triggered. The deadline isn't required anyway.
2021-09-30 14:58:28 +02:00
Andrew Jones e0742bcd6d contracts: Add event field names (#9896)
* Add struct variant fields to contract Event

* Update comments and usages

* Fmt
2021-09-30 08:12:25 +00:00
Dan Shields 817d0d26d5 subkey readme update on install (#9900)
Instructions are more detailed on devhub, ported to the README.
2021-09-30 03:54:45 +00:00
Éloïs 6898e8416b add feature wasmtime-jitdump (#9871)
* add feature wasmtime-jitdump

* remove unwrap

* always enable wasmtime/jitdump feature

* env WASMTIME_PROFILING_STRATEGY: retun an error for unknown value

* Add doc for env var WASMTIME_PROFILING_STRATEGY

* Update client/executor/wasmtime/Cargo.toml

Co-authored-by: Sergei Shulepov <s.pepyakin@gmail.com>

* warning instead of error

* Update client/executor/wasmtime/src/runtime.rs

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

* update doc: unknown value cause warning instead of error

* log warning only once

* static  right next to the usage

Co-authored-by: Sergei Shulepov <s.pepyakin@gmail.com>
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
2021-09-29 22:10:12 +02:00
Liu-Cheng Xu 802afa9f22 Return target_hash for finality_target instead of an Option (#9867)
* .

cargo +nightly fmt --all

* Fix test

* Simplify test

* They are already imported

* Needless clone()
2021-09-29 13:03:09 +00:00
Bastian Köcher 2deed49706 Update wasmtime to 0.29.0 (#9552)
* Start

* Move to ctx

* Make it compile for now

* More work

* Get rid off state-holder

* Use less Refcells

* 🤦

* Don't use RefCell

* Use names for parameters

* Fixes after merge

* Fixes after merge

* Review feedback

* FMT
2021-09-29 12:30:46 +00:00
Squirrel e64693933f Less sleeps (#9848)
* Less sleeps

* No need to use tokio-test crate

* Less sleep

* Avoid leaving zombie substrates around

(when panicing in tests)

* Remove unused imports

* Incorporating feedback

* rename method

* Use rpc_api

* Update bin/node/cli/tests/temp_base_path_works.rs

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

* Update bin/node/cli/tests/temp_base_path_works.rs

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

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
2021-09-29 10:55:31 +00:00
Guillaume Thiolliere f71d87ad28 remove unidiomatic (#9895) 2021-09-29 12:44:04 +02:00
dependabot[bot] 9605a6db3a Bump smallvec from 1.6.1 to 1.7.0 (#9894)
Bumps [smallvec](https://github.com/servo/rust-smallvec) from 1.6.1 to 1.7.0.
- [Release notes](https://github.com/servo/rust-smallvec/releases)
- [Commits](https://github.com/servo/rust-smallvec/compare/v1.6.1...v1.7.0)

---
updated-dependencies:
- dependency-name: smallvec
  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-09-29 09:54:10 +00:00
dependabot[bot] 559faf1c61 Bump async-std from 1.9.0 to 1.10.0 (#9759)
Bumps [async-std](https://github.com/async-rs/async-std) from 1.9.0 to 1.10.0.
- [Release notes](https://github.com/async-rs/async-std/releases)
- [Changelog](https://github.com/async-rs/async-std/blob/master/CHANGELOG.md)
- [Commits](https://github.com/async-rs/async-std/compare/v1.9.0...v1.10.0)

---
updated-dependencies:
- dependency-name: async-std
  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-09-29 10:53:15 +02:00
Guillaume Thiolliere 8684b73b46 Fix WrapperOpaque max encded len and type info (#9881)
* fix wrapper opaque

* fix compilation

* improve more precise implementation

* spacing

* fmt
2021-09-29 07:48:26 +00:00
Bastian Köcher 89a85936e5 Fix flaky sync tests (#9889) 2021-09-29 09:10:20 +02:00
Keith Yeung 7b65b049cb Extend PalletInfoAccess with module_name and crate_version method (#9690)
* Record pallet indices in CallMetadata

* Resurrect PalletVersion infrastructure and rename as CrateVersion

* cargo fmt

* Add missing runtime generics to pallet struct

* Fix path to instance

* Fix test

* Fix UI test expectations

* Fix UI test expectations

* Move crate_version function to PalletInfoAccess

* Update UI test expectations

* Add crate_name method to PalletInfo

* Convert path to module name instead of exposing crate name

* cargo fmt

* Keep the double colons when constructing the module name

* Remove unused import

* Update UI test expectations

* Update frame/support/src/traits/metadata.rs

Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>

* Update UI test expectations

Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>
2021-09-28 11:35:33 +02:00
Gautham 951a033e8d Add Polkadex to SS58 Registry (#9825)
* Add PDEX to SS58 Registry.

* Add PDEX to SS58 Registry.
2021-09-28 06:10:40 +00:00
Squirrel f95408b346 Point to nightly that can compile the code. (#9873) 2021-09-28 04:47:38 +00:00
Qinxuan Chen 7f550d6dd2 Migrate pallet-session to the new pallet macro (#9796)
* Migrate pallet-session to the new pallet macro

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

* Remove old macros

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

* Fix

Signed-off-by: koushiro <koushiro.cqx@gmail.com>
2021-09-28 03:12:57 +00:00
Falco Hirschenberger 6ec82c7a83 Add weight for decoding the call to benchmarks (#9781)
* First two bechmarks converted

* Add decoding weight to benchmarks.

* Update frame/democracy/src/benchmarking.rs

* Adapt to new Call-ing convention

* Resolve conflicts and change more calls

* Remove error impl for codec and use plain `expect` for error handling instead

* Compile fix

* Spaces to tabs

* Update frame/democracy/src/benchmarking.rs

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

* Add origin-type specifier to benchmarks macro

* formatting

* Update frame/benchmarking/src/lib.rs

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

* Change manual to automatic benchmark syntax

* Formatting

* Revert "Change manual to automatic benchmark syntax"

This reverts commit ea5b5d906b318b6525c1e6d2bd05c5011595c21a.

Because tests are lost and cleanup code in the verify function is not run on failing calls.

Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
2021-09-27 15:17:38 +00:00
Guillaume Thiolliere 1ebcbe1c34 pallet macro: allow to declare individual unbounded storage for those who cannot go into PoV (#9670)
* allow unbounded individual storage

* better doc

* fix UI tests

* update doc

* Update frame/support/procedural/src/pallet/parse/storage.rs

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

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
2021-09-27 08:25:24 +00:00
Qinxuan Chen d565382b50 Migrate the pallet macros of some tests and benches (#9853)
Signed-off-by: koushiro <koushiro.cqx@gmail.com>
2021-09-27 03:24:25 +00:00
Shawn Tabrizi f8a228859e Fungibles and Non-Fungibles Create and Destroy Traits + Assets and Uniques Implementation (#9844)
* refactor `do_destroy`

* destroy trait

* refactor do_force_create

* impl create trait

* do not bleed weight into api

* Do the same for uniques

* add docs
2021-09-26 22:05:01 +00:00
Andreas Doerr 0daa2b66ec BEEFY code owner (#9852) 2021-09-26 22:42:09 +02:00
Shawn Tabrizi d342d282a6 Fix amount emitted in rebonded event (#9866) 2021-09-26 08:26:57 +02:00
Georges cf19f1f442 Removing a trailing MaxSegmentLength (#9850) 2021-09-25 21:08:04 +00:00
Xiliang Chen aab666ed29 Expose trait Balance & AssetId (#9863)
* expose trait Balance

* expose trait AssetId
2021-09-25 22:41:11 +02:00