SIMD-0183
Skip Rent Rewrites
Feature Gate Status
CGB2jM8pwZkeeiXQ66kBMyBR6Np61mggL7XUsmLjVcrw
TL;DR
Do not rewrite accounts *that are unchanged* by rent collection.
Summary
Do not rewrite accounts *that are unchanged* by rent collection.
Motivation
Rent collection checks every account at least once per epoch. This process loads *and stores* accounts, regardless if the account has actually changed or not. All accounts now must be rent-exempt, and there are zero rent-paying accounts on mainnet-beta. Thus, almost every account stored due to rent collection is unchanged, and storing unchanged accounts is useless work. Worse, storing accounts incurs all the downstream costs on the accounts database: computing the various accounts hashes on extra accounts unnecessarily, tracking/cleaning/purging the new and old versions of accounts, plus it bloats the incremental snapshots with accounts that haven't meaningfully changed.
Impact
Validators will see performance improvements: * Fewer accounts will need to be stored per slot. * Fewer accounts will need to be hashed for the various accounts hashes. * Fewer accounts will need to be included in incremental snapshots.
Security Considerations
Having all accounts rewritten due to rent collection results in all accounts being included in at least one bank hash per epoch. Since the bank hash is part of what is voted on for consensus, this means every account is verified by the network at least once per epoch. By skipping rewrites, we lose this security property. This is OK because the Epoch Accounts Hash (EAH) was added to directly address this issue. See the [EAH proposal](https://docs.solanalabs.com/implemented-proposals/epoch_accounts_hash) for more information.