Commit Graph

168 Commits

Author SHA1 Message Date
Gav Wood ebba5d1d3c Revert "Forcing can be on or off."
This reverts commit 583b0552d6.
2019-08-12 17:25:34 +02:00
Gav Wood 583b0552d6 Forcing can be on or off. 2019-08-12 17:24:12 +02:00
André Silva 70d716dc48 node: exit on GRANDPA voter or BABE authoring error (#3353)
* node: exit on GRANDPA voter or BABE authoring error

* node: exit process with non-zero return code when service fails

* service: rename infallible task to essential task

* service: revert field name changes

* core: fix service testnet
2019-08-12 15:54:30 +02:00
Pierre Krieger 6fa84bae0f Refactor parse_and_execute (#3358)
* Refactor `parse_and_execute`

Adds a new function named `parse_and_prepare`, which prepares the environment and parses the command.
Contrary to `parse_and_execute`, `parse_and_prepare` returns a struct that permis the user to execute the command, as opposed to execute it itself.

`parse_and_execute` has been modified to use `parse_and_prepare` internally.

* Embed dispatch functions directly into run()

After the previous commit, we now have a lot of functions whose only one is to call other functions. And these other functions are called only from one location.
Let's merge these two for clarity.

* Deprecate parse_and_execute and replace it in node and node-template

* Apply suggestions from code review

Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>
2019-08-11 16:07:40 +02:00
Gavin Wood 14bb115193 Scale trait and move to u32 blocknumbers (#3357)
* Scale trait and move to u32 blocknumbers.

* Fixes

* Cleanups

* Update node/runtime/src/lib.rs

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

* Fix up some of the factory stuff.

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

Co-Authored-By: Shawn Tabrizi <shawntabrizi@gmail.com>

* Move Nonce/Index to u32 (#3361)

* Force a non-borked version of upstream crate

* Line lengths and runtime version bump
2019-08-11 15:03:06 +02:00
André Silva 59c88cb2f3 node: setup disabled grandpa properly (#3356) 2019-08-09 16:53:44 +02:00
André Silva 98d502466d node: re-introduce validator flag (#3351) 2019-08-09 15:17:52 +02:00
Bastian Köcher c824c959d7 Adds --no-validator CLI flag (#3348)
* Implement `is_validator` for offchain-workers

* Introduce `--no-validator` flag

* Don't run babe/grandpa/im-online when `--no-validator` is given

* Fixes compilation

* Bump spec version

* Improve error handling in executor

* Add missing extern function

* Revert making error public

* Remove `--no-validator` CLI
2019-08-09 14:24:18 +02:00
André Silva 8f3a68db25 grandpa: fix --no-grandpa flag breaking block production (#3350) 2019-08-09 00:53:54 +01: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
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
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
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
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
André Silva a7c6950f1b node: fix integration test transaction format (#3306) 2019-08-05 21:56:26 +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
André Silva c1640ef5da node: update flaming fir chain spec (#3258)
* node: update BABE authority ids in staging testnet config

* node: update flaming fir chain spec
2019-07-30 22:44:02 +01:00
Jim Posen 1295260f2b Remove unused imports introduced in #3239. (#3252)
Partly due to interaction with #3191.
2019-07-30 14:30:01 +02:00
Pierre Krieger 20eb52d6bb Allow creating a ChainSpec from a Vec<u8> (#3233)
* Allow creating a ChainSpec from a Vec<u8>

* Line widths

* Embedded -> Binary

* Remove from_embedded
2019-07-29 20:50:50 +02:00
Jim Posen 8aa367c27a Fix substrate factory CLI command (#3239)
* CLI execution flag for import-blocks and factory.

* Fix minimum_balance bug with CLI factory.
2019-07-29 17:06:13 +02:00
Pierre Krieger 9370a4a6b6 Clean up the basic-authorship crate (#3206)
* Switch consensus-common to new futures

* Fix tests

* More tests fixing

* Make Proposer, OnSlot and SyncOracle mut

* Make the Environment mut as well

* Fix test

* Fix Babe tests

* Babe fixes

* Fix CLI service tests

* Fix Babe tests

* Remove unnecessary trait bound

* Inline the code of BlockBuilder and AuthoringApi

* Remove warning lint

* Bounds simplification

* Imports simplification

* Don't panic on bad generated block

* Code style

* Add doc example

* Remove dependency on aura

* Order dependencies alphabetically

* Minor style
2019-07-27 20:24:51 -04:00
André Silva 2b021ba4f1 node: Update BABE protocol parameters (#3211)
* node: update babe parameters to target 6 second block time

* node: add comment on MILLISECS_PER_BLOCK constant
2019-07-26 08:19:04 -04:00
André Silva a5efdd05d7 Use milliseconds for timestamp resolution (#3210)
* node: tabify constants file

* node: define minimum period and slot duration in milliseconds

* core: srml: use milliseconds for timestamp resolution

* core: update slot_duration to millis in tests

* node: bump spec_version

* node: fix integration test

* node: fix executor test

* Update node/runtime/src/lib.rs

Co-Authored-By: Kian Peymani <Kianenigma@users.noreply.github.com>

* node: fix docs on timestamp resolution

* node: add docs on u64 for millis
2019-07-26 08:40:15 +08:00
Kian Peymani 002acb9373 Weight annotation. (#3157)
* Make extrinsics extensible.

Also Remove old extrinsic types.

* Rest of mockup. Add tips.

* Fix some build issues

* Runtiem builds :)

* Substrate builds.

* Fix a doc test

* Compact encoding

* Extract out the era logic into an extension

* Weight Check signed extension. (#3115)

* Weight signed extension.

* Revert a bit + test for check era.

* Update Cargo.toml

* Update node/cli/src/factory_impl.rs

* Update node/executor/src/lib.rs

* Update node/executor/src/lib.rs

* Don't use len for weight - use data.

* Operational Transaction; second attempt (#3138)

* working poc added.

* some fixes.

* Update doc.

* Fix all tests + final logic.

* more refactoring.

* nits.

* System block limit in bytes.

* Silent the storage macro warnings.

* More logic more tests.

* Fix import.

* Refactor names.

* Fix build.

* Update srml/balances/src/lib.rs

* Final refactor.

* Bump transaction version

* Fix weight mult test.

* Fix more tests and improve doc.

* Bump.

* Make some tests work again.

* Fix subkey.

* Remove todos + bump.

* First draft of annotating weights.

* Refactor weight to u64.

* More refactoring and tests.

* New convert for weight to fee

* more tests.

* remove merge redundancy.

* Fix system test.

* Bring back subkey stuff.

* a few stress tests.

* fix some of the grumbles.

* Final nits.

* Update srml/system/src/lib.rs

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

* Scale weights by 1000.

* Bump.

* Fix decl_storage test.
2019-07-25 11:58:47 +02:00
Pierre Krieger b31dcdf342 Switch consensus crates to new futures (#3146)
* Switch consensus-common to new futures

* Fix tests

* More tests fixing

* Fix Babe tests

* Fix Babe tests
2019-07-25 10:55:50 +08:00
André Silva 9f50c8fce4 Use BABE instead of AuRa in node (#3171)
* babe: add babe module trait

* babe: track current slot and epoch start slot

* babe: implement ShouldEndSession based on epochs

* babe: rename weight type to avoid ambiguities

* babe: expose epoch start slot in Epoch digest

* babe: use epoch start for validating epoch transitions

* babe: make the epoch duration a parameter type

* babe: remove unused fields from config

* node: update runtime to use babe instead of aura

* node: use babe instead of aura

* core: generate sr25519 keys from seed and add to keystore

* core: remove AuthorityKeyring

* node: remove unused primitive types related to babe crypto

* uniform babe primitives crate import name

* wrap long lines

* babe: fix find_epoch_digest

* fork-tree: fix find_node_where

* node: set babe epoch duration to "10 minutes"

* babe: cleanup import key cache if authorities don't change

* node: make integration test compile (but fail)

* node: bump spec_version

* node: fix import

* babe: don't use constants in storage fields array sizes

* babe: account for first epoch slot way in the past

* babe: signal next epoch change (not current)

* babe: calculate next epoch randomness with next epoch index

* babe: track next epoch in node

* babe: cache current epoch and authorities separately

* babe: generate valid babe vrf proofs in integration test

* babe: cleanup claim_slot

* babe: perform threshold calculation according to spec

* babe: compute relative weight in threshold

* babe: more precise threshold calculation

* babe: use floats for threshold exponent calculation

* babe: update constant c
2019-07-24 15:53:04 -04:00
thiolliere 2b6f664caf Staking rate targeting and specific rewards. (#2882)
* PNPoS implementation

* wip: change staking api

* code readibility

* fix overflow

* comment

* license

* doc

* reorganize a bit

* rename to proper english + doc

* address comments

* refactor unused mock

* fix add_point

* update tests

* add not equalize to ci

* Revert "add not equalize to ci"

This reverts commit 1c61c25874b04b1cdfadd7d353b75a189a59ad35.

* bring test back

* update locks

* fix genesis config

* add authorship event handler + test

* uncouple timestamp from staking

* use on finalize instead

* remove todo

* simplify mock

* address comment

* doc

* merge test

* fmt

* remove todo todo

* move add_reward_point to regular function

* doc

* doc

* increase version

* doc and fmt

* Update srml/staking/src/inflation.rs

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

* Fix some doc typos
2019-07-25 01:25:43 +08:00
Gavin Wood 78bc5edc14 Extensible transactions (and tips) (#3102)
* Make extrinsics extensible.

Also Remove old extrinsic types.

* Rest of mockup. Add tips.

* Fix some build issues

* Runtiem builds :)

* Substrate builds.

* Fix a doc test

* Compact encoding

* Extract out the era logic into an extension

* Weight Check signed extension. (#3115)

* Weight signed extension.

* Revert a bit + test for check era.

* Update Cargo.toml

* Update node/cli/src/factory_impl.rs

* Update node/executor/src/lib.rs

* Update node/executor/src/lib.rs

* Don't use len for weight - use data.

* Operational Transaction; second attempt (#3138)

* working poc added.

* some fixes.

* Update doc.

* Fix all tests + final logic.

* more refactoring.

* nits.

* System block limit in bytes.

* Silent the storage macro warnings.

* More logic more tests.

* Fix import.

* Refactor names.

* Fix build.

* Update srml/balances/src/lib.rs

* Final refactor.

* Bump transaction version

* Fix weight mult test.

* Fix more tests and improve doc.

* Bump.

* Make some tests work again.

* Fix subkey.

* Remove todos + bump.

* Ignore expensive test.

* Bump.
2019-07-22 19:06:49 +02:00
David Craven a3d19baea3 Refactors the offchain worker api (#3150)
* Update offchain primitives.

* Update offchain worker.

* Update im-online.

* Update service.

* Update node and node-template.

* Update runtime version.

* Fix build.

* Fix offchain worker tests.

* Generalize authority_pubkey.

* Add test.

* Update lib.rs
2019-07-22 17:20:57 +08:00
Pierre Krieger 2edeef5825 ImportBlock -> BlockImportParams (#3158) 2019-07-21 18:43:02 -04:00
Michael Müller c70b81444a Introduce srml/im-online (#3079)
* Fix grammar and typo

* Extend network service

* Extend offchain API

* Support creating unsigned UncheckedExtrinsic

* Introduce srml/im-online

* Bump impl and spec version

* Fix web-wasm test

* Apply suggestions from code review

Remove parity-multiaddr dependency

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

* Replace transmute with from_raw_parts

* Replace PeerId.to_string() with .to_base58()

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

* Update Cargo.lock

* Bump impl and spec version (again)

It was updated in master in the meantime.

* Apply suggestions from code review

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

* Address comments

* Add public function is_online_in_current_session()

* Bump spec_version

* Fix doc tests

* Improve comments

* Remove superfluous line

* Name parameters consistently

* Implement comments

* Switch From to TryFrom

* Use Vec instead of HashSet

* Fix tests

* Revert me: local testing

* Fix check if already sent during session

We gossip each session, hence we need to check
if already sent in this session (not era).

* Fix typos

* Consistent terminology

* Revert "Revert me: local testing"

This reverts commit 73fbc29ff3e5ed71d99436318260b4f007e837f4.

* Introduce IsMember trait

* Implement misc comments

* Remove unused function

* Fix test

* Fix external_addresses being written

* Fix test

* Add necessary trait bound

* Do not increment version

* Update lib.rs
2019-07-20 09:19:44 +08:00
André Silva ee0f3966ba node: fix hardcoded block time in integration tests (#3120) 2019-07-15 18:26:33 +02:00
Gavin Wood e4d4548121 Convert unnecessary storage item to static. (#3093)
* Convert unnecessary storage item to static.

* Polish

* 6 second blocks.

* Compile fixes

* Bump runtime

* Fix

* Another fix

* Import `srml_support::traits::Get`

* Export MinimumPeriod from `decl_module!`

* Remove `config` from Timestamp

* Clean up warnings
2019-07-11 23:03:33 +02:00
André Silva e7edc1ee9d node: pass stash accounts to session module config (#3095)
* node: pass stash accounts to session module

* node: pass stash accounts to staking invulnerables
2019-07-11 10:21:57 +02:00
Pierre Krieger efed2e3098 Remove set_finality_proof_request_builder (#3087)
* Remove set_finality_proof_request_builder

* Fix Babe

* Fix Grandpa

* Fix service doctests
2019-07-11 09:44:32 +02:00
Gavin Wood df93867620 Technical Committee (#3041)
* Add copy of council seats as elections module.

* Split council into collective and elections modules.

Make collective instanceable.

* Propagate changes to the runtime and fix origin/event

* insert_ref and put_ref to avoid copies.

* Add tests

* Fix up collective's tests

* One more test

* Fix elections module tests

* Missed merge line

* Minor fix

* Test fixes

* Line widths

* Line widths

* Rntime version

* Remove comment

* Deduplicate

* Bump runtime again

* Fix test
2019-07-10 14:29:14 +02:00
Max Inden 6639ab339a Introduce flag to enable sentry nodes to participate in grandpa gossip (#3018)
Given the following situation: A validator 'A' is not supposed to be
connected to the public internet to protect it from e.g. a DoS attack.
Instead it connects to a sentry node 'sentry-A' which connects to the
public internet. Validator 'B' can reach validator 'A' via sentry node
'sentry-A' and vice versa.

A sentry node needs to participate in the grandpa gossip without
becoming a validator itself in order to forward these message to its
validator. This commit adds a new command line flag (`--grandpa-voter`)
forcing a node to participate in the grandpa voting process even though
no `--key` was specified. Due to the fact that it does not have a key,
it does not become a validator in the network.

In order to simulate the above situation this commit also adds a Docker
Compose file (`scripts/sentry-node/docker-compose.yml`) with further
documentation.
2019-07-09 18:35:37 +02:00
Pierre Krieger d7b6720663 Change the import queue traits to take &mut self instead of &self (#3058)
* SharedFinalityProofRequestBuilder -> BoxFinalityProofRequestBuilder

* SharedThings -> BoxThings

* Fix tests

* build_request_data now takes &mut self

* The other traits now also take &mut self

* More or less fix tests

* Fix tests

* Fix more tests

* Moar tests

* Don't call make_block_import multiple time

* Fix doctest
2019-07-09 17:11:25 +02:00
Robert Habermeier 7df8e52cfe Slash and prove membership of prior sessions (#2970)
* skeleton for tracking historical sessions

* refactor OpaqueKeys

* some more skeleton work

* adjust session to new OpaqueKeys API

* further refactoring of key-type-ids

* session gets validator ID parameter

* run up against compiler

* tweak staking to support new session changes

* first run at child storage for deduplication

* Make session use `AccountId` as `ValidatorId`

* run up against child trie issues

* switch to using normal trie but with a fixed prefix

* clear out some println

* add dedup test

* flesh out historical module more

* introduce ExposureOf for staking

* test the historical module

* WASM compiles

* tests all compile

* do some mock change

* fix bulk of tests

* fix staking tests

* test obsolecence mechanic

* Apply suggestions from code review

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

* some more style nits

* a couple more nits

* tweak tries

* fix typo thie -> this
2019-07-08 14:36:46 +02:00
David Craven 51e345c901 Generic keystore (#3008)
* Add KeyTypeId.

* Implement clone for sr25519::Pair.

* Extend Pair with to_raw_vec.

* Implement TypedKey for Signature and Pair.

* Add trait Public.

* Make keystore generic.

* Fixup clone.

* Fix tests.

* Update service.

* Fix imports.

* Fix build.

* Fix babe build.

* Fix subkey build.

* Make authority setup generic.

* Update node-template.

* Fix build.

* Remove unsafe code.

* Fix tests.
2019-07-04 13:14:55 +02:00
David Craven 336053f7ae Session keys buffered for a session. (#2946)
* Session keys buffered for the duration of a session.

* Add queued_keys getter.

* Make sure genesis state is consistent.

* Add validator_count validators.

* Compensate for session delay.

* Remove unused code.

* Add num_validators option.

* Fix session numbers.

* Fix merge.

* Reintroduce changed.

* Update runtime.

* Make NextKeyFor private.

* Move block initialization to function.

* Update lib.rs

* Add test for change propagation.

* Fix docstring.

* Use get instead of take.

* Initialize validators from keys.

* Next try.

* Fix build.

* Fix warning.

* Make initial validator selection more transparent.

* Make storage items private.

* Reorder genesis initialization.

* Update Cargo.lock

* Update runtime version.

* Update runtime version.

* Update Cargo.lock

* Update runtime version.

* Add docs.
2019-07-04 12:40:10 +02:00
Bastian Köcher fe08221479 Build WASM binaries as part of cargo build (#2868)
* Introduce `wasm-builder` and `wasm-builder-runner` to retire `build.sh`

Make use of `wasm-builder` in `test-runtime`.

* Add build script and remove the wasm project

* Port `node-runtime` to new wasm-builder

* Make `substrate-executor` tests work with `wasm-builder`

* Move `node-template` to `wasm-builder`

* Remove `build.sh` :)

* Remove the last include_bytes

* Adds the missing build.rs files

* Remove `build.sh` from CI

* Debug CI

* Make it work in CI

* CI attempt 3

* Make `substrate-runtime-test` compile on stable

* Ahhh, some missed `include_bytes!`

* AHH

* Add suggestions

* Improve search for `Cargo.lock` and don't panic if it is not found

* Searching from manifest path was no good idea

* Make the `wasm-builder` source better configurable

* Expose the bloaty wasm binary as well

* Make sure to rerun WASM recompilation on changes in dependencies

* Introduce new `WASM_BUILD_TYPE` env and make sure to call `build.rs` on
changes to env variables

* Remove `build.sh` from READMEs

* Rename the projects

* Fixes CI

* Update lock file

* Fixes merge-conflict

* Apply suggestions from code review

Co-Authored-By: TriplEight <denis.pisarev@parity.io>

* Try to make windows happy

* Replace all back slashes in paths with slashes

* Apply suggestions from code review

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

* Use cargo from `CARGO` env variable

* Fix compilation

* Use `rustup` for running the nightly build

* Make individual projects skipable

* Fix compilation

* Fixes compilation

* Build all WASM projects in one workspace

* Replace more back slashes!

* Remove `inlcude_bytes!`

* Adds some documentation

* Apply suggestions from code review

Co-Authored-By: Shawn Tabrizi <shawntabrizi@gmail.com>

* Apply suggestions from code review

Co-Authored-By: Shawn Tabrizi <shawntabrizi@gmail.com>

* More review comments

* Update `Cargo.lock`

* Set license

* Apply suggestions from code review

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

* More review comments + adds `TRIGGER_WASM_BUILD` env

* Fix doc tests

* Increase version + update README

* Switch crates.io version of `wasm-builder`

* Update README

* Switch to released version of `wasm-builder-runner`
2019-07-04 11:34:06 +02:00
David Craven cf036f685e Turn storage items into parameters (#2883)
* balances: Turn storage items into parameters.

* contract: Turn storage items into parameters.

* council: Turn storage items into parameters.

* finality-tracker: Turn storage items into parameters.

* treasury: Turn storage items into parameters.

* democracy: Fix tests.

* example: Fix tests.

* executive: Fix tests.

* staking: Fix tests.

* Update runtime.

* Update template-node.

* Update runtime version.

* Fix executor tests.

* Fix node cli tests.

* Address grumbles.

* Add removed default values to docs.

* Make gas price a storage item.

* Set associated consts must be callable outside of build.

* Fix not enough gas to pay for transfer fee.

* Fix build.

* Emit metadata.

* Fix build.

* Add default values for all parameter types.

* Fix build.

* Fix build.

* Fix build.

* Fix build.
2019-07-02 12:52:58 +02:00
Bastian Köcher 62b7c05def Implement a proper generic resolution in decl_storage! (#2913)
* Add failing test case

* move storage maps to blake2_128 (#2268)

* remove default hash, introduce twox_128 and blake2

* use blake2_128 & create ext_blake2_128

* refactor code

* add benchmark

* factorize generator

* fix

* parameterizable hasher

* some fix

* fix

* fix

* fix

* metadata

* fix

* remove debug print

* map -> blake2_256

* fix test

* fix test

* Apply suggestions from code review

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

* impl twox 128 concat (#2353)

* impl twox_128_concat

* comment addressed

* fix

* impl twox_128->64_concat

* fix test

* Fix compilation and cleanup some docs

* Lol

* Remove traits from storage types that are not generic

* Get instance test almost working as wanted

* Make `srml-support-test` compile again :)

* Fixes test of srml-support

* Fix compilation

* Break some lines

* Remove incorrect macro match arm

* Integrates review feedback

* Update documentation

* Fix compilation
2019-06-27 13:40:22 +02:00
Bastian Köcher 23ea5d1795 Remove Mutex from core-service (#2961)
* Remove `Mutex` from `core-service`

* Fixes sync test
2019-06-27 10:07:34 +02:00
Pierre Krieger 1b73b6532a Remove tokio dependencies (#2935)
* Remove dependencies on tokio

* Make service not depend on tokio

* Fix service tests

* Manually poll the import queue if failed to start

* Spawn all tasks at the end

* Remove executor from TelemetryOnConnect

* Remove TaskExecutor from offchain workers

* Remove TaskExecutor from AuthoritySetup

* Remove TaskExecutor from service

* Remove tokio dependency from RPC

* Remove finality-grandpa from WASM checks

* Fix offchain tests

* Line widths

* Fix RPC tests

* Fix service tests

* Fix bad futures polling

* Address some concerns

* Better error handling

* Is it the connectivity test that's not passing? I don't know, let's try

* Revert "Is it the connectivity test that's not passing? I don't know, let's try"

This reverts commit 28bbe51f0e2e4885fe1f901e11078604604cb212.

* Fix test
2019-06-26 17:21:17 +02:00
Stanislav Tkach 443ad90b47 Update codec version to the 4.1 version (#2948)
* Update codec version to the 4.1 version

* Bump impl_version

* Update lock files

* Update codec to 4.1.1 version

* Bump impl version
2019-06-26 16:26:24 +02:00
Jim Posen 4c52aec260 srml-contract: Fix Gas type to u64 (#2944)
* srml-contract: Move gas costs from Config to Schedule.

* srml-contract: Define Gas units fixed as u64.

This removes Gas as a configurable type on the contracts Trait.

* Bump node runtime spec/impl versions.
2019-06-26 14:17:45 +02:00
thiolliere 8b89c7ae62 Update parity-scale codec minor version (#2951)
* update parity-scale codec minor version

* update to 3.5.3

* update locks

* increase impl version

* Update to 3.5.4

* Update WASM lockfiles
2019-06-26 08:48:12 +02:00
Sergei Pepyakin 828485ec08 Rename: srml-contract → srml-contracts (#2905)
* srml-contract → srml-contracts

* Trim.

* Bump version
2019-06-19 15:26:33 +02:00