Remove unneeded dependencies and dev-dependencies.
Made self_destruct test not dependent on wasm bin size.
Updated code related to deprecated warning on tracing-subscriber `scope()`
( See https://github.com/tokio-rs/tracing/issues/1429 )
Actually this will cost us another allocation, but before this wasn't
really safe. Assuming that we only need `size_of` bytes for the encoding
of the tx could have ended with an invalid encoding.
* Run cargo fmt on the whole code base
* Second run
* Add CI check
* Fix compilation
* More unnecessary braces
* Handle weights
* Use --all
* Use correct attributes...
* Fix UI tests
* AHHHHHHHHH
* 🤦
* Docs
* Fix compilation
* 🤷
* Please stop
* 🤦 x 2
* More
* make rustfmt.toml consistent with polkadot
Co-authored-by: André Silva <andrerfosilva@gmail.com>
* mark template and utils as non-publish
* switch to development version for testing
* activate unleash check
* maybe if I disable all rules...
* Fix isolated compilation of `max-encoded-len-derive` with `syn`
error[E0369]: binary operation `==` cannot be applied to type `syn::Path`
--> src/lib.rs:88:29
|
88 | .filter(|attr| attr.path == parse_quote!(max_encoded_len_crate))
| --------- ^^ ----------------------------------- _
| |
| syn::Path
error: aborting due to previous error
For more information about this error, try `rustc --explain E0369`.
Error: could not compile `max-encoded-len-derive`
* WIP: bump changes crates since v3 tag to next breaking
cargo unleash version bump-breaking --changed-since v3.0.0
cargo unleash version set-pre dev --changed-since v3.0.0
FIXME: Don't modify crates that are not yet released, e.g.
`max-encoded-len-derive`
* Update lockfile
* WIP: Bump sp-transaction-pool as well
* WIP: Bump sp-offchain as well
* WIP: Bump frame-system-rpc-runtime-api as well
* WIP: Bump sp-authority-discovery as well
* Manually deactivate dev-deps before `cargo unleash check`
Otherwise we run into `Cycle detected` error.
* Bump sp-consensus-slots
* Add missing Cargo.lock change
* Bump sp-consensus-vrf as well
* Bump sp-keyring as well
* Bump sp-consensus-pow as well
* Try to speed up the `unleash-check` job
Previously, the job took 106 minutes - let's see if explicitly
specifying a `CARGO_TARGET_DIR` will help
* fixup: Ensure the temp target dir exists for unleash check
* Bump pallet-transaction-payment-rpc-runtime-api as well
Needed for Polkadot
* Bump pallet-transaction-payment-rpc as well
Needed for Polkadot
* Try updating crates after patching in the Polkadot CI job
* Use another approach to update patched Substrate crates
* Try to update all sp-core versions in Polkadot CI job
* Simplify sp-core version checking
* Apply another shellcheck lint
* Just do the simplest thing I guess
* Welp don't do --offline then
* Clean up `unleash-check` job triggers
Co-authored-by: Denis Pisarev <denis.pisarev@parity.io>
* Fix a note in unleash-check cache step
* Add a note about temporary optimization in cargo-unleash
* Pin a newer version of cargo-unleash
Co-authored-by: Igor Matuszewski <xanewok@gmail.com>
Co-authored-by: Denis Pisarev <denis.pisarev@parity.io>
* Update impl-codec to use new upstream MaxEncodedLen trait
* Adapt crates to use the updated codec crate for `MaxEncodedLen`
* Remove max-encoded-len crate altogether
* Fix test compilation in `pallet-proxy`
* reorganize import (#9186)
* Fix remaining `MaxEncodedLen` imports
* Fix remaining old usages of max-encoded-len crate
* Fix UI test
* Manually depend on new impl-codec to fix Polkadot companion build
* Use newly released primitive-types v0.9.1 that has new codec impls
* Make sure codec deps are up-to-date in crates that use them
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>
* bump a bunch of deps in parity-common
* primitive-types 0.10.0
* update Cargo.lock
* downgrade a few more
* this is unlikely to help
* try something
* Checkmate, Atheists!
* implement max_values + storages info
* some formatting + doc
* sudo sanity check
* timestamp
* assets (not working)
* fix assets
* impl for proxy
* update balances
* rename StoragesInfo -> PalletStorageInfo
* merge both StorageInfoTrait and PalletStorageInfo
I think it is more future proof. In the future some storage could make
use of multiple prefix. Like one to store how much value has been
inserted, etc...
* Update frame/support/procedural/src/storage/parse.rs
Co-authored-by: Peter Goodspeed-Niklaus <coriolinus@users.noreply.github.com>
* Update frame/support/procedural/src/storage/storage_struct.rs
Co-authored-by: Peter Goodspeed-Niklaus <coriolinus@users.noreply.github.com>
* Fix max_size using hasher information
hasher now expose `max_len` which allows to computes their maximum len.
For hasher without concatenation, it is the size of the hash part,
for hasher with concatenation, it is the size of the hash part + max
encoded len of the key.
* fix tests
* fix ui tests
* Move `MaxBoundedLen` into its own crate (#8814)
* move MaxEncodedLen into its own crate
* remove MaxEncodedLen impl from frame-support
* add to assets and balances
* try more fixes
* fix compile
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
* nits
* fix compile
* line width
* fix max-values-macro merge
* Add some derive, needed for test and other purpose
* use weak bounded vec in some cases
* Update lib.rs
* move max-encoded-len crate
* fix
* remove app crypto for now
* width
* Revert "remove app crypto for now"
This reverts commit 73623e9933d50648e0e7fe90b6171a8e45d7f5a2.
* unused variable
* more unused variables
* more fixes
* Add #[max_encoded_len_crate(...)] helper attribute
The purpose of this attribute is to reduce the surface area of
max_encoded_len changes. Crates deriving `MaxEncodedLen` do not
need to add it to `Cargo.toml`; they can instead just do
```rust
\#[derive(Encode, MaxEncodedLen)]
\#[max_encoded_len_crate(frame_support::max_encoded_len)]
struct Example;
```
* fix a ui test
* use #[max_encoded_len_crate(...)] helper in app_crypto
* remove max_encoded_len import where not necessary
* update lockfile
* fix ui test
* ui
* newline
* fix merge
* try fix ui again
* Update max-encoded-len/derive/src/lib.rs
Co-authored-by: Peter Goodspeed-Niklaus <coriolinus@users.noreply.github.com>
* extract generate_crate_access_2018
* Update lib.rs
* compiler isnt smart enough
Co-authored-by: thiolliere <gui.thiolliere@gmail.com>
Co-authored-by: Peter Goodspeed-Niklaus <coriolinus@users.noreply.github.com>
Co-authored-by: Peter Goodspeed-Niklaus <peter.r.goodspeedniklaus@gmail.com>
The macro should assume less about the scope where it is being used in.
In this case it is about not assuming that the crate where the macro is
called in provides a `std` feature.
* Use host max log level when initializing the `RuntimeLogger`
This should fix performance problems introduced by logging under certain
circumstances. Before we always called into the host and the host was
doing the log filtering, now as the correct max log level is set, we
don't call into the host for every log line to check if it should be
logged. However, we would still call into the host to determine if
something should be logged when `something=trace` is given as we don't
forward the log targets that are enabled.
* Finish the pr
* Remove `serde` requirement from FRAME macros
Currently there is some implicit requirement on `serde` being present in
the `Cargo.toml` of a pallet when `GenesisConfig` is used. This pr
removes this requirement by using the serde attribute `serde(crate = "..")`.
* build a unique reexport of serde in impl_opaque_keys, by abusing paste doc concatenation
* Optimize
Co-authored-by: thiolliere <gui.thiolliere@gmail.com>
* Use 'Pallet' struct in construct_runtime.
* Fix genesis and metadata macro.
* Fix 'Pallet' type alias.
* Replace 'Module' with 'Pallet' for all construct_runtime use cases.
* Replace more deprecated 'Module' struct.
* Bring back AllModules and AllPalletsWithSystem type, but deprecate them.
* Replace deprecated 'Module' struct from merge master.
* Minor fix.
* Fix UI tests.
* Revert UI override in derive_no_bound.
* Fix more deprecated 'Module' use from master branch.
* Fix more deprecated 'Module' use from master branch.
* primitives/runtime: initial changes on supporting multiple Justifications
* primitives/runtime: make Justifications strongly typed
* Encode/decode Justifications
* primitives/runtime: add Justification type
* backend: apply_finality and finalize_block takes a single Justification
* manual-seal: create engine id and let rpc take encoded justification
* backend: skeleton functions for appending justifications
* backend: initial implementation append_justification
Initial implementation of append_justification on the Backend trait, and also remove unused skeleton
functions for append_justificaton on Finaziler trait.
k
* backend: guard against duplicate consensus engine id
* client/db: add check for block finality
* client/api: add append_justification to in_mem db
* client/light: add no-op append_justification
* network: fix decode call for Justification
* network: only send a single Justification in BlockData
* network: minor comment update
* protocol: update field names to distinguish single justification
* client: further field renames to plural
* client: update function names to plural justifications
* client/db: upgrade existing database for new format
* network: remove dependency on grandpa crate
* db: fix check for finalized block
* grandpa: check for multiple grandpa justifications hwne importing
* backend: update Finalizer trait to take multiple Justifications
* db: remove debugging statements in migration code
* manual-seal: update note about engine id
* db: fix check for finalized block
* client: update variable name to reflect it is now plural
* grandpa: fix incorrect empty Justications in test
* primitives: make Justifications opaque to avoid being empty
* network: fix detecting empty Justification
* runtime: doc strings for Justifications functions
* runtime: add into_justifications
* primitives: check for duplicates in when adding to Justifications
* network/test: use real grandpa engine id in test
* client: fix reviewer comments
* primitives: rename Justifications::push to append
* backend: revert changes to Finalizer trait
* backend: revert mark_finalized
* backend: revert changes to finalize_block
* backend: revert finalized_blocks
* db: add a quick early return for performance
* client: minor reviewer comments
* service/test: use local ConsensusEngineId
* network: add link to issue for sending multiple Justifications
* Apply suggestions from code review
Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
* Apply suggestions from code review
Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
* network: tweaks to review suggestions
* network: revert change to BlockData for backwards compatibility
* Apply suggestion from code review
Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
* Apply suggestions from code review
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
* primitives: update doc comment for Justifications
* client/db/upgrade: avoid grandpa crate dependency
* consensus: revert to single Justification for import_justification
* primitives: improve justifications docs
* style cleanups
* use and_then
* client: rename JUSTIFICATIONS db column
* network: revert to using FRNK in network-test
Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
Co-authored-by: André Silva <andrerfosilva@gmail.com>
* Add MMR custom RPC.
* Change RuntimeApi to avoid hardcoding leaf type.
* Properly implement the new RuntimeAPI and wire up RPC.
* Extract Offchain DB as separate execution extension.
* Enable offchain DB access for offchain calls.
* Fix offchain_election tests.
* Skip block initialisation for proof generation.
* Fix integration test setup.
* Fix offchain tests. Not sure how I missed them earlier 🤷.
* Fix long line.
* One more test missing.
* Update mock for multi-phase.
* Address review grumbbles.
* Address review grumbles.
* Fix line width of a comment
* Move AuRa digest from client to primitives
This makes the digest stuff usable from inside the runtime ;)
* Update primitives/runtime/src/generic/digest.rs
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
* Review feedback
* Make BABE use the new functionality
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
* Init `RuntimeLogger` automatically for each runtime api call
This pr change the runtime api in such a way to always and automatically
enable the `RuntimeLogger`. This enables the user to use `log` or
`tracing` from inside the runtime to create log messages. As logging
introduces some extra code and especially increases the size of the wasm
blob. It is advised to disable all logging completely with
`sp-api/disable-logging` when doing the wasm builds for the on-chain
wasm runtime.
Besides these changes, the pr also brings most of the logging found in
frame to the same format "runtime::*".
* Update frame/im-online/src/lib.rs
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>
* Update test-utils/runtime/Cargo.toml
* Fix test
* Don't use tracing in the runtime, as we don't support it :D
* Fixes
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>
* add concat Vec<u8> function and use it for better error logging in add_benchmark! macro
* refactor benchmark error reporting to use format! and RuntimeString