Skip to content

miner: async blob tx validation during bid simulation - #3618

Merged
allformless merged 3 commits into
bnb-chain:developfrom
flywukong:improve-blob-validation
Apr 1, 2026
Merged

allformless merged 3 commits into
bnb-chain:developfrom
flywukong:improve-blob-validation

Conversation

@flywukong

Copy link
Copy Markdown
Contributor

Description

Async blob validation is launched at the beginning of simBid, right before prepareWork. The validation result is consumed lazily in commitTransaction when the first blob tx is encountered.

If a bid contains N transactions and the first blob tx is at position K, the effective parallel window equals the prepareWork setup time plus the execution time of the preceding K-1 non-blob transactions. With a typical simBid duration of ~14ms and KZG proof verification at ~1.8ms per blob, the parallel window is usually sufficient to fully absorb the verification cost — especially since blob transactions are unlikely to appear at the very beginning of a bid.

Rationale

tell us why we need these changes...

Example

add an example CLI or API response...

Changes

Notable changes:

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

@flywukong
flywukong force-pushed the improve-blob-validation branch from 744e9ee to 60c6b80 Compare March 24, 2026 10:25
Comment thread miner/bid_simulator.go
if err := txpool.ValidateBlobTx(tx, env.header, nil); err != nil {
return err
if ch, ok := r.bid.BlobValResults[tx.Hash()]; ok {
if err := <-ch; err != nil {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

if a bad bid contain one blobtx twice, will it stuck forever?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed by deleting the map entry after consuming the channel result. It may cause one extra synchronous re-validation, the probability is extremely small

@allformless
allformless merged commit b23b92a into bnb-chain:develop Apr 1, 2026
8 checks passed
@allformless allformless added this to the 1.7.3 milestone Apr 9, 2026
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