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: wait miner finish the later multi-proposals when restarting the node; #2845

Merged
merged 4 commits into from
Jan 7, 2025

Conversation

galaio
Copy link
Contributor

@galaio galaio commented Jan 6, 2025

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.

Attention: if you maintain the node with systemd, pls set TimeoutStopSpec >= 60s, it will allow the node shutdown safely when enabling the MaxWaitProposalInSecs > 0.

Changes

Notable changes:

  • feat: wait miner finish the later multi-proposals when restarting the node;
  • ...

@galaio galaio requested review from buddh0 and zzzckck January 6, 2025 10:37
miner/worker.go Outdated Show resolved Hide resolved
consensus/parlia/snapshot.go Outdated Show resolved Hide resolved
miner/worker.go Outdated
}

currentBlock := currentHeader.Number.Uint64()
waitSecs := (endBlock - currentBlock) * posa.BlockInterval()
Copy link
Collaborator

@buddh0 buddh0 Jan 7, 2025

Choose a reason for hiding this comment

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

issue: endBlock - currentBlock?

Copy link
Collaborator

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?

zzzckck
zzzckck previously approved these changes Jan 7, 2025
consensus/parlia/snapshot.go Outdated Show resolved Hide resolved
miner/worker.go Outdated Show resolved Hide resolved
@zzzckck zzzckck merged commit 4ef505f into bnb-chain:develop Jan 7, 2025
7 checks passed
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