Storage requirements using BoundedVec
by default
#782
Labels
new content 💡✍️
New Devhub content required.
BoundedVec
by default
#782
We need to document the change in Substrate that's just been merged: paritytech/substrate#10662
Pallets require that all vectors in runtime storage are bounded, meaning that they must use the
BoundedVec
type and specify a max value constant. For example:To override this default behaviour, developers must add the
without_storage_info
attribute to their pallets:Bounded storage items is important because if any
Vec
gets too big it can lead to:Just like computation, memory / storage space is also a bottleneck for blockchains. For relay chains, bounded vectors are used to compute the PoV proof size and to ensure that the size of a proof-of-membership set in a vector doesn't grow unbounded. Users can still opt out of writing things bounded using the
without_storage_info attribute
. However they are encouraged by the compiler to ensure their storage is bounded.The text was updated successfully, but these errors were encountered: