Commit Graph

1516 Commits

Author SHA1 Message Date
Xiliang Chen 36d90ff272 expose linked map info to metadata (#2037)
* expose linked map info to metadata

* Make it non breaking change

* another way

* change to option 1

* bump metadata version

* fix test

* bump version and update wasm
2019-03-23 11:17:29 +01:00
Pierre Krieger 6e394464b8 Replace NodeIndex with PeerId everywhere (#2077)
* Replace NodeIndex with PeerId

* Fix tests

* More test fixing

* Whitespace
2019-03-23 10:34:28 +01:00
Gav Wood 6fa40ec199 Fix up the offline validator API to accept controller (#2090) 2019-03-23 08:16:22 +01:00
Kian Peymani 564c954aa7 Self-Vote for Staking (among others.) (#2078)
* initial doc for the staking module

* Remove md style links.

* Remove todos.

* Add rust code types

* Rename and fix review notes.

* Add new md file

* Final touches.

* Migrate compleatly to rustdoc

* Update link

* Fix heading

* Final touches wrt the new template.

* Remove empty prereq.

* Fix more reviews

* Some final nits.

* Fix some side issues.

* Fix another set of reviews

* Fix + stabilize leftover reivews.

* Remove unused test parameters

* Fix typo.

* Merge redundant loops

* Adds phantom self-vote

* Fix broken tests.

* Refactor some names to match the reference.

* Remove redundant inner loops from election round.

* Introduce phragmen post-processing.

* Some fixes and todos.

* Fix some tests with new phragmen params

* Fix test

* Bump spec

* Fix wasm build

* Fix tests and phragmen fallback. Avoid double-controlling

* Fix and rebuild wasm

* Whitespaces, whitespaces everywhere.

* Rebuild

* Disable post-processing.

* Identify by stash, not controller account.

* Couple of fixes

* Fix first test

* Fix invulnerability_should_work

* Fix a couple more tests

* Fix more tests

* Fix more tests

* Fix more tests

* Fix some tests

* Fix update-ledger.

* Fix update-ledger.

* Fix another test

* Fix another test

* Fix rest of staking tests

* Remove printlns

* Rebuild wasm

* Fix & tests for auth/val syncing

* Fix up threading for tests

* Remove superfluous asserts
2019-03-22 21:41:33 +01:00
André Silva 25ec793e35 Fix handling of justifications (#2086)
* util: fork-tree: check predicate first while traversing tree

* core: sync: keep track of justifications sent to the import queue

* core: grandpa: verify authority set changes dependencies

* core: fork-tree: add more tests

* core: grandpa: extend enacts_standard_change tests
2019-03-22 19:07:24 +01:00
Pierre Krieger 7469713dea Fix #2073 (#2087) 2019-03-22 18:21:24 +01:00
cheme dd47be51c3 Switch contract storage to child trie (#2002) 2019-03-22 18:01:06 +01:00
Arkadiy Paronyan 704d2a49c7 Don't sync on top of pruned blocks (#2079)
* Don't sync to pruned blocks

* Typo

Co-Authored-By: arkpar <arkady.paronyan@gmail.com>
2019-03-22 16:27:50 +01:00
gabriel klawitter 53f40c583d Ci update names and chart (#2076)
* add option to specifiy substrate node name via environment variable file

* gitlab-ci: change job names and adopt to polkadot pipeline

* upgrade helm chart

Signed-off-by: gabriel <gabriel@parity.io>
2019-03-22 13:13:37 +01:00
DemiMarie-parity 000e7a8002 Make AuRa generic over cryptography (#2062)
As is so often the case in Rust, most of the work was fixing compiler
errors and removing spurious type annotations.
2019-03-21 17:26:00 -04:00
Pierre Krieger b712795aa2 Fix #1777 (#2072) 2019-03-21 16:49:21 +01:00
Pierre Krieger 90c6f85db5 Add a substrate-peerset crate (#2042)
* Add a substrate-peerset crate

* Some adjustements

* More adjustements

* Use a temporary libp2p branch

* Add back-off mechanism

* Fix RPC tests

* Some adjustements

* Another libp2p bugfix

* Do a round-robin in the peerset

* Use a real dependency instead of a patch for libp2p

* Initialize reserved nodes correctly

* Better diagnostic for no address

* Don't allocate slots if in reserved only

* Ban node on dial failure

* Fix indentation
2019-03-21 14:02:28 +01:00
kaiyu f6f15b618e Use local executor (#2054) 2019-03-21 13:57:20 +01:00
Gav Wood df65a92c91 Rebuild, add a couple of tests and fix theoretical issue (#2056)
* Rebuild, add a couple of tests and fix theoretical issue

* Update lib.rs
2019-03-21 13:56:31 +01:00
Arkadiy Paronyan b31bcdfcc3 Keep peer info up to date (#2067)
* Keep peer info up to date

* Docs

Co-Authored-By: arkpar <arkady.paronyan@gmail.com>
2019-03-21 12:55:30 +01:00
Logan Saether e6c73e8951 update readme (#2066) 2019-03-21 10:44:39 +01:00
Pierre Krieger b5957a6aa2 Show the remote PeerId in the handler's logs (#2057) 2019-03-20 17:18:53 +01:00
Gav Wood dcd77a147c Introduce safe types for handling imbalances (#2048)
* Be a little safer with total issuance.

* PairT instead of _Pair

* Remove rev causing upset

* Remove fees stuff.

* Fix build (including tests)

* Update runtime, bump version

* Fix

* Handle gas refunds properly.

* Rename identifier

ala #2025

* Address grumbles

* New not-quite-linear-typing API

* Slimmer API

* More linear-type test fixes

* Fix tests

* Tidy

* Fix some grumbles

* Keep unchecked functions private

* Remove another less-than-safe currency function and ensure that
contracts module can never create cash.

* Address a few grumbles and fix tests
2019-03-20 14:07:28 +01:00
Arkadiy Paronyan f9e224e7b8 Account for pending insertions when pruning (#2047)
* Account for pending insertions when pruning

* Comments
2019-03-20 13:52:53 +01:00
Pierre Krieger 98a88a7d42 Start the handler init timer later (#2041) 2019-03-20 09:29:58 +01:00
Stanislav Tkach cd7d877cd4 Replace the incorrect 'commit' keyword with 'rev' (#2026) 2019-03-19 21:04:54 +01:00
Robert Habermeier e83a39fee3 remove aura inherent-checking compatibility shim (#2044) 2019-03-19 18:13:23 +01:00
thiolliere 3501746fa9 Fix lazy initialisation bug for parametizability (#2046)
remove lazy and compute prefix at compile time
2019-03-19 18:05:07 +01:00
André Silva fc16677e4d Fix grandpa aux schema migration (#2040)
* core: grandpa: fix aux schema migration

* core: grandpa: test aux schema migration
2019-03-19 12:13:49 +01:00
André Silva e56a5cd00b Minor gossip changes (#2038)
* core: gossip: don't expire messages based on time

* core: gossip: allow forcing resend of gossip messages

* core: grandpa: fix tests
2019-03-19 12:13:05 +01:00
Pierre Krieger 002143d0a2 Remove support for multiple network protocols (#2005)
* Remove support multiple network protocols

* Address concerns

* Add back debug_asserts
2019-03-19 11:56:56 +01:00
Roman Borschel 57387ef585 libp2p-0.5.0 (#1971)
* Update libp2p. Add support for ed25519 node (network) keys.

  * Update networking to the changes from https://github.com/libp2p/rust-libp2p/pull/972.
  * Add support for using ed25519 keys for libp2p networking.
  * Add support for reading libp2p secret keys from (external) files.

* Adapt to changes from https://github.com/libp2p/rust-libp2p/pull/992

* More tests.

* Cosmetics

* Deduplicate tests.

* Remove quickcheck from tests that don't use extra random inputs.

* Remove quickcheck.

* Swap new/default impls for NetworkConfiguration.

* Use libp2p-0.5.0 from crates.io.

* Post-rebase update.

* Remove unnecessary wildcard pattern.

* Combine two overlapping tests.
2019-03-19 11:16:25 +01:00
Marcio Diaz 648b11e118 Delegation voting (#1827)
* feat: add on-chain delegation voting

* fix: add recursion limit to delegated_votes

* fix: tests

* fix: count votes before limit exceeded
2019-03-18 18:33:36 +01:00
Bastian Köcher 530c12b4dc Expose keyring accounts in CLI (#2032)
* Expose keyring accounts in CLI

So, `--alice` will give you a node with `--key //Alice --name Alice`.

* Update readme
2019-03-18 18:15:18 +01:00
Shawn Tabrizi b513326ea7 Remove upgrade-key module from SRML (#2018)
* Remove upgrade-key from SRML. Update chain spec builder text

* bump spec_version, rebuild wasm

* Remove upgrade-key from SRML. Update chain spec builder text

* bump spec_version, rebuild wasm

* Rebase, Rebuild

* Rebuild wasm
2019-03-18 15:00:30 +01:00
thiolliere 96d1f841cb fix indexing event breakage (#2030)
* fix instance event indexing breakage

* fix infinite loop

* update runtime impl version, and builds

* Revert "Remove unnecessary restrictions in executive module (#2024)"

This reverts commit e9f17771b0.
2019-03-18 14:18:24 +01:00
郭光华 e9f17771b0 Remove unnecessary restrictions in executive module (#2024) 2019-03-18 10:06:31 +01:00
Gautam Dhameja 218536a825 updated link for example module in template (#2020) 2019-03-18 10:01:48 +01:00
Stanislav Tkach c3c7fdd052 Update environmental version (#2027) 2019-03-18 09:31:51 +01:00
Gav Wood 7bb1412d15 Fixes for new Schnorrkel API (#2015)
* Fixes for new Schnorrkel API

* Include specific commit hash for schnorrkel
2019-03-16 14:46:47 +01:00
thiolliere d743a8b71f Implement parameterisable modules (#1800)
* first implementation

* remove done comment

* origin done

* impl log for instance

* impl inherent for instance

* Fix wasm build + full example build

this requires parity codec implements codec for core::marker::PhantomData

* patch parity-codec link to github branch

* improve internal names and fix instance prefix

* Fix in macros

* add test modules for support

this allow to test for construct_runtime as well.

The reason to have put that in another crate is:
* if we put test in `tests/` dir of srml/support then decl_storage fails to get
  srml-support access because it believes it is inside srml-support
  crate and so derive access to `quote!{ crate }` but this is wrong
  (and I don't see any way to prevent that, and it only bother us so I
  don't think that matters that much)
* if we put test inside lib.rs then contruct_runtime cannot be used
  because it call some macros that are defined with macros
  (decl_outer_event and decl_outer_origin) and thus rustc complains.

* defaultinstance to its own struct to avoid errors

* enforce <T, I> for Event and Config, impl test

* add origin, log, inherent to test

* test more code generation

* basic storage test

* fix typo

* rename a few imports and field

* delete wip test in example and runtime

* change default prefix to make it backward compatible with test

* rename Instance to I and Instantiable to Instance

note: the name of generic parameter I is only enforce by decl_module!
and this could be rewritten

* doc

* clean old TODOs

* update parity-codec to 3.2

* update node impl version + builds

* fix warning

* fix unrelated grandpa test

* refactor code
2019-03-15 19:25:18 +01:00
Michael Müller c52c528ee8 Add grandpa telemetry (+ other minor improvements) (#1997)
* Support skipping the interactive purge prompt

Skip it via `cargo run -- purge-chain -y`.

* Fix typos

* Add Grandpa telemetry

* Address comments

* Revert unnecessary version bump

* Version bump to make CI run

* Remove unnecessary cast

* Do not bump version
2019-03-15 15:04:01 +01:00
Pierre Krieger 35a67b31e5 Add a 16MiB hard limit to Substrate packets (#2009) 2019-03-15 14:52:22 +01:00
Gav Wood 03d52fdbeb Crypto fixes/improvements (#2008)
* Crypto fixes:

- Use schnorrkel's HDKD derive
- Assume all key URIs beginning with `/` are prefixed with public
  root phrase.

* Remove commented code.

* Update README

* Update core/primitives/src/ed25519.rs

Co-Authored-By: gavofyork <github@gavwood.com>
2019-03-15 13:53:09 +01:00
Marcio Diaz ae1351cb79 chore: refactor test (#2007) 2019-03-15 13:12:36 +01:00
Bastian Köcher 32ae38c79d Build docs with nightly (#2006) 2019-03-15 12:34:53 +01:00
Gautam Dhameja 8dbba417a0 Documentation for the timestamp module (#1927)
* docs for timestamp module

* addressed review comments in timestamp module docs

* fixed typos

* uppercase readme file name

* merge with master

* fixed build failure

* removed md file

* updated as per the latest template

* updated docs

* updated docs

* addressed review comments

* addressed review comments
2019-03-15 11:48:38 +01:00
Marcio Diaz 23177ca8a4 Add exponential search for ancestor search (#1875)
* feat: add exponential search

* add tests

* chore: improve code
2019-03-15 11:15:08 +01:00
Bastian Köcher a57f6bbe6a Remove warning and make __PhantomItem unconstructable (#2000)
* Remove warning and make `__PhantomItem` unconstructable

* Switch to unreachable
2019-03-14 21:53:05 +01:00
Bastian Köcher 990d368f0d Prerequisites for validate_block in Cumulus (#1926)
* Adds benchmark for direct/indirect wasm function calls

* Store the benchmark function pointer in a `Cell`

* Add some documentation

* Make function implementations exchangeable

* Add parachain stub

* Add macro for registering the `validate_block` function

* Make all functions replace-able by unimplemented

* Some more refactoring

* Adds tests for executing empty parachain block

* Work on a new test with empty witness data

* Don't exchange `ext_print_*` stuff

* Some cleanup and one more function for `validate_block`

* More tests and more functions

* Fixes after merging master

* Use `parity-codec` `derive` feature

* CHange implementation of `wasm-nice-panic-message`

* Move `parachain` stuff to cumulus

* Updated wasm files

* Integrate feedback

* Switch to `ExchangeableFunction` struct

* More fixes

* Switch to Cell and panic on multiple replaces

* Increase `impl_version`

* Fix shifting

* Make the API more verbose of `ExchangeableFunction`

* Increase `impl_version`
2019-03-14 21:29:12 +01:00
thiolliere b92b2cc29b improve modules doc generation by support macros (#1975) 2019-03-14 16:35:52 +01:00
thiolliere e89d6e66fc fix grandpa test (#1996) 2019-03-14 13:50:38 +01:00
Marcio Diaz 534863d6d8 Import blocks with bad justification (#1977)
* init version

* chore: improve code

* fix test

* fix: log error resulting of bad justification

* fix: add test to check for disconnected peer
2019-03-14 12:24:29 +01:00
Kian Peymani b86c96ea31 Phragmén Validator Election (#1915)
* adds first draft phragmen with tuned tests and sr-primitives

* fix a few docs and code styles

* clean, organize and finish remaining test cases

* more and more tests

* update edge cases behavior and relavent tests

* fix global test issues

* updated wasm files

* all tests fixed

* cleanup

* fix some global issues

* fix global tests

* bump versions

* fix typo

* first step toward extracting phragmen

* Fix most of the grumbles.

* fix rest of the grumbles

* spaces to tabs

* update wasm

* Removed nightly feature.

* More tests

* Fix broken tests.

* Bump and update wasm.
2019-03-14 12:23:55 +01:00
Gav Wood d7fcf5dc9d Overhaul crypto (Schnorr/Ristretto, HDKD, BIP39) (#1795)
* Rijig to Ristretto

* Rebuild wasm

* adds compatibility test with the wasm module

* Add Ed25519-BIP39 support

* Bump subkey version

* Update CLI output

* New keys.

* Standard phrase/password/path keys.

* Subkey uses S-URI for secrets

* Move everything to use new HDKD crypto.

* Test fixes

* Ignore old test vector.

* fix the ^^ old test vector.

* Fix tests

* Test fixes

* Cleanups

* Fix broken key conversion logic in grandpa

CC @rphmeier

* Remove legacy Keyring usage

* Traitify `Pair`

* Replace Ed25519AuthorityId with ed25519::Public

* Expunge Ed25519AuthorityId type!

* Replace Sr25519AuthorityId with sr25519::Public

* Remove dodgy crypto type-punning conversions

* Fix some tests

* Avoid trait

* Deduplicate DeriveJunction string decode

* Remove cruft code

* Fix test

* Minor removals

* Build fix

* Subkey supports sign and verify

* Inspect works for public key URIs

* Remove more crypto type-punning

* Fix typo

* Fix tests
2019-03-13 14:08:31 +01:00