In chainlink, when LRU cache overflows it evicts accounts, which results in unsubscription, followed by account removal from accountsdb. This has several problems:
- If someone is currently operating on that account, it will lead to a nasty data race and potential UB
- Replication stream is completely unaware of the fact that accountsdb state has been changed, due to the lack of transaction and will result in a state mismatch with replica nodes.
We need to add a separate instruction to handle account closures, and do the operation properly via transaction.
|
fn subscribe_account_removals( |
In chainlink, when LRU cache overflows it evicts accounts, which results in unsubscription, followed by account removal from accountsdb. This has several problems:
We need to add a separate instruction to handle account closures, and do the operation properly via transaction.
magicblock-validator/magicblock-chainlink/src/chainlink/mod.rs
Line 232 in dac276f