Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove FHEPayment contract and create FHEGasLimit.sol #198

Closed
immortal-tofu opened this issue Dec 18, 2024 · 1 comment
Closed

Remove FHEPayment contract and create FHEGasLimit.sol #198

immortal-tofu opened this issue Dec 18, 2024 · 1 comment
Assignees

Comments

@immortal-tofu
Copy link
Collaborator

Payment won't be used anymore.
The idea is to remove the FHEPayment.sol and instead of create a minimized version called FHEGasLimit.sol.

This contract is not part of core components anymore, but rather an extension to call in TFHEExecutor similar to:

contract TFHEExecutorWithLimit is TFHEExecutor {
    function fheAdd(uint256 lhs, uint256 rhs, bytes1 scalarByte) public virtual override returns (uint256 result) {
        fheGasLimit.consumeGasForFheAdd(msg.sender, lhsType, scalar);
        result = super.fheAdd(lhs, rhs, scalarByte);
    }
}
@jatZama
Copy link
Member

jatZama commented Dec 23, 2024

Done in #211
With a caveat: for the moment we agreed on Slack to keep the call to FHEGasLimit by default inside the original TFHEExecutor contract. For two reasons:
1/ it is critical to avoid DDOS attack to keep some limitation on number of FHE ops
2/ and otherwise we would have to maintain 4 versions of almost same contract: TFHEExecutor , TFHEExecutorWithLimit, TFHEExecutorWithEvents and TFHEExecutorWithEventsWithLimit.

@jatZama jatZama closed this as completed Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants