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

Investigate removing old Ethereum events from storage #1287

Open
Tracked by #2023
sug0 opened this issue Apr 13, 2023 · 3 comments
Open
Tracked by #2023

Investigate removing old Ethereum events from storage #1287

sug0 opened this issue Apr 13, 2023 · 3 comments

Comments

@sug0
Copy link
Collaborator

sug0 commented Apr 13, 2023

To save storage space over time, it might be nice to remove processed Ethereum events from the current state at some block height $H$. Any Ethereum event whose processing is governed by nonces can potentially take advantage of such an optimization. To check if an Ethereum event has been seen (e.g. reached $\ge \frac{2}{3}$ voting power by stake), we can check if its nonce is lower than the nonce of the Ethereum event of the same kind that is registered in storage.


Further optimizations

  • After confirming validator set update Ethereum events, we can delete their proof from storage. EthBridgeQueries::valset_upd_seen should check the nonce in storage of the last processed valset upd event.
  • A similar optimization can be employed to Bridge pool root signatures.
@sug0
Copy link
Collaborator Author

sug0 commented May 18, 2023

Deleting a value from storage still writes a diff of the previous value. No data is actually being deleted, at the RocksDB level. Therefore, we can't free up any space derived from seen Ethereum events.

Closing this issue

@sug0 sug0 closed this as completed May 18, 2023
@sug0
Copy link
Collaborator Author

sug0 commented Jul 15, 2023

This might still be relevant, since keys that aren't deleted carry over a diff from the previous block height, which still contains some data. Please confirm this @yito88

@sug0
Copy link
Collaborator Author

sug0 commented Feb 12, 2024

Changed the priority because the Ethereum Bridge is not undergoing active development, currently. However, before its launch, this should definitely be implemented, as it could allow garbage collecting old tallies from storage, reducing the required space to operate the bridge in Namada.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant