-
Notifications
You must be signed in to change notification settings - Fork 21.4k
internal/ethapi: add eth_SendRawTransactionSync #32830
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
base: master
Are you sure you want to change the base?
internal/ethapi: add eth_SendRawTransactionSync #32830
Conversation
We can do a slight refactor with this PR merged: #32697 (comment) |
This PR was merged ^ |
0daa396
to
3a3c46a
Compare
The given examples (missing nonce or insufficient funds) are already covered by their own more granular codes (https://github.com/aodhgan/go-ethereum/blob/ag/feat/add-ethsendRawTransactionSync/internal/ethapi/errors.go#L102). There is an option to coalesce these into the new error code 5 but dont see much value? (Also considering the EIP says SHOULD (vs MUST)). The "node not ready to accept new transactions" seems to require a deeper set of changes? wdyt @s1na? |
Receipt *types.Receipt | ||
Transaction *types.Transaction | ||
} | ||
type ReceiptWithTx = ethapi.ReceiptWithTx |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved to avoid circular dependency
Got it, that makes sense. Since the EIP says SHOULD and not MUST, it’s optional. I just wanted to check if we plan to follow that or keep using the current detailed error codes. |
New RPC method eth_sendRawTransactionSync(rawTx, timeoutMs?) that submits a signed tx and blocks until a receipt is available or a timeout elapses.
Two CLI flags to tune server-side limits:
--rpc.txsync.default (default wait window)
--rpc.txsync.max (upper bound; requests are clamped)
Creates a SubscribeTransactionReceipts subscription to monitor and extract desired receipts.
Success/timeout unit tests added.
closes #32094