Closed mvines closed 4 years ago
Sneaky (too sneaky) but this appears to not be an issue due to: https://github.com/solana-labs/solana/blob/12eff5a2f988033fa2ce18b2c27e93a1c70431e8/sdk/src/native_loader.rs#L12
account.rent_epoch is always 0 for native programs
No, whitelisting executable accounts in update()
is the right thing to do as AccountsDb can modify the rent_epoch for a native program account.
This seems good:
-if account.rent_epoch > self.epoch || sysvar::check_id(&account.owner) {
+if account.executable || account.rent_epoch > self.epoch || sysvar::check_id(&account.owner) {
This bug can literally take down any cluster with a simple transfer
, we should fix it ASAP
We whitelist sysvars, https://github.com/solana-labs/solana/blob/c902fd0303368ab34bfe2ed627eb1c58e0e7fdf9/runtime/src/rent_collector.rs#L39, but not native programs with an account balance of 1 lamport.
This appears to imply that a native program can be rent-collected, which may be the root cause of #9109.
There's no need to collect rent from a native program account!