-
Notifications
You must be signed in to change notification settings - Fork 689
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
Fix for Issue 4762 #4803
Fix for Issue 4762 #4803
Conversation
User @gotnoshoeson, please sign the CLA here. |
Review required! Latest push from author must always be reviewed |
// throw defensive message when service_queues is called from on_initialize | ||
// don't throw message when service_queues is called from on_idle |
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 add the reason here, that it doesn't matter if on_idle
doesn't have enough weight
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.
Okay, that makes sense. Thank you
Please give it a descriptive title in case that it appears in the CHANGELOG. |
@gotnoshoeson what @ggwpez meant above is that, could you please add a prdoc file? |
The CI pipeline was cancelled due to failure one of the required jobs. |
@@ -1554,12 +1564,17 @@ impl<T: Get<O>, O: Into<u32>> Get<u32> for IntoU32<T, O> { | |||
impl<T: Config> ServiceQueues for Pallet<T> { | |||
type OverweightMessageAddress = (MessageOriginOf<T>, PageIndex, T::Size); | |||
|
|||
fn service_queues(weight_limit: Weight) -> Weight { | |||
fn service_queues(weight_limit: Weight, context: ServiceQueuesContext) -> Weight { |
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 just noticed that this is implementing a trait function. Can you maybe put the inner logic into a new function and call that from here?
Having the ServiceQueuesContext
in the interface would be ugly otherwise.
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.
Thanks, I pushed a new commit last night (PST). Now that I'm re-reading this I might not have implemented the way you requested.
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 mean, the code does not compile? You are implementing a trait function. Please try to run the pallet tests locally.
Hi. Sorry I fell off this issue. But I'm back to finish if it's still open. Can you provide guidance of what is needed to complete? Thx |
504edb1
Successfully created backport PR for |
[Issue #4762 ](#4762) - Creates an enum for passing context of `service_queues` being called from within `on_initialize` and `on_idle` hooks. Uses a match statement inside of `service_queues` to continue using the same code, but NOT throw a `defensive` if being called within `on_idle` hook. - The issue requested to not throw the `defensive` if being called from within `on_idle` hook. - Created the `ServiceQueuesContext` enum to pass as an argument of `service_queues` when called within the `on_initialize` and `on_idle` hooks. A match statement was added inside of `service_queues` to continue to throw the defensive if called from `on_initialize` but NOT throw the defensive if called from `on_idle`. --------- Co-authored-by: gotnoshoeson <milesbrentpatterson@proton.me> Co-authored-by: Bastian Köcher <git@kchr.de> Co-authored-by: Bastian Köcher <info@kchr.de> (cherry picked from commit 504edb1)
Successfully created backport PR for |
[Issue #4762 ](#4762) - Creates an enum for passing context of `service_queues` being called from within `on_initialize` and `on_idle` hooks. Uses a match statement inside of `service_queues` to continue using the same code, but NOT throw a `defensive` if being called within `on_idle` hook. - The issue requested to not throw the `defensive` if being called from within `on_idle` hook. - Created the `ServiceQueuesContext` enum to pass as an argument of `service_queues` when called within the `on_initialize` and `on_idle` hooks. A match statement was added inside of `service_queues` to continue to throw the defensive if called from `on_initialize` but NOT throw the defensive if called from `on_idle`. --------- Co-authored-by: gotnoshoeson <milesbrentpatterson@proton.me> Co-authored-by: Bastian Köcher <git@kchr.de> Co-authored-by: Bastian Köcher <info@kchr.de> (cherry picked from commit 504edb1)
Backport #4803 into `stable2407` from gotnoshoeson. See the [documentation](https://github.com/paritytech/polkadot-sdk/blob/master/docs/BACKPORT.md) on how to use this bot. <!-- # To be used by other automation, do not modify: original-pr-number: #${pull_number} --> Co-authored-by: Miles Patterson <miles_patterson@icloud.com>
Backport #4803 into `stable2409` from gotnoshoeson. See the [documentation](https://github.com/paritytech/polkadot-sdk/blob/master/docs/BACKPORT.md) on how to use this bot. <!-- # To be used by other automation, do not modify: original-pr-number: #${pull_number} --> Co-authored-by: Miles Patterson <miles_patterson@icloud.com>
Backport #4803 into `stable2407` from gotnoshoeson. See the [documentation](https://github.com/paritytech/polkadot-sdk/blob/master/docs/BACKPORT.md) on how to use this bot. <!-- # To be used by other automation, do not modify: original-pr-number: #${pull_number} --> Co-authored-by: Miles Patterson <miles_patterson@icloud.com>
Issue #4762
service_queues
being called from withinon_initialize
andon_idle
hooks. Uses a match statement inside ofservice_queues
to continue using the same code, but NOT throw adefensive
if being called withinon_idle
hook.defensive
if being called from withinon_idle
hook.ServiceQueuesContext
enum to pass as an argument ofservice_queues
when called within theon_initialize
andon_idle
hooks. A match statement was added inside ofservice_queues
to continue to throw the defensive if called fromon_initialize
but NOT throw the defensive if called fromon_idle
.