-
Notifications
You must be signed in to change notification settings - Fork 1.3k
feat(spcli): correctly handle the batch logic of lotus-miner actor settle-deal
#13189
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
@beck-8 : looks like there's a small lint error to fix. |
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.
there's too much duplicated code in here from cli/spcli/actor.go, we need to reduce the overlap because they're doing almost identical things so we can share the code even if we have it in two difference places.
I'm assuming that the intention here is that you'd like to have it available as a lotus-shed
and not need to have the full lotus-miner
setup available and you shouldn't be tied to a specific miner address? That's fine, but we need to dedupe.
I originally wanted to change it on the original foundation (lotus-miner). I don't think anyone will need to check the details of the message. Now everyone who uses this tool urgently wants to take out the locked amount. However, considering that someone may really ask to check the payment, I changed the logic to lotus-shed. This is my idea. Do you have any suggestions? |
Or should I ask if we really need this part of logic? Or put this small part elsewhere in the future? Lines 141 to 171 in cfb4c8e
|
Actually @beck-8, hold off from putting in all that work. I think maybe you should just explain, both briefly in the CHANGELOG and a little more verbose in the The alternative is to just go ahead and adapt your use-case to the |
In fact, no matter which one, SP will still complain, because StateMarketDeals is as high as 29G, and the premise of executing settlement is to wait for a few minutes to pull this data. |
I will give more explanations later. I know that the use case is relatively narrow, but I have no other good way to help SP. Some experienced people will use As we discussed at that time, I put forward my ideas and cases. But you don't have to merge this PR. You can close it and restructure it, but you should know my idea. |
I suggest exporting this method or transferring it to a reasonable place, and then |
My 2025-07-10 understanding of where this PR is at:
|
I know this may not meet some norms. I just want to express the effect I want. I may merge the command into lotus-miner later (still some logic will be removed) |
7aaa5b4
to
1880e60
Compare
lotus-miner actor settle-deal
Test completed, currently meets my expectations. ./lotus-miner --actor f01703655 actor settle-deal --really-do-it --max-deals 50 --from f3tdlvj4lzhdnes5qzg2w6cghsotka7kjeaiho3qpffctyqlncgls5oxlnclgk4mevivj3acvx46sumyg5ng5a
There are a total of 3335 deals, and about 66 messages will be sent out quickly.
Requested deal settlement in message: bafy2bzacea2j2oscgzjkcrc4pcyh4whja346tf2fkqmp7eqcajvpvegciauqg
Requested deal settlement in message: bafy2bzaceausxqeos6e5qglqqwdfn7yq3pu74opupun4muy6msovmjutdcyw2
Requested deal settlement in message: bafy2bzacecro7en6ij2zik6uvmih6kkukdfbi2p6rkz3stt3yok5xcmuhuyz4
Requested deal settlement in message: bafy2bzaceddzbutjwhg53n3ard7ktomuts4fwr5jevv5slhnasxnev3grikwy
Requested deal settlement in message: bafy2bzaced7by4ol2lnwqs3aabgkcuitad22xpxd46xttxn6dyqnjrdjly4ck
Requested deal settlement in message: bafy2bzaceb7p4gug4vcw23g4i7iogykr3qe4biibjfu37zur7in25teiymppa
Requested deal settlement in message: bafy2bzacebpec5kfuk2ofnq66qlbl4jd6pmtbfip4xuzk5g64ekxg3ivkcjgk
Requested deal settlement in message: bafy2bzacede35a4owjk7eark63vvucibklz2yfurs6p4aeclkqquujfl4cy3a
Requested deal settlement in message: bafy2bzacebafpufpphriwrh7zrxzqcliwcsefbdw5bfzbhhfivvw5kubafnfo
Requested deal settlement in message: bafy2bzaced7ttpkttehptrylyrwgemj7qeuam2iucfs5l2tldgzkordzu7tye
Requested deal settlement in message: bafy2bzacea5puvzm6ncj6gvzq4nblpsgtbbp2nwdbm5ug66j4sxjxktbqhlq4
Requested deal settlement in message: bafy2bzacedxpsykecnfhibggweaa5tphb2pn7oxcv3dg63jzbipvk42bmw5x6
Requested deal settlement in message: bafy2bzaceat3z7hrkocyverij2sre2trp3l7ti7cueaps4mnr5py5hmu666yg
ERROR: mpool push: failed to push message: failed to check balance: not enough funds including pending messages (required: 0.422663959546500762 FIL, balance: 0.3917174615362471 FIL): validation failure &cli.IntFlag{
Name: "max-deals",
Usage: "the maximum number of deals contained in each message",
Value: 50,
},
|
I don't know how to deal with the conflict in |
@beck-8 I resolved the conflict in the |
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.
Thank you for your pr.
From my perspective, this PR contains two parts:
- An optimization for the
GetDeals
method. - Batch submission for
settle-deal
.
Regarding the first part, I'm in full agreement. This will greatly improve the quality of life for SPs.
However, for the second part, I have some concerns:
- I might be lacking some background knowledge on this, but is it necessary to batch
settle-deal
transactions? This shouldn't be a particularly heavy transaction. - The logic after the transaction is modified here to exit immediately without waiting. While I can understand this behavior, it's a breaking change.
I think, would it be better to preserve the original behavior of waiting for the packaging to complete, but provide a flag to skip it directly?
Additionally, I suggest splitting this PR into two parts. This PR should only contain the GetDeals
optimization, which we can merge directly. For the batching part, please submit it as a new, separate PR where we can have a more detailed discussion and work on the implementation.
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.
Great, this is very close to completion. The rest of it looks good to me. I think we can get this merged once the batch push message is optimized.
I've submitted the change to switch to using |
It looks fine, very good, take off 🛫 |
Dismissing the request for change, since that request was for the lotus-shed cmd variant, but this has now changed fix/correctly handle the batch logic of lotus-miner actor settle-deal
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.
Looks good to me, thanks!
lets go 🛫! |
…ettle-deal` (#13189) * feat(spcli): correctly handle the batch logic of `lotus-miner actor settle-deal` * retain StateWaitMsg logic * use v0api.WrapperV1Full * opt(spcli): push settle-deals Chucks with MpoolBatchPushMessage * chore(spcli): combine logs to prevent interleaving caused by concurrency * fix typo * chore: remove unnecessary var --------- Co-authored-by: Phi-rjan <orjan.roren@gmail.com> Co-authored-by: qians <qiangezaici@outlook.com>
* feat(spcli): correctly handle the batch logic of `lotus-miner actor settle-deal` (#13189) * feat(spcli): correctly handle the batch logic of `lotus-miner actor settle-deal` * retain StateWaitMsg logic * use v0api.WrapperV1Full * opt(spcli): push settle-deals Chucks with MpoolBatchPushMessage * chore(spcli): combine logs to prevent interleaving caused by concurrency * fix typo * chore: remove unnecessary var --------- Co-authored-by: Phi-rjan <orjan.roren@gmail.com> Co-authored-by: qians <qiangezaici@outlook.com> * Empty commit to trigger CI --------- Co-authored-by: beck <34204218+beck-8@users.noreply.github.com> Co-authored-by: qians <qiangezaici@outlook.com>
I want to add a flag to indicate whether the deal is expired. By default, only expired deals will be processed. |
Makes sense to me, let's open a new PR to add this. |
Related Issues
https://filecoinproject.slack.com/archives/C03CKDLEWG1/p1751257247291959?thread_ts=1745286086.505189&cid=C03CKDLEWG1
Proposed Changes
Additional Info
Checklist
Before you mark the PR ready for review, please make sure that: