feat(txpool): update ValidateTransaction (#237)

This commit is contained in:
David 2024-05-08 01:02:44 +08:00 committed by GitHub
parent 471db71663
commit 6cc43e1d9c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -98,9 +98,9 @@ func ValidateTransaction(tx *types.Transaction, head *types.Header, signer types
if tx.GasFeeCapIntCmp(tx.GasTipCap()) < 0 {
return core.ErrTipAboveFeeCap
}
// CHANGE(taiko): ensure gasFeeCap fee cap larger than 0.01 GWei
if os.Getenv("TAIKO_TEST") == "" && tx.GasFeeCap().Cmp(new(big.Int).SetUint64(params.GWei/100)) < 0 {
return errors.New("max fee per gas is less than 0.1 gwei")
// CHANGE(taiko): ensure gasFeeCap fee cap larger than 0
if os.Getenv("TAIKO_TEST") == "" && tx.GasFeeCap().Cmp(common.Big0) == 0 {
return errors.New("max fee per gas is equal to 0")
}
// Make sure the transaction is signed properly
if _, err := types.Sender(signer, tx); err != nil {