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

feat: daemon: improvemens to the consensus slasher #10979

Merged
merged 3 commits into from
Jul 8, 2023

Conversation

arajasek
Copy link
Contributor

@arajasek arajasek commented Jun 13, 2023

Related Issues

Improvements to the new consensus slasher that was created in #10871

Proposed Changes

  • Log failures
  • Return a bool to indicate any faults, separate from other errors
  • Perform some additional checks before reporting faults

Additional Info

Run lotus daemon --slash-consensus=true --slashdb-dir="/mnt/data/.slasher" >> /mnt/data/slash.log 2>&1 & to run the consensus slasher.

--slashdb-dir is used to supply the path to the slasher database.
--slasher-sender can optionally be used to specify the account to send the ReportConsensusFault message from.

Checklist

Before you mark the PR ready for review, please make sure that:

  • Commits have a clear commit message.
  • PR title is in the form of of <PR type>: <area>: <change being made>
    • example: fix: mempool: Introduce a cache for valid signatures
    • PR type: fix, feat, build, chore, ci, docs, perf, refactor, revert, style, test
    • area, e.g. api, chain, state, market, mempool, multisig, networking, paych, proving, sealing, wallet, deps
  • New features have usage guidelines and / or documentation updates in
  • Tests exist for new functionality or change in behavior
  • CI is green

@arajasek arajasek requested a review from a team as a code owner June 13, 2023 14:52
@jennijuju jennijuju mentioned this pull request Jun 13, 2023
3 tasks
@jennijuju
Copy link
Member

missing bare minimum instruction on how to run this thing

@jennijuju
Copy link
Member

missing bare minimum instruction on how to run this thing

gentle ping

@mx819812523
Copy link
Contributor

mx819812523 commented Jun 25, 2023

Run nohup lotus daemon --slash-consensus=true --slashdb-dir="/mnt/data/.slasher" >> /mnt/data/slash.log 2>&1 & to monitor consensus slasher
--slash-consensus is a flag to open monitor and it need to be used with -- slashdb-dir, --slasher-senderoptionally specify the account to report consensus from

Copy link
Contributor

@ZenGround0 ZenGround0 left a comment

Choose a reason for hiding this comment

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

I won't block the review but will advocate for maintaining logging that provides useful information. This might mean logging when the fault is detected and the information is available or maybe going back and using typed errors instead of a bool.

With regards to "missing bare minimum instruction on how to run this thing" I have recently learned that this is a good place to put such things

log.Errorf("slash detector errored: %s", err)
continue
}
if fault {
log.Errorf("<!!> SLASH FILTER ERROR: %s", err)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we are losing information here. Before this change the error contained information about the slashing condition being hit and the problem blocks. Now I think this err will just be nil

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 catch, thank you -- fixing.

miner/miner.go Outdated
}

if fault {
log.Errorf("<!!> SLASH FILTER DETECTED FAULT due to witness %s", witness)
Copy link
Contributor

Choose a reason for hiding this comment

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

Again I think the old error log had more information about the slashing condition and blocks causing it.

@mx819812523
Copy link
Contributor

My previous log error: MpoolPushMessage error log is %s not %w

@arajasek arajasek force-pushed the asr/slasher-improvements branch from c4d4ed9 to 5279a0f Compare July 8, 2023 15:21
@arajasek arajasek force-pushed the asr/slasher-improvements branch from 5279a0f to 7180b52 Compare July 8, 2023 15:21
@arajasek arajasek merged commit e58b1df into master Jul 8, 2023
@arajasek arajasek deleted the asr/slasher-improvements branch July 8, 2023 17:05
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.

4 participants