-
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
Shed: Add a util to send a batch of messages #7667
Conversation
|
||
fmt.Printf("sending %s to %s in msg %s\n", value.String(), addr, smsg.Cid()) | ||
|
||
if i > 0 && i%100 == 0 { |
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.
Maybe remove? I'm just vaguely worried about bombarding mempool.
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.
Probably ok to keep, can change into a flag if needed
Codecov Report
@@ Coverage Diff @@
## master #7667 +/- ##
==========================================
- Coverage 39.44% 39.40% -0.05%
==========================================
Files 654 655 +1
Lines 70171 70247 +76
==========================================
Hits 27679 27679
- Misses 37741 37803 +62
- Partials 4751 4765 +14
Continue to review full report at Codecov.
|
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.
It would be really cool if this also optionally supported method/params
cmd/lotus-shed/send-csv.go
Outdated
return xerrors.Errorf("failed to parse value balance: %w", err) | ||
} | ||
|
||
smsg, err := api.MpoolPushMessage(ctx, &types.Message{ |
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.
this should use the batch APIs
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.
the batch api isn't gonna work well, cuz its inputs need to be signed. that means you're gonna either use the same gas params for all msgs (which probably won't work correctly), or individually estimate (tracking nonce yourself), and then batch, which seems ew.
the batch api isn't doing anything that different than just calling MpoolPushMessage
individually in a loop, i don't think
cmd/lotus-shed/send-csv.go
Outdated
Usage: "Utility for sending a batch of balance transfers", | ||
ArgsUsage: "[sender] [csvfile]", | ||
Action: func(cctx *cli.Context) error { | ||
if cctx.NArg() != 2 { |
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.
I would personally use the --from
flag instead of a positional argument, its standard across a lot of other things in our tooling
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.
fine, but are you okay with it being mandatory? i hate "default wallet" more with each passing day, especially for something like this.
b264df8
to
e15bc39
Compare
Done |
@arajasek could we provide different params for each row? e.g. Recipient, FIL, Param The current payment tool I'm building generates a batch of lotus send commands (or a CSV after this PR merges) for the billing team to copy and execute in the terminal, but the system needs a way to identify if the transaction has been paid, so each transaction needs to have a unique identifier in the param so the tool can search it on the Filecoin chain to know if it has been paid. |
75b3cf6
to
15ce721
Compare
Sure thing, done -- using hex encoding for params, lemme know if you'd prefer something else / want it to be configable. |
@arajasek thank you! Would you mind also printing the message ids? I may write a short script to look at the result and send the message ids to my system, so the ideal usage may look like the command below.
|
@ychiaoli18 The message IDs are being printed out, but in this format
I think it's important to do that, so that you know which msg id corresponds to which row of the CSV in case some messages get skipped. I can lower the output to be more script-friendly, though if you'd like (something like just |
|
15ce721
to
b0a9a27
Compare
@ychiaoli18 done! |
|
||
fmt.Printf("sending %s to %s in msg %s\n", value.String(), addr, smsg.Cid()) | ||
|
||
if i > 0 && i%100 == 0 { |
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.
Probably ok to keep, can change into a flag if needed
eg (not all messages are valid)