-
Notifications
You must be signed in to change notification settings - Fork 52
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
Fee handler #363
base: main
Are you sure you want to change the base?
Fee handler #363
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good direction, but i think we can eliminate the WeightRouter
entirely.
@@ -91,7 +91,7 @@ parachains-common = { workspace = true } | |||
|
|||
# ismp modules | |||
ismp = { workspace = true } | |||
pallet-ismp = { workspace = true, features = ["unsigned"] } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's revert this
fn handle_fee(messages: &[Message], _signer: T::AccountId) -> DispatchResultWithPostInfo { | ||
//Todo: reward the signer | ||
Ok(PostDispatchInfo { | ||
actual_weight: Some(get_weight::<T>(&messages)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should remove the WeightRouter
from the Config
trait as that is now replaced by this FeeHandler
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eliminate the WeightRouter
entirely in d03c72b
pub trait HandleFee<T: Config> { | ||
fn handle_fee(messages: &[Message], signer: T::AccountId) -> DispatchResultWithPostInfo; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets add a get_weight
method here instead of using the weight router
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest leaving weight to benchmark in a separate trait, as the convention FeeHandler
focuses on custom fee logic(e.g., rewarding the signer).
Some refactoring accordingly in d03c72b
@seunlanlege Please let me know WDYT.
Self::execute(messages.clone())?; | ||
|
||
Ok(PostDispatchInfo { | ||
actual_weight: Some(get_weight::<T>(&messages)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actual_weight: Some(get_weight::<T>(&messages)), | |
actual_weight: Some(T::HandleFee::get_weight(&messages)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try to resolve #361
Btw: Not sure fully understand the request, this is just a draft PR to get some feedback.