Manta-Network / Manta

The main repo for manta blockchain nodes.
GNU General Public License v3.0
239 stars 119 forks source link

Implement `MaxEncodedLen` wherever necessary #387

Open ghzlatarev opened 2 years ago

ghzlatarev commented 2 years ago

currently without_storage_info is used in all Pallets that do not implement MaxEncodedLen https://github.com/paritytech/substrate/pull/10662 Essentially without_storage_info means that the storage consumption of this pallet is unbounded. As part of this big PoV benchmarking issue https://github.com/paritytech/polkadot-sdk/issues/398, they added a trait StorageInfoTrait that every storage should implement (on condition that value and keys implement MaxEncodedLen) https://github.com/paritytech/substrate/pull/8735 Originally you had to use the generate_storage_info attribute to make a pallet implement the StorageInfoTrait. Since this shouldn't be missed in new pallets they made it implement by default, but now keys and values that don't implement MaxEncodedLen will not compile. So the without_storage_info attribute is used to skip implementation of StorageInfoTrait until MaxEncodedLen is implemented wherever necessary. https://github.com/paritytech/substrate/pull/10662

Enabling this will allow us to adopt the following test: https://github.com/paritytech/substrate/pull/11699

ghzlatarev commented 2 years ago

Since this work is also underway in Praity repos there are many PRs to study like https://github.com/paritytech/cumulus/pull/1337/files . Therefore it can also be good for first issue.