Context
Currently, we can specify worker-config via the flag --running-mode. See: https://github.com/litentry/litentry-parachain/blob/2371278fe9e014c4111865480b5f86d22511896a/tee-worker/service/src/main.rs#L136-L180
But I found that the settings about xxx_url didn't work when i run the test.
After digging into the code, I think the root cause is that service(untrusted env) and enclave-runtime(trusted env) don't share memory with each other. This means that the variables initialized in the service are not actually initialized in the enclave-runtime (stf_task run on the enclave-runtime).
Solution
Initialize via enclave-api. like:
https://github.com/litentry/litentry-parachain/blob/2371278fe9e014c4111865480b5f86d22511896a/tee-worker/service/src/main.rs#L483-L486
https://github.com/litentry/litentry-parachain/blob/2371278fe9e014c4111865480b5f86d22511896a/tee-worker/core-primitives/enclave-api/src/enclave_base.rs#L159-L168
Context
Currently, we can specify
worker-configvia the flag--running-mode. See: https://github.com/litentry/litentry-parachain/blob/2371278fe9e014c4111865480b5f86d22511896a/tee-worker/service/src/main.rs#L136-L180But I found that the settings about
xxx_urldidn't work when i run the test.After digging into the code, I think the root cause is that
service(untrusted env) andenclave-runtime(trusted env) don't share memory with each other. This means that the variables initialized in the service are not actually initialized in the enclave-runtime (stf_taskrun on theenclave-runtime).Solution
Initialize via
enclave-api. like:https://github.com/litentry/litentry-parachain/blob/2371278fe9e014c4111865480b5f86d22511896a/tee-worker/service/src/main.rs#L483-L486
https://github.com/litentry/litentry-parachain/blob/2371278fe9e014c4111865480b5f86d22511896a/tee-worker/core-primitives/enclave-api/src/enclave_base.rs#L159-L168