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

Build executable heap with baseFee when London fork is enabled #1857

Merged
merged 23 commits into from
Sep 5, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion txpool/txpool.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,8 +337,16 @@ func (p *TxPool) Prepare() {
// fetch primary from each account
primaries := p.accounts.getPrimaries()

var eligiblePrimaries []*types.Transaction

for _, tx := range primaries {
if tx.GetGasFeeCap().Cmp(new(big.Int).SetUint64(p.GetBaseFee())) >= 0 {
eligiblePrimaries = append(eligiblePrimaries, tx)
}
}

// create new executables queue with base fee and initial transactions (primaries)
p.executables = newPricesQueue(p.GetBaseFee(), primaries)
p.executables = newPricesQueue(p.GetBaseFee(), eligiblePrimaries)
}

// Peek returns the best-price selected
Expand Down
Loading