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

eth/handler: check blobs before broadcast blocks #2450

Merged

Conversation

NathanBSC
Copy link
Contributor

@NathanBSC NathanBSC commented May 13, 2024

Description

eth/handler: check blobs before broadcast blocks

Rationale

when nodes get a new block from other peers,
It will broadcast blocks directly to part peers after only verifyHeader
here add a more check before broadcasting.

Example

add an example CLI or API response...

Changes

Notable changes:

  • add each change in a bullet point here
  • ...

@NathanBSC NathanBSC force-pushed the check_blobs_before_broadcast_blocks branch from 4a446e8 to 2d2a255 Compare May 13, 2024 07:13
broadcastBlockWithCheck := func(block *types.Block, propagate bool) {
// All the block fetcher activities should be disabled
// after the transition. Print the warning log.
if h.merger.PoSFinalized() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe we can remove this check? not needed for BSC.

// the chain has finished the transition or not, the PoS headers
// should only come from the trusted consensus layer instead of
// p2p network.
if beacon, ok := h.chain.Engine().(*beacon.Beacon); ok {
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove it as well?

@zzzckck zzzckck merged commit 23f6194 into bnb-chain:develop May 13, 2024
7 checks passed
@NathanBSC NathanBSC deleted the check_blobs_before_broadcast_blocks branch July 25, 2024 07:40
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.

3 participants