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

General improvements for all core contracts #191

Open
jatZama opened this issue Dec 13, 2024 · 2 comments
Open

General improvements for all core contracts #191

jatZama opened this issue Dec 13, 2024 · 2 comments
Assignees

Comments

@jatZama
Copy link
Member

jatZama commented Dec 13, 2024

Non exhaustive list of general improvements:

  • Natspecs improvements.
  • Should we keep TFHEExecutor without events the default version? This is good to save around 5% gas, but some of our partners want to use the TFHEExecutorWithEvents as the default version, and we use this version at the moment in mocked mode to get faster mocked coprocessor (we als have a mocked for the version without events using tracing but it is 100x slower).
  • Code refactoring / best practise.
  • Use of custom errors instead of revert strings to save some gas.
  • We should also add more unit tests, for exemple the codegen does not sample uintXX types in good ranges for some of them.
  • Add coverage metric for core contracts testing.
  • Use Slither to get security warnings from static analysis.
  • Test different solc settings to improve gas consumption from users. It might make sense to make viaIR the default settings of the compiler to save easily 3-4% of gas for users, but this unfortunately makes the TFHEExecutor contract too big for deployment.
  • Should we merge the InputVerifier contract with ACL to save gas?
  • Should we get rid of proxies to save gas? Might be risky because upgrades will become impossible.
  • Maybe adding smart contracts fuzzing? What invariants should be asserted in our code? At least it will force us to think more deeply about security.
@PacificYield
Copy link
Contributor

PacificYield commented Dec 16, 2024

I also think that interfaces must be managed differently.

For instance, TFHEExecutor doesn't inherit ITFHEExecutor, ACL doesn't inherit IACL, etc.
It would be best to import/inherit the interfaces in TFHEExecutor, ACL, KMSVerifier.

@jatZama
Copy link
Member Author

jatZama commented Dec 19, 2024

I also think that interfaces must be managed differently.

For instance, TFHEExecutor doesn't inherit ITFHEExecutor, ACL doesn't inherit IACL, etc. It would be best to import/inherit the interfaces in TFHEExecutor, ACL, KMSVerifier.

I don't understand why would this be needed

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

4 participants