Commit Graph

1386 Commits

Author SHA1 Message Date
André Silva f8246ebcdf core: grandpa: collect garbage for topic (#1780)
* core: grandpa: collect garbage for topic

* core: grandpa: use collect_garbage_for_topic in tests
2019-02-13 15:37:44 +01:00
Gav Wood 380d17d989 Add more naunce to the runtime CI agent (#1764)
* Add more naunce to the runtime CI agent

- If there are no changes to runtime code, exit ok; otherwise:
- If spec_version has changed, then:
  - Exit ok if the runtime is rebuilt, fail otherwise.
- If impl_version has changed, then exit ok.
- If neither version has changed, fail.

* Update check_runtime.sh
2019-02-13 11:46:27 +01:00
Stanislav Tkach ff5e4ca87e Migrate everything to the 2018 edition (#1758) 2019-02-13 11:45:59 +01:00
Gav Wood a61c218cc3 Introduce Ristretto signing (#1730)
* first draft of ristretto crypto module #1685

* adds better comments and code-style

* remove the last evil unwrap

* remove a mistakenly committed lockfile

* add a fresh new lockfile --will probably need a manual merge later

* fix an invalid old test vector

* Wire in ristretto

* Update comment

* Fix use.

* new Signature type api alias to be compatible with substrate

* Add new keyring, fix node executor tests

* Bump version.

* Remove all hashes.

* Update core/primitives/src/sr25519.rs

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

* Revert back to Ed25519 (until JS UI is ready)

* Fix test
2019-02-13 10:10:17 +01:00
Tomasz Drwięga 9e2710246f EnumerableStorageMap (#1763)
* Refactor decl_storage a bit to allow easier impl of linked map.

* A bunch of refactorings for storage generation.

- Rename StorageMap and ChildrenStorageMap to avoid confusion with generator::StorageMap.
- Separate implementation from the procedural macro code to clean it up.
- Make sure that genesis is initialised using the `StorageValue/StorageMap`
  generated implementations instead of going RAW.

* WiP: Writing test.

* Basic implementation.

* Implement enumeration.

* Fix non-std issues.

* fix warning

* Fix test-client.

* Address review grumbles - part 1

* Avoid cloning the key, relax Storage requirements.

* Rebuild runtime.

* Remove dangling todo.
2019-02-13 08:52:52 +01:00
Pierre Krieger 6e26c52191 Add debug name in node infos (#1769) 2019-02-12 18:03:46 +01:00
Wei Tang 22048dba60 Add standalone set head operations (#1600)
* Refactor head setting operation to a separate function

* Fix commit issue and implement set_head standalone in db

* Add standalone set head operations

* Address grumbles

* Change number_and_hash_to_lookup key in light mod to take reference

* Fix bug in set head commit

* Add a convenience fn

* Fix a deadlock

* Fix missing argument
2019-02-12 17:21:25 +01:00
Gregory Terzian 6122f7d6b6 Remove wait on future in network bridge (#1765)
* remove wait on future in network bridge

* nit

Co-Authored-By: gterzian <2792687+gterzian@users.noreply.github.com>

* nit

Co-Authored-By: gterzian <2792687+gterzian@users.noreply.github.com>

* nit

* propagate error

* nit once more

* nit

Co-Authored-By: gterzian <2792687+gterzian@users.noreply.github.com>
2019-02-12 16:18:53 +01:00
Pierre Krieger 9e999cdd81 Make network-libp2p's Service generic over the message (#1708)
* Make network-libp2p's Service generic over the message

* Apply suggestions from code review

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

* Fix warning
2019-02-12 15:36:15 +01:00
Bastian Köcher 1f05a47cdb Set initialised_block if we called initialise_block (#1767) 2019-02-12 14:52:00 +01:00
Gav Wood 90a837d4b8 Add Proposed event (#1761)
* Add Proposed event.

* Bump and rebuild
2019-02-11 17:06:45 +01:00
Pierre Krieger d93769b0fd Fix infinite loop in reserved mode (#1759) 2019-02-11 15:04:23 +00:00
Marcio Diaz b8bd49961a Adds new execution strategy nativeElseWasm (#1546)
* fix: adds new execution strategy nativeElseWasm and replace nativeWhenPossible with it

* feat: adds cmd line params for execution strategies

* fix: uses of cmd line execution strategies

* chore: remove white spaces

* chore: remove println

* chore: remove whitespace

* fix: generating functions with context

* feat: add function to generate with_context declarations

* fix: add implementation for with_context function calls

* fix: add execution context to call_api_at function

* fix: making use of context to select strategy for block_builder

* chore: cleaning up

* fix: merging issues

* fix tests

* add wasm files

* chore: small doc for context fields

* chore: delete redundant docs

* fix: use full path for ExecutionContext

* fix: add context functions from inside fold_item_impl

* chore: remove clone

* fix: moving generative function to utils, remove unused imports

* fix: add missing full path for ExecutionContext

* fix: merge issues

* update wasm files

* fix: update to keep up with changes in master

* chore: remove unused functions, clean up

* fix test

* fix grumbles

* fix: add more tests

* fix: some refactorings

* feat: add execution strategy to call

* chore: small improvements

* fix: add message to panic

* fix tests
2019-02-11 15:22:44 +01:00
Bastian Köcher f9975af020 Make sr-api-macros and srml-support renaming of crates (#1757)
Procedural do not support `$crate` to get access to the crate where the
macro is defined. We use a hack to re-export the crate under a known
name. With rust edition 2018, people started to rename their crates in
`Cargo.toml`, but that breaks the re-export. This commit introduces
`proc-maco-crate` that supports finding the requested crate name, even
if it was renamed.
2019-02-11 13:58:41 +01:00
Pierre Krieger 35a4aa638c Make the discovery test more strict (#1721) 2019-02-11 13:47:14 +01:00
Stanislav Tkach c860787db7 Migrate srml crates to the 2018 edition (#1755) 2019-02-11 11:42:36 +01:00
André Silva b28f7328ac grandpa: fix reimport of change blocks (#1754)
* core: grandpa: handle re-import of change blocks

* core: grandpa: add test for change block reimport
2019-02-11 11:39:41 +01:00
Pierre Krieger bf2dd5f419 Reduce the spam from network misbehaviours (#1750)
* Reduce the spam from network misbehaviours

* Add protocol id to misbehaviour
2019-02-11 11:39:14 +01:00
Michael Müller de4bb87bea Replace unwrap with expect (#1684)
* Replace unwrap with expect

* Move expect to call sites

* Bubble errors up and trap

* Update wasm

* Update invalid pointer

* Remove test which makes problems in CI

* Check for underflow
2019-02-10 12:29:45 +01:00
Gav Wood e5ac7f0957 Vesting schedules. (#1726)
* Vesting.

* Vesting stuff.

* Add new wasm blobs

* Bump runtime version

* Update lock

* Fix tests

* Bump version
2019-02-10 11:15:16 +01:00
Tomasz Drwięga 51a98f5c94 Unify bad signature error (#1717)
* Unify bad signature message.

* Update runtime.
2019-02-09 19:44:52 +01:00
Stanislav Tkach ca69ad4c30 Migrate smrl-treasury and srml-upgrade-key to the 2018 edition (#1725) 2019-02-09 18:06:20 +01:00
gabriel klawitter 810c391de2 check spec_version and impl_version (#1743) 2019-02-09 17:29:15 +01:00
thiolliere e5dbcf6890 decouple balances from some modules (#1641)
* decouple balances from some module by creating a new traits in support/traits
* improve decl_event
2019-02-08 17:43:12 +01:00
Tomasz Drwięga 83f9e1e720 Allow modules to indicate full block. (#1687)
* Add transaction skipping.

* Update runtime.
2019-02-08 15:35:48 +01:00
Arkadiy Paronyan 091e222d99 Fixed a bunch of warnings (#1740) 2019-02-08 14:55:15 +01:00
Shawn Tabrizi 7b0f82b4f0 Fix issues related to Rust 2018, Macros, and node-template (#1742)
* Initial fix, need to remove demo

* Fix similar issue with contracts module

* Remove Demo Module for Testing

* Undo changes to Contracts module
2019-02-08 14:31:05 +01:00
Benjamin Kampmann 0135afd0ed Update substrate-cli & node-template deps (#1737)
* Update to latest sysinfo crate

* Update node_templates parking_lot dependency
2019-02-08 14:05:06 +01:00
Pierre Krieger 3509b69c4c Remove warning about empty list of identify addresses (#1739) 2019-02-08 15:39:15 +03:00
Stanislav Tkach 31188dc013 Migrate rpc-servers, serializer, service and sr-io to the 2018 edition (#1732) 2019-02-08 13:10:05 +01:00
gabriel klawitter 91114c6c11 CI: label a pull request breaksapi if there are changes on the wasm source code but no changes to the spec_version (#1727)
* trigger labelling pipeline for runtime changing pull requests

* cut out aws config as it is now included in the parity/awscli image
2019-02-08 13:00:01 +01:00
André Silva 78a60194eb Fix block justification response handling (#1729)
* core: sync: dont report peers on empty justification response

* core: sync: log dispatched block justification requests
2019-02-08 10:34:50 +01:00
Pierre Krieger 7afe69066f Fix panic in custom protocol handler (#1723) 2019-02-07 16:16:41 +00:00
thiolliere 4792a3806c use custom ext::Opt for default_value in DeclStorageLine (#1722)
instead of ext::Seq
2019-02-07 16:35:29 +01:00
Pierre Krieger 0da92bf114 Protect against flood of addresses (#1718) 2019-02-07 14:54:59 +01:00
Pierre Krieger 593c292f14 Update libp2p-core to 0.3.4 (#1720) 2019-02-07 14:30:17 +01:00
Arkadiy Paronyan 1dc15be5bd Check for block parent before verification. (#1714)
* Treat verification errors more seriously

* Track obsolete requests

* Check block parent before verification

* Style
2019-02-07 11:58:27 +01:00
Jordan Beauchamp fb0f4dfb03 Expose block random seed and timestamp to contract ABI (#1630)
* Expose block random seed and timestamp to contract ABI

* Add tests

* Bump spec version
2019-02-07 10:58:02 +01:00
André Silva eb6dc0394e core: network: fix sync on testing network (#1713) 2019-02-06 19:33:08 +01:00
Stanislav Tkach e60be1ad12 Migrate network, primitives and rpc to the 2018 edition (#1710) 2019-02-06 19:07:48 +01:00
Stanislav Tkach 3a4dda7beb Migrate sr-primitives, sr-sandbox, sr-std and sr-version to the 2018 edition (#1694) 2019-02-06 19:04:14 +01:00
Tomasz Drwięga 4e3eace15f Limit transaction pool size (#1676)
* Avoid excessive hashing. Store extrinsic len.

* Implement pool limits.

* Fix issues.

* Make sure we return error in case it doesn't make into the pool.

* Pass parameters from CLI.

* Remove redundant todo.

* Fix tests.
2019-02-06 19:03:05 +01:00
Bastian Köcher 461cd384fc Export TERM in node-template-release.sh (#1711) 2019-02-06 19:01:41 +01:00
gabriel klawitter 94e1e38008 build tagged versions (#1712) 2019-02-06 18:17:20 +01:00
Arkadiy Paronyan db572aa0b9 Reference counted uncanonicalised overlay (#1695)
* Refcounted uncanonicalised overlay

* Removed into_iter

* Using free functions
2019-02-06 17:52:03 +01:00
Bastian Köcher 567122fab5 Moves node-template into substrate repo (#1637)
* Make runtime macros work without required `macro_use`

* Adds node-template

* Adds node-template-release tool

* Fixes building `node-template` and improve the release

* Add `profile.release` by release script to remove warning

* Adds script for releasing the node template

* Fixes compilation after master merge

* Port node-template to edition 2018

* Remove license

* Fixes compilation after master merge

* Add `node-template-release.sh` into the CI

* WIP Ci integrate node template (#1701)

* copy artifacts to s3 bucket latest path

* typo

* bucket name

* Update wasm files
2019-02-06 17:15:12 +01:00
Pierre Krieger b6fd967dfb Update libp2p to v0.3 (#1634)
* Update libp2p

* Some more diagnostics

* 30 seconds back to 5 seconds

* Bump libp2p-core and improve test

* Fix runtime Cargo.lock

* More work

* Finish upgrade to libp2p 0.3

* Add a maximum of 60 seconds for the rounds

* Remove env_logger

* Update Cargo.lock

* Update Cargo.lock in test-runtime

* Fix test compilation

* Make the test pass

* Add identify addresses to Kademlia

* Don't connect to nodes we're already connected to

* Add warning for non-Substrate nodes

* Fix external address not added

* Start in Enabled mode
2019-02-06 16:39:22 +01:00
Sergei Pepyakin 7d8ae2df5c Indices maintenance (#1705)
* Migrate the indicies crate to 2018 edition.

* Use .cloned() instead of .map(|x| x.clone())

* Update documentation.
2019-02-06 14:51:14 +01:00
Wei Tang 1d0049ee00 Update trie to v0.11 (#1704)
* Update trie to v0.11

* Update wasm runtimes
2019-02-06 14:50:52 +01:00
Gregory Terzian a2d2ed69ab Rewrite network protocol/service to use channels (#1340)
* rewrite network protocol/service to use channels

* remove use of unwrap

* re-introduce with_spec

* remove unnecessary mut

* remove unused param

* improve with_spec, add with_gossip

* rename job to task

* style: re-add comma

* remove extra string allocs

* rename use of channel

* turn TODO into FIXME

* remove mut in match

* remove Self in new

* pass headers by value to network service

* remove network sender from service

* remove TODO

* better expect

* rationalize use of network sender in ondemand
2019-02-06 12:54:02 +01:00