Skip to content

Conversation

@lpahlavi
Copy link
Contributor

@lpahlavi lpahlavi commented Dec 19, 2025

(DEFI-2565) Add support for JSON-RPC batch requests and responses. This mostly involves implementing existing JSON-RPC middlewares for JSON-RPC batches in addition to JSON-RPC single requests.

@lpahlavi lpahlavi force-pushed the lpahlavi/defi-2565-batch-json-rpc branch 4 times, most recently from 8f0a69c to 0309f4f Compare December 19, 2025 12:25
@lpahlavi lpahlavi force-pushed the lpahlavi/defi-2565-batch-json-rpc branch from 0309f4f to 0410582 Compare December 19, 2025 16:16
@lpahlavi lpahlavi force-pushed the lpahlavi/defi-2565-batch-json-rpc branch from 8b24b98 to dce5081 Compare January 5, 2026 14:01
@lpahlavi
Copy link
Contributor Author

lpahlavi commented Jan 6, 2026

@gregorydemay I did quite a bit of experimenting here with different solutions to make this as easy to use as possible despite all the generics involved with tower middlewares. For example I considered an enum wrapping single requests and batch requests, some traits for request/response pairs that are valid JSON-RPC calls (i.e. HttpJsonRpcRequest/HttpJsonRpcResponse and HttpBatchJsonRpcRequest/HttpBatchJsonRpcResponse), etc. In the end I think things as they are now are a pretty good tradeoff between being generic and usable, but let me know if you have any specific ideas/concerns and I can let you know why I didn't go in those directions.

@lpahlavi lpahlavi requested a review from gregorydemay January 6, 2026 16:03
@lpahlavi lpahlavi marked this pull request as ready for review January 6, 2026 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant