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

Change bytecode storage to be by hash as opposed to by address #5388

Closed
6 of 7 tasks
non-fungible-nelson opened this issue Apr 25, 2023 · 1 comment · Fixed by #5889
Closed
6 of 7 tasks

Change bytecode storage to be by hash as opposed to by address #5388

non-fungible-nelson opened this issue Apr 25, 2023 · 1 comment · Fixed by #5889
Assignees
Labels
bonsai TeamGroot GH issues worked on by Groot Team

Comments

@non-fungible-nelson
Copy link
Contributor

non-fungible-nelson commented Apr 25, 2023

Today, code storage is stored by account address, but we need to store by code hash. Duplicated smart contracts can point to the same hashed bytecode. We also must serve data by hash in the context of the snapsync server.

  • Do a comparison with a full sync node to compare the improvement in storage reduction
  • Measure the performance impact of the change on syncing and block import
  • Change code storage to be stored by code hash instead of account address
  • Backwards capability for code storage by account
  • Compare stored code values from existing column family to new column to ensure consistency
  • Performance test syncing to ensure read/write performance caused by changes to tracking code hashes by address have minimal impact
  • Experimental flag to enable code storage by code hash
  • Compare storage size taken by new column families with old storage mode
  • Track code hashes by address so that self-destruct can removed when all code storage is unreferenced
@non-fungible-nelson non-fungible-nelson added the icebox items that need more consideration, time, or can wait label Apr 25, 2023
@jframe jframe added TeamGroot GH issues worked on by Groot Team bonsai and removed icebox items that need more consideration, time, or can wait labels Sep 6, 2023
@jframe jframe self-assigned this Sep 11, 2023
@jframe jframe reopened this Jan 31, 2024
@macfarla macfarla added this to the 2024 Q1 Besu team milestone Feb 2, 2024
@jframe
Copy link
Contributor

jframe commented Feb 8, 2024

Mainnet code by address hash column size

Column Family Keys Column Size SST Files Size
CODE_STORAGE 37701832 10 GiB 12 GiB

Mainnet code by code hash column size

Column Family Keys Column Size SST Files Size
CODE_STORAGE 1231697 3 GiB 3 GiB

We save ~7GB by storing by code hash

@jframe jframe closed this as completed Feb 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bonsai TeamGroot GH issues worked on by Groot Team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants