Skip to content

RPC client should be informed that the transaction he sent by calling eth_sendRawTransaction fails stateful validation. #31527

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

Closed
zouxyan opened this issue Mar 30, 2025 · 2 comments
Assignees

Comments

@zouxyan
Copy link

zouxyan commented Mar 30, 2025

Rationale

  • Why should this feature exist?

The transaction owner sends his transaction by rpc eth_sendRawTransaction and rpc response shows that it's ok to receive. Actually the error from txpool is not nil and txpool accepted nothing, but error in rpc response is empty.

This situation misleading the transaction sender so much. The sender of the transaction will think that the transaction has been successfully sent. But no transaction of the txhash from response can be found all over the network, from etherscan e.g. 🤔

Especially for the node service runners, their customers going to be confused and unhappy, like me 😂

  • What are the use-cases?

Some days ago, I sent a transaction by my node service provider zan.top. And rpc response showed no error. So I waited the tx packaged on Ethereum. I waited for a while and I tried to search this transaction but nothing found.

After I talked to the zan.top, they told me that it's failed with error that balance of my address not enough for gas fee. 😫 So I checked the geth node version and found the code changes about txpool locals stuff. So zan.top update their geth node with flag txpool.nolocals, and finally I sent tx with rpc error back.

Code below here requires that the locals has to be nil if returns the error inside rpc response.

func (b *EthAPIBackend) SendTx(ctx context.Context, signedTx *types.Transaction) error {
	locals := b.eth.localTxTracker
	if locals != nil {
		if err := locals.Track(signedTx); err != nil {
			return err
		}
	}
	// No error will be returned to user if the transaction fails stateful
	// validation (e.g., no available slot), as the locally submitted transactions
	// may be resubmitted later via the local tracker.
	err := b.eth.txPool.Add([]*types.Transaction{signedTx}, false)[0]
	if err != nil && locals == nil {
		return err
	}
	return nil
}

Implementation

  • Do you have ideas regarding the implementation of this feature?

☝️ Let the error returned with rpc response which is important for a normal geth user.

✌️TxTracker can handle repeated transaction, ignore txs resubmitted maybe ? 🤔 Or txtracker tracks the tx after it added to pool ?

  • Are you willing to implement this feature?

Please check pr #31528

@zouxyan zouxyan changed the title RPC client should be noticed that the transaction he sent by calling eth_sendRawTransaction fails stateful validation. RPC client should be informed that the transaction he sent by calling eth_sendRawTransaction fails stateful validation. Mar 30, 2025
@rjl493456442 rjl493456442 self-assigned this Apr 3, 2025
@samuelarogbonlo
Copy link

@rjl493456442 Can i pick this up?

@rjl493456442
Copy link
Member

This issue has been resolved in the latest release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants