Commit Graph

1963 Commits

Author SHA1 Message Date
Stanislav Tkach 443ad90b47 Update codec version to the 4.1 version (#2948)
* Update codec version to the 4.1 version

* Bump impl_version

* Update lock files

* Update codec to 4.1.1 version

* Bump impl version
2019-06-26 16:26:24 +02:00
Jim Posen 4c52aec260 srml-contract: Fix Gas type to u64 (#2944)
* srml-contract: Move gas costs from Config to Schedule.

* srml-contract: Define Gas units fixed as u64.

This removes Gas as a configurable type on the contracts Trait.

* Bump node runtime spec/impl versions.
2019-06-26 14:17:45 +02:00
Pierre Krieger 554a790eaa Fix build (#2958) 2019-06-26 14:13:54 +02:00
Fedor Sakharov e735853ca3 Add DHT key-value behaviour (#2937)
* Add DHT key-value behaviour

* Apply suggestions from code review

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

* Apply suggestions from code review

Co-Authored-By: Pierre Krieger <pierre.krieger1708@gmail.com>

* Return which key failed to be inserted
2019-06-26 13:30:39 +02:00
Robert Habermeier 0ddf4a2a00 Generic authorship and uncle inclusion module (#2941)
* generalized uncle processing

* add some uncle tests

* set author and do event handling

* OnePerAuthorPerHeight no longer O(n^2) and test

* bump impl_version of node

* Documentation and style fixes

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

* fix #2949: index-based FindAuthor wrapper for srml-session

* use for_each_tuple
2019-06-26 12:24:58 +02:00
Bastian Köcher 050377d1c0 Do not run build.rs of node-template everytime we compile (#2955) 2019-06-26 10:24:40 +02:00
Pierre Krieger db71e0cc48 Expose the telemetry external transport in the config (#2939)
* Expose the telemetry external transport in the config

* Fix tests
2019-06-26 09:05:49 +02:00
thiolliere 8b89c7ae62 Update parity-scale codec minor version (#2951)
* update parity-scale codec minor version

* update to 3.5.3

* update locks

* increase impl version

* Update to 3.5.4

* Update WASM lockfiles
2019-06-26 08:48:12 +02:00
Sergei Pepyakin 183931a8a2 Allow spending all available gas. (#2947)
* Allow spending all gas.

* Bump node runtime version
2019-06-25 17:05:48 +02:00
Pierre Krieger 846941550d Update to libp2p 0.10 (#2945)
* Update to libp2p 0.10

* Bump zeroize in substrate-network
2019-06-25 15:56:25 +02:00
Andrew Jones 770b94c20c srml-contract: test calls not dispatched if tx fails (#2917)
* Test for not dispatching calls if top level execution fails

* Add comment to test

* Only dispatch calls if contract execution succeeded

Note that `calls` should be empty in this case, but this makes things
clearer

* Add comment to test

Co-Authored-By: Sergei Pepyakin <s.pepyakin@gmail.com>

* Revert: Only dispatch calls if contract execution succeeded
2019-06-24 17:38:49 +02:00
thiolliere cf7dbe8151 Staking module: approximate fraction into perbill to avoid overflow (#2889)
* approximate fraction into perbill

* test

* fix comment

* line width

* bump impl version

* rename test for better naming

* test overflow

* Apply suggestions from code review

Co-Authored-By: Niklas Adolfsson <niklasadolfsson1@gmail.com>
2019-06-24 13:23:54 +02:00
Pierre Krieger e919d03331 Add ProtocolBehaviour (#2922)
* Add ProtocolBehaviour

* Fix tests

* Line widths

* Address concerns

* Apply suggestions from code review

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

* Remove TODO
2019-06-24 13:22:03 +02:00
DemiMarie-parity 48aa32bece Relative slots (#2820)
* Initial work on relative slots for BABE

* More work

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

`Aura` → `Babe`

Co-Authored-By: Pierre Krieger <pierre.krieger1708@gmail.com>

* More work on relative slots

* Add missing field in test-runtime

* Bump `impl_version` and `authoring_version`

* Fix compile errors and warnings

* Upgrade dependencies

* Update dependencies more

* Revert some updates to dependencies

Somehow, those broke the build

* Fix compilation errors

* `Duration` → `u128` in calculations

* `slot_duration` is in milleseconds, not seconds

* Median algorithm: ignore blocks with slot_num < sl

* Fix silly compile error

* Store a duration, rather than an instant

It is more useful

* Fix compilation errors

* `INVERSE_NANO` → `NANOS_PER_SEC`

Also: `1000_000_000` → `1_000_000_000`

Suggested-by: Niklas Adolfsson <niklasadolfsson1@gmail.com>

* Un-bump `authoring_version`

* Disable median algorithm when `median_required_blocks` is 0

Otherwise it would panic.

* Apply suggestions from code review

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

* Simplify panic

* Fix build error

* Create `SignedDuration` struct

for signed `Duration` values.

Suggested-by: Bastian Köcher

* Refactor median algorithm into separate function

* Add issues for FIXMEs and respond to code review

* Fix minor warnings
2019-06-22 12:21:29 -04:00
Pierre Krieger 437a6bc6b1 Move the network status reporting to the service (#2916)
* Move the network status reporting to the service

* Fix tests

* Fix build
2019-06-21 17:13:11 -04:00
Pierre Krieger 01fcdc2b1a Add documentation at the root of substrate-network (#2902)
* Add documentation at the root of substrate-network

* Apply suggestions from code review

Co-Authored-By: Toralf Wittner <tw@dtex.org>

* Grmlblbl

* Adjustments

* Link to Yamux specs
2019-06-21 14:59:57 -04:00
Pierre Krieger f45cfb0d16 Use a background task instead of a thread for the import queue (#2909)
* Use a background task instead of a thread for the import queue

* Update Cargo.locks

* Comment
2019-06-21 09:46:26 -04:00
Jim Posen 1af51f4234 srml-contract: Use encode_to rather than encode to reduce allocations. (#2919) 2019-06-21 12:09:52 +02:00
Sergei Pepyakin 83d3881542 Ditch the input buffer (#2911)
* Pass input data via the scratch buffer.

Remove calls to ext_input_*.

* Fix tests and docs

* Bump the version.

* Remove ext_input_* from COMPLEXITY.md

* Return back the length check and add more comments

* Update the documentation of the scratch buffer.

* Fix a silly mistake.
2019-06-20 17:06:12 +02:00
Pierre Krieger 32a14ba2b8 The network is no longer an Option (#2920) 2019-06-20 16:03:50 +01:00
Pierre Krieger c4877bc05b Remove on_connect from TelemetryConfig (#2888) 2019-06-19 15:41:35 +02:00
Pierre Krieger 80a4cd2b0d Add support for noise (#2613) 2019-06-19 15:36:58 +02:00
Svyatoslav Nikolsky 5030097799 Do not return empty entries from state_queryStorage (#2906)
* do not return empty entries from state_queryStorage

* revert back None -> null change

* Revert "revert back None -> null change"

This reverts commit 318eb043e03b7aabbc3f176e02c15fd4595d16db.
2019-06-19 15:31:14 +02:00
Sergei Pepyakin 828485ec08 Rename: srml-contract → srml-contracts (#2905)
* srml-contract → srml-contracts

* Trim.

* Bump version
2019-06-19 15:26:33 +02:00
Bastian Köcher 37acb90847 Remove UserError and switch to error::Error (#2899)
* Remove `UserError` and switch to `error::Error`

* More cleanup

* Update core/executor/src/error.rs

Co-Authored-By: Sergei Pepyakin <s.pepyakin@gmail.com>

* Fix typo

* Update core/executor/src/allocator.rs

Co-Authored-By: Stanislav Tkach <stanislav.tkach@gmail.com>
2019-06-19 15:08:59 +02:00
Bastian Köcher 0d7cb00def Activate std feature of session in babe (#2907) 2019-06-19 15:07:40 +02:00
Pierre Krieger 7efc504d59 Import queue API revamp (#2856)
* ImportQueue methods are now mut

* Link methods are now mut

* Remove Arc from BasicSyncQueue

* Fix tests

* Remove BasicSyncQueue

* Change the import queue API

* Add buffered_link

* Remove obsolete tests

* Comments and style improvement pass

* Fix grandpa and comment cleanup

* Update core/consensus/common/src/import_queue.rs

Co-Authored-By: André Silva <andre.beat@gmail.com>
2019-06-18 21:50:48 -04:00
Pierre Krieger de6d541c74 Fix the failing networking tests (#2904) 2019-06-18 21:03:38 -04:00
Fredrik Harrysson 925a90f57f Add documentation to the main sync code (#2879)
* Added some documentation and question on the main sync code

* Remove strange formatting change

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

* Improve comment per suggestion

* Remove comment about re-using PeerInfo, no real reason and no real consensus if it's better or worse.

* Fix redundancy in comment

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

* Explaining more things and fixing review comments.

* Better explanation of MAJOR_SYNC_BLOCKS
* Explains the ancestor search strategy a bit
* Corrects explanation of what a stale block is
* Adds a bit of context for `request_ancestry` function

* Revert code change to not confuse the PR
2019-06-18 21:38:13 +01:00
thiolliere 72278748ab fix construct_runtime (#2898) 2019-06-18 17:06:37 +02:00
gabriel klawitter faabbb15c1 Ci publish rustdocs GitHub (#2895)
* ci: publish rustdocs to github repo substrate-developer-hub/rustdocs
2019-06-18 12:20:53 +02:00
Pierre Krieger 4a44a07fd0 Move libp2p tests to custom_proto (#2884) 2019-06-18 10:36:42 +02:00
Toralf Wittner dc41558b6e Change network::sync::extra_requests to not send. (#2890)
* Change network::sync::extra_requests to not send.

Instead it only maintains the invariants and leaves the actual I/O part
to the parent module (i.e. `sync`).

* Update Cargo.lock.
2019-06-18 10:35:28 +02:00
mattrutherford 7eb2ff760a Remove uses of Error::description() use Display instead (#2887)
* Remove all uses of Error::description() - use Display instead
2019-06-17 22:04:29 +01:00
André Silva 57f8e9ccb1 node: update flaming fir chainspec (#2891) 2019-06-17 18:31:24 +01:00
Bastian Köcher de90fd78b6 Re-expose system events (#2881) 2019-06-17 08:37:00 -04:00
Pierre Krieger f7bd56d2a8 Handle RPC requests in the substrate-service (#2866)
* Rework RPC queries

* Remove SyncProvider trait

* Fix RPC tests
2019-06-15 15:44:04 +02:00
Bastian Köcher c48aebe897 Expose srml-system in metadata as well (#2876) 2019-06-15 15:07:08 +02:00
Wei Tang de4ab0653f Add assumptions that must be held in assets module (#2867)
* Add assumptions that must be held in assets module

* Update srml/assets/src/lib.rs

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

* Update srml/assets/src/lib.rs

Co-Authored-By: DemiMarie-parity <48690212+DemiMarie-parity@users.noreply.github.com>
2019-06-15 10:30:36 +02:00
Bastian Köcher e09045bde2 Fix several warnings and remove some forbid(warnings) (#2874) 2019-06-15 10:30:04 +02:00
Gavin Wood ecf25c9289 Disable validators but don't kick them (#2870)
* Disable validators but don't kick them

* Bump runtime

* Remove stray printlns
2019-06-15 10:29:34 +02:00
Wei Tang ad0011a1bd Maintain TotalIssurance integrity in case of sudo set_balance (#2871)
* Maintain TotalInsurance integrity in case of sudo set_balance

* Fix set_balance docs

* Update impl_version
2019-06-15 10:26:22 +02:00
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