-
Notifications
You must be signed in to change notification settings - Fork 50
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
Is it possible to use integrate smoldot further with Chopsticks to improve the performance of query remote state? #1473
Comments
I've read your post but overall I'm not really sure of what to answer.
If you make requests on the peer-to-peer level, then you're facing the same problems. The endpoint can be slow, unresponsive, etc. The advantage I see in doing requests at the peer-to-peer level is that some JSON-RPC providers might have a reverse proxy with a sketchy configuration in front of their endpoint, and you'd bypassing that. But that's hypothetical, and I'm not sure if it would be worth it.
If you're sending one storage request every time the runtime execution reads something, one thing I'd suggest is to ask for a call proof at the beginning. Since you're hijacking the storage the call proof will probably not cover everything, but it will probably cover a lot of accesses. Of course you'd need to decode the call proof, which is a bit complicated.
The new JSON-RPC API isn't ready for querying historical data. Right now it's been focused on following the head of the chain. |
I see the benefits of using p2p protocol is that it have peer discovery so that I can easily connect to more nodes, rather then a fixed set of rpc. Yeah I can see some additional work is needed to deal with all the peers but I am hoping smoldot already have the logic implemented and I can simply use it. |
Thanks for the suggestion of call proof. That wasn’t in my head and could make a big change in some scenarios. |
The problem is you can't know which nodes are archive nodes or not. You can't know which peers have a certain block available. |
If you want to give it a try anyway, what I'd suggest is to create a It's not public, but I think it should be ok making the light client services public. The way you do it is:
There's unfortunately no way yet to influence which peers the network service connects to. For example it's not possible to ban a peer in case it doesn't know a block. It's something I want to add (#1442). |
Thanks for the pointers. I will give it a play. |
Closing this. Feel free to open discussions or issues for questions or whatnot. |
We already have a working PoC AcalaNetwork/chopsticks#609 |
I spent a bit time navigating the repo trying to find an answer but I figured it maybe easier to just ask.
Right now, one of the biggest pain point to maintain a Chopstick based e2e test suite is to deal with all the broken RPC providers.
Chopsticks currently uses smoldot for wasm execution but that's it. The storages are read using pjs from a remote RPC endpoint (code)
This means if the upstream endpoint is slow, unresponsive, not working, etc, the tests will fail. Also currently Chopsticks is making a lot of sequential requests and that's not helping. It can easily hit a rate limit, or just slow due to latency.
Obviously smoldot as a light client is also capable of query storages. How can I use smoldot to query replace all the existing use cases (abstracted in this file) or RPC remote node?
Specifically, I am looking for some suggestions on the best way to approach this.
I know smoldot as a light client, query historical state is kinda out of scope and may not be supported. However, Chopsticks needs the ability to query historical state so it can fork off an old block. With that in mind, is there anyway to use smoldot to achieve my goal? For example, make p2p requests directly to remote peers to query the information. Chopsticks as a dev & testing tool, security isn't the top priority so it doesn't need to verify data integrity and that may make something easier?
I want to avoid running a light client if possible because I don't really need it.
Here is a list of the API Chopsticks is currently using:
The text was updated successfully, but these errors were encountered: