Commit Graph

3177 Commits

Author SHA1 Message Date
Marcio Diaz 41644c2ae8 Enable trace timings logs for transaction factory (#4845)
* Enable trace timings logs for transaction factory.
2020-02-07 08:12:19 +01:00
Nikolay Volf 8c373916a4 easy with threads (#4848) 2020-02-06 23:32:48 +01:00
Wei Tang 14b0c9a746 babe: pass epoch data via intermediates (#4807)
* babe: pass epoch data via intermediates

* Switch to use Box<dyn Any> for intermediates

* Set intermediate.epoch to be Option

* Fix proposer should put out an empty intermediate

* Remove unnecessary encode/decode

* Add EpochData to block_import_params in slot worker

* Fix aura compile

* Fix integration test
2020-02-06 17:52:30 +00:00
Wei Tang 4df27e760e Refactor epoch changes to a separate crate (#4785)
* Init epoch changes module

* Initial integration of new epoch changes module for BABE

* Fix all initial compile errors

* rename: digest -> digests

* Fix babe tests

* Bump impl_version

* Fix more test issues

* Remove test flag for tree

It unfortunately won't work for multiple crates.

* Update cargo lock

* Fix duplicate parking_lot version

* Add missing license header
2020-02-06 16:48:38 +01:00
gabriel klawitter c7a7197f97 ci: enable build for pre-tags (#4836)
* build for pre-tags

* shallow clone rustdocs
2020-02-06 16:47:44 +01:00
Bastian Köcher 07daa525b9 Allocator improvements/clean ups (#4838)
* FreeingBumpAllocator: Initialize the heads to `u32::max_value()`

`self.heads` can point to an element with the index `0` in the heap.
This would make the allocator fail to reuse this element.

* Simplify the `PREFIX_SIZE` handling
2020-02-06 16:08:11 +01:00
Cecile Tonglet be075893b5 CLI improvements & fixes (#4812)
These are a few changes I missed during the refactoring.

1. Initialization issue and boilerplate

    Most importantly: part of the `Configuration` initialization was done in `sc_cli::init`. This means the user can not benefit from this initialization boilerplate if they have multiple `Configuration` since `sc_cli::init` can only be called once.

2. Boilerplate for `VersionInfo` and `Configuration`

    I'm also answering to the critic of @bkchr on the initialization using version: https://github.com/paritytech/substrate/pull/4692/files/bea809d4c14a2ede953227ac885e3b3f9771c548#r372047238 This will allow initializing a `Configuration` and provide the version by default.

3. Loading the `chain_spec` explicitly

    In the past it was done automatically but in some cases we want to delay this. I moved the code to `Configuration.load_spec()` so it can be called later on. `chain_spec` can also be written directly to the `Configuration` without using this `load_spec` helper.

4. [deleted]

5. Fixing issue that prevents the user to override the port

    In the refactoring I introduced a bug by mistake that could potentially prevent the CLI user to override the ports if defaults where provided for these ports (only on cumulus).

6. Change task_executor from Box to Arc

    This is useful for cumulus where we have 2 nodes with 2 separate Configuration that need to spawn tasks to the same runtime.

7. Renamed TasksExecutorRequired to TaskExecutor

    For consistency.

This is related to https://github.com/paritytech/cumulus/issues/24

This is the continuation (and hopefully the end of) #4692
2020-02-06 15:46:49 +01:00
Marcio Diaz f891342f20 Fix broken factory by adding keystore back. (#4840) 2020-02-06 14:48:19 +01:00
Bastian Köcher c7867e5125 Fix memory leak in runtime interface (#4837)
* Fix memory leak in runtime interface

We used `slice::from_raw_parts` in runtime-interface which did not free
the memory afterwards. This pr changes it to `Vec::from_raw_parts` to
make sure `drop` is called properly and the values are freed.

* Check that `len` is non-zero

* Adds comment
2020-02-06 14:26:41 +01:00
Arkadiy Paronyan 3c79e6d03c Fixed a few warnings (#4841) 2020-02-06 14:06:53 +01:00
Jimmy Chu acb66f0699 Node template folders restructuring (#4811)
* Restructure node-template so it is clear that node, runtime, and pallets are separated
* Separating to mock and tests
* restructuring runtime to top-level
* updated release script
* updated Cargo.lock
2020-02-06 20:13:44 +08:00
Nikolay Volf 6148c7ce15 do join_all (#4832) 2020-02-06 13:07:52 +01:00
André Silva db4c8c03bb node: disable grandpa automatic finality fallback (#4835)
* node: disable grandpa automatic finality fallback

* node: bump spec_version
2020-02-06 00:10:35 +01:00
André Silva d53bb5ec50 grandpa: bump version to v0.11.1 (#4813) 2020-02-05 21:47:11 +01:00
Sergei Pepyakin 1af9e4f3ee executor: Simplify the SandboxCapabilities interface (#4825)
* Don't require `store` and `store_mut` in `SandboxCapabilities`.

* Simplify the sandbox a bit
2020-02-05 18:20:25 +01:00
Gavin Wood 9202cd87e0 Additional RPC for dumping all main storage key pairs under a prefix (#4803)
* Merge branch 'gav-split-balanecs-vesting' into gav-upsub

# Conflicts:
#	Cargo.lock
#	cli/Cargo.toml
#	collator/Cargo.toml
#	primitives/Cargo.toml
#	runtime/common/Cargo.toml
#	runtime/common/src/claims.rs
#	runtime/kusama/Cargo.toml
#	runtime/polkadot/Cargo.toml
#	service/Cargo.toml

* Update client/src/client.rs

* Update client/src/client.rs

* Fix merge conflict

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
2020-02-05 17:27:50 +01:00
Sergei Pepyakin 1185f3ea30 Get rid of in-substrate usages of core_intrinsics feature (#4823)
* Remove usage of unneeded Rust feature core_intrinsics

* core::intrinsics::abort -> arch::wasm32::unreachable

* Don't publish `core::intrinsics`.

* Disable panic_handler and alloc_error_handler for no_std non wasm builds
2020-02-05 17:26:48 +01:00
Wei Tang c0af995362 Avoid losing values in intermediate take (#4833) 2020-02-05 17:26:07 +01:00
Pierre Krieger 54c10893ab Print an error if listener is closed (#4830)
* Print an error if listener is closed

* Oops, forgot to commit this
2020-02-05 17:25:14 +01:00
Pierre Krieger a3439999cf Remove support for secio (#4831) 2020-02-05 16:56:49 +01:00
Pierre Krieger 39c037ab22 Fix missing overrides of NetworkBehaviour (#4829) 2020-02-05 11:56:59 +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
Bastian Köcher cd0d2fd791 Fix flaky messed signature test (#4819)
When messing with the signature, we need to make sure that we acutally
mess-up the signature. As the generated private/public key is random,
the signature is random as well. It can happen that `bytes[0] ==
bytes[2]` which makes the test fail. We fix this problem by just
inverting the bytes at `0` and `2`.
2020-02-04 12:39:56 +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
Xiliang Chen febb6e29b2 add state_getKeysPaged (#4718)
* add storage_getNextKey

* RPC storage_getKeysPages

* respect count

* use iterator

* improve

* add tests

* improve

* add doc comments

* Make prefix optional

* update error

* improve
2020-02-04 10:44:40 +01:00
cheme 900295b020 Fix call to backend in child_storage_hash (#4815)
* Fix call to backend in child_storage_hash

* child storage test.
2020-02-03 20:28:10 +01:00
Demi Obenour 28275fee96 Switch to the new lockfile format (#4816)
This will hopefully reduce merge conflicts in the future
2020-02-03 20:19:33 +01:00
Wei Tang bff1f4a18d block_import: switch to Box<dyn Any> for intermediates representation (#4809)
* block_import: switch to Box<dyn Any> for intermediates representation

* Use Cow and return Error instead of Option

* Remove unused error

* Distinguish NoIntermediate/InvalidIntermediate
2020-02-03 09:55:09 +01:00
Demi Obenour b390f51c2a Bump dependencies (#4808)
This pulls in the latest release of *ring* and also removes some
duplicate dependencies.
2020-02-03 09:13:55 +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
Wei Tang 98255bd37e fork-tree: add support for find_node_mut_where (#4784)
* fork-tree: add support for find_node_mut_where

* Update utils/fork-tree/src/lib.rs

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

* Update utils/fork-tree/src/lib.rs

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

* Update utils/fork-tree/src/lib.rs

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

* Fix calling name

* Update utils/fork-tree/src/lib.rs

Co-Authored-By: Robert Habermeier <rphmeier@gmail.com>

* doc: be precise what is "least significant" index

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: Robert Habermeier <rphmeier@gmail.com>
2020-02-01 16:35:05 +01: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
Pierre Krieger b6e8fba179 Remove warning about connecting to non-Substrate nodes (#4797) 2020-02-01 14:02:10 +01:00
Nikolay Volf 8a3caaeb68 update prost-build (#4789) 2020-02-01 12:33:13 +01:00
Nikolay Volf 63ad759c69 Increase transaction pool default limits (#4792)
* increase limits, improve logging

* format in kB
2020-02-01 00:27:53 -08:00
Gavin Wood adde404e41 client/finality-grandpa: Add regression test for observer polling network (was #4778) (#4795)
* client/finality-grandpa: Add regression test observer polling network

Ensure `Future` implementation of `ObserverWork` is polling its
`NetworkBridge`. Regression test for bug introduced in d9837d7dd and
fixed in 504b4e89e.

When polled, `NetworkBridge` forwards reputation change requests from
the `GossipValidator` to the underlying `dyn Network`. This test
triggers a reputation change by calling `GossipValidator::validate` with
an invalid gossip message. After polling the `ObserverWork` which should
poll the `NetworkBridge`, the reputation change should be forwarded to
the test network.

* Nits

Co-authored-by: Max Inden <mail@max-inden.de>
2020-01-31 19:12:03 +00:00
Benjamin Kampmann 111207afe8 Adding Serde Deserialisation to UncheckExtrinsics (#4793)
* Adding Serde:Deserialise to UncheckExtrinsics

to be able to use the ChainApi RPC from the client side

* Update primitives/runtime/src/generic/unchecked_extrinsic.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
2020-01-31 19:01:32 +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
Eric 3018bfe0e9 Update to the latest crate names (#4783)
* Update to the latest crate names

* Add to post initial rename fixes
2020-01-31 13:59:11 +01:00
Nikolay Volf 42dd01cbbd add negative tests for signatures (#4788) 2020-01-31 04:26:36 -08:00
Bastian Köcher 709a899f9d Cleanup transaction pool deps (#4782)
* Cleanup transaction pool deps

* Fix it properly

* Fix doc test
2020-01-31 12:40:32 +01:00
Cecile Tonglet ce47bfa2ba Removed a few warnings (#4786) 2020-01-31 12:32:12 +01:00
Bastian Köcher 4de44129cf Fix ui tests with rust 1.41.0 (#4787) 2020-01-31 11:46:05 +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
Sergei Pepyakin 6272b8d2c7 Remove notices regarding wasm file in check_runtime.sh (#4779)
To my knowledge, we don't keep wasm blobs checked in anymore.
2020-01-30 15:26:04 +01:00