I have been looking into the hrmp pallets where some of the extrinsics needs to have a witness data variable provided as a parameter.
Example:
/// Total number of opening channels must be provided as witness data.
#[pallet::weight(<T as Config>::WeightInfo::force_process_hrmp_open(*_channels))]
pub fn force_process_hrmp_open(origin: OriginFor<T>, _channels: u32)`
I found on this previous StackExchange answer that using a length witness as argument is a solution to calculate the weights of a extrinsic where the complexity is dictated by the number of items held in storage. And another example of another pallet with this approach (Alliance).
My question here is if this is only for benchmarking? and is there an alternative for this approach?