Commit Graph

2718 Commits

Author SHA1 Message Date
André Silva 16ad04e847 grandpa: increase timeout for catch up requests (#4149) 2019-11-20 11:01:53 -05:00
Kian Paimani e29b261240 genesis check for balances and ED (#4151)
* genesis check for balances

* fix test.

* Update paint/balances/src/lib.rs

Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>
2019-11-20 14:36:55 +01:00
Benjamin Kampmann 303843f483 Move inherents to primitives (#4126)
* Split Aura and Timestamp inherents out of paint

* fixup node depedencies

* move babe inherents to primitives

* move authorship inherents into primitives

* Move finalty tracker inherents into primitives

* fix aura primitives import
2019-11-20 12:18:36 +01:00
Gavin Wood 5979a8c3e5 Revert "grandpa: voting rules shouldn't restrict past round base (#4150)" (#4154)
This reverts commit 364df30970.
2019-11-20 10:48:55 +01:00
Pierre Krieger f9a4cff50a Remove the exit parameter from importing and exporting blocks (#3954)
* export_blocks now generates a Future

* Handle the export blocks exit in substrate-cli instead

* Turn import_blocks entirely into a Future

* Move the exit parameter to substrate-cli for imports
2019-11-20 10:03:43 +01:00
Bastian Köcher 75a0a3f6fd Fix forks_should_work_correctly test (#4152)
When we enabled arbitary precision for `serde_json`, the feature leaked
through the whole workspace. The given test fails because of some bug in
serde json when the feature is enabled.
2019-11-20 09:51:09 +01:00
André Silva 364df30970 grandpa: voting rules shouldn't restrict past round base (#4150) 2019-11-20 09:50:36 +01:00
Tomasz Drwięga 309f694f4f Move the bounds from where to trait definition. (#4044) 2019-11-20 09:49:16 +01:00
Xiliang Chen 3d4bee6cd6 add div and checked_div to Fixed64 (#4136)
* add div and checked_div to Fixed64

* add more tests

* div by zero is div by zero
2019-11-19 22:33:29 +01:00
Pierre Krieger 4e8b68dd14 Fix the status-sinks tests, hopefully (#4140) 2019-11-19 18:59:53 +01:00
Tomasz Drwięga 613b5e7e2d Fix serialization of transaction_paymentInfo (#4146)
* Add serialization test for u128

* Fix crash on serde of u128
2019-11-19 18:42:35 +01:00
Demi Obenour 07a05554c3 No balance can be between 0 and EXISTENTIAL_DEPOSIT exlcusive (#4118)
This invariant holds for both the free and reserved balances.  Document
it.  I also reformatted the documentation slightly.
2019-11-19 18:38:47 +01:00
Svyatoslav Nikolsky b5f8eb5ac3 Finality proof: fetch new authorities set instead of previous one (#4112)
* fetch new authorities set instead of previous one

* fixed leftovers + updated test properly

* read initial authorities once

* updated comment

* fix grumbles
2019-11-19 17:37:36 +03:00
André Silva e2e2eb7b32 docs: fix CODEOWNERS paths (#4138)
* docs: fix CODEOWNERS paths

* Apply suggestions from code review
2019-11-19 11:30:39 +01:00
André Silva 9194b2a3c0 gossip: replace LRU cache (#4137)
* peerset: remove unused dependencies

* gossip: replace lru cache

* header-metadata: replace lru cache
2019-11-19 10:58:06 +01:00
brenzi 10925510de fix full_crypto (#4133)
* hopefully fixing api-client with this

* another use statement needed

* using full path for Vec

* next try

* yet again

* cleanup
2019-11-19 09:33:56 +01:00
Bryant Eisenbach 566328cd3e Add serde for Signature types (#4109)
* refactor: Added `from_slice()` method to ECDSA signatures

* doc: Modified ECDSA signature docstring to note Recovery ID

* feat: Implemented serde for Signature types

Note: using hexstring encoding

* feat: Automatically derive serde for MultiSignature

* refactor: Convert hex bytes using try_from instead of from_slice

Avoids panicking in critical code

Implemented from Peer Review

* clean: spaces -> tabs

* test: Added tests for Signature serialization

Added dependency on serde_json for testing purposes
2019-11-18 21:00:47 +01:00
Pierre Krieger 621c02440a Fix the browser demo README (#4106) 2019-11-18 21:00:07 +01:00
Eric 9c6368f87c add hashed_key_for() getter method for StorageDoubleMap (#4120) 2019-11-18 14:44:31 +01:00
Sergei Pepyakin 33b3865858 srml-contracts: Add ability to read substrate's storage (#4108)
* Add `ext_get_runtime_storage`

* Implement testing for ext_get_runtime_storage

* Add integration test.

* Update spec version

* Fix the doc

* Save memory allocation.
2019-11-18 13:37:15 +01:00
Yuanchao Sun 0d658ab286 Fix errors when compiling node-template (#4115) 2019-11-18 13:18:10 +01:00
joe petrowski 9e85e21993 Small doc fixes (#4110)
* fix adoc links and some typos

* actually fix links
2019-11-16 21:43:11 +01:00
Shawn Tabrizi 0ecdb55183 Fix Readme (#4114)
* Update README.md

* Add badges

* Update license wording
2019-11-16 15:47:20 +01:00
Bastian Köcher ee9e66bacf Fixes paint-authority-discovery build and remove warnings (#4111) 2019-11-15 13:31:27 +01:00
Benjamin Kampmann 60e5011c72 Reorganising the repository - external renames and moves (#4074)
* Adding first rough ouline of the repository structure

* Remove old CI stuff

* add title

* formatting fixes

* move node-exits job's script to scripts dir

* Move docs into subdir

* move to bin

* move maintainence scripts, configs and helpers into its own dir

* add .local to ignore

* move core->client

* start up 'test' area

* move test client

* move test runtime

* make test move compile

* Add dependencies rule enforcement.

* Fix indexing.

* Update docs to reflect latest changes

* Moving /srml->/paint

* update docs

* move client/sr-* -> primitives/

* clean old readme

* remove old broken code in rhd

* update lock

* Step 1.

* starting to untangle client

* Fix after merge.

* start splitting out client interfaces

* move children and blockchain interfaces

* Move trie and state-machine to primitives.

* Fix WASM builds.

* fixing broken imports

* more interface moves

* move backend and light to interfaces

* move CallExecutor

* move cli off client

* moving around more interfaces

* re-add consensus crates into the mix

* fix subkey path

* relieve client from executor

* starting to pull out client from grandpa

* move is_decendent_of out of client

* grandpa still depends on client directly

* lemme tests pass

* rename srml->paint

* Make it compile.

* rename interfaces->client-api

* Move keyring to primitives.

* fixup libp2p dep

* fix broken use

* allow dependency enforcement to fail

* move fork-tree

* Moving wasm-builder

* make env

* move build-script-utils

* fixup broken crate depdencies and names

* fix imports for authority discovery

* fix typo

* update cargo.lock

* fixing imports

* Fix paths and add missing crates

* re-add missing crates
2019-11-14 21:51:17 +01:00
Max Inden becc3b0a4f *: Refactor authority discovery (key mngmt, runtime API) (#3955)
* {core,srml}/authority-discovery: Move generic to specific session keys

* {srml,core}/authority-discovery: Verify signature outside of runtime

Given that the `core/authority-discovery` uses concrete authority
identifiers and signatures, one can verify a signature with the
authority discovery within `core`. Given the above, the `verify` runtime
api is obsolete and thus removed.

* *: Add authority discovery to the set of session keys

* *: Sign authority discovery DHT payload with keystore instead of runtime

Instead of calling a runtime function to sign a dht payload, which then
invokes the keystore, pass the keystore to the authority discovery
module and use it directly.

* core/authority-discovery: Give libp2p Kademlia time to start up

* core/authority-discovery: Move authorities priority group name to const

* node/runtime/src/lib.rs: Bump runtime spec version

* *: Fix lints and node/testing test failures

* *: Fix formatting

* core/authority-discovery: Box dht event channel in unit tests

* node/cli/src/service.rs: Fix future import

* node/cli/src/service.rs: Replace unwrap by expect with proof

* node/cli/src/chain_spec: Remove TODO for testnet key generation

* core/authority-discovery/src/lib: Remove scale encoding TODOs

* srml/authority-discovery: Make comment a doc comment

* core/authority-discovery: Remove unused StreamExt import

* node/runtime: Bump impl version to debug CI

* Test ci.

* Change the line width to 100.

* Revert "Change the line width to 100."

This reverts commit edff1f855bc71e0418bf3a967f81a35591d882e3.

* Fix a check for polkadot to work on forked repos.

* Revert "node/runtime: Bump impl version to debug CI"

This reverts commit 1a90903b4c929bc55a9e0a538af34b50b7f65139.

* Revert "Test ci."

This reverts commit a2c9df574e645158f77cd2b3d4d9355bcae33aab.

* Cargo.lock: Fix wrong lock file merge

* srml/authority-discovery: Keep track of new validator set not upcoming

* core/authority-discovery: Document key retrieval functions
2019-11-14 14:14:06 +01:00
Caio 64f7ed04dc Implement Copy, Deref and FromStr to (ed25519|sr25519)::Public (#3998) 2019-11-14 09:40:13 +01:00
Sergei Pepyakin e1b6f68f60 Additional wasm diagnostics (#4097)
* Wasm diagnostics

* Pass the error

* Make errno optional

* Cargo.lock

* Log the error
2019-11-14 09:40:00 +01:00
Arkadiy Paronyan cf49b2b8de Keep tack of best imported block precisely (#4100) 2019-11-14 09:39:52 +01:00
Arkadiy Paronyan 5cf3e2825d Do not download blocks too far ahead (#4095) 2019-11-12 19:22:53 +01:00
Robert Habermeier 2eac9f5b1b Translation for linked map (#4052)
* make linked_map generic functions better

* implement translation of linked map

* proc-macro for linked map updated

* test linked map migration

* account for instances

* address grumbles

* cut map short if migration fails
2019-11-12 19:17:42 +01:00
cheme 05391f7e04 State machine call proof backend (#3945)
* drafting a proof extraction at the hashdb level (to include everything
for the 'call' proof case).

* use full proof by default (replace previous proof recorder).

* fix warnings.

* Cache value not found in proof recorder.

* Remove need or internal backend struct.

* fix type.

* doc
2019-11-12 16:57:37 +01:00
Nikolay Volf 61e43218e5 Randomized tests on storage cache (#4070)
* randomized tests

* destroy clones

* remove commented

* fixes

* add finalization fork
2019-11-12 16:57:21 +01:00
Arkadiy Paronyan 95d1bf0e41 Sensible limits for known blocks and extrinsics (#4094) 2019-11-12 16:57:03 +01:00
Kian Paimani efedac734d Weight annotation for block hooks. (#4058)
* Initial version that works with proper tests.

* get rid of todos and grumbles and such.

* Cleanup and fix line-width

* fix test runtime test
2019-11-12 14:42:38 +01:00
Demi Obenour ab1b98fee5 Bump dependencies with cargo update (#4087)
This lets us drop a couple old dependencies, which is nice.
2019-11-12 14:04:09 +01:00
Arkadiy Paronyan d40abed4a5 Fix sync stalling on moving head (best block) prior to the tip of the chain sometimes (#4091)
* Work around finalization woes

* Fixed check_block

* Added a test
2019-11-12 13:54:11 +01:00
Gavin Wood c91d42712a Do nothing for zero imbalances (#4089) 2019-11-12 09:42:32 +01:00
Weiliang Li bff16d906d update tiny-keccak (#4093)
* update tiny-keccak

* fix

* Update Cargo.toml

* update Cargo.lock

* remove keccak-hasher
2019-11-12 09:35:46 +01:00
Gavin Wood f1427d51f8 EVM should store contracts' balances in an account. (#4090) 2019-11-12 09:34:08 +01:00
Bastian Köcher 5504b4b2dc Fix runtime interface docs and remove accidentally added file (#4092) 2019-11-12 00:25:13 +01:00
Bastian Köcher 2ecffa1cd0 Refactor sr-api to not depend on client anymore (#4086)
* Refactor sr-api to not depend on client anymore

* Fix benches

* Apply suggestions from code review

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

* Apply suggestions from code review
2019-11-11 16:26:49 +01:00
Max Inden e26d1a0b3e [WIP] .gitlab-ci.yml: Fix a check for polkadot to work on forked repos v2 (#4078)
* Fix a check for polkadot to work on forked repos.

* .gitlab-ci.yml: Add `git diff` for CI debugging

* More future proof and less redundant.

* .gitlab-ci.yml: Improve comments and refactor sed command

* .gitlab-ci.yml: Remove two commas in a row

* .gitlab-ci.yml: Ensure to match branch statements at the end

* .gitlab-ci.yml: Reference concrete commit

When one does not specify the concrete commit, cargo-update tries to
checkout 'master' in the Substrate repository.

* .gitlab-ci.yml: Remove 'git diff' debug line
2019-11-11 14:49:15 +01:00
Talha Cross daa0e0e91b core/consensus: fix console output for slot duration (#4085) 2019-11-11 13:31:38 +01:00
Arkadiy Paronyan 59ec4cb071 Don't request old obsolete blocks (#4084) 2019-11-11 11:34:53 +01:00
Arkadiy Paronyan a62dcd5a13 Cleanup filtered messages (#4082) 2019-11-11 11:34:23 +01:00
Tomasz Drwięga 57ab3aeb82 Typed chain state queries over rpc. (#4079)
* Create typed client helpers for querying chain state storage items declared by
'decl_storage!'.

* Update substrate-rpc-custom functions to use async await syntax.

* The implementation of substrate-rpc-custom was a bit verbose and repetitive.
This commit makes the implementation simpler by intruducing a struct which
represents query for a typed value in storage. The new struct is called
StorageQuery. A StorageQuery wraps a raw StorageKey but is not directy
constructable. To construct a StorageQuery, the user must supply an
implementation of a srml_support::storage::generator trait such as
StorageValue or StorageMap.

A type implementing one of the generator traits can be aquired by:
A) marking a storage item as pub within a call to decl_storage (recommended)
or B) implementing one of the generator types manually.

While option B may sometimes me necessary, it's not recommended because
separate manual implementaions may lose sync with the original definition.

* drop unused dependency

* fmt

* Remove unnecessary pub from Authorities field in test-runtime storage
declaration.

This field was added to support a test in an earlier commit. The
test no longer relies on test-runtime so the change can be reverted.

* Move it to srml as support extension.

* Fix long lines.

* Fix.
2019-11-11 02:01:15 +01:00
Arkadiy Paronyan bb0736cdba Allow ancient fork download after ancestry search (#4080) 2019-11-11 01:23:41 +01:00
Kian Paimani ed5d31a22b Remove Self vote from phragmen (#4081)
* first draft of everything that works

* Some test fixes
2019-11-11 00:41:44 +01:00
Bastian Köcher b691cfe093 Substrate runtime interface 2.0 (#4057)
* Adds first version of traits for generating the host functions

* First steps of the procedural macro

* Implements generation of the host extern functions

* Prefix ext host function with snake case trait name

* Implement host functions implementation on the host

* Change `HostFunctions` interface

* Implement `HostFunctions` for tuples

* Make `WasmExecutor` generic over the host functions

* Begin to add a test and make it compile

* Make the test succeed

* Add test to ensure that host functions are not found

* It's alive! Make the `set_storage` test work

* Add test for mutable references

* Code cleanup and documentation etc

* Add marker trait for types that should be passed as SCALE encoded

* Inherit the visibility from the trait and more improvements

* More impls and move them into their own file

* Code simplification by dropping one trait

* Give it a better name

* Implement traits for arrays

* Refactor code to support pass by codec/inner

* Docs

* Implement pass by inner for some crypto types and add a test

* Implement exchangeable function support

* Rewrite sr-io with as runtime interface

* Start reworking after master merge

* Adds `PassByCodec` derive

* Adds `PassByInner` derive

* Fix compilation errors

* More implementations

* Implement runtime interface traits for `str`

* Make `sr-io` compile again

* Fix more compilation errors

* More progress on getting stuff back to compile

* More compilation fixes

* Fix warnings

* Remove le conversions

* Add support for `wasm_only` interfaces

* Implement `Allocator` interface

* Improve error message

* Move `WasmAllocator` to `sr-io` and more clean ups

* Use correct function signature for wasm functions

* Store the host functions with the Wasm runtime

* Docs update

* Fix compilation after master merge

* Remove `sr-io/without_std`

* Make `srml-support` tests run again

* More compilation error fixes

* Use correct doc syntax

* Fix test-runtime

* Fix compilation

* Catch native panics when executing the wasm runtime

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.

* Fix compilation

* Don't panic in a panic

* Move `sr-sandbox` to new runtime interface

* Fixes tests after sandbox changes

* Make sure we detect invalid utf8

* Fixes after master merge

* Adds pass by enum strategy

* Fix wasmtime integration

* Some macro structure clean up

* Rework and test exchangebale host functions

* PassBy derive macros documentation

* Docs for `runtime_interface` macro

* Support wild card argument names

* Adds ui tests

* Make sure that we are backwards compatible to the old runtime interfaces

* Documentation

* Fixes after latest master merge

* Make `wasmtime` happy

* Make `full_crypto` work

* Make the new interface versionable

* Rename `Sanboxing` to `Sandbox`

* Don't finalize in test while importing

* Fix Performance regression

* Fix test
2019-11-10 21:59:30 +01:00