> For the complete documentation index, see [llms.txt](https://node1.gitbook.io/node1-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://node1.gitbook.io/node1-docs/documentation/zh/robinhood/robinhood-landing/robinhood-responses.md).

# Responses & Retries

接入前请查看[节点地址、Account UUID 与额度](/node1-docs/documentation/zh/robinhood/robinhood-landing.md)。以下接收回执适用于新版节点的 JSON-RPC 单笔、plain text 和 batch 三种入口。

## 单笔交易：HTTP 202，已入队

节点完成本地校验、鉴权、限流和入队后即返回，不等待排序器回应或链上回执。响应头为 `x-node1-submission-state: queued`，JSON-RPC `result` 返回本地计算的交易哈希：

响应提示 `message` 为 `"Successfully forwarded"`。单笔 JSON-RPC 和纯文本响应将其放在顶层；batch 将其放在每个 `queued` 交易项中。该字段仅用于展示，服务仍在本地入队后返回 HTTP 202，不等待网络写出或排序器确认，也不表示交易已上链。客户端应依据状态、哈希及错误字段处理响应，不要根据提示文案判断上链成功。

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "0x<TRANSACTION_HASH>",
  "message": "Successfully forwarded"
}
```

这是正常的接收回执，不带 `error`，不是原先的 `202 / -32008`。客户端不能只把 HTTP 200 当作成功。JSON-RPC 响应保留请求的 `id`；plain text 响应的 `id` 固定为 `null`。

`queued` 仅表示本地已接收，不保证任何或全部转发路径已经写出，也不表示上游已接受、交易已上链或执行成功。上游后续的 `nonce too low` 等错误不会再通过这个响应返回。请使用自己的链上 RPC 按哈希查询状态，不要因尚未出现链上回执而自动重发。

同一节点识别为重复提交时，可返回同一哈希并附带 `x-node1-duplicate: true`；这不表示再次转发或上链成功。

## batch：HTTP 202 与逐笔状态

服务先保存本地批次接收记录，再完成限流和入队，随后返回；记录异步上报数据库，不等待排序器回应。响应包含 `result.batch_id` 和按 `tx_index` 排列的 `result.transactions`，并附带 `x-node1-batch-id` 响应头。一个交易项的示例如下：

```json
{
  "jsonrpc": "2.0",
  "id": 2,
  "result": {
    "batch_id": "<BATCH_ID>",
    "transactions": [
      {
        "tx_index": 0,
        "tx_hash": "0x<TRANSACTION_HASH>",
        "status": "queued",
        "duplicate": false,
        "retry": "do_not_retry_automatically",
        "message": "Successfully forwarded"
      }
    ]
  }
}
```

逐项检查 `status`、`retry` 和可选的 `error`。`queued` 表示该项本地已接收，`duplicate` 表示去重命中；HTTP 202 不保证所有交易项均已入队或成功。新请求可能与已有去重项混合，因此不要只检查 HTTP 状态码。

仅对明确标记为 `not-sent` 且 `retry_safe` 的项，等待后再重试。不要自动重发 `queued` 项，也不要自动重发整个 batch。批次接收记录不是上链证明。

## 本地错误

| HTTP 状态   | 含义与处理                                    |
| --------- | ---------------------------------------- |
| 400       | 请求参数或交易本地校验失败；检查 `error` 并修正请求           |
| 401       | Account UUID 缺失或鉴权失败                     |
| 413 / 415 | 请求过大或 Content-Type 不支持                   |
| 429       | 账号额度或 IP 级请求限制触发；遵循 `Retry-After`，等待后再发送 |
| 503       | 服务不可用、容量不足或批次记录失败；检查具体错误与逐笔状态            |

账号限流的 JSON-RPC code 为 `-32005`，可同时提供 `x-ratelimit-retry-after-ms`。容量不足可返回 `-32006`；明确未发送可返回 `-32001`。Batch 在本地接收记录保存失败时返回 `503 / -32011`，该请求中的交易尚未开始发送。

Batch 的 HTTP 503 可能包含顶层 `error`，也可能包含 `result.transactions` 中的逐笔错误。不要因为收到 503 就忽略响应体或重发整批。连接中断、响应不完整或没有明确未发送信息时，按下方连接超时规则处理。

## 连接超时与重试

三种入口在未收到完整响应时，都应使用本地已签名交易的哈希查询。暂时查不到交易或回执，并不代表交易没有发送；不要自动重发。交易状态以链上 RPC 查询为准。

如需长期保持连接，请使用[60 秒空闲超时与心跳](/node1-docs/documentation/zh/robinhood/robinhood-landing.md)。

## 迁移期间的旧版回执

DNS 缓存或已有长连接可能仍连接旧版节点。客户端应区分以下回执：

| 回执                                   | 含义                                           |
| ------------------------------------ | -------------------------------------------- |
| HTTP 202 + `result` 哈希，提交状态 `queued` | 新版：本地已接收                                     |
| HTTP 200 + `result` 哈希               | 旧版：至少一路上游确认接收；仍不代表上链                         |
| HTTP 202 + `error.code: -32008`      | 旧版：提交结果不明确；使用 `error.data.tx_hash` 查询，不要自动重发 |

旧版 batch 可能返回 HTTP 200/202，逐项包含 `dispatched`、`in-flight`、`unknown` 或错误状态。仍须逐项检查 `retry`，不能把整个 HTTP 2xx 响应当作所有交易已成功。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://node1.gitbook.io/node1-docs/documentation/zh/robinhood/robinhood-landing/robinhood-responses.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
