-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Add EIP: eth_sendRawTransactionSync Method #9890
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?
Conversation
File
|
chore: update EIP-sync send method
EIPS/eip-sync_send_method.md
Outdated
- `DATA`. The signed transaction data. | ||
|
||
### Returns | ||
- **On success**. Return the transaction receipt object as defined by the [`eth_getTransactionReceipt`](https://docs.metamask.io/services/reference/ethereum/json-rpc-methods/eth_gettransactionreceipt/) method. If the transaction is not yet included in a block, the fields blockHash will be populated but all other fields will be `null` or omitted depending on the client implementation. |
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.
Avoid explaining "why" certain decisions were made.
"If the transaction is not yet included in a block, the fields blockHash will be populated but all other fields will be null or omitted depending on the client implementation." This explanation is behavioral context that's implementation-specific and not a strict part of the “what” — this belongs in a Rationale
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.
Thank you, I have refined the description.
EIPS/eip-sync_send_method.md
Outdated
Upon receiving an `eth_sendRawTransactionSync` request, the handler function performs the follow task. | ||
- Submit the signed transaction to the network as per the existing `eth_sendRawTransaction` semantics. | ||
- Poll for the transaction receipt at short intervals (e.g., every 10 milliseconds). | ||
- If the receipt is found within the specified timeout, return it immediately. |
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.
in a specification. This should use precise language like (all-caps MUST, SHOULD, MAY, etc.) for example "MUST poll every X milliseconds"
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.
EIPS/eip-sync_send_method.md
Outdated
- **On standard error**. Return A JSON-RPC error object consistent with existing RPC error formats. | ||
|
||
### Behavior | ||
Upon receiving an `eth_sendRawTransactionSync` request, the handler function performs the follow task. |
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.
Upon receiving an `eth_sendRawTransactionSync` request, the handler function performs the follow task. | |
Upon receiving an `eth_sendRawTransactionSync` request, the handler function performs the following tasks. |
EIPS/eip-sync_send_method.md
Outdated
- align blockchain interactions closer to traditional Web2 request-response patterns; | ||
- maintain backward-compatibility and optionality, preserving existing RPC methods and semantics. | ||
|
||
## Specification |
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.
In here, we need to have consistent use of RFC 2119 keywords (MUST, SHOULD, etc.). For example, in places where we currently have phrases like "this should be", we need to revise them to use proper normative language, such as:
- "The handler function MUST submit the signed transaction to the network."
- "The implementation MUST poll for the receipt at an interval not greater than 100 milliseconds until the timeout elapses."
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.
EIPS/eip-sync_send_method.md
Outdated
} | ||
``` | ||
|
||
Other implementations such as [`go-ethereum`](https://github.com/ethereum/go-ethereum) can utilize channel to signify receipt availability instead of polling. A prototype is being developed in reth: |
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.
Other implementations such as [`go-ethereum`](https://github.com/ethereum/go-ethereum) can utilize channel to signify receipt availability instead of polling. A prototype is being developed in reth: | |
Other implementations such as [`go-ethereum`](https://github.com/ethereum/go-ethereum) can utilize a channel to signify receipt availability instead of polling. A prototype is being developed in reth: |
EIPS/eip-sync_send_method.md
Outdated
|
||
## Reference Implementation | ||
|
||
A minimal reference implementation can be realized by wrapping existing `eth_sendRawTransaction` submission with a polling loop that queries `eth_getTransactionReceipt` at short intervals until receipt is found or timeout occurs. Polling intervals and timeout values can be tuned by client implementations to optimize performance. |
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.
A minimal reference implementation can be realized by wrapping existing `eth_sendRawTransaction` submission with a polling loop that queries `eth_getTransactionReceipt` at short intervals until receipt is found or timeout occurs. Polling intervals and timeout values can be tuned by client implementations to optimize performance. | |
A minimal reference implementation can be realized by wrapping existing `eth_sendRawTransaction` submission with a polling loop that queries `eth_getTransactionReceipt` at short intervals until receipt is found or a timeout occurs. Polling intervals and timeout values can be tuned by client implementations to optimize performance. |
EIPS/eip-sync_send_method.md
Outdated
|
||
## Backwards Compatibility | ||
|
||
This EIP introduces a new RPC method and does not modify or deprecate any existing methods. Clients and servers that do not implement this method will continue operating normally. Existing applications using `eth_sendRawTransaction` are unaffected. Clients not supporting the method will simply return `method not found`. |
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.
This EIP introduces a new RPC method and does not modify or deprecate any existing methods. Clients and servers that do not implement this method will continue operating normally. Existing applications using `eth_sendRawTransaction` are unaffected. Clients not supporting the method will simply return `method not found`. | |
This EIP introduces a new RPC method and does not modify or deprecate any existing methods. Clients and servers that do not implement this method will continue operating normally. Existing applications using `eth_sendRawTransaction` are unaffected. Clients that do not support the method will simply return `method not found`. |
chore: address comments in ethereum#9890
The commit 3f74e21 (as a parent of 7e408a0) contains errors. |
@SmoothBot let us know when you have fixed the issues flagged by the bot and this PR is draft ready |
Thank you @g11tech, all issues flagged by the bot have been resolved now. |
|
||
- The handler function MUST submit the signed transaction to the network as per the existing `eth_sendRawTransaction` semantics. | ||
- The handler function MUST wait for the transaction receipt until the timeout elapses. | ||
- If the receipt is found within the specified timeout, the handler function MUST return it immediately. |
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.
You mention the timeout is specified but not how it is specified. Should it be a parameter to this function or should it be configured by the node?
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.
Hi @wjmelements, thank you for the comment. We have addressed the timeout issue in 316cf05.
@SmoothBot seems like there are a few things more flagged by other technical reviewers which you might want to accomodate or respond to. let me know when you are done so we can consider it for merging this draft |
Thanks, there are a few technical discussions happening still. We will ping you when it's ready 🙏 |
Thank you @g11tech, these have been addressed. |
EIP: eth_sendRawTransactionSync RPC Method for Lower Latency Transaction Submission
This EIP proposes a new JSON-RPC method
eth_sendRawTransactionSync
which reduces the latency between transaction submission and user confirmation by blocking until the transaction has been included in a block or safely gossiped to peers. This method addresses the user experience gap in high-frequency applications by offering stronger delivery guarantees thaneth_sendRawTransaction
.