lambdaclass / lambdaclass/eth-agent

Batch RPC throws on first error, losing successful results

Open
#8 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug high-priority
Dominant language
TypeScript
Stars
10
Forks
1
PR merge metrics
No merged PRs in 30d

Description

Problem

If any item in a batch fails, the entire batch throws. This loses successful results.

Location

src/protocol/rpc.ts:157-163

Current Code

return results.map((r) => {
  if (r.error) {
    throw new RPCRequestError(...);  // Throws on first error
  }
  return r.result;
}) as T;

Recommendation

  • Return Result<T, Error> type for each item
  • Or provide separate method for "all or nothing" vs "collect results"
  • Document behavior clearly

Priority

High - Data loss in partial failure scenarios

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the batch RPC handling in src/protocol/rpc.ts:157-163 and trace how individual results and errors are represented. Decide whether batch calls should return per-item Result values or expose separate partial-success and all-or-nothing behavior. Done means successful results are no longer lost on partial failure and the behavior is documented clearly.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.