* 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>
* Make debug builds more usable
This pr makes debug builds more usable in terms of `cargo run -- --dev`.
1. `--dev` activates `--execution native`, iff `--execution` is not
given or no sub `--execution-*` is given.
2. It was probably a mistake to compile WASM in debug for a debug build.
So, we now build the WASM binary always as `release` (if not requested
differently by the user). So, we trade compilation time for a better
debug experience.
* Make sure we only overwrite default values
* Make it work
* Apply suggestion
* Add `max_members` to `found`, add society genesis for Substrate node
* Update test
* Use `Option<bool>` rather than `Option<()>`
* Update from feedback
* reset a couple of versions down from v0.2.0
* Unstablise browser-utils (very new) and grafana-data-source (going to be replaced with prometheus sometime)
* unmark a bunch more client crates for stabilization
* fix versions in Cargo.tomls
* Downgrade network-test
* Set frame-metadata version to `10.0.0`
* Hide and documented storage generator as internal api
* Downgrade `sp-externalities`
* Downgrade `sc-cli`
* Downgrade sc-executor et al to 0.8.0
* Downgrade sp-state-machine to 0.8.0
* Downgrade pallet-contracts et al to 0.8.0
* Downgrade sp-sandbox to 0.8.0
* downgrade pallet-evm to 0.8.0
* Downgrade pallet-staking to 0.8.0
2.0 should be implementation of lazy payout alongside all the fixes of
current module
* Downgrade node-transaction-factory to 0.8.0
* frame pallets are 2.0.0
Co-authored-by: Ashley <ashley.ruglys@gmail.com>
Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: Sergei Pepyakin <s.pepyakin@gmail.com>
Co-authored-by: Wei Tang <accounts@that.world>
Co-authored-by: thiolliere <gui.thiolliere@gmail.com>
Co-authored-by: Marcio Diaz <marcio@parity.io>
* Extend `Proposer` to optionally generate a proof of the proposal
* Something
* Refactor sr-api to not depend on client anymore
* Fix benches
* Apply suggestions from code review
Co-Authored-By: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
* Apply suggestions from code review
* Introduce new `into_storage_changes` function
* Switch to runtime api for `execute_block` and don't require `H256`
anywhere in the code
* Put the `StorageChanges` into the `Proposal`
* Move the runtime api error to its own trait
* Adds `StorageTransactionCache` to the runtime api
This requires that we add `type NodeBlock = ` to the
`impl_runtime_apis!` macro to work around some bugs in rustc :(
* Remove `type NodeBlock` and switch to a "better" hack
* Start using the transaction cache from the runtime api
* Make it compile
* Move `InMemory` to its own file
* Make all tests work again
* Return block, storage_changes and proof from Blockbuilder::bake()
* Make sure that we use/set `storage_changes` when possible
* Add test
* Fix deadlock
* Remove accidentally added folders
* Introduce `RecordProof` as argument type to be more explicit
* Update client/src/client.rs
Co-Authored-By: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
* Update primitives/state-machine/src/ext.rs
Co-Authored-By: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
* Integrates review feedback
* Remove `unsafe` usage
* Update client/block-builder/src/lib.rs
Co-Authored-By: Benjamin Kampmann <ben@gnunicorn.org>
* Update client/src/call_executor.rs
* Bump versions
Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
Co-authored-by: Benjamin Kampmann <ben.kampmann@googlemail.com>
* Initial run and gun at `OnReapAccount`
* Fix some imports
* More fixes
* Whitespace
* More wack-a-mole
* Gotta catch em all
* Update lib.rs
* Small doc update
* Whitespace
* Make `decl_error!` errors usable
This pr implements support for returning errors of different pallets in
a pallet. These errors need to be declared with `decl_error!`.
The pr changes the following:
- Each dispatchable function now returns a `DispatchResult` which is an
alias for `Result<(), DispatchError>`.
- `DispatchError` is an enum that has 4 variants:
- `Other`: For storing string error messages
- `CannotLookup`: Variant that is returned when something returns a
`sp_runtime::LookupError`
- `BadOrigin`: Variant that is returned for any kind of bad origin
- `Module`: The error of a specific module. Contains the `index`,
`error` and the `message`. The index is the index of the module in
`construct_runtime!`. `error` is the index of the error in the error
enum declared by `decl_error!`. `message` is the message to the error
variant (this will not be encoded).
- `construct_runtime!` now creates a new struct `ModuleToIndex`. This
struct implements the trait `ModuleToIndex`.
- `frame_system::Trait` has a new associated type: `ModuleToIndex` that
expects the `ModuleToIndex` generated by `construct_runtime!`.
- All error strings returned in any module are being converted now to `DispatchError`.
- `BadOrigin` is the default error returned by any type that implements `EnsureOrigin`.
* Fix frame system benchmarks
* clean up cargo.toml syntax
* bumping versions to 2.0
* bump networking to 0.8
* move consensus down to 0.8
* bump consensus pallets to 0.8.0, too
* Upping babe and aura pallets
* add remaining, missing version definitions
* missed some
* Add `swap` and `decode_len` to `DoubleMap`
* Add tests to `swap` and `decode_len` for `DoubleMap` (WIP)
* Address review comments
* Remove function that is not in scope
* fix test
* better naming
* Adding script for rename, could be applicable for nodes on top of it, too
* add stderr and gitlab ci features
* apply script
* fix now minor details in expected stderr
* Update the Cargo.lock
* fix name: sc-transaction -> sc-tracing
* fix rename in script, too
* define slashing spans
* tests and pruning for slashing-spans record
* validators get slashed before nominators
* apply slash to nominators as well
* chill and end slashing spans
* actually perform slashes
* integration (tests failing)
* prune metadata
* fix compilation
* some tests for slashing and metadata garbage collection
* correctly pass session index to slash handler
* test span-max property for nominators and validators
* test that slashes are summed correctly
* reward value computation
* implement rewarding
* add comment about rewards
* do not adjust slash fraction in offences module
* fix offences tests
* remove unused new_offenders field
* update runtime version
* fix up some docs
* fix some CI failures
* remove no-std incompatible vec! invocation
* try to fix span-max rounding error
* Update srml/staking/src/slashing.rs
Fix type: winow -> window
Co-Authored-By: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
* slashes from prior spans don't kick validator again
* more information for nominators, suppression
* ensure ledger is consistent with itself post-slash
* implement slash out of unlocking funds also
* slashing: create records to be applied after-the-fact
* queue slashes for a few eras later
* method for canceling deferred slashes
* attempt to fix test in CI
* storage migration for `Nominators`
* update node-runtime to use SlashDeferDuration
* adjust migration entry-points somewhat
* fix migration compilation
* add manual Vec import to migration
* enable migrations feature in node-runtime
* bump runtime version
* update to latest master crate renames
* update to use ensure-origin
* Apply suggestions from code review
use `ensure!`
Co-Authored-By: Gavin Wood <gavin@parity.io>
* fix multi-slash removal
* initialize storage version to current in genesis
* add test for version initialization
* Implement all storage after prefix
* fix test, bump version and fix doc
* bump metadata version
* Update frame/support/procedural/src/storage/storage_struct.rs
* Remove superflous errors from the system module
* Rename and document InclusionOutcome
* Rename InclusionError
* Remove unused inclusion errors.
I left the enumeration though since other elements might be used some day.
* Rename and document DispatchOutcome
* Apply suggestions from code review
Co-Authored-By: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
* TransactionValidityError instead of InclusionError
* Rename InclusionOutcome to ApplyExtrinsicResult
* Update docs.
* Update lib.rs
should be → is
* Bump the block builder API version.
* Fix the should_return_runtime_version test
* Clean the evidence
* Publish the dispatch info in extrinsic events
Place the DispatchInfo (which contains weight information about the
extrinsic that is otherwise difficult to determine) in the dispatch
result value.
* Runtime bump.
* Fix build
* Fix tests
* Fix build?