Skip to content

Commit e84d371

Browse files
authored
Merge pull request #954 from LIT-Protocol/docs/drel-1157-discord-timeout-with-decryptandcombine
docs(auth-context): add important considerations for using decryptAnd…
2 parents 14db974 + adb7690 commit e84d371

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

docs/sdk/auth-context-consumption/execute-js.mdx

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,38 @@ Unlike traditional client-side decryption, this approach ensures that sensitive
233233
</Step>
234234
</Steps>
235235

236+
#### Important Considerations
237+
238+
When using `decryptAndCombine` within your Lit Actions, there are several critical requirements and potential issues to be aware of:
239+
240+
#### Unified Access Control Conditions Required
241+
242+
<Warning>
243+
The `decryptAndCombine` function **only accepts unified access control conditions**. Standard or legacy access control condition formats are not supported.
244+
</Warning>
245+
246+
When encrypting data that you plan to decrypt within a Lit Action, ensure you use the unified access control conditions format. EVM contract conditions are supported, but they must be specified as unified access control conditions with `conditionType: "evmContract"` in the JSON structure.
247+
248+
#### Timeout Issues and Determinism
249+
250+
<Warning>
251+
**Common Cause of Timeouts**: If you experience timeouts when using `decryptAndCombine`, the most likely cause is nondeterminism in your Lit Action.
252+
</Warning>
253+
254+
For decryption to succeed, all Lit nodes must reach consensus on:
255+
- The access control conditions being evaluated
256+
- The ciphertext being decrypted
257+
- The dataToEncryptHash being validated
258+
259+
If nodes receive different values for any of these parameters, they cannot reach consensus and the operation will timeout. Common sources of nondeterminism include:
260+
261+
- **Dynamic Construction**: Building access control conditions dynamically within the Lit Action
262+
- **Variable Data**: Using timestamps, random values, or other changing data in your conditions
263+
- **External Data**: Fetching data that may differ between nodes (e.g., latest block numbers, API responses)
264+
- **Conditional Logic**: Logic that produces different results on different nodes
265+
266+
To avoid timeouts, ensure all parameters passed to `decryptAndCombine` are static and deterministic across all nodes. Pass these values via `jsParams` from the client rather than generating them within the Lit Action.
267+
236268
---
237269

238270
### ⚡️ Getting Chain RPC URLs Example

0 commit comments

Comments
 (0)