Skip to content
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

Transaction Hash Returned but Not Broadcasted Automatically #30085

Open
J1a-wei opened this issue Jun 28, 2024 · 5 comments
Open

Transaction Hash Returned but Not Broadcasted Automatically #30085

J1a-wei opened this issue Jun 28, 2024 · 5 comments

Comments

@J1a-wei
Copy link

J1a-wei commented Jun 28, 2024

Hi Geth Team,

I've encountered an issue where Geth returns a transaction hash after sending a transaction, but the transaction does not seem to be broadcasted to the network. As a result, the transaction only appears on the blockchain after manually broadcasting it using a block explorer.

  • What might be causing Geth to return a transaction hash but not broadcast the transaction?
  • Are there any configuration parameters that can be optimized to prevent this issue?

Geth version: v1.14.3

@dreamPerson0106
Copy link

This issue has been preview on the Pull Requests. To resolve, Contact the Ethereum support page to initiate a chat with the live agent on the chat button to get more information about your request via ETH Support Thanks for posting @J1a-wei

This seems like a scam. Please do not open the links of this comment.

@jwasinger
Copy link
Contributor

jwasinger commented Jul 2, 2024

Can you set the log level to trace (debug.vmodule("core/txpool=5") in the console), try again to resubmit, see if there is anything relevant in the logs (and post them here)?

@jwasinger
Copy link
Contributor

Also, ensure that the transaction hash appears in the output of txpool.inspect and note which category (pending/queued) it falls into.

@J1a-wei
Copy link
Author

J1a-wei commented Jul 3, 2024

Hi, @jwasinger ,

We are a node provider, and similar issues have occurred before. Currently, we are unsure how to debug this. Could you please explain the mechanism of the transaction pool and the possible situations that might arise?

Additionally, are there any optimization techniques we can use to improve the success rate of broadcasting transactions?

Thank you very much.

@jwasinger
Copy link
Contributor

jwasinger commented Jul 3, 2024

@J1a-wei so I assume this issue happens occasionally, and is not necessarily reproduceable on command?

I'm going to assume that the transactions in question are normal transactions, and not blob transactions (as these are not direct broadcasted).

When normal transactions are sent to the pool (regardless of local/remote origination), they are first validated:

  • signature is correct and made by the sender account.
  • transaction pays the minimum "intrinsic gas" necessary.
  • transaction sender has enough funds to include this transaction, as well as others they may have already queued up.
  • transaction nonce is above the nonce of the account in the pool. if there is another queued/pending transaction from the same account with a matching nonce already in the pool, the incoming transaction must pay more than the existing one. If it does, it bumps the existing transaction out of the pool and replaces it.

Transactions which pass this validation are considered "queued": the set of transactions which are not necessarily currently-executable (higher nonce than the current value for the sender).

Asynchronously, the pool will look for queued transactions that have become executable and move these to the "pending" set.

From there, these are direct-broadcasted to a random subset of the peers. The size of this subset is the square root of the peer set.

Given that you received no error from sending the transaction to the pool, it passed validation and was included in the queued set. Because it is able to be included reliably via a block explorer, I assume that it became executable, and eligible for broadcast.

Perhaps there are not enough peers in the direct-broadcast set to reliably propagate the transaction through the network. How many peers are connected when you experience the issue?

Note that to prevent spamming the network with additional traffic, Geth will not automatically re-broadcast transactions if they do not get included in the chain. This is functionality that you will have to build yourself.

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