-
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
fix: cli: fix panic in lotus-miner actor control list
#9241
Conversation
Tuning down slice to only 6 characters to avoid panics if the multisig-actor is of really low character length.
cmd/lotus-miner/actor.go
Outdated
kstr = kstr[:9] + "..." | ||
kstr = kstr[:6] + "..." |
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 think it would be a little safer here to check the length k
and then print different things based on that. If the string is 9 characters or fewer, print the whole string. If it's 10 or longer, print the first 6 characters with 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.
Added a check for length of the multisig address, and only printing the first 6 characters with ...
if its larger then 9: 3e74819. Else it will print everything.
Check the length of multisig address, and print based on that.
if len(kstr) > 9 { | ||
kstr = kstr[:6] + "..." | ||
} |
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.
In an else statement here I would print the whole string (it should fit). And then apply the same thing to lotus-shed/actor.go
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.
In an else statement here I would print the whole string (it should fit).
I might be mistaken here, but printing the whole string here would just create an additional output of the key in the wrong place? As kstr
is written to the tablewriter and flushed later on.
And then apply the same thing to lotus-shed/actor.go
Oh, completely forgot to fix the lotus-shed cmd 😅
Check the length of multisig address in lotus-shed actor cmd as well.
Tuning down slice to only 6 characters to avoid panics if the multisig-actor is of a really low character length.
Related Issues
fixes #9239
Proposed Changes
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