Commit Graph

1486 Commits

Author SHA1 Message Date
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
Bastian Köcher 17f093da13 Make use of assimilate_storage for GenesisConfig (#1982)
* Make use of `assimilate_storage` for `GenesisConfig`

Fixes incorrect initialization of the staking gensis storage.

* Add some documentation
2019-03-13 12:59:07 +01:00
Pierre Krieger e91426ac77 Add a warning when banning or dropping reserved peers (#1976) 2019-03-12 15:43:22 +01:00
Bastian Köcher 71c0d4d968 More documentation improvements (#1972)
* Bring back public calls in `Module` documentation
* Forward storage item documentation to storage structs
2019-03-12 13:58:15 +01:00
郭光华 3149136367 Fix telemetry panic error in node-template (#1958) 2019-03-12 13:19:42 +01:00
Pierre Krieger ead437d0f4 Remove dialing without a PeerId 2019-03-12 11:47:08 +01:00
Gregory Terzian 90cd8a8479 Add network state to system.interval telemetry (#1959)
* add network state to system.interval telemetry

* use serde_json

* use unwrap_or_default
2019-03-12 10:17:29 +01:00
Bastian Köcher 0ea90111b4 Cleanup rustdoc (#1965)
* Hide `__GetByteStruct*` types in the docs

* Forward documentation to `GenesisConfig`

* Hide `PhantomItem` in docs for `Call`

* Hide public calls in `Module`

* Forward documenation for storage functions

* Hide auxiliary functions in documentation
2019-03-11 21:49:37 +01:00
Pierre Krieger a3a5031d9d Add timeouts for initialization and opening (#1948)
* Add timeouts for initialization and opening

* Don't keep alive opening and init

* Reset deadline when timer error
2019-03-11 12:09:03 +01:00
thiolliere ffd803c3d8 remove unecessary 2015 imports (#1961) 2019-03-11 12:02:06 +01:00
Pierre Krieger 0a300b061e Remove the error from network-libp2p (#1950) 2019-03-11 11:40:22 +01:00
Pierre Krieger 560057ebfd Update rw-stream-sink (#1954) 2019-03-10 19:36:11 +01:00
Pierre Krieger 97fd1831e9 Fix old connections not being reused (#1934)
* Fix old connections not being reused

* Address issues
2019-03-07 22:15:40 +01:00
Luke Schoen a4168f2515 docs: Update Readme with example of how to run tests only for a single package (#1946) 2019-03-07 22:13:49 +01:00
Arkadiy Paronyan 8d290f6110 Don't mark peers sending expired messages as useless (#1944) 2019-03-07 22:12:57 +01:00
Gav Wood 9f3b4468db Make subkey support Sr25519 crypto (#1933)
* Make subkey support Sr25519 crypto.

* Rebuild runtime.

* Build and rejig locks.

* Fix grumbles

* Derivations

* Introduce tests
2019-03-07 17:10:17 +01:00
Tomasz Drwięga 9ad06d57fc Extract specific transaction pool errors. (#1930)
* Extract specific transaction pool errors.

* Convert error codes to constants.
2019-03-07 10:53:53 +01:00
Bastian Köcher 7927054f86 Update copyrights to 2019 (#1932) 2019-03-06 15:04:28 +01:00
郭光华 b5f6a77d3b Delete unused import in finaly-tracker module (#1931)
* Delete unused import in finaly-tracker module

* Fix test build error

* Revert spec_version

* Rebuild wasm
2019-03-06 13:16:12 +01:00
Gav Wood ccc11974ee Aggregate all liquidity restrictions in a single place (#1921)
* Clean up session key rotation

* Fix build

* Bump version

* Introduce feature to balances.

* Move staking locking logic over to central point

* ^^^ rest

* First part of assimilation

* More assimilation

* More assimilation

* Fix most tests

* Fix build

* Move Balances to new locking system

* :q!

* Bump runtime version

* Build runtime

* Convenience function

* Test fix.

* Whitespace

* Improve type legibility.

* Fix comment.

* More tests.

* More tests.

* Bump version

* Caps

* Whitespace

* Whitespace

* Remove unneeded function.
2019-03-06 12:46:17 +01:00
renlulu 46541ec73c fix typo (#1928) 2019-03-06 08:39:49 +01:00
Pierre Krieger bcda2fafa0 Add even more diagnostic messages (#1925)
* Add even more diagnostic messages

* Fix
2019-03-05 22:44:55 +01:00
Robert Habermeier dfb48a2405 Offline fallback for GRANDPA (#1619)
Co-authored-by: André Silva <andre.beat@gmail.com>

* skeleton for finality tracker

* dispatch events when nothing finalized for a long time

* begin integrating finality tracker into grandpa

* add delay field to pending change

* add has_api_with function to sr_version for querying APIs

* partially integrate new force changes into grandpa

* implement forced changes

* get srml-grandpa compiling

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

Co-Authored-By: rphmeier <rphmeier@gmail.com>

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

Co-Authored-By: rphmeier <rphmeier@gmail.com>

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

Co-Authored-By: rphmeier <rphmeier@gmail.com>

* remove explicit dependence on CoreApi

* increase node runtime version

* integrate grandpa forced changes into node runtime

* add some tests to finality-tracker

* integrate finality tracking into node-runtime

* test forced-change logic

* test forced changes in the authority-set handler

* kill some unneeded bounds in client

* test forced-changes in finality-grandpa and fix logic

* build wasm and finality-tracker is no-std

* restart voter on forced change

* allow returning custom error type from lock_import_and_run

* extract out most DB logic to aux_schema and use atomic client ops

* unify authority set writing

* implement set pausing

* bump runtime version

* note on DB when we pause.

* core: grandpa: integrate forced changes with multiple pending standard changes

* core: grandpa: fix AuthoritySet tests

* runtime: bump impl_version

* core: clear pending justification requests after forced change import

* srml: finality-tracker: use FinalizedInherentData

* core: log requests for clearing justification requests

* core, node: update runtimes

* core: grandpa: fix tests

* core: grandpa: remove todos and add comments

* core: grandpa: use has_api_with from ApiExt

* core: fix tests

* core: grandpa: remove unnecessary mut modifier

* core: replace PostImportActions bitflags with struct

* core: grandpa: restrict genesis on forced authority set change

* core: grandpa: add more docs

* core: grandpa: prevent safety violations in Environment::finalize_block

* core: grandpa: register finality tracker inherent data provider

* core: grandpa: fix tests

* node: update runtime blobs

* core: grandpa: remove outdated todo

* core: aura: fix typo in log message

* core: grandpa: check re-finalization is on canonical chain

* srml: finality-tracker: fix initialization

* node: update runtime wasm

* srml: finality-tracker: don't re-initialize config keys
2019-03-05 15:41:35 +00:00
Hero Bird 128d164f2b Make use of parity-codec "derive" crate feature (#1919)
* Make use of parity-codec "derive" crate feature

* Bump impl_version

* Update wasm files and Cargo.lock files

* Transferred to parity_codec derive feature for the rest of the crates

* Update wasm binaries and lock files

* Update core and node wasm binaries
2019-03-05 09:00:37 +01:00
Gav Wood 755b53bd05 Clean up session key rotation (#1911)
* Clean up session key rotation

* Fix build

* Bump version
2019-03-04 18:03:44 +01:00
thiolliere b599556e21 remove unused code (#1920) 2019-03-04 17:10:31 +01:00
Michael Müller c485eb8fdc Get rid of wildcard imports (#1916)
* Get rid of wildcard imports

* Update core/service/src/lib.rs

Co-Authored-By: cmichi <mich@elmueller.net>

* Update core/client/src/client.rs

Co-Authored-By: cmichi <mich@elmueller.net>

* Import by namespace
2019-03-04 14:00:46 +01:00
thiolliere 66bc864f29 improve storage build type checking (#1914)
* force build closure in decl_storage! to return explicit type
* fix when type was different

Note: it breaks API but it is easy to upgrade: just do the conversion from encode type to the final type yourself in the build closure:

```rust
Encode::using_encoded(&value, |mut value| Decode::decode(&mut v)).unwrap();
```
2019-03-04 10:49:56 +01:00
Gregory Terzian a81f7f48a0 Refactor Sync status updates into a stream of updates (#1858)
* refactor sync provider

* relative use of interval

* typo

* set propagate timeout to 2500ms

* address comments

* fix instant calc

* update intervals
2019-03-02 14:35:16 +01:00
Gav Wood 828cd9580a Stash/controller model for staking (#1782)
* First steps to stash/controller separation

* More drafting

* More drafting

* Finish draft.

* Optimisation

* Remove accidental commit

* Make it build.

* Fix linked map for traits.

* Fix Option<_> variant.

*  Improve naming a tad

* Rebuild runtime

* Builds!

* First test.

* Bump RT version

* Minor fix

* Update Mock

* adds the correct reward testcase (+staking eras which was already ok)

* fixes the basic staking testcase to work properly (along with a small fix in the module)

* New logic to avoid controller transferring stash.

* Fix some build issues.

* adding some comments to tests

* Fix impls.

* adds a few more lines to explain the test case

* More fixes.

* gets the basic test up and running again

* Fix rest of build

* Rebuild wasm

* Fix docs.

* fix staking test with new chnages

* updating some tests, pending questions

* More working tests

* adds double staking test

* Docs

* remove invalid slashing test

* Payee stuff.

* Fix build

* Docs

* Fix test

* Fix a couple of tests

* Layout plan for finishing tests before Pragmen

* Add some working tests

* re-build staking and reward tests

* Add more tests

* fix offline grace test

* Nominator should have payee checked for cleanup

* adds more nomination tets

* adds validator prefs tests

* Fix and clean up some TODOs

* Fix a couple of issues

* Fix tests

* noting warnings from tests

* final fix of local tests

* Fix slot_stake bug

* Half baked test

* Add logic to limit `unstake_threshold` set in storage

* Make sure to check before writing!

Almost forgot this one

* Move a couple of comments

* fix last broken slot_stake test

* Ignore broken test
2019-03-02 14:31:48 +01:00
Pierre Krieger ff331e7fdc Bump libp2p to 0.4.2 (#1891)
* Bump libp2p to 0.4.2

* Update yamux
2019-03-01 19:12:50 +01:00