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

cleanup(db): Give forward and reverse database iterators explicit names #8063

Merged
merged 2 commits into from
Dec 6, 2023

Conversation

teor2345
Copy link
Contributor

@teor2345 teor2345 commented Dec 6, 2023

Motivation

It was really tricky to use our database API in #8050, so I wanted to make iterator directions clearer.

This is different from the Rust Iterator trait, but that's probably ok as long as it's more explicit.

PR Author Checklist

Check before marking the PR as ready for review:

  • Will the PR name make sense to users?
  • Does the PR have a priority label?
  • Have you added or updated tests?
  • Is the documentation up to date?

If a checkbox isn't relevant to the PR, mark it as done.

Specifications

RocksDB has forward and reverse iterators, we use our own generic wrappers for them.

Solution

  • Rename iterators to forward, and remove extra boolean arguments
  • Ignore a clippy lint

Testing

This is covered by existing tests.

Review

This is a low priority cleanup, but it might be useful for some of the scanner work.

Please double-check that:

  • false is forward
  • true is reverse

Reviewer Checklist

Check before approving the PR:

  • Does the PR scope match the ticket?
  • Are there enough tests to make sure it works? Do the tests cover the PR motivation?
  • Are all the PR blockers dealt with?
    PR blockers can be dealt with in new tickets or PRs.

And check the PR Author checklist is complete.

@teor2345 teor2345 added C-cleanup Category: This is a cleanup P-Low ❄️ A-state Area: State / database changes C-trivial Category: A trivial change that is not worth mentioning in the CHANGELOG A-blockchain-scanner Area: Blockchain scanner of shielded transactions labels Dec 6, 2023
@teor2345 teor2345 self-assigned this Dec 6, 2023
@teor2345 teor2345 requested a review from a team as a code owner December 6, 2023 01:08
@teor2345 teor2345 requested review from arya2 and removed request for a team December 6, 2023 01:08
mergify bot added a commit that referenced this pull request Dec 6, 2023
@mergify mergify bot merged commit 9fec711 into main Dec 6, 2023
128 checks passed
@mergify mergify bot deleted the db-iter-clean branch December 6, 2023 21:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-blockchain-scanner Area: Blockchain scanner of shielded transactions A-state Area: State / database changes C-cleanup Category: This is a cleanup C-trivial Category: A trivial change that is not worth mentioning in the CHANGELOG
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants