* Strip out control codes from the logged messages
* Also strip away C1 control codes
* Add extra comments
* Clear the buffer after flushing; rename `write` to `flush`
* Move control code stripping into its own function
* Also strip out control codes from panic messages
* Also strip out Unicode left-to-right/right-to-left control codes
* Fuzzer for Pallet Bags List
* Some small updates
* Fuzzer for Pallet Bags List
This PR adds a fuzzer for the `SortedListProvider` API exposed by pallet-bags-list.
* Feature gate code NOT used by fuzz feature
* Create Enum for list actions
* fix some small mistakes
* try and make CI happy
* fmt
* Do not insert before updating
* clean up some misc. comments
* marginally improve Node::sanity_check
* Change ID_RANGE to 25_000
* comma
* try improve correct feature gating so no unused code
Co-authored-by: thiolliere <gui.thiolliere@gmail.com>
* Offchain-worker: Make it possible to disable http support
If a chain doesn't require http support in its offchain workers, this pr enables them to disable the
http support.
* Switch to bitflags
* Use Capabilities
* Update client/offchain/src/lib.rs
Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
* Fix test
* Update client/offchain/src/lib.rs
Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
* pallet-utility: Fix possible mismatch between native/wasm
The `batched_calls_limit` constant value includes the `size_of` of the runtime `Call`. As we compile
the runtime for native/wasm, we need to align the call size to ensure that it is the same on
wasm/native. This also solves the problem of different metadata outputs for the same runtime.
* Review feedback
* Removal of light client from substrate
* add missing import
* These tests relate to there being light and non light clients.
* removing lightnodes from test
* cargo fmt
* not needed
* LightDataChecker not needed any longer
* cargo fmt
* Update client/service/test/src/lib.rs
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
* Update client/service/test/src/lib.rs
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
* cargo fmt
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
* pallet-scheduler: Introduce `OriginPrivilegeCmp`
When a scheduled task should be canceled, the origin that tries to
cancel the task is compared to the origin the task should be executed
with. Before this pr this check only allowed that both origins are
equal. However, this is problematic as this means that for example a
council origin it needs to be have the same amount of yes votes to
cancel the scheduled task. While a council origin with more yes votes
should be able to cancel this task. This happened recently on Kusama and
lead to a failed cancelation of a scheduled task. With this pr the two
origins are compared and the cancelling origin needs to have greater or
equal privileges as the origin that scheduled the task. What a greater,
equal or less privilege is, can be configured in the runtime.
For simplicity, a `EqualPrivilegeOnly` implementation is provided that
only checks if two origins are equal. So, this mimics the old behaviour.
* FMT
* fix import
* Small optimizations
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
* Update example-offchain-worker to include missing implementation for TestAuthId
i tried to incorporate the off-chain worker callback demo as a custom pallet of my own Substrate-based blockchain implementation that's provided at the following links
* https://www.parity.io/blog/substrate-off-chain-workers-secure-and-efficient-computing-intensive-tasks/
* https://gnunicorn.github.io/substrate-offchain-cb/
but when i build the code with `cargo build --release`, it gave me an error:
```
error[E0277]: the trait bound `AuthorityId: AppCrypto<MultiSigner, MultiSignature>` is not satisfied
--> /Users/me/my_repo/node/runtime/src/lib.rs:1172:5
|
1172 | type AuthorityId = AuthorityId;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `AppCrypto<MultiSigner, MultiSignature>` is not implemented for `AuthorityId`
|
note: required by a bound in `offchaincb::Config::AuthorityId`
--> /Users/me/my_repo/node/pallets/offchaincb/src/lib.rs:169:21
|
169 | type AuthorityId: AppCrypto<Self::Public, Self::Signature>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `offchaincb::Config::AuthorityId`
```
where in my custom pallet i have:
pallets/offchaincb/src/lib.rs
```
...
use offchaincb::{
crypto::{
TestAuthId,
},
};
...
parameter_types! {
pub const GracePeriod: BlockNumber = 1 * MINUTES;
pub const UnsignedInterval: BlockNumber = 1 * MINUTES;
pub const UnsignedPriority: BlockNumber = 1 * MINUTES;
}
impl offchaincb::Config for Runtime {
type AuthorityId = TestAuthId;
type Call = Call;
type Currency = Balances;
type Event = Event;
type GracePeriod = GracePeriod;
type UnsignedInterval = UnsignedInterval;
type UnsignedPriority = UnsignedPriority;
}
...
```
then i found another different off-chain workers Substrate Recipe demo from Jimmy Chu https://github.com/jimmychu0807/recipes/blob/master/pallets/ocw-demo/src/lib.rs#L73 which had an extra implementation for TestAuthId here https://github.com/jimmychu0807/recipes/blob/master/pallets/ocw-demo/src/lib.rs#L73, and when i added that it overcame the error.
so i think this change should be included in the Substrate repository
* Fix indentation
* Fix formatting
* Swap order
* pallet-multisig: Improve opaque call handling
Before the opaque call was just a type redefinition of `Vec<u8>`. With metadata v14 that was
breaking external tools, as they stopped looking at the type name. To improve the situation the
`WrapperKeepOpaque` type is introduced that communicates to the outside the correct type info.
* Cleanup
* Fix benchmarks
* FMT
* Update `tracing`-related dependencies
* Enable `parking_lot` feature in `tracing-subscriber`
* Add an asynchronous stderr logger
* Make clippy happy
* Add an integration test for the logger
* Refactor `test_logger_filters`'s subprocess machinery into a separate function
* Use a child process instead of hooking into stderr for the test
* Add a doc comment for `MakeStderrWriter`
* Move the initialization into the `MakeStderrWriter`'s constructor
* Add an extra test case to trigger the logger's emergency flush mechanism
* Use the buffer's mutex for asynchronous flushes
* Remove vestigial `nix` dependency from one of the previous commits
It is possible that `Instant::now()` is returning an earlier clock time when being called a second
time. To guard against this, we should use `saturating_duration_since`.
The babe `authoring_blocks` test was flaky because it could happen that
we imported the first block multiple times. This lead to import the
genesis epoch multiples times. `EpochChanges` was assuming that
importing a genesis epoch while there was already an imported epoch
means that there is a "gap". However, this wasn't true as we just
imported 2 genesis epochs. The bug is solved by checking that the
already imported epochs are not all genesis epochs.
* documentation for recovery of emergency phase
* Update frame/election-provider-multi-phase/src/lib.rs
Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>
* Update frame/election-provider-multi-phase/src/lib.rs
Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>
Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>
* sc-executor-wasmtime: upgrade wasmtime to 0.30.0
Changes related to memory64 proposal implementation,
for additional details see bytecodealliance/wasmtime#3153
* sc-executor-wasmtime: introduce parallel_compilation flag
* typos
* sp-debug-derive: Add `force-debug` feature
Sometimes users want to have proper debug information even inside the
wasm runtime, when they use `RuntimeDebug`. To not fork Substrate to
change a type to a normal `Debug` derive, this pr introduces the
`force-debug` feature. This feature can be enabled by the user in their
runtime and then the types will use the normal Debug derive instead of
printing `wasm:stripped`.
* Fixes