Commit Graph

1734 Commits

Author SHA1 Message Date
Robert Habermeier bb95e7d6a2 Initial version of the polite-grandpa networking protocol (#2110)
* Consensus status packet

* Allow for repropagation after status

* More generic gossip

* add a basic view struct and gossip module

* move gossip stuff to the gossip module

* integrate view into gossip

* some reshuffling

* alter rules for keeping one commit at a time in view

* Allow sending addressed messages

* don't cast outgoing votes if we know that we voted before

* Handle one hop messages

* initial run at polite grandpa

* build WASM

* handle neighbor messages

* refactor validator's internals into an Inner struct

* gossip only knows to keep or discard messages. optimize should_send_to

* Periodic rebroadcast

* implement `should_send_to` and message_expired

* track peers' best received commit height

* Pass peer id to topic steam

* kill rebroadcasting network

* Notify about existing peers

* clean up network APIs a bunch

* implement gossip::send_message for direct messages

* refactor network trait

* implement gossip::send_message for direct messages

* get all non set-change tests passing

* treat unknown rebroadcasts as broadcasts

* get all other main tests passing

* remove unimplemented test

* everything compiles

* treat unknown rebroadcasts as broadcasts

* Rebradcast interval

* Apply suggestions from code review

Style

Co-Authored-By: arkpar <arkady.paronyan@gmail.com>

* Style

* some module docs

* address some grumbles + docs

* allow rebroadcast every few minutes

* send_topic && generic context

* some tests for view change

* more grumbles & tests

* use send_peer
2019-04-02 18:09:05 +02:00
Kian Peymani b7eeb28de9 Fix Staking Accuracy issues. (#2180)
* Nasty patch for election

* cleanup

* a few more comments.

* minor fixes

* Improve comment
2019-04-02 17:57:56 +02:00
Robert Habermeier f0c21815b3 Aura: add a deprecated method for seal compatibility (#2176)
* aura API defaults to rejecting old seals

* build node-cli
2019-04-02 17:19:50 +02:00
Niklas Adolfsson 11da395553 style(on_demand): remove needless wildcards (#2171) 2019-04-02 16:54:02 +02:00
cheme 669e79181e no_std support for substrate trie (#2146)
* no_std trie compile in test_runtime (require to set nightly feature due
to the way hashbrown currently works).

* No nightly with hashmap_core.

* using crate elastic-array

* switch to publish trie crates

* fix default array decl

* bump impl_version for ci

* set all semver when possible wasm, and remove redundant code.

* Actually test use_trie function

* impl version +1

* Bump impl version
2019-04-02 12:49:04 +02:00
gabriel klawitter 728f0393c7 ci: remove ci for automated wasm rebuilds (#2168) 2019-04-02 12:19:52 +02:00
thiolliere 7e3b2d464a skip phantom for decl_event (#2158)
* use parity-codec-derive from parity-codec everywhere

* codec v3.2 -> v3.3

* skip phantom when deriving event

* fix decl_module call

* update impl version of node + builds
2019-04-02 12:04:23 +02:00
TriplEight 0f3363d681 new Dockerfile, new cache (#2122)
* new Dockerfile, new cache

* typo

* test build with cache

* Update .gitlab-ci.yml

Co-Authored-By: TriplEight <denis.pisarev@parity.io>

* Update .gitlab-ci.yml

Co-Authored-By: TriplEight <denis.pisarev@parity.io>

* Update .gitlab-ci.yml

Co-Authored-By: TriplEight <denis.pisarev@parity.io>

* cleanup

* done

* cosmetics

* removed unneded lines
2019-04-02 10:34:01 +02:00
Bastian Köcher 345145326b Implement support for renaming runtime api functions (#2160)
* Implement support for renaming runtime api functions

* Redelete the wasm files

* FIxes test

* Fix test correctly...

* Bring back old `authorities`

* Tag as deprecated

* Fixes compilation on WASM

* Add missing method implementations

* Fixes tests

* Increase `spec_version`
2019-04-02 10:05:35 +02:00
Pierre Krieger e89ce263bd Minor logging improvements in libp2p (#2162) 2019-04-02 09:38:44 +02:00
Robert Habermeier bbb45c76dc fix backwards compatibility for aura seals (#2164) 2019-04-01 17:52:44 -04:00
Wei Tang a8b5fe145f Remove an unnecessary clone in aura (#2163) 2019-04-01 23:35:48 +02:00
thiolliere a0e6d96de0 keep track storage bytes (#2154)
* refactor

* fix accountinfo creation + impl mem_stored

* add comment

* improve syntax

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

* rename current_mem_stored -> storage_size

* more explaination + more readable code

* bump impl version of node + builds

* delete builds
2019-04-01 19:14:55 +02:00
Gav Wood 3ed4309644 Remove another wasm file 2019-04-01 15:52:12 +02:00
Gav Wood b5cab356e0 Remove runtime. 2019-04-01 15:49:24 +02:00
Bastian Köcher 137409f02a Remove execute_extrinsics_without_checks as it will not be required (#2145)
This functionality was added by me for Cumulus, but after better
understanding Cumulus, this will not be required.
2019-04-01 15:37:58 +02:00
Gav Wood eca163ba64 Bump version to 1.0.0 globally (#2149)
* Bump versionb globally

* Rebuild and fix

* Rename fixes

* Rebuild

* Minor fix and code formatting for validator election

* Fix tests

* More test fixes

* Fix several bugs in phragmen elections.

* Rebuild, remove pointless closures
2019-04-01 15:16:06 +02:00
Stanislav Tkach fbbd79e778 Use [u8; 4] for well known cache keys (#2152)
* Use [u8; 4] for well known cache keys

* Use type alias
2019-03-31 19:56:49 -04:00
Pierre Krieger 3dfda381d5 Add support for mDNS (#2153)
* Use libp2p 0.6.0 instead of a custom branch

* Add support for mDNS

* Fix tests

* Nit
2019-03-31 19:47:15 -04:00
Pierre Krieger d4a4022dd1 Use libp2p 0.6.0 instead of a custom branch (#2150) 2019-03-30 20:53:20 +00:00
DemiMarie-parity 63c3dd5a45 Fix compile errors in test suite (#2151) 2019-03-29 21:30:28 +01:00
Amar Singh b1f9c31f21 Documentation for consensus module (#2043)
* first try

* resolve description of grandpa and add links to relevant docs

* Update srml/consensus/src/lib.rs

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

* Can do a relative link here

* Update srml/consensus/src/lib.rs

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

* Update srml/consensus/src/lib.rs

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

* Update srml/consensus/src/lib.rs

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

* formatting/style/semantics

* missed conflict

* style

* Update srml/consensus/src/lib.rs

* Update srml/consensus/src/lib.rs
2019-03-29 17:41:36 +01:00
Stanislav Tkach cbfc36b39f Move authorities interface from Core to consensus (#1412)
* Move authorities interface from Core to consensus

f

* notify all caches of block insert + create with up-to-date best_fin

* merged authorities_are_cached from light_grandpa_import2

* Add ProvideCache trait

* Create helper function for 'get_cache'

* Fix some formatting

* Bump impl version

* Resolve wasm conflicts

* Apply review comments

* Use try_for_each

* Move authorities interface from Core to consensus

f

* notify all caches of block insert + create with up-to-date best_fin

* merged authorities_are_cached from light_grandpa_import2

* Add ProvideCache trait

* Create helper function for 'get_cache'

* Fix some formatting

* Bump impl version

* Resolve wasm conflicts

* Apply review comments

* Use try_for_each

* Move authorities interface from Core to consensus

f

* notify all caches of block insert + create with up-to-date best_fin

* merged authorities_are_cached from light_grandpa_import2

* Add ProvideCache trait

* Create helper function for 'get_cache'

* Fix some formatting

* Bump impl version

* Resolve wasm conflicts

* Apply review comments

* Use try_for_each

* Increment impl_version

* Update lib.rs
2019-03-29 17:41:22 +01:00
Shawn Tabrizi 55788fdf77 Add documentation to the Sudo module (#2017)
* First draft of sudo module documentation

* add ignore tags to code blocks

* Suggested Updates

Still needs some more love with links

* Update lib.rs

* Add links to other modules

* Update lib.rs

* style

* missed parens
2019-03-29 17:05:34 +01:00
Kian Peymani 958cc7efea Extended Balance Type for Staking's Election (#2134)
* First draft of extended balance type

* Test cleanup.

* Update staking docs.

* Add a good failing test case for quintill

* Bring back saturating.

* Some final fixes

* A few more.

* Update wasm; Bump spec;

* Re-bump.

* Custom lossy conversion from currency to vote

* remove print

* Fix reverse conversion issue.

* void. Re-trigger ci.
2019-03-29 16:30:15 +01:00
Gav Wood 086d55397b Proxy voting (#2137)
* Proxy voting in democracy

* Proxy voting for council elections

* Bump and build

* Kill proxy when account dead

* Rebuild wasm

* Fix democraxy delegation locking

* Update srml/council/src/seats.rs

Co-Authored-By: gavofyork <github@gavwood.com>

* Update to use mutate
2019-03-29 16:07:04 +01:00
Gav Wood 5c9f306eb3 Use a context prefix for SS58 hash (#2141)
* Update to final ss58 spec

* Fix tests

* Rebuild
2019-03-29 15:44:57 +01:00
joe petrowski 0ddcbf747f Convert all UK spelling to US (#2138)
* all the ise

* forgot a misspelling

* a few more replacements

* bump impl

* rollback and fixes

* bump impl again

* Add aliases for RPC

* Update on_demand.rs
2019-03-29 14:11:45 +01:00
DemiMarie-parity a10e86ba5a Refactor DigestItem (#2108)
* Add `start_aura2`.

* .gitignore patch conflict files

and remove one that accidentally got committed

* Fix build

The tests still don’t work.

* Fix compilation errors

* Fix compile errors (again)

* Try (and fail) to fix tests

* Properly deserialize data

Previously, `DigestItem::Consensus` had no separate `DigestItemType`,
so it did not get properly serialized and deserialized.

* Add extra debug logging.  Always allow old seals.

A `RUST_LOG=substrate_aura_consensus cargo test --all -- --nocapture \
tests::authoring_blocks` revealed that old seals were being and
rejected, causing the test to hang.  As a temporary debug measure, allow
old seals unconditionally, so that CI can test if this fixes the
problem.

* Forcibly disable rejection of old seals

* Use old trait, but newer serialization

The old trait for `CompatibleDigestItem` actually worked.  By changing
its implementation, one can ensure that all *new* seals have the modern
form, but *legacy* seals are still decoded correctly.

* Bump impl version

* Squash spurious deprecation warning

`rustc` should not be emitting a deprecation warning in deprecated
code, but it does, so silence it.

* Rip out unused Cargo feature

* Move AURA to aura_primitives

* Respond to code review

* Wrap overly-long line

* Reduce logging verbosity and add target

* Add dependency on `sr-primitives` to `aura_primitives`

* Fix build

It failed with a message about Cargo.lock being out of date.

* core: aura: rename aura engine id const

* core: aura: remove superfluous logging

* core: primitives: add removed semicolons

* core: aura: remove unused import

* core: network: style fix

* runtime: update wasm blobs

* runtime: bump impl_version

* core: primitives: tag all DigestItemType variants explicitly
2019-03-29 12:15:23 +00:00
Nicole Zhu 665a0ac26a Documentation for Contract Module (#2045)
* Add: documentation for srml_contract, per @sergeis comments. TODO: make concise and add usage example

* Fix: minor spelling and grammar

* Add: Revisions to the doc clarification from @Sergei on trx revert behavior

* Edit: added spacing btw function list for better readability

* Remove: usage create contract example todo later

* Update srml/contract/src/lib.rs

Co-Authored-By: nczhu <nicolezhuis@gmail.com>

* Update srml/contract/src/lib.rs

Co-Authored-By: nczhu <nicolezhuis@gmail.com>

* Update srml/contract/src/lib.rs

Co-Authored-By: nczhu <nicolezhuis@gmail.com>

* Update srml/contract/src/lib.rs

Co-Authored-By: nczhu <nicolezhuis@gmail.com>

* Update srml/contract/src/lib.rs

Co-Authored-By: nczhu <nicolezhuis@gmail.com>

* Edit: explained max gas limit revert behavior in greater detail

* Edit: incorporated first round of PRs, mostly syntax/styling

* Edit: incorporated Sergeis mental model, terms, and added usage examples

* Fix: staking module is no longer closely related to contract. Balances now manages the reaping of accounts

* Minor cleanup of links/text that are not ready to be shown

* Update srml/contract/src/lib.rs

made more concise

Co-Authored-By: nczhu <nicole@parity.io>

* Update srml/contract/src/lib.rs

Co-Authored-By: nczhu <nicole@parity.io>

* Minor edits from PR

* Explained contract creation in more detail, fixed PR suggestions

* Linted according to contri guidelines

* Created a notable scenarios section, unlisted public functions in lieu of a direct link to the module

* Update srml/contract/src/lib.rs

Co-Authored-By: nczhu <nicole@parity.io>

* Update srml/contract/src/lib.rs

Co-Authored-By: nczhu <nicole@parity.io>

* Update srml/contract/src/lib.rs

Co-Authored-By: nczhu <nicole@parity.io>

* Update srml/contract/src/lib.rs

Co-Authored-By: nczhu <nicole@parity.io>

* Update srml/contract/src/lib.rs

Co-Authored-By: nczhu <nicole@parity.io>

* Update srml/contract/src/lib.rs

Co-Authored-By: nczhu <nicole@parity.io>

* Update srml/contract/src/lib.rs

Co-Authored-By: nczhu <nicole@parity.io>

* Update srml/contract/src/lib.rs

Co-Authored-By: nczhu <nicole@parity.io>

* Update srml/contract/src/tests.rs

Co-Authored-By: nczhu <nicole@parity.io>

* Update srml/contract/src/lib.rs

Co-Authored-By: nczhu <nicole@parity.io>

* Update srml/contract/src/lib.rs

Co-Authored-By: nczhu <nicole@parity.io>

* Update srml/contract/src/lib.rs

Co-Authored-By: nczhu <nicole@parity.io>

* Update srml/contract/src/lib.rs

Co-Authored-By: nczhu <nicole@parity.io>

* Update srml/contract/src/lib.rs

Co-Authored-By: nczhu <nicole@parity.io>

* minor commit after pr feedback

* s/codehash/code_hash for consistency
2019-03-29 12:22:04 +01:00
zak 700ef193bd fixed some typo (#2140)
* fixed some typo

* Update traits.rs
2019-03-29 09:36:21 +01:00
Xiliang Chen ea868b6e30 allow trailling comma in decl_event (#2117)
* allow trailling comma in decl_event

* Update srml/support/src/event.rs

Co-Authored-By: xlc <xlchen1291@gmail.com>

* Update srml/support/src/event.rs

Co-Authored-By: xlc <xlchen1291@gmail.com>

* Update srml/support/src/event.rs

Co-Authored-By: xlc <xlchen1291@gmail.com>

* Update srml/support/src/event.rs

Co-Authored-By: xlc <xlchen1291@gmail.com>

* Update srml/support/src/event.rs

Co-Authored-By: xlc <xlchen1291@gmail.com>

* bump version and update wasm
2019-03-29 08:19:35 +01:00
Tomasz Drwięga e22b491783 Fix a race conditon in the pool when transactions are imported during pruning. (#2136)
* Store recently pruned tags to avoid re-importing transactions.

* Update core/transaction-pool/graph/src/base_pool.rs

* Update core/transaction-pool/graph/src/base_pool.rs

* Update core/transaction-pool/graph/src/base_pool.rs

* Update base_pool.rs
2019-03-28 18:57:26 +01:00
Arkadiy Paronyan 7046e13de2 Use prefixed keys for trie node. (#2130)
* Account for pending insertions when pruning

* Prefixed trie storage

* Comments

* Prefixed trie storage

* Fixed tests

* Fixed tests

* Bumped runtime version

* Bumped runtime version again
2019-03-28 18:46:21 +01:00
thiolliere f9d0da0a18 storage doublemap in decl_storage (#1918)
* factorization

* introduce GenericUnhashedStorage

* implement generator and storage

* impl double map in storage macro

* improve StorageDoubleMapXX methods

* remove storage from example and impl test

* remove old comments

* wasm compatible

* improve imports

* rename storages

* update runtime impl version

* make code less verbose

* impl hash config for second key in double map

hash available are all of Hashable trait

* use double map in decl_storage for contract

* fix double map config issue

* add hasher into metadata

* update impl version and build wasm

* doc

* add attrs

* update metadata version

* update runtime version

* fix unused storage
2019-03-28 17:40:50 +01:00
Arkadiy Paronyan e3516d2bf4 Track peers in network-libp2p (#2135) 2019-03-28 17:21:53 +01:00
Gav Wood 3f348d0a18 Ensure timestamp config makes sense. (#2132)
* Timestamp period should be expressed as expected period

* Fix test

* Ensure value never illegal

* Rename

* Remove println

* Add default

* Comment

* Fix, bump and rebuild wasm

* Fix test

* Add TODOs

* Configure only minimum_period.

* Fix

* Update srml/timestamp/src/lib.rs

Co-Authored-By: gavofyork <github@gavwood.com>

* Update srml/timestamp/src/lib.rs

Co-Authored-By: gavofyork <github@gavwood.com>
2019-03-28 15:59:59 +01:00
Gautam Dhameja d6927c2f3e Documentation for system module (#1999)
* srml system docs

* updated docs

* fixed typo

* addressed initial review comments

* addressed review comments

* addressed review comments

* minor fixes in docs

* Various corrections, punctuation.

* updated docs

* minor edit

* fixed doc test

* Update srml/system/src/lib.rs
2019-03-28 15:09:44 +01:00
thiolliere 29001cb469 Decouple contract from balances (#2081)
* decouple contract from balance

* update impls and builds

* set fees in contract module

* builds
2019-03-28 13:46:30 +01:00
Tomasz Drwięga ff4523cbec Make some txpool logs a bit more compact (#1995)
* Improve logging for transaction pool.

* Change Debug in node-template runtime.

* Fix hexdisplay.

* Add some additional logging.

* Rebuild wasm
2019-03-27 23:36:18 +01:00
Gav Wood 039acb9518 Fix subtle indices bug (#2128)
* Fix subtle indices bug

* Also fix balances divide by zero.
2019-03-27 17:46:30 +01:00
Tomasz Drwięga 823abc2fc0 Use NativeWhenPossible for offchain worker. (#2126) 2019-03-27 16:49:53 +01:00
André Silva d17e34b3c8 core: network: reduce log level of peer drop messages (#2125) 2019-03-27 16:49:19 +01:00
Shawn Tabrizi 1c1609342c Introduce ReservableCurrency Trait in Balances Module (#2124)
* Introduce `ReservableCurrency`

* Update Docs for `ReservableCurrency`

* Update Tests

* Bump spec and rebuild wasm

* Extra: Add a note to `slash()`

Discussion in Riot clarified the behavior of `slash()` and `can_slash()`. Trying to sneak clarifying comments about it into this PR

* Update lib.rs

* Don't drop the periods!

CC @shawntabrizi
2019-03-27 16:48:37 +01:00
Shawn Tabrizi b32653d0a8 Update AccountId to use sr25519 in node-template (#2119) 2019-03-27 10:50:14 +01:00
joe petrowski 2ca08a95ba Documentation for balances module (#1943)
* comment updates

* added rustdoc and readme

* clarified LockableCurrency trait

* Currency trait rustdocs

* fixed typo

* fixed suggestions round 1

* UpdateBalanceOutcome docs (open for discussion)

* rm description of enum, consolidation, rm ReclaimRebate

* type clarification, examples overhaul, adoc formatting

* adoc to md

* format change for rustdoc

* update links and fix typos

* typos and links

* updates according to comments

* new example

* small clarifications

* trait implementation section

* missing ```

* small changes, ready for review

* line width update

* small tweaks

* Update srml/balances/src/lib.rs

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

* Update srml/balances/src/lib.rs

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

* Update srml/balances/src/lib.rs

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

* Update srml/balances/src/lib.rs

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

* Update lib.rs

* address review by thiolliere

* remove common warning

* Update docs

* updated srml example
2019-03-26 17:00:29 +01:00
thiolliere a2222279ca improve decl storage doc (#2059)
* improve decl storage doc

* nocompile doc

* fix doc

* typo

* Update srml/support/procedural/src/lib.rs
2019-03-26 15:01:46 +01:00
Pierre Krieger a9420424b2 Improvements to system_networkState (#2088) 2019-03-26 14:45:11 +01:00
Kian Peymani da124d74d1 Replace Overflow-Prone Operations in Staking with Saturating Arithmetic (#2115)
* Improve a few doc string

* Replace overflow-prone operation with saturating.

* Remove whitespace.

* Update wasm; Bump spec;

* Bump impl again.

* Fix review comments.
2019-03-26 14:39:14 +01:00
thiolliere 571d094313 improve docs (#2068)
* improve decl_storage instance doc

* use decl_event doc accordignly

* automate doc and while allow to extend it on event

* some missed ones

* Update srml/example/src/lib.rs

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

* Update srml/support/procedural/src/storage/transformation.rs
2019-03-26 14:35:57 +01:00