-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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: wait miner finish the later multi-proposals when restarting the node; #2845
Conversation
miner/worker.go
Outdated
} | ||
|
||
currentBlock := currentHeader.Number.Uint64() | ||
waitSecs := (endBlock - currentBlock) * posa.BlockInterval() |
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.
issue: endBlock - currentBlock?
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 can wait more time to avoid shutdown immediately after miner producing the end block for safety, maybe another 10 second?
Description
The PR aims to avoid validator being slashed when restarting the node, the node will propose multi blocks after enabling the #2482.
So the PR will wait for the multi-block proposals to be done to avoid the slashing when restarting, and the node will wait
MaxWaitProposalInSecs
.The default value of
MaxWaitProposalInSecs
is set to 30 seconds. Because the average restart time in mainnet is around 30s, so the node try to wait for the next multi-proposals to be done.Changes
Notable changes: