Commit Graph

121 Commits

Author SHA1 Message Date
Jimmy Chu fb73a4eef6 Enhancement on Substrate Node Template (#8473)
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>
2021-03-30 07:47:37 +08:00
Shaun Wang 2e5522444a Replace 'Module' with 'Pallet' in construct_runtime macro (#8372)
* Use 'Pallet' struct in construct_runtime.

* Fix genesis and metadata macro.

* Fix 'Pallet' type alias.

* Replace 'Module' with 'Pallet' for all construct_runtime use cases.

* Replace more deprecated 'Module' struct.

* Bring back AllModules and AllPalletsWithSystem type, but deprecate them.

* Replace deprecated 'Module' struct from merge master.

* Minor fix.

* Fix UI tests.

* Revert UI override in derive_no_bound.

* Fix more deprecated 'Module' use from master branch.

* Fix more deprecated 'Module' use from master branch.
2021-03-18 08:50:08 +00:00
Bastian Köcher 15e15e7d8e Aura and Slots refactoring (#8386)
* Make slot duration being exposed as `Duration` to the outside

* Some slot info love

* Add `build_aura_worker` utility function

* Copy copy copy
2021-03-17 23:25:58 +00:00
Robert Habermeier e2960c383e more clear randomness API for BABE (#8180)
* more clear randomness API for BABE

* babe: move randomness utilities to its own file

* node: use babe::RandomnessFromOneEpochAgo in random_seed implementation

* frame-support: annotate randomness trait with block number

* pallet-randomness-collective-flip: fix for new randomness trait

* pallet-society: fix randomness usage

* pallet-lottery: fix randomness usage

* pallet-contracts: fix randomness usage

* pallet-babe: fix randomness usage

we need to track when the current and previous epoch started so that we
know the block number by each existing on-chain was known

* node: fix random_seed

* node-template: fix random_seed

* frame-support: extend docs

* babe: add test for epoch starting block number tracking

* babe: fix epoch randomness docs

* frame: add todos for dealing with randomness api changes

Co-authored-by: André Silva <andrerfosilva@gmail.com>
2021-03-10 16:31:49 +00:00
Bastian Köcher 4de4662480 Make ExecuteBlock::execute_block return the final block header (#8244)
This pr changes the `ExecuteBlock` trait to return the final header that
results from executing the given block.
2021-03-03 08:44:34 +00:00
Shawn Tabrizi 62ef739faf Add benchmark to node-template pallet-template (#8239)
* Add benchmark to node-template pallet-template

* export sp_std to avoid missing dep when using macro

* fix more `sp_std` deps

* remove unused

* Update bin/node-template/pallets/template/src/benchmarking.rs

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

* Update bin/node-template/pallets/template/Cargo.toml

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
2021-03-02 18:23:07 +01:00
Benjamin Kampmann 0b4126ca40 Frame Benchmarking v3.1.0 released (#8206)
* Releasing frame-benchmarking 3.1

* bump in the entire dependency tree
2021-02-25 17:04:36 +01:00
Benjamin Kampmann 6a964c5df0 Releasing 3.0 (#8098)
* bumping version for next release
* add changelog
* add guide
2021-02-10 19:23:18 +01:00
Bastian Köcher 5569313bd6 AURA: Switch to CurrentSlot instead of LastTimestamp (#8023)
* Convert AURA to new pallet macro

* AURA: Switch to `CurrentSlot` instead of `LastTimestamp`

This switches AURA to use `CurrentSlot` instead of `LastTimestamp`.

* Add missing file

* Update frame/aura/src/migrations.rs

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

* Remove the runtime side provide inherent code

* Use correct weight

* Add TODO

* Remove the Inherent from AURA

* 🤦

* Remove unused stuff

Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
2021-02-03 13:47:13 +01:00
Guillaume Thiolliere f48296e9ad Update parity-scale-codec to 2.0 (#7994)
* update cargo.toml

* use 2.0 in mmmr
2021-01-29 12:22:45 +00:00
Liu-Cheng Xu 65569620c2 Add payment_queryFeeDetails RPC (#7692)
* Return FeeDetails in compute_fee_raw()

* Add payment_queryDetails rpc

* Simplify serde attribute a bit

* Fix line width check

* Use saturating_add()

* Move transaction payment rpc types to types.rs

* Add file header

* Fix test

* Update Cargo.lock

* Nit

* Apply the review suggestions

* .

* .

* Fix serde

* Fix rust doc

* .

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

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

* Use NumberOrHex in fee details RPC

* Address review feedback

* Nits

* Update some docs

* Address review

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

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

* Happy 2021

* Nit

* Address code review

* Remove needless bound

Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>
2021-01-14 11:43:53 +00:00
Guillaume Thiolliere 014e6f03c6 bumpd minor version (#7873) 2021-01-12 09:25:47 +01:00
Alexander Theißen ec2c70396e Define ss58 prefix inside the runtime (#7810)
* Add SS58Prefix type to the frame_system config trait

* Remove unused chain_id runtime interface
2020-12-30 22:07:37 +00:00
Tomasz Drwięga 39a776cd00 Streamline frame_system weight parametrization (#6629)
* Basic weights builder.

* Fixing WiP

* Make the tests work.

* Fix weights in node/runtime.

* WiP.

* Update pallets with new weights parameters.

* Validate returns a Result now.

* Count mandatory weight separately.

* DRY

* BREAKING: Updating state root, because of the left-over weight-tracking stuff

* Update tests affected by Mandatory tracking.

* Fixing tests.

* Fix defaults for simple_max

* Update frame/system/src/weights.rs

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

* Rework the API a bit.

* Fix compilation & tests.

* Apply suggestions from code review

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

* Add extra docs & rename few things.

* Fix whitespace in ASCII art.

* Update frame/system/src/limits.rs

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

* Fix max_extrinsic calculations.

* Fix conflicts.

* Fix compilation.

* Fix new code.

* re-remove generic asset

* Fix usage.

* Update state root.

* Update proxy.

* Fix tests.

* Move weights validity to integrity_test

* Remove redundant BlockWeights.

* Add all/non_mandatory comment

* Add test.

* Remove fn block_weights

* Make the macro prettier.

* Fix some docs.

* Make max_total behave more predictabily.

* Add BlockWeights to metadata.

* fix balances test

* Fix utility test.

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
Co-authored-by: Benjamin Kampmann <ben@gnunicorn.org>
Co-authored-by: thiolliere <gui.thiolliere@gmail.com>
2020-12-08 13:18:34 +01:00
Guillaume Thiolliere 1cbfc9257f Rename pallet trait Trait to Config (#7599)
* rename Trait to Config

* add test asserting using Trait is still valid.

* fix ui tests
2020-11-30 14:34:54 +00:00
Bastian Köcher 923cb8eea1 Wasm-builder 3.0 (#7532)
* Build every wasm crate in its own project with wasm-builder

Building all wasm crates in one workspace was a nice idea, however it
just introduced problems:

1. We needed to prune old members, but this didn't worked for old git
deps.
2. We locked the whole wasm workspace while building one crate. This
could lead to infinitely locking the workspace on a crash.

Now we just build every crate in its own project, this means we will
build the dependencies multiple times. While building the dependencies
multiple times, we still decrease the build time by around 30 seconds
for Polkadot and Substrate because of the new parallelism ;)

* Remove the requirement on wasm-builder-runner

This removes the requirement on wasm-builder-runner by using the new
`build_dep` feature of cargo. We use nightly anyway and that enables us
to use this feature. This solves the problem of not mixing
build/proc-macro deps with normal deps. By doing this we get rid off
this complicated project structure and can depend directly on
`wasm-builder`. This also removes all the code from wasm-builder-runner
and mentions that it is deprecated.

* Copy the `Cargo.lock` to the correct folder

* Remove wasm-builder-runner

* Update docs

* Fix deterministic check

Modified-by: Bastian Köcher <git@kchr.de>

* Try to make the ui test happy

* Switch to `SKIP_WASM_BUILD`

* Rename `SKIP_WASM_BINARY` to the correct name...

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

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

* Update utils/wasm-builder/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>
2020-11-24 10:18:36 +01:00
Shawn Tabrizi 4637100ac7 More Extensible Multiaddress Format (#7380)
* More extensible multiaddress format

* update name

* Don't depend on indices to define multiaddress type

* Use MultiAddress in Node Template too!

* reduce traits, fix build

* support multiple `StaticLookup`

* bump tx version

* feedback
2020-11-19 11:40:12 +00:00
Alexander Popiak 2ae6ab0e7e Update MILLISECS_PER_BLOCK comments (#7483)
* add doc comment to node template MILLISECS_PER_BLOCK

* add broken link comment

* update Babe block time link

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

Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
2020-11-03 14:01:18 +01:00
Albrecht b7205d4ae0 decouple transaction payment and currency (#6912)
* wip: setup types

* fix types

* make tx payment pallet independent from balances

* fix dependent tests

* comments

* restructure a bit and  include more info

* clean up ugly phantom

* reduce complexity

* minor doc improvements

* use shorthand

* doc

* fix line lenght and style

* readd BalanceOf

* some clarifications and readability improvements

* move balance type to OnChargeTransaction

* remove noise

* fix style

* Apply suggestions from code review

improved documentation

Co-authored-by: Alexander Theißen <alex.theissen@me.com>

* Improve naming and documentation

Apply suggestions from code review

Co-authored-by: Alexander Theißen <alex.theissen@me.com>

* Apply suggestions from code review

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

* always call withdraw_fee

* move NegativeImbalanceOf to payment module

* fix unused import

Co-authored-by: Alexander Theißen <alex.theissen@me.com>
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
2020-10-30 12:27:04 +00:00
Shawn Tabrizi e4cfb2556d New Weight Template + Organization (#7391)
* add_handlebar_template_to_benchmark

- add benchmark-cli arg to take in a handlebar-template file

* update to always use template

* rewrite writer for handlebars

* polish

* pass cmd data

* update docs

* new weight layout

* separate templates

* support custom filename output

* Update command.rs

* Create frame-weight-template.hbs

* use a vector to maintain benchmark order

* bring back ()

* fix tests

* fix build

* Custom string serializer, remove feature flag

* temp

* rename

* nit

* update docs

* docs on public objects

* small fix

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

* remove long line

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

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

* update for system

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

* update for staking

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

* update for identity and staking

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

* update for collective

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

* update for democracy

* clean up zeros

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

* update for elections phragmen

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

* update for im online

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

* update for indices

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

* update for multisig

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

* update for proxy

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

* update for scheduler

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

* update for session

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

* update for timestamp

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

* update for treasury

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

* update for utility

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

* update for vesting

* temp update

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

Co-authored-by: Ezadkiel Marbella <zadkiel.m@gmail.com>
Co-authored-by: Parity Benchmarking Bot <admin@parity.io>
2020-10-27 20:26:12 +00:00
Bastian Köcher 1a01bca647 Fixes bug in wasm-builder with cargo publish (#7299)
* Fixes bug in wasm-builder with cargo publish

There was a bug in wasm-builder which resulted in generating a
`Cargo.lock` in the project directory because of running `cargo
metadata`. This resulted in commands like `cargo publish` to fail (if
there was no `Cargo.lock` before building), because it checks that the
project directory isn't modified.

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

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

Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
2020-10-12 12:29:53 +02:00
Bastian Köcher 4f447efb65 Release new version of wasm-builder-runner (#7283)
* Release new version of wasm-builder-runner

Besides the new version this merges `SKIP_WASM_BUILD` and
`BUILD_DUMMY_WASM_BINARY`, this means a file is generated with
`SKIP_WASM_BUILD` if no file existed before.

* Update utils/wasm-builder-runner/Cargo.toml

* Update utils/wasm-builder-runner/src/lib.rs

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

* Update versions

Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
2020-10-09 12:34:40 +02:00
Benjamin Kampmann ecdc94420e Releasing 2.0 – two dot 😮 (#7182)
Tagging the release of substrate 2.0


[ci: skip-checks]
2020-09-22 19:47:38 +02:00
Bastian Köcher 86594727d9 Rename ModuleToIndex to PalletRuntimeSetup (#7148)
* Rename `ModuleToIndex` to `PalletRuntimeSetup`

Besides the renaming it also adds support getting the name of a pallet
as configured in the runtime.

* Rename it to `PalletInfo`

* Remove accidentally added files
2020-09-22 13:39:56 +00:00
Shawn Tabrizi 42a4c2eef0 Add WeightInfo to Babe and Grandpa Pallet (#7155)
* Add `WeightInfo` to Babe Pallet

* Also grandpa

* Update frame/grandpa/src/default_weights.rs

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

Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
2020-09-21 13:31:44 +00:00
Shawn Tabrizi ab97e94972 Add benchmarking pipeline to node-template (#7122) 2020-09-17 10:09:59 +02:00
Shawn Tabrizi 9aa8698cfc WeightInfo for Vesting Pallet (#7103)
* WeightInfo for Vesting Pallet

* clean up weight docs

* Update lib.rs

* try to pipe max locks

* Update for new type

* add warning when locks > MaxLocks

* Update lib.rs

* fix compile

* remove aliasing, fix trait def

* Update
2020-09-16 19:48:10 +00:00
Benjamin Kampmann 2416aa7999 prepping for releasing rc6 (#6922)
* Bump version

* update test-utils crates to be ready for publishing

* adding changelog

* Adding automaticly generated READMEs

* fixing versions

* another version mishap
2020-08-20 17:04:42 +02:00
Joshy Orndorff e4280858dc De-alias pallets in node template runtime (#6836)
* dealias pallets

* Restore accidentally deleted code blocks
2020-08-06 21:23:31 +02:00
Joshy Orndorff 07c56a9be9 De-alias frame_system in node template runtime (#6829)
* de-alias frame_system in node template

* Fix line length

* Fix chainspec
2020-08-06 16:18:35 +00:00
Hamza Tokuchi 9e438c2fc1 Add RPC Builder to Substrate Node Template (#6808)
* Pulled RPC from node and populated the node-template's RPC builder with one example implementation

* surpress build errror

* dead_code

* Fixed module usage, removed copyright, removed rpc builder for light client + some comments

* added a comment for rpc extension

* Update bin/node-template/node/src/rpc.rs

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

* Update rpc.rs

* fix spacing

* more space to tabs

* more space to tabs

* Documenation nitpick

* Documentation nitpick

* Documentation nitpick

* Documentation nitpick

* Documentation nitpick

* pre-format

* Updated transaction payment API implemented for node template

* fix space and commented code

* fix long line

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
Co-authored-by: Dan Forbes <dan@danforbes.dev>
2020-08-06 10:31:03 +00:00
Bastian Köcher e7d8040af8 Update parity-scale-codec to prepare for breaking rustc release (#6746)
This updates parity-scale-codec{-derive} to prepare for a rustc release
that would otherwise break the derive implementation:
https://github.com/rust-lang/rust/pull/73084
2020-07-28 20:26:01 +00:00
Dan Forbes a20db31165 Remove unused node template deps (#6748)
* Remove unused node template deps

Backport changes made by @c410-f3r
https://github.com/substrate-developer-hub/substrate-node-template/pull/66

* Enhancements to README

* Revert change to serde per @thiolliere
2020-07-28 18:33:53 +00:00
Dan Forbes 68b2a09d21 Augmented node template docs (#6721) 2020-07-24 06:30:48 -07:00
Wei Tang ac8de557d6 Better handling of stable-only build (#6569)
* Better handling of stable-only build

* Fix node template build

* Fix wasm builder node-template version mismatch

* Fix load_spec error

* Add , in parameter

* Add descrptive panic messages in tests

* Add descriptive tests in node/executor benches

* Fix missing compact_code_unwrap

* Add missing wasm_binary_unwrap function for executor integration test

* Only define import_sp_io in no_std

* Small Cargo.toml styling fix

* Bump wasm-builder to 2.0.0

* Fix all `with_wasm_builder_from_crates` version in Substrate

* Use `with_wasm_builder_from_crates` for node-template

Co-authored-by: Gavin Wood <gavin@parity.io>
2020-07-22 21:40:11 +02:00
Benjamin Kampmann 629a801b6a Fixup cargo unleash (#6689)
* Bumping to rc5

* Revert "Bumping to rc5"

This reverts commit 5a63a8230e5a12db1b4ce4ac62e4967c52291da7.

* Bumping for rc5, correctly this time
2020-07-21 10:26:47 +00:00
André Silva ae38a806ed grandpa: report equivocations with unsigned extrinsics (#6656)
* grandpa: use unsigned extrinsics for equivocation reporting

* grandpa: allow signed reports as well

* grandpa: change runtime api for submitting unsigned extrinsics

* grandpa: fix tests

* grandpa: add test for unsigned validation

* grandpa: add benchmark for equivocation proof checking

* offences: fix grandpa benchmark

* grandpa: add proper weight for equivocation reporting extrinsic

* grandpa: fix weight unit
2020-07-17 12:32:20 +02:00
Shawn Tabrizi 2302898b8a Add WeightInfo to all pallets with benchmarks. (#6575)
* Start adding weight info

* More weightinfo

* finish weight info

* more fixes

* inital update of node runtime

* fix the rest of the compilation

* update balances

* add docs

* fix balances tests

* Fix more tests

* Fix compile

* Fix pallet-evm tests
2020-07-08 18:22:01 +02:00
Bastian Köcher ad2e832289 Don't require module name in inherents (#6576)
* Start

* Cleanup `construct_runtime!`

* Add tests

* Fix after merge

* Update the docs
2020-07-06 10:29:17 +00:00
Benjamin Kampmann f6ebd5f87d Releasing rc4 – Rhinoceros (#6515)
Co-authored-by: Martin Pugh <pugh@s3kr.it>
2020-06-25 23:18:43 +02:00
Arkadiy Paronyan 7b34438178 Validate encoding of extrinsics passed to runtime (#6442)
* Validate encoding of extrinsics passed to runtime

* Bump codec version explicitly
2020-06-19 19:27:16 +00:00
Guillaume Thiolliere c2ad27271b Introduce in-origin filtering (#6318)
* impl filter in origin

* remove IsCallable usage. Breaking: utility::batch(root, calls) no longer bypass BasicCallFilter

* rename BasicCallFilter -> BaseCallFilter

* refactor code

* Apply suggestions from code review

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

* remove forgotten temporar comment

* better add suggestion in another PR

* refactor: use Clone instead of mem::replace

* fix tests

* fix tests

* fix tests

* fix benchmarks

* Make root bypass filter in utility::batch

* fix unused imports

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
2020-06-15 17:05:41 +02:00
Benjamin Kampmann 881072e590 Intent to release rc3 (#6290) 2020-06-08 23:29:52 +02:00
Bastian Köcher c9cc46de3b Wasm-builder runtime-wasm feature (#6177)
* Enable the `runtime-wasm` for wasm builds

This enables the `runtime-wasm` feature for wasm builds. The feature is
not mandatory and will only be activated if it exists in the
`Cargo.toml`.

* Fix compilation

* Update docs

* Uprgade version

* Apply suggestions from code review
2020-05-28 21:06:25 +01:00
Kian Paimani 8279ba96df Make Get<T> const friendly + Clean the runtime files a bit. (#6132)
* Make Get const friendly

* Better doc

* Grumble

* Better doc

* Clean runtime files more
2020-05-27 14:40:07 +02:00
Benjamin Kampmann b64f55089d Releasing rc2 (#6136) 2020-05-26 14:32:23 +02:00
Benjamin Kampmann fb32ac8c51 Tagging as rc1 2020-05-25 18:30:48 +02:00
Alexander Theißen 9dd21b1eed Allow fee calculation to happen off-chain (#6076)
* Emit a PaymentParameters event once per block

This contains per-block paramaters need to calculate
fees off-chain.

* Add WeightToFee trait

* Add documentation to polynomial types

* Ignore pseudo code snippet for doc tests

* Use `Mul` implementation of Perbill

* Add tests for WeightToFeePolynomial

* Revert "Emit a PaymentParameters event once per block"

This reverts commit 6c4763baff3d8179676a3c1660fe7063fd56a8ca.

Co-authored-by: Gavin Wood <gavin@parity.io>
2020-05-21 12:16:04 +02:00
Tomasz Drwięga f74a7171be Maximum extrinsic weight limit (#6067)
* Only check single extrinsics weight limit in validate_transaction.

* Add missing parameter to all pallets.

* Add tests, fix default configuration.

* Bump spec version.

* Use AvailableBlockRation to calculate MaxExtrinsicWeight
2020-05-20 15:05:16 +02:00
Benjamin Kampmann 7c565085e9 resetting to -dev (#6050) 2020-05-16 19:03:04 +02:00