ckb icon indicating copy to clipboard operation
ckb copied to clipboard

Update ckb-db's COLUMNs Key Schemas to Use `BlockNumber`

Open eval-exec opened this issue 1 year ago • 0 comments

What problem does this PR solve?

This PR updates the key schema of RocksDB columns from using just the block hash to a combination of block number and block hash. By including the block number in the key, the new schema ensures that key-value pairs are ordered by block number. This reordering can improve query performance and data organization.

What is changed and how it works?

Related changes

  • [x] Modified key schema in RocksDB from block_hash to block_number + block_hash.
  • [ ] Add a layer to the read/write process from ckb-store to ckb-db, allowing old versions of db-schemas to read/write old version data and new versions of db-schemas to read/write new version data.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code ci-runs-only: [ quick_checks,linters ]

Side effects

  • Performance regression
  • Breaking backward compatibility

Release note

Title Only: Include only the PR title in the release note.

eval-exec avatar Jun 27 '24 05:06 eval-exec