Skip to content

worker-config doesn't work in enclave-runtime #1206

@ziming-zung

Description

@ziming-zung

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

Metadata

Metadata

Assignees

Labels

D2-bugSomething isn't workingI3-highshould be completed within 5 working days

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions