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

feat: fhe randomness implementation #25

Merged
merged 14 commits into from
Sep 16, 2024
Merged
33 changes: 33 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
BSD 3-Clause Clear License

Copyright © 2024 ZAMA.
All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or other
materials provided with the distribution.

3. Neither the name of ZAMA nor the names of its contributors may be used to endorse
or promote products derived from this software without specific prior written permission.

NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY THIS LICENSE*.
THIS SOFTWARE IS PROVIDED BY THE ZAMA AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
ZAMA OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

*In addition to the rights carried by this license, ZAMA grants to the user a non-exclusive,
free and non-commercial license on all patents filed in its name relating to the open-source
code (the "Patents") for the sole purpose of evaluation, development, research, prototyping
and experimentation.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 3 additions & 7 deletions fhevm-engine/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion fhevm-engine/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,10 @@ sha3 = "0.10.8"
anyhow = "1.0.86"

[profile.dev.package.tfhe]
overflow-checks = false
overflow-checks = false

# for testing in release mode due to too big
# binary inside mac
[profile.release]
opt-level = "z"
lto = true

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion fhevm-engine/coprocessor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ sha3.workspace = true

[dev-dependencies]
testcontainers = "0.21"
random = "0.14.0"
rand = "0.8.5"

[build-dependencies]
tonic-build = "0.12"
5 changes: 5 additions & 0 deletions fhevm-engine/coprocessor/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ recreate_db:
$(MAKE) cleanup
$(MAKE) init_db

.PHONY: docker_compose_setup
docker_compose_setup:
$(MAKE) init_db
DATABASE_URL=postgres://postgres:[email protected]:5432/coprocessor cargo test setup_test_user -- --nocapture --ignored

.PHONY: clean_run
clean_run:
$(MAKE) recreate_db
Expand Down
10 changes: 10 additions & 0 deletions fhevm-engine/coprocessor/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,20 @@ services:
- DATABASE_URL=postgresql://postgres:postgres@db:5432/coprocessor
ports:
- '50051:50051'
volumes:
- ${PWD}/coprocessor.key:/usr/share/coprocessor.key
command:
- --run-bg-worker
- --run-server
- --server-addr=0.0.0.0:50051
- --coprocessor-key=/usr/share/coprocessor.key
geth:
image: custom-devnet:v1
environment:
- FHEVM_COPROCESSOR_API_KEY=a1503fb6-d79b-4e9e-826d-44cf262f3e05
- FHEVM_COPROCESSOR_URL=coproc:50051
ports:
- '8545:8545'
volumes:
db:
driver: local

This file was deleted.

Loading