Skip to content

Commit 0c7a997

Browse files
authored
fix(tx-submitter): ensure correct feecap on resubmission (#747)
Co-authored-by: WorldDogs <noreply.github.com>
1 parent 7f79e0a commit 0c7a997

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tx-submitter/services/rollup.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1603,13 +1603,17 @@ func (r *Rollup) ReSubmitTx(resend bool, tx *ethtypes.Transaction) (*ethtypes.Tr
16031603
if err != nil {
16041604
return nil, fmt.Errorf("get l1 head error:%w", err)
16051605
}
1606+
var recalculatedFeecap *big.Int
16061607
if head.BaseFee != nil {
1607-
gasFeeCap = new(big.Int).Add(
1608+
recalculatedFeecap = new(big.Int).Add(
16081609
tip,
16091610
new(big.Int).Mul(head.BaseFee, big.NewInt(2)),
16101611
)
16111612
} else {
1612-
gasFeeCap = new(big.Int).Set(tip)
1613+
recalculatedFeecap = new(big.Int).Set(tip)
1614+
}
1615+
if recalculatedFeecap.Cmp(gasFeeCap) > 0 {
1616+
gasFeeCap = recalculatedFeecap
16131617
}
16141618
}
16151619
}

0 commit comments

Comments
 (0)