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

[FRAME] pallet using tasks should automatically bound frame_system::Config<RuntimeTask: From<Task>>. #6462

Open
gui1117 opened this issue Nov 13, 2024 · 3 comments
Assignees
Labels
I5-enhancement An additional feature request.

Comments

@gui1117
Copy link
Contributor

gui1117 commented Nov 13, 2024

pallet using tasks (#[pallet::tasks_experimental]) needs to bound From<Task> to system runtime tasks. The macro should automatically bound it in the pallet config supertrait.

In rust we can bound multiple time the same supertrait AFAIR, so we can just have the macro add: frame_system::Config<RuntimeTask: From<Task>> to the pallet Config trait.

This will not work for the system pallet. I think we can have a new attribute to notify the macro that a pallet is system pallet, and the macro would generate differently in this case. This new attribute can be: #[pallet::is_frame_system].

The same process can be used to get rid of the associated type RuntimeEvent in pallets.

cc @gupnik

@gui1117 gui1117 added the I5-enhancement An additional feature request. label Nov 13, 2024
@Doordashcon
Copy link
Contributor

Doordashcon commented Nov 28, 2024

@gui1117 A requirement for #5163?

@gui1117
Copy link
Contributor Author

gui1117 commented Dec 1, 2024

@gui1117 A requirement for #5163?

No need to wait for this, we can bound it manually for now. If the suggestion is implemented it will be backward compatible.

@Doordashcon
Copy link
Contributor

Can you assign me to this? @gui1117 Would like to continue working on the Task implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I5-enhancement An additional feature request.
Projects
None yet
Development

No branches or pull requests

2 participants