incubator-teaclave-sgx-sdk icon indicating copy to clipboard operation
incubator-teaclave-sgx-sdk copied to clipboard

help forking jsonrpc

Open brenzi opened this issue 5 years ago • 5 comments

We're currently forking jsonrpc for use in our enclave. Thanks @dingelish for your previous upgrades on serde.

We're now stuck. If you build https://github.com/scs/substraTEE-worker/tree/upgrade-deps/enclave (build it easily in our docker: https://www.substratee.com/howto_worker.html#using-docker)

as-is the build should work, but if you add the dependency of our fork of jsonrpc-core, we get std collisions.

just enable this dependency and the build will fail https://github.com/scs/substraTEE-worker/blob/60c0c15635d8fff5c21ac376fa4e463857689d6f/enclave/Cargo.toml#L75-L78

Our end goal is to use jsonrpc-ws-server where well have to replace transport layer deps with mesalock-forks....

May we kindly ask for your support porting this crate to SGX?

brenzi avatar Dec 21 '20 15:12 brenzi

sure. do you need jsonrpc-core only?

dingelish avatar Dec 21 '20 21:12 dingelish

I fear we will need more to get wss:// into the enclave working. at least jsonrpc-ws-server and its dependencies

brenzi avatar Dec 22 '20 06:12 brenzi

Our reference implementation is: https://github.com/paritytech/substrate/tree/master/client/rpc-api

We don't necessarily need to support all transport protocols. wss:// is enough.

jsonrpc-core
jsonrpc-core-client
jsonrpc-pubsub (?)
jsonrpc-client-transports (?)
jsonrpc-derive
jsonrpc-ws-server
jsonrpc-server-utils

(secure) websockets seem to use tokio, hyper-tls, parity-ws

We thought we might be able to bend these dependencies to rustls which is already ported. Not sure which option means more work

brenzi avatar Dec 22 '20 10:12 brenzi

hi @brenzi , i just got your no_std branch works along with substratee enclave. please review and merge https://github.com/scs/jsonrpc/pull/1 and then checkout my changes at https://github.com/dingelish/encointer-worker/commit/69bd8690eeb904fe201b713190fe7b139d00704c

will look into the jsonrpc crates later ...

dingelish avatar Dec 27 '20 05:12 dingelish

Hi @dingelish, scs/jsonrpc#1 was merged and is working well. Thank you very much for your support so far!

haerdib avatar Jan 04 '21 10:01 haerdib