Commit Graph

2912 Commits

Author SHA1 Message Date
Arkadiy Paronyan 3c79e6d03c Fixed a few warnings (#4841) 2020-02-06 14:06:53 +01:00
Wei Tang 710ffebcca pallet-evm: log created address (#4821)
* pallet-evm: log created address

* Bump spec_version

* Only emit Created event when ExitReason is Succeed
2020-02-04 16:58:23 +01:00
Demi Obenour 0ab013bddb Bump parking_lot (#4817)
Hopefully this can be merged if the tests pass.
2020-02-04 16:56:50 +01:00
Gautam Dhameja 78006d0523 Added GetCallMetadata for extrinsic calls. (#4791)
* Added GetCallMetadata for extrinsic calls.

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

* Improved test for outer call metadata.

* fixed review comments

* removed dead code

* fixed review suggestions

* Update frame/support/src/dispatch.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
2020-02-04 11:25:04 +01:00
Gavin Wood 1c9418d748 Don't attempt to upgrade balances module on chain start (#4802)
* Introduce vesting to node, debug message for upgrades and fix them

* Bump spec version
2020-02-01 18:08:39 +00:00
Gav Wood 2b41fe2856 Urgent patch 2020-02-01 13:28:37 +00:00
Gavin Wood d52d8692f9 Refactor the balances module (#4649)
* Initially scoping out of the problem

* Remove need for exiry in balance locks.

* Remove expiry from locks.

* Remove supefluous balance test

* Amalgamate pieces of balance module

* Split out vesting

* Fix tests

* Fixes for vesting.

* Docs.

* Weight docs.

* Refactor things in terms of set_balances.

* Switch out ED to be free + reserved.

* Remove on_free_balance_zero and some docs.

* Build fixes

* Update frame/vesting/src/lib.rs

Co-Authored-By: Xiliang Chen <xlchen1291@gmail.com>

* Update frame/vesting/src/lib.rs

Co-Authored-By: Xiliang Chen <xlchen1291@gmail.com>

* Migration

* Remove superfluous code.

* Test fixes

* Fix some tests

* Fix repatriate reserve

* Fixes

* Add test for migration

* Final cleanups

* Fix

* Indentation.

* Undo unneeded referencing

* Bump runtime version

* Fixes

Co-authored-by: Xiliang Chen <xlchen1291@gmail.com>
2020-02-01 13:20:16 +00:00
Tomasz Drwięga 2f9315cc02 Refactor im-online and print more debug info. (#4771)
* Initial version.

* Fix tests.

* Refactor using StorageValueRef.

* Add tests and apply review suggestions.

* Bump runtime.

Co-authored-by: Gavin Wood <github@gavwood.com>
2020-01-31 18:59:49 +00:00
thiolliere a36a170c15 remove ambiguous into_iter (#4794) 2020-01-31 18:49:02 +01:00
Sergei Pepyakin 4cbd03f62b Small follow-up docs improvements in rent module (#4790)
* Small follow-up docs improvements in rent module

* Update frame/contracts/src/rent.rs

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

* Use a shorter version of the sentence

Co-authored-by: thiolliere <gui.thiolliere@gmail.com>
2020-01-31 17:27:10 +01:00
Sergei Pepyakin df6ef1780f pallet-contracts: Rent projection RPC (#4754)
* Initial approach

* Introduce the pallet-contracts-common crate

* Add rent::compute_rent_projection

* Wire everything together

* Fix build error.

* Rename EvictionDate → EvictionAt.

* Clean.

* Renaming and cleaning.

* Add documentation for rent_projection RPC.

* Add documentation for rent_projection runtime API.

* Refactor rent_budget.

Merge it with subsistence_treshold.

* Bump impl_version

* Constrain RPC impl with Block::Header::Number.

* Rename pallet-contracts-common into -primitives

* Add a comment for `compute_rent_projection` on the usage

* Small tidying
2020-01-31 15:22:25 +01:00
Bastian Köcher 45938d8033 Expose information about the extrinsic in the metadata (#4774)
* Expose information about the extrinsic in the metadata

This pr exposes some information about the extrinsic used in the runtime
via metadata. The following information are exposed:

- Version of the extrinsic
- List of all signed extensions used by the extrinsic.

* Increment `spec_version`
2020-01-30 16:41:03 +01:00
Gavin Wood 907fd8c2fa Identity should bound additional fields (#4770)
* Identity should bound additional fields

* ump rutnime
2020-01-29 18:41:51 +01:00
Bastian Köcher 4c36143375 Add get_global for Sandbox (#4756)
* Add `get_global` for `Sandbox`

This pr adds `get_global` to retrieve a `global` variable from an
instantiated sandbox wasm blob.

* Bump `spec_version`

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

Co-Authored-By: Sergei Pepyakin <sergei@parity.io>

* `get_global` -> `get_global_val`

Co-authored-by: Sergei Pepyakin <s.pepyakin@gmail.com>
Co-authored-by: Gavin Wood <github@gavwood.com>
2020-01-29 16:24:40 +01:00
Gavin Wood 5c1c31ccd4 Revamp some of the weights (#4759)
* Remove free transaction dos vectors.

* Bump spec version

* Indentation.

* Update frame/support/src/weights.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
2020-01-29 13:38:46 +01:00
thiolliere 556c80e792 LinkedMap doesn't implement StoragePrefixedMap (#4760)
* LinkedMap doesn't implement StoragePrefixedMap

* fix test
2020-01-29 13:36:52 +01:00
Sergei Pepyakin 2c90562818 Clean up indentation problems (#4762) 2020-01-29 13:27:23 +01:00
thiolliere f4fa59470a doc (#4761) 2020-01-29 13:26:09 +01:00
Benjamin Kampmann 3f9a05a0d3 clarify licensing (#4755)
* adding license fields to all crates

* Apply suggestions from code review

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

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
2020-01-29 11:57:13 +01:00
Hoani Bryson d38e96f2e1 Remove unnecessary duplication in generic asset create (#4744)
* Remove unneccessary duplication in generic asset create

* Increment impl_version due to refactoring generic_asset
2020-01-28 23:30:25 +01:00
Bastian Köcher c37e9817ef Print extrinsic failed error always, not just on import (#4747)
* Print extrinsic failed error always, not just on import

Before we printed the error of a transaction only when importing a
block, this pr changes it to print the error also at building the block.

* Increment `impl_version`
2020-01-28 19:33:23 +01:00
thiolliere 76acc96f3a Remove default hasher (#4739)
* remove default hasher from decl_storage!

* fix decl_storage declarations
2020-01-27 18:23:10 +01:00
Sergei Pepyakin f39335d638 pallet-contracts: Refactor and comment rent module. (#4733)
* Refactor and comment `rent` module.

* impl_version bump

* Add doc for Exempt

* Simplify code.

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

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

* Update frame/contracts/src/exec.rs

Co-Authored-By: Hero Bird <robin.freyler@gmail.com>

Co-authored-by: thiolliere <gui.thiolliere@gmail.com>
Co-authored-by: Hero Bird <robbepop@web.de>
2020-01-27 17:40:57 +01:00
Joshy Orndorff 957ea8ba46 Remove references to frame_consensus from docs (#4582)
* Simply remove references to frame_consensus

* More thorough re-write

* Update frame/session/src/lib.rs

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

* on_initialize is not dispatchable

* Attempt to fix test.

* Actually fix test.

* Actually ran passing test.

* Update frame/session/src/lib.rs

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

Co-authored-by: thiolliere <gui.thiolliere@gmail.com>
2020-01-27 17:14:10 +01:00
thiolliere e4f3e85585 Improve decl storage parsing (#4731)
* improve decl storage parsing

* remove hidding detail macro

* Apply suggestions from code review

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
2020-01-24 20:04:11 +01:00
Bastian Köcher b7887df104 Deposit event on frame-system::set_code (#4726)
* Deposit event on `frame-system::set_code`

* Update frame/system/src/lib.rs

Co-authored-by: thiolliere <gui.thiolliere@gmail.com>
2020-01-24 13:38:45 +01:00
Jaco Greeff b89ac5d2ef Expose recovery module errors in metadata (#4727) 2020-01-24 10:02:55 +01:00
Hero Bird 389b8f1698 [contracts] Add ext_tombstone_deposit (#4722)
* [contracts] add ext_tombstone_deposit

* [contracts] update tombstone_deposit docs
2020-01-23 15:13:49 +01:00
Bastian Köcher 8370b99709 Expose Error in metadata for pallet-utility (#4721) 2020-01-23 14:35:04 +01:00
Hero Bird caa6efa5ec contracts: New contract events + unconfusions (#4685)
* contracts: during execution -> contract trapped during execution

This message confused many people so we are improving it to make clear what happened.

* contracts: rename Event::Contract -> Event::ContractExecution

* contracts: fix tests after ContractExecution renaming

* contracts: Add Evicted and Restored events

* fix doc comment

* wrap to not go over (soft) 100 column line limit

* add event deposit for eventual eviction upon pay_rent

* contracts: adjust tests for the new events

* emit Evicted event immediately and add tombstone flag bool
2020-01-21 13:06:54 +01:00
thiolliere 164dec95e5 Pallet session new API (#4609)
* Initial work

* Fix most things

* fix test

* fix old comment

* migration

* fix

* remove useless stuff

* fix

* less spaghetti implementation

* fix initial session

* fix
2020-01-20 17:26:53 +01:00
Robert Habermeier 3ae5e1640b keep nominations after getting kicked with zero slash (#4681)
* keep nominations after getting kicked with zero slash

* rename next_key to maybe_next_key

Co-Authored-By: Gavin Wood <gavin@parity.io>

Co-authored-by: Gavin Wood <github@gavwood.com>
2020-01-20 15:58:39 +01:00
Gavin Wood 26fa5193cd Add rules and unfounding to society. (#4671)
* Add rules and unfounding to society.

* Docs and event

* Extra bit of docs.

* Cunningly reduce complexity

* Remove candidates when unfounding.

* Remove suspended candidates when unfounding, too.
2020-01-18 18:35:25 +01:00
Xiliang Chen b72ba98b97 make compute_fee public (#4669) 2020-01-18 09:22:43 +01:00
Shawn Tabrizi bd0e72ffad Society: Ensure all votes are removed after tally (#4666)
* Ensure all votes are removed after tally

* Fix comment
2020-01-17 19:09:36 +01:00
Shawn Tabrizi d5ecec3775 Patch practical usability issues with Society (#4651)
* Add `max_members` to `found`, add society genesis for Substrate node

* Update test

* Use `Option<bool>` rather than `Option<()>`

* Update from feedback
2020-01-17 15:43:09 +01:00
Xiliang Chen 20ce6c120c remove unused safe-mix dependency (#4656) 2020-01-17 09:16:20 +01:00
Svyatoslav Nikolsky febf29390a Allow updating configuration of changes tries (#3201)
* DigestItem::ChangesTrieSignal

* introduce changes_trie::State

* introduce config activation block

* ChangesTrieSignal::as_new_configuration

* moved well_known_cache_keys to client

* extracted DbChangesTrieStorage to separate file

* change meaning of none in blockchain cache

* changes trie config (FULL) cache draft

* eliminating const ChangesTrieConfiguration

* delay pruning

* continue elimination

* do not prune CT config from cache

* removed redundant code

* fix some TODOs

* introduce ConfigurationRange

* use Configuration range in build

* build skewed digest

* remove debug print

* extracted surface iterator

* key_changes works with skewed digests

* fix client build

* add test for NeverPrune

* fix TODO

* fixed some TODOs

* more tests

* fixing TODOs

* fixed compilation

* update runtime version

* git rid of large tuple

* too long lines

* config_activation_block -> zero

* obsolete TODO

* removed unjustified expect

* update TODOs with issue number

* new CT pruning algorithm

fixed cache + multiple blocks finalization

track CT configuraiton on light clients

support CT configuration change revert

revert CT config test

new CT pruning algorithm

fixed cache + multiple blocks finalization

track CT configuraiton on light clients

support CT configuration change revert

revert CT config test

* BlockIdOrHeader isn't really required

* removed debug leftovers + some docs

* more docs

* more post-merge fixes

* more post-merge fixes

* revertes some unnecessary changes

* reverted unnecessary changes

* fix compilation + unnecessary changes

* (restart CI)

* fix cache update when finalizing multiple blocks

* fixed tests

* collect_extrinsics -> set_collect_extrinsics

* restore lost test

* do not calculate block number twice

* Update primitives/blockchain/src/error.rs

Co-Authored-By: cheme <emericchevalier.pro@gmail.com>

* map_err -> unwrap_or

* document get_at Result

* delete abandoned file

* added weight for set_changes_trie_config

* prefer_configs -> fail_if_disabled

* Update client/api/src/backend.rs

Co-Authored-By: cheme <emericchevalier.pro@gmail.com>

* Update client/db/src/changes_tries_storage.rs

Co-Authored-By: cheme <emericchevalier.pro@gmail.com>

* CommitOperation+merge -> CommitOperations

* fixed test compilation

* merged two different CTRange structs

* lost file

* uggrade db from v0 to v1 (init CT cache + add column)

* fix after merge

Co-authored-by: cheme <emericchevalier.pro@gmail.com>
Co-authored-by: Gavin Wood <github@gavwood.com>
2020-01-16 17:38:24 +01:00
Bastian Köcher afc3318f21 Implement runtime version checks in set_code (#4548)
* Implement runtime version checks in `set_code`

Check that the new runtime code given to `set_code` fullfills some
requirements:

- `spec_name` matches
- `spec_version` does not decreases
- `impl_version` does not decreases
- Either `spec_version` and `impl_version` increase

* Make tests almost work

* Some fixes after master merge

* Fix tests

* Add missed file

* Make depedency check happy?

* Remove leftover `sc-executor`

* AHHHHH

* Reset debug stuff

* Remove some 'static

* More 'static

* Some docs

* Update `Cargo.lock`
2020-01-16 13:58:37 +01:00
thiolliere 28fada7daf remove old test (#4637) 2020-01-16 08:00:01 +01:00
Weiliang Li ab1be250bc fix some discrepancies in generic-asset (#4221)
* fix generic-asset

* Update lib.rs

* Update lib.rs

* Update lib.rs

* Update lib.rs
2020-01-15 18:54:34 +01:00
Robert Habermeier 69e0cf7fe2 reset a couple of versions down from v2.0 (#4572)
* reset a couple of versions down from v0.2.0

* Unstablise browser-utils (very new) and grafana-data-source (going to be replaced with prometheus sometime)

* unmark a bunch more client crates for stabilization

* fix versions in Cargo.tomls

* Downgrade network-test

* Set frame-metadata version to `10.0.0`

* Hide and documented storage generator as internal api

* Downgrade `sp-externalities`

* Downgrade `sc-cli`

* Downgrade sc-executor et al to 0.8.0

* Downgrade sp-state-machine to 0.8.0

* Downgrade pallet-contracts et al to 0.8.0

* Downgrade sp-sandbox to 0.8.0

* downgrade pallet-evm to 0.8.0

* Downgrade pallet-staking to 0.8.0

2.0 should be implementation of lazy payout alongside all the fixes of
current module

* Downgrade node-transaction-factory to 0.8.0

* frame pallets are 2.0.0

Co-authored-by: Ashley <ashley.ruglys@gmail.com>
Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: Sergei Pepyakin <s.pepyakin@gmail.com>
Co-authored-by: Wei Tang <accounts@that.world>
Co-authored-by: thiolliere <gui.thiolliere@gmail.com>
Co-authored-by: Marcio Diaz <marcio@parity.io>
2020-01-15 18:35:27 +01:00
Shawn Tabrizi 04789bcd35 Return early when fees/balances/values are zero (#4628)
* Return early when fees/balances/values are zero

* Add docs about no-op
2020-01-15 16:37:07 +01:00
Gavin Wood 972be34e38 Add trivial EnsureFounder verifier to society (#4615)
* Add trivial EnsureFounder verifier to society

* Fix potential panic

* Keep founder account around.

* Cleanups

* Fix.

* Fix tests

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
2020-01-14 15:07:47 +01:00
Bastian Köcher ee5e8050c3 Take genesis_storage by ref (#4617)
Instead of having these weird implementation of `BuildStorage for
&ChainSpec` we should just take the `genesis_storage` by ref. The
`BuildStorage` trait changed some time ago to take a self ref anyway,
instead of a self value.

Also fixes warnings in frame-staking
2020-01-14 11:18:56 +01:00
Kian Paimani 4a353f1e81 custom weight function wrapper (#4158)
* custom weight function wrapper

* dox

* Better tests.

* remove u8 encoding

* Update frame/support/src/weights.rs

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

* fix pays fee

Co-authored-by: thiolliere <gui.thiolliere@gmail.com>
2020-01-14 08:41:18 +01:00
Shawn Tabrizi 5c0bdd339f Additional zero bid logic for Society pallet (#4604)
* Select only one zero bid, better ordering of new bids

* Select zero bid as head

* Update comment

* Update frame/society/src/tests.rs

* Add new test, logic not updated yet

* Implement `put_bid` to order same value bids

Note that this extra logic currently does not do anything per the implementation of `binary_search` in Rust.
2020-01-13 19:00:04 +01:00
Shawn Tabrizi d16d57884a A Social Account Recovery Pallet (#4531)
* Initial sketch of social recovery pallet

* Fix compilation issues

* Use a single total delay, rename stuff

* Check possible overflow

* Copyright bump

* Add mock for tests

* Add basic end to end test

* Add `create_recovery` tests

* Add malicious recovery lifecycle test

* Make clear we check for sorted and unique friends

* Work on some tests, clean up imports

* Change `if let Some(_)` to `ok_or()`

* More tests

* Finish tests, except issue with `on_free_balance_zero`

* Fix `on_free_balance_zero`

* Pallet docs

* Add function/weight docs

* Fix merge master

* OnReapAccount for System too

* Update weight docs

* Allow passthrough to support fee-less extrinsics
2020-01-13 17:52:04 +01:00
Kian Paimani 0cd8d2c2cf Remove wrong assertion from phragmen (#4515)
* remove assertion
2020-01-13 16:48:00 +01:00
Gavin Wood 2597457a7e Disable equalize, avoiding consensus issue (#4608)
* Disable equalize, avoiding consensus issue

* Update frame/staking/Cargo.toml

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
2020-01-13 12:49:52 +01:00