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

Contract artifact propagation tech debt #408

Merged
merged 10 commits into from
May 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
17 changes: 3 additions & 14 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ jobs:
- *checkout
- *setup_env
- run:
name: "Build"
name: "Build and test"
command: build l1-contracts

yarn-project-base:
Expand All @@ -177,17 +177,6 @@ jobs:
name: "Build"
command: build yarn-project-base

ethereum-js:
machine:
image: ubuntu-2004:202010-01
resource_class: large
steps:
- *checkout
- *setup_env
- run:
name: "Build and test"
command: build ethereum.js

foundation:
machine:
image: ubuntu-2004:202010-01
Expand Down Expand Up @@ -441,9 +430,10 @@ workflows:
- yarn-project-base:
requires:
- circuits-wasm-linux-clang
- l1-contracts
<<: *defaults
- l1-contracts: *defaults

- ethereum-js: *yarn_project
- aztec-js: *yarn_project
- end-to-end: *yarn_project
- foundation: *yarn_project
Expand All @@ -461,7 +451,6 @@ workflows:

- e2e-join:
requires:
- ethereum-js
- aztec-js
- end-to-end
- noir-contracts
Expand Down
71 changes: 19 additions & 52 deletions build_manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,30 @@
"rebuildPatterns": [
"^l1-contracts/"
],
"dependencies": [
"ethereum.js",
"foundation"
]
"dependencies": []
},
"l1-artifacts": {
"buildDir": "yarn-project",
"projectDir": "yarn-project/l1-artifacts",
"dockerfile": "l1-artifacts/Dockerfile",
"rebuildPatterns": [
"^l1-contracts/",
"^yarn-project/l1-artifacts/"
],
"dependencies": []
},
"yarn-project-base": {
"buildDir": "yarn-project",
"dockerfile": "yarn-project-base/Dockerfile",
"rebuildPatterns": [
"^circuits/",
"^l1-contracts/",
"^yarn-project/yarn-project-base/",
"^yarn-project/yarn.lock"
],
"dependencies": [
"circuits-wasm-linux-clang"
"circuits-wasm-linux-clang",
"l1-contracts"
]
},
"acir-simulator": {
Expand All @@ -94,9 +103,8 @@
"^yarn-project/archiver/"
],
"dependencies": [
"ethereum.js",
"foundation",
"l1-contracts",
"l1-artifacts",
"types"
]
},
Expand Down Expand Up @@ -179,21 +187,10 @@
"aztec-node",
"aztec.js",
"foundation",
"l1-contracts",
"l1-artifacts",
"noir-contracts"
]
},
"ethereum.js": {
"buildDir": "yarn-project",
"projectDir": "yarn-project/ethereum.js",
"dockerfile": "ethereum.js/Dockerfile",
"rebuildPatterns": [
"^yarn-project/ethereum.js/"
],
"dependencies": [
"foundation"
]
},
"foundation": {
"buildDir": "yarn-project",
"projectDir": "yarn-project/foundation",
Expand Down Expand Up @@ -227,20 +224,6 @@
"foundation"
]
},
"l2-block": {
"buildDir": "yarn-project",
"projectDir": "yarn-project/l2-block",
"dockerfile": "l2-block/Dockerfile",
"rebuildPatterns": [
"^yarn-project/l2-block/"
],
"dependencies": [
"circuits.js",
"foundation",
"l1-contracts",
"tx"
]
},
"merkle-tree": {
"buildDir": "yarn-project",
"projectDir": "yarn-project/merkle-tree",
Expand Down Expand Up @@ -298,9 +281,8 @@
"dependencies": [
"archiver",
"barretenberg.js",
"ethereum.js",
"foundation",
"l1-contracts",
"l1-artifacts",
"merkle-tree",
"p2p",
"sequencer-client",
Expand All @@ -318,29 +300,14 @@
"dependencies": [
"acir-simulator",
"circuits.js",
"ethereum.js",
"foundation",
"l1-contracts",
"l1-artifacts",
"merkle-tree",
"p2p",
"types",
"world-state"
]
},
"tx": {
"buildDir": "yarn-project",
"projectDir": "yarn-project/tx",
"dockerfile": "tx/Dockerfile",
"rebuildPatterns": [
"^yarn-project/tx/"
],
"dependencies": [
"barretenberg.js",
"circuits.js",
"foundation",
"types"
]
},
"types": {
"buildDir": "yarn-project",
"projectDir": "yarn-project/types",
Expand All @@ -351,7 +318,7 @@
"dependencies": [
"circuits.js",
"foundation",
"l1-contracts"
"l1-artifacts"
]
},
"world-state": {
Expand Down
10 changes: 4 additions & 6 deletions l1-contracts/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,21 @@ FROM ubuntu:focal as builder
# Required for foundry
RUN apt-get update && apt install -y git curl

WORKDIR /usr/src/contracts
WORKDIR /usr/src/l1-contracts

# Install foundry
RUN git init
COPY ./scripts/install_foundry.sh ./scripts/install_foundry.sh
COPY . .
RUN ./scripts/install_foundry.sh
ENV PATH="/usr/src/contracts/.foundry/bin:${PATH}"
ENV PATH="/usr/src/l1-contracts/.foundry/bin:${PATH}"

# Install deps
RUN forge install --no-commit \
https://github.com/foundry-rs/forge-std \
https://github.com/openzeppelin/openzeppelin-contracts
ENV MAINNET_RPC_URL='https://mainnet.infura.io/v3/9928b52099854248b3a096be07a6b23c'

COPY . .

# Run build and tests
RUN forge clean && forge fmt --check && forge build && forge test

WORKDIR /usr/src/contracts
WORKDIR /usr/src/l1-contracts
2 changes: 0 additions & 2 deletions yarn-project/.prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,3 @@
node_modules/
dest/
*.md
ethereum.js/example/
ethereum.js/src/contract/fixtures/
3 changes: 1 addition & 2 deletions yarn-project/archiver/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,8 @@
"rootDir": "./src"
},
"dependencies": {
"@aztec/ethereum.js": "workspace:^",
"@aztec/foundation": "workspace:^",
"@aztec/l1-contracts": "workspace:^",
"@aztec/l1-artifacts": "workspace:^",
"@aztec/types": "workspace:^",
"debug": "^4.3.4",
"tsc-watch": "^6.0.0",
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/archiver/src/archiver/archiver.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { RollupAbi, UnverifiedDataEmitterAbi } from '@aztec/l1-contracts/viem';
import { RollupAbi, UnverifiedDataEmitterAbi } from '@aztec/l1-artifacts';
import { ContractData, ContractPublicData, EncodedContractFunction, L2Block } from '@aztec/types';
import { MockProxy, mock } from 'jest-mock-extended';
import { Chain, HttpTransport, Log, PublicClient, Transaction, encodeFunctionData, toHex } from 'viem';
Expand Down
4 changes: 2 additions & 2 deletions yarn-project/archiver/src/archiver/archiver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { RunningPromise } from '@aztec/foundation/running-promise';
import { EthAddress } from '@aztec/foundation/eth-address';
import { BufferReader } from '@aztec/foundation/serialize';
import { AztecAddress } from '@aztec/foundation/aztec-address';
import { INITIAL_L2_BLOCK_NUM } from '@aztec/l1-contracts';
import { RollupAbi, UnverifiedDataEmitterAbi } from '@aztec/l1-contracts/viem';
import { INITIAL_L2_BLOCK_NUM } from '@aztec/types';
import { RollupAbi, UnverifiedDataEmitterAbi } from '@aztec/l1-artifacts';
import {
ContractData,
ContractPublicData,
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/archiver/src/archiver/config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { EthAddress } from '@aztec/foundation/eth-address';
import { L1Addresses } from '@aztec/l1-contracts';
import { L1Addresses } from '@aztec/types';

/**
* The archiver configuration.
Expand Down
5 changes: 1 addition & 4 deletions yarn-project/archiver/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,11 @@
"tsBuildInfoFile": ".tsbuildinfo"
},
"references": [
{
"path": "../ethereum.js"
},
{
"path": "../foundation"
},
{
"path": "../l1-contracts"
"path": "../l1-artifacts"
},
{
"path": "../types"
Expand Down
3 changes: 1 addition & 2 deletions yarn-project/aztec-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,8 @@
"dependencies": {
"@aztec/archiver": "workspace:^",
"@aztec/barretenberg.js": "workspace:^",
"@aztec/ethereum.js": "workspace:^",
"@aztec/foundation": "workspace:^",
"@aztec/l1-contracts": "workspace:^",
"@aztec/l1-artifacts": "workspace:^",
"@aztec/merkle-tree": "workspace:^",
"@aztec/p2p": "workspace:^",
"@aztec/sequencer-client": "workspace:^",
Expand Down
5 changes: 1 addition & 4 deletions yarn-project/aztec-node/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,11 @@
{
"path": "../barretenberg.js"
},
{
"path": "../ethereum.js"
},
{
"path": "../foundation"
},
{
"path": "../l1-contracts"
"path": "../l1-artifacts"
},
{
"path": "../merkle-tree"
Expand Down
3 changes: 1 addition & 2 deletions yarn-project/aztec-rpc/src/account_state/account_state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import { AztecNode } from '@aztec/aztec-node';
import { Grumpkin } from '@aztec/barretenberg.js/crypto';
import { EcdsaSignature, KERNEL_NEW_COMMITMENTS_LENGTH, PrivateHistoricTreeRoots, TxRequest } from '@aztec/circuits.js';
import { KernelProver, OutputNoteData } from '@aztec/kernel-prover';
import { INITIAL_L2_BLOCK_NUM } from '@aztec/l1-contracts';
import { EncodedContractFunction, L2BlockContext, Tx, UnverifiedData } from '@aztec/types';
import { EncodedContractFunction, INITIAL_L2_BLOCK_NUM, L2BlockContext, Tx, UnverifiedData } from '@aztec/types';
import { NotePreimage, TxAuxData } from '../aztec_rpc_server/tx_aux_data/index.js';
import { ContractDataOracle } from '../contract_data_oracle/index.js';
import { Database, TxAuxDataDao, TxDao } from '../database/index.js';
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/end-to-end/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"@aztec/aztec-node": "workspace:^",
"@aztec/aztec.js": "workspace:^",
"@aztec/foundation": "workspace:^",
"@aztec/l1-contracts": "workspace:^",
"@aztec/l1-artifacts": "workspace:^",
"@aztec/noir-contracts": "workspace:^",
"@types/jest": "^29.5.0",
"jest": "^29.5.0",
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/end-to-end/src/deploy_l1_contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
RollupBytecode,
UnverifiedDataEmitterAbi,
UnverifiedDataEmitterBytecode,
} from '@aztec/l1-contracts/viem';
} from '@aztec/l1-artifacts';
import type { Abi, Narrow } from 'abitype';
import {
Account,
Expand Down
1 change: 0 additions & 1 deletion yarn-project/end-to-end/src/e2e_block_building.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { AztecNode, getConfigEnvVars } from '@aztec/aztec-node';
import { AztecRPCServer, ContractDeployer, Fr, TxStatus } from '@aztec/aztec.js';

import { mnemonicToAccount } from 'viem/accounts';
import { createAztecRpcServer } from './create_aztec_rpc_client.js';
import { deployL1Contracts } from './deploy_l1_contracts.js';
Expand Down
1 change: 0 additions & 1 deletion yarn-project/end-to-end/src/e2e_zk_token_contract.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { AztecNode, getConfigEnvVars } from '@aztec/aztec-node';
import { AztecAddress, AztecRPCServer, Contract, ContractDeployer, TxStatus } from '@aztec/aztec.js';

import { ZkTokenContractAbi } from '@aztec/noir-contracts/examples';

import { mnemonicToAccount } from 'viem/accounts';
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/end-to-end/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"path": "../foundation"
},
{
"path": "../l1-contracts"
"path": "../l1-artifacts"
},
{
"path": "../noir-contracts"
Expand Down
6 changes: 0 additions & 6 deletions yarn-project/ethereum.js/.eslintrc.cjs

This file was deleted.

2 changes: 0 additions & 2 deletions yarn-project/ethereum.js/.gitignore

This file was deleted.

1 change: 0 additions & 1 deletion yarn-project/ethereum.js/.prettierignore

This file was deleted.

14 changes: 0 additions & 14 deletions yarn-project/ethereum.js/Dockerfile

This file was deleted.

Loading