document TaskManager isEnabled / onlyIfEnabled switch#23
Draft
roeezolantz wants to merge 1 commit into
Draft
Conversation
Every state-changing FHE-op entry point and publishDecryptResult* is gated by onlyIfEnabled; owner-only enable() / disable() flip the flag and revert with CofheIsUnavailable while off. Add an Enable / Disable Switch section to the TaskManager deep dive covering the modifier, state variable, owner functions, and the client-side read path (including useCofheEnabled for React apps). Co-authored-by: multica-agent <github@multica.ai>
Contributor
|
Preview deployment for your docs. Learn more about Mintlify Previews.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The TaskManager has had a global
isEnabledflag since the v0.1.x line, gated via theonlyIfEnabledmodifier. While disabled, every state-changing FHE-op entry point andpublishDecryptResult*reverts withCofheIsUnavailable. None of this is in the deep-dive page, so apps building reactive UIs around the coprocessor can't find it.Adding this also gives the React docs (gap B-1 — separate PR) a stable target to cross-link to from
useCofheEnabled.This covers gap B-7 from the docs audit on XDL-11.
Where the underlying changes were made
isEnabledstate variable +onlyIfEnabledmodifier +enable()/disable()owner functions, plus theonlyIfEnabledgate on publish: `cofhe-contracts/contracts/internal/host-chain/contracts/TaskManager.sol#L237-L263`. TheonlyIfEnabledmodifier onpublishDecryptResult*was introduced as part of the v0.1.0 publish/verify work — cofhe-contracts CHANGELOGv0.1.0— and remains on the currentpublishDecryptResultentry points in the source above.useCofheEnabledhook added in@cofhe/react@0.5.0: cofhesdk CHANGELOG0.5.0— `09bf7c9`.Changes
deep-dive/cofhe-components/task-manager.mdxisEnabledstate variable, theonlyIfEnabledmodifier, the owner-onlyenable()/disable()functions, theCofheIsUnavailablerevert, and the client-side read pattern (including a forward reference touseCofheEnabledfor React apps).The
useCofheEnabledcross-link currently points at the React quick-start stub. Once the React docs PR (gap B-1) lands, the link can be updated to the proper hook reference page.Test plan