microsoft / CCF

Confidential Consortium Framework
https://microsoft.github.io/CCF/
Apache License 2.0
784 stars 213 forks source link

Support returning responses to users only after the transaction is committed #4671

Open achamayou opened 1 year ago

achamayou commented 1 year ago

CCF today returns responses as soon as they become available, before consensus has been achieved. It is then the responsibility of the user to check that they do commit eventually.

This isbeneficial on SGX where EPC/fast memory was scarce, and where max enclave sizes remain small due to startup times: freeing the response as quickly as possible is critical to keeping memory usage down.

On AMD hardware however, we could afford to keep responses on the node for longer, providing the user with the convenience of only seeing committed responses. It's worth noting that this increases somewhat the window of loss for responses as well.

heidihoward commented 1 year ago

This seems like something @jeffa5 might be interested in for LSKV, related ticket: https://github.com/microsoft/LSKV/issues/208

jeffa5 commented 1 year ago

I'd be interested in how it might be dynamically changed (configurable in the endpoint handler during execution?). I'd rather come around to the optimistic model but also understand the value of having it be toggleable for some applications that really do care about consistency.

achamayou commented 1 year ago

@jeffa5 @heidihoward this remains of interest to us, and something we are planning to do. It's also almost certainly a post-4.0 item, considering current timelines and workloads, unfortunately.