solana-foundation / developer-content

Collection of Developer content for exploring, learning, and building in the Solana ecosystem.
https://solana.com/developers
93 stars 136 forks source link

Rent docs are no longer accurate #121

Open fafrd opened 5 months ago

fafrd commented 5 months ago

Is this still accurate? https://github.com/solana-foundation/developer-content/blob/main/docs/core/rent.md?plain=1#L32

The Solana rent rate is set on a network wide basis, primarily based on the set
LAMPORTS _per_ byte _per_ year.

Per SIMD-0084, it seems rent is no longer being collected: https://github.com/solana-foundation/solana-improvement-documents/pull/84

As a new developer on Solana i'm confused, would be good to have this cleared up in the documentation.

nickfrosty commented 5 months ago

This is still accurate and rent is still being "collected" when new accounts are allocated, specifically the runtime collects "2 years worth of rent" upfront for an account to become "rent exempt". This "data storage fee" is still very much being collected.

For some time now, newly created accounts are required to be rent exempt. But since this was not always the requirement, there were still accounts that were NOT rent exempt. Accounts that were NOT rent exempt would periodically have a small portion of their "rent" lamport balance collected by the runtime (I believe at the epoch boundary). When an account's lamport balance dropped to zero, it would be garbage collected by the runtime and it's state removed.

SIMD-84 is more referring to disabling the automatic collection of this periodic rent fee (aka account balance deduction until zero balance) since recently the very last non-rent exempt account was finally garbage collected. So now, we no longer need this "periodic rent collection" code in the code base since it is effectively dead code.

nickfrosty commented 5 months ago

I will also note that this SIMD-84 is still in a pending state and not not been merged or completed.

Only once the various engineering teams come to an agreement, will any SIMD be "approved" and completed.

nickfrosty commented 5 months ago

All this being said, I do agree that we can and should update this rent doc to clarify the current state of this concept of rent and rent exempt