Commit Graph

2421 Commits

Author SHA1 Message Date
Coenen Benjamin 53a43e92aa create some vectors with initial capacities (#3701)
Signed-off-by: Benjamin Coenen <benjamin.coenen@hotmail.com>
2019-09-27 11:46:53 +02:00
Alexey 62be947877 Enable runtime_api for Substrate service (#3709)
* added new_full_concrete for service

* line width fix

* Update node/cli/src/service.rs

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

* Update node/cli/src/service.rs

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

* Update node/cli/src/service.rs

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

* replaced new_full

* empty

* added backticks to pass ci
2019-09-27 11:43:25 +02:00
Wei Tang 3864d0e4da Update libsecp256k1 dep to 0.3.0 (#3711)
* Update libsecp256k1 dep to 0.3.0

* Bump impl_version
2019-09-27 09:48:29 +02:00
Bastian Köcher ba98168b71 Make TestOffchainExt panic on unknown requests (#3710)
* Make `TestOffchainExt` panic on unknown requests

* Fix test
2019-09-26 23:02:30 +02:00
Caio 0da34de380 Pointer does not implement Display (#3707)
Instead, use `Debug` for `debug_trace!`
2019-09-26 22:21:12 +02:00
André Silva 0330f3bac6 grandpa: send authority id to telemetry when starting new voter (#3705) 2019-09-26 19:23:01 +02:00
thiolliere 55e5b21478 Improve storage doc (#3691)
* doc

* fix

* Apply suggestions from code review

Co-Authored-By: Kian Paimani <5588131+kianenigma@users.noreply.github.com>

* complete suggestion
2019-09-26 11:44:52 +02:00
Ashley a2c553a0d9 Random seed API for offchain workers (#3694)
* Add random_seed impl for offchain api

* switch to rand::random
2019-09-26 09:36:58 +02:00
thiolliere 66b0e00651 Fix linkedmap instance head of (#3690) 2019-09-25 22:38:29 +02:00
Kian Paimani f277c4884a Fix Phragmen equalize loop. (#3693)
* Fix phragmen loop

* Bump.
2019-09-25 16:43:11 +02:00
Kian Paimani 1c15ca6ad1 Refactor: fixed point arithmetic for SRML. (#3456)
* Macro-ify perthings.

* Refactor fixed64

* Half-workign phragmen refactor.

* Finalize phragmen refactor.

* Fix creation of perquintill

* Fix build errors

* Line-width

* Fix more build errors.

* Line-width

* Fix offence test

* Resolve all TODOs.

* Apply suggestions from code review

Co-Authored-By: Gavin Wood <gavin@parity.io>
Co-Authored-By: thiolliere <gui.thiolliere@gmail.com>

* Fix most of the review comments.

* Updates to multiply by rational

* Fxi build

* Fix abs issue with Fixed64

* Fix tests and improvements.

* Fix build

* Remove more tests from staking.

* Review comments.

* Add fuzzing stuff.

* Better fuzzing

* Better doc.

* Bump.

* Master.into()

* A bit more hardening.

* Final nits.

* Update lock

* Fix indent.

* Revert lock file.

* Bump.
2019-09-25 11:21:05 +02:00
Kian Paimani 87688aadaa Document how to get head of linked map. (#3679)
* Document how to get head of linked map.

* Update srml/support/procedural/src/lib.rs

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

* Update srml/support/procedural/src/lib.rs

Co-Authored-By: thiolliere <gui.thiolliere@gmail.com>
2019-09-25 09:36:24 +02:00
Toralf Wittner 3dd5a508b4 Remove debug_assert!ion. (#3678) 2019-09-25 09:35:45 +02:00
Ashley a6329f8779 Change decl_storage! to forbid default value for Option types (#3682)
* Forbid default values for Option types in decl_storage!

* fix test errors

* bump impl_version
2019-09-25 09:34:31 +02:00
André Silva 1bf44278d3 node: update flaming fir (#3681)
* node: reduce grandpa justification period to 512 blocks

* node: update flaming fir chainspec
2019-09-24 19:47:06 +02:00
thiolliere 1835c3f9a1 Fix head not hashed (#3680)
* fix head not hashed

* bump version
2019-09-24 17:46:41 +02:00
Toralf Wittner 7611c08679 Fix invalid debug assertion. (#3663)
The current `debug_assert_eq` is clearly wrong as the code handles zero
response blocks. What should have been expressed is that we expect 0 or
1 response blocks.
2019-09-24 13:53:16 +02:00
Toralf Wittner af0d71d389 Add block announce validator. (#3346)
* Add `BlockAnnounceValidator` trait.

* Add associated data to block announcement.

* Make tests compile.

* Move validator into `sync.rs`.

* Smaller changes.

* Update core/network/src/protocol.rs

Co-Authored-By: Kian Paimani <5588131+kianenigma@users.noreply.github.com>

* Update core/network/src/protocol.rs

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

* Update core/network/src/test/sync.rs

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

* Formatting.

* Remove assoc. data from `BlockImportNotification`.

* Use `Option<Vec<u8>>` for associated data.

* Update core/network/src/protocol/sync.rs

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

* Fix type error.
2019-09-24 10:48:21 +02:00
Robert Habermeier 4888c253a3 fix #2177: port GRANDPA node-side code to use Consensus digests (#3669)
* fix #2177: port GRANDPA node-side code to use Consensus digests

* bump runtime version

* fix service compilation

* document change precedence rules
2019-09-24 10:45:44 +02:00
Ashley 5c39f588be Change decl_storage! to import the storage traits automatically (#3674)
* decl_storage imports needed traits

* bump impl_version

* Update srml/system/src/lib.rs

Co-Authored-By: Kian Paimani <5588131+kianenigma@users.noreply.github.com>

* Update srml/system/src/lib.rs

Co-Authored-By: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
2019-09-24 10:05:15 +02:00
Ashley a7cd458544 Move best_containing from Client to blockchain::Backend (#3655)
* Move best_containing from Client to Backend

* Add comma for clearer diffs

Co-Authored-By: André Silva <andre.beat@gmail.com>
2019-09-24 07:31:06 +02:00
Ashley 1baee72d75 use pdqselect for median_algorithm selection (#3636)
* use pdqselect for median_algorithm selection instead of sorting the whole vec

* Make use of pqdselect clearer

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

* Make use of pqdselect clearer

Co-Authored-By: André Silva <andre.beat@gmail.com>
2019-09-23 22:37:53 +02:00
Michael Müller 2d6e617309 Send local GRANDPA authority id to telemetry (#3646)
* Fix indentation

There is a space between the tabs.

* Send local GRANDPA authority id to telemetry

* Update core/finality-grandpa/src/lib.rs

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

* Generalize authority_id()

* Shorten code

* Do not send unfinalized authority sets to telemetry

`update_authority_set()` is called from, among others,
import side. These updates only track a pending change
and may or may not happen, hence it's wrong to send
this set to telemetry (which would assume that this is
the current, finalized authority set).

* Send current authority set and local authority id on set change
2019-09-23 17:48:09 +02:00
Jim Posen 82e7f9e423 Decouple node-executor structures from wasmi (#3610)
* executor: Support non-Wasmi sandbox supervisor environments.

* node-executor: Tests don't reference WasmExecutor directly.

* executor: Simplify encoding of heap metadata.

* executor: Decouple allocator from wasmi::MemoryRef.
2019-09-23 17:38:51 +02:00
Robert Habermeier c200ce757b Fixing BABE epochs to change between blocks (#3583)
* always fetch epoch from runtime

* node integration tests don't test light nodes

* give stand-in full node a FULL role

* rejig babe APIs

* introduce next-epoch-descriptor type

* overhaul srml-BABE epoch logic

* ensure VRF outputs end up in the right epoch-randomness

* rewrite `do_initialize` to remove unnecessary loop

* begin accounting for next epoch in epoch function

* slots passes header to epoch_data

* pass slot_number to SlotWorker::epoch_data

* begin extracting epoch-change logic into its own module

* aux methods for block weight

* aux methods for genesis configuration

* comment-out most, refactor header-check pipeline

* mostly flesh out verifier again

* reinstantiate babe BlockImport implementation

* reinstate import-queue instantiation

* reintroduce slot-worker implementation

* reinstate pretty much all the rest

* move fork-choice logic to BlockImport

* fix some, but not all errors

* patch test-runtime

* make is_descendent of slightly more generic

* get skeleton compiling when passing is_descendent_of

* make descendent-of-builder more succinct

* restore ordering of authority_index / slot_number

* start fiddling with tests

* fix warnings

* improve initialization architecture and handle genesis

* tests use correct block-import

* fix BABE tests

* fix some compiler errors

* fix node-cli compilation

* all crates compile

* bump runtime versions and fix some warnings

* tweak fork-tree search implementation

* do backtracking search in fork-tree

* node-cli integration tests now work

* fix broken assumption in test_connectivity

* babe tests fail for the right reasons.

* test genesis epoch logic for epoch_changes

* test that epochs can change between blocks

* First BABE SRML test

* Testing infrastructure for BABE

Also includes a trivial additional test.

* Apply suggestions from code review

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

* A little more test progress

* More work on BABE testing

* Try to get the tests working

* Implement `UintAuthorityId`-based test mocks

* Fix compilation errors

* Adjust to upstream changes

* Block numbers are ignored in BABE epoch calculation

* authority_index() should ignore invalid authorities

* Fix compile error

* Add tests that session transitions happen

* Check if BABE produces logs

It currently does not.

* Fix test suite

This was really nasty, due to a type confusion that showed up as an
off-by-1 buffer error.

* Add additional tests

Most of these were derived from the current output, so they are only
useful to guard against regressions.

* Make the tests more readable

Also bump impl_version.

* Fix excessive line width

* Remove unused imports

* Update srml/babe/src/lib.rs

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

* try to fix imports

* Fix build errors in test suite

* tests did not pass

* Try to get at least one digest to be output

Currently, the code emits either no digests (if I don’t call
`Session::rotate_session()` or two digests (if I do), which is wrong.

* More tests

They still don’t work, but this should help debugging.

* fix silly error

* Don’t even try to compile a broken test

* remove broken check_epoch test and add one for genesis epoch

* Check that the length of the pre-digests is correct

* Bump `impl_version`

* use epoch_for_descendent_of even for genesis

* account for competing block 1s

* finish srml-babe docs

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

* address grumbles
2019-09-23 16:03:05 +02:00
thiolliere e6d4a76521 Refactor reward curve (#3668)
* move test in tests dir

* comment

* refactor
2019-09-23 14:11:24 +02:00
Ashley 0a469666c1 Rename more things related to contract instantiation (#3664)
* Rename more things related to contract instantiation

* rename `creator_ch`

* Fix node runtime

* fix contracts tests

* Little fix
2019-09-23 11:32:44 +02:00
Robert Habermeier e0b3564f2d improve justification docs 2019-09-23 10:28:24 +02:00
Wei Tang 642e76b738 Only submit signed extrinsics back to pool when retracting block (#3660)
* Only submit signed extrinsics back to pool when retracting block

* Fix import
2019-09-21 19:50:37 +08:00
Joshy Orndorff 210290f8ca Remove unused key types sr25 and ed25 (#3659)
* Remove unused key types sr25 and ed25.

* Restore in specific files to fix build.

* Fix runtime tests

* Fix keystore test

* Revert typo

* Move keytypes to primitives/src/testing.rs

* More missed items.

* Getting close now.

* Fix example in documentation.

* Update core/application-crypto/src/ed25519.rs

* Update core/application-crypto/src/sr25519.rs

* Bump impl version.
2019-09-21 12:48:03 +08:00
thiolliere c25d7386cf Make staking inflation curve configurable. (#3644)
* Draft for new design of NPoS rewards

* finish code

* fix test

* add tests

* improve log test

* version bump

* Update srml/staking/reward-curve/Cargo.toml

Co-Authored-By: Kian Paimani <5588131+kianenigma@users.noreply.github.com>

* u128 -> u64

* make conversion to smaller type safe

* Update core/sr-primitives/src/curve.rs

Co-Authored-By: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
2019-09-21 12:47:10 +08:00
Robert Habermeier 68cda2fe79 find best_containing even if best chain is shorter (#3657) 2019-09-20 17:44:19 +01:00
Hernando Castano e434dbdfc5 Use ThreadPool::spawn_ok() instead of ThreadPool::spawn() (#3656)
* Bump futures-timer to v0.3

* Bump futures-preview to v0.3.0-alpha.18

* Replace ThreadPoll::spawn() with ThreadPoll::spawn_ok()
2019-09-20 15:26:14 +02:00
Ashley c95fdd53d8 Finish off srml-contract create -> instantiate renamings (#3649)
* Finish off srml-contract create -> instantiate renamings

* bumped spec_version
2019-09-20 10:53:03 +02:00
Svyatoslav Nikolsky eba6dd73c6 Blockchain cache pruning strategy (#3395)
* blockchain cache pruning strategy

* added some internal docs to cache_pruning_strategy

* Update core/client/db/src/cache/mod.rs

Co-Authored-By: DemiMarie-parity <48690212+DemiMarie-parity@users.noreply.github.com>
2019-09-20 09:49:15 +03:00
Weiliang Li d105d3f3a1 fn import_block -> fn block_import_params in SimpleSlotWorker (#3647) 2019-09-19 15:49:24 +01:00
Ashley 0ed8d40b88 srml-contract: Rename Contract::create to instantiate (#3645)
* Rename Contract::create to Contract::instantiate

* Rename some documentation items

* fixed node executor test

* bumped impl_version

* increased spec_version
2019-09-19 13:06:11 +02:00
Tomasz Drwięga 668acca9ed Force new era only if 1/3 validators is disabled. (#3533)
* Force new era only when over third validators is disabled.

* Update srml/session/src/lib.rs

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

* Update srml/staking/src/lib.rs

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

* Parametrize the threshold.

* Bump runtime version.

* Update node/runtime/src/lib.rs

* Fix build.

* Fix im-online test.
2019-09-19 18:04:48 +08:00
Kian Paimani bfe240d1b0 srml-module: Phragmen election (#3364)
* phragmen election module.

* Add new files.

* Some doc update

* Update weights.

* bump and a few nits.

* Performance improvement.

* Master.into()

* Update srml/elections-phragmen/src/lib.rs

Co-Authored-By: Gavin Wood <gavin@parity.io>

* Fix build

* Some fixes.

* Fix build.

* Proper outgoing and runner-up managment.

* Bit more sensical weight values.

* Update srml/elections-phragmen/src/lib.rs

* Update srml/elections-phragmen/src/lib.rs

Co-Authored-By: Gavin Wood <gavin@parity.io>

* Update srml/elections-phragmen/src/lib.rs

Co-Authored-By: Gavin Wood <gavin@parity.io>

* Update srml/elections-phragmen/src/lib.rs

Co-Authored-By: Gavin Wood <gavin@parity.io>

* fix lock file

* Fix build.

* Remove runner-ups

* Some refactors.

* Add support for reporting voters.

* Fix member check.

* Remove equlize.rs

* Update srml/elections-phragmen/src/lib.rs

* Update srml/elections-phragmen/src/lib.rs

* Update srml/elections-phragmen/src/lib.rs

Co-Authored-By: Gavin Wood <gavin@parity.io>

* Update srml/elections-phragmen/src/lib.rs

Co-Authored-By: Gavin Wood <gavin@parity.io>

* Bring back runner ups.

* use decode_len

* Better weight values.

* Update bogus doc

* Bump.

* Update srml/elections-phragmen/src/lib.rs

Co-Authored-By: Gavin Wood <gavin@parity.io>

* Review comments.

* One more test

* Fix tests

* Fix build

* .. and fix benchmarks.

* Update srml/elections-phragmen/src/lib.rs

* Version bump
2019-09-19 18:04:02 +08:00
Talha Cross 5585770a12 core, subkey: allow to read Polkadot, Kusama, and Dothereum address types (#3643)
* core/primitives: set dothereum address type to 4

* subkey: add dothereum to network prefix

* core/primitives: set dothereum address type to 20

* core/primitives: update comment

* core/primitives: set default address to Dothereum

* Revert "core/primitives: set default address to Dothereum"

This reverts commit 2fc95490c89390eb26f200cb314435b1e9ff83e8.

* core/primitives: allow to parse different default address types
2019-09-19 08:34:41 +02:00
Pierre Krieger 9ea3d8fc52 Remove the no_std feature from the WASM builder (#3640)
* Remove the no_std feature from the WASM builder

* Address review

* More fixing

* Address review again

* Fix missing Cargo.lock
2019-09-18 22:00:44 +02:00
Bastian Köcher 49ad0dbdff Make wasm-builder check for rust-lld (#3635)
* Make `wasm-builder` check for `rust-lld`

* Update README.adoc

Co-Authored-By: Ricardo Rius <9488369+riusricardo@users.noreply.github.com>
2019-09-18 13:52:18 +02:00
Kian Paimani b46340cf8e From<UintAuthority> for u64 (#3638)
* Add from impl for uint authority

* Undo change to cargo.
2019-09-18 13:24:08 +02:00
Ashley e9c756dced Update parity-wasm to 0.40 (#3631)
* updated direct dependencies to parity-wasm

* fixed tests and incremented impl_version of the runtime

* update wasmi to 0.5.1 in sr-sandbox, bringing all parity-wasm deps up to 0.40
2019-09-18 12:27:59 +02:00
Arkadiy Paronyan a07e567fe1 Storage tracing (#3614)
* Storage tracing

* Whitepsaces

Co-Authored-By: Sergei Pepyakin <sergei@parity.io>

* Apply suggestions from code review

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

* Update Cargo.lock
2019-09-17 20:42:15 +02:00
Bastian Köcher 2b040fe983 Properly detect debug build in slots (#3630)
`debug-assertions` can also be enabled in for release builds. This
introduces a new build-script that extracts the build type from the
`PROFILE` env variable and sets the `build_type` cfg.
2019-09-17 14:39:40 +02:00
Shawn Tabrizi 113d512300 Suggest --release compilation (#3627) 2019-09-17 13:32:52 +02:00
Tomasz Drwięga c4af4fa522 Fix missing contracts RPC on a full node. (#3622)
* Add contracts RPC to full node.

* Instantiate both RPC extensions for light & full.
2019-09-17 13:06:36 +02:00
Bastian Köcher 96c781834d Enable nice wasm panic messages by default (#3619)
By accident it was already enabled in master for quite some time. To
make sure that we don't blow up the wasm binary size, I compiled the
binary with the feature enabled and disabled. With nice panic messages
enabled, the binary size increases by 908 bytes. Given the value that
this feature brings, I think it is okay to have these panic messages
enabled by default.
2019-09-17 11:28:32 +02:00
Arkadiy Paronyan 84d0c790f3 Send block status with announcement (#3607)
* Send block status with announcement

* Fixed tests

* Whitespace

Co-Authored-By: Gavin Wood <gavin@parity.io>

* Additional comment

* Update comment

Co-Authored-By: André Silva <andre.beat@gmail.com>
2019-09-17 11:19:46 +02:00