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(doc): Simplify the database design using prefix iterators #3916

Merged
merged 2 commits into from
Mar 21, 2022

Conversation

teor2345
Copy link
Contributor

@teor2345 teor2345 commented Mar 21, 2022

Motivation

To avoid storing the transaction count for each block, we can use RocksDB prefix iterators.

API Reference

API Function:
https://docs.rs/rocksdb/latest/rocksdb/struct.DBWithThreadMode.html#method.prefix_iterator_cf

API Docs:
https://github.com/facebook/rocksdb/wiki/Prefix-Seek#why-prefix-seek

Designs

Iterate through every transaction for a height, rather than storing a transaction count.

Solution

  • Update the design to use a prefix iterator

Related changes:

  • Make column family names consistent
  • Fix some minor design details

Review

This is a low-priority design fix.

It would be good to have it merged by the database design review meeting later this week. (Wednesday evening UTC.)

Reviewer Checklist

  • Design changes make sense

Follow Up Work

Implement the design in:

@teor2345 teor2345 added A-docs Area: Documentation C-design Category: Software design work P-Low ❄️ A-state Area: State / database changes lightwalletd any work associated with lightwalletd labels Mar 21, 2022
@teor2345 teor2345 requested a review from a team as a code owner March 21, 2022 07:50
@teor2345 teor2345 self-assigned this Mar 21, 2022
@teor2345 teor2345 requested review from upbqdn and removed request for a team March 21, 2022 07:50
Copy link
Member

@upbqdn upbqdn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, I have a few minor suggestions.

book/src/dev/rfcs/0005-state-updates.md Outdated Show resolved Hide resolved
book/src/dev/rfcs/0005-state-updates.md Outdated Show resolved Hide resolved
book/src/dev/rfcs/0005-state-updates.md Outdated Show resolved Hide resolved
Co-authored-by: Marek <mail@marek.onl>
@teor2345 teor2345 requested a review from upbqdn March 21, 2022 20:44
mergify bot added a commit that referenced this pull request Mar 21, 2022
@mergify mergify bot merged commit 2b51f90 into main Mar 21, 2022
@mergify mergify bot deleted the db-design-tweak branch March 21, 2022 22:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: Documentation A-state Area: State / database changes C-design Category: Software design work lightwalletd any work associated with lightwalletd
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants