-
Notifications
You must be signed in to change notification settings - Fork 307
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
WIP: bdk_core::coin_select
integration
#773
WIP: bdk_core::coin_select
integration
#773
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
Something is still off with weight calculations. Is this a problem with Update: Held up by bugs in |
@evanlinjin is the PR ready to be revived now that |
I will close this as @LLFourn has reworked the bdk chain's coin selector so this is no longer relevant. |
Description
This is just a showcase of how coin selection will look with
bdk_core
integration. 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_select
module.Checklists
All Submissions:
cargo fmt
andcargo clippy
before committingNew Features:
Bugfixes: