Commit Graph

1781 Commits

Author SHA1 Message Date
Marcio Diaz bc325eca66 Init store for slots-headers (#2492)
* init store for slots

* fix: add check_equivocation to Aura/Babe

* fix tests

* fix: add pruning bound

Co-Authored-By: André Silva <andre.beat@gmail.com>

* use saturating_sub
2019-05-15 12:22:43 +02:00
Bastian Köcher d50b717ff6 Generate correct serde bound for GenesisConfig (#2585)
* Generate correct serde bound for GenesisConfig

* Handle double map as well

* Adapt double map test
2019-05-15 11:54:00 +02:00
TriplEight 9ea689bdef check-web-wasm now uses the default builder image (#2583) 2019-05-14 18:28:01 +02:00
thiolliere 3a58c7ebcb make construct_service_factory compile (#2581) 2019-05-14 17:50:38 +02:00
Niklas Adolfsson e330b69cb9 fix(redundant import) (#2582)
Fixes warning: the item `HashSet` is imported redundantly
2019-05-14 18:07:13 +03:00
Pierre Krieger 0181833f89 Randomly fuzz the PSM (#2470)
* Randomly fuzz the PSM

* Fix test

* Run it moar
2019-05-14 16:30:28 +02:00
Pierre Krieger 0d0fe6a0ea Add WebSocket addresses for bootnodes (#2578) 2019-05-14 16:30:16 +02:00
Pierre Krieger 18f7acce98 Move ProtocolMsg to service.rs (#2560)
* Move ProtocolMsg to service.rs

* Fix line width

* Fix line width again

* Correct whitespace

* Another whitespace correction
2019-05-14 14:26:52 +01:00
Svyatoslav Nikolsky a29fd10859 Do not try to synchronize from light client (#2039)
* do not try to sync from light node

* use Roles' utility methods
2019-05-14 14:41:10 +02:00
Pierre Krieger 5bde98e95a Increase tolerance for bandwidth usage in test (#2576) 2019-05-14 14:40:06 +02:00
Svyatoslav Nikolsky 9a14ba0555 Fix light client startup (build_select_chain returns Result<Option>) (#2574)
* fix light client strtup (build_select_chain -> Option)

* fixed node template compilation

* Update core/service/src/lib.rs

Co-Authored-By: Benjamin Kampmann <ben.kampmann@googlemail.com>
2019-05-14 12:38:30 +01:00
André Silva 132984adf5 Introduce Flaming Fir testnet (#2526)
* node: replace emberic elm with flaming fir testnet

* update readme
2019-05-14 12:11:25 +02:00
Sergei Pepyakin d57f6f9305 Pass topics along with events (#2563)
* Introduce an IndexedEvent

* Plumb topics through the Ext interface.

* Add topics to ext_deposit_event

* Charging for events.

* Check the number of topics.

* Check for duplicate topics.

* Bump API version.

* Move derive(*Eq) under test.

* Use sorting for finding duplicates.
2019-05-14 12:09:51 +02:00
Pierre Krieger 6ccdbea01c Move extra_requests.rs as a submodule of sync (#2573) 2019-05-14 12:08:01 +02:00
joe petrowski 580432d822 Fix over/under flow risk in OnDilution (#2548)
* fix over/under flow risk in OnDilution

* bump impl
2019-05-14 12:07:32 +02:00
Andrew Jones e5627e2480 Prevent divide by zero panic with checked_div (#2575) 2019-05-14 11:54:56 +02:00
Michael Müller 7f3d71d306 Add possibility to sign calls via cli (#2549)
* Add possibility to sign calls via cli

* Update subkey/README.adoc

Co-Authored-By: Robert Habermeier <rphmeier@gmail.com>
2019-05-13 21:18:14 +02:00
Pierre Krieger e5b0a98f1a Split SyncContext from protocol Context (#2550) 2019-05-13 21:16:52 +02:00
Gavin Wood 20e809668b Introduce the Get trait and type_parameter. (#2565) 2019-05-13 20:58:57 +02:00
Sergei Pepyakin 21773b3a07 Light client friendly events (#2491)
* Sketch of indexed events.

* Get EventIndex by holding another variable.

* Add some docs.

* Use DoubleMap to store reverse topic index

* Implement StorageDoubleMap::append

* Use append for EventTopics.

* Refactor.

* Avoid `mutate`

* Docs.

* Add topics to EventRecord

* Update tests.

* Rebuild.

* Bump version.

* Event topics test.

* Mix in BlockNumber to distinguish updates

* Fix srml-system test.

* Post merge fixes.

* Comments/TODO.
2019-05-13 20:56:01 +02:00
Pierre Krieger d974189e3c Make the behaviour in libp2p generic (#2525)
* Make the behaviour in libp2p generic

* Fix indentation

* Fix bad merge
2019-05-13 20:55:39 +02:00
Pierre Krieger 2724cdac33 Remove the NetworkChan from the OnDemandService (#2561) 2019-05-13 20:55:27 +02:00
gabriel klawitter 7fb3dc5f68 check line-width of only newly added lines (#2522)
* strictly require <= 120 characters
2019-05-13 17:51:09 +02:00
TriplEight 3b0eca992c Tag for wasm check job (#2538)
* tag for wasm tst
2019-05-13 16:31:29 +02:00
thiolliere 2b694b5898 contruct_runtime doc (#2552) 2019-05-13 14:15:26 +02:00
Joshy Orndorff 3b534c1cc6 Changed all occurences of referendums to referenda. Updated spec versions. (#2545) 2019-05-13 11:37:47 +02:00
Svyatoslav Nikolsky 22586113ea Light GRANDPA import handler (#1669)
* GrandpaLightBlockImport

* extract authorities in AuraVerifier

* post-merge fix

* restore authorities cache

* license

* new finality proof draft

* generalized PendingJustifications

* finality proof messages

* fixed compilation

* pass verifier to import_finality_proof

* do not fetch remote proof from light import directly

* FinalityProofProvider

* fixed authorities cache test

* restored finality proof tests

* finality_proof docs

* use DB backend in test client

* justification_is_fetched_by_light_client_when_consensus_data_changes

* restore justification_is_fetched_by_light_client_when_consensus_data_changes

* some more tests

* added authorities-related TODO

* removed unneeded clear_finality_proof_requests field

* truncated some long lines

* more granular light import tests

* only provide finality proof if it is generated by the requested set

* post-merge fix

* finality_proof_is_none_if_first_justification_is_generated_by_unknown_set

* make light+grandpa test rely on finality proofs (instead of simple justifications)

* empty_finality_proof_is_returned_to_light_client_when_authority_set_is_different

* missing trait method impl

* fixed proof-of-finality docs

* one more doc fix

* fix docs

* initialize authorities cache (post-merge fix)

* fixed cache initialization (post-merge fix)

* post-fix merge: fix light + GRANDPA tests (bad way)

* proper fix of empty_finality_proof_is_returned_to_light_client_when_authority_set_is_different

* fixed easy grumbles

* import finality proofs in BlockImportWorker thread

* allow import of finality proofs for non-requested blocks

* limit number of fragments in finality proof

* GRANDPA post-merge fix

* BABE: pos-merge fix
2019-05-13 11:36:52 +02:00
Pierre Krieger 258f0835e4 Reserved peers don't occupy slots (#2546) 2019-05-13 11:02:51 +02:00
Svyatoslav Nikolsky 6cd82ca747 send GRANDPA messages without holding validator lock (#2537) 2019-05-13 09:18:43 +03:00
Pierre Krieger 6c41d0b3ec Isolate the code of ChainSync and turn it into a state machine (#2497)
* Move the is_offline and is_major_syncing logic to service.rs

* Move the ImportQueue to service.rs

* Remove stop() and abort()

* Add some more documentation to sync.rs
2019-05-12 19:23:45 +02:00
Pierre Krieger cbe13c459b Fix #2535 (#2540) 2019-05-11 17:36:10 +02:00
André Silva 9d23d2a25a Bump master to v2.0.0 (#2514)
* bump crates to v2.0.0

* fix crate authors

* bump node runtime spec_version

* remove unused import for no-std
2019-05-10 16:55:15 +02:00
Chevdor 1475e72313 Revert from alpine to phusion and include wasm build (#2482)
* Revert from alpine to phusion and include wasm build

* Update Dockerfile
2019-05-10 14:36:18 +02:00
cheme 0d8379d5d2 Child trie storage proof (#2433)
* proof on child trie

* higher level api for child storage proof

* boilerplate for proof from light fetch

* actually check proof on light fetch

* Do not break former encoding

* tabify

* tabify2

* Add child trie root tx to full_storage_root transaction.

* Shorten long lines.

* Temp rename for audit

* Make full_storage a trait method

* Name back and replace some code with full_storage where it looks fine.

* fix indentations, remove unused import

* flush child root to top when calculated

* impl +1
2019-05-10 14:31:41 +02:00
Svyatoslav Nikolsky 59be403730 Create AuthoritiesChange digest item in correct block (#2512)
* finalize srml modules in reverse order

* update runtime versions
2019-05-10 14:30:48 +02:00
thiolliere ac195a0060 add brief doc to some macro (#2523)
* add doc

* Update lib.rs
2019-05-10 14:21:03 +02:00
Gregory Terzian 363448cd01 don't acquire the lock unless, and only hold it for as long as, necessary. (#2530) 2019-05-10 14:15:36 +02:00
Svyatoslav Nikolsky 42fa5f6209 Fix deadlock in tests that are using with_gossip (#2533)
* fixed gossip related tests deadlock

* cleaning sync tests log

* fixed typo in logs

* send GRANDPA messages without holding validator lock

* Revert "fixed gossip related tests deadlock"

This reverts commit d3fe55e45e32b7ea2e9f05f1c511972c708209ad.
2019-05-10 14:14:42 +02:00
thiolliere dfbaedd535 Allow modules to validate transaction, second attempt (#2463)
* first impl

* rename origin::inherent to none

* fix

* fix

* Apply suggestions from code review

Co-Authored-By: thiolliere <gui.thiolliere@gmail.com>

* comment

* better error

* doc

* (add unsigned module 🤦)

* doc

* fix

* implement for node-template as well

* add validated unsigned to executor

* fix

* fix

* bump version

* testing xt

* remove extraneous logic

* licence

* impl test
2019-05-10 14:13:04 +02:00
Pierre Krieger 4aa44ab280 Rewrite the PSM (#2440)
* Rewrite the PSM

* Fix disconnecting from reserved peers

* Minor adjustements

* Address review

* Reputation changes adjustements

* More adjustements

* Adjust all reputations

* More fixes and adjustments

* Improve proof

* Remove the possible panic

* Make sure reputation reaches 0
2019-05-10 14:08:42 +02:00
Benjamin Kampmann 18ca0170c3 Allow for customisation of chain selection systems (#2240)
* move SelectChain trait out of client

* Extend SelectChain, move longest chain implementation into it

* Bring SelectChain into service

* implement LongestChain SelectChain

* implement longest chain for node

* update Cargo.lock's

* in between erroring tests

* deprecate ::backend and ::import_lock

* Remove unneded space

Co-Authored-By: gnunicorn <ben.kampmann@googlemail.com>

* Remove unneded space

Co-Authored-By: gnunicorn <ben.kampmann@googlemail.com>

* Fixes test compilation

* remove todo

* re-enable client test

* add doc

* fixing tests

* Clarify SelectChain Interface, intended implementation and usage

* minor components cleanups

* minor cleanups

* Update lock files

* Implement cleaner interface for SelectChain

* addressing comments

* Updating tests

* bump node runtime impl version

* address grumbles
2019-05-10 14:08:12 +02:00
André Silva 32fdeed21c core: use current_thread tokio runtime to poll network to proto channel (#2531) 2019-05-10 10:26:58 +01:00
Kian Peymani 71426fb060 Reformat Validator Election (#2406)
* Add index caching to election

* Initial draft of the new phragmen API.

* Port post-processing to the new API.

* Fix tests and accuracy.

* Final fixes.

* Unify convert namings.

* Remove todo.

* Some typos.

* Bump.

* Add extended balance type doc.

* A bit more sophisticated weight compensation.

* Fix review feedbacks.

* Bump.

* Final updates
2019-05-09 19:05:45 +02:00
Sergei Pepyakin c7cd82784b Add a simple PR template (#2510)
* Add a basic PR template

* Update

* Update

* Another iteration.

* Fixes.

* Apply suggestions from code review

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

* Be not rude

* Label only if you have permissions
2019-05-09 19:02:55 +02:00
Michael Müller 47e3dacc2d Imply forced authoring on --dev (#2498)
* Imply forced authoring on --dev

* Combine conditionals
2019-05-09 19:01:57 +02:00
Pierre Krieger 099ff629b6 Add some benchmarks for ed25519 in substrate_primitives (#2520)
* Add some benchmarks for ed25519

* We don't need the Debug impl

* Add multiple message sizes
2019-05-09 17:58:45 +01:00
Pierre Krieger cad1f19d48 Make more crates compile for WASM browser (#2524)
* Make more crates compile for WASM browser

* More crates

* Update .gitlab-ci.yml

Co-Authored-By: Sergei Pepyakin <s.pepyakin@gmail.com>
2019-05-09 17:41:50 +01:00
André Silva 9927c336d3 fix chain spec builder compilation (#2521) 2019-05-09 18:25:02 +02:00
Pierre Krieger d4eb3ec747 Replace ring with ed25519-dalek in primitives (#2415) 2019-05-09 16:24:56 +02:00
Bastian Köcher e67b653c85 Silence the deprecated warning in generated code (#2513)
`impl_runtime_apis!` is not only implementing the apis, it also calls
them internally and thus generates the warning. So, we just allow
depracted calls in the generated code.
2019-05-09 10:27:08 +02:00