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

Crisp Integration with Enclave #19

Merged
merged 64 commits into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
eb56916
compute provider
hmzakhalid Aug 23, 2024
9488522
Update - Merkle Tree
hmzakhalid Aug 23, 2024
ef83eee
Refactor enclave server
hmzakhalid Aug 26, 2024
d0159f3
merkle tree generation with light-poseidon
hmzakhalid Aug 28, 2024
6f27a3a
Update tree depth
hmzakhalid Aug 28, 2024
3289264
add: scaffold out CRISP contracts
auryn-macmillan Aug 30, 2024
9b74eef
add: risc0 contracts
auryn-macmillan Aug 30, 2024
7fe38f9
fix: 🐍 snake case
auryn-macmillan Sep 2, 2024
be245bc
feat: add forge to `evm_base`
auryn-macmillan Sep 2, 2024
f9a7d2f
fix: add lib/ to gitignore
auryn-macmillan Sep 2, 2024
3af32fe
feat: add hardhat to risc0
auryn-macmillan Sep 2, 2024
a749c8b
fix: dependencies
auryn-macmillan Sep 2, 2024
aba5ad0
add: IComputationModule.validate now takes `uint256 seed` as a parame…
auryn-macmillan Sep 2, 2024
6c732c2
draft: parallel merkle tree
hmzakhalid Sep 3, 2024
8870ff7
update tests and add zeroes
hmzakhalid Sep 4, 2024
2e88028
Merge pull request #17 from gnosisguild/contract-module
hmzakhalid Sep 5, 2024
1ae4ee3
Merge pull request #18 from gnosisguild/server/refactor
hmzakhalid Sep 5, 2024
a57a2b2
Update logging
hmzakhalid Sep 6, 2024
4efafd3
Cfeat: server switched to actix
hmzakhalid Sep 6, 2024
c73a7e7
feat: server swictched to actix
hmzakhalid Sep 9, 2024
dd56216
feat: use compute_provider as a base for risc0
hmzakhalid Sep 10, 2024
f5f4ed9
Remove folder from tracking and update .gitignore
hmzakhalid Sep 10, 2024
6674be5
feat: start listener and relayer
hmzakhalid Sep 10, 2024
c4ef597
E3 Listener and Handler
hmzakhalid Sep 13, 2024
d5e278f
Decoded Events Successfully
hmzakhalid Sep 13, 2024
cbf935c
feat: generic compute provider, updated the routes/client & models & …
hmzakhalid Sep 16, 2024
b395e6e
Update: risc0 contracts
hmzakhalid Sep 16, 2024
47bd1f9
Added Greco input validation structure and beginner functions
Sep 17, 2024
f7bef83
feat: commit ciphertext hash inside guest and update compute provider
hmzakhalid Sep 17, 2024
769d086
Switch to LeanIMT and Keep track of Index for CT hash
hmzakhalid Sep 17, 2024
e528e1a
refactor: avoid race conditions between routes on the DB
hmzakhalid Sep 17, 2024
804d3a5
Refactored code and added new classes for greco
Sep 18, 2024
28b889f
feat: add config, param decryption and result publishing
hmzakhalid Sep 18, 2024
1d7a88f
Update Cli: Decyption and Plaintext Publish
hmzakhalid Sep 18, 2024
6f18f9a
Made interface much easier to use for greco integration
Sep 19, 2024
c0ff1c7
feat: Use Web Worker for wasm
hmzakhalid Sep 19, 2024
6da3324
Included bounds code in greco, refactored substantially
Sep 19, 2024
fe41b71
Updated greco code to newer version, added test
Sep 19, 2024
b8561e8
Fixed typo in encrypt vote test
Sep 19, 2024
49d54e3
feat: import Enclave solidity interfaces from @gnosis-guild/enclave
auryn-macmillan Sep 20, 2024
eef92eb
feat: import Enclave solidity interfaces from @gnosis-guild/enclave
auryn-macmillan Sep 20, 2024
77ec966
feat: update to enclave v0.0.3
auryn-macmillan Sep 20, 2024
a524d8e
feat: Sync Db with contracts and update deployment
hmzakhalid Sep 23, 2024
fc062e1
Fix Journal encoding
hmzakhalid Sep 24, 2024
ef34b3c
Fix Deployment & remove mock evm
hmzakhalid Sep 24, 2024
0ee6ccb
Handle Error
hmzakhalid Sep 24, 2024
9ffc89a
Use Chain ID
hmzakhalid Sep 24, 2024
af4c072
Ciphernode integration changes
hmzakhalid Oct 1, 2024
3610303
Update web-rust params to match the ciphernode setup
hmzakhalid Oct 1, 2024
42eb287
Activate e3 after committee key is published
hmzakhalid Oct 1, 2024
734cc7e
feat: e3 request cron
hmzakhalid Oct 2, 2024
110cb1e
Manually added submodules
hmzakhalid Oct 2, 2024
faf1da5
Switch submodules to specific commit
hmzakhalid Oct 2, 2024
28812e6
Update DB
hmzakhalid Oct 2, 2024
0fc27cd
Update .env.example
hmzakhalid Oct 2, 2024
fc2da49
Remove unused models
hmzakhalid Oct 2, 2024
8878492
Remove example config
hmzakhalid Oct 2, 2024
75fc659
Update Fhe Params, remove unused code and update readme
hmzakhalid Oct 3, 2024
e674e79
Add Local Testnet Readme
hmzakhalid Oct 3, 2024
b72f09a
Update Readme
hmzakhalid Oct 3, 2024
1aa2d92
Update Scripts
hmzakhalid Oct 3, 2024
63146a0
Refactor server, Naming, Remove unused code and Documentation
hmzakhalid Oct 7, 2024
174557d
specify CRISP server more clearly
samepant Oct 7, 2024
06d88d6
remove unused gh action files
samepant Oct 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 0 additions & 37 deletions .github/workflows/cla.yaml

This file was deleted.

36 changes: 0 additions & 36 deletions .github/workflows/client.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ database
*.log
.pnp.*
package-lock.json
.DS_Store
.DS_Store
12 changes: 12 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[submodule "packages/evm_base/lib/forge-std"]
path = packages/evm_base/lib/forge-std
url = https://github.com/foundry-rs/forge-std
[submodule "packages/risc0/lib/forge-std"]
path = packages/risc0/lib/forge-std
url = https://github.com/foundry-rs/forge-std
[submodule "packages/risc0/lib/openzeppelin-contracts"]
path = packages/risc0/lib/openzeppelin-contracts
url = https://github.com/OpenZeppelin/openzeppelin-contracts
[submodule "packages/risc0/lib/risc0-ethereum"]
path = packages/risc0/lib/risc0-ethereum
url = https://github.com/risc0/risc0-ethereum
89 changes: 10 additions & 79 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ CRISP/packages
│ ├── /public/ - Static files
│ ├── /src/ - React components and source code
│ └── [configuration files and README]
├── /evm/ - Ethereum Virtual Machine related code
├── /rust/ - Rust server-side logic
├── /compute_provider/ - Helper library for RISC Zero compute provider
├── /risc0/ - RISC Zero zkVM and Verifier contracts
├── /server/ - Rust server-side logic
└── /web-rust/ - Rust to WebAssembly logic
```

Expand All @@ -29,88 +30,18 @@ CRISP/packages
<img width="607" alt="image" src="https://github.com/gnosisguild/CRISP/assets/19823989/c8881fe2-1e66-4d99-9347-24e4edc91516">Ï
</p>

## Running the project locally

### Setting Up Web App

To set up the CRISP dApp in your local environment, follow these steps:

1. Clone the repository:
```sh
git clone https://github.com/gnosisguild/CRISP.git
```
2. Navigate to the `client` directory:
```sh
cd CRISP/packages/client
```
3. Install dependencies:
```sh
yarn install
```
4. Start the development server:
```sh
yarn dev
```

## Setting Up the Enclave Server

### Prerequisites

Before running the Enclave server, you must have Rust installed on your machine along with the necessary environment variables set. Follow these steps to set up your environment:

1. Install Rust:
```sh
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
```
This will install `rustup`, Rust's toolchain installer. Follow the on-screen instructions to complete the installation.

2. Add the Rust toolchain to your system's PATH:
```sh
source $HOME/.cargo/env
```

### Running the Enclave Server

Navigate to the `enclave_server` directory and run the server with:

```sh
cargo run --bin enclave_server
```

### Setting Up Cipher Nodes

Open 4 separate terminal windows for the various components.

1. In two terminals, start the cipher nodes by running:
```sh
cargo run --bin start_cipher_node
```
Wait for the `enclave_server` to be up and running before executing this command in each terminal.

2. In the last terminal, run the CLI client:
```sh
cargo run --bin cli
```

### Interacting with CRISP via CLI

Once the CLI client is running, you can interact with the CRISP voting protocol as follows:

1. Select the option `CRISP: Voting Protocol (ETH)`.

2. To start a new CRISP round, select the option `Initialize new CRISP round`.

Ensure all components are running and communicating with each other properly before initializing a new round.

Remember to provide exact paths if the `enclave_server`, `start_cipher_node`, and `cli` binaries are located in specific directories. If any specific configuration is needed in the environment files, make sure to outline what changes need to be made and where the files are located. It's also crucial to include any ports that need to be open or additional services that are required for the application to run correctly.
Check out the [README file in the `/packages/local_testnet` directory](packages/local_testnet/Readme.md) for detailed instructions on how to run the project locally.

## Contributing

We welcome and encourage community contributions to this repo. Please make sure to read the [CLA](https://github.com/gnosisguild/CLA) before contributing.
We welcome and encourage community contributions to this repository. Please ensure that you read and understand the [Contributor License Agreement (CLA)](https://github.com/gnosisguild/CLA) before submitting any contributions.

### Security and Liability
## Security and Liability

This repo is provided WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
This project is provided **WITHOUT ANY WARRANTY**; without even the implied warranty of **MERCHANTABILITY** or **FITNESS FOR A PARTICULAR PURPOSE**.

### License
## License

This repo created under the [LGPL-3.0+ license](LICENSE).
This repository is licensed under the [LGPL-3.0+ license](LICENSE).
41 changes: 0 additions & 41 deletions packages/ciphernode/Cargo.toml

This file was deleted.

5 changes: 0 additions & 5 deletions packages/ciphernode/example_ciphernode_config.json

This file was deleted.

Loading
Loading