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

Remove account deletion completely in state staking #55

Merged
merged 2 commits into from
Apr 2, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 2 additions & 14 deletions specs/Economics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,20 +94,8 @@ def on_account_change(block_height, account):

Where `sizeOf(account)` includes size of `account_id`, `account` structure and size of all the data stored under the account.

Account can end up with not enough balance for next two reasons:
- Created new account and didn't give it enough funds.
- Account got slashed.

This account still can receive transfers, hence can be saved.
But to prevent grinding with accounts that don't have balances, we allow for anyone to delete accounts that don't have enough balance. *Note:* this creates possible race conflicts and we recommend all account creating applications to be careful about funding account properly at the creation.

```python
def action_delete_account(account_id, account, ...):
if ctx.signer == account_id or not check_storage_rent(account):
# proceed with deleting
else:
assert DeleteAccountHasEnoughBalance()
```
Account can end up with not enough balance in case it gets slashed. Account will become unusable as all orginating transactions will fail (including deletion).
The only way to recover it in this case is by sending extra funds from a different accounts.

## Validators

Expand Down