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

Prevent Explorer Nodes from Adding Future Blocks #4845

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from

Conversation

GheisMohammadi
Copy link
Contributor

This PR ensures that explorer nodes do not accept future blocks that are not the immediate next block during the COMMIT and PREPARE phase. Previously, there was no strict check on whether a received block was sequential, which could lead to inconsistencies.

@GheisMohammadi GheisMohammadi self-assigned this Feb 7, 2025
if recvMsg.BlockNum != node.Blockchain().CurrentBlock().NumberU64()+1 {
utils.Logger().Warn().
Uint64("Received BlockNum", recvMsg.BlockNum).
Uint64("Consensus BlockNum", node.GetConsensusBlockNum()).
Copy link
Contributor

Choose a reason for hiding this comment

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

Explorer node does not participate in consensus, so getting consensus block number doesn't make much sense for me

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

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.

2 participants