* Run offchain workers at particular hash, not number.
* Don't run if not new best.
* Don't run if not new best.
* Update client/service/src/builder.rs
Co-Authored-By: Nikolay Volf <nikvolf@gmail.com>
* Update client/service/src/builder.rs
Co-Authored-By: Nikolay Volf <nikvolf@gmail.com>
* Update client/service/src/builder.rs
Co-authored-by: Nikolay Volf <nikvolf@gmail.com>
* Clarify code a bit.
* Move code around.
* Introduce `Order`.
* Introduce `Link` structure.
* Get rid of ptr_offset
This is beneficial since ptr_offset is essentially makes us handle two different address spaces, global (i.e. `mem`) and heap local and without it things are becoming simpler.
* Rename PREFIX_SIZE to HEADER_SIZE.
This will come in the next commits.
* Introduce a separate `Memory` trait.
This is not necessary, but will come in handy for the upcoming changes.
* Rename `ptr` to `header_ptr` where makes sense.
* Introduce a `Header` type.
* Make `bump` dumber.
This allows us to pull `HEADER_SIZE` to see that we actually allocate `order.size() + HEADER_SIZE`.
* Clean up.
* Introduce a freelists struct.
* Update documentation.
* Make Sized requirement optional to make the PR truly back-compatible.
* Apply suggestions from code review
Co-Authored-By: Gavin Wood <gavin@parity.io>
* Apply suggestions from code review
Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: Gavin Wood <github@gavwood.com>
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
* Make WASM browser thing compile
* Fix
* updated exit-future (github repo)
* Switch to broadcast crate
* Migrate client/cli
* Switch exit-future to modernize branch
* Small changes
* Switch to cargo version and fix fg tests
* fix basic-authorship
* Fix crash on grafana macro
* Fix grafana macro
* Switch node python version
* Disable record_metrics_slice in grafana macro on wasm
* Update client/grafana-data-source/src/lib.rs
* Revert "Update client/grafana-data-source/src/lib.rs"
This reverts commit 888009a8e0b7051bd4bfbbfdb0448bcf2e2aae93.
* Add wasm support for state machine
* Switch to my own libp2p version
* Revert "Switch to my own libp2p version"
This reverts commit ce613871b59264b3165b45c37943e6560240daa7.
* Revert "Add wasm support for state machine"
This reverts commit de7eaa0694d9534fc3b164621737968e9a6a7c5f.
* Add sc-browser
* Squash
* remove sc-browser
* Fix keystore on wasm
* stubs for removed functions to make env compatible with old runtimes
* Add test (that doesn't work)
* Fix build scripts
* Revert basic-authorship due to no panics
* Revert cli/informant
* Revert consensus
* revert offchain
* Update utils/browser/Cargo.toml
Co-Authored-By: Benjamin Kampmann <ben@gnunicorn.org>
* export console functions
* Add new chainspec
* Fix ws in chain spec
* revert chainspec
* Fix chainspec
* Use an Option<PathBuf> in keystore instead of cfg flags
* Remove crud
* Only use wasm-timer for instant and systemtime
* Remove telemetry changes
* Assuming this is ok
* Add a KeystoreConfig
* Add stubs back in
* Update libp2p
* Revert "Add stubs back in"
This reverts commit 4690cf1882aa0f99f7f00a58c4080c8aa9b77c36.
* Remove commented js again
* Bump kvdb-web version
* Fix cli
* Switch branch on futures-timer
* Fix tests
* Remove sc-client test build in check-web-wasm because there isn't a good way to build futures-timer with wasm-bindgen support in the build
* Remove more things ^^
* Switch branch on futures-timer back
* Put DB io stats behind a cfg flag
* Fix things
* Don't timeout transports on wasm
* Update branch of futures-timer and fix bad merge
* Spawn informant
* Fix network test
* Fix delay resets
* Changes
* Fix tests
* use wasm_timer for transaction pool
* Fixes
* Switch futures-timer to crates
* Only diagnose futures on native
* Fix sc-network-test tests
* Select log level in js
* Fix syncing ;^)
* Allow disabling colours in the informant
* Use OutputFormat enum for informant
* MallocSizeOf impl on transaction pool broke stuff because wasm_timer::Instant doesnt impl it so just revert the transaction pool to master
* Update futures-diagnose
* Revert "MallocSizeOf impl on transaction pool broke stuff because wasm_timer::Instant doesnt impl it so just revert the transaction pool to master"
This reverts commit baa4ffc94fd968b6660a2c17ba8113e06af15548.
* Pass whole chain spec in start_client
* Get Instant::now to work in transaction pool again
* Informant dep reordering
Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: Svyatoslav Nikolsky <svyatonik@gmail.com>
Co-authored-by: Benjamin Kampmann <ben.kampmann@googlemail.com>
Co-authored-by: Demi Obenour <48690212+DemiMarie-parity@users.noreply.github.com>
* Init epoch changes module
* Initial integration of new epoch changes module for BABE
* Fix all initial compile errors
* rename: digest -> digests
* Fix babe tests
* Bump impl_version
* Fix more test issues
* Remove test flag for tree
It unfortunately won't work for multiple crates.
* Update cargo lock
* Fix duplicate parking_lot version
* Add missing license header
* FreeingBumpAllocator: Initialize the heads to `u32::max_value()`
`self.heads` can point to an element with the index `0` in the heap.
This would make the allocator fail to reuse this element.
* Simplify the `PREFIX_SIZE` handling
* Fix memory leak in runtime interface
We used `slice::from_raw_parts` in runtime-interface which did not free
the memory afterwards. This pr changes it to `Vec::from_raw_parts` to
make sure `drop` is called properly and the values are freed.
* Check that `len` is non-zero
* Adds comment
When messing with the signature, we need to make sure that we acutally
mess-up the signature. As the generated private/public key is random,
the signature is random as well. It can happen that `bytes[0] ==
bytes[2]` which makes the test fail. We fix this problem by just
inverting the bytes at `0` and `2`.
* block_import: switch to Box<dyn Any> for intermediates representation
* Use Cow and return Error instead of Option
* Remove unused error
* Distinguish NoIntermediate/InvalidIntermediate
* Adding Serde:Deserialise to UncheckExtrinsics
to be able to use the ChainApi RPC from the client side
* Update primitives/runtime/src/generic/unchecked_extrinsic.rs
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
* Expose information about the extrinsic in the metadata
This pr exposes some information about the extrinsic used in the runtime
via metadata. The following information are exposed:
- Version of the extrinsic
- List of all signed extensions used by the extrinsic.
* Increment `spec_version`
It changes the way we extended the CLI functionalities of substrate to allow more flexibility. (If this was not clear, here is another version: it changes the `sc_cli` API to allow more flexibility).
This touches a few important things:
- the startup of the async task with tokei:
This was in node and node-template and I moved it to substrate. The idea is to have 1 time the code that handles unix signals (SIGTERM and SIGINT) properly. It is however possible to make this more generic to wait for a future instead and provide only a helper for the basic handling of SIGTERM and SIGINT.
- increased the version of structopt and tokei
- no more use of structopt internal's API
- less use of generics
Related to #4643 and https://github.com/paritytech/cumulus/pull/42: the implementation of "into_configuration" and "get_config" are similar but with better flexibility so it is now possible in cumulus to have the command-line arguments only of the run command for polkadot if we want
Related to https://github.com/paritytech/cumulus/issues/24 and https://github.com/paritytech/cumulus/issues/34 : it will now be possible to make a configuration struct for polkadot with some overrides of the default parameters much more easily.
* Print extrinsic failed error always, not just on import
Before we printed the error of a transaction only when importing a
block, this pr changes it to print the error also at building the block.
* Increment `impl_version`
* WASM runtime switch to import memory
Up to now runtimes have exported their memory. To unify it with
sandboxing, this pr switches runtimes to import memory as well.
From a functional perspective, exporting/importing memory makes no
difference to the runtime.
To provide backwards compatibility, WASM exported memory is still supported.
* Revert debug stuff
* Revert some stuff
* instant/manual seal
unbounded queues are evil
Apply suggestions from code review
Co-Authored-By: Robert Habermeier <rphmeier@gmail.com>
add fork tests, docs, remove todos
moar docs
Update client/consensus/manual-seal/src/rpc.rs
Co-Authored-By: Robert Habermeier <rphmeier@gmail.com>
remove unbound generic, parameter, docs, deps, code style changes
Apply suggestions from code review
Co-Authored-By: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
code style chnges
remove unused deps, remove dep renames, check if block is empty before importing, use ? for error propagation
fix tests
log errors for instant seal
use debug
code style changes, updated copyright dates
use txpool::Pool instead of BasicPool, code style changes
fixed tests
* fix tests
* requested changes from review
* check inherents len
* rebase
* Introduces `author_hasKey` and `author_hasSessionKeys` rpc endpoints
Both endpoints can be used to check if a key is present in the keystore.
- `hasKey` works on with an individual public key and key type. It
checks if a private key for the given combination exists in the
keystore.
- `hasSessionKeys` works with the full encoded session key blob stored
on-chain in `nextKeys`. This requires that the given blob can be decoded
by the runtime. It will return `true`, iff all public keys of the
session key exist in the storage.
Fixes: https://github.com/paritytech/substrate/issues/4696
* Update client/rpc-api/src/author/error.rs
Co-Authored-By: Nikolay Volf <nikvolf@gmail.com>
* Indentation
Co-authored-by: Nikolay Volf <nikvolf@gmail.com>
* consensus, pow: intermediate separation and fail
* Fix compiles
* Update primitives/consensus/common/src/block_import.rs
Co-Authored-By: Robert Habermeier <rphmeier@gmail.com>
* Update primitives/consensus/common/src/block_import.rs
Co-Authored-By: Robert Habermeier <rphmeier@gmail.com>
* Document what None means for `fork_choice` in block import params
Co-authored-by: Robert Habermeier <rphmeier@gmail.com>