scroll-tech / go-ethereum

Scroll's fork of the official Go implementation of the Ethereum protocol

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Txpool: about discard transactions without enough fees for L1gas

hsyodyssey opened this issue · comments

Hi, for this part, transactions that don’t have enough fees will be dismissed directly by the transaction pool.

I think it could be hard for the user to know if their transactions are rejected. Because transaction pool will not give the user a feedback of the transaction being discarded, such events are hard to directly notify users unless they are monitoring all the tx pools? This issue may become more difficult for users after enabling decentralized sequencers 

IIRC,

func (b *EthAPIBackend) SendTx calls func (pool *TxPool) AddLocal

func (pool *TxPool) AddLocal calls func (pool *TxPool) AddLocals

func (pool *TxPool) AddLocals calls func (pool *TxPool) addTxs with local=true

it then calls func (pool *TxPool) addTxsLocked and then func (pool *TxPool) add

so the error can be returned.

that is, if user call SendTx to send an insufficient l1_fee tx then he will know such a rejection.
(But I agree that if someone don't run our codes and accept such a tx into tx_pool then broadcast the tx, user will not know the tx will be rejected.)

The accurate representation is that it is harder for general wallet users to get timely feedback. Yes, I agree, it's ok if the user runs the node. But for wallet users, it may be more difficult. Perhaps it could be marked for a while to see user feedback.

The accurate representation is that it is harder for general wallet users to get timely feedback. Yes, I agree, it's ok if the user runs the node. But for wallet users, it may be more difficult. Perhaps it could be marked for a while to see user feedback.

But user can still know it's rejected if using metamask with our RPC. (you can test by sending max ether in your wallet.)
They will know it's rejected (tho they probably won't know it's because of l1fee).

if they want to know the exact reason (rejected because of l1fee) we will probably require support from metamask?

yep, it would require the help of various wallets to support reminders of why a transaction was rejected. As a user and I would like to know why my transaction failed.

Or more precisely for the transactions captured from the P2P network, giving them feedback seems to be difficult. via: https://github.com/scroll-tech/go-ethereum/blob/staging/core/tx_pool.go#L890-L892