Commit Graph

876 Commits

Author SHA1 Message Date
Tomasz Drwięga ec8dda0dd4 Return correct hash for finalised transactions. (#858) 2018-10-01 17:49:48 +01:00
Tomasz Drwięga e8d88fcb7b Global unique subscription ids. (#848)
* Global unique subscription ids.

* Fix tests.
2018-10-01 16:31:52 +01:00
Arkadiy Paronyan 04cf0072ba Auxiliary data storage in client backend (#849)
* Auxiliary data storage in client backend

* Runtime error handling
2018-10-01 00:10:45 +01:00
Arkadiy Paronyan 2e728005c9 Fixed transaction propagation (#854) 2018-09-30 19:41:18 +01:00
Gav Wood da2469b82a New BBQ Birch spec (#853)
* Update BBQ Birch def

* Fix
2018-09-30 18:25:27 +01:00
Sergey Pepyakin 2414ffdac0 Fix sandbox::Memory lifecycle + sandox get memory function for no_std env (#845)
* Fix `sandbox::Memory` lifecycle for no_std env

* Retain memories in env_def builder and instance

* Add scoped memory creation to test RC semantics

* Add deploying_wasm_contract_should_work test.

* Fix sandboxed memory set function.
2018-09-30 17:23:32 +01:00
Arkadiy Paronyan a5a7dd2480 Fixed transaction propagation (#850) 2018-09-30 16:48:41 +01:00
Sergey Pepyakin cad28aa283 metadata returns Bytes (#846) 2018-09-30 13:16:31 +01:00
Sergey Pepyakin 68b6fd1ebd Remove #![feature(panic_handler)] (#844) 2018-09-29 18:56:20 +01:00
Sergey Pepyakin f4eb08dae5 Take and return the result in bytes (#842) 2018-09-29 18:56:00 +01:00
Sergey Pepyakin 6d8bea5137 Extract vanity, add restore (#843) 2018-09-29 18:51:52 +01:00
Arkadiy Paronyan d4dbc306e8 Fixed consensus message garbage collection & DB initialization (#841)
* Consensus cleanup

* Fixed DB initialization issue

* Spacing
2018-09-29 16:53:47 +02:00
Arkadiy Paronyan e1e6c19f64 Limit gossip for non-authorities (#838)
* Limit gossip for non-authorities

* Random shuffle
2018-09-29 13:08:22 +01:00
Pierre Krieger 79d538ee66 Clean up the "custom protocol" code (#832)
* No longer use a channel for custom protocols

* Fix warnings

* Add graceful shutdown and comments

* Minor cleanups

* Add warning if queue goes over threshold

* Increase threshold

* Address grumble
2018-09-29 12:01:23 +01:00
Svyatoslav Nikolsky c54350661d Fetching changes proof from remote nodes (#769)
* changes_trie

* changs_trie: continue

* changes_trie: adding tests

* fixed TODO

* removed obsolete ExtrinsicChanges

* encodable ChangesTrieConfiguration

* removed polkadot fle

* fixed grumbles

* ext_storage_changes_root returns u32

* moved changes trie root to digest

* removed commented code

* read storage values from native code

* fixed grumbles

* fixed grumbles

* missing comma

* key changes proof generation + query

* fix grumbles

* check that changes trie config is not changed by block.finalize()

* fixed changes trie config check
2018-09-29 09:47:29 +01:00
Bastian Köcher fdfd4672c1 Remove serde_json stuff from the metadata RPC (#833)
The metadata call does not work anymore with JSON and just returns an
opaque blob.
2018-09-29 09:37:06 +01:00
guanqun bec80177c0 fix a warning (#839) 2018-09-29 09:34:53 +01:00
Arkadiy Paronyan 9a660f82ed Integration tests (#805)
* Started substrate tests

* Sync test

* Test updates

* Improved tests

* Use on-chain block delay

* Parallel test execution

* Otimized tests

* Logging

* Fixed racing test

* Fixed compilation

* Fixed timestamp test

* Removed rlp dependency

* Minor fixes

* Fixed tests

* Removed best_block_id and resolved fdlimit issue

* Whitespace

* Use keyring

* Style

* Added API execution setting

* Removed stale import
2018-09-28 10:37:55 +01:00
Sergey Pepyakin 955a5393d8 Load code from the overlay not from the database (#828) 2018-09-27 20:56:15 +01:00
Sergey Pepyakin 6af61b8649 Add test that ensures drain funds to death works (#829) 2018-09-27 20:55:45 +01:00
snd 41a6f54c4a pass correct header column to read_meta again (#827)
* pass correct header column to read_meta again

fixes #826

* make COLUMN_META exist in a single place

* pass COLUMN_META as arg for more consistency with other db utils

* remove unused import
2018-09-27 20:43:18 +01:00
Sergey Pepyakin 0d284c0195 Fix transfer overflow exploit. (#824) 2018-09-27 19:13:14 +01:00
Gav Wood acc83202bc SS58 addresses in BFT (#823)
* SS58 addresses in BFT

Closes #590

* Fix wasm compile
2018-09-27 17:53:57 +01:00
Bastian Köcher 2332d6dd04 More dependency cleanup (#825)
* Removes `rlp` dependency

* Enable warnings about unused crates in the CI

* Remove all the unused crates

* Make tests working again
2018-09-27 17:52:51 +01:00
Sergey Pepyakin bf0d009d65 Refactor. (#822) 2018-09-27 17:47:54 +01:00
Gav 65b9e11cd8 Renaming 2018-09-27 16:25:53 +01:00
Robert Habermeier a3285e43f6 ensure meta is actually in the right column and sanity check on iterator (#820) 2018-09-27 16:05:24 +01:00
Gav Wood e5b48030b5 Fix newline. (#821) 2018-09-27 15:31:44 +01:00
Gav Wood 851c7f42df Fix block generation by updating codec versions in wasm (#810)
* Fixes for staging testnet

* Fix codec versioning

* Comment unneeded trace

* Update lib.rs

* Update parity-codec

* Add script to update wasm deps and update them.

* Update hashes

* Add BBQ Birch testnet

* it's default-features, apparently.

* Use simpler version spec for parity codec

* Typo
2018-09-27 14:38:56 +01:00
Arkadiy Paronyan 29c9719568 Support authoring for multiple runtime versions (#816) 2018-09-27 13:56:40 +01:00
Bastian Köcher 5eb1aefde6 Updates dependencies and tries to consolidate multiple version (#815) 2018-09-27 13:50:15 +01:00
Arkadiy Paronyan 0ab3b2de35 Protocol ID configurable in the chain spec (#811)
* Protocol ID configurable in the chain spec

* Removed obsolete const
2018-09-27 12:26:07 +01:00
Bastian Köcher 37102611d4 Remove ethereum-types as direct dependency (#812) 2018-09-27 12:35:05 +02:00
Arkadiy Paronyan a50e184402 Fixed spec to json serialization (#809)
* Fixed spec to json serialization

* Fixed tests
2018-09-27 10:22:45 +01:00
guanqun d46f2b9c76 cli: add --dev to all subcommands (#807) 2018-09-27 10:22:09 +01:00
Pierre Krieger dea800586f Remove accidentally-added .cargo/config (#806) 2018-09-26 17:59:23 +01:00
Bastian Köcher 718ba4e159 Remove node-api (#804)
* Remove `node-api` from `node-consensus` and `node-transaction-pool`

* Remove the `node-api` crate and its last usages

* Remove left over file

* Fixes compilation errors

* Switch to `As` trait

* Rename trait

* Whitespace
2018-09-26 17:57:30 +01:00
snd 58cc0992df best_containing operations (issue 603) (#740)
* add stub for Client.best_chain_containing_block_hash

* add fn blockchain::Backend::leaf_hashes

* fix typo

* sketch out Client.best_chain_containing_block_hash

* fix indent

* Blockchain.leaf_hashes -> Blockchain.leaves

* add unimplemented! stub impls for Blockchain.leaves

* start impl of Blockchain.leaves for in-memory client db

* Client.best_chain_containing...: check canonical first and make compile

* first rough attempt at maintaining leaf list in in-memory db

* fix tab indent

* add test best_chain_containing_single_block

* add failing test best_chain_containing_with_fork

* pub use client::blockchain; in test-client to prevent circular dep in client tests

* best_chain_containing_with_single_block: improve and test leaves

* far improve in-memory Backend::leaves impl

* test blockchain::Backend::leaves more thoroughly

* handle more edge cases in blockchain::Backend::leaves impl for in memory

* fix test best_chain_containing_with_fork (two distinct test blocks had same hash)

* make best_chain_containing_block_hash pass existing tests

* improve docstring for Blockchain::leaves

* Client.best_chain_containing: some cleanup. support max_block_number

* best_chain_containing: remove broken outcommented fast check for best = canonical

* remove blank line

* best_block_containing: return None if target_hash not found

* best_chain_containing: add unreachable! at end of function

* improve tests for best_chain_containing

* renames

* more elaborate test scenario for best_containing

* best_containing: fix restriction of search through maybe_max_number

* best_containing: tests for restriction of search

* get rid of unnecessary clones

* replace Client::new_in_mem by new_with_backend which is useful for testing backends

* add test_client::new_with_backend for testing different backend impls

* add test for in_mem::Backend::leaves

* remove unused imports

* in_mem test_leaves: simplify

* flesh out tests for in_mem leaves impl

* remove tests for leaves from client which are now covered in implementing module

* improve comment

* add Client.new_in_mem again

* unwrap in test_client::new_with_backend

* make test_client::BlockBuilderExt work not just with in-mem backend

* make test client ext not just work with in mem backend

* add failing Backend.leaves test for client-db

* update Cargo.lock

* replace KeccakHasher with Blake2Hasher

* refactor

address grumble https://github.com/paritytech/substrate/pull/740#discussion_r217822862

* refactor using NumberFor

address grumble https://github.com/paritytech/substrate/pull/740#discussion_r217823341

* add test that exposes possible problem

* update docstring for Client.best_containing

* extract test for Backend.leaves for reuse

* improve test blockchain_header_and_hash_return_blocks_from_canonical_chain_given_block_numbers

* extract test_blockchain_query_by_number_gets_canonical to easily test multiple impls

* remove whitespace

* remove todo

* Client.best_containing: pre-empt search loop when target in canonical

* best_containing: prevent race condition by holding import lock

* add todo

* extract leaf list update code into function

* add comment

* client-db: use in-memory-kvdb for tests

* use BTreeSet to store leaves for in-mem which is faster and simpler

* add docstring

* add comments and fix formatting

* add initial raw version of LeafSet

* remove Client::update_leaves which has been superceded by LeafSet

* use LeafSet in in-mem backend

* keccak -> blake2

* don't reexport codec traits in primitives

addresses https://github.com/paritytech/substrate/pull/740#discussion_r219538185

* fix rebase mistake

* improve LeafSet and use it in state-db

* correct Transfer nonces to fix ApplyExtinsicFailed(Stale)

* use given backend in canoncal test

* kill dead tree-route code in util

* fix warnings

* tests for leafset

* reorganizations in in_mem backend

* fix reorganization canon block logic

* DB commit and safe reversion on write error

* fix style nits
2018-09-26 12:34:05 +01:00
Guanqun Lu 1438e15925 clear statedb panics (#797)
* state-db: remove the assertion and replace it with Result<>

* state-db: unit test fixes

* comment fixes

* typo fix
2018-09-26 11:23:33 +01:00
Guanqun Lu 74a5ff7d0d State db random fixes (#802)
* state-db: typo fixes

* use fmt::Result for 'fmt'

* state-db: typo fixes

* state-db: use the same pattern to pass the parameter

* state-db: follow the same style
2018-09-26 11:15:56 +01:00
Pierre Krieger 52dbf0cace Rewrite the libp2p networking (#742)
* Rewrite the libp2p networking

* Fix erroneous replacement during rebase

* Update libp2p

* Update libp2p

* Remove the logic error about useless substreams

* Use the new NodeHandler system of libp2p

* Commit the Cargo.lock

* Upgrade yamux

* Forward port latest changes

* Fix compilation issues

* Implement the external URL

* Update to latest networking fixes

* Forward port rest of v0.2

* Fix reserved peers being dropped when we're full
2018-09-26 11:56:32 +02:00
Robert Habermeier abf799f78f Hard cutoff for non-finalized block state pruning (#798)
* state pruning after window even when nothing is finalized

* rename and alter canonicalization delay

* fix constant

* address grumbles

* add comment on canonicality vs finality
2018-09-26 00:24:11 +02:00
Sergey Pepyakin 98e0a3a55a Contracts: Add transfer event (#801) 2018-09-25 20:49:18 +01:00
Arkadiy Paronyan a613c62dc1 Fixed extrinsic encoding (#794)
* Fixed extrinsic encoding

* Reserve heuristic

* Fixed no-std build
2018-09-25 17:01:10 +01:00
Tomasz Drwięga 68e3e3ee11 Transactions dependency graph (#787)
* Graph transaction pool.

* Start future implementation.

* Future -> Ready promotions.

* Replacement logic.

* Clear extern crates, add docs.

* Move hash externally.

* Implement remove_invalid

* Implement ready transactions pruning.

* Move & rename.

* Add some logs.

* Clean up deps.

* Use Member trait.

* Add missing docs, elaborate on the proof.

* Expand on docs and proofs.
2018-09-25 15:38:23 +01:00
Gav Wood 82d6ca3484 Switch to shiny new fast, RLP-less trie (#795)
* Bump codec

* Fix tests

* Patricia trie builds

* Introduce trie

* Some yak shaving.

* Some fixes

* Remove RLP ref

* Fixes

* It builds!

* Some tests fixed

* Another test fix

* Rejig more hashes

* substrate-trie::iterator_works test

* Update lock

* Polish

* Docs

* Undo incorrect "fix" for tests

* Fix nits
2018-09-25 16:32:22 +02:00
Robert Habermeier b02c274374 Finality notification streams (#791)
* finalization for in_mem

* fetch last finalized block

* pruning: use canonical term instead of final

* finalize blocks in full node

* begin to port light client DB

* add tree-route

* keep number index consistent in full nodes

* fix tests

* disable cache and finish porting light client

* add AsMut to system module

* final leaf is always best

* fix all tests

* Fix comment and trace

* removed unused Into call

* add comment on behavior of `finalize_block`

* move `tree_route` to client common

* tree_route tests

* return slices in TreeRoute

* apply finality up to parent

* add `finalize_block` call

* adjust formatting

* finality notifications and add last finalized block to chain info

* exhaustive match and comments

* fix sync tests by using non-instant finality
2018-09-24 18:45:37 +02:00
Sergey Pepyakin ef97973178 Contracts: clean (#788)
* Extract `runtime` module

* Restructure & comment code to avoid confusion
2018-09-24 13:31:00 +02:00
Arkadiy Paronyan da991efd5f Removed From<H256> bound (#790) 2018-09-23 19:45:06 +01:00
Gav Wood f71200ee3c Bump codec (#786)
* Bump codec

* Fix tests
2018-09-21 17:16:15 +02:00