Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AccountsCache not being cleared #2083

Closed
web3-developer opened this issue Mar 19, 2024 · 1 comment
Closed

AccountsCache not being cleared #2083

web3-developer opened this issue Mar 19, 2024 · 1 comment
Labels
bug Something isn't working Sync Prevents or affects sync with Ethereum network

Comments

@web3-developer
Copy link
Contributor

See the discussion here for some context:
#2072 (comment)

The AccountsCache type holds a cache in memory of the accounts and storage slots which have recently been accessed. This data structure should periodically be cleared in order to avoid memory bloat. Currently the call to persist in the process block function will check if ClearCache is set in the VM flags:
db.persist(clearEmptyAccount, ClearCache in vmState.flags)

The VM flag is currently not set anywhere in the code base and therefore the AccountsCache is never cleared. Perhaps the flag should be set by the synchronizer(snap, full, or beacon sync).

@web3-developer web3-developer changed the title AccountsCache never cleared AccountsCache not being cleared Mar 19, 2024
@web3-developer web3-developer added the bug Something isn't working label Mar 19, 2024
@jangko jangko added the Sync Prevents or affects sync with Ethereum network label Mar 22, 2024
@arnetheduck
Copy link
Member

A new cache is created every time a ledger is created which happens every time a new vmstate is created which happens often enough:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Sync Prevents or affects sync with Ethereum network
Projects
None yet
Development

No branches or pull requests

3 participants