-
Notifications
You must be signed in to change notification settings - Fork 2.7k
[Contracts] Overflowing bounded DeletionQueue
#13702
[Contracts] Overflowing bounded DeletionQueue
#13702
Conversation
…inst contract termination
DeletionQueue allows DoS against contract terminationDeletionQueue allows DoS against contract termination
athei
left a comment
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.
Rather superficial first round of review:
Let's move all the deletion queue stuff into the storage file. I want to prevent cluttering the lib file.
For the migration: We should not add a migration in this PR. We should:
|
bot merge |
|
Error: "Check reviews" status is not passing for paritytech/cumulus#2409 |
|
bot rebase |
…-overflowing-bounded-deletionqueue-allows-dos-against-contract-termination
|
Rebased |
|
@pgherveou Command |
|
bot rebase |
…-overflowing-bounded-deletionqueue-allows-dos-against-contract-termination
|
Rebased |
|
bot merge |
DeletionQueue allows DoS against contract terminationDeletionQueue
|
This pull request has been mentioned on Polkadot Forum. There might be relevant details there: |
Currently the DeletionQueue is limited to DeletionQueueDepth, which is set to 128 for the test runtime. If more contracts are terminated within a short time, further attempts to terminate a contract will fail. If a public contract with an in-contract governance system is supposed to be terminated, an attacker can prevent this by terminating 128 fake contracts shortly before that. This will make the self-termination fail (and prevent freeing up the account balance + storage deposit of the contract). Launching another attempt to self-terminate may require a significant effort (e.g. votes from hundreds of stakeholders via the self-governance of the contract), which may be impractical, especially after multiple failed attempts.
This PR updates the storage to use a StorageMap instead of the current Bounded Vec used to keep track of contracts marked for deletion.
cumulus companion: paritytech/cumulus#2409