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

Fix solidity tests and ensure tests are run and that we can merge in main #67

Merged
merged 47 commits into from
Sep 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
5fe19ff
feat: add incremental merkle tree
auryn-macmillan Aug 23, 2024
7c2eadf
Feat: BinaryIMT
auryn-macmillan Aug 27, 2024
456ff18
feat: use LeanIMT, rather than BinaryIMT.
auryn-macmillan Aug 27, 2024
b2c946e
fix: deploy Poseidon
auryn-macmillan Aug 29, 2024
f58cdd0
fix: update comment
auryn-macmillan Aug 29, 2024
2b62c35
fix: explicitly set types for hash inputs
auryn-macmillan Aug 29, 2024
04f8116
fix: delete commented out code
auryn-macmillan Aug 29, 2024
4b60423
feat: add `getInputRoot()` to `IEnclave.sol`
auryn-macmillan Aug 29, 2024
5bd660a
fix: swap computationModule for outputVerifier
auryn-macmillan Aug 29, 2024
627d0f8
feat: replace keccak256 with Poseidon hash
auryn-macmillan Aug 29, 2024
4904316
fix: remove redundant abi encoding
auryn-macmillan Aug 29, 2024
e1bee16
fix: test that I broke in the last commit.
auryn-macmillan Aug 29, 2024
4578905
fix: broken test
auryn-macmillan Sep 2, 2024
6d09a1b
fix: appease the linter
auryn-macmillan Sep 2, 2024
be4cca8
Merge pull request #37 from gnosisguild/merkle-inputs
auryn-macmillan Sep 2, 2024
f298486
add: first pass at renaming things
auryn-macmillan Sep 4, 2024
48d5932
add: bump solhint verstion
auryn-macmillan Sep 4, 2024
0750677
add: global `compile` and `test` commands
auryn-macmillan Sep 4, 2024
e46e58b
chore: bump solidity version
auryn-macmillan Sep 4, 2024
1ec49f6
chore: rename OutputVerifier to DycryptionVerifier
auryn-macmillan Sep 4, 2024
cfda103
Merge pull request #39 from gnosisguild/update-language
auryn-macmillan Sep 4, 2024
fce8520
feat: update sequence diagram
auryn-macmillan Sep 4, 2024
b403e83
Merge pull request #40 from gnosisguild:auryn/update-readme
auryn-macmillan Sep 4, 2024
14b6d4d
fix: computationModule -> e3Program
auryn-macmillan Sep 4, 2024
b8f9658
Merge pull request #41 from gnosisguild/update-language
auryn-macmillan Sep 4, 2024
bb08876
feat: emit seed and params
auryn-macmillan Sep 4, 2024
d253bc5
Merge pull request #42 from gnosisguild:auryn/emit-seed-and-params
auryn-macmillan Sep 4, 2024
f6a01b2
feat: add `e3Id` and `seed` to `validate()` calls to `IE3Program` and…
auryn-macmillan Sep 5, 2024
2104514
Merge pull request #43 from gnosisguild:auryn/add-e3id-and-params-to-…
auryn-macmillan Sep 5, 2024
6305380
feat: store ciphernode in an incremental merkle tree
auryn-macmillan Sep 5, 2024
01a7b6b
feat: make roots easily accessible
auryn-macmillan Sep 5, 2024
5a27c0e
Merge pull request #44 from gnosisguild:auryn/ciphernode-merkle-tree
auryn-macmillan Sep 5, 2024
b930596
add deploy script for deploying contracts, and setting registry address
samepant Sep 10, 2024
cf0e93c
add filter contract to deploy script
samepant Sep 10, 2024
f1b1038
remove vestigial deploy script
samepant Sep 13, 2024
b3c87d1
keep deployments in git
samepant Sep 13, 2024
ccce031
update readme
samepant Sep 13, 2024
6df113f
ignore DS_STORE
samepant Sep 13, 2024
2c5f314
update packages to fix yarn error
samepant Sep 13, 2024
fb0fe39
Merge pull request #52 from gnosisguild/deploy-cleanup
samepant Sep 13, 2024
1e90b10
Merge branch 'main' into ciphernode_poc
ryardley Sep 14, 2024
ea93c90
Fix linting issues
ryardley Sep 14, 2024
e95ed8d
Remove task as enclave does not exist
ryardley Sep 14, 2024
aaeb657
Allow typechain to be run without env vars
ryardley Sep 14, 2024
dacfb36
Formatting
ryardley Sep 14, 2024
2b9431c
Enable tests to run
ryardley Sep 14, 2024
f6d89bd
Formatting
ryardley Sep 14, 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
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ node_modules


# ciphernode
target
target

*.DS_Store
81 changes: 39 additions & 42 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,49 +17,46 @@ Enclave employs a modular architecture involving numerous actors and participant

```mermaid
sequenceDiagram
actor Requester
actor Data Providers
participant Users
participant Enclave
participant Ciphernode Registry
participant Ciphernodes
participant Computation Module
participant Execution Module

loop Each computation request
Requester ->> Enclave: Request computation
activate Enclave
Enclave ->> Ciphernode Registry: Select Committee
activate Ciphernode Registry
Ciphernode Registry -->> Ciphernodes: Key Setup
activate Ciphernodes
Ciphernodes -->> Ciphernode Registry: Publish shared keys
deactivate Ciphernodes
Ciphernode Registry -->> Enclave: Publish Committee
deactivate Ciphernode Registry

loop Each input
Data Providers ->> Enclave: Publish inputs
Enclave ->> Computation Module: Validate inputs
activate Computation Module
Computation Module -->> Enclave: 👌
deactivate Computation Module
end

Enclave ->> Execution Module: Request execution
activate Execution Module
Execution Module -->> Enclave: Publish ciphertext output
deactivate Execution Module

Enclave -->> Ciphernodes: Request plaintext output
activate Ciphernodes
Ciphernodes ->> Enclave: Publish plaintext output
deactivate Ciphernodes

Requester -->> Enclave: Get plaintext
Enclave -->> Requester: Returns plaintext
deactivate Enclave
end

participant CiphernodeRegistry
participant E3Program
participant ComputeProvider
participant InputValidator
participant DecryptionVerifier

Users->>Enclave: request(parameters)
Enclave->>E3Program: validate(e3ProgramParams)
E3Program-->>Enclave: inputValidator
Enclave->>ComputeProvider: validate(computeProviderParams)
ComputeProvider-->>Enclave: decryptionVerifier
Enclave->>CiphernodeRegistry: requestCommittee(e3Id, filter, threshold)
CiphernodeRegistry-->>Enclave: success
Enclave-->>Users: e3Id, E3 struct

Users->>Enclave: activate(e3Id)
Enclave->>CiphernodeRegistry: committeePublicKey(e3Id)
CiphernodeRegistry-->>Enclave: publicKey
Enclave->>Enclave: Set expiration and committeePublicKey
Enclave-->>Users: success

Users->>Enclave: publishInput(e3Id, data)
Enclave->>InputValidator: validate(msg.sender, data)
InputValidator-->>Enclave: input, success
Enclave->>Enclave: Store input
Enclave-->>Users: success

Users->>Enclave: publishCiphertextOutput(e3Id, data)
Enclave->>DecryptionVerifier: verify(e3Id, data)
DecryptionVerifier-->>Enclave: output, success
Enclave->>Enclave: Store ciphertextOutput
Enclave-->>Users: success

Users->>Enclave: publishPlaintextOutput(e3Id, data)
Enclave->>E3Program: verify(e3Id, data)
E3Program-->>Enclave: output, success
Enclave->>Enclave: Store plaintextOutput
Enclave-->>Users: success
```

## Security and Liability
Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@
},
"scripts": {
"clean": "cd packages/evm && yarn clean",
"compile": "yarn evm:compile",
"compile": "yarn evm:compile && yarn ciphernode:build",
"lint": "yarn evm:lint",
"typechain": "yarn evm:typechain",
"test": "yarn evm:test",
"test": "yarn evm:test && yarn ciphernode:test",
"coverage": "yarn evm:coverage",
"ciphernode:test": "cd packages/ciphernode && cargo test",
"ciphernode:build": "cd packages/ciphernode && cargo build --release",
"evm:install": "cd packages/evm && yarn install",
"evm:compile": "cd packages/evm && yarn compile",
"evm:lint": "cd packages/evm && yarn lint",
Expand Down
4 changes: 4 additions & 0 deletions packages/evm/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
MNEMONIC=
INFURA_KEY=

ETHERSCAN_API_KEY=
1 change: 0 additions & 1 deletion packages/evm/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ coverage
dist
node_modules
types
deployments

# files
*.env
Expand Down
2 changes: 1 addition & 1 deletion packages/evm/.prettierrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ trailingComma: "all"
overrides:
- files: "*.sol"
options:
compiler: "0.8.26"
compiler: "0.8.27"
parser: "solidity-parse"
tabWidth: 4
- files: "*.ts"
Expand Down
2 changes: 1 addition & 1 deletion packages/evm/.solhint.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"plugins": ["prettier"],
"rules": {
"code-complexity": ["error", 8],
"compiler-version": ["error", ">=0.8.26"],
"compiler-version": ["error", ">=0.8.27"],
"func-visibility": ["error", { "ignoreConstructors": true }],
"max-line-length": ["error", 120],
"named-parameters-mapping": "warn",
Expand Down
12 changes: 12 additions & 0 deletions packages/evm/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Enclave EVM

## To deploy

```
yarn deploy --network [network]
```

This will add the deployment information to the `./deployments` directory.

Be sure to configure your desired network in `hardhat.config.ts` before
deploying.
Loading
Loading