-
Notifications
You must be signed in to change notification settings - Fork 38
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
Mempool refactor #291
Mempool refactor #291
Conversation
✅ Deploy Preview for cheery-moxie-4f1121 ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
overall the PR is very good, I'm leaving a partial review about algorithms and data structure used.
Most of them can be done as future PRs since the old system did the same and this is a refactor PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nits/triviliaties
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tACK bfde392
Looking stable in every way I can test: HD and non-HD wallets, Staking and Unstaking, Shielding and Deshielding, synchronising, all appear to be perfectly stable and reliable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tACK and merging
Abstract
This PR aims to better define the role of the Mempool class, and its relationship to other parts of the code. It's worthwhile to note that the name 'Mempool' has been a misnomer for quite a while; I've decided to interpret its role as a Transaction Manager, implementing the following functionalities:
The circular dependency with the
Wallet
class was removed. Now theWallet
class holds a private instance of theMempool
, and all public references to the global mempool object have been removed.Why not merge this with the Wallet class?
I believe the Wallet class already has a lot of complexity, and it may be more beneficial to abstract some behavior to other classes, rather than having one big class.
Other minor improvements:
getUTXOs
method was changed. It now takes afilter
, which should usually be left as default = OutpointState.SPENT.filter
removes any UTXO that matches the OutpointState.A new parameter has been added,
requirement
. This does the opposite of filter, and only returns UTXOs that match the given state. For examplegetUTXOs({requirement: OutpointState.P2PKH})
would only return regular P2PKH UTXOsTODO
Testing