Closed m1stoyanov closed 1 month ago
supportive
@Ethanol48 perhaps you want to take this?
Sure!
Currently, we cannot fetch/cache particular accounts, slots, and block hashes because the corresponding functions are private. Making them public will provide more flexibility.
Furthermore, having access to accounts, storage, and block_hashes HashMaps will allow for very fast simulations(we know how slow it can be getting a bunch of storage slots). So functions like:
pub fn insert_or_update_accounts(&self, data: Map<Address, AccountInfo>) pub fn insert_or_update_storage(&self, data: Map<Address, StorageInfo>) pub fn insert_or_update_block_hashes(&self, data: Map<U256, B256>)
will be of great benefit, i beleive.
Hi @m1stoyanov, can you tell me how do you use the library? I created some public functions inside the cache.rs
in the struct BlockchainDb
, that let's you do what you requested, but I'm not sure what you meant is that, do you want these functions inside the BackendHandler
in backend.rs
?
I use the library to simulate txs that touch many storage slots. I think the pub functions should be placed in SharedBackend to maintain the design integrity.
Great work, @Ethanol48 I am closing this
Currently, we cannot fetch/cache particular accounts, slots, and block hashes because the corresponding functions are private. Making them public will provide more flexibility.
Furthermore, having access to accounts, storage, and block_hashes HashMaps will allow for very fast simulations(we know how slow it can be getting a bunch of storage slots). So functions like:
will be of great benefit, i beleive.