feat(rpc): structured JSON-RPC error codes for all endpoints#119
Open
feat(rpc): structured JSON-RPC error codes for all endpoints#119
Conversation
dfd1229 to
b87e46b
Compare
Replace string-based RPC errors with structured error types implementing ajj's IntoErrorPayload trait. Each namespace (eth, debug, signet) gets a dedicated error enum with spec-compliant error codes. - Add EthError, DebugError, SignetError with thiserror + IntoErrorPayload - Replace response_tri! macro and string errors with typed error propagation - Add resolve_block_id/resolve_header helpers with ResolveError - Update ajj dependency from git branch to published 0.7.0 - Preserve hot storage reader consistency from #118 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
b87e46b to
112c417
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[Claude Code]
Summary
EthError,DebugError, andSignetErrorwithIntoErrorPayloadimpls (ajj 0.7) so all 45 RPC endpoints return proper JSON-RPC error codes instead of blanket-32603Result<T, String>/ResponsePayload<T, E>toResult<T, ErrorType>— the framework handles error-to-JSON-RPC conversion automaticallyCallErrorData,response_tri!macro,EthError::into_string; simplifyawait_handler!to single parameterized form?with#[from]impls for correct error codes and sanitized messages (no internal details leaked)EvmRevertvariants fromDebugErrorandSignetErrorEthError::task_panic()constructor to deduplicate 20+ inline copiesError code mapping
3eth_call,eth_estimateGasreverts — revert bytes indatafield-32000-32001-32602-32601debug_traceTransactionwith unsupported tracerDependencies
IntoErrorPayloadtrait) — currently patched to ajj PR #42 branch. Will update to published version once merged.Closes ENG-1899
Test plan
--all-featurescargo +nightly fmt🤖 Generated with Claude Code