Commit Graph

1921 Commits

Author SHA1 Message Date
Niklas Adolfsson 549b4e9fb1 fix(compile warn): &mut Trait -> dyn &mut Trait (#2872) 2019-06-15 09:01:37 +02:00
Bastian Köcher db5722adc3 Make impl_opaque_keys more scope independent (#2873) 2019-06-15 07:41:46 +02:00
Stefanie Doll 2082e9468e fixed formatting (#2864) 2019-06-14 16:34:49 +02:00
Gavin Wood bda8641892 New sessions, kill consensus module (#2802)
* Draft of new sessions

* Reintroduce tuple impls

* Move staking module to new session API

* More work on staking and grandpa.

* Use iterator to avoid cloning and tuple macro

* Make runtime build again

* Polish the OpaqueKeys devex

* Move consensus logic into system & aura.

* Fix up system module

* Get build mostly going. Stuck at service.rs

* Building again

* Update srml/staking/src/lib.rs

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

* Refactoring out Consensus module, AuthorityIdOf, &c.

* Refactored out DigestItem::AuthoritiesChanged. Building.

* Remove tentative code

* Remove invalid comment

* Make Seal opaque and introduce nice methods for handling opaque items.

* Start to use proper digest for Aura authorities tracking.

* Fix up grandpa, remove system::Raw/Log

* Refactor Grandpa to use new logging infrastructure.

Also make authorityid/sessionkey static. Switch over to storing
authorities in a straight Vec.

* Building again

* Tidy up some AuthorityIds

* Expunge most of the rest of the AuthorityKey confusion.

Also, de-generify Babe and re-generify Aura.

* Remove cruft

* Untangle last of the `AuthorityId`s.

* Sort out finality_tracker

* Refactor median getting

* Apply suggestions from code review

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

* Session tests works

* Update core/sr-primitives/src/generic/digest.rs

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

* Session tests works

* Fix for staking from @dvc94ch

* log an error

* fix test runtime build

* Some test fixes

* Staking mock update to new session api.

* Fix build.

* Move OpaqueKeys to primitives.

* Use on_initialize instead of check_rotate_session.

* Update tests to new staking api.

* fixup mock

* Fix bond_extra_and_withdraw_unbonded_works.

* Fix bond_with_little_staked_value_bounded_by_slot_stake.

* Fix bond_with_no_staked_value.

* Fix change_controller_works.

* Fix less_than_needed_candidates_works.

* Fix multi_era_reward_should_work.

* Fix nominating_and_rewards_should_work.

* Fix nominators_also_get_slashed.

* Fix phragmen_large_scale_test.

* Fix phragmen_poc_works.

* Fix phragmen_score_should_be_accurate_on_large_stakes.

* Fix phragmen_should_not_overflow.

* Fix reward_destination_works.

* Fix rewards_should_work.

* Fix sessions_and_eras_should_work.

* Fix slot_stake_is_least_staked_validator.

* Fix too_many_unbond_calls_should_not_work.

* Fix wrong_vote_is_null.

* Fix runtime.

* Fix wasm runtime build.

* Update Cargo.lock

* Fix warnings.

* Fix grandpa tests.

* Fix test-runtime build.

* Fix template node build.

* Fix stuff.

* Update Cargo.lock to fix CI

* Re-add missing AuRa logs

Runtimes are required to know about every digest they receive ― they
panic otherwise.  This re-adds support for AuRa pre-runtime digests.

* Update core/consensus/babe/src/digest.rs

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

* Kill log trait and all that jazz.

* Refactor staking tests.

* Fix ci runtime wasm check.

* Line length 120.

* Make tests build again

* Remove trailing commas in function declarations

The `extern_functions!` macro doesn’t like them, perhaps due to a bug in
rustc.

* Fix type error

* Fix compilation errors

* Fix a test

* Another couple of fixes

* Fix another test

* More test fixes

* Another test fix

* Bump runtime.

* Wrap long line

* Fix build, remove redundant code.

* Issue to track TODO

* Leave the benchmark code alone.

* Fix missing `std::time::{Instant, Duration}`

* Indentation

* Aura ConsensusLog as enum
2019-06-14 16:34:34 +02:00
TriplEight 0f44a28ce3 Cargo check benches (#2862)
* add job
2019-06-14 12:58:09 +02:00
cheme e777038418 Add storage cache for child trie and notification internals (#2639)
* child cache, and test failing notifications

* fix tests and no listen child on top wildcard

* remove useless method

* bump impl version

* Update core/client/src/notifications.rs

Co-Authored-By: Tomasz Drwięga <tomusdrw@users.noreply.github.com>

* Update core/client/src/notifications.rs

Co-Authored-By: Tomasz Drwięga <tomusdrw@users.noreply.github.com>

* Update core/client/src/notifications.rs

Co-Authored-By: Tomasz Drwięga <tomusdrw@users.noreply.github.com>

* Update core/client/src/notifications.rs

Co-Authored-By: Tomasz Drwięga <tomusdrw@users.noreply.github.com>

* factoring notification methods to remove some redundant code.

* test child sub removal

* HStorage implementation and some type alias.

* Remove HStorage cache: does not fit

* fix removal

* Make cache use byte length (shared) instead of number of kv

* Make use of hashes cache in rpc

* applying ratio on different lru caches

* Fix format

* break a line

* Remove per element overhead of lru cache.

* typo
2019-06-14 11:25:20 +02:00
Michael Müller 5c3d1f82cd Various minor fixes (#2860)
* Make sr-api-macros benchmark work again

It broke with 4f888f34d3.

* Give better indication of import progress

* Only send consensus info when explicitly enabled

This is only necessary for validators and they can
explicitly enable it via

	--telemetry-url 'wss://telemetry.polkadot.io 1'

(or some other endpoint)

* Remove unnecessary mutable

* Fix style
2019-06-13 18:23:04 +02:00
Pierre Krieger 12bbc2ffd9 Merge network-libp2p into network (#2843)
* Move network-libp2p into network

* Merge libp2p_service into service

* Don't expose RegisteredProtocol in the API

* Extract DiscoveryBehaviour from Behaviour

* Restore libp2p tests

* Add a test for discovery

* Line width

* Remove bandwidth check

* Fix gitlab
2019-06-13 18:21:31 +02:00
Gavin Wood f4afdd2f0b Subkey supports 24-word phrases (#2827)
* Revamp crypto API and make seeds work better in subkey

* Final tweaks

* Update tests

* line spacing

* Avoid escapes in hex constants

* Fix build

* Another fix

* More fixes

* Minor nits
2019-06-13 11:06:30 +02:00
Pierre Krieger 68f4d11df3 Move the telemetry information to service (#2846)
* Move the telemetry information to service

* Proper exit
2019-06-12 21:32:52 +02:00
Pierre Krieger ce302390dd Refactoring: Remove ExtraVerification in the import queue (#2844)
* Remove ExtraVerification in the import queue

* Fix Babe

* Fix node-template
2019-06-12 14:56:31 +02:00
Kian Peymani 3496f11404 Per-transaction weight for srml (#2799)
* debug checkpoint.

* new

* Worked.

* Worked and weight propagated to executive.

* Works with some tests.

* Cleanup debug prints.

* More cleanup.

* Undo more logs.

* Undo a few more.

* Fix build.

* Allow len to be used in weight calculation.

* Remove noop function from dispath.

* Cleanup.

* Unify traits.

* Update docs and nits.

* line width

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

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

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

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

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

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

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

Co-Authored-By: Amar Singh <asinghchrony@protonmail.com>

* Update srml/example/src/lib.rs

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

* Final cleanup.

* Fix build.
2019-06-12 14:38:30 +02:00
Alexander Koz e53e9e9bda srml-assets: AssetID should be generic parameter (#2838)
* improved srml-assets: AssetId is generic type-parameter now.

* rem already imported Codec;
use primitives::One instead into-convertion.
2019-06-12 10:48:27 +02:00
lsaether f0f32f9250 Add weight annotations to Timestamp, Sudo, Democracy, Treasury, et al. (#2694)
* Add some initial weighting notes

* Add Democracy and Sudo

* Add flags, fix formatting

* Add comments on finality-tracker

* Add a few mode modules.

* Update srml/democracy/src/lib.rs

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

* Update srml/democracy/src/lib.rs

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

* Update srml/system/src/lib.rs

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

* Update srml/system/src/lib.rs

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

* Update srml/system/src/lib.rs

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

* Update srml/system/src/lib.rs

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

* Update srml/treasury/src/lib.rs

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

* Update and merge changes

* Update srml/system/src/lib.rs

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

* Remove unneeded comment

* Remove comment line

* Fix comment

* Fix formatting overall

* Apply suggestions from code review

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

* Apply suggestions from code review

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

* Clean up and polish

* Update srml/indices/src/lib.rs

* Update srml/staking/src/lib.rs

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

* Final nits.
2019-06-12 09:03:23 +02:00
Tomasz Drwięga 6feab51069 Remove compilation warnings. (#2835)
* Remove compilation warnings.

* Allow unused only not in tests.

* Remove unnecessary mut.

* Make CI happy.

* Revert "Make CI happy."

This reverts commit abb865fe4b9fe9af1ae3ec801da9d4305ea35765.
2019-06-11 22:42:28 +02:00
Tomasz Drwięga ad2d958248 Make test-client generic over runtime (#2824)
* Make test-client generic over runtime.

* Make sure genesis storage is constructed correctly.

* Use prelude in tests.

* Add an example of how to use test-client with node/runtime.

* Bump version.

* Rename test-clients.
2019-06-11 21:54:34 +02:00
kaichao cae324598f Make use of StorageHasher and HasherKind (#2836)
* Make use of StorageHasher and HasherKind.

* Use Storagehasher hasher function for key2 of double map.

* Refactor to reuse hasher from implementation.

* Bump up since there is srml changes.

* Update metadata version.
2019-06-11 21:34:10 +02:00
ddorgan c1654ecd23 Allow check-runtime to fail (#2845)
* Allow check-runtime to fail

* Do not allow the line-width to fail

* Allow failure on line-check
2019-06-11 17:26:13 +02:00
Lio李欧 66ae3a57ff Passthru build.sh/script.sh command line arguments (#2837) 2019-06-11 16:00:27 +02:00
TriplEight cf8a021e22 fix job (#2842) 2019-06-11 15:14:50 +02:00
TriplEight c24d278365 subkey build, cargo audit (#2752)
* subkey build, cargo audit

* some fixes

* cleanup

* review

* not to be launched on PRs

* not to be launched on PRs 2

* check-runtime should run on PRs only

* changed only to except, easier to read

* fix no jobs ran

* only: rewrites when it's last

* only: -branches wasn't needed

* benching subkey build

* benching subkey build 2

* subkey check

* not for 1.0

* cleanup
2019-06-11 10:29:17 +02:00
Pierre Krieger 925f8a1b04 Make it build for Android (#2833) 2019-06-10 18:09:14 +02:00
Robert Habermeier 67138b3103 polite-grandpa: Ensure only votes from a set's voters are propagated (#2720)
* make authorities available to gossip

* make local view optional until set

* address grumbles

* micro-optimize: encode without lock held
2019-06-09 11:38:41 +02:00
Pierre Krieger ac895023be More crate compiling for WASM-browser (#2825)
* More crate compiling for WASM-browser

* Update runtime Cargo.lock
2019-06-07 16:06:15 +02:00
Pierre Krieger 4d3396d095 Move modules around in network (#2822)
* Rename modules in protocol

* Line widths
2019-06-07 15:30:45 +02:00
thiolliere 693ea3cb42 Fix construct_runtime multiple log issue (#2816)
* Fix comma issue

* multiple log test
2019-06-07 15:27:55 +02:00
Kian Peymani d7ba5c00ba Enhanced Council. (#2407)
* first --unclean-- working version of locks and weight decay

* Refactor voter activity history.

* Tuning offset calculation and tests

* Remove print.

* Configurable decay ratio.

* Remove spaces.

* Name for activity.

* Fix some style

* Re-write voters as chunked map-vec.

* Adds panic todo.

* Fix some of the grumbles.

* Fix some of the grumbles.

* Chunked approvals vector.

* Introduce voter_index for set_approvas in favor of complexity.

* Add a bit more docs

* Add boolean approvals as scalar.

* Some cleanups TODO removes.

* enhance some error checking.

* No more double_map

* Combined voter info and fee.

* Fix global tests

* Bump.

* Fix line length

* Fix error message.

* Kill As<T>.

* Final fix.

* _Further_ kill As.

* Proper imbalance for fee.

* Bump.

* Fix spacing.

* Update

* Address grumbles.

* Line width.
2019-06-07 15:27:32 +02:00
Sergei Pepyakin 5a2282ce82 srml-contract: update complexity.md (#2795)
* Update COMPLEXITY.md

* Update the doc.

* Mention child tries. And format.

* most probably → most likely

* Update for state rent

* Apply suggestions from code review

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

* Update COMPLEXITY.md
2019-06-07 14:14:18 +02:00
DemiMarie-parity 418d4a0ce0 Add digest subtypes and update dependencies (#2734)
* Add different digest types for different parts of the code

* Add script to update dependencies

* Remove an old changelog

* `Inherent` → `PreRuntime`
2019-06-06 22:16:59 +02:00
Joshy Orndorff eac4ed412e Move Council and Democracy logic to block initialization (#2806)
* s/on_finalize/on_initialize

* bump impl_version
2019-06-06 22:16:24 +02:00
Pierre Krieger 57afa9b440 Rewrite telemetry using libp2p (#2812)
* Rewrite telemetry using libp2p

* Update the Cargo.lock files

* Apply suggestion
2019-06-06 22:15:38 +02:00
Pierre Krieger 6130ff3f46 Don't pass the Endpoint as message (#2814) 2019-06-06 22:12:55 +02:00
Pierre Krieger f210557211 Require --locked when building runtime (#2813)
* Require --locked when building runtime

* Update locks

* Do it in a different way

* Accidentally reverted Cargo.lock

* pass on arguments in build.sh scripts
2019-06-06 15:53:22 +02:00
Pierre Krieger e18dc6d53c Update to libp2p 0.9.1 (#2804) 2019-06-06 11:50:22 +02:00
Gavin Wood b8c9558419 Fix subkey (#2798)
* Fix ed25519 crypto

* Add test

* Remove unneeded import

* Remove unneeded type

* Remove unneeded clutter
2019-06-05 19:08:28 +02:00
Svyatoslav Nikolsky fc7548ce27 Light client integration tests (#2638)
* add light nodes to test_sync && test_consensus

* forbid light2light connections

* add light nodes to test_connectivity

* fixed light2light connection penalty

* post-merge fixes

* remove best_queued from Client info
2019-06-05 17:14:42 +02:00
Pierre Krieger 67bdfc7d8e Small slots refactor (#2780)
* Deprecate SlotWorker::on_start

* start_slot_worker no longer needs an Arc

* start_slot_worker now always succeeds

* Removed on_exit parameter from start_*_worker

* Minor doc

* Fix node-template
2019-06-05 10:31:20 -04:00
Benjamin Kampmann eaa0ab014a Move import lock onto backend (#2797)
* Drop import_lock from client, move it into backend, impl default version via static mutex

* still need to allow depcretion because of client.backend

* additional docs

* Remove default impl of get_import_lock, impl on instances

* Bump parking_lot to 0.8.0 accross the board
2019-06-05 15:46:01 +02:00
Bastian Köcher 4f888f34d3 Build LongestChain with TestClientBuilder (#2792)
* Switch to `TestClientBuilder` and support generating LongestChain

* Make sure test-client works without the wasm blob

* Use `TestClientBuilder` in more places
2019-06-05 13:45:18 +02:00
Gavin Wood 22a00a3353 Sensible scheduling for referenda (#2753)
* Nonlinear locking and cleanups

* Bump runtime version

* Minor cleanup

* Fix tests

* Fix council tests

* Fix flaw in turnout counting

* Initial work on referendum schedules

* Refactor council-democracy interface.

* Fix build

* Update srml/democracy/src/lib.rs

Co-Authored-By: Luke Schoen <ltfschoen@users.noreply.github.com>

* Update srml/democracy/src/lib.rs

Co-Authored-By: Luke Schoen <ltfschoen@users.noreply.github.com>

* Tests compile again

* Tests!

* Update todo

* Fix build

* Ensure votes arer not double-counted on member-transitions

* Extra logic for normal council changes

* Typo

* A few grumbles addressed.
2019-06-05 12:36:28 +02:00
Pierre Krieger 89b312fe9c Revert #2745 (#2791)
* Revert #2745

* Fix error in merge resolve

* Fix compilation
2019-06-05 11:56:36 +02:00
Kian Peymani a5964e4055 Some benchmarks for phragmen (#2650)
* Add some benchmarks for phragmen

* Fix dep. import.

* Clean up with some macros.

* more details.

* Fix dual import.

* Remove wrong assertions.

* Add a few more.
2019-06-05 11:42:29 +02:00
Svyatoslav Nikolsky 012ce5878b Restore integration tests (#2620)
* restored test_consensus

* restored test_sync

* run integration tests only on CI

* use single test-thread for integration tests

* post-merge fix

* panic when integration test runs for too long

* add some traces to integration logs

* manual wait -> timeout

* post-merge fix

* post-merge fix
2019-06-05 09:16:14 +02:00
Pierre Krieger 9ad9f7eebd Minor sync refactoring (#2767)
* Make maintain_sync private

* Remove sync::Context::peer_info

* Print errors if sync state mismatch

* Line width
2019-06-05 09:15:54 +02:00
Bastian Köcher 4d9efbc1d5 Remove deprecated authorities function (#2785)
* Remove deprecated authorities function

* Bump spec

* Fixes compilation

* Remove last piece
2019-06-04 22:28:18 +02:00
Pierre Krieger 9ae3082ef0 Update to libp2p 0.9 (#2783)
* Update to libp2p 0.9

* Fix browser-WASM
2019-06-04 20:11:17 +02:00
Bastian Köcher 6142f95611 Fix tons of warnings in newest nightly (#2784)
* Fix tons of warnings in newest nightly

* Fix sr-api-macro doc tests
2019-06-04 20:09:49 +02:00
Joshy Orndorff 9700029203 WIP: Treasury reference docs (#2557)
* Some initial re-organization.

* Text looking decent. No Example Yet.

* Clarify that using block rewards is jsut an example.

* Clarify the purpose of OnDilution.

* Update lib.rs
2019-06-04 18:48:50 +02:00
Tomasz Drwięga 6112f815b3 JSON-RPC client generation (#2778)
* Bump jsonrpc & generate clients.

* Initial version of JSON-RPC client.

* Re-wort

* Remove spurious `#[derive(Encode, Decode)]`

They did not compile, since `Encode` and `Decode` are deliberately not
implemented for `usize`.

Fixes #2742.

* Re-write rpc-client example.

* Update to jsonrpc=12.0.0

* Remove unnecessary import

* Bump version.

* Revert version bump.

* Bump again.
2019-06-04 18:43:55 +02:00
Pierre Krieger 5df89a8a6f Client::info() no longer returns a Result (#2776) 2019-06-04 16:09:46 +02:00