WIP: bdk_core::coin_select integration#773
Closed
evanlinjin wants to merge 16 commits intobitcoindevkit:masterfrom
Closed
WIP: bdk_core::coin_select integration#773evanlinjin wants to merge 16 commits intobitcoindevkit:masterfrom
bdk_core::coin_select integration#773evanlinjin wants to merge 16 commits intobitcoindevkit:masterfrom
Conversation
be40647 to
f8d9c97
Compare
There is a bug in miniscript where they fail to take into consideration an `OP_PUSH..` (4 weight units) when calculating `max_satisfaction_weight` for `pkh` script types. We add this weight explicitly for `pkh` script types during coin selection.
Weight units should always be whole units. However, virtual bytes will need decimal places and the conversion from weight unit to vbytes should not be rounded. This commit has the following changes: * vbytes should always be represented in `f32` * conversion between vbytes and weight units should never be rounded * simple calculations (such as those for feerates) should be explicitly defined (instead of using multiple small functions)
Since `CoinSelectionAlgorithm` is a trait, if the database is really needed, one can create a struct that contains a database field which implements the `CoinSelectionAlgorithm` trait. Most `CoinSelectionAlgorithm` implementations do not require a database.
Use `iter_unspent` instead, as it returns an iterator directly.
If `exclude_hash` is set, we split the input data, and if a checksum already existed within the original data, we check the calculated checksum against the original checksum. Additionally, the implementation of `IntoWalletDescriptor` for `&str` has been refactored for clarity.
`Wallet` stores the descriptors' checksum in the database for safety. Previously, the checksum used was a checksum of a descriptor that already had a checksum. This PR allows for backward-compatibility of databases created with this bug.
This begins work on the `wallet::coin_control` module. The idea is to filter coins, and determine which coins are fit for coin selection. `Wallet::avaliable_utxos` is introduced to use `CoinFilterParams`.
eff7a50 to
543b263
Compare
618cece to
429e505
Compare
Member
Author
Something is still off with weight calculations. Is this a problem with Update: Held up by bugs in |
Member
|
@evanlinjin is the PR ready to be revived now that |
Member
Author
|
I will close this as @LLFourn has reworked the bdk chain's coin selector so this is no longer relevant. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This is just a showcase of how coin selection will look with
bdk_coreintegration. Tests are failing badly at the moment and I still need to figure out why.Notes to the reviewers
This is still WIP, but let me know what you think.
Changelog notice
Integrate
bdk_core::coin_selectmodule.Checklists
All Submissions:
cargo fmtandcargo clippybefore committingNew Features:
Bugfixes: