Commit Graph

2244 Commits

Author SHA1 Message Date
André Silva fc392896dc node: update flaming fir chain spec (#3423) 2019-08-16 16:23:46 +02:00
André Silva cb7527d2b2 babe: Introduce secondary slots (Aurababeous) (#3380)
* babe: initial implementation of secondary slots

* babe: validate secondary slot author

* babe: implement weight based fork choice

* babe: remove unused

* aura: cleanup unused imports

* babe: pass in parent weight when authoring and verifying

* babe: use epoch randomness for picking secondary slot authors

* babe: fix tests

* babe: fix wasm build

* babe: node-side code for disabling secondary slots

* babe: allow enabling/disabling secondary slots from runtime

* babe: fix test

* babe: use blake2_256 for secondary slot assignment

* babe: run block initialization in should_end_session

* node: increase slot duration to 6s

* babe: add docs

* node: bump spec_version

* Apply suggestions from code review

Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* babe: simplify secondary slot assignment calculation

* babe: remove unnecessary comment

* node: bump spec_version

* babe: fix bad merge
2019-08-16 15:47:53 +02:00
Sergei Pepyakin f735d067c4 Respect heap_pages parameter. (#3420) 2019-08-16 15:33:22 +02:00
Tomasz Drwięga 42fb0c7cad Verify signature and session index during apply phase of im-online. (#3418)
* Verify signature and session index during apply phase of im-online.

* Bump impl_version.

* Add docs to SignedExtension
2019-08-16 12:59:02 +02:00
Tomasz Drwięga c94e0f28b4 Reject transactions with no provides tags. (#3416) 2019-08-16 11:52:47 +02:00
Svyatoslav Nikolsky 3825a21bac Fix light client synchronization on master (#3301)
* value ranges in consensus cache

* skip values in cache

* read epoch0 + epoch1 data from genesis in babe

* sync authorities + session validators at genesis

* removed some debug printlns

* fixed cache encoding

* Revert "skip values in cache"

This reverts commit ce451c32823aaa4b67d99ca5b58f1bf3984df4db.

* Revert "value ranges in consensus cache"

This reverts commit 9062f9434cddd14a01275ddbfcd904b04282e63b.

* get rid of cache::AUTHORITIES in Babe

* cleaning up

* cleaning up

* update spec version

* lost changes

* fixed tests

* Update node/runtime/src/lib.rs

Co-Authored-By: DemiMarie-parity <48690212+DemiMarie-parity@users.noreply.github.com>

* fix once-per-block condition

* fix standalone babe + temp_storage in BuildGenesis

* fix benhes compilation

* fixed comment

* re-added light nodes to integration tests

* finalize_with_ancestors from extra_requests

* post-merge fix

* aaand removed debug code

* (another one)

* fix warn in logs (do not call ForkTree::finalize twice for the same block)

* sync digest.next_authorities with actual next authorities

* more docs

* reverting all commits affecting storage

* also remove keys from babe trait

* fixed warnings

* post-merge fixes

* reverted some redundant changes

* reverted more changes
2019-08-16 11:51:49 +02:00
André Silva d1dde7e087 session: add handler for genesis session (#3413)
* session: add handler for genesis session

* node: bump spec version

* aura: handle on_genesis_session

* srml: make sure we don't re-initialize genesis authorities

* session: fix mock

* node: remove genesis authorities from chain spec

* staking: fix mock

* srml: don't initialize genesis authorities twice

* aura: don't reinitialize genesis authorities

* aura: fix runtime_io dependency

* Bump runtime
2019-08-16 11:24:06 +03:00
André Silva 3590c9c33f im-online: use new session keys (not upcoming session) (#3414)
* im-online: use new session keys (not upcoming session)

* node: bump spec_version

* im-online: rename on_new_session queued validator set parameter
2019-08-16 09:58:38 +02:00
Robert Habermeier ee0ac798eb remove weighting and staking dependency in BABE (#3412)
* remove weighting and staking dependency in BABE

* bump spec version

* Update Cargo.toml

* Update lock

* Fix warnings.
2019-08-15 21:21:14 +02:00
André Silva 6bc72cea62 sync: fix peer common number on block announce (#3410) 2019-08-15 20:47:09 +02:00
Gavin Wood 50896aa916 Bad spelling (#3409) 2019-08-15 16:52:41 +02:00
Yuanchao Sun 8977dd2d40 Fix panic message (#3407) 2019-08-15 16:45:14 +02:00
Pierre Krieger be732a2d68 Update to libp2p 0.12 (#3408) 2019-08-15 16:41:39 +02:00
Robert Habermeier 6a7a222882 add some docs for consensus-gossip (#3405)
* add some docs for consensus-gossip

* formatting adjustments

* authorities -> nodes

* Update core/network/src/protocol/consensus_gossip.rs

Co-Authored-By: André Silva <andre.beat@gmail.com>
2019-08-15 16:41:23 +02:00
Pierre Krieger 11da397db8 Transition the transaction-pool to new futures (#3394)
* Transition the transaction-pool to new futures

* Fix tests

* Fix tests again?!
2019-08-15 12:01:47 +02:00
Pierre Krieger 9d6118279e Rewrite the GRANDPA voter to not use a loop (#3393) 2019-08-15 12:01:35 +02:00
André Silva 6058207935 consensus: refactor aura and babe proposer (#3377) 2019-08-15 08:20:39 +02:00
Drew Stone 5b83e6426f Make inflation mod public to access inflation functions (#3400) 2019-08-14 20:28:03 +02:00
Pierre Krieger 7e2dba3e3a Remove usage of loop_fn in the GRANDPA tests (#3397) 2019-08-14 19:21:04 +02:00
Joshy Orndorff ea8831b15f Minor typo fix. bu -> by (#3402) 2019-08-14 18:33:50 +02:00
AndrewSterlin 818bf37931 clarify comment (#3391)
* clarify comment

* clarify comment

* clarify comment
2019-08-14 11:01:41 +02:00
Bastian Köcher 0c941d66cb Make sure that srml-collective does not initialize Members twice (#3379)
* Make sure that `srml-collective` does not initialize `Members` twice

* Implement trait for `()`

* Fix test
2019-08-13 20:40:30 +02:00
Michael Müller 7f764dbd37 Replace config field with default value (srml/im-online) (#3388)
* Fix whitespacing

* Replace configurable fields with default values

* Bump version

* Apply suggestions from code review

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

* Fix more whitespacing

* Fix style
2019-08-13 20:16:02 +02:00
Marcio Diaz 7b45130115 Add transaction pool to Aura and Babe import queue (#3225)
* Add transaction pool to babe import queue

* Add transaction pool to Babe check header

* Fix tests

* Add tx pool to Aura import_queue

* Fix tests, node-template

* Add comments regarding unused _transaction_pool

* Make tx pool optional in check_header
2019-08-13 10:44:00 +01:00
Arkadiy Paronyan 9ca96d6fe7 More robust state pinning (#3355)
* Better state pinning

* Fixed pinning race

* Update core/state-db/src/noncanonical.rs

Co-Authored-By: Robert Habermeier <rphmeier@gmail.com>
2019-08-13 09:19:54 +02:00
Max Inden 83052fe573 core/network: Surface peerset's set_priority_group in NetworkService (#3376)
`PeerSetHandle.set_priority_group` allows modifying a priority group by
group identifier. With this commit the function can be accessed through
`NetworkService`.

This is need in order for a validator to connect to as many other
validators as configured without reserving a specific connection slot
for them.
2019-08-12 19:23:59 +02:00
Gavin Wood e8d19f7a09 subkey network default works (#3375) 2019-08-12 19:23:35 +02:00
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