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

[MQ pallet] Dont warn for low on_idle weight #4762

Open
ggwpez opened this issue Jun 11, 2024 · 3 comments
Open

[MQ pallet] Dont warn for low on_idle weight #4762

ggwpez opened this issue Jun 11, 2024 · 3 comments
Assignees
Labels
C1-mentor A task where a mentor is available. Please indicate in the issue who the mentor could be. C2-good-first-issue A task for a first time contributor to become familiar with the Polkadot-SDK. I3-annoyance The node behaves within expectations, however this “expected behaviour” itself is at issue.

Comments

@ggwpez
Copy link
Member

ggwpez commented Jun 11, 2024

The on_idle of the MQ pallet calls the service_queues function which prints a warning when it does not have enough weight to do anything.
Normally this is an issue since its called from on_initialize, but on_idle it should not print a defensive error.
It was introduced in #3844.

@ggwpez ggwpez added C1-mentor A task where a mentor is available. Please indicate in the issue who the mentor could be. I3-annoyance The node behaves within expectations, however this “expected behaviour” itself is at issue. C2-good-first-issue A task for a first time contributor to become familiar with the Polkadot-SDK. labels Jun 11, 2024
@ggwpez ggwpez changed the title [MQ pallet] Remove warn for low on_idle weight [MQ pallet] Dont warn for low on_idle weight Jun 11, 2024
@gotnoshoeson
Copy link

Yo @ggwpez looking for a good-first-issue to jump into polkadot and contribute. Coming from Ethereum full-stack app development.

@gotnoshoeson
Copy link

gotnoshoeson commented Jun 12, 2024

So I see the defensive! getting thrown on line 1562. defensive!("Not enough weight to service a single message."); I'm thinking I can create a context parameter of where the service_queues is being called. fn service_queues(weight_limit: Weight, context: Context) If it's being called within on_initialize then pass "on_initialize" as the argument and it can continue with the current code. If "on_idle" is passed as context argument then it just returns Weight::zero(). Does this logic make sense? Or is there some other convention for doing something like this in Rust? Cheers!

@ggwpez
Copy link
Member Author

ggwpez commented Jun 12, 2024

Yo ggwpez looking for a good-first-issue to jump into polkadot and contribute. Coming from Ethereum full-stack app development.

Thanks, yes please go ahead.

fn service_queues(weight_limit: Weight, context: Context)

Yea that sounds good! I think we dont have a precedent case on how to handle this, but a small enum with two entries OnIdle and OnInitialize should work 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C1-mentor A task where a mentor is available. Please indicate in the issue who the mentor could be. C2-good-first-issue A task for a first time contributor to become familiar with the Polkadot-SDK. I3-annoyance The node behaves within expectations, however this “expected behaviour” itself is at issue.
Projects
Status: Backlog
Development

No branches or pull requests

2 participants