Skip to content
This repository has been archived by the owner on Oct 25, 2024. It is now read-only.

Commit

Permalink
fix memory leak in prefetcher
Browse files Browse the repository at this point in the history
  • Loading branch information
avalonche committed Feb 12, 2024
1 parent 5e90070 commit 992725a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions miner/algo_greedy.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ func (b *greedyBuilder) mergeOrdersIntoEnvDiff(
func (b *greedyBuilder) buildBlock(simBundles []types.SimulatedBundle, simSBundles []*types.SimSBundle, transactions map[common.Address][]*txpool.LazyTransaction) (*environment, []types.SimulatedBundle, []types.UsedSBundle) {
orders := newTransactionsByPriceAndNonce(b.inputEnvironment.signer, transactions, simBundles, simSBundles, b.inputEnvironment.header.BaseFee)
envDiff := newEnvironmentDiff(b.inputEnvironment.copy())
b.inputEnvironment.state.StopPrefetcher()
usedBundles, usedSbundles := b.mergeOrdersIntoEnvDiff(envDiff, orders)
envDiff.applyToBaseEnv()
return envDiff.baseEnvironment, usedBundles, usedSbundles
Expand Down
1 change: 1 addition & 0 deletions miner/algo_greedy_buckets.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ func (b *greedyBucketsBuilder) mergeOrdersIntoEnvDiff(
func (b *greedyBucketsBuilder) buildBlock(simBundles []types.SimulatedBundle, simSBundles []*types.SimSBundle, transactions map[common.Address][]*txpool.LazyTransaction) (*environment, []types.SimulatedBundle, []types.UsedSBundle) {
orders := newTransactionsByPriceAndNonce(b.inputEnvironment.signer, transactions, simBundles, simSBundles, b.inputEnvironment.header.BaseFee)
envDiff := newEnvironmentDiff(b.inputEnvironment.copy())
b.inputEnvironment.state.StopPrefetcher()
usedBundles, usedSbundles := b.mergeOrdersIntoEnvDiff(envDiff, orders)
envDiff.applyToBaseEnv()
return envDiff.baseEnvironment, usedBundles, usedSbundles
Expand Down

0 comments on commit 992725a

Please sign in to comment.