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

feat: greedy merge tx in bid #2363

Merged
merged 9 commits into from
Apr 11, 2024
Merged

feat: greedy merge tx in bid #2363

merged 9 commits into from
Apr 11, 2024

Conversation

irrun
Copy link
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
  • ...

miner/bid_simulator.go Outdated Show resolved Hide resolved
miner/bid_simulator.go Outdated Show resolved Hide resolved
miner/bid_simulator.go Outdated Show resolved Hide resolved
miner/bid_simulator.go Outdated Show resolved Hide resolved
@irrun irrun force-pushed the re/mevfix branch 7 times, most recently from e80bc31 to 60e32b4 Compare April 7, 2024 08:56
go.sum Outdated Show resolved Hide resolved
miner/bid_simulator.go Outdated Show resolved Hide resolved
miner/bid_simulator.go Outdated Show resolved Hide resolved
miner/bid_simulator.go Outdated Show resolved Hide resolved
miner/bid_simulator.go Outdated Show resolved Hide resolved
miner/bid_simulator.go Outdated Show resolved Hide resolved
miner/bid_simulator.go Outdated Show resolved Hide resolved
miner/worker.go Outdated Show resolved Hide resolved
miner/worker.go Outdated Show resolved Hide resolved
miner/worker.go Outdated Show resolved Hide resolved
miner/bid_simulator.go Outdated Show resolved Hide resolved
miner/worker.go Outdated Show resolved Hide resolved
@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
miner/worker.go Outdated Show resolved Hide resolved
miner/bid_simulator.go Outdated Show resolved Hide resolved
unclezoro
unclezoro previously approved these changes Apr 9, 2024
miner/worker.go Outdated
@@ -1080,6 +1081,29 @@ func (w *worker) fillTransactions(interruptCh chan int32, env *environment, stop
localBlobTxs[account] = txs
}
}

Copy link
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
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
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
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
7 checks passed
@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