Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
d6ea91e
WIP
PhilWindle Mar 27, 2023
524f389
refactor: remove some circuits.ts boilerplate
sirasistant Mar 27, 2023
8a58c32
Fixed first end to end test
PhilWindle Mar 28, 2023
96d25d1
Merge branch 'master' into pw/fix-end-to-end-test
PhilWindle Mar 28, 2023
1321f5e
Fixed merge
PhilWindle Mar 28, 2023
e7c0693
Merge branch 'master' into pw/fix-end-to-end-test
sirasistant Mar 28, 2023
cf66bda
Merge fix
PhilWindle Mar 28, 2023
138a21d
Merge fix
PhilWindle Mar 28, 2023
22c55b2
Merge fix
PhilWindle Mar 28, 2023
8ef373e
refactor: remove duplicated foundation classes
sirasistant Mar 28, 2023
d7be193
Merge branch 'pw/fix-end-to-end-test' of github.com:AztecProtocol/azt…
sirasistant Mar 28, 2023
3d3e390
More test fixes
PhilWindle Mar 28, 2023
436b4f6
Merge branch 'pw/fix-end-to-end-test' of github.com:AztecProtocol/azt…
PhilWindle Mar 28, 2023
313bfb6
Merge branch 'master' into pw/fix-end-to-end-test
sirasistant Mar 28, 2023
3aa2524
Merge branch 'pw/fix-end-to-end-test' of github.com:AztecProtocol/azt…
sirasistant Mar 28, 2023
333daaf
Fix build attempt
PhilWindle Mar 28, 2023
28e05fa
Merge branch 'pw/fix-end-to-end-test' of github.com:AztecProtocol/azt…
PhilWindle Mar 28, 2023
28b8048
Attempt build fix
PhilWindle Mar 28, 2023
6514017
Attempt test fix
PhilWindle Mar 28, 2023
86b49ed
Attempt fix
PhilWindle Mar 28, 2023
d517d31
More fixes
PhilWindle Mar 28, 2023
046f516
Fix attempt
PhilWindle Mar 28, 2023
21d29ef
TxRequest fix
PhilWindle Mar 28, 2023
c138828
Merge branch 'master' into pw/fix-end-to-end-test
PhilWindle Mar 28, 2023
f2681dc
Merge fixes
PhilWindle Mar 28, 2023
038a5c2
Merge fixes
PhilWindle Mar 28, 2023
beddf9d
Merge fix
PhilWindle Mar 28, 2023
82cb057
Merge fix
PhilWindle Mar 28, 2023
e1e061f
Merge fix
PhilWindle Mar 28, 2023
dc78556
Enable test debug
PhilWindle Mar 28, 2023
f7c467f
Logging
PhilWindle Mar 28, 2023
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
1 change: 1 addition & 0 deletions bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ PROJECTS=(
"yarn-project/kernel-prover:yarn build"
"yarn-project/aztec-rpc:yarn build"
"yarn-project/aztec.js:yarn build"
"yarn-project/noir-contracts:yarn build"
)

for E in "${PROJECTS[@]}"; do
Expand Down
1 change: 1 addition & 0 deletions yarn-project/acir-simulator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"rootDir": "./src"
},
"dependencies": {
"@aztec/circuits.js": "workspace:^",
"tslib": "^2.4.0"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/acir-simulator/src/acvm.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AztecAddress, CallContext, ContractDeploymentData } from './circuits.js';
import { AztecAddress, CallContext, ContractDeploymentData } from '@aztec/circuits.js';
import { NoteLoadOracleInputs } from './db_oracle.js';

export interface ACIRCallback {
Expand Down
229 changes: 0 additions & 229 deletions yarn-project/acir-simulator/src/circuits.ts

This file was deleted.

10 changes: 9 additions & 1 deletion yarn-project/acir-simulator/src/db_oracle.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AztecAddress, EthAddress } from './circuits.js';
import { AztecAddress, EthAddress, PrivateCircuitPublicInputs } from '@aztec/circuits.js';

export interface NoteLoadOracleInputs {
note: Buffer;
Expand All @@ -14,3 +14,11 @@ export interface DBOracle {
getProvingKey(contractAddress: AztecAddress, functionSelector: string): Promise<Buffer>;
getPortalContractAddress(contractAddress: AztecAddress): Promise<EthAddress>;
}

export class PrivateCallStackItem {
constructor(
public readonly contractAddress: AztecAddress,
public readonly functionSelector: number,
public readonly publicInputs: PrivateCircuitPublicInputs,
) {}
}
39 changes: 27 additions & 12 deletions yarn-project/acir-simulator/src/simulator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,20 @@ import { ExecutionPreimages } from './acvm.js';
import {
CallContext,
PrivateCircuitPublicInputs,
TxRequest,
EthAddress,
PrivateCallStackItem,
OldTreeRoots,
} from './circuits.js';
Fr,
ARGS_LENGTH,
EMITTED_EVENTS_LENGTH,
NEW_COMMITMENTS_LENGTH,
NEW_NULLIFIERS_LENGTH,
PRIVATE_CALL_STACK_LENGTH,
PUBLIC_CALL_STACK_LENGTH,
L1_MSG_STACK_LENGTH,
RETURN_VALUES_LENGTH,
TxRequest,
} from '@aztec/circuits.js';
import { PrivateCallStackItem } from './db_oracle.js';

export interface ExecutionResult {
// Needed for prover
Expand Down Expand Up @@ -36,19 +45,25 @@ export class AcirSimulator {
portalContractAddress,
false,
false,
request.functionData.isContructor,
request.functionData.isConstructor,
);

const randomFields = (num: number) => {
return Array(num)
.fill(0)
.map(() => new Fr(0));
};

const publicInputs = new PrivateCircuitPublicInputs(
callContext,
request.args,
[], // returnValues,
[], // emittedEvents,
[], // newCommitments,
[], // newNullifiers,
[], // privateCallStack,
[], // publicCallStack,
[], // l1MsgStack,
request.args.concat(randomFields(ARGS_LENGTH - request.args.length)),
randomFields(RETURN_VALUES_LENGTH), // returnValues,
randomFields(EMITTED_EVENTS_LENGTH), // emittedEvents,
randomFields(NEW_COMMITMENTS_LENGTH), // newCommitments,
randomFields(NEW_NULLIFIERS_LENGTH), // newNullifiers,
randomFields(PRIVATE_CALL_STACK_LENGTH), // privateCallStack,
randomFields(PUBLIC_CALL_STACK_LENGTH), // publicCallStack,
randomFields(L1_MSG_STACK_LENGTH), // l1MsgStack,
oldRoots.privateDataTreeRoot,
oldRoots.nullifierTreeRoot,
oldRoots.contractTreeRoot,
Expand Down
7 changes: 6 additions & 1 deletion yarn-project/acir-simulator/tsconfig.dest.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
{
"extends": ".",
"exclude": ["**/*.test.*", "**/fixtures/*"]
"exclude": ["**/*.test.*", "**/fixtures/*"],
"references": [
{
"path": "../circuits.js/tsconfig.dest.json"
}
]
}
5 changes: 5 additions & 0 deletions yarn-project/acir-simulator/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,10 @@
"rootDir": "src",
"tsBuildInfoFile": ".tsbuildinfo"
},
"references": [
{
"path": "../circuits.js/tsconfig.dest.json"
}
],
"include": ["src"]
}
2 changes: 1 addition & 1 deletion yarn-project/archiver/src/archiver/archiver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ export class Archiver implements L2BlockSource {
if (from > this.l2Blocks.length) {
return Promise.resolve([]);
}
const startIndex = from - 1;
const startIndex = from - INITIAL_ROLLUP_ID;
const endIndex = startIndex + take;
return Promise.resolve(this.l2Blocks.slice(startIndex, endIndex));
}
Expand Down
21 changes: 0 additions & 21 deletions yarn-project/aztec-node/src/aztec-node/fixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,27 +29,6 @@ import { AztecAddress, randomBytes } from '@aztec/foundation';
import { Rollup, Yeeter } from '@aztec/l1-contracts';
import { Tx } from '@aztec/tx';

// REFACTOR: Move deployment logic to l1-contracts package, and refactor it out of other integration tests (archiver, sequencer)
export const deployRollupContract = async (provider: WalletProvider, ethRpc: EthereumRpc) => {
const deployAccount = provider.getAccount(0);
const contract = new Rollup(ethRpc, undefined, { from: deployAccount, gas: 1000000 });
await contract.deploy().send().getReceipt();
return contract.address;
};

export const deployYeeterContract = async (provider: WalletProvider, ethRpc: EthereumRpc) => {
const deployAccount = provider.getAccount(0);
const contract = new Yeeter(ethRpc, undefined, { from: deployAccount, gas: 1000000 });
await contract.deploy().send().getReceipt();
return contract.address;
};

export const createProvider = (host: string, mnemonic: string, accounts: number) => {
const walletProvider = WalletProvider.fromHost(host);
walletProvider.addAccountsFromMnemonic(mnemonic, accounts);
return walletProvider;
};

// REFACTOR: Use @aztec/circuit.js/factories where possible
export const createCircuitEthAddress = () => {
return new CircuitEthAddress(randomBytes(20));
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
@@ -1,6 +1,5 @@
import { AztecAddress } from '@aztec/circuits.js';
import { TxHash } from '@aztec/tx';

import { AztecAddress } from '../circuits.js';
import { Database } from '../database/index.js';

export class AccountState {
Expand Down
Loading