There are a dozen of global variables introduced in the enclave. We should aim to reduce these globabl variables to a minimum, mitigating the risk of improper handling of them. One way to reduce them would be to combine some to one variable only (if the access of the variable allows that).
There are a dozen of global variables introduced in the enclave. We should aim to reduce these globabl variables to a minimum, mitigating the risk of improper handling of them. One way to reduce them would be to combine some to one variable only (if the access of the variable allows that).
We're currently using global variables for: https://github.com/Polkadex-Substrate/polkadexTEE-worker/blob/310dbc5072a0acfcdc96d7d479b930531cae7987/enclave/src/channel_storage.rs#L29-L32 https://github.com/Polkadex-Substrate/polkadexTEE-worker/blob/310dbc5072a0acfcdc96d7d479b930531cae7987/enclave/src/nonce_handler.rs#L26 https://github.com/Polkadex-Substrate/polkadexTEE-worker/blob/310dbc5072a0acfcdc96d7d479b930531cae7987/enclave/src/polkadex_orderbook_storage.rs#L36 https://github.com/Polkadex-Substrate/polkadexTEE-worker/blob/310dbc5072a0acfcdc96d7d479b930531cae7987/enclave/src/polkadex_cache/cancel_order_cache.rs#L27 https://github.com/Polkadex-Substrate/polkadexTEE-worker/blob/310dbc5072a0acfcdc96d7d479b930531cae7987/enclave/src/polkadex_cache/create_order_cache.rs#L27 https://github.com/Polkadex-Substrate/polkadexTEE-worker/blob/310dbc5072a0acfcdc96d7d479b930531cae7987/enclave/src/polkadex_balance_storage/mod.rs#L29 https://github.com/Polkadex-Substrate/polkadexTEE-worker/blob/310dbc5072a0acfcdc96d7d479b930531cae7987/enclave/src/accounts_nonce_storage/mod.rs#L44
I think that's quite a lot..