-
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
Implement a tooling for slasher #10928
Conversation
Merge official code.
merge latest Code
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 looks pretty close to landable, thank you! We'll also definitely want to test this out (perhaps by connecting to calibrationnet and intentionally creating some consensus faults there).
chain/gen/slashfilter/slashfilter.go
Outdated
return cid.Undef, nil | ||
} | ||
|
||
func (f *SlashFilter) MinedBlock(ctx context.Context, bh *types.BlockHeader, parentEpoch abi.ChainEpoch) error { |
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 don't think we need a new method here -- we can just refactor the callers of MinedBlock
to expect 2 returns.
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 is done in order to reduce modifications, and this method can be removed if necessary.
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.
Do the modifications get big? I think it should just be a couple other lines in a couple other files.
chain/gen/slashfilter/slashfilter.go
Outdated
@@ -78,45 +78,50 @@ func (f *SlashFilter) MinedBlock(ctx context.Context, bh *types.BlockHeader, par | |||
} | |||
|
|||
if !found { | |||
return xerrors.Errorf("produced block would trigger 'parent-grinding fault' consensus fault; miner: %s; bh: %s, expected parent: %s", bh.Miner, bh.Cid(), parent) | |||
return cid.Undef, xerrors.Errorf("produced block would trigger 'parent-grinding fault' consensus fault; miner: %s; bh: %s, expected parent: %s", bh.Miner, bh.Cid(), parent) |
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 should still return parent
as the witness here -- we will just have to special-case handle it in the caller.
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 we resolved this without actually making the change?
@@ -160,6 +169,19 @@ var DaemonCmd = &cli.Command{ | |||
Name: "restore-config", | |||
Usage: "config file to use when restoring from backup", | |||
}, | |||
&cli.BoolFlag{ |
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.
Let's not have this in lotus daemon -- instead, I think this should be a standalone process that connects to a lotus node (exactly the way the miner does this).
Do you think that's reasonable? If so, can you please move this into a new lotus-slasher process? If not, happy to discuss more!
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 have tried using lotus-slasher before, But encountered the problem of rpc blocking(too many rpc request)
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.
If there is a good idea to solve this problem, I would be happy to add an independent process
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.
Hmm, I'm a little surprised to hear that -- @magik6k do you have any suggestions here?
It's fine to leave it as a goroutine for now, though.
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 looks pretty close to landable, thank you! We'll also definitely want to test this out (perhaps by connecting to calibrationnet and intentionally creating some consensus faults there).
Co-authored-by: Aayush Rajasekaran <arajasek94@gmail.com>
chain/gen/slashfilter/slashfilter.go
Outdated
@@ -78,45 +78,50 @@ func (f *SlashFilter) MinedBlock(ctx context.Context, bh *types.BlockHeader, par | |||
} | |||
|
|||
if !found { | |||
return xerrors.Errorf("produced block would trigger 'parent-grinding fault' consensus fault; miner: %s; bh: %s, expected parent: %s", bh.Miner, bh.Cid(), parent) | |||
return cid.Undef, xerrors.Errorf("produced block would trigger 'parent-grinding fault' consensus fault; miner: %s; bh: %s, expected parent: %s", bh.Miner, bh.Cid(), parent) |
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 we resolved this without actually making the change?
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 LGTM! Thank you very much!
Related Issues
this is reopen for #10917
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, build, chore, ci, docs, perf, refactor, revert, style, testarea
, e.g. api, chain, state, market, mempool, multisig, networking, paych, proving, sealing, wallet, deps