substrate icon indicating copy to clipboard operation
substrate copied to clipboard

Investigate better types for max len of bounded storage items

Open emostov opened this issue 2 years ago • 1 comments

Currently, bounded storage items require a type that implements Get for its max length. This permits the user to configure the type as something that can be modified at runtime.

Modifying the bounds at runtime is a foot gun for chain builders. For example, it could render some storage items non-decodable or break assumptions used to create weights and soften DDoS vectors.

We should look into forcing the bound to be a const or something similiar

emostov avatar Jan 07 '22 23:01 emostov

Generally speaking, I realized again that Get can break everything.

For example, if you put a type Foo: Get<u32> into the metadata, but the Get<_> is actually implemented by a real storage that can change on the fly, PJS api breaks.

kianenigma avatar Sep 16 '22 09:09 kianenigma