Commit Graph

62 Commits

Author SHA1 Message Date
Pierre Krieger 8bca52128f Adjust the RPC service for the WASM-browser use case (#3013)
* Use SpawnTaskHandle to pass to the RPC

* Create the RPC server in lib.rs

* Create the RPC servers in a separate function

* Keep a local version of the RPC handlers

* Make rpc-servers compile for WASM

* Add RpcSesssion

* Clean up

* Address review

* Address pull request review
2019-07-05 09:55:50 +02:00
Bastian Köcher ae80c05232 Fix node-template-release and make cargo doc faster (#3019) 2019-07-04 16:26:03 +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
gabriel klawitter 6acef99561 ci: add job to test staking in srml (#2995)
* ci: add job to test staking in srml

* restrict on code changes

* test whole package

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

* add --release --verbose flags
2019-07-02 20:03:46 +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
gabriel klawitter faabbb15c1 Ci publish rustdocs GitHub (#2895)
* ci: publish rustdocs to github repo substrate-developer-hub/rustdocs
2019-06-18 12:20:53 +02:00
Gavin Wood bda8641892 New sessions, kill consensus module (#2802)
* Draft of new sessions

* Reintroduce tuple impls

* Move staking module to new session API

* More work on staking and grandpa.

* Use iterator to avoid cloning and tuple macro

* Make runtime build again

* Polish the OpaqueKeys devex

* Move consensus logic into system & aura.

* Fix up system module

* Get build mostly going. Stuck at service.rs

* Building again

* Update srml/staking/src/lib.rs

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

* Refactoring out Consensus module, AuthorityIdOf, &c.

* Refactored out DigestItem::AuthoritiesChanged. Building.

* Remove tentative code

* Remove invalid comment

* Make Seal opaque and introduce nice methods for handling opaque items.

* Start to use proper digest for Aura authorities tracking.

* Fix up grandpa, remove system::Raw/Log

* Refactor Grandpa to use new logging infrastructure.

Also make authorityid/sessionkey static. Switch over to storing
authorities in a straight Vec.

* Building again

* Tidy up some AuthorityIds

* Expunge most of the rest of the AuthorityKey confusion.

Also, de-generify Babe and re-generify Aura.

* Remove cruft

* Untangle last of the `AuthorityId`s.

* Sort out finality_tracker

* Refactor median getting

* Apply suggestions from code review

Co-Authored-By: Robert Habermeier <rphmeier@gmail.com>

* Session tests works

* Update core/sr-primitives/src/generic/digest.rs

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

* Session tests works

* Fix for staking from @dvc94ch

* log an error

* fix test runtime build

* Some test fixes

* Staking mock update to new session api.

* Fix build.

* Move OpaqueKeys to primitives.

* Use on_initialize instead of check_rotate_session.

* Update tests to new staking api.

* fixup mock

* Fix bond_extra_and_withdraw_unbonded_works.

* Fix bond_with_little_staked_value_bounded_by_slot_stake.

* Fix bond_with_no_staked_value.

* Fix change_controller_works.

* Fix less_than_needed_candidates_works.

* Fix multi_era_reward_should_work.

* Fix nominating_and_rewards_should_work.

* Fix nominators_also_get_slashed.

* Fix phragmen_large_scale_test.

* Fix phragmen_poc_works.

* Fix phragmen_score_should_be_accurate_on_large_stakes.

* Fix phragmen_should_not_overflow.

* Fix reward_destination_works.

* Fix rewards_should_work.

* Fix sessions_and_eras_should_work.

* Fix slot_stake_is_least_staked_validator.

* Fix too_many_unbond_calls_should_not_work.

* Fix wrong_vote_is_null.

* Fix runtime.

* Fix wasm runtime build.

* Update Cargo.lock

* Fix warnings.

* Fix grandpa tests.

* Fix test-runtime build.

* Fix template node build.

* Fix stuff.

* Update Cargo.lock to fix CI

* Re-add missing AuRa logs

Runtimes are required to know about every digest they receive ― they
panic otherwise.  This re-adds support for AuRa pre-runtime digests.

* Update core/consensus/babe/src/digest.rs

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

* Kill log trait and all that jazz.

* Refactor staking tests.

* Fix ci runtime wasm check.

* Line length 120.

* Make tests build again

* Remove trailing commas in function declarations

The `extern_functions!` macro doesn’t like them, perhaps due to a bug in
rustc.

* Fix type error

* Fix compilation errors

* Fix a test

* Another couple of fixes

* Fix another test

* More test fixes

* Another test fix

* Bump runtime.

* Wrap long line

* Fix build, remove redundant code.

* Issue to track TODO

* Leave the benchmark code alone.

* Fix missing `std::time::{Instant, Duration}`

* Indentation

* Aura ConsensusLog as enum
2019-06-14 16:34:34 +02:00
TriplEight 0f44a28ce3 Cargo check benches (#2862)
* add job
2019-06-14 12:58:09 +02:00
Pierre Krieger 12bbc2ffd9 Merge network-libp2p into network (#2843)
* Move network-libp2p into network

* Merge libp2p_service into service

* Don't expose RegisteredProtocol in the API

* Extract DiscoveryBehaviour from Behaviour

* Restore libp2p tests

* Add a test for discovery

* Line width

* Remove bandwidth check

* Fix gitlab
2019-06-13 18:21:31 +02:00
ddorgan c1654ecd23 Allow check-runtime to fail (#2845)
* Allow check-runtime to fail

* Do not allow the line-width to fail

* Allow failure on line-check
2019-06-11 17:26:13 +02:00
TriplEight cf8a021e22 fix job (#2842) 2019-06-11 15:14:50 +02:00
TriplEight c24d278365 subkey build, cargo audit (#2752)
* subkey build, cargo audit

* some fixes

* cleanup

* review

* not to be launched on PRs

* not to be launched on PRs 2

* check-runtime should run on PRs only

* changed only to except, easier to read

* fix no jobs ran

* only: rewrites when it's last

* only: -branches wasn't needed

* benching subkey build

* benching subkey build 2

* subkey check

* not for 1.0

* cleanup
2019-06-11 10:29:17 +02:00
Pierre Krieger ac895023be More crate compiling for WASM-browser (#2825)
* More crate compiling for WASM-browser

* Update runtime Cargo.lock
2019-06-07 16:06:15 +02:00
Pierre Krieger 57afa9b440 Rewrite telemetry using libp2p (#2812)
* Rewrite telemetry using libp2p

* Update the Cargo.lock files

* Apply suggestion
2019-06-06 22:15:38 +02:00
Pierre Krieger f210557211 Require --locked when building runtime (#2813)
* Require --locked when building runtime

* Update locks

* Do it in a different way

* Accidentally reverted Cargo.lock

* pass on arguments in build.sh scripts
2019-06-06 15:53:22 +02:00
Svyatoslav Nikolsky 012ce5878b Restore integration tests (#2620)
* restored test_consensus

* restored test_sync

* run integration tests only on CI

* use single test-thread for integration tests

* post-merge fix

* panic when integration test runs for too long

* add some traces to integration logs

* manual wait -> timeout

* post-merge fix

* post-merge fix
2019-06-05 09:16:14 +02:00
Bastian Köcher 4d476161e2 Generate docs for all workspace crates (#2773) 2019-06-04 10:14:46 +02:00
DemiMarie-parity c7d1204ce5 Introduce inherent digests (#2466)
* Introduce inherent digests

* Implement inherent digests

* fix silly error

* Implementation of inherent digests in BABE

All tests pass. There are still limitations:

1. The runtime strips out inherent digests, so BABE must re-add them.
2. The test runtime checks that it can re-compute all digests.  It
   can’t, so I had to comment out that test.

* Fix compilation and seal import

Seals were not imported correctly: the pre-digest was imported twice,
instead of both it and the seal being imported.  Also, other parts of
the code did not compile due to incomplete refactoring.

* Remove bogus assertion

* Fix testsuite compilation

* Remove unused import

* Fix compiler diagnostics

* Add inherent digest parameters to block constructors

This enforces that inherent digests are added first.

* Fixup Cargo.lock

* Fix build errors

* Re-add an incorrectly removed import

* Bump primitive-types version

* Update Cargo.lock

* Refactoring

* Use inherent digests for AuRa

They do reach the runtime, but get stripped.  I have not figured out
where.

* Fix compilation errors

* Fix compilation errors due to incorrect types

* Fix whitespace

Suggested-by: Tomasz Drwiega <tomasz@parity.io>

* Add preamble

Suggested-by: Tomasz Drwiega <tomasz@parity.io>

* Fix silly compile error

* Refactor pre-digest finding code into a separate function

* Remove unwanted assertion

It is too likely to bring down the entire blockchain.

Suggested-by: Tomasz Drwiega <tomasz@parity.io>

* Use `find_pre_digest` after runtime, too

Also, use `Member` trait rather than rolling our own requirements.

Suggested-by: Tomasz Drwiega <tomasz@parity.io>

* Fix various warnings

mostly due to upgrading the dependency on `error_chain`.

* Pre-digests nearly complete

This nearly completes the implementation of pre-runtime digests.

* `Seal2` → `Seal` and fix test suite

* Try to fix the storage error

* Try to fix storage (again)

* Fix tests

* Hopefully finish pre-runtime digests

The key is to pass *only* the pre-runtime digests to the runtime.  The
others must be stripped out by `initialize_block`.

* Fix silly typo

* Fix another silly mistake

* Remove unnecessary filtering of BABE pre-digests

We no longer get duplicate BABE pre-digests, so if they appear, the
header should be rejected outright.

* Update Cargo.lock files

* Reformatting

* Fix silly typo in inherent digest code

Also, revert `error.rs` files that contained calls to the `error_chain!`
macro.

* Try to keep the runtime from stripping pre-digests

Currently runs into the “Storage root must match that calculated”
assertion.

* Don’t compute storage root until storage changes are done.

Also, fix a compilation error.

* Fix compile-time error

* Fix compilation errors

* Fix more compile errors

* Hopefully it compiles this time…

* Fix compilation and add docs

* Prevent BABE from adding duplicate pre-runtime digests

Found by comparing with the AuRa code.  I also did some refactoring.

* Respond to review and fix some warnings

* Delete some dead code introduced earlier

* More dead code goes away

* `ref mut` → `&mut`

* Respond to review and fix some warnings

* Fix compilation error

* Remove unneeded `HashT` type parameter

Suggested-by: Robert Habermeier <robert@parity.io>

* Remove spurious #[allow(deprecated)]

* Document inherent digest parameter to `build_block`

* Delete `Simple` trait

It wasn’t needed

* delete wrongly added files

* Fix trait bounds

* Digest serialization tests

I also did some reformatting and cleanup.

* Apply suggestions from code review

Reformatting

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

* Swap two arguments to `propose` and `propose_with`

Also, remove some needless unsafe code.

* Remove bogus `#![allow(deprecated)]` annotations

With the removal of the deprecated `Seal` variant, these are not needed.

* Add a missing `#[allow(deprecated)]` in the AuRa tests

* Fix silly compile error

* Fix silly compiler error

RLS did not tell me that I hadn’t fixed `babe/lib.rs`, so I missed it.

* Fixes made automatically by Cargo
2019-05-29 14:13:38 +02:00
TriplEight 672b72f44a some prettiness, fix dockerfile's metadata (#2682) 2019-05-27 14:06:38 +02:00
TriplEight fa08a1e35c rust versions (#2681) 2019-05-24 12:24:37 +02:00
Pierre Krieger dda04eef38 Remove dependency on parity-crypto (#2655) 2019-05-23 10:28:35 +01:00
ddorgan a827869dfb Flaming fir deployment scripts (#2599)
* Initial commit of flaming fir deployment scripts

* Debug

* Fix formatting

* Correct wget syntax

* Use 8 char commit id

* 9 chars

* Use the longer CI_BUILD_REF ref to slice from

* Fix backtick error with flaming fir deploy script

* Use the correct commit id length

* Split out validator deploments

* Fix syntax, missing :

* Pass hostname as TARGET_HOST per validator

* Correct syntax

* Uncomment wget

* Switch deploy -> kubernetes

* Use full group name

* Check awx log

* Fix if syntax and ignore failed

* Use correct JOB_ID and fix if syntax

* Use correct variable

* Print ansible awx log and status

* Make awx status clearer

* make variable names consistent

* Do 15 second checkups on the job

* Remove extra echo

* Use artifacts/VERSION instead of gitlab variables

* Use all of the VERSION info
2019-05-18 21:50:38 +01:00
TriplEight 9ad96e50ac Dockerfile optimization (#2598)
* metadata for docker image

* metadata for docker image
2019-05-16 14:36:27 +02:00
TriplEight 9ea689bdef check-web-wasm now uses the default builder image (#2583) 2019-05-14 18:28:01 +02:00
gabriel klawitter 7fb3dc5f68 check line-width of only newly added lines (#2522)
* strictly require <= 120 characters
2019-05-13 17:51:09 +02:00
TriplEight 3b0eca992c Tag for wasm check job (#2538)
* tag for wasm tst
2019-05-13 16:31:29 +02:00
Pierre Krieger cad1f19d48 Make more crates compile for WASM browser (#2524)
* Make more crates compile for WASM browser

* More crates

* Update .gitlab-ci.yml

Co-Authored-By: Sergei Pepyakin <s.pepyakin@gmail.com>
2019-05-09 17:41:50 +01:00
TriplEight 1761a7fcd1 universal docker builder for substrate-based projects (#2453) 2019-05-02 20:31:43 +02:00
Pierre Krieger 3c42e6d4f0 Try run check-web-wasm for PRs (#2424) 2019-05-01 09:47:51 +02:00
Pierre Krieger 0b6490854d Make libp2p compile for wasm32-unkown-unknown (#2412)
* Make libp2p compile for wasm32-unkown-unknown

* Fix tests

* Add some crates
2019-04-29 16:07:40 +02:00
TriplEight 1aec6d6fa0 image name was changed, pipeline will fail (#2397) 2019-04-27 20:02:02 +02:00
ddorgan ef7084c47a Use aws image for s3-docs upload (#2389) 2019-04-26 14:18:54 +02:00
Bastian Köcher beadb4b1bd Build wasm files in doc release pipeline (#2340) 2019-04-23 10:31:25 +02:00
TriplEight 7e1ac69791 set size as a global var (#2280) 2019-04-15 18:23:34 +02:00
gabriel klawitter 728f0393c7 ci: remove ci for automated wasm rebuilds (#2168) 2019-04-02 12:19:52 +02:00
TriplEight 0f3363d681 new Dockerfile, new cache (#2122)
* new Dockerfile, new cache

* typo

* test build with cache

* Update .gitlab-ci.yml

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

* Update .gitlab-ci.yml

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

* Update .gitlab-ci.yml

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

* cleanup

* done

* cosmetics

* removed unneded lines
2019-04-02 10:34:01 +02:00
gabriel klawitter 53f40c583d Ci update names and chart (#2076)
* add option to specifiy substrate node name via environment variable file

* gitlab-ci: change job names and adopt to polkadot pipeline

* upgrade helm chart

Signed-off-by: gabriel <gabriel@parity.io>
2019-03-22 13:13:37 +01:00
Bastian Köcher 32ae38c79d Build docs with nightly (#2006) 2019-03-15 12:34:53 +01:00
gabriel klawitter 7c1d1268ef fix VERSION transport between stages (#1888) 2019-02-28 10:13:30 +01:00
gabriel klawitter ea7da0d4a4 allow the whole doc pipeline to fail (#1881) 2019-02-27 14:17:19 +01:00
gabriel klawitter f5c32f71f4 ci: add kubernetes helm chart and gcp deployment (#1854)
* ci: add kubernetes helm chart and gcp deployment

* use official or parity's docker images only
2019-02-27 12:37:10 +01:00
gabriel klawitter 797de27d2b allow build:rust:doc:release job to fail (#1812) 2019-02-17 10:12:27 +01:00
gabriel klawitter 3cbf2bc9c4 gitlab-ci: merge-test stage (#1752) 2019-02-15 14:54:21 +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
gabriel klawitter 94e1e38008 build tagged versions (#1712) 2019-02-06 18:17:20 +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
gabriel klawitter 8aae19e2db fix cache clearing error (#1703) 2019-02-06 12:40:36 +01:00
gabriel klawitter 888e7bb76f add test for wasm runtime changes (#1612)
* add test for wasm runtime changes

* use default container

* disable cache for runtime source test

* compare spec_versions directly
2019-02-05 10:50:44 +01:00
Sergei Pepyakin 6e08b64e49 Enable debug assertions while building tests (#1472)
* Add debug-assertions=y

* Return space
2019-01-17 22:06:23 +01:00
gabriel klawitter 04175ddc83 [CI] Publish rustdoc (#1446)
* build rust docs and publish them on s3

* fix yaml anchors

* debug i

* debug fix

* typo

* add doc build caching

* cache doc artifacts

* test caching

* more caching, aws tuning

* debug i

* debug ii

* rework caching

* send to substrate_service/index.html per default
2019-01-16 12:17:57 +01:00