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

Host: Fix bug causing unnecessary multiplier on L1 gas fees #1747

Merged
merged 1 commit into from
Jan 16, 2024
Merged
Changes from all 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
3 changes: 2 additions & 1 deletion go/ethadapter/geth_rpc_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,9 @@ func (e *gethRPCClient) PrepareTransactionToRetry(txData types.TxData, from geth
}

// it should never happen but to avoid any risk of repeated price increases we cap the possible retry price bumps to 5
retryFloat := math.Max(_maxRetryPriceIncreases, float64(retryNumber))
retryFloat := math.Min(_maxRetryPriceIncreases, float64(retryNumber))
// we apply a 20% gas price increase for each retry (retrying with similar price gets rejected by mempool)
// Retry '0' is the first attempt, gives multiplier of 1.0
multiplier := math.Pow(_retryPriceMultiplier, retryFloat)

gasPriceFloat := new(big.Float).SetInt(gasPrice)
Expand Down
Loading