Commit Graph

265 Commits

Author SHA1 Message Date
Gavin Wood 95d1d668c3 Sensible way of selecting Prime member (#5346)
* Calculate prime votes only during the election

* Migration

* Fix build, enable migration

* Fix tests

* Bump runtime version

* Update frame/elections-phragmen/src/lib.rs

Co-Authored-By: Marcio Diaz <marcio.diaz@gmail.com>

Co-authored-by: Marcio Diaz <marcio.diaz@gmail.com>
2020-03-23 11:52:44 +01:00
Gavin Wood 22f88bf9d1 Redesign Democracy pallet (#5294)
* Repot a bit of democracy code

* Basic logic is drafted

* Lazy democracy builds.

* Add non-locked split-voting and instant-scheduling.

* Introduce delegation that works.

* Builds again.

* Indentation

* Building.

* Docs and migration

* Fix half of the tests

* Fix up & repot tests

* Fix runtime build

* Update docs

* Docs

* Nits.

* Turnout counts full capital

* Delegations could towards capital

* proxy delegation & proxy unvoting

* Fix

* Tests for split-voting

* Add missing file

* Persistent locking.
2020-03-21 16:08:48 +01:00
Hero Bird 017f218926 Implement ext_ hashes for contracts (issue #5258) (#5326)
* Implement ext_ hashes for contracts (issue #5258)

* load cryto hash .wat from raw string literal instead of file

* update .wat contents for testing crypto hashes

* remove unnecessary 'static

* fix bug in input (call_indirect required 1+ at least it seems)

* no longer use scratch buffer for crypto hash functions

* improve doc comments of ext_ hash functions

* remove unnecessary comment in .wat test file

* add return value (const 0) to contract test to hopefully enable result buffer

* fix bug in contract assertion

* implement proper output_len in contract

* implement proper test for crypto hashes

* bump spec_version 238 -> 239

* fix COMPLEXITY description

* remove final invalid instances of scratch buffer from docs
2020-03-20 18:46:51 +01:00
Shawn Tabrizi ca3cbbfc14 Benchmark Treasury Pallet (#5287)
* Start benchmarks

* try_origin or root

* More benches

* stuck

* Custom trait functions for benchmarks

* finish benchmarks

* Bump impl

* More comments

* Bump spec

* Remove import

* Update frame/elections-phragmen/src/lib.rs

Co-Authored-By: thiolliere <gui.thiolliere@gmail.com>

* Update frame/support/src/traits.rs

Co-Authored-By: thiolliere <gui.thiolliere@gmail.com>

* Fix merge

Co-authored-by: thiolliere <gui.thiolliere@gmail.com>
2020-03-20 15:08:16 +01:00
Shawn Tabrizi 400a62680f Benchmark Im Online Pallet (#5318)
* Initial benchmarking setup

* Add keystore

* validate unsigned

* Update frame/im-online/src/benchmarking.rs

Co-Authored-By: Marcio Diaz <marcio.diaz@gmail.com>

* Fix verify_unsigned benchmark

* add variable for teting the external addresss length

* Update frame/im-online/src/benchmarking.rs

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

* Update utils/frame/benchmarking-cli/src/lib.rs

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

Co-authored-by: Marcio Diaz <marcio.diaz@gmail.com>
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
Co-authored-by: Benjamin Kampmann <ben@gnunicorn.org>
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
2020-03-20 12:42:00 +01:00
Gavin Wood 7947cbf915 Remove migration code. (#5291)
* Remove migration code.

* Fix cargo

* Bump spec version
2020-03-19 23:01:13 +01:00
Shawn Tabrizi 9c06d8c6f4 Benchmark Staking and Session Pallet (#5183)
* starting bench

* More

* more

* Payout Validator

* Give each validator exactly n nominators

* Update with test

* Try to add accounts to chain spec

* Undo changes to chainspec

* Payout nominator

* Rebond and Reap Stash

* Set history depth

* fix smelly code

* cancel deferred slash

* new_era bench

* do_slash benchmark

* Add features

* undo extrinsic move

* lower

* Update new era

* Update benchmarking.rs

* whitespace

* Apply suggestions from code review

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

* fixes

* nit

* Refactor tests, initial code

* Move session benchmarks to avoid cyclic deps

* Update lib.rs

* Fix warnings

* Move impl

* Update to do random nominator allocation

* add feature to benchmark pallet

* Remove extra stuff

* Update based on feedback

* Less intrusive

* Remove `transfer_idle_users`

* remove again

* unused dep

* test feature flag

* Update to latest substrate

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
2020-03-17 14:12:04 +01:00
Gavin Wood af9083f53b Refactor away from opaque hashes (#5226)
* System.BlockHash

* Fix hash

* Introduce K/V iteration in all _concat maps

Also move across:
- System.Account (blake2_128_concat)
- Balances.Locks (twox_64_concat)
- ElectionsPhragmen.VotesOf (twox_64_concat)
- ElectionsPhragmen.StakeOf (twox_64_concat)
- Identity.IdentityOf (twox_64_concat)
- Identity.SubsOf (twox_64_concat)
- Society.Payouts (twox_64_concat)
- Session.NextKeys (twox_64_concat)
- Identity.SuperOf (blake2_128_concat)
- Session.KeyOwner (blake2_128_concat)
- Society.SuspendedCandidates (twox_64_concat)
- Society.SuspendedMembers (twox_64_concat)
- Society.Vouching (twox_64_concat)
- Society.Strikes (twox_64_concat)
- System.EventTopics
- Balances.Account

* Build fixes

* Ensure migration happens in correct order

* Staking.*

* Vesting.* Offences.*

* Democracy.*

* Babe.* Collective.*

* Grandpa.*

* Assets.* Benchmark.* Contracts.* Elections.* Asset.* Nicks.*

Also introduce real account list

* ImOnline.*

* Treasury.*

* Recovery.*

* Final bits.

* Docs

* Fix one test

* Fix test

* All passing except the UI tests

* Remove linked_map part 1

* Remove linked_map

* Some iterator utils for double maps.

* Remove old migrations

* Introduce tombstone for LinkedMap type

* Migration for genesis hash

* Fix build

* Fix hash

* Rename Map is_linked -> unused, keeping backwards compat (#5256)

* Update frame/balances/src/lib.rs

Co-Authored-By: Shawn Tabrizi <shawntabrizi@gmail.com>

* Update frame/elections/src/lib.rs

Co-Authored-By: Shawn Tabrizi <shawntabrizi@gmail.com>

* Remove old migration code.

* Update frame/system/src/lib.rs

Co-Authored-By: Shawn Tabrizi <shawntabrizi@gmail.com>

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

Co-Authored-By: Shawn Tabrizi <shawntabrizi@gmail.com>

* Fix hash

* fix session migration

* Fix watning

Co-authored-by: Jaco Greeff <jacogr@gmail.com>
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
Co-authored-by: Robert Habermeier <rphmeier@gmail.com>
2020-03-16 23:19:53 +01:00
Alexander Theißen b817763ea9 Add ext_transfer call (#5169)
* contracts: Add ext_transfer call

This call allows contracts to send balance to any account
contract or not. Previously, the only way to do that was
though ext_call.

* Apply suggestions from code review

Co-Authored-By: Nikolay Volf <nikvolf@gmail.com>

* The define_env! macro does not allow for trailing comma

* Update frame/contracts/src/exec.rs

Co-Authored-By: Nikolay Volf <nikvolf@gmail.com>

* Bump spec version

* Do not use nested gas meter

* Use explicit 0 or 1 as return value

* Remove superflous intermediate binding

Co-authored-by: Nikolay Volf <nikvolf@gmail.com>
2020-03-14 12:49:22 +01:00
Gavin Wood 2387543ecb Split fees and tips between author and treasury independently (#5207)
* Split fees and tips between author and treasury independently

* Docs and cleanup

* Fix test
2020-03-12 00:15:39 +01:00
Hero Bird e5e0ca7389 Split ext_clear_storage out from ext_set_storage (#5103)
* split out ext_clear_storage from ext_set_storage contracts API

* update tests to adjust for the ext_set_storage changes

* adjust COMPLEXITY for the ext_set_storage API changes

* remove value_len == 0 constraint for ext_set_storage

* bump spec_version

* remove guarantee from COMPLEXITY of ext_clear_storage

Co-authored-by: Gavin Wood <gavin@parity.io>
2020-03-11 09:46:20 +01:00
Stanislav Tkach 93ee3104e7 Use CLI to configure max instances cache (#5177)
* Use CLI to configure max instances cache

* Fix tests

* Move default value into CLI

* Use SmallVec

* Apply review comments

* Get rid of `SmallVec`

Co-authored-by: Bastian Köcher <git@kchr.de>
2020-03-11 09:43:37 +01:00
thiolliere 1b4dcd1f23 Staking improve payout_validator (#5208)
* add documentation and optimise payout_validator a bit

* bump spec version to be safe

this is just in case clipped exposure and exposure have different fields
own and total. This shouldn't be the case but better be safe in case
storage is wrong.

* Update frame/staking/src/lib.rs

Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
2020-03-10 20:54:29 +01:00
Shawn Tabrizi 0971fff470 Update logic to cancel_deferred_slash (#5186)
* Update logic to cancel_deferred_slash

* More idiomatic

* bump spec

Co-authored-by: Gavin Wood <gavin@parity.io>
2020-03-09 12:39:05 +01:00
Marcio Diaz 013fb6ae18 Benchmark Vesting (#5048)
* Init macro

* Refactor function.

* Add feature

* vested transfer benchmark

* Fix features

* Forgot to push this fix

* bump impl

* Nits.

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
2020-03-09 10:12:20 +01:00
Gavin Wood 1c94a03780 Second migration fix (#5178)
* Second migration fix

* Fix check-runtime script

* Another fix to the CI

* Revert changes.

* Bump runtime
2020-03-06 23:46:38 +01:00
Gavin Wood 615dc00702 Migration fix (#5174) 2020-03-06 21:23:14 +01:00
Bastian Köcher c244b1d036 Revert "Build block without checking signatures (#4916)" (#5159)
* Revert "Build block without checking signatures (#4916)"

This reverts commit e50f610907.

* Some further clean ups
2020-03-06 15:27:59 +01:00
Gavin Wood 0573f1408d Introduce default-setting prime for collective (#5137)
* Introduce default-setting prime for collective

* Docs.

* Elections phragmen supports prime

* Fix

* Membership supports prime

* Fix

* Update frame/collective/src/lib.rs

Co-Authored-By: Shawn Tabrizi <shawntabrizi@gmail.com>

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
2020-03-05 15:57:03 +01:00
Gavin Wood 91b44299d8 Adds a session getter to historical proofs (#5125)
* Adds a session getter to historical proofs

* Bump spec_version

* Adds some useful trait derives to Proof
2020-03-05 13:37:59 +01:00
Gavin Wood ddbcefe928 Adds vested_transfer to Vesting pallet (#5029)
* Add the vested_transfer function with tests

* Add VestingDeposit for minimum amount to create a new schedule

* Remove irrelevant file commit

* Bump spec

* Add weight comment

* Fix CI build

* Make the check before the transfer

* Update frame/vesting/src/lib.rs

Co-Authored-By: Shawn Tabrizi <shawntabrizi@gmail.com>

* Update frame/vesting/src/lib.rs

Co-Authored-By: Shawn Tabrizi <shawntabrizi@gmail.com>

* Update frame/vesting/src/lib.rs

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

* Update frame/vesting/src/lib.rs

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

* Update frame/vesting/src/lib.rs

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

* Add tab to line 249

* Rename to `MinVestedTransfer` for clarity

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
2020-03-05 12:03:20 +01:00
Benjamin Kampmann ff2a36d7cb Hide benchmarks behind a feature flag (#5024)
* Hide benchmarks behind a feature flag

* Propage attributes in impl_runtime_apis macro

* Bump impl_version

* Fillter cfg attributes

* Hide more things under the feature

* Fix set_block_number availability

* Rename filter_attrs -> filter_cfg_attrs

* Rename runtime_benchmarks to runtime-benchmarks
2020-03-05 10:40:55 +01:00
Gavin Wood 619f64efe9 Lazy payouts (#4474)
* TODOs

* Remove superfluous:

* partial implementation

* full implementation

* fix preferences

* update comments

* upgrade test WIP

* fix more tests

* fix cutoff

* fix saturation

* comment

* upgrade mock

* upgrade test

* WIP migration

* WIP migration

* remove slot stake stuff

* fix merge

* migration of ledger

* remove equalize from test

* add test

* fix

* update doc

* fix compilation

* improve test readibility

* improve doc

* fix most todo

* fix migration and test

* remove println

* WIP

* add test and spec

* weight

* update doc

* safer end_era

* fix exposure of conversion

* Revert "safer end_era"

This reverts commit 72ff737d27be67d87308514b13e2574bc5f09fce.

* fix useless put

* exposure clipped

* doc

* fix payout with clipped

* fix node runtime

* add doc

* pluggable and generalized staking module

* remove print

* update doc

* refactor

* improve documentation and implementation

* fix test

* Fix test

* fix test

* fix test

* fix remove lowest stake from exposure, not biggest.

* nomination index arguments in nominator_payout

* add test

* try to fix offence

* apply slashed and bond eras until active era

* doc

* update spec version

* add test upgrade from previous test environment

* Apply suggestions from code review

Co-Authored-By: Shawn Tabrizi <shawntabrizi@gmail.com>

* nominators upgrade has been cleaned

* dynamic history depth implementation

* make current_era - history_depth included

* Change equality check to start era to less than or equal

* Use era specific validator prefs

* Add print statement and comment about start era if <

* fix next_reward overflow

* make more check for bad era claim for zero cost

* small refactor

* code refactor + fix use of deprecated storage

* fix wasm build

* add comment

* Fix tests

* remove outdated comment

* Apply suggestions from code review

Co-Authored-By: Shawn Tabrizi <shawntabrizi@gmail.com>

* gather active era information into one storage

Co-authored-by: thiolliere <gui.thiolliere@gmail.com>
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
2020-03-03 14:48:20 +01:00
Fedor Sakharov 8539b85c99 Offence reporting returns a result (#5082)
* Offence reporting returns a result

* Bump spec_version

* Use unwrap instead of assertions

* Fix more review grumbles
2020-03-02 11:00:38 +01:00
Marcio Diaz 347b5d641c Add options to overwrite range bounds in benchmark command. (#5072)
* Add --mins --maxs to benchmark command.

* Apply review suggestions.
2020-02-28 15:40:42 +01:00
Marcio Diaz d39605d9cd Propagate DispatchError for benchmarks. (#5075)
* Propagate DispatchError for benchmarks.

* Apply review suggestions.

* Use RuntimeString.

* fix expect

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

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
2020-02-28 12:05:27 +01:00
Eric 01c6b7cdde Fix/div by zero (#5041)
* Handle gas_price being zero separately

* Bump spec_version

* Add a unit & integration tests for gas price = 0
2020-02-26 15:19:53 +01:00
Marcio Diaz d024364503 Add steps setting to benchmarking CLI (#5033)
* Add steps setting to CLI, use max value to hit worst case.

* Bump impl_version.

* Apply review suggestion.
2020-02-25 15:51:25 +01:00
Gavin Wood afa5861f3b Lazy reaping (#4895)
* Squash and rebase from gav-lazy-reaping

* Bump version

* Bump runtime again

* Docs.

* Remove old functions

* Update frame/balances/src/lib.rs

Co-Authored-By: Shawn Tabrizi <shawntabrizi@gmail.com>

* Update frame/contracts/src/lib.rs

Co-Authored-By: Shawn Tabrizi <shawntabrizi@gmail.com>

* Warnings

* Bump runtime version

* Update frame/democracy/src/lib.rs

Co-Authored-By: Shawn Tabrizi <shawntabrizi@gmail.com>

* Update frame/system/src/lib.rs

* Clean up OnReapAccount

* Use frame_support debug

* Bump spec

* Renames and fix

* Fix

* Fix rename

* Fix

* Increase time for test

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
Co-authored-by: Benjamin Kampmann <ben.kampmann@googlemail.com>
2020-02-24 18:04:42 +01:00
Tomasz Drwięga e8871e0327 Un-deprecate ValidateUnsigned (#5003)
* Un-deprecate ValidateUnsigned.

* Bump runtime.

* Bump runtime.

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
2020-02-21 10:42:55 +01:00
Gavin Wood f5176ba377 Benchmark macro (#4962)
* MAcro benchamrks

* Iterative macro

* Tidying it up.

* Macro improvements

* Bits..

* Last benchmaks.

* Repo benchmark macro

* Add the possibility of evaluating arbitrary expressions in a
benchmaark

* Better syntax and docs

* Update `BenchmarkParameter`

* Add `ignore` to sudo-code in docs

* First try of timestamp implementation.

* Fix macro docs, remove warnings.

* Use macro in balances pallet.

* Make some space in frame benchmarking.

* Remove _benchmarks_seed variable.

* Bump impl_version.

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
Co-authored-by: Marcio Diaz <marcio@parity.io>
2020-02-20 17:20:16 +01:00
Kian Paimani b368736be4 Unsigned transactions should also note weight (#4998)
* Make unsigned also note weight

* Bump.

* Fix tests

* Better fee test

* Fix another test

* Update lock file
2020-02-20 16:46:11 +01:00
Tomasz Drwięga 9a0b8b5be5 Offchain Workers: Example Pallet (#4989)
* Example of offchain worker pallet.

* Fix compilation issues.

* Use serde_json to parse JSON.

* Add some basic tests.

* Working on docs.

* Fix compilation

* Finish docs for signed.

* Work on unsigned send.

* Add some tests and missing docs.

* Add example of StorageValueRef

* Add weight.

* Extra \n

* Fix im-online test.

* Bump runtime.

* Fix tests.

* Apply suggestions from code review

Co-Authored-By: Joshy Orndorff <JoshOrndorff@users.noreply.github.com>
Co-Authored-By: Gavin Wood <gavin@parity.io>

* Address review comments.

Co-authored-by: Joshy Orndorff <JoshOrndorff@users.noreply.github.com>
Co-authored-by: Gavin Wood <github@gavwood.com>
2020-02-20 15:21:34 +01:00
Shawn Tabrizi 8cdf98c773 vesting_balance returns Option (#4987)
* `vesting_balance` returns `Option`

* bump impl
2020-02-20 13:25:52 +01:00
Alexander Popiak a98e6b0ec8 Rename remaining occurences of SRML to FRAME (#4932)
* rename remaining SRML occurences to FRAME

* Some module -> pallet

* remove out of date url

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
Co-authored-by: Cecile Tonglet <cecile.tonglet@cecton.com>
2020-02-19 10:46:54 +01:00
Bastian Köcher b4ebd41c21 Consolidate frame benchmarking into a frame crate (#4977)
This prs cleans up some of the frame benchmarking stuff:
- Move CLI into `frame-benchmarking-cli`. No frame related CLI should
exists in the default Substrate CLI.
- Move all traits and types related to frame benchmarking into the
`frame-benchmarking` trait. Frame types should be isolated in Frame.
2020-02-19 10:22:36 +01:00
Nikolay Volf e50f610907 Build block without checking signatures (#4916)
* in executive

* in other places

* to UnsafeResult

* move doc comment

* apply suggestions

* allow validity mocking for TestXt

* add test

* augment checkable instead of another trait

* fix im online test

* blockbuilder dihotomy

* review suggestions

* update test

* Update client/block-builder/src/lib.rs

* updae spec_version

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
2020-02-18 23:34:31 +01:00
Shawn Tabrizi 0049a93af0 Utility/Recovery passthrough always pays a fee. (#4953)
* Utility passthrough always pays a fee.

* Use `FunctionOf` instead of Passthrough

* Update recovery passthrough
2020-02-18 00:59:08 +01:00
Seun Lanlege 5567d18b6a Adds babe rpc support (#4729)
* babe_epochAuthorship
remove test-helpers from sp-keyring, bump spec_version, impl_version

* bump Cargo.lock

* add BabeRPC to node-rpc

* rename to BabeApi, remove err_derive

* pass &ServiceBuilder to with_rpc_extensions callback

* sc-consensus-babe-rpc

* Update client/consensus/babe/src/lib.rs

Co-Authored-By: Tomasz Drwięga <tomusdrw@users.noreply.github.com>

* Better docs, code style chanegs

Co-Authored-By: André Silva <andre.beat@gmail.com>

* new line at the end of Cargo.toml

Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
Co-authored-by: André Silva <andre.beat@gmail.com>
2020-02-17 18:05:30 +00:00
Shawn Tabrizi ab47ee226a Add passthrough weight to Sudo (#4946)
* Add passthrough weight to Sudo

* Bump spec version

* Passthrough `pays_fee`

* Sudo always pays fee

* Use `FunctionOf`

* Add support for closure in dispatch classification

* Update docs
2020-02-17 17:30:49 +01:00
Shawn Tabrizi c7a14db792 Fix various spelling errors (#4940)
* meaningfull -> meaningful

* initialise -> initialize

* tokans -> tokens

* incentivise -> incentivize

* lenght -> length

* incentivisation -> incentivization

* doesnt't -> doesn't

* overwriten -> overwritten

* lifecycle -> life cycle

* lifecycle -> life cycle

* usefull -> useful

* noone -> no one

* spaming -> spamming

* defered -> deferred

* hieght -> height

* sumation -> summation

* ingore -> ignore

* registed -> registered

* Auxialary -> Auxiliary

* loggin -> logging

* independance -> independence

* trailling -> trailing

* responsability -> responsibility

* trunkated -> truncated

* Weither -> Whether

* informations -> information

* Runtume -> Runtime

* choosen -> chosen

* delcataion -> declaration

* Unchekced -> Unchecked

* defintion -> definition

* scrach -> scratch

* imput -> input

* transfered -> transferred

* endownment -> endowment

* Determinator -> Determiner

* relevent -> relevant

* emited -> emitted

* acocunt -> account

* proprotional -> proportional

* instantiaion -> instantiation

* commited -> committed

* tombstonedead -> tombstone

* uwnrap -> unwrap

* acount -> account

* specialised -> specialized

* existant -> existent

* requried -> required

* Anull -> Annul

* AUTHORITES -> AUTHORITIES

* underyling -> underlying

* recognisable -> recognizable

* Capitalise -> Capitalize

* reportfor -> report for

* hearbeat -> heartbeat

* onlineness -> being online

* creater -> creator

* Bytearray -> Byte array

* Despoit -> Deposit

* substratced -> subtracted

* Curent -> Current

* imbalanes -> imbalances

* countfown -> countdown

* inexisting -> inexistent

* additionaly -> additionally

* substracted -> subtracted

* auxilary -> auxiliary

* parital -> partial

* in't -> isn't

* compatability -> compatibility

* infomation -> information

* etected -> detected

* extrinsiscs -> extrinsics

* reprensentation -> representation

* coonfiguration -> configuration

* primtives -> primitives

* miscelanious -> miscellaneous

* VERISON -> VERSION

* endcoded -> encoded

* Genrates -> Generates

* miliseconds -> milliseconds

* occured -> occurred

* trully -> truely

* truely -> truly

* conjuction -> conjunction

* encouters -> encounters

* customised -> customized

* deterministicly -> deterministically

* finalisation -> finalization

* pluggable -> plugable

* wakeup -> wake-up

* interemdiate -> intermediate

* intepreting -> interpreting

* finalzied -> finalized

* throgh -> through

* extinsic -> extrinsic

* convient -> convenient

* allocater -> allocator

* propagateable -> propagatable

* succesfuly -> successfully

* finalising -> finalizing

* publically -> publicly

* phrasee -> phrase

* substration -> substractions

* substractions -> subtractions

* neccessarily -> necessarily

* Inlucde -> Include

* unefficient -> inefficient

* thay -> they

* funtion -> function

* datastructures -> data structures

* infromation -> information

* propagatable -> propagable

* ecountered -> encountered

* recognise -> recognize

* intergration -> integration

* lastet -> latest

* datatypes -> data types

* datatype -> data type

* Strongarming -> Strong Arming

* avaible -> available

* Commiting -> Committing

* Retreiving -> Retrieving

* shoud -> should

* canonicaliziation -> canonicalization

* comitted -> committed

* clonable -> cloneable

* Uknown -> Unknown

* reponse -> response

* arbitary -> arbitrary

* Capapbilities -> Capabilities

* responsbile -> responsible

* initialisation -> initialization

* cames -> came

* intemediate -> intermediate

* reqeust -> request

* intance -> instance

* explcitly -> explicitly

* neighor -> neighbor

* reolving -> resolving

* untill -> until

* Validte -> Validate

* deserailize -> deserialize

* literaly -> literally

* preceeding -> preceding

* abpve -> above

* chcecked -> checked

* numbet -> number

* Unknow -> Unknown

* halfs -> halves

* gossup -> gossip

* givent -> given

* immediatelly -> immediately

* slicable -> sliceable

* conensus -> consensus

* Mimicks -> Mimics

* acccept -> accept

* serialise -> serialize

* exstrinsics -> extrinsics

* panicks -> panics

* maintaince -> maintenance

* repeatidely -> repeatedly

* anecstor -> ancestor

* becasue -> because

* processer -> processor

* Prunning -> Pruning

* insterested -> interested

* unuseful -> not useful

* yeided -> yielded

* descendfing -> descending

* corresponts -> corresponds

* survivew -> survive

* keps -> keeps

* ligh -> light

* prerequisities -> prerequisites

* positiion -> position

* depedency -> dependency

* extrinisic -> extrinsic

* atomicaly -> atomically

* staticly -> statically

* resul -> result

* timestamb -> timestamp

* Utilites -> Utilities

* ammount -> amount

* pocess -> process

* exteral -> external

* Update client/finality-grandpa/src/tests.rs

* Update primitives/io/src/lib.rs

Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* Update primitives/blockchain/src/lib.rs

Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* Update frame/support/src/weights.rs

Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

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

Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* Update client/api/src/execution_extensions.rs

Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* Update client/cli/src/params.rs

Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* Update client/executor/common/src/sandbox.rs

Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* Update client/api/src/execution_extensions.rs

Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* Update client/finality-grandpa/src/communication/mod.rs

Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* Update client/state-db/src/pruning.rs

Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* Update frame/contracts/src/tests.rs

Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* Update client/api/src/execution_extensions.rs

* bump impl

* timestamb -> timestamp

Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
2020-02-17 15:07:24 +01:00
Bastian Köcher 625e963aa2 Remove default expansion from construct_runtime! (#4937)
This removes the following syntactic sugar from `construct_runtime!`:

- Expansion of `default` to the default set of module parts
- Expansion of `System: system` to the default set of module parts

The macro now requires the user to provide all the module parts of a pallet.
2020-02-15 14:40:29 +01:00
Alexander Theißen b999911bcf Allow to distinguish out of gas from other traps (#4883)
* contracts: Allow to distinguish out of gas from other traps

When a contract encounters a runtime error a wasm trap is
triggered and the execution is halted. Currently, no matter
what was the cause for the trap it is always reported as:
DispatchError::Other("contract trapped during execution").

However, the trap that is triggered if a contract exhausts
its gas budget is particulary interesting. Therefore we add
a seperate error message for this cause:
DispatchError::Other("ran out of gas during contract execution").

A test is added hat executes a contract that never terminates.
Therefore it always exhausts is gas budget.

* fixup! contracts: Allow to distinguish out of gas from other traps

Remove overlong lines.

* fixup! contracts: Allow to distinguish out of gas from other traps

Rename Contract to Contracts
2020-02-14 11:46:45 +01:00
Gavin Wood 5b7512e2e4 Composite accounts (#4820)
* Basic account composition.

* Add try_mutate_exists

* De-duplicate

* Refactor away the UpdateBalanceOutcome

* Expunge final UpdateBalanceOutcome refs

* Refactor transfer

* Refactor reservable currency stuff.

* Test with the alternative setup.

* Fixes

* Test with both setups.

* Fixes

* Fix

* Fix macros

* Make indices opt-in

* Remove CreationFee, and make indices opt-in.

* Fix construct_runtime

* Fix last few bits

* Fix tests

* Update trait impls

* Don't hardcode the system event

* Make tests build and fix some stuff.

* Pointlessly bump runtime version

* Fix benchmark

* Another fix

* Whitespace

* Make indices module economically safe

* Migrations for indices.

* Fix

* Whilespace

* Trim defunct migrations

* Remove unused storage item

* More contains_key fixes

* Docs.

* Bump runtime

* Remove unneeded code

* Fix test

* Fix test

* Update frame/balances/src/lib.rs

Co-Authored-By: Shawn Tabrizi <shawntabrizi@gmail.com>

* Fix ED logic

* Repatriate reserved logic

* Typo

* Fix typo

* Update frame/system/src/lib.rs

Co-Authored-By: Shawn Tabrizi <shawntabrizi@gmail.com>

* Update frame/system/src/lib.rs

Co-Authored-By: Shawn Tabrizi <shawntabrizi@gmail.com>

* Last few fixes

* Another fix

* Build fix

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: Jaco Greeff <jacogr@gmail.com>
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
2020-02-14 00:47:51 +00:00
Wei Tang 78b5a06200 pallet-evm: refactor duplicate code in call/create/create2 (#4922)
* pallet-evm: refactor duplicate code in call/create/create2

* Bump runtime version
2020-02-13 21:21:19 +01:00
Wei Tang 0f122445f6 pallet-evm: add support for transaction-level create2 (#4907)
* pallet-evm: add support for transaction-level create2

* Bump runtime version

* Switch to FunctionOf for weights
2020-02-13 19:12:26 +01:00
Kian Paimani c871eaacbc Per-things trait. (#4904)
* Give perthigns the trait it always deserved.

* Make staking and phragmen work with the new generic per_thing

* Make everything work together 🔨

* a bit of cleanup

* Clean usage

* Bump.

* Fix name

* fix grumbles

* hopefully fix the ui test

* Some grumbles

* revamp traits again

* Better naming again.
2020-02-13 13:09:33 +01:00
Nikolay Volf e6454eb091 Full block import benchmark (#4865)
* full block import benchmark

* try rocksdb cache

* add profiling helper

* use random keyring instead of zero caching

* update docs

* add more io stats

* remove last sentence

* add ci job to see

* Update primitives/keyring/src/sr25519.rs

Co-Authored-By: Marcio Diaz <marcio.diaz@gmail.com>

* switch to 100tx-block

* remove ci script

Co-authored-by: Marcio Diaz <marcio@parity.io>
2020-02-13 14:09:00 +03:00
Xiliang Chen 35b5cdd29b serialize partial_fee into string (#4898)
* serialize partial_fee into string

* implement deserialize

* bump version
2020-02-12 13:16:00 +01:00
Shawn Tabrizi 13971fe2a7 Benchmark the Balances Pallet (#4879)
* Initial transfer bench

* Add best case

* Transfer keep alive

* Set balance benchmarks

* Bump impl

* Fix text

Co-authored-by: Gavin Wood <github@gavwood.com>
2020-02-12 12:11:20 +01:00