Skip to content

Hint known JSON-RPC error codes on failed mempool submissions - #5006

Merged
AryanGodara merged 3 commits into
mainfrom
aryan/mempool-rpc-error-codes-init
Oct 1, 2026
Merged

AryanGodara merged 3 commits into
mainfrom
aryan/mempool-rpc-error-codes-init

Conversation

@AryanGodara

Copy link
Copy Markdown
Member

Description

On Ink, some settlements fail at eth_sendRawTransaction with -32100: transaction rejected from every RPC. The error comes from a proxyd-style proxy in front of the sequencer
(proxyd). Currently it wasn't obvious as where this error comes from

This PR adds a small mapping on the JSON-RPC code for new codes we come across, and codes we haven't seen before stand out.

Changes

  • -32000 and errors without a code: unchanged
  • -32100: the error now starts with transaction rejected upstream (JSON-RPC -32100): ...
  • Any other code: the error now starts with unexpected error code <N>

No behaviour change: the error is still Error::Other and the tx fails the same way. The hint shows up in the existing sending transaction via mempool failed warning.

How to test

log-only change, so no unit test.

Signed-off-by: Aryan Godara <aryangodara03@gmail.com>
@AryanGodara AryanGodara self-assigned this Sep 30, 2026
@AryanGodara
AryanGodara requested a review from a team as a code owner September 30, 2026 13:31
@claude

claude Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @AryanGodara's task in 58s —— View job


PR Review: Hint known JSON-RPC error codes on failed mempool submissions

  • Read changed file and diff
  • Verify no downstream string-matching on the error is affected
  • Check types / correctness of explain_rpc_error

Verdict: LGTM — no changes required.

The change is correct and well-scoped:

  • explain_rpc_error maps only the failing send_transaction path; -32000/no-code stay untouched, -32100 gets a targeted upstream-proxy hint, and any unknown code surfaces via unexpected error code <N>.
  • The original RPC message is preserved as the cause chain, so ?err in the sending transaction via mempool failed warn log still shows the full detail — the added .context(...) only prepends the hint.
  • No behavior change downstream: the error remains mempools::Error::Other, which is matched purely by variant (crates/driver/src/domain/mempools.rs:512, crates/driver/src/infra/notify/mod.rs:122) — never by string content — so no categorization or notification logic is affected.
  • Types are sound: as_error_resp() → Option<&ErrorPayload>, code is Option<i64>, and the literal match arms + format! are consistent.

Nice touch adding the proxyd source link in the comment for the -32100 rationale.
· aryan/mempool-rpc-error-codes-init

Comment thread crates/driver/src/infra/mempool/mod.rs Outdated
Comment on lines +238 to +242
Some(-32100) => err.context(
"transaction rejected upstream (JSON-RPC -32100): the RPC's proxy refused it before \
the sequencer",
),
Some(code) => err.context(format!("unexpected error code {code}")),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO error conversion can be quite complicated and it's up to the caller whether they print the full context. I'd err on the side of keeping things simple and obvious by simply emitting a log here and leave the error conversion itself as it was before.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed it to log instead 🫡

Comment thread crates/driver/src/infra/mempool/mod.rs Outdated
Signed-off-by: Aryan Godara <aryangodara03@gmail.com>
…or-codes-init

Signed-off-by: Aryan Godara <aryangodara03@gmail.com>
@AryanGodara
AryanGodara enabled auto-merge October 1, 2026 10:42
@AryanGodara
AryanGodara added this pull request to the merge queue Oct 1, 2026
Merged via the queue into main with commit d40dfdf Oct 1, 2026
25 checks passed
@AryanGodara
AryanGodara deleted the aryan/mempool-rpc-error-codes-init branch October 1, 2026 11:01
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 1, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants