Introduction

Hi, I'm cardene, a software engineer and technical writer focused on blockchain and AI.

I've also authored Japanese technical books on specification-driven development with LLMs and decentralized application (DApp) development.

I also build and publish a variety of tools, libraries, and open-source projects.

Background

EIP-7966 proposes eth_sendRawTransactionSync, a JSON-RPC method that submits a signed transaction and waits for its receipt in the same call.

This article walks through the proposal below.

I also cover EIPs, BIPs, SLIPs, CAIPs, ENSIPs, RFCs, and ACPs.

Overview

With eth_sendRawTransaction, submitting a transaction and retrieving its receipt are separate steps. The caller submits the signed transaction, then polls for the receipt. EIP-7966 lets the caller wait for the receipt in the submission request.

On fast L2s and high-throughput EVM chains, a receipt can be available soon after submission. A separate polling request can introduce avoidable latency. The proposal estimates a roughly 50% reduction under the conditions it describes and aims to simplify clients. The actual difference depends on the chain and polling behavior.

If a transaction is rejected because its nonce is higher than the next expected nonce, the error includes that expected value. The application can use it without separately querying the account.

Motivation

Asynchronous transaction submission

Clients submit signed transactions asynchronously through eth_sendRawTransaction. The call returns a transaction hash immediately, while block inclusion happens later. Callers repeatedly invoke eth_getTransactionReceipt until a receipt is available.

That approach is useful on Ethereum mainnet, where slots are about 12 seconds apart. On fast L2s and other low-latency chains, processing may follow submission quickly. Another RPC round trip then adds network overhead and can delay access to a receipt that is already available.

Synchronous and asynchronous transaction submission flows

A receipt becomes available when the transaction is executed in a block, sometimes shortly after it reaches the producer's mempool on fast chains. Waiting in the original request avoids having to retrieve that receipt in a separate call.

Missing context in nonce errors

A transaction may be unready because its nonce is higher than expected or the account balance is insufficient. Existing calls may return a generic error. To diagnose a nonce gap, an application can make an additional request such as eth_getTransactionCount, but this adds another round trip.

How the proposal addresses these issues

eth_sendRawTransactionSync combines transaction submission and receipt retrieval.

Improvement Effect
Lower latency The proposal estimates about 50% lower combined submission and confirmation latency in its target scenario.
Simpler clients Callers can avoid a polling loop on the synchronous success path.
More responsive applications Dapps and wallets can get a result sooner on fast chains.
Familiar request-response pattern A single request returns the submission outcome and receipt when available.
Backward compatibility Existing RPC methods remain available.

Specification

Method definition

Method name and parameters

The name is eth_sendRawTransactionSync. It takes two parameters.

Position Type Description Required
1 DATA Hex-encoded, signed transaction data, using the same transaction format as eth_sendRawTransaction. Yes
2 INT Maximum time to wait for a receipt, in milliseconds. If the receipt is unavailable by the deadline, the call returns a timeout error. No
Parameter validation

The transaction must be a valid hex-encoded signed transaction in the format accepted by eth_sendRawTransaction, including RLP encoding as applicable to the transaction type. A supplied timeout must be a positive integer and cannot exceed the node's configured maximum.

Return values

The result depends on the outcome.

  • Receipt available The call returns the receipt object defined by eth_getTransactionReceipt. The receipt describes the result after block inclusion and execution.
  • Timeout Error code 4 indicates that the transaction entered the mempool but was not included before the deadline.
  • Not ready for execution Error code 5 indicates that a transaction not ready for execution was not added to the mempool. A nonce gap has its own code, 6.
  • Standard error The call returns an ordinary JSON-RPC error object for other failures covered by the existing RPC error format.

Error codes

The method defines three specific errors.

Code Error Meaning data field
4 Timeout The transaction entered the mempool but was not processed before the deadline. Transaction hash as a hex string
5 Unknown/Queued The transaction was not ready for execution and was not added to the mempool. Transaction hash as a hex string
6 Nonce Gap A nonce gap was detected, so the transaction was not added to the mempool. Expected nonce as a hex string

An error response has three fields.

  • code The numeric error code.
  • message A human-readable explanation.
  • data Error-specific information. Codes 4 and 5 carry the transaction hash. Code 6 carries the expected nonce.

Why error code 6 includes the expected nonce

If a nonce gap causes rejection, the hex-encoded expected nonce is returned directly in data.

An application can recover that value from the error instead of calling eth_getTransactionCount, removing an RPC round trip before it can rebuild and resubmit the transaction.

Timeout configuration

Node settings

Node implementations should provide a configurable timeout while waiting for a receipt. The recommended default is two seconds. An operator can adjust the timeout based on network conditions.

Caller settings

Applications can pass a timeout as the second parameter to match their latency requirements. The caller cannot exceed the node's configured maximum. The node uses its default when a supplied timeout is invalid.

Request handling

The following diagram shows the handler's flow. Its labels are retained from the Japanese original.

flowchart TD
    A[リクエスト受信] --> B{タイムアウトパラメータあり?}
    B -- はい --> C{タイムアウト値は有効?}
    B -- いいえ --> D[デフォルトタイムアウトを使用]
    C -- はい --> E[指定値を使用]
    C -- いいえ --> D
    D --> F{トランザクションは即時実行可能?}
    E --> F
    F -- nonceギャップ --> G[エラーコード6を返す\n期待nonceを含む]
    F -- その他の理由でキューイング --> H[エラーコード5を返す]
    F -- 即時実行可能 --> I[mempoolに送信]
    I --> J{レシート取得を待機}
    J -- タイムアウト前に取得 --> K[レシートを返す - 成功]
    J -- タイムアウト --> L[エラーコード4を返す\nトランザクションハッシュを含む]
    I -- 送信失敗 --> M[標準エラーを返す]
  1. Validate the timeout. Check a supplied timeout and fall back to the node default if it is invalid.
  2. Check readiness. Before adding the transaction to the mempool, check whether it is ready for immediate execution. If its nonce is higher than expected, return code 6 and the expected nonce without adding it. If it would be queued for another reason, return code 5 without adding it.
  3. Submit to the mempool. If ready, submit it as eth_sendRawTransaction would.
  4. Wait for the receipt. Return it when available. If the deadline elapses first, return code 4 and the transaction hash.
  5. Report submission errors. If submission fails because, for example, the transaction itself is invalid, return the existing eth_sendRawTransaction error immediately.

Example requests and responses

Request without a timeout

Omitting the timeout uses the node's default.

json
{
  "jsonrpc": "2.0",
  "method": "eth_sendRawTransactionSync",
  "params": [
    "0xf86c808504a817c80082520894ab... (signed tx hex)"
  ],
  "id": 1
}

Request with a timeout

This example requests a five-second timeout (5,000 milliseconds).

json
{
  "jsonrpc": "2.0",
  "method": "eth_sendRawTransactionSync",
  "params": [
    "0xf86c808504a817c80082520894ab... (signed tx hex)",
    5000
  ],
  "id": 1
}

Successful response

If the transaction is included before the deadline, the call returns a receipt in the same format as eth_getTransactionReceipt.

json
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "transactionHash": "0x1234abcd...",
    "blockHash": "0xabcd1234...",
    "blockNumber": "0x10d4f",
    "cumulativeGasUsed": "0x5208",
    "gasUsed": "0x5208",
    "contractAddress": null,
    "logs": [],
    "status": "0x1"
  }
}

A status of "0x1" indicates successful execution. A value of "0x0" indicates unsuccessful execution.

Timeout response (error code 4)

The transaction entered the mempool but was not included before the deadline. The caller can use the transaction hash in data to poll eth_getTransactionReceipt later.

json
{
  "jsonrpc": "2.0",
  "id": 1,
  "error": {
    "code": 4,
    "message": "The transaction was added to the mempool but wasn't processed within the designated timeout interval.",
    "data": "0x1234abcd..."
  }
}

Nonce gap response (error code 6)

The node rejected the transaction without adding it to the mempool. The hex-encoded expected nonce in data lets the caller rebuild and resubmit the transaction.

json
{
  "jsonrpc": "2.0",
  "id": 1,
  "error": {
    "code": 6,
    "message": "The transaction was rejected due to a nonce gap. Please resubmit with the next on-chain nonce.",
    "data": "0x5"
  }
}

Unknown or queued response (error code 5)

The transaction was unready and was not added to the mempool. The node can still compute its hash from the submitted data and return it in data.

json
{
  "jsonrpc": "2.0",
  "id": 1,
  "error": {
    "code": 5,
    "message": "The transaction was rejected for an unknown reason.",
    "data": "0x1234abcd..."
  }
}

Standard error response

If the transaction data is invalid or a similar submission error occurs, the call returns the same type of error as eth_sendRawTransaction.

json
{
  "jsonrpc": "2.0",
  "id": 1,
  "error": {
    "code": -32000,
    "message": "Invalid transaction"
  }
}

Additional notes

Why add a new RPC method?

Adding a timeout to eth_sendRawTransaction and changing its return type or timing would break the expectations of existing callers, which expect a transaction hash immediately.

A separate method lets callers opt into synchronous behavior while retaining the existing asynchronous option.

Which chains benefit from synchronous submission?

The method suits fast-block EVM chains and L2s with low network latency. Receipts are likely to arrive within a short window, so waiting in the request can save time.

On Ethereum mainnet, the roughly 12-second slot interval can lead to prolonged requests or frequent timeouts. Asynchronous submission remains useful there.

Why the expected nonce is useful

Returning the expected nonce alongside error code 6 has two benefits.

Benefit Explanation
Immediate recovery The error contains the expected nonce, avoiding a separate call to eth_getTransactionCount.
Lower latency Removing a round trip lets the application resubmit sooner.

The diagram compares nonce-gap recovery with and without EIP-7966. Its original Japanese labels are retained.

Nonce-gap recovery with and without EIP-7966

The conventional flow can take three RPC calls: submit, query the nonce after an error, and resubmit. With EIP-7966, the error supplies the nonce, reducing the example to two RPC calls.

Compatibility

The proposal adds a method without modifying or removing an existing one. Applications that use eth_sendRawTransaction can continue to do so. Nodes without the new method return method not found. Applications can use both methods where supported, making incremental adoption possible.

Reference implementation

The proposal includes this example handler for reth, a Rust-based Ethereum client.

rust
async fn send_raw_transaction_sync(
    &self,
    tx: Bytes,
    user_timeout_ms: Option<u64>,
) -> RpcResult<OpTransactionReceipt> {
    const MAX_TIMEOUT_MS: u64 = 2_000;

    const ERROR_CODE_TIMEOUT: i32 = 4;
    const ERROR_CODE_UNKNOWN: i32 = 5;
    const ERROR_CODE_NONCE_GAP: i32 = 6;

    const ERROR_MSG_TIMEOUT_RECEIPT: &str = "The transaction was added to the mempool but wasn't processed within the designated timeout interval.";
    const ERROR_MSG_UNKNOWN: &str = "The transaction was rejected for an unknown reason.";
    const ERROR_MSG_NONCE_GAP: &str = "The transaction was rejected due to a nonce gap. Please resubmit with the next on-chain nonce.";

    let start_time = Instant::now();
    let timeout = Duration::from_millis(
        user_timeout_ms.map_or(MAX_TIMEOUT_MS, |ms| ms.min(MAX_TIMEOUT_MS)),
    );

    let pool_transaction = OpPooledTransaction::from_pooled(recover_raw_transaction(&tx)?);
    let sender = pool_transaction.sender();

    let outcome = self
        .pool
        .add_transaction(TransactionOrigin::Local, pool_transaction)
        .await
        .map_err(OpEthApiError::from_eth_err)?;

    if let AddedTransactionState::Queued(reason) = outcome.state {
        self.pool.remove_transaction(outcome.hash);

        match reason {
            QueuedReason::NonceGap => {
                let expected_nonce = self
                    .pending_state
                    .basic_account(&sender)
                    .ok()
                    .flatten()
                    .map(|acc| format!("0x{:x}", acc.nonce));

                return Err(ErrorObject::owned(
                    ERROR_CODE_NONCE_GAP,
                    ERROR_MSG_NONCE_GAP,
                    expected_nonce,
                ));
            }
            _ => {
                return Err(ErrorObject::owned(
                    ERROR_CODE_UNKNOWN,
                    ERROR_MSG_UNKNOWN,
                    Some(hash),
                ));
            }
        }
    }

    let hash = outcome.hash;
    match self
        .pending_state
        .get_receipt(hash, timeout.saturating_sub(start_time.elapsed()))
        .await
    {
        Some(receipt) => Ok(receipt),
        None => Err(ErrorObject::owned(
            ERROR_CODE_TIMEOUT,
            ERROR_MSG_TIMEOUT_RECEIPT,
            Some(hash),
        )),
    }
}

The example handles the request as follows.

  1. Determine the timeout. Use the supplied timeout or the two-second default (MAX_TIMEOUT_MS). The example clamps a supplied value to the maximum.
  2. Recover and submit the transaction. Recover it from the raw bytes and add it to the pool.
  3. Check for a queued state. If queued because it is not ready, remove it from the pool and return the error code for the reason. For a nonce gap, read the account nonce and include it in the error.

Specification and reference implementation

The specification checks readiness before adding the transaction to the mempool. The reference example adds it, inspects the queued state, and removes it if it is not ready. Both approaches leave an unready transaction out of the pool when they finish.

  1. Wait for the receipt. If the transaction is ready, wait using the remaining time budget. Return a receipt when available, or code 4 on timeout.

Other clients, such as go-ethereum, can detect the arrival of a receipt through an event-driven approach, such as channels, instead of polling.

Security considerations

Timeouts as a DoS safeguard

Without a timeout, a synchronous request could wait indefinitely for a receipt. A configurable timeout with a recommended two-second default bounds that wait. Node implementations should also account for concurrent requests so that many outstanding calls do not degrade service.

Relationship to the existing security model

The proposal uses the existing transaction validation and execution rules. Waiting for a receipt changes the RPC behavior without changing transaction execution. Applications still need to handle timeouts and can continue monitoring transactions where appropriate.

References

Conclusion

EIP-7966 lets a caller submit a signed transaction and receive its receipt in the same RPC call when the chain processes it in time. That can simplify client logic and improve responsiveness on fast L2s and other low-latency chains.

Questions are welcome by direct message.

Twitter @cardene777

I also write at the following sites.