Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pallet-ismp]: Introduce a FeeHandler #361

Open
seunlanlege opened this issue Dec 30, 2024 · 0 comments · May be fixed by #363
Open

[pallet-ismp]: Introduce a FeeHandler #361

seunlanlege opened this issue Dec 30, 2024 · 0 comments · May be fixed by #363
Labels
good first issue Good for newcomers

Comments

@seunlanlege
Copy link
Member

seunlanlege commented Dec 30, 2024

Currently we provide a WeightProvider interface that allows modules to declare their runtime weights so that the appropriate transaction fees can be charged. This unfortunately only works for requests and responses. We should eventually switch to a simpler callback mechanism which should return the PostDispatchInfo for the handle extrinsic.

#[cfg(not(feature = "unsigned"))]
#[pallet::weight(get_weight::<T>(&messages))]
#[pallet::call_index(1)]
#[frame_support::transactional]
pub fn handle(origin: OriginFor<T>, messages: Vec<Message>) -> DispatchResultWithPostInfo {
        let signer = ensure_signed(origin)?;

        Self::execute(messages.clone())?;

        // do anything, but return the `PostDispatchInfo`
        T::FeeHandler::on_executed(messages, signer)
}

This allows for a wider variety of fee collection strategies as well as free transactions, or even negatively priced transactions for consensus update incentives.

@seunlanlege seunlanlege added the good first issue Good for newcomers label Dec 30, 2024
@kku9706 kku9706 linked a pull request Jan 4, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant