Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use weiroll to batch process multiple eth_call requests in a single RPC call #51

Open
TimDaub opened this issue Oct 11, 2022 · 2 comments

Comments

@TimDaub
Copy link
Member

TimDaub commented Oct 11, 2022

  • [email protected] adds weiroll support
  • technically, this means that if we had an eth_call to weiroll call converter, then we could take some of the eth_calls in the queue, convert them to weiroll calls and hence save network requests
  • the idea is that network requests are slow as they have roundtrip time, latency etc. and so batching network requests seems like a good idea
  • potentially, if we're generically translating eth_calls to weiroll calls then we should consider natively implementing it in eth-fun
  • so I may need to transfer this issue there.
@il3ven
Copy link
Contributor

il3ven commented Oct 16, 2022

Some thoughts about weiroll in general:

If we are to generically translate all RPC calls to weiroll then won't we be better off just using weiroll.js?

In case we want to keep it lean and just translate eth_calls then also it seems like a lot of work. This is coming from a person who just started to learn weiroll so maybe I am wrong. To reduce our work and solve the problem we can use the batch functionality of JSON RPC. It's the simplest. (Edit: Found #45)

Weiroll has a disadvantage when compared to batch JSON RPC requests. If one eth_call fails in weiroll then all the calls will fail. This can happen if we provided a wrong tokenID to one of the eth_call in the batch. This doesn't happen in JSON RPC.

@TimDaub
Copy link
Member Author

TimDaub commented Oct 17, 2022

  • weiroll.js is unfortunately a stateful transaction builder and we don't like stateful software
  • I'm not sure if translating from eth_calls to weiroll calls is a lot of work, it could be that it's quite lean
  • alchemy and other cloudproviders treat batch requests badly as you can see in Implement JSON-RPC batch support #45
  • I think a lot of people would appreciate a eth_call to weiroll_call function

Weiroll has a disadvantage when compared to batch JSON RPC requests. If one eth_call fails in weiroll then all the calls will fail. This can happen if we provided a wrong tokenID to one of the eth_call in the batch. This doesn't happen in JSON RPC.

Nice take actually, I hadn't considered this.

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

No branches or pull requests

2 participants