Skip to content

Commit

Permalink
add a detailed log
Browse files Browse the repository at this point in the history
  • Loading branch information
colinlyguo committed May 31, 2024
1 parent a7f1a00 commit ddfe398
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion core/tx_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,18 @@ func (pool *TxPool) validateTx(tx *types.Transaction, local bool) error {
// Transactor should have enough funds to cover the costs
// cost == L1 data fee + V + GP * GL
if b := pool.currentState.GetBalance(from); b.Cmp(new(big.Int).Add(tx.Cost(), l1DataFee)) < 0 {
return errors.New("invalid transaction: insufficient funds for l1fee + gas * price + value")
return fmt.Errorf(
"invalid transaction: insufficient funds for l1fee + gas * price + value. "+
"Sender address: %s, Sender balance: %v, L1 data fee: %v, Gas: %v, Gas price: %v, Gas tip cap: %v, Gas fee cap: %v, Transaction cost: %v",
from.Hex(),
b.Uint64(),
l1DataFee.Uint64(),
tx.Gas(),
tx.GasPrice().Uint64(),
tx.GasTipCap().Uint64(),
tx.GasFeeCap().Uint64(),
tx.Cost().Uint64(),
)
}
}
// Ensure the transaction has more gas than the basic tx fee.
Expand Down

0 comments on commit ddfe398

Please sign in to comment.