Skip to content

fix: wait builder's final bid during the peak time#2892

Merged
zzzckck merged 1 commit intobnb-chain:developfrom
48Club:develop
Feb 14, 2025
Merged

fix: wait builder's final bid during the peak time#2892
zzzckck merged 1 commit intobnb-chain:developfrom
48Club:develop

Conversation

@Jolly23
Copy link
Copy Markdown
Contributor

@Jolly23 Jolly23 commented Feb 14, 2025

Description

When the block gas limit is reached in the miner's local building loop, the packing process stops prematurely, even though there might be still much time till the block.timestamp. At that time, some builders may not have provided their best bids, leading to suboptimal block selection.

On February 14th, during a peak usage period on the BNB Chain mainnet, builders struggled to have their bids accepted by validators, making it difficult for bundles and private transactions to finalize.

This PR adds a simple mechanism: if there's still ample time before sealing, introduce a short wait. This ensures the validator makes full use of the 3-second window to pack transactions and wait for potentially better bids.

Rationale

  • Extends the packing window to its full duration.
  • Minimizes the risk of missing higher bids submitted later.
  • Improves block building efficiency, especially during peak times.

Example

  • Before: The loop stops very early after hitting the gas limit during the peak time, and the validator loads what may be a suboptimal best bid or even no bid coming yet.
  • After: If the block isn't due to be sealed yet, the miner waits, giving more time for better bids to arrive.

Changes

  • Introduced a wait timer before sealing if sufficient time remains.
  • Ensured validators utilize their 3-second window for potential better bids.
  • Tweaked packing logic to avoid early exit.

Note: This is one of many possible approaches; for example, a separate Go routine could be used to wait for builder bids. This PR offers a simple solution.

Copy link
Copy Markdown
Collaborator

@zzzckck zzzckck left a comment

Choose a reason for hiding this comment

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

LGTM, as a short term solution, we can check later if the mine logic can be improved further in the future.

@zzzckck zzzckck merged commit c84a7f8 into bnb-chain:develop Feb 14, 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.

3 participants