Skip to content
Commit 22db788c authored by Bastian Köcher's avatar Bastian Köcher Committed by GitHub
Browse files

Optimize `decode_len` (#5975)



* Optimize `decode_len`

Instead of reading the full storage value into the runtime, we only read
at maximum `5bytes` from the storage into the runtime. Furthermore this
drops any handling with regards to set default values in
`decl_storage!`. If the value does not exists or the decoding of the
length fails, it will return `None`. To prevent people from messing
stuff up, this feature relies on the `StorageDecodeLength` trait that is
sealed by `frame-support` (aka only implementable inside this crate).

* Some clean ups

* Update frame/support/src/storage/mod.rs

Co-authored-by: default avatarAlexander Popiak <[email protected]>

Co-authored-by: default avatarAlexander Popiak <[email protected]>
parent 0690bb51
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment