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.
Related to #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 tasksmigrate_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:
migrate_keysand inside the call we would do a basic rate of migration of 1000 keys in a bulk).maybe (2) is a better API if we want external submission of tasks.