Commit Graph

4310 Commits

Author SHA1 Message Date
Wei Tang 9a672c4e97 pallet-evm: add builtin support for the four basic Ethereum precompiles (#6743)
* pallet-evm: add builtin support for the four basic Ethereum precompiles

* linear_cost -> ensure_linear_cost to directly return OutOfGas error
2020-07-30 15:52:16 +02:00
Garrett MacDonald 814911f414 Add " Successfully mined block" log message (#6764) 2020-07-30 13:23:25 +00:00
Pierre Krieger 5060324b91 Ignore flaky test (#6767) 2020-07-30 14:58:30 +02:00
Ashley 7df97abab4 Add a DefaultQueue type alias to remove the need to use sp_api::TransactionFor (#6761)
* Add DefaultQueue

* Add DefaultImportQueue to the top level of sp-consensus
2020-07-30 09:02:12 +00:00
Aten 1284a491c2 support custom ss58addressformat in from_ss58check_with_version (#5526)
* support custom ss58addressformat in from_ss58check_with_version

* fix str parse

1. if can parse with u8, use u8 into.
2. if u8 can't parse, convert to str then parse

* add a test

* typo

* add error description in test

* fix the `TryFrom<u8>` for `Ss58AddressFormat`

change check logic in TryFrom<u8> to replace modified code in `from_ss58check_with_version`

* use Ss58AddressFormat::default() replace DEFAULT_VERSION

* Apply suggestions from code review

* Update primitives/core/src/crypto.rs

* Update primitives/core/src/crypto.rs

* Update primitives/core/src/crypto.rs

* Update primitives/core/src/crypto.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
2020-07-30 10:41:32 +02:00
Ashley 8fc8c81144 Add memory-tracker feature to sp-trie to fix wasm panic (#6745)
* Add memory tracker feature to sp-trie to fix wasm panic

* 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-07-30 09:41:08 +02:00
Max Inden dc33e64643 client/network: Add peers to DHT only if protocols match (#6549)
* client/network/src/discovery: Adjust to Kademlia  API changes

* client/network: Add peers to DHT only if protocols match

With https://github.com/libp2p/rust-libp2p/pull/1628 rust-libp2p allows
manually controlling which peers are inserted into the routing table.
Instead of adding each peer to the routing table automatically, insert
them only if they support the local nodes protocol id (e.g. `dot`)
retrieved via the `identify` behaviour.

For now this works around
https://github.com/libp2p/rust-libp2p/issues/1611. In the future one
might add more requirements. For example one might try to exclude
light-clients.

* Cargo.toml: Remove crates.io patch for libp2p

* client/network/src/behaviour: Adjust to PeerInfo name change

* client/network/src/discovery: Rework Kademlia event matching

* client/network/discovery: Add trace on adding peer to DHT

* client/network/discovery: Retrieve protocol name from kad behaviour

* client/network/discovery: Fix formatting

* client/network: Change DiscoveryBehaviour::add_self_reported signature

* client/network: Document manual insertion strategy

* client/network/discovery: Remove TODO for ignoring DHT address

Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
2020-07-29 14:44:15 +02:00
Guillaume Thiolliere 1eeb4b0e3f benchmarks! macro: factorize instance usage. (#6750)
* factorize benchmark!

* fix types

* fix types
2020-07-29 14:33:54 +02:00
Shawn Tabrizi 6e6568167a Allow PostDispatchInfo to disable fees (#6749)
* initial mock

* add test

* remove unneeded clone

* Update frame/support/src/weights.rs

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

* fix compile

* Update frame/support/src/weights.rs

Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>

* Update frame/sudo/src/lib.rs

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

* Apply suggestions from code review

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

Co-authored-by: Alexander Theißen <alex.theissen@me.com>
Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
2020-07-29 12:30:10 +00:00
Gavin Wood 6bfbb7c6f1 Cleanup our sort usage (#6754) 2020-07-29 14:00:51 +02:00
Pierre Krieger 1ab7719314 Add a back-pressure-friendly alternative to NetworkService::write_notifications 🎉 (#6692)
* Add NetworkService::send_notifications

* Doc

* Doc

* API adjustment

* Address concerns

* Make it compile

* Start implementation

* Progress in the implementation

* Change implementation strategy again

* More work before weekend

* Finish changes

* Minor doc fix

* Revert some minor changes

* Apply suggestions from code review

* GroupError -> NotifsHandlerError

* Apply suggestions from code review

Co-authored-by: Roman Borschel <romanb@users.noreply.github.com>

* state_transition_waker -> close_waker

* Apply suggestions from code review

Co-authored-by: Roman Borschel <romanb@users.noreply.github.com>

* Finish renames in service.rs

* More renames

* More review suggestsions applied

* More review addressing

* Final change

* 512 -> 2048

Co-authored-by: Roman Borschel <romanb@users.noreply.github.com>
2020-07-29 11:23:19 +00:00
Max Inden e674d64a72 client/network: Adjust wording (#6755)
Rename `NetworkWorker::from_worker` to `NetworkWorker::from_service` as
it is a channel from the `NetworkService` to the `NetworkWorker`.
2020-07-29 11:18:40 +00:00
Alexander Theißen a2163420f4 seal: Add benchmarks for dispatchables (#6715)
* seal: Fix syntax that confuses rust-analyzer

* seal: Add benchmarks for Dispatchables

These are only the benchmarks for the dispatchables of
the pallet. Those are not listed in the Schedule because
we do not want to pull the Schedule from storage before
dispatching.

This OK because those costs are not related to actual contract
execution. Those costs (instruction costs, ext_* costs) will
be benchmarked seperatly and entered into the default Schedule.

* seal: Add a maximum code size

* Fix comments from review

* Removed SEED constant
2020-07-29 10:32:27 +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
Joseph 4161e9fad3 Replace Process.toml with json (#6740)
* Replace Process.toml with json

* Trigger checks

* Revert "Trigger checks"

This reverts commit 9bdf9f135cecb92ca3859dfa211d396a48dd6a8d.

* Trigger checks

* Revert "Trigger checks"

This reverts commit b0c6f29d6aefaf7ca8b137c7d2f958a5e0929d9e.
2020-07-28 21:14:19 +02: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
Ashley 9220b646d2 Various small improvements to service construction. (#6738)
* Remove service components and add build_network, build_offchain_workers etc

* Improve transaction pool api

* Remove commented out line

* Add PartialComponents

* Add BuildNetworkParams, documentation

* Remove unused imports in tests

* Apply suggestions from code review

Co-authored-by: Nikolay Volf <nikvolf@gmail.com>

* Remove unused imports in node-bench

Co-authored-by: Nikolay Volf <nikvolf@gmail.com>
2020-07-28 15:21:33 +02:00
Ashley 97f400f0f0 Use node_template_runtime::opaque::Block instead of node_template_runtime::Block (#6737) 2020-07-28 14:38:38 +02:00
Andronik Ordian 0a165a19c3 prometheus: don't use protobuf feature (#6744) 2020-07-28 11:13:11 +02:00
Wei Tang 2f3d98d3a7 pallet-evm: add support for tuple-based precompile declarations (#6681)
* pallet-evm: add support for tuple-based precompile declarations

* Add missing license header

* Switch to use impl_for_tuples

* Remove unnecessary impl for ()
2020-07-27 17:30:03 +02:00
Pierre Krieger 5af85552af Remove Unpin requirement for Slots (#6711) 2020-07-27 14:31:35 +00:00
Alexander Theißen bead1becf0 seal: Fail instantiate if new contract is below subsistence threshold (#6719)
* seal: Fail instantiate if new contract is below subsistence threshold

We need each contract that exists to be above the subsistence threshold
in order to keep up the guarantuee that we always leave a tombstone behind
with the exception of a contract that called `ext_terminate`.

* Fixup executor test

* Bump runtime
2020-07-27 09:45:00 +00:00
Pierre Krieger 63bd1d8346 Add the Substrate Service Tasks dashboard (#6665) 2020-07-27 09:34:02 +00:00
Bastian Köcher 9310f15ac2 Name all the tasks! (#6726)
* Remove any implementation of `Spawn` or `Executor` from our task executors

* Fix compilation

* Rename `SpawnBlockingExecutor`

* Update primitives/core/src/traits.rs

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

* Fix tests

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
2020-07-26 12:56:17 +00:00
André Silva 2ec131142b grandpa: allow noting that the set has stalled (#6725)
* grandpa: remove unused methods to convert digest

* grandpa: add root extrinsic for scheduling forced change

* grandpa: add benchmark for schedule_forced_change

* grandpa: don't take authority weight in schedule_forced_change

* grandpa: add const for default forced change delay

* grandpa: adjust weights after benchmark on ref hardware

* grandpa: fix cleanup of forced changes on standard change application

* grandpa: replace schedule_forced_change with note_stalled

* grandpa: always trigger a session change when the set is stalled

* grandpa: fix bug on set id mutation after failed scheduled change

* grandpa: take delay as parameter in note_stalled

* grandpa: fix tests

* grandpa: fix cleanup of forced changes

* grandpa: add test for forced changes cleanup

* grandpa: add test for session rotation set id

* grandpa: add test for scheduling of forced changes on new session
2020-07-24 21:02:12 +00:00
Benjamin Kampmann 15679360fd remove breaking excepts 2020-07-24 18:48:35 +02:00
Benjamin Kampmann 39b5af737d fixing CI 2020-07-24 18:37:17 +02:00
Benjamin Kampmann e22c484942 adding changelog (#6728) 2020-07-24 18:10:00 +02:00
Benjamin Kampmann d9df1716da Switching from git back to released versions for wasmtime, fix cargo-unleash (#6722)
* Switching from git back to released versions for wasmtime

* filter out cratelift_codegen messages-a

Co-authored-by: NikVolf <nikvolf@gmail.com>
2020-07-24 14:45:20 +00:00
Dan Forbes 68b2a09d21 Augmented node template docs (#6721) 2020-07-24 06:30:48 -07:00
Wei Tang 9acb321f01 Support using system storage directly for EVM balance and nonce (#6659) 2020-07-23 17:49:12 +02:00
HarryHong 36e312088e [CI]Chaostest suite initiation (#5793)
* Initiate chaostest cli test suite: singlenodeheight on one dev node
    Added chaostest stages in CI
    Added new docker/k8s resources and environments to CI
    Added new chaos-only tag to gitlab-ci.yml

* Update .maintain/chaostest/src/commands/singlenodeheight/index.js

Co-authored-by: Max Inden <mail@max-inden.de>

* change nameSpace to namespace(one word)

* update chaos ci job to match template

* rename build-pr ci stage to docker [chaos:basic]

* test gitlab-ci [chaos:basic]

* Update .gitlab-ci.yml

* add new build-chaos-only condition

* add *default-vars to singlenodeheight [chaos:basic]

* change build-only to build-rules on substrate jobs [chaos:basic]

* test and change when:on_success to when:always [chaos:basic]

* resolve conflicts and test [chaos:basic]

Co-authored-by: Max Inden <mail@max-inden.de>
Co-authored-by: Denis Pisarev <denis.pisarev@parity.io>
2020-07-23 12:53:55 +02:00
Reto Trinkler e15fb6da2e Add 4 as address type of ss58 for Katal Chain (#6713) 2020-07-23 10:21:53 +02:00
Pierre Krieger e8ce5a2364 Remove clear_on_drop from browser util crate (#6710) 2020-07-22 21:59:00 +02: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
Ashley ffa2177d46 Remove the service builder (#6557)
* :)

* Slight tidy

* Remove ServiceBuilderCommand

* Remove whitespace

* Keep task manager alive for check_block/import_blocks

* Pass task_manager to run_until_exit

* WIP

* WIP

* Get rid of the macros

* Simplify a few chain components creation APIs related to the service

* Fix basic-authorship doc tests

* Remove DefaultQueue

* Update client/service/src/builder.rs

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

* Move ExecutionExtensions comment around

* Remove unused BlakeTwo256

* Add sc-prelude

* Rename sc-prelude to sc-service-prelude

* Rename to sc-service-types

* Improve service types

* Fix line widths

* Remove sc-service-types and move type definitions to crates

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

Co-authored-by: Seun Lanlege <seunlanlege@gmail.com>

* Add TLightClientWithHash

* Rework types

Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
Co-authored-by: Seun Lanlege <seunlanlege@gmail.com>
2020-07-22 19:10:27 +00:00
Nikolay Volf 85a9af64d8 Update wasmtime to (almost) lastest master (#6662)
* update wasmtime to (almost) lastest master

* bump lock

* bump once more
2020-07-22 21:09:31 +02:00
Benjamin Kampmann 7c161ec177 Update to latest sysinfo prevents leaking fd-handlers (#6708)
* Ensure we close old file handles hold by sysinfo

* Dropping is needed unfortunately

* enable process refreshing, ignore result from refresh_process

* jumping to proposed patch

* switch to latest sysinfo
2020-07-22 15:48:12 +00:00
mattrutherford c4dd079119 Tracing values (#6679)
* Switch to serde_json::Value for Visitor values

* add tests

* switch Visitor to use Map

* refactor change names

* \n

* update integration test

* use discrete maps for each type of recorded value

* update integration test

* add docs

* Update client/tracing/src/lib.rs

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

* add docs

Co-authored-by: Matt Rutherford <mattrutherford@users.noreply.github.com>
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
2020-07-22 11:29:33 +00:00
ddorgan 0feac04f36 Reset flaming fir network (#6703) 2020-07-22 11:09:15 +00:00
Cecile Tonglet de3181076a Graceful shutdown for the task manager (#6654)
* Initial commit

Forked at: 74655edebc
Parent branch: origin/master

* Move task_manager.rs to mod.rs

* Graceful shutdown for the task manager

* Await all background task JoinHandle at the same time

* Add tests

* Make future() wait also for exit signal + fix essential task failed

Probably related to https://github.com/paritytech/cumulus/issues/111

* add comments for non-obvious code

* Use clean_shutdown() in sc-cli

* Adapt code and upgrade tokio in sc-cli

* cleanup spacing in doc

* Add license

* I guess actually running the clean shutdown would be a good idea

* fix tests

* Update client/cli/src/runner.rs

Co-authored-by: Benjamin Kampmann <ben@gnunicorn.org>

* Improve error logging

* disable other tests (can't reproduce on my machine)

* Revert "disable other tests (can't reproduce on my machine)"

This reverts commit c133c590f33c253123ba0555ce719a71ededd60d.

* It is possible that the tasks are ended first

* Revert "It is possible that the tasks are ended first"

This reverts commit 502aba4a49fb5d892e704c412b8a81768a3f2c71.

* Use single threaded scheduler for more predictability

* enable_time

* Revert "enable_time"

This reverts commit 4e152140764a4bddeedff06a4e36ec701909e8c7.

* Revert "Use single threaded scheduler for more predictability"

This reverts commit ee5e13c5f13ff71e012dcda13579dffeb15f8ffc.

* Revert "Revert "It is possible that the tasks are ended first""

This reverts commit 1b91a8ca3eebbdc18be199c8ca188e88669ae649.

* This cannot be verified either with a threaded pool

* Apply suggestions from code review

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

Co-authored-by: Benjamin Kampmann <ben@parity.io>
Co-authored-by: Benjamin Kampmann <ben@gnunicorn.org>
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
2020-07-22 07:15:22 +00:00
Dan Forbes 686ee971d9 Removing staging resources from node template README (#6701) 2020-07-21 21:45:07 +00:00
Xiliang Chen 168e9df7e2 make impl_outer_origin default to use frame_system (#6695) 2020-07-21 15:47:08 +00:00
Bastian Köcher f1523c75f6 pallet-swap-action: Change BalanceSwapAction signature (#6580)
Instead of requiring `T: Trait` in `BalanceSwapAction`, we directly
depend on `AccountId`. This fixes a compilation error on wasm, where
`Runtime` does not implement `Debug`, but `BalanceSwapAction` required it.
2020-07-21 17:39:56 +02:00
Kian Paimani c9fd0c964a Properly filter out duplicate voters in elections. (#6693)
* Prevent duplicate voter

* Update primitives/npos-elections/src/lib.rs

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

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
2020-07-21 17:33:33 +02:00
Denis Pisarev 3b6597e0ed "cargo test" jobs optimization (#6606)
* change (ci): 3 jobs in 1 decreases concurrency and is more effectiv; w/o release it's ~20% faster, but needs testing on prod; wasmtest tests are already running within cargo test --workspace

* fix (test): these ones were failing on nightly

* save: cargo profiles [skip ci]

* change (ci): one test to run them all

* change (ci): rebase

* Revert "change (ci): rebase"

This reverts commit 8a6b7ea043a460bf71526ccaa4c7a68899a3b2bc.

* fix (config): fix manifest

* change (ci): bench release
2020-07-21 16:55:54 +02:00
Dan Forbes b93713d49f Remove dead link to out-of-date style guide (#6682)
* Remove dead link to out-of-date style guide

* Replace dead link with self-hosted doc

* Use relative link to style guide

Co-authored-by: Benjamin Kampmann <ben@gnunicorn.org>

* Format style guide

Co-authored-by: Benjamin Kampmann <ben@gnunicorn.org>

* Formatting

Co-authored-by: Benjamin Kampmann <ben@gnunicorn.org>
2020-07-21 13:14:25 +00:00
pscott 046fda914a Improve overall performance (#6699)
* Improve overall performance

* Clean up code

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

* Remove needless ::

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

* Remove needless ::

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

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
2020-07-21 14:46:49 +02:00
Pierre Krieger ab82eb1c98 Add sync_legacy_requests_received metric (#6698) 2020-07-21 11:59:49 +00: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