Skip to content

feat(host-contracts): introduce coprocessor contexts logic#875

Closed
isaacdecoded wants to merge 15 commits intofeat/coprocessor_contexts_in_gatewayfrom
isaac/112/feat/add-support-for-copro-context-in-inputverifier
Closed

feat(host-contracts): introduce coprocessor contexts logic#875
isaacdecoded wants to merge 15 commits intofeat/coprocessor_contexts_in_gatewayfrom
isaac/112/feat/add-support-for-copro-context-in-inputverifier

Conversation

@isaacdecoded
Copy link
Copy Markdown
Contributor

@isaacdecoded isaacdecoded commented Sep 18, 2025

This PR introduces two types of coprocessor contexts into the InputVerifier contract: active and suspended. The active context is always present and initialized during the contract deployment. The suspended one is always the contextId being replaced when calling the addNewContextAndSuspendCurrentOne, and it could be "removed" by setting it into a deactivated state.

On the other hand, the signers set is now retrieved based on a given coprocessorContextId, which must match the currently stored active or suspended contexts.

Closes https://github.com/zama-ai/fhevm-internal/issues/112

@cla-bot cla-bot bot added the cla-signed label Sep 18, 2025
@isaacdecoded isaacdecoded force-pushed the isaac/112/feat/add-support-for-copro-context-in-inputverifier branch from 9e66fa1 to 35e30cc Compare October 2, 2025 15:29
@isaacdecoded isaacdecoded marked this pull request as ready for review October 3, 2025 07:59
@isaacdecoded isaacdecoded force-pushed the isaac/112/feat/add-support-for-copro-context-in-inputverifier branch from 6a7d736 to 89f17d7 Compare October 6, 2025 08:54
Copy link
Copy Markdown
Contributor

@melanciani melanciani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great !! made several comments, mostly to align the logic and names with what has been done in the gateway PR !

@dartdart26 dartdart26 force-pushed the feat/coprocessor_contexts_in_gateway branch from 29b4ec8 to 0bb20fb Compare October 9, 2025 15:33
@melanciani melanciani force-pushed the feat/coprocessor_contexts_in_gateway branch from 0bb20fb to 390c08a Compare October 9, 2025 15:52
@melanciani melanciani force-pushed the isaac/112/feat/add-support-for-copro-context-in-inputverifier branch from 3101161 to d9253bd Compare October 10, 2025 16:59
}

// Activate the initial context.
_activateContext(1, initialCoprocessorSigners);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no this is wrong : someone might deploy the contract one day in the future and the contextId might be much greater in the gateway : the contextId should be an input to initializeFromEmptyProxy

only reinitializeV2 should not consider it, as it will be used only to upgrade the preivous version (without context) to the new one (so with initial context)

Copy link
Copy Markdown
Contributor

@melanciani melanciani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great work ! have one request changes that needs to be addressed

@isaacdecoded
Copy link
Copy Markdown
Contributor Author

Outdated implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants