Skip to content

feat: wait miner finish the later multi-proposals when restarting the node;#2845

Merged
zzzckck merged 4 commits intobnb-chain:developfrom
galaio:wait-miner-proposal
Jan 7, 2025
Merged

feat: wait miner finish the later multi-proposals when restarting the node;#2845
zzzckck merged 4 commits intobnb-chain:developfrom
galaio:wait-miner-proposal

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
}

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

@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
@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