* grandpa: initial structure for catch up messages
* grandpa: answer catch up requests
* grandpa: inject catch up messages into global stream
* grandpa: keep track of pending catch up request
* grandpa: block catchup until all referenced blocks are imported
* grandpa: unify catch up and commit streams
* grandpa: simplify communication stream/sink types
* grandpa: note gossip validator on catch up message import
* grandpa: fix cost on catch up message validation
* grandpa: check signatures on catch up messages
* grandpa: clean up catch up request handling state
* grandpa: adjust costs on invalid catch up requests
* grandpa: release lock before pushing catch up message
* grandpa: validate catch up request against peer view
* grandpa: catch up docs
* grandpa: fix tests
* grandpa: until_imported: add tests for catch up messages
* grandpa: add tests for catch up message gossip validation
* grandpa: integrate HistoricalVotes changes
* grandpa: add test for neighbor packet triggering catch up
* grandpa: add test for full voter catch up
* grandpa: depend on finality-grandpa 0.8 from crates
* granda: use finality-grandpa test helpers
* grandpa: add PSM cost for answering catch up requests
* grandpa: code style fixes
Co-Authored-By: Robert Habermeier <rphmeier@gmail.com>
* grandpa: more trailing commas
* grandpa: lower cost of invalid catch up requests near set change
* grandpa: process catch up sending on import of neighbor message
* grandpa: add comments on HistoricalVotes
* grandpa: use finality-grandpa v0.8.1 from crates.io
* grandpa: fix test compilation
* srml-contract: Refactor to reduce unnecessary storage lookups.
* srml-contract: Fail calls to removed contracts.
Previously, the calls would transfer funds and succeed without executing
any code on the target account, which is unintuitive behavior.
* Bump node runtime spec/impl versions.
* 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`
* Can now disable the keystore
* Fix service test
* Apply suggestions from code review
Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>
* Fix cli
* Initial work on exposing pre-runtime digests
This provides the primitive API, as well as exposing it from BABE.
* Initial work on using pre-digests in runtimes
This includes both code to expose them from `srml_system`, as well as
using it in (currently dead) code in `srml_babe`.
* Bump `{spec,impl}_version`
* Add `u64_backend` feature to curve25519-dalek
Otherwise, it errors out at compile-time.
* Bump `Cargo.lock`
* Do not depend on the schnorrkel crate in the runtime
The schnorrkel crate does not work on `#![no_std]`, but the runtime only
needs constants from it. This adds our own definitions of those
constants, and checks them for correctness at compile-time.
* Actually implement storage of VRF outputs
* Trivial formatting change
* Provide a `hash_randomness` function in BABE
for processing VRF outputs.
* Implement a basic randomness generating function
It just XORs the VRF outputs together.
* Actually implement on-chain randomness
Blake2b is used for hashing.
* Update dependencies
* Run `cargo update` where needed
* Re-add a newline at EOF
* Remove broken and unsafe code
XOR is not a hash function, and must not be used as such. The
implementation was also needlessly unsafe.
* Run `cargo update` where needed
* Remove spurious dependency
* Document security guarantees of BABE randomness
* Add a `RandomnessBeacon` trait
* Document `RandomnessBeacon::random`
* Fix silly compile error (unexpected type arguments)
* Fix BABE randomness
* Implement `FindAuthor` for `babe::Module`
* Apply suggestions from code review
Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>
Co-Authored-By: Robert Habermeier <rphmeier@gmail.com>
* Respond to suggestions from code review and fix bugs
* Store an authority index, not the authority itself.
* Avoid unnecessary decoding.
* Implement relative slots and BABE randomness fully and correctly.
* Remove spurious dependency
* Fix error reported by rust-analyzer
* Update Cargo.lock files
* `wrapping_add` → `checked_add`
The epoch index will not overflow. Panic if it does.
* Move randomness documentation to trait
* Fix compile error in test suite
* Explain 2^64 limit
Co-Authored-By: Robert Habermeier <rphmeier@gmail.com>
* Fix DiscoveryBehaviour::poll.
The previous implementation regularly returned `NotReady` from `poll`
despite the inner Kademlia behaviour having events ready, thus letting
the `poll`ing be largely driven by the task wakeups from the Delay for
the next random Kademlia query, inducing major delays in consuming
the ready Kademlia events and thus slowing progress.
The discovery test now passes quickly, as expected.
* Ensure the Delay is polled right after reset.
For task wakeup.
* Some cleanup
* Add module constant metadata declaration
* Begin to integrate the constants in `decl_module`
* Fixes tests
* Fix compilation and add tests
* Remove duplicate code
* Expose constants in democracy and staking + further fixes
* Update srml/metadata/src/lib.rs
Co-Authored-By: YJ <yjkimjunior@gmail.com>
* Hide `RawEvent` metadata function
* Prevent whitespaces in types
* Fix `offchain_worker` and `constants` with instances
* Up the `impl_version`
* Fix macro
* Incrase impl_version
This macro compiles and executes the given code only when `std` feature
is enabled. This can be useful for debugging without needing to worry
that your code does not compile on `no_std`.
* 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
* check resulting state root on import.
* get root from last method.
* Fix test runtime (was changing state after root calculation).
* Do reset new authorities (just take before root calculation).
* bump impl runtime version.
* Update core/sr-api-macros/tests/trybuild.rs
Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>
* 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.
* generalized uncle processing
* add some uncle tests
* set author and do event handling
* OnePerAuthorPerHeight no longer O(n^2) and test
* bump impl_version of node
* Documentation and style fixes
Co-Authored-By: DemiMarie-parity <48690212+DemiMarie-parity@users.noreply.github.com>
* fix#2949: index-based FindAuthor wrapper for srml-session
* use for_each_tuple