Commit Graph

928 Commits

Author SHA1 Message Date
Gav Wood 8a9ffeaea2 Add runtime so that cargo install works (#940) 2018-10-20 23:01:49 +02:00
Gav Wood 1475610880 Remove nonsense code and options, fix score and generally make subkey work (#936)
* Remove nonsense code and options, fix score and generally make subkey work.

* Rename Demo -> Node
2018-10-20 22:15:28 +02:00
Luke Schoen e47f3835fd fix: Fix typo in argument name (#935) 2018-10-20 12:43:20 +02:00
Gav Wood 583c24f017 Add Assets module (#925)
* Add Assets module

* Fixes

* Fix

* Update comments

* Support `GenesisConfig` without any fields

Fixes: #923

* Do not generate an empty `GenesisConfig`, instead generate no `GenesisConfig`
2018-10-20 12:43:00 +02:00
Bastian Köcher 7f6862ba5e Remove node-service (#933)
* Move `chain_spec` into `node-cli`

* Fixes tests

* Adds `construct_simple_service` and `construct_service_factory` macros

* Remove the `node-service` crate

* Add some documentation

* Fixes compilation on stable
2018-10-19 12:22:32 +02:00
Svyatoslav Nikolsky ca38fd72f6 Moved DigestItem impl to impl_outer_log (#932)
* moved DigestItem impl to impl_outer_log

* Enable backtrace collecting on the CI

* internal module is not required in impl_outer_log

* Revert "internal module is not required in impl_outer_log"

This reverts commit 5430446971cdf5fd5735863b86cd08a11d35d1dd.

* Revert "moved DigestItem impl to impl_outer_log"

This reverts commit 8872bbee963dbb4316251222f5c0757303fb3f52.

* Revert "Revert "moved DigestItem impl to impl_outer_log""

This reverts commit 47afd59682f8828665bd9cfb293b40ce4c4787af.

* Revert "Revert "internal module is not required in impl_outer_log""

This reverts commit 9ae640010c00ef134099d5b6a4430d330be134b2.

* More diagnostics

* check if only 1 test fails

* test is back + some "traces"

* removed some traces

* removed "traces"
2018-10-19 09:47:09 +02:00
Wei Tang 2604474880 Multiple storage root support (#902)
* Implement a non generic version of child delta trie

* Use delta_trie_root in state_machine

* Expand InMemory backend to support multi-storage

* Create Consolidate trait

* Fix all crate compile and remove unused OverlayedChanges::drain

* Implement child storage root support and overlay changes

* Add child storage reader

* Add child storage writer

* Implement child storage cleaning

* Fix light backend compile

* Add all required ext functions for wasm executor

* Add ext def to io

* Add all io functions

* Fix nostd compile

* Add simple test

* Remove unnecessary vec copy in child_storage_root_transaction

* Use values_mut/for_each to make it shorter

* Use extend to shorter a for loop

* Move record_all_keys to trie so it's easier to generic them later

* space -> tab

* Remove to_owned in debug format

* Clean out all to_owned

* Break debug_trace to multiple lines

* Remove 0..

* UserError copy/paste typo

* Replace Vec::from_raw_parts by slice::from_raw_parts

* Use iter::empty()

* Wrap some long lines

* Wrap a missing line

* Remove unnecessary map

https://github.com/paritytech/substrate/pull/856#discussion_r226222663

* Call ext_free after from_raw_parts

* Fix tests in other crates
2018-10-18 18:54:02 +02:00
Chevdor 849506daa5 Add docker file for Substrate (#930) 2018-10-18 18:36:43 +02:00
Bastian Köcher e321a645c9 Fixes tests on master (#929) 2018-10-18 13:36:54 +02:00
Bastian Köcher 4132a49fbb Move inherent implementation into the modules (#924)
* Adds new `ProvideInherent` trait

Also implements the new trait for `srml/consensus` and `srml/timestamp`.

* Adds `impl_outer_inherent!` macro

* Reexport macros from `alloc`

* Introduce `RuntimeString` and fix `ProvideInherent` on `no_std`

* Replace `VersionString` with `RuntimeString`

* Improvements for `impl_outer_inherent!`

* Make `construct_runtime!` support `impl_outer_inherent!`

* Fixes after rebase

* Whitespace
2018-10-18 10:55:52 +02:00
Tomasz Drwięga 36625faa9f Pool: parallel ready and runtime changes (#922)
* Revert "Revert runtime changes."

This reverts commit 01a7d1aa83c2918dd63b7dc54eb688d544cfc649.

* Parallel queue reads.

* Avoid recursion in best iterator.
2018-10-18 10:37:29 +02:00
snd 62c71a31ec Index blocks by number in the DB (#890)
* resolve #780

* in import tx insert after retracting so blocks don't disappear

* adapt db/cache to changes to db/utils

* db/light: remove old hash lookup insertion

* renames

* improve naming

* improve naming

* db/utils: improve docs for block lookup key stuff

* db/light/note_finalized: adapt to changes for issue #780

* db/light/cht/tests: add assertions for HASH_LOOKUP

* simplify

addresses
https://github.com/paritytech/substrate/pull/890#discussion_r226009746

* break long line

addresses
https://github.com/paritytech/substrate/pull/890#discussion_r226002211

* Whitespace
2018-10-18 10:37:13 +02:00
Sergey Pepyakin 89fd3a78d5 Contracts: COMPLEXITY.md (#905)
* Initial sketch.

* More work.

* Grammar.

* Fix.

* Fix grammar.
2018-10-17 17:47:55 +02:00
Tomasz Drwięga 0c7389e108 Pool: A bunch of tests and fixes (#914)
* Implement Ready/Future events.

* Trigger invalid notification.

* Clearing stale transactions test.

* Fix RPC test.
2018-10-17 16:25:30 +02:00
Svyatoslav Nikolsky 9886d12c26 Pruning changes tries (#856)
* changes trie pruning

* add comment

* do not prune changes tries on archive nodes
2018-10-17 10:08:45 +02:00
Gav Wood 8bc5242c92 Compact format for block number, nonce, balance (#910)
* Try to make everything compact

* Make `Clone` work

* Fix

* Move contracts and balances over to compact encoding

* Session and timestamp are compact

* Sataking uses compact numbers

* Treasury now compact

* Compact Democracy

* Council is compact

* Fix
2018-10-16 22:47:30 +02:00
Drew Stone 54a0f5b204 Drew.commentfix: There is no next_era function in staking. (#915)
* Change next_era to new_era in comments so there is no confusion

* Change next_era to new_era in comments so there is no confusion
2018-10-16 20:58:19 +02:00
Bastian Köcher 8de663f105 Adds check_inherents function to the BlockerBuilder API (#912)
* Adds new `check_inherents` function to the `BlockBuilder` API

* Switch to `check_inherents` in `node-consensus`

* Remove `CheckedBlock`, because it is not required anymore

* Fixes after rebase

* Fixes compilation on stable
2018-10-16 20:30:04 +02:00
Bastian Köcher 169cf91bb5 Updates ws dependency (#913) 2018-10-16 17:39:33 +01:00
Pierre Krieger 15fe5f7540 Remove the packet ID system (#900) 2018-10-16 12:57:42 +01:00
Benjamin Kampmann ac4bcf879f Generalize the Consensus Infrastructure (#883)
* Split out Consensus
* Supply ImportQueue through network-service
  - simplify ImportQueue.import_blocks
  - remove Deadlock on import_block
  - Adding Verifier-Trait
  - Implement import_queue provisioning in service; allow cli to import
* Allow to actually customize import queue
* Consensus Gossip: Cache Message hash per Topic
2018-10-16 13:40:33 +02:00
Tomasz Drwięga a24e61cb29 Longevity handling. (#903) 2018-10-16 09:04:19 +01:00
Pierre Krieger 8050979660 Rename min-peers and max-peers CLI options (#909) 2018-10-16 08:34:59 +01:00
Bastian Köcher 2301163b2d Fixes error in impl_apis! macro, caused by a missing comma (#908)
* Fixes error in `impl_apis!` macro, caused by a missing comma

* Adds another missing comma
2018-10-15 16:01:39 +02:00
Gav Wood f6f1d8dbc9 System should provide default Lookup impl (#906)
* System should provide default Lookup impl

* Use proxy struct as in balances
2018-10-14 21:58:38 +02:00
guanqun 26b105b472 fix the ignored tests in doc test (#898)
* fix ignored test

* move CI to --release per Gav
2018-10-13 15:16:17 +02:00
Maciej Hirsz 2be621af77 Silence Telemetry WS errors (#904) 2018-10-12 18:10:24 +02:00
Bastian Köcher db427cb45c Adds construct_simple_protocol macro for simplifying the creation of protocols (#897)
* Make `on_message` take the message as `&mut Option<_>`

* Make `ConsensusGossip` implement `Specialization`

* Move `new_session` into `ConsensusGossip`

* Adds `construct_simple_protocol` macro for simplifying the creation of protocols
2018-10-12 13:10:36 +02:00
Tomasz Drwięga 671b0e0007 Tagged transaction queue integration (#893)
* Make the graph generic.

* Adapting pool API for the graph.

* Merge pool & graph.

* Restructure.

* Fix test of transaction pool.

* Get rid of node/transaction-pool.

* Compilation fixes.

* Test7

* Fix compilation of tests.

* Revert runtime changes.

* Add validate_transaction to test-runtime.

* Fix RPC tests.

* Add clearing of the old transactions.

* Trigger pool events.

* Use new queue API.

* Fix wasm build, re-export Hasher.

* No warning if validate transaction fails.

* Get rid of Into<u64> and use As
2018-10-12 13:09:35 +02:00
Shawn Tabrizi 2404d3c89f Adding instructions specific for OS X (#899)
* Adding instructions specific for OS X

* fix link format

* fix link format

* adding mac libraries and how to start testnet

* adding bullets to make it more clear

* typo
2018-10-12 09:50:07 +02:00
guanqun 1a1300e845 remove unused nodecode in impl_stubs (#895) 2018-10-10 13:03:55 +02:00
Bastian Köcher 12f12bff28 Make all copyrights use the correct year (#894)
* Adds a script for automatically update all copyrights

* Ran the `update-copyright` script
2018-10-10 10:28:41 +02:00
Bastian Köcher 6b4b8b8f8e Runtime API clean up (#892)
* Rename `NewTxQueue` to `TaggedTransactionQueue`

* Remove `BlockBuilder` API and support adding documentation to the API functions

* Adds new `BlockBuilder` API

* Fixes compilation with new `BlockBuilder` API

* Some more cleanup

* Cargo.lock update

* Try to fix on stable
2018-10-09 14:01:23 +02:00
Bastian Köcher 2c65ad6c7b Refactor the runtime API to use traits. (#878)
* Add missing `As` imports.

* Adds new API traits that will be used by the client and runtime

* Switch consensus to new API's

* Switches transaction-pool to new API's

* Move runtime api stuff into its own crate

* Adds `impl_apis!` macro for implementing the new API traits

* Make `metadata` return directly a blob

* Runtime replace `impl_stubs!` with `impl_apis!`

* Switches to none feature based approach for declaring the different API traits

* Fixes compilation error

* Fixes errors

* Make the `decl_apis!` trait usable from the outside

* Make the `test-client` use the new API traits

* Remove last `impl_stubs!` bits and move some of them into wasm executor for tests

* A little bit more documentation
2018-10-09 10:58:29 +02:00
Svyatoslav Nikolsky fb058ae235 authorities_at cache update (#836)
* AuthoritiesAt cache update

* fix after merge
2018-10-09 10:54:57 +02:00
guanqun ceda61f13c fix the overflow issue (#891) 2018-10-09 10:50:08 +02:00
Pierre Krieger 0666759b16 Clean up the networking layer (#881) 2018-10-08 18:20:38 +02:00
Robert Habermeier 02f8897648 Fix grumbles from previous GRANDPA PR (#880)
* implement grandpa client

* consensus gossip with arbitrary topics

* defer GRANDPA messages until referenced blocks imported

* set up communication for voter in a transparent way

* instantiate GRANDPA voter

* keep last round state on disk

* switch back to crates.io finality-grandpa

* update cargo.lock

* use new `collect_garbage` API

* update sync test framework and make public

* test that observers can observe

* fix warning

* use more idiomatic predicate for collecting garbage in gossip

* kill spaces

* fix date

* fatal error when unable to complete

* rename run_voter to run_grandpa

* switch back to crates.io
2018-10-05 14:26:28 -04:00
Svyatoslav Nikolsky f851dcf41c Filter peers on light nodes (#862)
* do not send OnDemand request to node who, we believe, can't process it

* ignore peers with too old best block on light nodes

* non-weird temporary

* fix condition

* compilation
2018-10-05 13:51:28 -04:00
Sergey Pepyakin 36d71cb88d Add missing As imports. (#877) 2018-10-05 17:22:01 +02:00
Robert Habermeier 68b4be14ff Initial GRANDPA integration (#866)
* implement grandpa client

* consensus gossip with arbitrary topics

* defer GRANDPA messages until referenced blocks imported

* set up communication for voter in a transparent way

* instantiate GRANDPA voter

* keep last round state on disk

* switch back to crates.io finality-grandpa

* update cargo.lock

* use new `collect_garbage` API

* update sync test framework and make public

* test that observers can observe

* fix warning

* use more idiomatic predicate for collecting garbage in gossip

* kill spaces

* fix date
2018-10-05 16:30:39 +02:00
guanqun 1cc0e3b6ea Enhance decl storage (#777)
* enhance macro decl_storage()

* update the state root hash

* fix one comment
2018-10-05 14:20:32 +02:00
Svyatoslav Nikolsky 200a716a1a Extract search of digest item into Digest::log() function (#874)
* Digest::log fn

* change DigestItem::log impl
2018-10-05 14:17:00 +02:00
Svyatoslav Nikolsky 187c232629 Compare digests item-by-item (#869)
* compare digest item-by-item

* update comment
2018-10-05 14:16:22 +02:00
Maciej Hirsz 4d18c50e67 Version bump on sysinfo (#871) 2018-10-04 16:51:05 +02:00
Shawn Tabrizi e368b2d158 Updating Moment to support Mul/Div with BlockNumber (#868)
* Updating Moment to support Mul/Div with BlockNumber

Issue #261

* Fixed whitespace and commented code
2018-10-03 13:32:43 -04:00
Sergey Pepyakin 608f6ae5d9 Use transfer for sandboxed memory get/set (#863) 2018-10-03 13:26:38 +01:00
Sergey Pepyakin 9e476ba0ab Query dest balance only once + doc. (#861) 2018-10-03 13:25:14 +01:00
Sergey Pepyakin 270d0186c1 Refine sandbox errors (#860) 2018-10-03 13:23:50 +01:00
guanqun 35f3fe7e77 use the map! macro instead of defining it all over the place (#867)
* remove one map implementation in test

* remove one map macro

* remove one map macro

* remove one map macro
2018-10-03 13:22:58 +01:00