-
Notifications
You must be signed in to change notification settings - Fork 390
refactor(chain)! removed IndexedTxGraph 🗑 #1510
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
Conversation
041f4e3
to
7307bb1
Compare
Concept ACK |
I added this to the beta milestone but TBH I'm worried about trying to get another big refactor in on top of the other refactoring going on. |
Fine to de-prioritize this one. It's here for when it's useful. |
I'm interested in updating this PR if @LLFourn hasn't gotten to it. |
In this PR bdk/crates/wallet/src/wallet/changeset.rs Lines 11 to 24 in 88330f6
|
9ab4194
to
dc597bf
Compare
in favour of adding a type parameter to TxGraph. When the second type parameter `X: Indexer` is set then TxGraph behaves like `IndexedTxGraph` used to. I reworked the internals of `TxGraph` as I thought things were a bit convoluted. - feat: allow changing the indexer on TxGraph Co-authored: LLFourn
dc597bf
to
c6047a0
Compare
I think the new edit: After talking on dev call we decided that, in the interest of not breaking the data model, it would be best to maintain |
8c368dd
to
0873d17
Compare
@ValuedMammal are you suggesting that the new I'm okay with this, but I still don't understand how this is better than having the indexer changeset as a new field in |
Not exactly. Assuming the new tx graph If I understand, @tnull was of the opinion that making the wallet's changeset automatically become |
@ValuedMammal I'm not sure which "data model" we are referring to here. The one we support is // tx_graph.rs
// the old indexed tx graph changeset
struct ChangeSet<A, I> {
#[serde(alias="tx_graph")] // or whatever it was called
pub txs: TxChangeSet<A>, // the old tx graph changeset
pub indexer: I
} But if we are serious about keeping serde encodings compatible we should really think carefully about how to do that (perhaps by using a lot of |
Ok it makes sense to use the same structure as the original |
0873d17
to
61276fe
Compare
- The original `tx_graph::ChangeSet` is moved to `changeset` module. - The indexed changeset, formerly `indexed_tx_graph::ChangeSet`, is now defined in the `changeset::indexed` module. This is the type used by `TxGraph`.
61276fe
to
872fa4a
Compare
No, this is about maintaining at least backwards compatibility of the I'm not sure I'm completely following the different changes proposed in this PR, but what was discussed on the recent call mentioned that fields would be moved between sub-types, which would be a breaking change, AFAIU. |
We are making breaking changes to |
I'm going to rebase this on master and remove the changes to |
Excuse the delay here, I was off for a bit. FWIW, when we started to implement our serialization, I was ensured over and over again that custom serialization is fully supported by the BDK project and that I therefore think it's crucial to finally clearly document what kinds of changes can be expected, what is and will be guaranteed going forward by the And, while I generally try to keep an eye on what's happening in BDK and appreciate the pings on/pointers to particular PRs, it can't be expected that I review every PR for changes that might potentially break the previously agreed upon policy. The guarantees really need to be written down, and preferably even asserted via upgrade tests in CI to make they are not violated. |
@tnull Changeset serialization format is definitely going to be backwards compatible. In terms of Cargo semver, these are breaking changes. |
Hmm, okay, still confused what you mean by 'ChangeSet serialization format' here, as BDK doesn't provide (a canonical) one. Would be great to see these guarantees documented (i.e., spelled out in detail what exactly they mean) and tested. |
cACK 872fa4a |
@tnull are you able to be specific with what you want? I.e. it will be much more productive if you told us how you did serialization in LDK Node if it worries you that serialization would break here. Serialization format is not changing at all in this PR. We never agreed on having a canonical serialization format for BDK (and I don't understand how it would help). We agreed that we will only add new and default-able fields on changesets (with |
We had a discovery which lead to discussion about whether this is the right approach. For silent payments you need to change the Removing I'm closing this for now. Thanks for trying to keep this up to date @ValuedMammal. Feel free to reopen this if you disagree or have another idea. |
I'm sorry for the confusion wrt to this. It's possible we did change our guidance on this. We may need to make changes to |
Well, what I stated multiple times previously: clear, documented guidance on what guarantees implementors can lean on. So far, all the compatibility guarantees were committed to on Discord, or in live meetings, but it turns out there is increasing confusion on what they actually mean and whether I can expect to be able to upgrade to the next BDK version or not. 🤷♂️
Well, I'm happy to point you to the code (1, 2), but that is also not how this should work: there should be an API contract clearly communicated and committed to by the BDK project. So neither do I expect you guys to read our code, nor do I want to constantly review BDK PRs just to check it doesn't break our stuff (to be clear, I'm happy to contribute some review here and there, but not for this reason).
Well IIRC you agreed to a) only make backwards compatible changes (and solved it by implementing @evanlinjin Note that the guarantees you just reiterated in your own words seem to be in conflict with what @LLFourn just summarized:
So, to be honest, I basically read this as "all bets are off, we currently just care about whether or not our SQLite persistence breaks or not, nevermind what we said a few months back, please come back once we're done making further breaking changes". Please, if I'm misinterpreting this, let us define a clear, documented API contract that defines compatibility guarantees. It could be that everything is fine and I'm worrying too much, but as the confusion on all sides seems to be increasing, I fear that one day I won't be able to upgrade BDK without writing tedious migration scripts, or, much worse, have the user discover in production that their serialized data doesn't work with the newest version of BDK. |
Fixes bitcoindevkit/bdk_wallet#130
Removes
IndexedTxGraph
in favour of adding a type parameter to TxGraph.When the second type parameter
X: Indexer
is set then TxGraph behaves likeIndexedTxGraph
used to.This simplifies code and improves ergonomics.
The motivation for doing this now this is because doing this later would be a breaking change for
bdk_wallet
and I felt it was irritating to work with.I reworked the internals of
TxGraph
as I thought things were a bit convoluted.Notes to the reviewers
Changelog notice
IndexedTxGraph
in favour of adding a type parameter to TxGraph.Checklists
All Submissions:
cargo fmt
andcargo clippy
before committing