Skip to content

feat: greedy merge tx in bid#2363

Merged
irrun merged 9 commits intobnb-chain:developfrom
irrun:re/mevfix
Apr 11, 2024
Merged

feat: greedy merge tx in bid#2363
irrun merged 9 commits intobnb-chain:developfrom
irrun:re/mevfix

Conversation

@irrun
Copy link
Copy Markdown
Contributor

@irrun irrun commented Apr 2, 2024

Description

  1. enable greedy merge tx in bid
  2. fix several bugs

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
  • ...

@irrun irrun changed the title fix: empty bidHash and pay bid tx checking feat: greedy merge tx in bid Apr 8, 2024
@irrun irrun marked this pull request as ready for review April 8, 2024 10:07
@irrun irrun requested a review from zzzckck as a code owner April 8, 2024 10:07
@irrun irrun requested a review from unclezoro April 8, 2024 11:02
unclezoro
unclezoro previously approved these changes Apr 9, 2024
miner/worker.go Outdated
localBlobTxs[account] = txs
}
}

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.

how about move it to line#1068, so only need to filter: pendingPlainTxs & pendingBlobTxs, could be more efficient.

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.

ok,fixed

stopTimer := time.NewTimer(*delay)

bidTxsSet := mapset.NewSet[common.Hash]()
for _, tx := range bidRuntime.bid.Txs {
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.

better to eliminate this for loop.
We can pass bidRuntime.bid.Txs into fillTransactions(..., bidRuntime.bid.Txs) directly.

// in fillTransactions(...)
for _, bigTx range bidRuntime.bid.Txs {
   // check and remove from pendingPlainTxs & pendingBlobTxs
}

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.

hashset makes it simple

@irrun irrun merged commit b7972bc into bnb-chain:develop Apr 11, 2024
@irrun irrun deleted the re/mevfix branch April 11, 2024 07:15
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.

5 participants