Skip to content

Remove Database::flush() function #567

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

Closed
notmandatory opened this issue Mar 13, 2022 · 1 comment
Closed

Remove Database::flush() function #567

notmandatory opened this issue Mar 13, 2022 · 1 comment

Comments

@notmandatory
Copy link
Member

notmandatory commented Mar 13, 2022

Remove Database::flush() function added in #409 and call it internally in the keyvalue::Database impl in functions that create or update Tree data.

Currently only the keyvalue::Database impl does anything in the Database::flush function and @thunderbiscuit and I confirmed it needs to be called to fix bitcoindevkit/bdk-ffi#114 on Android. But the Database::flush is not used or needed for the Memory or Sqlite databases, see also bitcoindevkit/bdk-ffi#116 (comment).

EDIT: as discussed in #575 for now it's enough to only remove the Database::flush() function. The auto-flushing is probably not the right approach at this time.

@kafaichoi kafaichoi mentioned this issue Mar 23, 2022
9 tasks
notmandatory added a commit that referenced this issue Jul 4, 2022
5ff8320 add private function ivcec_to_u32 in keyvalue (KaFai Choi)
e68d3b9 remove Database::flush (KaFai Choi)

Pull request description:

  <!-- You can erase any parts of this template not applicable to your Pull Request. -->

  ### Description

  This PR is to remove Database::flush. See this issue for detail #567

  ### Notes to the reviewers
  The 2nd commit is a small refactoring of adding a new private ivec_to_u32 to avoid too much code duplication. Please let me know if it's ok to include this in this PR or I should make it into a separate PR

  Currently existing test cases are shared across for all Databaes implementation so I am not sure if we should add  specific test cases for keyvalue(Tree) for this auto-flush behaviour?(and I feel like it's more a implementation detail). Please let me know how should I proceed for test case in this PR

  ### Checklists

  #### All Submissions:

  * [x] I've signed all my commits
  * [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md)
  * [x] I ran `cargo fmt` and `cargo clippy` before committing

  #### New Features:

  * [ ] I've added tests for the new feature
  * [ ] I've added docs for the new feature
  * [x] I've updated `CHANGELOG.md`

  #### Bugfixes:

  * [ ] This pull request breaks the existing API
  * [ ] I've added tests to reproduce the issue which are now passing
  * [ ] I'm linking the issue being fixed by this PR

ACKs for top commit:
  danielabrozzoni:
    re-ACK 5ff8320

Tree-SHA512: eb37de8217efeb89d3ae346da36d0fb55aa67554d591b4759500f793bcf6aa7601c3d717fd473136c88e76aa72dbb6008ecf62b1d4ccf5ba3cbd1598f758522a
@danielabrozzoni
Copy link
Member

Fixed by #575

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants