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

Concurrent transactions submitted with the same nonce #169

Closed
yondonfu opened this issue Oct 30, 2017 · 1 comment
Closed

Concurrent transactions submitted with the same nonce #169

yondonfu opened this issue Oct 30, 2017 · 1 comment
Assignees
Labels
type: bug Something isn't working
Milestone

Comments

@yondonfu
Copy link
Member

When 2 transactions are submitted concurrently, it is possible for transaction A to be submitted with nonce X and transaction B to be submitted with the same nonce. This leads to the Geth error "transaction replacement is underpriced" because Geth thinks the transaction B is meant to be a replacement transaction which would require a higher gas price than transaction A.

This is because the Go contract bindings for our contracts use the RPC method getTransactionCount(addr, "pending") to retrieve the nonce to be used for a transaction. getTransactionCount(addr, "pending") SHOULD return the next nonce taking into account an account's pending transactions in the transaction pool. However, at the moment getTransactionCount(addr, "pending") instead only takes into account pending transactions in the pending block which is the block currently being mined or the latest canonical block if the node you are connected to is not a miner. As a result, the nonce retrieved will not reflect any pending transactions sitting in the transaction pool and transactions submitted concurrently (or close in time to each other) can be submitted with the same nonce.

There is an open issue in Geth, but it is not fixed yet: ethereum/go-ethereum#2880

Some possible alternative solutions for nonce tracking can be documented here

@yondonfu
Copy link
Member Author

Fixed by #252

eliteprox pushed a commit to eliteprox/go-livepeer that referenced this issue Sep 17, 2024
This commit adds pipeline descriptions so that each pipeline is clearly
explained on the docs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants