-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Make tasks local only. #10162
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
Merged
Merged
Make tasks local only. #10162
Changes from 5 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
53a1388
make task local only
gui1117 2671662
do not propagate
gui1117 45d07f2
fmt
gui1117 0143e7c
Merge branch 'master' into gui-task-local-only
gui1117 ec191ef
Update from github-actions[bot] running command 'prdoc --audience run…
github-actions[bot] ba50240
Update prdoc/pr_10162.prdoc
gui1117 636dc01
Merge branch 'master' into gui-task-local-only
gui1117 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| title: Make tasks local only. | ||
| doc: | ||
| - audience: | ||
| - Runtime Dev | ||
| - Node Dev | ||
| description: |- | ||
| Related to https://github.com/paritytech/polkadot-sdk/issues/9693 | ||
|
|
||
| In the transaction pool, transaction are identified by the tag they provide. | ||
|
|
||
| For tasks the provided tag is simply the hash for the encoded task. | ||
|
|
||
| Nothing in the doc says that implementers should be careful that tasks are not too many for a single operation. What I mean is if a task is `migrate_keys(limit)`, with valid first from 1 to 10_000. Then all tasks `migrate_keys(1)`, `migrate_keys(2)` ... `migrate_keys(10_000)` are valid and effectively do the same operation: they all migrate part of the keys. | ||
| In this case a malicious person can submit all those tasks at once and spam the transaction pool with 10_000 transactions. | ||
|
|
||
| I see multiple solution: | ||
| * (1) we are careful when we implement tasks, we make the doc clear, but the API is error prone. (in my example above we would implement just `migrate_keys` and inside the call we would do a basic rate of migration of 1000 keys in a bulk). | ||
| * (2) we have a new value returned that is the provided tag for the task. Or we use the task index as provided tag. | ||
| * (3) we only accept local tasks: <-- implemented in this PR. | ||
|
|
||
| maybe (2) is a better API if we want external submission of tasks. | ||
| crates: | ||
| - name: frame-support-procedural | ||
| bump: major | ||
| - name: frame-system | ||
| bump: major | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.