thor icon indicating copy to clipboard operation
thor copied to clipboard

Darren/logdb remove leading zeros

Open darrenvechain opened this issue 4 months ago • 1 comments

Description

This changes reduces the storage size for the LogDB by removing leading zeros from topics. Eg, instead of storing topic 1 equal to:

0000000000000000000000006d95e6dca01d109882fe1726a2fb9865fa41e7aa

We store:

6d95e6dca01d109882fe1726a2fb9865fa41e7aa

This saves over 0.5 GB of storage.

Type of change

Please delete options that are not relevant.

  • [x] Breaking change - requires a full resync of the logDB

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • [x] Unit tested
  • [x] Performance tested - No change in query performance
  • [x] Comparison tested](https://github.com/darrenvechain/thor-comparative-testing/blob/main/tests/endpoints/logs/events/compare-events.test.ts) - Mainnet against synced node with these changes. All API calls returned the same values for the same request

Checklist:

  • [x] My code follows the style guidelines of this project
  • [x] I have performed a self-review of my code
  • [x] I have commented my code, particularly in hard-to-understand areas
  • [x] I have made corresponding changes to the documentation
  • [x] My changes generate no new warnings
  • [x] I have added tests that prove my fix is effective or that my feature works
  • [x] New and existing unit tests pass locally with my changes
  • [x] New and existing E2E tests pass locally with my changes
  • [x] Any dependent changes have been merged and published in downstream modules
  • [x] I have not added any vulnerable dependencies to my code

darrenvechain avatar Oct 21 '24 08:10 darrenvechain