-
Notifications
You must be signed in to change notification settings - Fork 707
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
Tasks: general system for recognizing and executing service work #1343
Conversation
btw this branch is going to get force-pushed over later today -- my version that actually has the correct rebase with |
remaining compile issue:
is this because I'm not generating a I just find it strange that it suddenly needs this because I didn't need this impl at all on the |
Did you forget to include the tasks_example pallet in your construct_runtime? |
lmao thank you yes I think this was one of the lines the patch file misses |
oh yeah and then the weird follow-up to that that I remember fixing for after adding
🤔 (now pushed up on this branch) |
* but now getting expected keyword error on construct_runtime!
@sam0x17 |
edit: resolved On current version of the branch, when compiling
All I've changed is I've added proper impls for the |
🎉 |
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.
Approving for bot, SRLabs will review this in the future, PR is in pipeline
The test frame ui started failing consistently on latest master [1]. I assume it was because of a race between #1343 which introduced this warning and a PR that updated our tooling version, hence the warnings don't match perfectly, so regenerated them with `TRYBUILD=overwrite` as the test suggests. [1] https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/4666766 Signed-off-by: Alexandru Gheorghe <alexandru.gheorghe@parity.io>
The test frame ui started failing consistently on latest master [1]. I assume it was because of a race between #1343 which introduced this warning and a PR that updated our tooling version, hence the warnings don't match perfectly, so regenerated them with `TRYBUILD=overwrite` as the test suggests. [1] https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/4666766 --------- Signed-off-by: Alexandru Gheorghe <alexandru.gheorghe@parity.io>
#1343 introduced Tasks API. This one moves `do_task` call in frame_system under the experimental flag, till the previous one is audited. --------- Co-authored-by: command-bot <>
This pull request has been mentioned on Polkadot Forum. There might be relevant details there: https://forum.polkadot.network/t/polkadot-release-analysis-v1-6-0/5855/1 |
…itytech#1343) `polkadot-sdk` version of original tasks PR located here: paritytech/substrate#14329 Fixes paritytech#206 ## Status - [x] Generic `Task` trait - [x] `RuntimeTask` aggregated enum, compatible with `construct_runtime!` - [x] Casting between `Task` and `RuntimeTask` without needing `dyn` or `Box` - [x] Tasks Example pallet - [x] Runtime tests for Tasks example pallet - [x] Parsing for task-related macros - [x] Retrofit parsing to make macros optional - [x] Expansion for task-related macros - [x] Adds support for args in tasks - [x] Retrofit tasks example pallet to use macros instead of manual syntax - [x] Weights - [x] Cleanup - [x] UI tests - [x] Docs ## Target Syntax Adapted from paritytech#206 (comment) ```rust // NOTE: this enum is optional and is auto-generated by the other macros if not present #[pallet::task] pub enum Task<T: Config> { AddNumberIntoTotal { i: u32, } } /// Some running total. #[pallet::storage] pub(super) type Total<T: Config<I>, I: 'static = ()> = StorageValue<_, (u32, u32), ValueQuery>; /// Numbers to be added into the total. #[pallet::storage] pub(super) type Numbers<T: Config<I>, I: 'static = ()> = StorageMap<_, Twox64Concat, u32, u32, OptionQuery>; #[pallet::tasks_experimental] impl<T: Config<I>, I: 'static> Pallet<T, I> { /// Add a pair of numbers into the totals and remove them. #[pallet::task_list(Numbers::<T, I>::iter_keys())] #[pallet::task_condition(|i| Numbers::<T, I>::contains_key(i))] #[pallet::task_index(0)] pub fn add_number_into_total(i: u32) -> DispatchResult { let v = Numbers::<T, I>::take(i).ok_or(Error::<T, I>::NotFound)?; Total::<T, I>::mutate(|(total_keys, total_values)| { *total_keys += i; *total_values += v; }); Ok(()) } } ``` --------- Co-authored-by: Nikhil Gupta <17176722+gupnik@users.noreply.github.com> Co-authored-by: kianenigma <kian@parity.io> Co-authored-by: Nikhil Gupta <> Co-authored-by: Gavin Wood <gavin@parity.io> Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Co-authored-by: gupnik <nikhilgupta.iitk@gmail.com>
The test frame ui started failing consistently on latest master [1]. I assume it was because of a race between paritytech#1343 which introduced this warning and a PR that updated our tooling version, hence the warnings don't match perfectly, so regenerated them with `TRYBUILD=overwrite` as the test suggests. [1] https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/4666766 --------- Signed-off-by: Alexandru Gheorghe <alexandru.gheorghe@parity.io>
paritytech#1343 introduced Tasks API. This one moves `do_task` call in frame_system under the experimental flag, till the previous one is audited. --------- Co-authored-by: command-bot <>
polkadot-sdk
version of original tasks PR located here: paritytech/substrate#14329Fixes #206
Status
Task
traitRuntimeTask
aggregated enum, compatible withconstruct_runtime!
Task
andRuntimeTask
without needingdyn
orBox
Target Syntax
Adapted from #206 (comment)