Commit Graph

2196 Commits

Author SHA1 Message Date
TriplEight b4b53cbb6e Check for warnings (#2850)
* check for warnings

* test run

* prebuild wasm binaries, pre-test is not needed for now

* will run everywhere but PRs

* lost warnings

* lost warnings

* try warnings with tests

* Update expected stderr in UI tests

* added to RUSTFLAGS

* another way of collecting warnings

* bump impl_version

* fix int tests parser

* revert demis changes and impl version bump

* no need to collect warnings in int test
2019-08-09 14:07:41 +02:00
André Silva 44515ed5f9 grandpa: fix catch up test (#3347) 2019-08-09 13:46:54 +02:00
Gavin Wood cc02a7424d Introduce AppVerify (#3343)
This trait, which works just like `Verify`, except on AppKey types.
I'd like for it all just to be `Verify`, but Rust's trait rules
concerning upstream changes mean it can't happen. This is a simple
workaround needed for some stuff in Polkadot.
2019-08-09 13:43:32 +02:00
André Silva 8f3a68db25 grandpa: fix --no-grandpa flag breaking block production (#3350) 2019-08-09 00:53:54 +01:00
Robert Habermeier a1a8c9829e remove unneeded as_ref call (#3349) 2019-08-08 23:05:03 +02:00
Arkadiy Paronyan 17a851b433 Fixed warnings (#3345) 2019-08-08 18:10:32 +02:00
David Craven a7c87f21da Remove Decode trait bound. (#3342) 2019-08-08 16:31:50 +02:00
Pierre Krieger bafc7202ca Service various cleanups (#3238)
* Remove generic from sign()

* Remove mandatory RuntimeGenesis trait req

* Remove requirement from Configuration

* Relax trait bounds of core/cli

* Move method

* The config field is no longer public

* Remove Components from bounds of functions

* Implement DerefMut for LightComponents

* Implement Executor for Full/LightComponents

* Fix bad merge

* Fix forgotten config()

* Fix build
2019-08-08 16:14:30 +02:00
Logan Saether fe18b4055d Fix documentation set_controller (#3340)
The documentation for the `set_controller` function was copied from the function above it, however it does not do the same thing. Fixed the documentation to fit the correct description of what `set_controller` does.
2019-08-08 15:08:14 +02:00
cheme b0e1212d48 Child storage tests and genesis fix. (#3185)
* Using child storage, (srml-support only), test failing .

* fix simple tests.

* Enumerable by requiring owned struct (previous form only allow
&'static).
Broken tests are from genesis init.

* implement for_child_keys_with_prefix

* indent

* clear_child_prefix fix.

* clear_child_prefix fix 2.

* fix for storage_impl, if/when allowing child and not child this could be
reverted.

* Fix lot of urlinked child genesis, still need to look upon actual
genesis srml module code.
Probably still a lot of broken code needing debugging.

* switch well_known_key to their associated module child trie.
Fix a genesis init (balance).
Complete some testing.
Comment some tests before using.

* fixing test runtime child keys

* latest commit fix broken genesis init

* fix system balances child name.

* Important fix: storage_root from test externalities need children (it is
already the case for ext).

* executive root with child calculation

* Avoid empty trie on test ext.

* Symetric removal of key for system.

* commenting changes related tests.

* Remove child module specifics.

* fix issues.

* fix some formatting

* fix bench and bump runtime

* Remove extend_storage_overlays, assimilate_storage do the same as is
proper considering srml macro.

* Fix warning for assimilate.

* Removing kill as they do not impact any test cases.

* Use tuple of storage map instead of two parameters. This changes the
behavior of decl_storage genesis build closure (breaking api).

* Do not use build storage before assimilate.

* fix error

* Update core/state-machine/src/backend.rs
2019-08-08 15:05:25 +02:00
Jim Posen 0067b2d9a2 srml-contracts: Refactor away some duplication in runtime functions. (#3257)
* srml-contracts: Storage access micro-optimization.

* srml-contracts: Refactor runtime functions to reduce duplication.

* Bump node runtime impl version.
2019-08-08 15:02:04 +02:00
Bastian Köcher 7c1fc4cc77 Make --dev to --alice again (#3338) 2019-08-08 13:11:46 +02:00
Bastian Köcher 0de7d9bb64 Adds author_rotateKeys RPC (#3337)
* Adds `author_rotateKeys` RPC

`author_rotateKeys` will rotate all session keys, store them into the
keystore and returns their encoded public keys as result. These encoded
public keys can be used directly to send the transaction to the chain.

* Review comments
2019-08-08 11:00:04 +02:00
André Silva 6565e1f8aa grandpa: track multiple live rounds in voter set state (#3298)
* grandpa: track multiple live rounds in voter set state

* grandpa: don't assume rounds are completed in-order

* grandpa: fix tests

* grandpa: don't assume round is being tracked on Environment::completed

* grandpa: fix missing import in test
2019-08-08 09:56:49 +02:00
Xiliang Chen 0f0df9850a add post_dispatch (#3229)
* add post_dispatch

* Update traits.rs

* Update checked_extrinsic.rs

* Update traits.rs

* Update traits.rs

* fix build issue

* update runtime version

* fix test build issue
2019-08-08 09:56:04 +02:00
Pierre Krieger 3d65753d48 Switch offchain workers to new futures (#3285)
* Switch offchain workers to new futures

* Fix tests
2019-08-08 09:35:12 +02:00
Arkadiy Paronyan b29277239a Improve console output (#3326)
* Cache idle state

* Display import error by default
2019-08-08 09:34:09 +02:00
Bastian Köcher 60269d65c6 Clean up CLI interface (#3334)
* Clean up CLI interface

- Removes `--validator` and `--grandpa-voter`
- Make `--alice` etc work without `--dev`

* Style fixes
2019-08-08 09:33:45 +02:00
Pierre Krieger 6396901481 Reintroduce mplex (reverts #3312) (#3328)
This reverts commit f11291cd9a.
2019-08-08 09:32:07 +02:00
Arkadiy Paronyan c0fd256c01 Fixed test block conditions (#3332) 2019-08-08 01:01:16 +02:00
Arkadiy Paronyan 58bd0d4c05 Set uncles inherent (#3317)
* Include uncles

* Filter missing uncles

* Moved inherent registration to a new crate

* Ignore invalid inherent encoding
2019-08-08 00:56:29 +02:00
Bastian Köcher ea58b7c92a Make DefaultByte implement Send + Sync (#3333)
* Make `DefaultByte` implement `Send + Sync`

* Update runtime version.
2019-08-08 00:10:36 +02:00
Bastian Köcher 46709e8381 More tests and some cleanup (#3331) 2019-08-08 00:05:15 +02:00
thiolliere 556a9416ae Staking optimisation (#3300)
* staking code api

* doc + test

* version bump

* index fn

* rename function

* doc

* adress comments

* add complexity comment
2019-08-07 22:11:12 +02:00
Andrew Jones 65a7629361 Derive CompactAs for Perbill/mill/U128 (#3327)
* Derive CompactAs for Perbill/mill/U128

* Increment impl_version
2019-08-07 21:48:30 +02:00
Pierre Krieger c32d9a17e0 Rename CustomProto to LegacyProto (#3313) 2019-08-07 21:22:27 +02:00
Pierre Krieger 97febf4c30 Make Verifier::verify mutable (#3165)
* Make Verifier::verify mutable

* Fix GrandPa tests

* Fix doctest

* Fix more doctests
2019-08-07 21:21:44 +02:00
Pierre Krieger f11291cd9a Remove support for mplex (#3312) 2019-08-07 21:08:21 +02:00
Arkadiy Paronyan b5cd36289e Handle telemetry socket errors (#3321)
* Handle telemetry socket errors

* Line width
2019-08-07 20:49:21 +02:00
Svyatoslav Nikolsky 3cb557700e remove leaves tracking from lignt backend (#3311) 2019-08-07 20:48:39 +02:00
Gavin Wood 1a524b8207 Refactor key management (#3296)
* Add Call type to extensible transactions.

Cleanup some naming

* Merge Resource and BlockExhausted into just Exhausted

* Fix

* Another fix

* Call

* Some fixes

* Fix srml tests.

* Fix all tests.

* Refactor crypto so each application of it has its own type.

* Introduce new AuthorityProvider API into Aura

This will eventually allow for dynamic determination of authority
keys and avoid having to set them directly on CLI.

* Introduce authority determinator for Babe.

Experiment with modular consensus API.

* Work in progress to introduce KeyTypeId and avoid polluting API
with validator IDs

* Finish up drafting imonline

* Rework offchain workers API.

* Rework API implementation.

* Make it compile for wasm, simplify app_crypto.

* Fix compilation of im-online.

* Fix compilation of im-online.

* Fix more compilation errors.

* Make it compile.

* Fixing tests.

* Rewrite `keystore`

* Fix session tests

* Bring back `TryFrom`'s'

* Fix `srml-grandpa`

* Fix `srml-aura`

* Fix consensus babe

* More fixes

* Make service generate keys from dev_seed

* Build fixes

* Remove offchain tests

* More fixes and cleanups

* Fixes finality grandpa

* Fix `consensus-aura`

* Fix cli

* Fix `node-cli`

* Fix chain_spec builder

* Fix doc tests

* Add authority getter for grandpa.

* Test fix

* Fixes

* Make keystore accessible from the runtime

* Move app crypto to its own crate

* Update `Cargo.lock`

* Make the crypto stuff usable from the runtime

* Adds some runtime crypto tests

* Use last finalized block for grandpa authority

* Fix warning

* Adds `SessionKeys` runtime api

* Remove `FinalityPair` and `ConsensusPair`

* Minor governance tweaks to get it inline with docs.

* Make the governance be up to date with the docs.

* Build fixes.

* Generate the inital session keys

* Failing keystore is a hard error

* Make babe work again

* Fix grandpa

* Fix tests

* Disable `keystore` in consensus critical stuff

* Build fix.

* ImOnline supports multiple authorities at once.

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

* Merge branch 'master' into gav-in-progress

* Remove unneeded code for now.

* Some `session` testing

* Support querying the public keys

* Cleanup offchain

* Remove warnings

* More cleanup

* Apply suggestions from code review

Co-Authored-By: Benjamin Kampmann <ben.kampmann@googlemail.com>

* More cleanups

* JSONRPC API for setting keys.

Also, rename traits::KeyStore* -> traits::BareCryptoStore*

* Bad merge

* Fix integration tests

* Fix test build

* Test fix

* Fixes

* Warnings

* Another warning

* Bump version.
2019-08-07 20:47:48 +02:00
Bastian Köcher a6a6779f01 Fix linked_map in decl_storage! for option values (#3323) 2019-08-07 18:43:05 +02:00
Arkadiy Paronyan 4242a4e54a Propagate cache when calling into runtime (#3319) 2019-08-07 13:18:03 +02:00
Bastian Köcher 394eff6c2f Update to schnorrkel 0.8.0 (#3267)
* Update to schnorrkel `0.8.0`

* Increase `spec_version`

* Bump schnorrkel to 0.8.3 (#3283)

* Schnorrkel 0.8.1 (builds on bkchr upgrade branch)

* Add tests for known hard/soft derivation values

* Bump all schnorrkel versions

* Flatten for easier inspection

* 0.8.2

* 0.8.3

* Update subkey/Cargo.toml

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

* Update `Cargo.lock`

* 0.8.4

* Fix cargo lock file.

* Adding an error message for `NotMarkedSchnorrkel` as that was missing.
Also fixing a typo, strage -> stage.
2019-08-07 12:59:54 +02:00
Pierre Krieger b5b1c2a4d8 Rename on_demand to light_dispatch and various minor changes (#3315)
* Rename on_demand to light_server

* Small docs improvement

* Rename on_block_announce to update_best_number

* More minor documentation

* Light server -> light dispatch

* is_light_rq_response -> is_light_response
2019-08-07 12:40:49 +02:00
thiolliere 87e72d9327 Fix decl_storage map and linked_map for insert_ref (#3316)
* test

* fix

* bumpd version

* Update srml/support/procedural/src/storage/impls.rs

Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>
2019-08-07 11:52:06 +02:00
thiolliere 4ed67e03a4 Update to parity-scale-codec (#3232)
* WIP: update codec

* WIP

* compiling

* WIP

* rename parity-scale-codec to codec

* WIP

* fix

* remove old comments

* use published crates

* fix expected error msg

* bump version

* fmt and fix

* remove old comment

* fix wrong decoding impl

* implement encode like for structures

* undo removal of old pending changes

* trailingzeroinput

* Apply suggestions from code review

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

* update codec

* fmt

* version is 1.0.0

* show more error

* fmt
2019-08-06 19:36:23 +02:00
thiolliere a0d442333f Improve internal doc of inflation module (#3288)
* improve internal doc

* Apply suggestions from code review

Co-Authored-By: DemiMarie-parity <48690212+DemiMarie-parity@users.noreply.github.com>

* correct spelling

* Apply suggestions from code review

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

* improve not confusing expression

* improve general doc
2019-08-06 10:12:53 +02:00
Robert Habermeier d5726d8e8a fix BABE randomness calculation (#3305) 2019-08-05 20:50:37 -04:00
André Silva a7c6950f1b node: fix integration test transaction format (#3306) 2019-08-05 21:56:26 +02:00
Pierre Krieger 83b148f514 Mention that in_mem::Backend doesn't work (#3250)
* Mention that in_mem::Backend doesn't work

* Bigger warning
2019-08-03 10:33:53 +02:00
Sergei Pepyakin f0856db12c srml-contracts: Minor fixes to docs. (#3262)
* Adjust documentation.

* Bump impl_version.

* Update srml/contracts/src/wasm/runtime.rs

Co-Authored-By: Hero Bird <robbepop@web.de>

* Remove incorrect doc.
2019-08-02 19:53:33 +02:00
Pierre Krieger c792dd358d Switch RPCs to stable futures (#3287) 2019-08-02 19:52:55 +02:00
André Silva aa86185648 node: use BABE predigest data to find authorship (#3293)
* node: use BABE predigest data to find authorship

* node: bump spec_version

* babe: use u32 for authority index
2019-08-02 19:52:36 +02:00
cheme da8b91ae7b Trie simplification. (#2815)
* switch to simple codec, trie broken for now

* Actualy use trie_root_noext

* align some hash, failing test on EMCH comment

* Fix trie code over layout instead of hash, revert legacy code for legacy
mainnet ??

* stub behind LayOut

* fix no_std

* temp solution for legacy trie behind feature legacy-key in various crate

* use remote project

* rc client db need prefix

* update trie deps

* bum spec runtime version

* Removing legacy as default.

* Switch mode to non legacy.

* bump runtime version

* Remove legacy trie compatibility features.

* fix warning

* bump version

* change hash on new test.

* Move dependency (#11 trie PR) patched to a parity repo.
Bench reverted to correct hasher.
Some renaming and doc improvments.

* ChildBitmap renaming to BitMap.

* Renaming of LayOut to Layout.

* formatting.

* Removing abreviation such as _ix nb_ or bm.

* Update deps and apply renaming 'Buff' -> 'Buffer'.

* Align to latest trie crates naming changes.

* Update trie dependency.

* Update trie dependency.

* change block_import test hash

* update trie deps (trie use new scale codec but it does not seems to be
an issue).

* update to use latest trie version (no mgmt of multiple radix).

* tabify

* Restoring test to 10 000.

* Use published crate, trie bench is currently down until publishing
(require another pr to update version).

* Update trie-bench.
2019-08-02 19:51:59 +02:00
Gavin Wood 7927e80bc6 Check the genesis hash in transactions regardless of era. (#3286)
* Check the genesis hash in transactions regardless of era.

* Fix check-fees, too.

* Undo.

* Subkey supports new signing.

* Remove unneeded type param.

* Bump tx version

* Build.

* Another build fix

* Build again

* Cleanup

* Another fix.

* Fix

* Fixes

* 6 second blocks.

* Fixes

* Build fix

* Fix

* Fix.
2019-08-02 18:30:20 +02:00
Gavin Wood ae6c2f7f8c Fix staking (#3284)
* 6 second blocks.

* Version bump

* Add test for slashable_balance()
2019-08-01 16:01:22 +02:00
Fedor Sakharov 17b9ef19c1 Slots should not try to catch panics. (#3281) 2019-08-01 14:37:02 +02:00
thiolliere b504f5a7bb Make staking add_reward_points_to_validator public (#3273)
* make staking add_reward_points_to_validator public

* make storage private

* bump version
2019-08-01 09:55:27 +02:00
Pierre Krieger cb7383b6b6 Documentation and small cleanup in panic-handler (#3249)
* Documentation and small cleanup in panic-handler

* Apply suggestions from code review

Co-Authored-By: Sergei Pepyakin <s.pepyakin@gmail.com>
2019-08-01 09:53:53 +02:00