substrate
substrate copied to clipboard
Investigate better types for max len of bounded storage items
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
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.