-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Refactor FundManager #4736
Refactor FundManager #4736
Conversation
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.
Early comments:
Overall, this is great. The code for the loop to handle reserves/releases/withdrawals is really good.
I have two changes, one fairly simple and the other... unfortunately not.
The first is your WithdrawFunds won't work as written. WithdrawBalance is a seperate method in the market actor.
The second is, we have to account for multiple wallets, and I'm not sure the best way to do this. Right now, at least on the client side, we assume that any wallet the client owns can initiate the deal. It's baked into the call to StorageClient.ProposeStorageDeal && all the way up to the Lotus full node API for ClientStartDeal. So, assuming a universal source wallet probably doesn't work. On the provider side, this is actually true -- the miner owner/worker address is always the source. However, there's no getting around it on the client. I'm sorry if my method signatures I provided obscured that fact.
I don't think the change is particularly hard, except your current code combines reserve requests & withdraw requests on the assumption of the same wallet. I believe the only way to ultimately address this is to add a source wallet parameter to Reserve and Withdraw, and to only combine messages for the same wallet address at the same time (deferring the messages for other wallets for the next message submission for the given destination address)
Fixes #2685 |
e422f67
to
f94ca36
Compare
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.
LGTM, pending integration. Remaining suggestions are non-blocking, up to you.
2b7c77e
to
a9a80be
Compare
I am marking this ready for review because I believe it can be merged without having any significant effect -- while there is new code, it is not actually active in Lotus yet as the integration aspects of this PR are not complete, and covered seperately in #4787 & filecoin-project/go-fil-markets#445 |
IOW, there is no harm in code reviewing this code, merging to master, in order to limit the challenge of reviewing #4787 |
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.
LGTM
9d363c5
to
0101436
Compare
Currently in markets we have
This PR unifies the logic for these mechanisms into a single interface:
TODO: