Skip to content

Conversation

@dharjeezy
Copy link
Contributor

@dharjeezy dharjeezy commented Dec 7, 2025

This PR intorduces Preimage in pallet Collective (via QueryPreimage + StorePreimage traits) for proposal storage. This allows the collective pallet to perform cheap O(1) length checks using the preimage metadata before incurring the cost of fetching the full proposal data.

closes #10209

@dharjeezy dharjeezy requested a review from a team as a code owner December 7, 2025 17:24
Comment on lines 444 to +445
pub type ProposalOf<T: Config<I>, I: 'static = ()> =
StorageMap<_, Identity, T::Hash, <T as Config<I>>::Proposal, OptionQuery>;
StorageMap<_, Identity, T::Hash, (), OptionQuery>;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be removed and migrated with a multi block migration to Preimage

type RuntimeOrigin: From<RawOrigin<Self::AccountId, I>>;

/// The runtime call dispatch type.
type Proposal: Parameter
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be also removed and replaced by frame_system::Config::RuntimeCall

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pallet-collective: Unbounded ProposalOf causes weight under-estimation in close extrinsic

2 participants