Skip to content

Commit

Permalink
Merge pull request #4 from RSS3-Network/feat/debug-log
Browse files Browse the repository at this point in the history
add debug log
  • Loading branch information
anvztor authored Mar 18, 2024
2 parents 00d5b73 + ab3c326 commit 77e2101
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions miner/ordering.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"github.com/ethereum/go-ethereum/common/math"
"github.com/ethereum/go-ethereum/core/txpool"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/log"
)

// txWithMinerFee wraps a transaction with its gas price or effective miner gasTipCap
Expand All @@ -40,6 +41,7 @@ func newTxWithMinerFee(tx *txpool.LazyTransaction, from common.Address, baseFee
tip := new(big.Int).Set(tx.GasTipCap)
if baseFee != nil {
if tx.GasFeeCap.Cmp(baseFee) < 0 {
log.Info("Fee cap less than base fee", "GasFeeCap", tx.GasFeeCap, "baseFee", baseFee, "txHash", tx.Hash)
return nil, types.ErrGasFeeCapTooLow
}
tip = math.BigMin(tx.GasTipCap, new(big.Int).Sub(tx.GasFeeCap, baseFee))
Expand Down
3 changes: 2 additions & 1 deletion miner/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -789,6 +789,7 @@ func (w *worker) commitTransaction(env *environment, tx *types.Transaction) ([]*
}
receipt, err := w.applyTransaction(env, tx)
if err != nil {
log.Info("sequencer apply tx failed", "err", err.Error(), "txHash", tx.Hash())
return nil, err
}
env.txs = append(env.txs, tx)
Expand Down Expand Up @@ -906,7 +907,7 @@ func (w *worker) commitTransactions(env *environment, txs *transactionsByPriceAn
default:
// Transaction is regarded as invalid, drop all consecutive transactions from
// the same sender because of `nonce-too-high` clause.
log.Debug("Transaction failed, account skipped", "hash", ltx.Hash, "err", err)
log.Info("Transaction failed, account skipped", "hash", ltx.Hash, "err", err)
txs.Pop()
}
}
Expand Down

0 comments on commit 77e2101

Please sign in to comment.