Skip to content

Conversation

juampiq6
Copy link

Multiquery RPC feature:

This PR adds functionality for making several rpc queries in one request. Handling most of the stuff internally in a separate implementation of a Web3Client for compatibility purpose.
I can add documentation for it in the main README.md file for people who need it as it can be a useful feature for a lot of people to ask once and get several responses (reducing latency times specially for dapps that make a lot of request).
I think this is a key feature.
I added some integration test but a lot more can be added (i saw the other parts of this library werent thoughly tested so i want make sense to keep a good test suite only for this feature).
Hope this helps!

Any improvement is more than welcome as any corrections or discussion about the implementation!
@xclud i hope you have time to review it, I have marked in the PR comments the part where it does actually change a little the library API, but so far the rest and the main functionality is developed in other implementation of the Web3Client.

instead of throwing an RPCError, now an error is returned in the list of responses, to be handled by the receiver appropiately
created some really handy constructors to be able to create several queries easily
… them.

switched back rpc query id to be int instead of string, for single type managment purpose:
theorically an rpc id can be string too, but for simplicity all ids assigned will be int
…ber of responses

added response sorted by request order (not id order)
Copy link
Owner

@xclud xclud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @juampiq6. I appreciate your efforts. Please let's review and improve the code together.

@juampiq6
Copy link
Author

juampiq6 commented Mar 2, 2023

@xclud all fixes done, i dont know what could be missing

@xclud
Copy link
Owner

xclud commented Mar 2, 2023

Thank You @juampiq6,

There are a couple of merge conflicts.

xclud added 3 commits April 3, 2025 23:38
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.

2 participants