Skip to content
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/post find #4355

Merged
merged 11 commits into from
Nov 20, 2020
Merged

Shed/post find #4355

merged 11 commits into from
Nov 20, 2020

Conversation

ZenGround0
Copy link
Contributor

Shed util to print out all miners that have submitted a post in the last day.

cmd/lotus-shed/postfind.go Show resolved Hide resolved
cmd/lotus-shed/postfind.go Outdated Show resolved Hide resolved
},
&cli.BoolFlag{
Name: "withpower",
Usage: "only print addrs of miners with more than zero power",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: it could well be handy in the future for this to be a continuous parameter rather than a zero/nonzero.

if err != nil {
return err
}
if power.MinerPower.RawBytePower.GreaterThan(big.Zero()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check with the requirements whether you want power (excl faults and miners below min size) or committed bytes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. FYI no power reqs specified right, I included to see if it makes a difference today and if we should recommend that it be included.

cmd/lotus-shed/postfind.go Outdated Show resolved Hide resolved
_, seenBefore := postedMiners[msg.To]

if shouldCheck && !seenBefore {
if msg.Method == builtin.MethodsMiner.SubmitWindowedPoSt {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would this be true for a window post that is a pre spec actors v2 upgraded window post (with a previous network param)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, because the SubmitWindowedPoSt method number didn't change.


postedMiners := make(map[address.Address]struct{})
for _, msg := range msgs {
_, shouldCheck := minersToCheck[msg.To]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correctness nit: I think it's possible that a valid WindowedPost was submitted with the msg.To being the miner's robust t2 address, which will not be in the minersToCheck map.

Lotus doesn't do this by default, though, so maybe don't bother _address_ing this.

@magik6k magik6k merged commit b10b6fd into master Nov 20, 2020
@magik6k magik6k deleted the shed/post-find branch November 20, 2020 13:52
bibibong pushed a commit to EpiK-Protocol/go-epik that referenced this pull request Jan 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants