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

Bangkok #6

Draft
wants to merge 80 commits into
base: main
Choose a base branch
from
Draft

Bangkok #6

wants to merge 80 commits into from

Conversation

silasdavis
Copy link

No description provided.

yuxizama and others added 30 commits September 2, 2024 16:14
Updated upgrades plugin and made mocked mode working when changing .env
feat: set null FHE gas prices +  remove Payment lib
chore: refactored transient storage cleanup

chore: fixed input verifier revert message
feat: moved input KMS sig checking in KMSVerifier
feat: use dynamic lists in fhevmjsMocked
feat: finalized InputVerifier for native version

chore: fixed native test

chore: fixed index

chore: removed hardhat console import
chore: cleanup README

feat: add option to pass addresses for kms signers instead of private keys

chore: typo and cleanup in sh script
feat: use fhevm deployer private key for deployment
jatZama and others added 30 commits October 8, 2024 17:25
feat: adds getter functions for address constants
Adding templates for easier handling of customer support
feat: splits launch-fhevm.sh in 2 scripts
chore: updates fhevmjs and fhevmjsMocked to v0.6
chore: eq-neq  bool support and bitwise scalar support

chore: overloads for fheEq and fheNe

fix: reverts onchain when rhs is 0 in fheDiv-fheRem

feat: added support for scalar and,or,xor

chore: cleanup codegen

feat: adds euint128 and euint256 types

chore: removes ebool fheRandBounded and adds manual tests

feat: adds new types for fheRand

feat: adds trivialEncrypt for ebytesXXX

feat: adds fheEq fheNe ifThenElse for new types

chore: rename asyncDecrypt() to initGateway()
feat: updated TFHEExecutor to support new types
* fix: use gateway addr from parsedEnv

* fix: load relayer priv key only in mock
chore: fixed typo initializing relayer
Also improved a few bits of config

Signed-off-by: Silas Davis <[email protected]>
* feat: Make FHEVM use FHEVMConfig rather than hardcoded addresses

This all feels a bit contorted, but trying to maintain compatibility
with the existing structure that uses assembly code to house an
FHEVMConfig within the storage of TFHEExecutor.

The idea is to make this config object the source of truth. Since there
is a circular dependency between ACL and TFHEExecutor we need to pass a
TFHEExecutor into ACL, and then later call Impl.setFHEVM to doubly link
them.

I'm not sure this is how I'd build it from the ground up but I'm hoping
keeping things close to how they are will make future upgrades easier.

In principle the code should maintain its current behaviour when not
configured, however to configure custom addresses the flow should be
something like:

1. Deploy `TFHEExecutor tfheExecutor` (an `IFHEVMProvider`)
2. Deploy `ACL acl`
3. Call `acl.setFHEVMProvider(tfheExecutor)`
4. Deploy `IFHEPayment payment`
5. Deploy `IKMSVerifier kmsVerifier`
6. Deploy `IInputVerifier inputVerifier`
7. Call `tfheExecutor.setFHEVM({ tfheExecutor, acl, payment,
   kmsVerifier, inputVerifier}) (in `Impl.sol` - completing the closure
   of the circular dependency between `TFHEExecutor` and `ACL`)
8. Deploy `GatewayContract.sol gateway`
9. Call `gateway.setFHEVMProvider(tfheExecutor)

Then cross your fingers I guess...

Signed-off-by: Silas Davis <[email protected]>

* fix: compile errors and bash on NixOS

Signed-off-by: Silas Davis <[email protected]>

* chore: prettier test

Signed-off-by: Silas Davis <[email protected]>

* fix: match codegen with TFHE.sol and Payment.sol

Signed-off-by: Silas Davis <[email protected]>

---------

Signed-off-by: Silas Davis <[email protected]>
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

Successfully merging this pull request may close these issues.

6 participants