Closed haerdib closed 2 years ago
We can currently not switch to the unbound TCS policy, because futures::executor::block_on()
actively uses the TLS (thread local storage).
If we get rid of the block_on() I believe we should be able to switch: https://github.com/integritee-network/worker/blob/79aa3a8be5a4bb354ca31567c21627611b644365/sidechain/rpc-handler/src/direct_top_pool_api.rs#L145
Is this an implementation/ futures
crate specific requirement (or can there be other implementations that don't have this requirement)? Because as long as we have async
/await
parts in our enclave code (like the top pool for instance), we will need a way to execute a future (like futures::executor::block_on()
does)
I have not investigated further there, as it's currently not necessary to switch the TCS Policy. Additionally, the executor
part of futures
already seems outdated. futures-sgx
has simply stalled as v3.0.8. So I think an update should come before the investigation part.
With https://github.com/integritee-network/worker/pull/938 we are now actively using thread local storage, so we need our TCS policy to be on 0. Closing this for now.
Our TCSPolicy in the Enclave Config
<TCSPolicy>0</TCSPolicy>
should be updated, as previously set to 0 as default, is now set to 1 according to Intel. If it's 0, the following holds true:That does not seem necessary and might cause TCS problems in the future.
Thanks to @Kailai-Wang for pointing this out.