Commit Graph

2217 Commits

Author SHA1 Message Date
Sergei Pepyakin baf8c74bac Add code owners file (#3371)
* Add code owners file.

* Update CODEOWNERS

* Update CODEOWNERS
2019-08-12 19:16:48 +02:00
Gavin Wood 9afd655d8b Era change can be forced on and forced off (#3374)
* Forcing can be on or off.

* Add a testcase.
2019-08-12 18:14:16 +02:00
Gav Wood ebba5d1d3c Revert "Forcing can be on or off."
This reverts commit 583b0552d6.
2019-08-12 17:25:34 +02:00
Gav Wood 583b0552d6 Forcing can be on or off. 2019-08-12 17:24:12 +02:00
Gavin Wood 248237647b Remark is trivial and doesn't deserve such a big weight (#3372) 2019-08-12 17:23:09 +02:00
David Craven 6435df16f1 Implement Deserialize for SignedBlock and Header. (#3370)
* Implement Deserialize for SignedBlock.

* Implement Deserialize for Header.

* Deserialize number.

* Deserialize number (second try).

* Fix line length.

* Remove ::'s.
2019-08-12 17:07:11 +02:00
Jim Posen 36abb128f5 srml-contracts: Contract calls/instantiations to return exit statuses (#3320)
* srml-contracts: Rename ext_scratch_copy to ext_scratch_read.

This is to disambiguate from the next ext_scratch_write function.

* Remove unnecessary OutputBuf and EmptyOutputBuf.

* Replace VmExecError with a result type of custom structs.

* Do not drop the scratch buffer on traps and regular returns.

This just reduces the number of allocations required during nested
contract calls and instantiations.

* Semantics for returning a status code and data from contract calls.

* Remove CallReceipt and InstantiateReceipt.

With forthcoming changes to return data from instantiate calls, the two
types of receipts become very similar to each other and to
ExecReturnValue. Instead, replace them with ExecReturnValue and
a regular 2-tuple in the case of instantiation.

* Modify contract function signatures to allow returning status codes.

* Introduce ext_sandbox_write runtime function.

* Test all the things.

* Bump node runtime spec version.

* Style fixes.
2019-08-12 16:16:30 +02:00
Robert Habermeier bf32626373 downgrade logging of malformed packets to debug (#3367) 2019-08-12 16:13:59 +02:00
Juan Aguilar db5e6712d7 Remove enumerate_trie_root in favour of ordered_trie_root #2382 (#3360) 2019-08-12 16:13:02 +02:00
André Silva 70d716dc48 node: exit on GRANDPA voter or BABE authoring error (#3353)
* node: exit on GRANDPA voter or BABE authoring error

* node: exit process with non-zero return code when service fails

* service: rename infallible task to essential task

* service: revert field name changes

* core: fix service testnet
2019-08-12 15:54:30 +02:00
Gavin Wood 09b57261df Remove unneeded cruft (#3368) 2019-08-12 15:47:29 +02:00
Bastian Köcher 418ea85e42 Make --alice etc implicitly enable --validator (#3369) 2019-08-12 15:42:53 +02:00
Robert Habermeier aa86d5ce7a document that session key generation stores keys (#3366)
* document that session key generation stores keys

* final typo fix
2019-08-12 15:27:39 +02:00
Pierre Krieger 4f051a5784 Rewrite the GrandPa observer work future (#3309)
* Rewrite the observer work future

* Line widths

* Update core/finality-grandpa/src/observer.rs

Co-Authored-By: André Silva <andre.beat@gmail.com>
2019-08-12 12:49:51 +02:00
Pierre Krieger 6fa84bae0f Refactor parse_and_execute (#3358)
* Refactor `parse_and_execute`

Adds a new function named `parse_and_prepare`, which prepares the environment and parses the command.
Contrary to `parse_and_execute`, `parse_and_prepare` returns a struct that permis the user to execute the command, as opposed to execute it itself.

`parse_and_execute` has been modified to use `parse_and_prepare` internally.

* Embed dispatch functions directly into run()

After the previous commit, we now have a lot of functions whose only one is to call other functions. And these other functions are called only from one location.
Let's merge these two for clarity.

* Deprecate parse_and_execute and replace it in node and node-template

* Apply suggestions from code review

Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>
2019-08-11 16:07:40 +02:00
Gavin Wood 14bb115193 Scale trait and move to u32 blocknumbers (#3357)
* Scale trait and move to u32 blocknumbers.

* Fixes

* Cleanups

* Update node/runtime/src/lib.rs

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

* Fix up some of the factory stuff.

* Update core/sr-primitives/src/traits.rs

Co-Authored-By: Shawn Tabrizi <shawntabrizi@gmail.com>

* Move Nonce/Index to u32 (#3361)

* Force a non-borked version of upstream crate

* Line lengths and runtime version bump
2019-08-11 15:03:06 +02:00
Bastian Köcher d1161b7d36 Switch AuRa to dynamic keystore lookup (#3359) 2019-08-09 23:10:53 +01:00
Pierre Krieger a29f5763a7 Add a small ban when we get disconnected from a node (#3325) 2019-08-09 16:25:28 +01:00
André Silva 59c88cb2f3 node: setup disabled grandpa properly (#3356) 2019-08-09 16:53:44 +02:00
André Silva 98d502466d node: re-introduce validator flag (#3351) 2019-08-09 15:17:52 +02:00
Bastian Köcher c824c959d7 Adds --no-validator CLI flag (#3348)
* Implement `is_validator` for offchain-workers

* Introduce `--no-validator` flag

* Don't run babe/grandpa/im-online when `--no-validator` is given

* Fixes compilation

* Bump spec version

* Improve error handling in executor

* Add missing extern function

* Revert making error public

* Remove `--no-validator` CLI
2019-08-09 14:24:18 +02:00
TriplEight b4b53cbb6e Check for warnings (#2850)
* check for warnings

* test run

* prebuild wasm binaries, pre-test is not needed for now

* will run everywhere but PRs

* lost warnings

* lost warnings

* try warnings with tests

* Update expected stderr in UI tests

* added to RUSTFLAGS

* another way of collecting warnings

* bump impl_version

* fix int tests parser

* revert demis changes and impl version bump

* no need to collect warnings in int test
2019-08-09 14:07:41 +02:00
André Silva 44515ed5f9 grandpa: fix catch up test (#3347) 2019-08-09 13:46:54 +02:00
Gavin Wood cc02a7424d Introduce AppVerify (#3343)
This trait, which works just like `Verify`, except on AppKey types.
I'd like for it all just to be `Verify`, but Rust's trait rules
concerning upstream changes mean it can't happen. This is a simple
workaround needed for some stuff in Polkadot.
2019-08-09 13:43:32 +02:00
André Silva 8f3a68db25 grandpa: fix --no-grandpa flag breaking block production (#3350) 2019-08-09 00:53:54 +01:00
Robert Habermeier a1a8c9829e remove unneeded as_ref call (#3349) 2019-08-08 23:05:03 +02:00
Arkadiy Paronyan 17a851b433 Fixed warnings (#3345) 2019-08-08 18:10:32 +02:00
David Craven a7c87f21da Remove Decode trait bound. (#3342) 2019-08-08 16:31:50 +02:00
Pierre Krieger bafc7202ca Service various cleanups (#3238)
* Remove generic from sign()

* Remove mandatory RuntimeGenesis trait req

* Remove requirement from Configuration

* Relax trait bounds of core/cli

* Move method

* The config field is no longer public

* Remove Components from bounds of functions

* Implement DerefMut for LightComponents

* Implement Executor for Full/LightComponents

* Fix bad merge

* Fix forgotten config()

* Fix build
2019-08-08 16:14:30 +02:00
Logan Saether fe18b4055d Fix documentation set_controller (#3340)
The documentation for the `set_controller` function was copied from the function above it, however it does not do the same thing. Fixed the documentation to fit the correct description of what `set_controller` does.
2019-08-08 15:08:14 +02:00
cheme b0e1212d48 Child storage tests and genesis fix. (#3185)
* Using child storage, (srml-support only), test failing .

* fix simple tests.

* Enumerable by requiring owned struct (previous form only allow
&'static).
Broken tests are from genesis init.

* implement for_child_keys_with_prefix

* indent

* clear_child_prefix fix.

* clear_child_prefix fix 2.

* fix for storage_impl, if/when allowing child and not child this could be
reverted.

* Fix lot of urlinked child genesis, still need to look upon actual
genesis srml module code.
Probably still a lot of broken code needing debugging.

* switch well_known_key to their associated module child trie.
Fix a genesis init (balance).
Complete some testing.
Comment some tests before using.

* fixing test runtime child keys

* latest commit fix broken genesis init

* fix system balances child name.

* Important fix: storage_root from test externalities need children (it is
already the case for ext).

* executive root with child calculation

* Avoid empty trie on test ext.

* Symetric removal of key for system.

* commenting changes related tests.

* Remove child module specifics.

* fix issues.

* fix some formatting

* fix bench and bump runtime

* Remove extend_storage_overlays, assimilate_storage do the same as is
proper considering srml macro.

* Fix warning for assimilate.

* Removing kill as they do not impact any test cases.

* Use tuple of storage map instead of two parameters. This changes the
behavior of decl_storage genesis build closure (breaking api).

* Do not use build storage before assimilate.

* fix error

* Update core/state-machine/src/backend.rs
2019-08-08 15:05:25 +02:00
Jim Posen 0067b2d9a2 srml-contracts: Refactor away some duplication in runtime functions. (#3257)
* srml-contracts: Storage access micro-optimization.

* srml-contracts: Refactor runtime functions to reduce duplication.

* Bump node runtime impl version.
2019-08-08 15:02:04 +02:00
Bastian Köcher 7c1fc4cc77 Make --dev to --alice again (#3338) 2019-08-08 13:11:46 +02:00
Bastian Köcher 0de7d9bb64 Adds author_rotateKeys RPC (#3337)
* Adds `author_rotateKeys` RPC

`author_rotateKeys` will rotate all session keys, store them into the
keystore and returns their encoded public keys as result. These encoded
public keys can be used directly to send the transaction to the chain.

* Review comments
2019-08-08 11:00:04 +02:00
André Silva 6565e1f8aa grandpa: track multiple live rounds in voter set state (#3298)
* grandpa: track multiple live rounds in voter set state

* grandpa: don't assume rounds are completed in-order

* grandpa: fix tests

* grandpa: don't assume round is being tracked on Environment::completed

* grandpa: fix missing import in test
2019-08-08 09:56:49 +02:00
Xiliang Chen 0f0df9850a add post_dispatch (#3229)
* add post_dispatch

* Update traits.rs

* Update checked_extrinsic.rs

* Update traits.rs

* Update traits.rs

* fix build issue

* update runtime version

* fix test build issue
2019-08-08 09:56:04 +02:00
Pierre Krieger 3d65753d48 Switch offchain workers to new futures (#3285)
* Switch offchain workers to new futures

* Fix tests
2019-08-08 09:35:12 +02:00
Arkadiy Paronyan b29277239a Improve console output (#3326)
* Cache idle state

* Display import error by default
2019-08-08 09:34:09 +02:00
Bastian Köcher 60269d65c6 Clean up CLI interface (#3334)
* Clean up CLI interface

- Removes `--validator` and `--grandpa-voter`
- Make `--alice` etc work without `--dev`

* Style fixes
2019-08-08 09:33:45 +02:00
Pierre Krieger 6396901481 Reintroduce mplex (reverts #3312) (#3328)
This reverts commit f11291cd9a.
2019-08-08 09:32:07 +02:00
Arkadiy Paronyan c0fd256c01 Fixed test block conditions (#3332) 2019-08-08 01:01:16 +02:00
Arkadiy Paronyan 58bd0d4c05 Set uncles inherent (#3317)
* Include uncles

* Filter missing uncles

* Moved inherent registration to a new crate

* Ignore invalid inherent encoding
2019-08-08 00:56:29 +02:00
Bastian Köcher ea58b7c92a Make DefaultByte implement Send + Sync (#3333)
* Make `DefaultByte` implement `Send + Sync`

* Update runtime version.
2019-08-08 00:10:36 +02:00
Bastian Köcher 46709e8381 More tests and some cleanup (#3331) 2019-08-08 00:05:15 +02:00
thiolliere 556a9416ae Staking optimisation (#3300)
* staking code api

* doc + test

* version bump

* index fn

* rename function

* doc

* adress comments

* add complexity comment
2019-08-07 22:11:12 +02:00
Andrew Jones 65a7629361 Derive CompactAs for Perbill/mill/U128 (#3327)
* Derive CompactAs for Perbill/mill/U128

* Increment impl_version
2019-08-07 21:48:30 +02:00
Pierre Krieger c32d9a17e0 Rename CustomProto to LegacyProto (#3313) 2019-08-07 21:22:27 +02:00
Pierre Krieger 97febf4c30 Make Verifier::verify mutable (#3165)
* Make Verifier::verify mutable

* Fix GrandPa tests

* Fix doctest

* Fix more doctests
2019-08-07 21:21:44 +02:00
Pierre Krieger f11291cd9a Remove support for mplex (#3312) 2019-08-07 21:08:21 +02:00
Arkadiy Paronyan b5cd36289e Handle telemetry socket errors (#3321)
* Handle telemetry socket errors

* Line width
2019-08-07 20:49:21 +02:00