Skip to content
This repository has been archived by the owner on Mar 14, 2023. It is now read-only.

Enforce tx consistency in ChainGraph #97

Closed
LLFourn opened this issue Dec 20, 2022 · 2 comments · Fixed by #116
Closed

Enforce tx consistency in ChainGraph #97

LLFourn opened this issue Dec 20, 2022 · 2 comments · Fixed by #116

Comments

@LLFourn
Copy link
Owner

LLFourn commented Dec 20, 2022

Now that we have done #80 we always have a full tx whenever we have a txid in the SparseChain. In #74 we started enforcing that txs in ChainGraph don't double spend each other but only in determine_changeset. We are inconsistent about this though. We don't do it in insert_tx for example. This is an issue to discuss whether we want to do this across the whole structure. If we are not going to always enforcing it then we shouldn't just do it in determine_changeset. We should have a separate method like determine_changeset_evict_conflicts that does determine_changeset.

My preference is to keep it consistent across the whole structure.

@rajarshimaitra
Copy link
Collaborator

My preference is to keep it consistent across the whole structure.

+1 on this.. This makes reasoning over the structure easier and less chance to screw up by the API.. IMO we should maintain all the invariant consistently across the API..

@evanlinjin
Copy link
Collaborator

We don't do it in insert_tx for example.

However we also don't do it for apply_update as well.

How should we approach this? For insert_tx, should we split it into determine_insert_tx_changeset and apply_insert_tx?

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

Successfully merging a pull request may close this issue.

3 participants