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

use copyed baseGp to update #197

Merged
merged 2 commits into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
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 sequencer/sequencer.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,8 @@ func (s *Sequencer) addTxToWorker(ctx context.Context, tx pool.Transaction) erro
_, l2gp := s.pool.GetL1AndL2GasPrice()
defaultGp := new(big.Int).SetUint64(l2gp)
baseGp := s.worker.getBaseClaimGp(defaultGp)
txTracker.GasPrice = baseGp.Mul(baseGp, new(big.Int).SetUint64(uint64(getGasPriceMultiple(s.cfg.GasPriceMultiple))))
copyBaseGp := new(big.Int).Set(baseGp)
txTracker.GasPrice = copyBaseGp.Mul(copyBaseGp, new(big.Int).SetUint64(uint64(getGasPriceMultiple(s.cfg.GasPriceMultiple))))
}

replacedTx, dropReason := s.worker.AddTxTracker(ctx, txTracker)
Expand Down
3 changes: 2 additions & 1 deletion sequencer/txsorted_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ func (e *txSortedList) delete(tx *TxTracker) bool {

if (e.sorted[i].GasPrice.Cmp(tx.GasPrice)) != 0 {
// we have a tx with different (lower) GasPrice than the tx we are looking for, therefore we haven't found the tx
log.Warnf("error deleting tx %s from txSortedList, not found in the list of txs with same gasPrice: %s", tx.HashStr)
log.Warnf("error deleting tx %s from txSortedList %s, not found in the list of txs with same gasPrice: %s - %s",
tx.HashStr, e.sorted[i].HashStr, tx.GasPrice.String(), e.sorted[i].GasPrice.String())
return false
}

Expand Down
1 change: 1 addition & 0 deletions sequencer/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ func NewWorker(state stateInterface, constraints state.BatchConstraintsCfg, read
state: state,
batchConstraints: constraints,
readyTxsCond: readyTxsCond,
claimGp: new(big.Int),
}

return &w
Expand Down
Loading