• Bastian Köcher's avatar
    Optimize `decode_len` (#5975) · 22db788c
    Bastian Köcher authored
    
    
    * 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]>
    22db788c