#[whitelist_storage]
Expand description

The optional attribute #[pallet::whitelist_storage] will declare the storage as whitelisted from benchmarking. Doing so will exclude reads of that value’s storage key from counting towards weight calculations during benchmarking.

This attribute should only be attached to storages that are known to be read/used in every block. This will result in a more accurate benchmarking weight.

Example

#[pallet::storage]
#[pallet::whitelist_storage]
pub(super) type Number<T: Config> = StorageValue<_, frame_system::pallet_prelude::BlockNumberFor::<T>, ValueQuery>;

NOTE: As with all pallet::* attributes, this one must be written as #[pallet::whitelist_storage] and can only be placed inside a pallet module in order for it to work properly.