Skip to content

Commit

Permalink
resolve TODO
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenButtolph committed Feb 28, 2025
1 parent ba3156b commit 474b48c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 16 deletions.
9 changes: 0 additions & 9 deletions core/txpool/blobpool/blobpool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
11 changes: 4 additions & 7 deletions plugin/evm/header/dynamic_fee_windower.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit 474b48c

Please sign in to comment.