Skip to content

Commit

Permalink
revert
Browse files Browse the repository at this point in the history
  • Loading branch information
ludamad committed Apr 2, 2024
1 parent 3713f44 commit 23f819d
Show file tree
Hide file tree
Showing 601 changed files with 2,370 additions and 2,720 deletions.
4 changes: 0 additions & 4 deletions Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,5 @@ build:
test-end-to-end:
BUILD ./yarn-project/end-to-end/+test-all

echo-github-ref:
ARG EARTHLY_GIT_HASH
RUN echo $EARTHLY_GIT_HASH

bench:
RUN echo hi
38 changes: 23 additions & 15 deletions yarn-project/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ FROM node:18.19.0
RUN apt update && apt install -y jq curl perl && rm -rf /var/lib/apt/lists/* && apt-get clean

# copy bb-js and noir-packages
COPY ../barretenberg/ts/+build/build /usr/src/barretenberg/ts
COPY ../noir/+packages/packages /usr/src/noir/packages
COPY ../barretenberg/ts/+build/build /build/barretenberg/ts
COPY ../noir/+packages/packages /build/noir/packages
# install acvm binary
COPY ../noir/+nargo/acvm /usr/bin/acvm
COPY --dir ../noir-projects/+build/. /usr/src/noir-projects
COPY ../l1-contracts/+build/out /usr/src/l1-contracts/out
COPY --dir ../noir-projects/+build/. /build/noir-projects
COPY ../l1-contracts/+build/out /build/l1-contracts/out

WORKDIR /usr/src/yarn-project
WORKDIR /build/yarn-project
# copy source
COPY --dir * *.json .yarn .yarnrc.yml .

Expand All @@ -20,16 +20,24 @@ COPY --dir * *.json .yarn .yarnrc.yml .
# This does kind of work, but jest doesn't honor it correctly, so this seems like a neat workaround.
# Also, --preserve-symlinks causes duplication of portalled instances such as bb.js, and breaks the singleton logic
# by initialising the module more than once. So at present I don't see a viable alternative.
RUN ln -s /usr/src/yarn-project/node_modules /usr/src/node_modules
RUN ln -s /build/yarn-project/node_modules /build/node_modules

# Target for main build process
build:
FROM +source
ARG EARTHLY_CI
# TODO: Replace puppeteer with puppeteer-core to avoid this.
# TODO encapsulate in bash script for cleanliness
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
RUN ./bootstrap.sh && yarn workspaces focus @aztec/cli @aztec/aztec --production
SAVE ARTIFACT /usr/src
ENV YARN_CACHE_FOLDER /build/yarn-cache
# Use a mount for incremental builds locally.
RUN --mount type=cache,target=/build/node_modules_cache --mount type=cache,target=/build/yarn-cache \
mkdir -p node_modules_cache && \
mv node_modules_cache node_modules && \
./bootstrap.sh && \
yarn workspaces focus @aztec/cli @aztec/aztec --production && \
cp -r node_modules node_modules_cache
SAVE ARTIFACT /build

# TODO versioning flow at end before publish?
# ENV COMMIT_TAG=$EARTHLY_BUILD_SHA
Expand All @@ -39,23 +47,23 @@ build:
# FROM node:18.19.1-slim
# ARG COMMIT_TAG=""
# ENV COMMIT_TAG=$COMMIT_TAG
# COPY --from=builder /usr/src /usr/src
# WORKDIR /usr/src/yarn-project
# COPY --from=builder /build /build
# WORKDIR /build/yarn-project
# ENTRYPOINT ["yarn"]

aztec:
FROM +build
# ENV vars for using native ACVM simulation
ENV ACVM_BINARY_PATH="/usr/bin/acvm" ACVM_WORKING_DIRECTORY="/tmp/acvm"
ENTRYPOINT ["node", "--no-warnings", "/usr/src/yarn-project/aztec/dest/bin/index.js"]
ENTRYPOINT ["node", "--no-warnings", "/build/yarn-project/aztec/dest/bin/index.js"]
EXPOSE 8080
# TODO(AD) the following are the biggest node modules bundled, should they be deleted as they are build tools?
# 25840 @jest
# 31544 typescript
# 62368 @types

source:
# for debugging rebuild
# for debugging rebuilds
RUN echo CONTENT HASH $(find . -type f -exec sha256sum {} ';' | sort | sha256sum | awk '{print $1}') | tee .content-hash

end-to-end:
Expand All @@ -69,16 +77,16 @@ end-to-end:
# Build web bundle for browser tests
RUN yarn workspace @aztec/end-to-end run build:web
RUN yarn workspaces focus @aztec/end-to-end --production && yarn cache clean
SAVE ARTIFACT /usr/src/*
SAVE ARTIFACT /build

end-to-end-minimal:
# end to end test runner
BUILD +aztec
FROM node:18.19.1-slim
RUN apt-get update && apt-get install jq chromium -y
ENV CHROME_BIN="/usr/bin/chromium"
COPY +end-to-end/. /usr/src
WORKDIR /usr/src/yarn-project/end-to-end
COPY +end-to-end/build /build
WORKDIR /build/yarn-project/end-to-end
ENTRYPOINT ["yarn", "test"]

build-end-to-end:
Expand Down
8 changes: 4 additions & 4 deletions yarn-project/accounts/src/defaults/account_contract.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { type AccountContract, type AccountInterface, type AuthWitnessProvider } from '@aztec/aztec.js/account';
import { type CompleteAddress } from '@aztec/circuit-types';
import { type ContractArtifact } from '@aztec/foundation/abi';
import { type NodeInfo } from '@aztec/types/interfaces';
import { AccountContract, AccountInterface, AuthWitnessProvider } from '@aztec/aztec.js/account';
import { CompleteAddress } from '@aztec/circuit-types';
import { ContractArtifact } from '@aztec/foundation/abi';
import { NodeInfo } from '@aztec/types/interfaces';

import { DefaultAccountInterface } from '../defaults/account_interface.js';

Expand Down
10 changes: 5 additions & 5 deletions yarn-project/accounts/src/defaults/account_interface.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { type AccountInterface, type AuthWitnessProvider } from '@aztec/aztec.js/account';
import { type EntrypointInterface, type FeeOptions } from '@aztec/aztec.js/entrypoint';
import { type AuthWitness, type FunctionCall, type TxExecutionRequest } from '@aztec/circuit-types';
import { type AztecAddress, type CompleteAddress, Fr } from '@aztec/circuits.js';
import { AccountInterface, AuthWitnessProvider } from '@aztec/aztec.js/account';
import { EntrypointInterface, FeeOptions } from '@aztec/aztec.js/entrypoint';
import { AuthWitness, FunctionCall, TxExecutionRequest } from '@aztec/circuit-types';
import { AztecAddress, CompleteAddress, Fr } from '@aztec/circuits.js';
import { DefaultAccountEntrypoint } from '@aztec/entrypoints/account';
import { type NodeInfo } from '@aztec/types/interfaces';
import { NodeInfo } from '@aztec/types/interfaces';

/**
* Default implementation for an account interface. Requires that the account uses the default
Expand Down
8 changes: 4 additions & 4 deletions yarn-project/accounts/src/ecdsa/account_contract.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { type AuthWitnessProvider } from '@aztec/aztec.js/account';
import { AuthWitness, type CompleteAddress } from '@aztec/circuit-types';
import { AuthWitnessProvider } from '@aztec/aztec.js/account';
import { AuthWitness, CompleteAddress } from '@aztec/circuit-types';
import { Ecdsa } from '@aztec/circuits.js/barretenberg';
import { type ContractArtifact } from '@aztec/foundation/abi';
import { type Fr } from '@aztec/foundation/fields';
import { ContractArtifact } from '@aztec/foundation/abi';
import { Fr } from '@aztec/foundation/fields';

import { DefaultAccountContract } from '../defaults/account_contract.js';
import { EcdsaAccountContractArtifact } from './artifact.js';
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/accounts/src/ecdsa/artifact.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type NoirCompiledContract, loadContractArtifact } from '@aztec/aztec.js';
import { NoirCompiledContract, loadContractArtifact } from '@aztec/aztec.js';

import EcdsaAccountContractJson from '../artifacts/EcdsaAccount.json' assert { type: 'json' };

Expand Down
8 changes: 4 additions & 4 deletions yarn-project/accounts/src/ecdsa/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
*
* @packageDocumentation
*/
import { AccountManager, type Salt } from '@aztec/aztec.js/account';
import { type AccountWallet, getWallet } from '@aztec/aztec.js/wallet';
import { type GrumpkinPrivateKey, type PXE } from '@aztec/circuit-types';
import { type AztecAddress } from '@aztec/circuits.js';
import { AccountManager, Salt } from '@aztec/aztec.js/account';
import { AccountWallet, getWallet } from '@aztec/aztec.js/wallet';
import { GrumpkinPrivateKey, PXE } from '@aztec/circuit-types';
import { AztecAddress } from '@aztec/circuits.js';

import { EcdsaAccountContract } from './account_contract.js';

Expand Down
8 changes: 4 additions & 4 deletions yarn-project/accounts/src/schnorr/account_contract.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { type AuthWitnessProvider } from '@aztec/aztec.js/account';
import { AuthWitness, type CompleteAddress, type GrumpkinPrivateKey } from '@aztec/circuit-types';
import { AuthWitnessProvider } from '@aztec/aztec.js/account';
import { AuthWitness, CompleteAddress, GrumpkinPrivateKey } from '@aztec/circuit-types';
import { Schnorr } from '@aztec/circuits.js/barretenberg';
import { type ContractArtifact } from '@aztec/foundation/abi';
import { type Fr } from '@aztec/foundation/fields';
import { ContractArtifact } from '@aztec/foundation/abi';
import { Fr } from '@aztec/foundation/fields';

import { DefaultAccountContract } from '../defaults/account_contract.js';
import { SchnorrAccountContractArtifact } from './artifact.js';
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/accounts/src/schnorr/artifact.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type NoirCompiledContract, loadContractArtifact } from '@aztec/aztec.js';
import { NoirCompiledContract, loadContractArtifact } from '@aztec/aztec.js';

import SchnorrAccountContractJson from '../artifacts/SchnorrAccount.json' assert { type: 'json' };

Expand Down
8 changes: 4 additions & 4 deletions yarn-project/accounts/src/schnorr/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
*
* @packageDocumentation
*/
import { AccountManager, type Salt } from '@aztec/aztec.js/account';
import { type AccountWallet, getWallet } from '@aztec/aztec.js/wallet';
import { type GrumpkinPrivateKey, type PXE } from '@aztec/circuit-types';
import { type AztecAddress } from '@aztec/circuits.js';
import { AccountManager, Salt } from '@aztec/aztec.js/account';
import { AccountWallet, getWallet } from '@aztec/aztec.js/wallet';
import { GrumpkinPrivateKey, PXE } from '@aztec/circuit-types';
import { AztecAddress } from '@aztec/circuits.js';

import { SchnorrAccountContract } from './account_contract.js';

Expand Down
10 changes: 5 additions & 5 deletions yarn-project/accounts/src/single_key/account_contract.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { generatePublicKey } from '@aztec/aztec.js';
import { type AuthWitnessProvider } from '@aztec/aztec.js/account';
import { AuthWitness, type CompleteAddress, type GrumpkinPrivateKey } from '@aztec/circuit-types';
import { type PartialAddress } from '@aztec/circuits.js';
import { AuthWitnessProvider } from '@aztec/aztec.js/account';
import { AuthWitness, CompleteAddress, GrumpkinPrivateKey } from '@aztec/circuit-types';
import { PartialAddress } from '@aztec/circuits.js';
import { Schnorr } from '@aztec/circuits.js/barretenberg';
import { type ContractArtifact } from '@aztec/foundation/abi';
import { type Fr } from '@aztec/foundation/fields';
import { ContractArtifact } from '@aztec/foundation/abi';
import { Fr } from '@aztec/foundation/fields';

import { DefaultAccountContract } from '../defaults/account_contract.js';
import { SchnorrSingleKeyAccountContractArtifact } from './artifact.js';
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/accounts/src/single_key/artifact.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type NoirCompiledContract, loadContractArtifact } from '@aztec/aztec.js';
import { NoirCompiledContract, loadContractArtifact } from '@aztec/aztec.js';

import SchnorrSingleKeyAccountContractJson from '../artifacts/SchnorrSingleKeyAccount.json' assert { type: 'json' };

Expand Down
8 changes: 4 additions & 4 deletions yarn-project/accounts/src/single_key/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
*
* @packageDocumentation
*/
import { AccountManager, type Salt } from '@aztec/aztec.js/account';
import { type AccountWallet, getWallet } from '@aztec/aztec.js/wallet';
import { type GrumpkinPrivateKey, type PXE } from '@aztec/circuit-types';
import { type AztecAddress } from '@aztec/circuits.js';
import { AccountManager, Salt } from '@aztec/aztec.js/account';
import { AccountWallet, getWallet } from '@aztec/aztec.js/wallet';
import { GrumpkinPrivateKey, PXE } from '@aztec/circuit-types';
import { AztecAddress } from '@aztec/circuits.js';

import { SingleKeyAccountContract } from './account_contract.js';

Expand Down
4 changes: 2 additions & 2 deletions yarn-project/accounts/src/testing/configuration.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { generatePublicKey } from '@aztec/aztec.js';
import { type AccountWalletWithPrivateKey } from '@aztec/aztec.js/wallet';
import { type PXE } from '@aztec/circuit-types';
import { AccountWalletWithPrivateKey } from '@aztec/aztec.js/wallet';
import { PXE } from '@aztec/circuit-types';
import { Fr, GrumpkinScalar } from '@aztec/foundation/fields';

import { getSchnorrAccount } from '../schnorr/index.js';
Expand Down
4 changes: 2 additions & 2 deletions yarn-project/accounts/src/testing/create_account.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { type AccountWalletWithPrivateKey } from '@aztec/aztec.js/wallet';
import { type PXE } from '@aztec/circuit-types';
import { AccountWalletWithPrivateKey } from '@aztec/aztec.js/wallet';
import { PXE } from '@aztec/circuit-types';
import { GrumpkinScalar } from '@aztec/circuits.js';

import { getSchnorrAccount } from '../schnorr/index.js';
Expand Down
20 changes: 6 additions & 14 deletions yarn-project/archiver/src/archiver/archiver.test.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,14 @@
import { type Body, EncryptedL2BlockL2Logs, L2Block, LogType, UnencryptedL2BlockL2Logs } from '@aztec/circuit-types';
import { Body, EncryptedL2BlockL2Logs, L2Block, LogType, UnencryptedL2BlockL2Logs } from '@aztec/circuit-types';
import { EthAddress } from '@aztec/foundation/eth-address';
import { Fr } from '@aztec/foundation/fields';
import { sleep } from '@aztec/foundation/sleep';
import { AvailabilityOracleAbi, type InboxAbi, RollupAbi } from '@aztec/l1-artifacts';

import { type MockProxy, mock } from 'jest-mock-extended';
import {
type Chain,
type HttpTransport,
type Log,
type PublicClient,
type Transaction,
encodeFunctionData,
toHex,
} from 'viem';
import { AvailabilityOracleAbi, InboxAbi, RollupAbi } from '@aztec/l1-artifacts';

import { MockProxy, mock } from 'jest-mock-extended';
import { Chain, HttpTransport, Log, PublicClient, Transaction, encodeFunctionData, toHex } from 'viem';

import { Archiver } from './archiver.js';
import { type ArchiverDataStore } from './archiver_store.js';
import { ArchiverDataStore } from './archiver_store.js';
import { MemoryArchiverStore } from './memory_archiver_store/memory_archiver_store.js';

describe('Archiver', () => {
Expand Down
52 changes: 26 additions & 26 deletions yarn-project/archiver/src/archiver/archiver.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import {
type FromLogType,
type GetUnencryptedLogsResponse,
type L1ToL2MessageSource,
FromLogType,
GetUnencryptedLogsResponse,
L1ToL2MessageSource,
L2Block,
type L2BlockL2Logs,
type L2BlockSource,
type L2LogsSource,
type LogFilter,
type LogType,
type TxEffect,
type TxHash,
type TxReceipt,
type UnencryptedL2Log,
L2BlockL2Logs,
L2BlockSource,
L2LogsSource,
LogFilter,
LogType,
TxEffect,
TxHash,
TxReceipt,
UnencryptedL2Log,
} from '@aztec/circuit-types';
import { ContractClassRegisteredEvent, type FunctionSelector } from '@aztec/circuits.js';
import { ContractClassRegisteredEvent, FunctionSelector } from '@aztec/circuits.js';
import {
ContractInstanceDeployedEvent,
PrivateFunctionBroadcastedEvent,
Expand All @@ -22,28 +22,28 @@ import {
isValidUnconstrainedFunctionMembershipProof,
} from '@aztec/circuits.js/contract';
import { createEthereumChain } from '@aztec/ethereum';
import { type AztecAddress } from '@aztec/foundation/aztec-address';
import { type EthAddress } from '@aztec/foundation/eth-address';
import { AztecAddress } from '@aztec/foundation/aztec-address';
import { EthAddress } from '@aztec/foundation/eth-address';
import { Fr } from '@aztec/foundation/fields';
import { type DebugLogger, createDebugLogger } from '@aztec/foundation/log';
import { DebugLogger, createDebugLogger } from '@aztec/foundation/log';
import { RunningPromise } from '@aztec/foundation/running-promise';
import { getCanonicalClassRegistererAddress } from '@aztec/protocol-contracts/class-registerer';
import {
type ContractClassPublic,
type ContractDataSource,
type ContractInstanceWithAddress,
type ExecutablePrivateFunctionWithMembershipProof,
type PublicFunction,
type UnconstrainedFunctionWithMembershipProof,
ContractClassPublic,
ContractDataSource,
ContractInstanceWithAddress,
ExecutablePrivateFunctionWithMembershipProof,
PublicFunction,
UnconstrainedFunctionWithMembershipProof,
} from '@aztec/types/contracts';

import groupBy from 'lodash.groupby';
import { type Chain, type HttpTransport, type PublicClient, createPublicClient, http } from 'viem';
import { Chain, HttpTransport, PublicClient, createPublicClient, http } from 'viem';

import { type ArchiverDataStore } from './archiver_store.js';
import { type ArchiverConfig } from './config.js';
import { ArchiverDataStore } from './archiver_store.js';
import { ArchiverConfig } from './config.js';
import {
type DataRetrieval,
DataRetrieval,
retrieveBlockBodiesFromAvailabilityOracle,
retrieveBlockMetadataFromRollup,
retrieveL1ToL2Messages,
Expand Down
Loading

0 comments on commit 23f819d

Please sign in to comment.