Improve JSON-RPC error handling in Consensus/Execution communication#4629
Open
pmikolajczyk41 wants to merge 9 commits intomasterfrom
Open
Improve JSON-RPC error handling in Consensus/Execution communication#4629pmikolajczyk41 wants to merge 9 commits intomasterfrom
pmikolajczyk41 wants to merge 9 commits intomasterfrom
Conversation
…tation to the execution package
This was referenced Apr 10, 2026
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #4629 +/- ##
==========================================
+ Coverage 33.90% 33.97% +0.07%
==========================================
Files 498 499 +1
Lines 59879 59870 -9
==========================================
+ Hits 20303 20342 +39
+ Misses 36022 35989 -33
+ Partials 3554 3539 -15 |
Contributor
❌ 6 Tests Failed:
View the top 3 failed tests by shortest run time
📣 Thoughts on this report? Let Codecov know! | Powered by Codecov |
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.
The consensus <-> execution RPC boundary previously relied on
convertErrorfunctions that matched sentinel errors by scanning error message strings withstrings.Contains. This approach was fragile (breaks on message rewording or multi-layer wrapping), incomplete (ErrSequencerInsertLockTakenwas missing from the execution client;ErrRetrySequencerwas missing from the consensus client), and required duplicated conversion logic in two separate clients.What changed:
execution.RPCError— a struct that carries a JSON-RPC error code and implements bothrpc.Error(server side, so go-ethereum embeds the code in the wire response) and a code-based Is method (in-process path). CorrespondingjsonError.Isin the go-ethereum fork handles the wire path by comparingErrorCode()values.ErrRetrySequencer,ErrSequencerInsertLockTaken,ErrResultNotFound) and numeric constants for their codes, chosen below -32768 to avoid collision with the JSON-RPC 2.0 reserved range.convertErrorfrom bothexecution/rpcclientandconsensus/consensusrpcclient; errors now propagate as-is anderrors.Ismatches by code.ResultNotFoundfromexecution/gethexecto the execution package (renamedErrResultNotFound), removing an unnecessary import of gethexec from arbnode.closes NIT-4738
pulls in OffchainLabs/go-ethereum#649