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

Make eth_sendRawTransaction idempotent #245

Open
lightclient opened this issue Jun 22, 2022 · 0 comments
Open

Make eth_sendRawTransaction idempotent #245

lightclient opened this issue Jun 22, 2022 · 0 comments
Labels
A-spec Area: specification

Comments

@lightclient
Copy link
Member

From @MicahZoltu in NethermindEth/nethermind#4148:

Describe the bug

If you eth_sendRawTransaction for a transaction that is already in the mempool you receive an error of AlreadyKnown. Instead, you should receive the transaction hash.

This is especially impactful when combined with other bugs like when you call eth_sendRawTransaction and get back a FeeTooLow error (no transaction hash) and then when you send it again you get AlreadyKnown error. This means you never can receive the transaction hash for the transaction in question (unless you calculate it yourself) so you can't actually query it.

If the transaction is already in the mempool, a more appropriate response would be to return the transaction hash which would make eth_sendRawTransaction semi-idempotent (you could call it multiple times and get the same answer each time).

To Reproduce

Steps to reproduce the behavior:

Via JSON-RPC call eth_sendRawTransaction with some transaction.
Call eth_sandRawTransaction again with the same transaction details.
Notice that you receive AlreadyKnown error.

Expected behavior

You get the transaction hash back.

Additional context

I'm not sure what Geth does here, but even if it returns AlreadyKnown I think this is incorrect behavior since you could just return the transaction hash which would always be a correct response in this case.

@lightclient lightclient added the A-spec Area: specification label Jun 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-spec Area: specification
Projects
None yet
Development

No branches or pull requests

1 participant