flashbots/geth-sgx-gramine

Is it not possible to attach to geth inside sgx with a private net?

Closed this issue · 4 comments

Thanks to you, I was able to successfully launch a private network. However, when I try to attach and process a transaction, the following error occurs. Is there any other way to process transactions in this case?

show4510@sgx-test:~/test-geth2/go-ethereum$ ./build/bin/geth attach ./geth-network/miner/geth.ipc
Fatal: Unable to attach to remote geth: dial unix ./geth-network/miner/geth.ipc: connect: no such file or directory

When trying to run it within sgx, an error similar to the one below seems to occur even in versions that did not cause an error even when using --mine or --miner.

panic: ethash (pow) sealing not supported any more

panic: ethash (pow) sealing not supported any more

When I initialized genesisi.json using the copied ./geth instead of .build/bin/geth, it worked fine, but geth.ipc was not displayed.

DEBUG[01-07|15:13:20.451] IPCs registered                          namespaces=admin,debug,web3,eth,txpool,clique,miner,net,engine
(libos_epoll.c:368:do_epoll_add) [P1:T1:geth] debug: epoll: added 69 (0x3fc721018) to epoll handle 0x3fcfe21c8
INFO [01-07|15:13:20.451] IPC endpoint opened                      url=/go-ethereum/geth-network/miner/geth.ipc
DEBUG[01-07|15:13:20.451] Allowed origin(s) for WS RPC interface [http://localhost http://sgx-test] 
INFO [01-07|15:13:20.452] Loaded JWT secret file                   path=/etc/jwt.hex crc32=0xf0cc454b
DEBUG[01-07|15:13:20.452] Allowed origin(s) for WS RPC interface [localhost] 
(libos_epoll.c:368:do_epoll_add) [P1:T1:geth] debug: epoll: added 70 (0x3fc721478) to epoll handle 0x3fcfe21c8
INFO [01-07|15:13:20.452] HTTP server started                      endpoint=[::]:8552 auth=false prefix= cors=* vhosts=localhost
(libos_epoll.c:368:do_epoll_add) [P1:T1:geth] debug: epoll: added 71 (0x3fc7216a8) to epoll handle 0x3fcfe21c8
INFO [01-07|15:13:20.452] WebSocket enabled                        url=ws://127.0.0.1:8546
(libos_epoll.c:368:do_epoll_add) [P1:T1:geth] debug: epoll: added 72 (0x3fc7218d8) to epoll handle 0x3fcfe21c8
INFO [01-07|15:13:20.453] WebSocket enabled                        url=ws://[::]:8553
INFO [01-07|15:13:20.453] HTTP server started                      endpoint=[::]:8553 auth=true  prefix= cors=localhost vhosts=*
DEBUG[01-07|15:13:20.456] TCP listener up                          addr=[::]:30305

IPC endpoint appears to remain open:

INFO [01-07|15:13:20.451] IPC endpoint opened url=/go-ethereum/geth-network/miner/geth.ipc

It seems that geth.ipc cannot be executed when running the geth client within sgx. I worked around it by indirectly using JSON-RPC instead.

The IPC endpoint is mounted in gramines tmpfs, which resides in SGX encrypted memory and not avaiilable to the host. If you want to access the IPC endpoint, you need to mount that file as an untrusted file on the host.