Commit Graph

2609 Commits

Author SHA1 Message Date
Arkadiy Paronyan 1aaf31a34d Less verbose console output (#4029) 2019-11-06 10:06:11 +01:00
Nikolay Volf f093eeba24 fix warnings (#4024) 2019-11-05 19:53:50 +01:00
Bastian Köcher 508c52a08a Don't re-compile on every cargo run (#4019)
- Add new crate `substrate-build-script-utils` to unify the code of
`node`, `node-template` and `polkadot-node`.
- The `node-cli` build script needs to search upwards for the
`.git/HEAD` file to find it.
2019-11-05 19:36:10 +01:00
Gavin Wood 350e72dac5 Revert "Header-only sync for old forks (#3942)" (#4022)
This reverts commit 172359adad.
2019-11-05 16:05:36 +01:00
Arkadiy Paronyan 172359adad Header-only sync for old forks (#3942)
* Header-only sync for old forks

* Simplified blocks-count

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

Co-Authored-By: Marcio Diaz <marcio.diaz@gmail.com>
2019-11-05 12:17:12 +01:00
Tomasz Drwięga 279391f9c1 Limit longevity of im-online heartbeats. (#4011)
* Limit longevity of im-online heartbeats.

* Unused import.

* Use parameter for session duration.
2019-11-05 12:16:46 +01:00
Arkadiy Paronyan b92674d88a Traffic statistics (#4017)
* Network stats

* Fixed tests
2019-11-05 12:15:59 +01:00
Arkadiy Paronyan 4ca6f8d1b2 Enable parallel block download (#4014) 2019-11-05 10:27:49 +01:00
Kian Paimani 093f1c46e5 Update RPC deps. (#4012)
* Bump rpc deps

* Update core/test-runtime/src/genesismap.rs

Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>
2019-11-04 12:53:58 +01:00
Tengfei Niu 8b6b3d3730 refactor code: remove unused import (#4010)
* remove unused import

* fix test error
2019-11-04 11:34:19 +01:00
brenzi ed5ac30a44 support crypto primitives for no_std introducing full_crypto feature (#3778)
* introduced "with_crypto" feature and applied switches like in substrate-api-client fork

* introduced "with_crypto" feature and applied switches like in substraTEE-worker fork

* distinguishing core::hash vs std::hash

* @bkchr's review requests fulfilled

* fixes

* revert dependency upgrade ed25519-dalek

* added full_crypto features to all crates using app_crypto! macro

* fixing CI complaints.

* fix again

* adding CI test for with_crypto feature

* added full_crypto for ecdsa. now builds wit h--no-deafault-features --features with_crypto

* remove --release from CI test

* @bkchr requested changes. moved full_crypto CI test to build stage

* fixing no_std issue

* CI fresh copy from srml-staking

* gitlab CI with +nightly

* solved no-feature-in-macro dilemma

* cosmetics

* Update core/application-crypto/src/sr25519.rs

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

* Update core/application-crypto/src/ed25519.rs

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

* even more simple

* undo line delete

* refactoring app_crypto macro. splitting functionalities based on full_crypto feature

* whitespace cosmetics
2019-11-04 10:53:41 +01:00
Wei Tang 2e424f4d9f Substrate EVM (#3927)
* srml-evm: init the basic structures

* srml-evm: finish executor implementation

* srml-evm: implement balance deposit and withdraw

* srml-evm: implement the actuall call/create

* srml-evm: use crates.io version of evm

* srml-evm: fix no-std compile

* Remove dependency patch

* Update to evm 0.14

* Use double map for account storage

* Add precompiles support

* Add some basic docs

* Use runtime_io::chain_id()

* Update srml/evm/src/lib.rs

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

* Update srml/evm/src/lib.rs

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

* Fix WithdrawReason

* Unique saturate balance to u128

* Unique saturate withdraw to u128

* Remove extern crate alloc

* Move account code to a separate storage and use ref for convert_account_id

* More match cause for error message

* Fix potential interger overflow

* Use decode_len for fetching code length
2019-11-03 15:57:46 +01:00
joe petrowski 77ed0dc2bc fix formula in comment (#4006) 2019-11-03 15:09:45 +01:00
Tomasz Drwięga 69c4e2f7f0 Deprecate ValidateUnsigned and prevent duplicate heartbeats (#3975)
* Add pre-dispatch checks for ValidateUnsigned

* Deprecate ValidateUnsigned.

* Bump specversion.

* Fix test.
2019-11-03 10:52:08 +00:00
Tomasz Drwięga 45e79d617b Avoid sending heartbeat if we are already considered online. (#3981)
* Don't send a heartbeat if already online.

* Remove env_logger.

* Update lock.

* Bump runtime.

* Merge master
2019-11-03 10:51:33 +00:00
Bastian Köcher c9e4d203e7 CI test executor with wasmtime (#4005) 2019-11-03 10:43:30 +00:00
Bastian Köcher d233ad55ad Implement color output for wasm builder (#4004)
* Implement color output for wasm builder

* Fix `Cargo.lock`
2019-11-02 19:59:49 +01:00
thiolliere 5503c483b1 doc (#3995) 2019-11-02 16:09:10 +00:00
Kian Paimani 084b158031 Optional serde for phragmen support (#3994)
* Add serde to phragmen

* Update lock file

* and bump a version

* and bump a version again

* Apply suggestions from code review

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

* revert impl-tarit for tuple update

* revert session.

* Revert "revert session."

This reverts commit 98086c9db56677068db85f74320868b2c10d1c00.

* Revert "revert impl-tarit for tuple update"

This reverts commit 28a7fddee2e09c5785b19883f743065e0be8f331.
2019-11-01 22:22:37 +01:00
Benjamin Kampmann 4852763d73 expose offchain worker storage prefix (#3977)
* expose offchain worker storage prefix

* add docs

* move STORAGE_PREFIX to primitives
2019-11-01 19:32:01 +01:00
Benjamin Kampmann 2ff04d332d Move config path generation into the service config for reusability (#3978)
* Move config path generation into the service config for reusability

* Make NoCostum Default and fix tests

* Apply suggestions from code review

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

* remove function not used anymore

* Make path into an option

* remove database_path function and call it directly

* remove helper functions, use consts
2019-11-01 17:51:06 +00:00
Jim Posen 8fe64173e8 executor: Move runtime version caching out of WasmRuntime interface. (#3993)
* executor: Move runtime caching out of WasmRuntime interface.

The runtime version is now fetched and cached at a higher level, not
within the WasmRuntime trait implementations.

* executor: Require successful querying of runtime version.
2019-11-01 18:22:28 +01:00
Bastian Köcher 6193481352 Don't panic in Offchain test context, when we are already panicking (#3996) 2019-11-01 17:14:21 +01:00
Marcio Diaz 596ac7bd1f Possible fix to storage cache (#3989)
* Comment local_cache propagation

* Add test

* Deny cache when modifications are unknown

* Fix indentation
2019-11-01 15:17:38 +00:00
Caio d5f61d5217 Implement Debug for some structures (#3941)
* Implement Debug for some structures

`NetworkConfiguration`, `TransportConfig`, `NodeKeyConfig` and `Secret`.

Needs a new release of the `rust-libp2p` crate. This PR is just a
reminder.

* Explicitly separate `std` and `core`

* Add manual implementation for Secret
2019-11-01 15:28:19 +01:00
Jim Posen 8676c25ef4 Integrate Wasmtime for runtime execution (#3869)
* executor: Use non wasmi-specific execution in tests.

* executor: Move all runtime execution tests into tests file.

* executor: Use test_case macro to easily execute tests with different
Wasm execution methods.

* executor: Convert errors to strings with Display, not Debug.

* node-executor: Rewrite benchmarks with criterion.

They were not passing compilation before and criterion seems to be more
widely used in Substrate.

* executor: Begin implementation of Wasm runtime.

The implementation demonstrates the outline of the execution, but does
not link against the external host functions.

* executor: Define and implement basic FunctionExecutor.

The SandboxCapabilities::invoke is still left unimplemented.

* executor: Implement host function trampoline generation.

* executor: Instantiate and link runtime module to env module.

* executor: Provide input data during wasmtime execution.

* executor: Implement SandboxCapabilites::invoke for wasmtime executor.

* executor: Integrate and test wasmtime execution method.

* executor: Improve FunctionExecution error messages.

* Scope the unsafe blocks to be smaller.

* Rename TrampolineState to EnvState.

* Let EnvState own its own compiler instead of unsafe lifetime cast.

* Refactor out some common wasmi/wasmtime logic.

* Typos and cosmetic changes.

* More trampoline comments.

* Cargo.lock update.

* cli: CLI option for running Substrate with compiled Wasm execution.

* executor: Switch dependency from fork to official wasmtime repo.

* Quiet down cranelift logs.

* Explicitly catch panics during host calls.

We do this to ensure that panics do not cross language boundaries.

* Additional checks and clarifications in make_trampoline.

* Fixes after merge from master and panic safety for wasmtime
instantiation.
2019-11-01 13:32:14 +01:00
Weiliang Li 34bd4c335b authority-discovery: futures 03 Future (#3848)
* authority-discovery: futures 03 Future

* make ci happy

* use futures timer instead of tokio timer

* Update core/authority-discovery/src/lib.rs

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

* remove tokio 01 runtime

* trigger build

* kill futures01

* rename futures
2019-11-01 12:55:29 +01:00
Gavin Wood 26f4084f95 Add events for im_online (#3991)
* Add AllGood event for im_online

* Another event just in case.

* Bump runtime
2019-11-01 11:07:46 +00:00
Pierre Krieger 9de6dea4c3 Print warning again if polling network is too long (#3984) 2019-11-01 10:25:35 +01:00
Jim Posen 8207b4fceb Revert "grandpa: Use storage proofs for Grandpa authorities (#3734)" (#3983)
This reverts commit c0a1926704.
2019-10-31 22:48:04 +00:00
Ashley b0a58647eb Retire storage_items! (#3950)
* Retire storage_items

* Add storage_items! tests to srml/support/tests

* Assimilate genesis config
2019-10-31 21:33:25 +01:00
thiolliere 984163e86e Improve doc for storages in srml-support (#3982)
* improve doc

* Apply suggestions from code review
2019-10-31 19:04:53 +01:00
Benjamin Kampmann 363c8989d4 and backend reference to rpc builder (#3979) 2019-10-31 15:44:52 +00:00
Pierre Krieger eb3c950cfe Remove NetworkSpecialization::on_event (#3976) 2019-10-31 15:38:53 +00:00
Pierre Krieger 4264613a96 Add the code for compiling node-cli for WASM-browser (#3974)
* Extract CLI to separate module in node/cli

* Make node/cli compile for WASM

* More work on node/cli browser

* More work on browser node

* More work

* More work

* Purge a bit the CI script

* More clean up

* Remove substrate-finality-grandpa from the CI

Its tests use tokio, which fails to compile.

* Address review

* Add rocksdb feature to the service

* Fix substrate-service WASM CI

* Apply suggestions from code review

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

* Don't WASM-compile substrate-service altogether
2019-10-31 16:34:12 +01:00
Jim Posen c0a1926704 grandpa: Use storage proofs for Grandpa authorities (#3734)
* grandpa: Write Grandpa authorities to well known key.

Instead of requiring execution proofs for Grandpa authorities, this
enables much simpler storage proofs.

* grandpa: Introduce named AuthorityList type.

* grandpa: Storage migration for srml-grandpa module.

* Remove no-longer-used GrandpaApi runtime API.

* grandpa: Write AuthorityList to storage with encoding version.

We expect the AuthorityList type may change (eg. key changes). To make
upgrades smoother, include a version in the stored value.

* Bump node runtime spec version.

* Update srml/grandpa/src/lib.rs

Co-Authored-By: André Silva <andre.beat@gmail.com>
2019-10-31 14:33:34 +01:00
André Silva 3cbc28ab59 im-online: account for block authorship (#3973)
* im-online: account for block authorship

* im-online: add test for block authorship onlineness

* im-online: cleanup

* im-online: fix test
2019-10-31 11:11:11 +01:00
Jim Posen a167f37b91 Create opaque struct for StorageProof. (#3834)
Passing around Vec<Vec<u8>> everywhere is gross and confusing and
breaks encapsulation.
2019-10-31 11:02:29 +01:00
Gavin Wood 073040a053 Add translate API for storage values (#3947)
* Add translate item.

* fix

* doc

* fix doc

* A test added.

* Apply suggestions from code review

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

* address suggestion
2019-10-31 09:24:23 +01:00
Tomasz Drwięga a73334f769 Increase priority of ImOnline heartbeats (#3972)
* Make sure im-online reports are high priority.

* Bump runtime.
2019-10-30 16:19:31 -07:00
Denis Pisarev e3893d5e39 retry on gitlab system failures (#3970)
* retry on gitlab system failures

* test

* 5 retries for the most popular project

* max is just 2
2019-10-30 23:19:34 +01:00
Pierre Krieger d04d24d047 Fix compiling substrate-chain-spec for WASM (#3971)
* Fix compiling substrate-chain-spec for WASM

* Fix tests
2019-10-30 20:54:22 +01:00
Pierre Krieger 2c2bba64a0 Allow passing a custom database when creating the Service (#3957)
* Put the DB configuration in an enum

* Allow passing a custom database to client-db

* Clean-ups in client-db

* Fix client tests

* Fix service tests

* Hopefully fix tests for good this time 😩

* Address review
2019-10-30 16:50:08 +01:00
Pierre Krieger 14e4cf9155 Remove node/src/main.rs (#3969) 2019-10-30 16:49:17 +01:00
Bastian Köcher 7627428f44 Catch native panics when executing the wasm runtime (#3953)
As with the native runtime, we now catch all native panics when we
execute the wasm runtime. The panics inside the wasm runtime were
already catched before by the wasm executor automatically, but any panic
in the host functions could bring down the node. The recent switch to
execute the native counterpart of the host function in `sr-io`, makes
this change required. The native `sr-io` functions just `panic` when
something is not provided or any other error occured.
2019-10-30 16:34:00 +01:00
Sergei Pepyakin 5486d7add2 Implement contract_getStorage RPC API (#3944) 2019-10-30 13:54:57 +01:00
Pierre Krieger 6c49ad4438 Remove the RPC helpers module (#3967) 2019-10-30 13:19:55 +01:00
Pierre Krieger b8602aa58b Fix TODO for the WASM CI build of rpc-servers (#3966) 2019-10-30 12:22:04 +01:00
Pierre Krieger 5de3393297 Make substrate-offchain compile for WASM again (#3965)
* Make substrate-offchain compile for WASM again

* Minor adjustments
2019-10-30 12:08:46 +01:00
Ashley 678ec6899c Remove deprecated Client::backend (#3951) 2019-10-29 19:26:44 -04:00