Skip to content

Commit 91b8187

Browse files
authored
Merge pull request #46 from enigmampc/lacabra-patch-1
DOC: documenting future work for the enclave
2 parents a77a173 + 0d77058 commit 91b8187

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

enclave/README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,20 @@ This folder contains the code that runs inside the enclave using Intel Secure Gu
4646
./safetrace-app
4747
```
4848

49-
## ToDo
49+
## Future Work
50+
51+
This section documents some of the limitations of the current implementation, and covers some areas of future work.
52+
53+
* The amount of data that the enclave is capable of storing encrypted (through a process known as [sealing and unsealing](https://software.intel.com/en-us/blogs/2016/05/04/introduction-to-intel-sgx-sealing) is currently limited to 4kB. This is obviously not limited by disk space, but by the fact that the amount of data to seal/unseal needs to fit inside the enclave memory. Intel SGX documentation states that the enclave limit is 4GB, which should be tested for this particular application. The current limit is controlled by `SEAL_LOG_SIZE` in [enclave/src/data.rs] around Line 25. This value needs to at most equal to `HeapMaxSize` defined in [enclave/Enclave.config.xml]
54+
55+
* Enclave data is serialized for sealing/unsealing using JSON format, which is highly inefficient in terms of space. This should be improved using a binary format such as CBOR. The correct library `serde-cbor` that is SGX compatible should be identified and used, the code adjusted to use that. Data is JSON_serialized in [enclave/src/data.rs] in the first line of `create_sealeddata_for_serializable()`, and later deserialized in the last line of `recover_sealeddata_for_serializable()`.
56+
57+
* Error handling needs much improvement, as most functions inside the enclave will return success regardless of whether the fail or succeed. This obviously makes it hard to debug and troubleshoot. The developer team at Enigma is working on the right infrastructure for error handling with **enigmampc/EnigmaBlockchain**. Once that work is completed, it should be straightforward to be ported to this repo.
58+
59+
* Data is overwritten each time a user submits data - this can be improved but is hard. Currently user data is stored inside the enclave as a Rust [HashMap](https://doc.rust-lang.org/std/collections/struct.HashMap.html) indexed by the `userId` as its key, and the array of locations as its associated data. so everytime a new dataset is added to HashMap overwrites whatever prior entry was there for that key. Improving on this is hard because one would need to find data overlaps in terms of space and time with prior entries and do a proper merge.
60+
61+
* Data is not deleted after two weeks - this is easy to implement. This requires another end point that only the server would call on a daily basis (setup a cronjob) to delete old data. This endpoint would **not** be made available at the JSON RPC server so that could only be called internally.
62+
63+
* Document how to decode and interpred the Remote Attestation report. This is more of a task at the `client` end, but because all the information comes from SGX, it is included here.
5064
5165
* Sign code and deploy

0 commit comments

Comments
 (0)