1

How does this "collecting rent" work exactly(or used to work)? Does it iterate over all the accounts that are not rent exempt per every epoch? in this link, i saw this line:

requires the whole scan of accounts and is spread over an epoch based on account address prefix to avoid load spikes due to this rent collection.

but it is not completely clear and i wonder if it does so, isn't it bad implementation because iteration over that many accounts is in big O of n and n can be a very large number in blockchain world

1 Answer 1

1

Collecting rent will be removed. As of now to my knowledge there are no accounts anymore that are not rent exempt. When an account is rent exempt there is no rent collection anymore. This will enable that the feature will be completly removed from the code at some point.

You can see how much rent an account costs to be rent exempt using the command:

solana rent bytes

Here is the SIMD to remove rent collection: https://github.com/solana-foundation/solana-improvement-documents/pull/84

To find more details on how rent collection works/worked its probably easiest to read the issues or the code on the solana repository:

2020 you can see it was switched from lazy to eager collection for example: https://github.com/solana-labs/solana/issues/7413

Here you can see for example that the fees are collected as a blocking operation at the end of every block. https://github.com/solana-labs/solana/issues/18233

You can see rent collection caused quite some problems so that is one reason why it was removed: https://github.com/solana-labs/solana/issues/23342

2
  • 1
    thank you for the time to answer. but i still need to know how it used to work? was it as i imagined, iterating through all the accounts? Commented Feb 15 at 12:49
  • I dont know too many details, but i added some github links.
    – Jonas H.
    Commented Feb 15 at 18:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.