From 474b48c666e184ac3a1b328442be515a14cbc6d6 Mon Sep 17 00:00:00 2001 From: Stephen Buttolph Date: Thu, 27 Feb 2025 20:23:16 -0500 Subject: [PATCH] resolve TODO --- core/txpool/blobpool/blobpool_test.go | 9 --------- plugin/evm/header/dynamic_fee_windower.go | 11 ++++------- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/core/txpool/blobpool/blobpool_test.go b/core/txpool/blobpool/blobpool_test.go index a682fe3077..7c86ae2b69 100644 --- a/core/txpool/blobpool/blobpool_test.go +++ b/core/txpool/blobpool/blobpool_test.go @@ -78,13 +78,6 @@ func init() { *testChainConfig.CancunTime = uint64(time.Now().Unix()) } -// overrideMinFee sets the minimum base fee to 1 wei for the duration of the test. -func overrideMinFee(t *testing.T) { - orig := header.EtnaMinBaseFee - header.EtnaMinBaseFee = big.NewInt(1) - t.Cleanup(func() { header.EtnaMinBaseFee = orig }) -} - // testBlockChain is a mock of the live chain for testing the pool. type testBlockChain struct { config *params.ChainConfig @@ -755,7 +748,6 @@ func TestOpenIndex(t *testing.T) { // Tests that after indexing all the loaded transactions from disk, a price heap // is correctly constructed based on the head basefee and blobfee. func TestOpenHeap(t *testing.T) { - overrideMinFee(t) log.SetDefault(log.NewLogger(log.NewTerminalHandlerWithLevel(os.Stderr, log.LevelTrace, true))) // Create a temporary folder for the persistent backend @@ -843,7 +835,6 @@ func TestOpenHeap(t *testing.T) { // Tests that after the pool's previous state is loaded back, any transactions // over the new storage cap will get dropped. func TestOpenCap(t *testing.T) { - overrideMinFee(t) log.SetDefault(log.NewLogger(log.NewTerminalHandlerWithLevel(os.Stderr, log.LevelTrace, true))) // Create a temporary folder for the persistent backend diff --git a/plugin/evm/header/dynamic_fee_windower.go b/plugin/evm/header/dynamic_fee_windower.go index 6308c54b73..eb92512120 100644 --- a/plugin/evm/header/dynamic_fee_windower.go +++ b/plugin/evm/header/dynamic_fee_windower.go @@ -22,12 +22,9 @@ var ( maxUint256Plus1 = new(big.Int).Lsh(common.Big1, 256) maxUint256 = new(big.Int).Sub(maxUint256Plus1, common.Big1) - ap3MinBaseFee = big.NewInt(ap3.MinBaseFee) - ap4MinBaseFee = big.NewInt(ap4.MinBaseFee) - // EtnaMinBaseFee is exported so that it can be modified by tests. - // - // TODO: Unexport this. - EtnaMinBaseFee = big.NewInt(etna.MinBaseFee) + ap3MinBaseFee = big.NewInt(ap3.MinBaseFee) + ap4MinBaseFee = big.NewInt(ap4.MinBaseFee) + etnaMinBaseFee = big.NewInt(etna.MinBaseFee) ap3MaxBaseFee = big.NewInt(ap3.MaxBaseFee) ap4MaxBaseFee = big.NewInt(ap4.MaxBaseFee) @@ -131,7 +128,7 @@ func baseFeeFromWindow(config *params.ChainConfig, parent *types.Header, timesta // Ensure that the base fee does not increase/decrease outside of the bounds switch { case config.IsEtna(parent.Time): - baseFee = selectBigWithinBounds(EtnaMinBaseFee, baseFee, maxUint256) + baseFee = selectBigWithinBounds(etnaMinBaseFee, baseFee, maxUint256) case isApricotPhase5: baseFee = selectBigWithinBounds(ap4MinBaseFee, baseFee, maxUint256) case config.IsApricotPhase4(parent.Time):