Skip to content

Conversation

@110CodingP
Copy link
Contributor

@110CodingP 110CodingP commented Jul 22, 2025

Description

Fixes #1991. As the linked issue mentions Boxing helps reduce memory overhead and limits the size of enums with StoreErrorWithDump as variant.

Breaking: The enum StoreErrorWithDump and the functions load,dump and load_or_create have been changed.

Changelog Notice

   Changed
   - `changeset` field of `StoreErrorWithDump` is now of type `Option<Box<C>>` 

Checklists

All Submissions:

@ValuedMammal
Copy link
Collaborator

I agree with the use of Box in the StoreErrorWithDump error, but I wonder is it necessary to box the changeset when returned in the Ok value, for example in dump and load, etc. If no one finds this to be important, I would just as soon leave it out.

@110CodingP
Copy link
Contributor Author

110CodingP commented Jul 28, 2025

Removed the Box from return type of dump, load, load_or_create in #56f1fad .
Sorry for the delay.

Copy link
Contributor

@nymius nymius 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 to me!

I wonder is it necessary to box the changeset when returned in the Ok value, for example in dump and load, etc.

We can ignore that, thinking in terms of the goal of this crate, which is to provide a testing database to experiment, not performance. load and dump are called most of the time just on the startup and on the shutdown of the code using the database, with occasional dumps for debugging.

@ValuedMammal
Copy link
Collaborator

ACK 56f1fad

Copy link
Contributor

@LagginTimes LagginTimes left a comment

Choose a reason for hiding this comment

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

ACK 56f1fad

Copy link
Contributor

@oleonardolima oleonardolima left a comment

Choose a reason for hiding this comment

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

ACK 56f1fad

You need to do a rebase to get the updated rustc and MSRV fixed CI.

As mentioned in the corresponding issue, `Box`ing helps reduce memory
overhead while passing the enum around and also to limit the size of
enums with `StoreErrorWithDump` as a variant.

Breaking: The enum `StoreErrorWithDump` has been changed.
@ValuedMammal ValuedMammal added this to the Wallet 3.0.0 milestone Aug 6, 2025
@ValuedMammal ValuedMammal moved this to Needs Review in BDK Wallet Aug 6, 2025
Copy link
Member

@evanlinjin evanlinjin left a comment

Choose a reason for hiding this comment

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

ACK 418753f

@evanlinjin evanlinjin merged commit c43154d into bitcoindevkit:master Aug 7, 2025
31 of 34 checks passed
@github-project-automation github-project-automation bot moved this from Needs Review to Done in BDK Wallet Aug 7, 2025
@github-project-automation github-project-automation bot moved this from In Progress to Done in BDK Chain Aug 7, 2025
@oleonardolima oleonardolima mentioned this pull request Sep 12, 2025
24 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done
Archived in project

Development

Successfully merging this pull request may close these issues.

[file_store] Change StoreErrorWithDump to box the aggregate changeset

6 participants