Important
Storage limit and account minimum balance were released on the emulator.
This is a breaking change. This also emulates what will be on the testnet in the near future. That is why it is highly recommended that you get familiar with this version of the emulator. However if you really need to, you can turn off storage limits and account minimum balance by running the emulator with a --storage-limit=false
flag.
Description of changes
Each account now has storage used and storage capacity. Storage used is the byte size of all the data that is on that account. Storage capacity of an account depends on the amount of FLOW the account has. The conversion rate between FLOW and storage capacity is 1 megabyte per 1 FLOW.
An account can use storage up to its capacity. If a transaction would put an accounts storage used over its storage capacity the transaction fails and is reverted.
A minimum account balance of 0.1 FLOW is also introduced. This is so that accounts always have at least 100 kilobytes of storage. The minimum account balance is deducted from the account creator an put on the newly created account during account creation. Existing accounts on testnet and mainnet will be given the minimum account balance during the spork that will turn this on.
Impact
- The 100kb minimum storage means most accounts wont need to worry about storage capacity.
- If you have 100 FLOW on your account, you canβt withdraw 100 FLOW. If you are storing less then 100kB you can withdraw 99.9 FLOW. If you are for example storing 3MB you can only withdraw 97 FLOW.
- To create an account the account creating it has to be at least 0.1 FLOW (100kb) below its storage capacity, because 0.1 FLOW will be moved to the new account.
- If a transaction is adding an NFT to an account (or increasing its storage some other way), that same transaction can then check if the account is over capacity and also sent it some flow.
References
User doc that explains storage capacity and storage used - Storing Data on Flow - Flow Documentation
Documentation for the new cadence fields - Accounts - Flow Documentation