Skip to content

Commit

Permalink
Aztec.js and AztecRPCServer. (#80)
Browse files Browse the repository at this point in the history
* Update e2e test.

* Aztec.js and AztecRPCServer. (#67)

* Add ContractDeployer.

* Add aztec-rpc, remove wallet.

* Initial Aztec RPC Server.

* Use pre-generated abi in e2e.

* Update yarn.lock.

* Use aztec-node in aztec-rpc.

* Update dockerfiles.

* Fix dependencies.

* Update dockerfile.

* Update build manifest.

* Cleanup.

* Interface changes.

* Fix.

* Fix.

* Update eslintrc source.

* feat(sim): added skeleton of simulators to the aztec rpc server (#73)

* feat(acir): added skeleton for acir sim

* feat(sim): use callstackitem

* feat(sim): kernel prover skeleton

* merge milestone/1_1 into arv/simulators

* feat(sim): integrate sim skeleton with rpc

* refactor: remove unused comments

* chore: global skipLibCheck

* Revert "chore: global skipLibCheck"

This reverts commit fe27427.

* chore: renamed kernel-simulator to kernel-prover

* feat(rpc): fetch acir and portal from DB

* fix(prover): pass signature to kernel

* chore: added build of deps

* chore: fixed  dockerfile

* chore: master => milestone1-1 (#78)

* Working Aztec Node (#76)

* Init sequencer client

* Update circuits to "TS structs for merge and root rollups structs"

See AztecProtocol/aztec3-circuits#81

* Symlink circuits/ts into yarn-project

* Fix archiver main

* Expose p2p client state and fix typo

* Rename aztec-ethereumjs-tx-sender

* Sequencer client wip

* Include full output of private kernel circuit in p2p pool txs

* Remove hardcoded deps and block builder (wip)

* Update circuits to palla/aztec3-packages branch

* Update l1-contracts

* Update sequencer to use new method names

* Update archiver to use current l1 contract abi

* Add archiver integration test

* Update circuits package

* Update yarn.lock

* Lose lastBlock view method in rollup contract and remove syncStatus from archiver in favor of latestBlockNum

* Archiver TODOs for when we move to mainnet

* Update rollup contract to latest

* Fix archiver test

* WIP

* Use components and serialization from circuits package for L2Block

* WIP

* WIP

* Format archiver

* Check consistency of block number in block parsed from calldata

* Make linter happy

* Format

* WIP

* Add missing reference

* WIP

* WIP

* Move references in archiver to base tsconfig

* Add formatting:fix tasks here and there

* Fix build issues

* WIP

* WIP

* WIP

* Fix build issues on integration test and move to separate folder

* WIP

* WIP

* Update rollup contract to handle blocks with id 0

* Fix settled block num in integration test

* Use aztec debug logger and add inspect method for L2block

* Fix bug in block builder due to bad ordering of ctor args

* Stop sequencer when aztec node stops

* Add integration test for processing 3 txs

* Apply changes to all trees on world state synchroniser

* Formatting

* Working Aztec Node

* Minor refactor

* Lint fix

* Yarn lockfile

* Merge fixes

* Project references

* Build order

* Docker file

* Test rename

* Test logging

* fix: build (attempt)

* fix: build (attempt)

* fix: build (attempt)

* fix: build (attempt)

* fix: build (attempt)

* fix: build (attempt)

* fix: build (attempt)

* fix: build (attempt)

* fix: build (attempt)

* fix: build by refactoring .yalc usage

* fix: build by refactoring .yalc usage

* Revert l1-contracts

* Update Dockerfile

* Update circuits

* Update circuits

* fix: circuits.js ref

* fix: misc build

---------

Co-authored-by: Santiago Palladino <[email protected]>
Co-authored-by: Adam Domurad <[email protected]>
Co-authored-by: ludamad <[email protected]>
Co-authored-by: ludamad <[email protected]>

* post-merge

* post-merge

* post-merge

* post-merge

---------

Co-authored-by: PhilWindle <[email protected]>
Co-authored-by: Santiago Palladino <[email protected]>
Co-authored-by: Adam Domurad <[email protected]>

* Fix merge.

* Remove formatting from build script.

* Mark contract as deployed when block is settled.

* Update ts ref.

* Revert test.

* Update build manifest.

* Fix.

* Fix.

* Empty test.

---------

Co-authored-by: Álvaro Rodríguez <[email protected]>
Co-authored-by: ludamad <[email protected]>
Co-authored-by: PhilWindle <[email protected]>
Co-authored-by: Santiago Palladino <[email protected]>
Co-authored-by: Adam Domurad <[email protected]>
  • Loading branch information
6 people authored Mar 26, 2023
1 parent 01ce107 commit 4a5238e
Show file tree
Hide file tree
Showing 97 changed files with 1,928 additions and 147 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ The Aztec 3 system consists of the following sub projects.
- `acir-simulator`
- `archiver`
- `aztec-cli`
- `aztec-rpc`
- `aztec.js`
- `ethereum.js`
- `kernel-simulator`
- `kernel-prover`
- `key-store`
- `l1-contracts`
- `p2p`
- `prover-client`
- `aztec-node`
- `sequencer-client`
- `wallet`
17 changes: 7 additions & 10 deletions bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,23 +47,20 @@ cd ../..

# We only bootstrap projects that produce artefacts needed for running end-to-end tests.
PROJECTS=(
# "circuits:./bootstrap.sh db_cli rollup_cli"
# "yarn-project/acir-simulator:yarn build"
# "yarn-project/aztec-cli:yarn build"
"yarn-project/foundation:yarn build"
"yarn-project/l1-contracts:yarn build"
"yarn-project/aztec.js:yarn build"
"yarn-project/ethereum.js:yarn build"
"yarn-project/archiver:yarn build"
# "yarn-project/kernel-simulator:yarn build"
"yarn-project/key-store:yarn build"
"yarn-project/merkle-tree:yarn build"
"yarn-project/p2p:yarn build"
# "yarn-project/prover-client:yarn build"
# "yarn-project/wallet:yarn build"
"yarn-project/archiver:yarn build"
"yarn-project/world-state:yarn build"
"yarn-project/p2p:yarn build"
"yarn-project/sequencer-client:yarn build"
"yarn-project/aztec-node:yarn build"
"yarn-project/key-store:yarn build"
"yarn-project/acir-simulator:yarn build"
"yarn-project/kernel-prover:yarn build"
"yarn-project/aztec-rpc:yarn build"
"yarn-project/aztec.js:yarn build"
)

for E in "${PROJECTS[@]}"; do
Expand Down
45 changes: 22 additions & 23 deletions build_manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,21 +57,28 @@
"projectDir": "yarn-project/aztec-cli",
"dockerfile": "aztec-cli/Dockerfile",
"rebuildPatterns": ["^yarn-project/aztec-cli/"],
"dependencies": ["yarn-project-base"]
"dependencies": ["aztec.js"]
},
"aztec-rpc": {
"buildDir": "yarn-project",
"projectDir": "yarn-project/aztec-rpc",
"dockerfile": "aztec-rpc/Dockerfile",
"rebuildPatterns": ["^yarn-project/aztec-rpc/"],
"dependencies": ["aztec-node"]
},
"aztec.js": {
"buildDir": "yarn-project",
"projectDir": "yarn-project/aztec.js",
"dockerfile": "aztec.js/Dockerfile",
"rebuildPatterns": ["^yarn-project/aztec.js/"],
"dependencies": ["yarn-project-base", "foundation"]
"dependencies": ["aztec-rpc"]
},
"end-to-end": {
"buildDir": "yarn-project",
"projectDir": "yarn-project/end-to-end",
"dockerfile": "end-to-end/Dockerfile",
"rebuildPatterns": ["^yarn-project/end-to-end/"],
"dependencies": ["yarn-project-base", "foundation"]
"dependencies": ["aztec.js"]
},
"ethereum.js": {
"buildDir": "yarn-project",
Expand All @@ -80,11 +87,18 @@
"rebuildPatterns": ["^yarn-project/ethereum.js/"],
"dependencies": ["yarn-project-base", "foundation"]
},
"kernel-simulator": {
"foundation": {
"buildDir": "yarn-project",
"projectDir": "yarn-project/foundation",
"dockerfile": "foundation/Dockerfile",
"rebuildPatterns": ["^yarn-project/foundation/"],
"dependencies": []
},
"kernel-prover": {
"buildDir": "yarn-project",
"projectDir": "yarn-project/kernel-simulator",
"dockerfile": "kernel-simulator/Dockerfile",
"rebuildPatterns": ["^yarn-project/kernel-simulator/"],
"projectDir": "yarn-project/kernel-prover",
"dockerfile": "kernel-prover/Dockerfile",
"rebuildPatterns": ["^yarn-project/kernel-prover/"],
"dependencies": ["yarn-project-base"]
},
"key-store": {
Expand All @@ -94,13 +108,6 @@
"rebuildPatterns": ["^yarn-project/key-store/"],
"dependencies": ["yarn-project-base"]
},
"foundation": {
"buildDir": "yarn-project",
"projectDir": "yarn-project/foundation",
"dockerfile": "foundation/Dockerfile",
"rebuildPatterns": ["^yarn-project/foundation/"],
"dependencies": ["yarn-project-base"]
},
"merkle-tree": {
"buildDir": "yarn-project",
"projectDir": "yarn-project/merkle-tree",
Expand Down Expand Up @@ -140,8 +147,7 @@
"world-state",
"p2p",
"sequencer-client",
"ethereum.js",
"circuits.js"
"ethereum.js"
]
},
"sequencer-client": {
Expand All @@ -157,13 +163,6 @@
"archiver"
]
},
"wallet": {
"buildDir": "yarn-project",
"projectDir": "yarn-project/wallet",
"dockerfile": "wallet/Dockerfile",
"rebuildPatterns": ["^yarn-project/wallet/"],
"dependencies": ["yarn-project-base"]
},
"world-state": {
"buildDir": "yarn-project",
"projectDir": "yarn-project/world-state",
Expand Down
4 changes: 2 additions & 2 deletions build_manifest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ PROJECTS=(
# acir-simulator:yarn-project
# archiver:yarn-project
# aztec-cli:yarn-project
# aztec-rpc:yarn-project
# aztec.js:yarn-project
# end-to-end:yarn-project
# ethereum.js:yarn-project
# kernel-simulator:yarn-project
# kernel-prover:yarn-project
# key-store:yarn-project
# merkle-tree:yarn-project
# p2p:yarn-project
# prover-client:yarn-project
# aztec-node:yarn-project
# sequencer-client:yarn-project
# wallet:yarn-project
# world-state:yarn-project
)
2 changes: 1 addition & 1 deletion l1-contracts
2 changes: 1 addition & 1 deletion yarn-project/acir-simulator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"tsconfig": "./tsconfig.dest.json"
},
"scripts": {
"build": "yarn clean && yarn formatting && tsc -b tsconfig.dest.json",
"build": "yarn clean && tsc -b tsconfig.dest.json",
"build:dev": "tsc -b tsconfig.dest.json --watch",
"clean": "rm -rf ./dest .tsbuildinfo",
"formatting": "run -T prettier --check ./src && run -T eslint --max-warnings 0 ./src",
Expand Down
31 changes: 31 additions & 0 deletions yarn-project/acir-simulator/src/acvm.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { AztecAddress, CallContext, ContractDeploymentData } from './circuits.js';
import { NoteLoadOracleInputs } from './db_oracle.js';

export interface ACIRCallback {
getSecretKey(keyId: Buffer): Promise<Buffer>;
getNotes(storageSlot: Buffer): Promise<NoteLoadOracleInputs[]>;
getRandomField(): Promise<Buffer>;
privateFunctionCall(
contractAddress: AztecAddress,
functionSelector: string,
args: Array<Buffer>,
): Promise<Array<Buffer>>;
}

export interface ExecutionPreimages {
newNotes: Buffer[];
nullifiedNotes: Buffer[];
}

export interface ACIRExecutionResult {
preimages: ExecutionPreimages;
partialWitness: Buffer;
}

export type execute = (
acir: Buffer,
args: Array<Buffer>,
callContext: CallContext,
contractDeploymentData: ContractDeploymentData,
oracle: ACIRCallback,
) => Promise<ACIRExecutionResult>;
Loading

0 comments on commit 4a5238e

Please sign in to comment.