fix(evmrpc): use synthetic IDs in slow-path batch to handle duplicate and null request IDs#3331
Merged
masih merged 3 commits intoApr 29, 2026
Conversation
|
The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3331 +/- ##
==========================================
+ Coverage 59.16% 59.17% +0.01%
==========================================
Files 2097 2097
Lines 172485 172496 +11
==========================================
+ Hits 102053 102078 +25
+ Misses 61570 61562 -8
+ Partials 8862 8856 -6
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
sei-will
approved these changes
Apr 29, 2026
masih
approved these changes
Apr 29, 2026
|
Created backport PR for
Please cherry-pick the changes locally and resolve any conflicts. git fetch origin backport-3331-to-release/v6.4
git worktree add --checkout .worktree/backport-3331-to-release/v6.4 backport-3331-to-release/v6.4
cd .worktree/backport-3331-to-release/v6.4
git reset --hard HEAD^
git cherry-pick -x e47d7a2ba3c0234a84baaa8adc1a0af04665af79
git push --force-with-lease |
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.
Problem
In the slow-path (gated)
handleBatchflow,mergeSeiLegacyHTTPBatchbuiltidToIdxkeyed on the original request ID echoed back by the inner server. When a batch contained multiple requests sharing the same ID — including multiple"id":nullentries — the old code detected the ID collision and fell through toappendMergeFailure, replacing all responses in the batch with internal errors.Fix
Assign a unique sequential synthetic integer ID (0, 1, 2, …) to each forwarded non-notification request before dispatching to the inner server. The inner server echoes these synthetic IDs back, so
idToIdxis always collision-free regardless of duplicate or null original IDs. Original IDs are restored in the output viapatchJSONRPCResponseIDIfNeeded.Changes:
msgsappendMergeFailureon duplicate inner-ID with a best-effortcontinue(the synthetic-ID scheme makes this unreachable in normal operation, but it's safer than a hard failure)json.RawMessage(...)casts on already-[]bytereturn valuesTests
TestWrapSeiLegacyHTTP_BatchTwoNullIDsDifferentResults: regression test covering two"id":nullrequests + a notification + a unique-ID request + a blocked sei_ method in one batch — verifies correct per-slot responses and that the notification is omitted from outputLinear
Closes PLT-282, PLT-292