Commit Graph

3125 Commits

Author SHA1 Message Date
Tomasz Drwięga fd03f4e950 Fix warnings. (#4768) 2020-01-29 21:37:26 +01:00
Max Inden 504b4e89e8 client/finality-grandpa/src/observer: Poll NetworkBridge (#4766)
Patch d9837d7dd reintegrated the periodic neighbor packet worker, by
moving its logic into a `Future` implementation on `NetworkBridge` which
needs to be polled by its upper layer.

Polling by the upper layer was implemented within the `Future`
implementation of the `VoterWork` struct but not within the `Future`
implementation of the `ObserverWork` struct. This patch adds polling of
the `NetworkBridge` to the latter.
2020-01-29 18:42:21 +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
Gavin Wood a9100449dc RPC calls should execute with configured strategy (#4772) 2020-01-29 17:57:50 +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
Pierre Krieger ae1e9002d7 Order network dependencies alphabetically (#4763) 2020-01-29 15:32:45 +01:00
brenzi b6dc02decc adding a ss58 format for SubstraTEE (#4764) 2020-01-29 15:30:25 +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
Pierre Krieger b452867eb7 Add diagnostics to tasks (#4752) 2020-01-29 11:46:39 +01:00
Bastian Köcher 34c1c4b954 Don't run dev light client as validator (#4757)
A light client can not be a validator, so we should not set `authority
== true` in dev mode.
2020-01-29 11:52:54 +03:00
Edwin 9a6d9f0db5 RPC api for offchain storage (#4694)
* Rpc api for offchain storage

* Replace Vec<u8> to Bytes, replace Mutex to RwLock

* Remove pub

* Modify copyright year
2020-01-28 23:31:28 +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
Tomasz Drwięga e7df428274 Display has_api_with results if invalid version of Offchain Workers is detected. (#4749)
* Display error message when checking has_api.

* Cargo.lock.
2020-01-28 22:34:41 +01:00
philipstanislaus 4c63766e41 Add SS58 network identifier for Centrifuge (#4748)
* Add SS58 network identifier for Centrifuge

* Bump version
2020-01-28 20:30:39 +01:00
Joshy Orndorff e0ac148444 Add decl_error to template module (#4743)
* Update template to use decl_error

* Test for error on template

* Comments

* Reorder decl_* blocks: storage, event, error, module

* Remove TODOs

* Clarify comment on type Error = Error<T>
2020-01-28 19:33:50 +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
Tomasz Drwięga e58dc6a293 Make sure destroy_state is called in case of errors. (#4745)
* Make sure to destroy state in case of error.

* Update client/src/call_executor.rs

* Update client/src/call_executor.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
2020-01-28 16:18:09 +01:00
Toralf Wittner 78c77a3784 Update yamux to version 0.4.1 (#4746) 2020-01-28 13:00:37 +01:00
Bastian Köcher 793a1eb053 WASM runtime switch to import memory (#4737)
* WASM runtime switch to import memory

Up to now runtimes have exported their memory. To unify it with
sandboxing, this pr switches runtimes to import memory as well.

From a functional perspective, exporting/importing memory makes no
difference to the runtime.

To provide backwards compatibility, WASM exported memory is still supported.

* Revert debug stuff

* Revert some stuff
2020-01-28 09:36:57 +01:00
Pierre Krieger 5c8743510e Upgrade to libp2p 0.15 (#4732)
* Fixes for libp2p 0.15

* More work

* Update libp2p

* Update to libp2p 0.15
2020-01-27 18:27:36 +01:00
Nikolay Volf ed3da9f903 Fix quadratic iterations over transaction pool (#4736)
* transaction pool changes

* service & network changes

* address review

* reduce future pool
2020-01-27 18:26:42 +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
gabriel klawitter 38a01f3c65 ci: fix runtime version check (#4741) 2020-01-27 18:22:52 +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
Nikolay Volf 94a187f291 Transaction queue tests update (#4734)
* shuffle tests

* update tests

* inc_nonce -> increment_nonce
2020-01-27 04:22:04 -08:00
Seun LanLege 9cea98e950 Manual Seal (#4143)
* instant/manual seal

unbounded queues are evil

Apply suggestions from code review

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

add fork tests, docs, remove todos

moar docs

Update client/consensus/manual-seal/src/rpc.rs

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

remove unbound generic, parameter, docs, deps, code style changes

Apply suggestions from code review

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

code style chnges

remove unused deps, remove dep renames, check if block is empty before importing, use ? for error propagation

fix tests

log errors for instant seal

use debug

code style changes, updated copyright dates

use txpool::Pool instead of BasicPool, code style changes

fixed tests

* fix tests

* requested changes from review

* check inherents len

* rebase
2020-01-27 10:59:40 +01:00
Sergei Pepyakin 2421576f91 Cursed implementation of allowing missing imports on wasmtime (#4730)
* Quick and dirty impl.

* Clean up

* Check the signatures.

* Fix tests.

* Apply suggestions from code review

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

* Ignore non function members.

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
2020-01-25 23:53:08 +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 fc99887de0 Introduces author_hasKey and author_hasSessionKeys rpc endpoints (#4720)
* Introduces `author_hasKey` and `author_hasSessionKeys` rpc endpoints

Both endpoints can be used to check if a key is present in the keystore.

- `hasKey` works on with an individual public key and key type. It
checks if a private key for the given combination exists in the
keystore.
- `hasSessionKeys` works with the full encoded session key blob stored
on-chain in `nextKeys`. This requires that the given blob can be decoded
by the runtime. It will return `true`, iff all public keys of the
session key exist in the storage.

Fixes: https://github.com/paritytech/substrate/issues/4696

* Update client/rpc-api/src/author/error.rs

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

* Indentation

Co-authored-by: Nikolay Volf <nikvolf@gmail.com>
2020-01-24 15:20:45 +01:00
Nikolay Volf 1614ce0996 Async/await in transaction-graph (#4645)
* async/await in tx graph

* review notes

* remove unused typedef
2020-01-24 05:22:39 -08: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
Ashley c2c429877e Switch GrandPa to std futures (replaces #3909) (#4612)
* Switch GrandPa to new futures

* Work on making tests work

* until_imported tests working again

* Work on switching tests to stable futures

* Modifications

* Re-add test as #[ignore]

* Don't ignore

* Add manual unpins

* Remove Header import

* Return concrete Sink type

* Switch to crates.io finality-grandpa version

* Remove use statement that slipped in

* Fix some nitpicks

* Remove unpin from i

* Fixed typo

* Move futures01 to dev-deps

* Fix nitpicks

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

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

* nitpicking

Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
Co-authored-by: André Silva <andre.beat@gmail.com>
2020-01-24 13:34:42 +01:00
Nikolay Volf 14e95f3398 Refactor tx-pool maintenance and other high-level api (#4629)
* Reduction.

* Reformation.

* add locked timer stuff

* fix issues and introduce full pool

* arrange together

* fix benches

* fix new_light

* Add revalidation test case

* review fixes

* review fixes

* use just ready future

* address review
2020-01-24 04:21:24 -08:00
Jaco Greeff b89ac5d2ef Expose recovery module errors in metadata (#4727) 2020-01-24 10:02:55 +01:00
Hero Bird ad9c75e4c4 [contracts] minor follow-up on PR #4722 (#4723) 2020-01-23 16:59:00 +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
Nikolay Volf 81004eabfd Refactor and test spec block rules (#4670)
* Refactor and test spec block rules

* address review

* Update client/src/block_rules.rs

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

Co-authored-by: André Silva <andre.beat@gmail.com>
2020-01-23 05:41:22 -08:00
Bastian Köcher 8370b99709 Expose Error in metadata for pallet-utility (#4721) 2020-01-23 14:35:04 +01:00
Max Inden 597c0a6c4f client/finality-grandpa: Make round_communication use bounded channel (#4691)
* clinet/finality-grandpa: Make round_communication use bounded channel

`round_communication` returns a `Sink` and a `Stream` for outgoing and
incoming messages. The messages send into the `Sink` are forwarded down
to the network as well as send back into the `Stream` to ensure the node
processes its own messages.

So far, to send messages into the `Sink` back into the `Stream`, an
unbounded channel was used. This patch updates `round_communication` and
`OutgoingMessages` to use a bounded channel.

This is part of a greater effort to reduce the number of owners of
components within `finality-grandpa` and `network` as well as to reduce
the amount of unbounded channels. For details see d9837d7dd and
5f80929dc.

* client/finality-grandpa: Import futures03::future::ready at the top

* client/finality-grandpa: Make tests use compat of future 03

* client/finality-grandpa: Do not import ready into scope

Instead of importing futures03::future::ready into the scope, only
import futures::future03 into scope and call ready as furure03::ready.
2020-01-23 12:58:36 +01:00
Wei Tang 4b2e6a5be2 Default fork choice value and intermediates for block import parameters (#4652)
* consensus, pow: intermediate separation and fail

* Fix compiles

* Update primitives/consensus/common/src/block_import.rs

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

* Update primitives/consensus/common/src/block_import.rs

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

* Document what None means for `fork_choice` in block import params

Co-authored-by: Robert Habermeier <rphmeier@gmail.com>
2020-01-23 00:03:38 -08:00
Sergei Pepyakin 9a77b299df Add fool protection and comment construct_block (#4715)
* Add fool protection and comment construct_block

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

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

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
2020-01-22 18:34:41 +01:00
Bastian Köcher 5bd6e94e64 Move "wasm" allocator into its own crate (#4716)
This moves the wasm-allocator (`FreeingBumpHeapAllocator`) into its own
crate `sp-allocator`. This new crate can theoretically provide multiple
different allocators. Besides moving the allocator, this pr also makes
`FreeingBumpHeapAllocator` compile on `no_std`.
2020-01-22 18:13:17 +01:00
Toralf Wittner 670ce71009 Update soketto to v0.3.2 (#4714)
See #4702 for details.
2020-01-22 17:34:42 +01:00
Robert Habermeier 21a2539a24 make NotificationStream event naming consistent (#4712) 2020-01-22 16:33:42 +01:00
Denis Pisarev 40e4d8fb0a fixes trigger-contracts-ci job to actually depend on build-linux-subs… (#4701)
* fixes trigger-contracts-ci job to actually depend on build-linux-substrate
2020-01-22 15:24:34 +01:00