-
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: util: get all msig #9322
shed: util: get all msig #9322
Conversation
cmd/lotus-shed/msig.go
Outdated
|
||
ctx := ReqContext(cctx) | ||
|
||
ts, err := LoadTipSet(ctx, cctx, api) |
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.
We can just call the one in cli/
package like we do in other shed commands
cmd/lotus-shed/msig.go
Outdated
|
||
var multisigGetAllCmd = &cli.Command{ | ||
Name: "all", | ||
Usage: "get all multisig actor on chain with id, siigners, threshold and balance", |
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.
Usage: "get all multisig actor on chain with id, siigners, threshold and balance", | |
Usage: "get all multisig actor on chain with id, signers, threshold and balance", |
cmd/lotus-shed/msig.go
Outdated
Flags: []cli.Flag{ | ||
&cli.UintFlag{ | ||
Name: "network-version", | ||
Value: uint(build.NewestNetworkVersion), | ||
}, | ||
}, |
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.
We don't want to pass in the network version. We should be using the network version at whatever tipset we're using otherwise there might be a mismatch. api.StateNetworkVersion(ctx, Tipset key)
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 can be significantly faster (order of seconds) if we change it to work in "offline" mode -- instead of querying a daemon's API, it can work on the daemon's blockstore directly, iterating over all the actors in the state tree. See here for an example shed command.
45b971e
to
2ec4ac3
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.
Nits but LGTM
cmd/lotus-shed/msig.go
Outdated
|
||
var multisigGetAllCmd = &cli.Command{ | ||
Name: "all", | ||
Usage: "get all multisig actor on chain with id, siigners, threshold and balance at a tipset", |
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.
Usage: "get all multisig actor on chain with id, siigners, threshold and balance at a tipset", | |
Usage: "get all multisig actor on chain with id, signers, threshold and balance at the given state root", |
cmd/lotus-shed/msig.go
Outdated
if builtin.IsMultisigActor(act.Code) { | ||
ms, err := multisig.Load(store, act) | ||
if err != nil { | ||
return err |
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.
Can we make it a practice to always wrap errors? It speeds things up when 🕵️♀️ issues.
And needs |
Additional Info
Checklist
Before you mark the PR ready for review, please make sure that:
<PR type>: <area>: <change being made>
fix: mempool: Introduce a cache for valid signatures
PR type
: fix, feat, INTERFACE BREAKING CHANGE, CONSENSUS BREAKING, build, chore, ci, docs,perf, refactor, revert, style, testarea
: api, chain, state, vm, data transfer, market, mempool, message, block production, multisig, networking, paychan, proving, sealing, wallet, deps