-
Notifications
You must be signed in to change notification settings - Fork 248
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
Subxt gives error when used with risczero #1742
Comments
Hey @amiyatulu subxt is using the jsonrpsee-ws-client by default it depends on ring which doesn't compile for risc-v and probably jsonrpsee doesn't as well. So you need to disable the jsonrpsee feature in subxt but it might possible to use jsonrpsee without tls. What will work is provide some other rpc client that you know compiles risc zero and then implement the subxt::RpcClientT trait example here We have not tested risc-v or know that much about the platform, so it might be a frustrating experiment but we do know that subxt-core compiles for no-std at least so not impossible :) |
Here is issue on risc v support on ring. risc0 issue, may be one has to wait for the support: When I use jsonrpsee, it successfully compiles in risc-zero but not with feature jsonrpsee-ws-client, that depends on ring. |
jsonrpsee without any features doesn't enable anything Try building the following: jsonrpsee-ws-client = { version = "0.22", default-features = false } This will disable TLS |
Tonic successfully compiled with risczero. But not sure how to implement Should I have to modify the struct struct MyLoggingClient {
log: Arc<Mutex<String>>,
} Tonic rpc can be good alternative to jsonrpsee, an example file will be a good idea. |
jsonrpsee most likely works as well if you disable TLS and tonic hasn't enabled TLS in the example |
Will there be security issues if I disable tls ? |
It's something you have to decide i.e, whether you can have it running on localhost or something that you trust but it's not recommended obviously (I don't know how to workaround that in risc-v) Anyway I have created an example how to get you started with subxt without tls, https://github.com/niklasad1/subxt-riscv-example but it's nothing really that on our roadmap to support but it's quite cool... |
Not localhost but using lightclient. If I can fetch data from the light client without any security issues, then I don't have any problem. However, to offload computations off-chain, RiscZero support is required. Using Subxt and risczero I can securely fetch data from the blockchain, make intermediate transactions, perform off-chain computations, and store the proof of computation on the blockchain. For instance, to calculate the standard deviation of millions of values, I can fetch the data from the blockchain using RiscZero and Subxt, perform the calculation, and then submit the proof containing the output value, i.e., the standard deviation. One can be sure that output value is the actual standard deviation without manipulation. Importantly, the duration of the computation does not matter - even if it takes an hour, as only proof is still stored on the blockchain. |
Also the dependancies don't work in risczero. It still gives ring error: serde = "1.0.209"
serde_json = "1.0.127"
subxt = { version = "0.37.0", default-features = false, features = ["native"] }
tokio = { version = "1.40.0", features = ["rt-multi-thread", "macros", "time"] }
jsonrpsee-ws-client = { version = "0.24.5", default-features = false }
jsonrpsee-core = { version = "0.24.5", features = ["client"] }
futures = "0.3" Error:
|
Ok, subxt seems to leak that feature from the reconnecting-client. I pushed a fix but I was to lazy to install the toolchain. I'll test it later today... or may you could test it again. |
No, still the ring error. |
jsonrpsee-ws-client is also not working, its gives sys error. jsonrpsee-ws-client = { version = "0.24.5", default-features = false } Error
Only jsonrpsee-core and jsonrpsee (without any features) successfully compiles: jsonrpsee = {version = "0.24.5"}
jsonrpsee-core = { version = "0.24.5", features = ["client"] } |
Just discussing in risczero forum
As host subxt successfully compiles, but it doesn't compile in guest.
|
Ok, I have raised #1812 which is subxt issue that we should fix. I would rather copy-paste this in to a discussion thread because I don't regard it as subxt issue because subxt has:
Thus, the way forward for you is most likely to keep interacting with the chain via RPC as host and do the zk-stuff as guest. You may be able to use IPC or something else to interact between guest/host but I don't know that stuff... Hopefully that will help to engineer something around it. |
Yes, currently I am trying to just compare input data string and journal data of risczero in blockchain, to have offchain computing. One can also use hash of input data for comparision. It would cheaper to do, and solves most use cases. subxt-signer is needed for guest in risczero and is already compatible with it. |
Subxt gives error when used with risczero.
The text was updated successfully, but these errors were encountered: