Skip to content

[FRAME Core] Remove without_storage_info on pallets #323

@shawntabrizi

Description

@shawntabrizi

paritytech/substrate#8556

Need to update all instances of Vec in the runtime storage to BoundedVec, which will allow us to start generating worse case scenario PoV sizes.

Polkadot:

  • Pallet XCM
  • XCM in general.

Infra stuff:

  1. PalletsOrigin @gavofyork MEL: Origin, Referenda, ConvictionVoting substrate#11631
  2. Call should impl MaxEncodedLen. Two options:
  • Any dispatchables whose args do not all impl MaxEncodedLen should be marked #[pallet::call(unbounded)] and will not be included in Call. Introduce an additional UnboundedCall type which gets created in parallel to Call, and includes all dispatchables but does not impl MaxEncodedLen.
  • Introduce a new Signed Extension AuxData, from Preimages pallet. This places one or more blobs of data in a non-persistent storage item of Preimages pallet, indexed by its hash. It can be a map which is cleared at on_finalize but would ideally use Transient storage runtime host function #359. The data can be retrieved through the usual Preimages API in exactly the same manner as the persistent preimages. Large arguments for Calls dispatched immediately in a transaction would be encoded and placed in this AuxData Signed Extension and referenced through hash. If such a Call were expected to execution autonomously on-chain then the preimage would need to be registered as usual. note_preimage would use AuxData, set_code would use (via the trait interface) Preimages pallet.
  • Call need not impl MEL, instead we can just avoid storing it directly but do so through a preimage. Bound uses of Call substrate#11649
  1. #[pallet::storage(write_only)] for items which cannot/must not be read. the MEL is allowed to be undefined. in this case, and if a new production feature is enabled, then there should be no storage API to read the item (this is a larger refactoring and will need additional changes to storage macros). this together with marking the low-level storage accesses as unsafe APIs will give build-time safety for PoV size.
  2. #[derive(MaxEncodedLen) should respect #[codec(skip)].

Before any pallet is checked off above, the final step in this process would be do remove the without_storage_info macro:

	#[pallet::pallet]
	#[pallet::generate_store(pub(super) trait Store)]
	#[pallet::without_storage_info] <--- here
	pub struct Pallet<T, I = ()>(PhantomData<(T, I)>);

This tells us that all the storage item in the pallet are compatible with the storage info trait.

Metadata

Metadata

Assignees

No one assigned

    Labels

    T1-FRAMEThis PR/Issue is related to core FRAME, the framework.

    Type

    No type

    Projects

    Status

    Draft

    Status

    In Progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions