solana: Accounts implicitly created by a Transfer cannot be resized
Problem
Once an account is implicitly created by getting tokens from a Transfer, it can no longer be “created” in CreateAccount because we fail the transaction if the account is already in use (lamports > 0).
Proposed Solution
- Remove the conditions that created accounts must have 0 lamports / empty data
- Additional CreateAccount lamports get added to the current account balance, and the account data is simply resized
tag @rob-solana
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 15 (14 by maintainers)
Supporting
CreateAccountinto an existing system account regardless of current lamports or data seems fine now that we signto. In that case the additionalCreateAccountlamports get added to the current account balance, and the account data is simply resized (no need for clearing back to zero since a system account will always have zero-ed out data).I think that should solve the potential
TransferDoS without introducing another system program instruction.