Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
2dc4d77
Use circuit constructor.
codygunton Jun 20, 2023
0d186af
Undo hack to stop exposing manifest.
codygunton Jun 21, 2023
350ab82
Update Bb
codygunton Jun 21, 2023
ea69fc5
Update Bb
codygunton Jun 21, 2023
64c8ba7
Bump Bb (need Mont conversion)
codygunton Jun 21, 2023
d488fc4
Using builder and CircuitType
codygunton Jun 26, 2023
ded2a64
Fix some things break others.
codygunton Jun 26, 2023
2224d0f
Satisfy prettier?
codygunton Jun 26, 2023
aa6f850
Composer ~> Builder
codygunton Jun 26, 2023
f91ece9
composer ~> builder
codygunton Jun 26, 2023
86fa2cd
mv dummy_composer.hpp and rename class.
codygunton Jun 26, 2023
b3097e2
Clean change to settingss.
codygunton Jun 26, 2023
e3eed2f
Bump Bb.
codygunton Jun 26, 2023
019c759
Merge branch 'master' into cg/circuit-builders
codygunton Jun 27, 2023
f888db5
Note on compilation errors in tests.
codygunton Jun 27, 2023
4958f0a
Try to satisfy clang-tidy.
codygunton Jun 27, 2023
2b8e215
Fix test that didn't compile before.
codygunton Jun 27, 2023
d19e5ee
Merge branch 'master' into cg/circuit-builders
codygunton Jun 27, 2023
80d7d22
Respond to comments and clean up
codygunton Jun 27, 2023
a586f3b
use cross chain harness for uniswap e2e (#916)
rahul-kothari Jun 27, 2023
ee71367
Fix typo and formatting.
codygunton Jun 27, 2023
27b9a0a
Merge branch 'master' into cg/circuit-builders
codygunton Jun 27, 2023
46b831f
Fix compilation post-merge
codygunton Jun 27, 2023
c10ae38
It should be a Schnorr signature?
codygunton Jun 27, 2023
4bd5469
Sp/aztec sandbox (internal) (#904)
spypsy Jun 27, 2023
d5fe0d3
Merge branch 'master' into cg/circuit-builders
codygunton Jun 27, 2023
ee3d9e0
Revert to Ecdsa
codygunton Jun 27, 2023
bef4f57
Proposed fix.
codygunton Jun 27, 2023
aaeb225
Revert "Proposed fix."
codygunton Jun 27, 2023
ec3fbf4
Test Schnorr; update snapshot.
codygunton Jun 27, 2023
5d20a8d
Rebuild WASM before making snapshot.
codygunton Jun 28, 2023
1df243e
Merge pull request #895 from AztecProtocol/cg/circuit-builders
codygunton Jun 28, 2023
d9acb20
Revert "refactor!: Use circuit builders"
codygunton Jun 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
35 changes: 35 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,17 @@ jobs:
name: "Build and test"
command: build aztec-rpc

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

circuits-js:
machine:
image: ubuntu-2004:202010-01
Expand Down Expand Up @@ -535,6 +546,20 @@ jobs:
name: "Noop"
command: echo Noop

deploy:
machine:
image: ubuntu-2004:202010-01
resource_class: medium
steps:
- *checkout
- *setup_env
- run:
name: "deploy-sandbox"
working_directory: aztec-sandbox
command: |
deploy_ecr aztec-sandbox
deploy_dockerhub aztec-sandbox master

# Repeatable config for defining the workflow below.
tag_regex: &tag_regex /v[0-9]+(\.[0-9]+)*(-[a-zA-Z-]+\.[0-9]+)?/
defaults: &defaults
Expand Down Expand Up @@ -615,6 +640,7 @@ workflows:
- types: *yarn_project
- circuits-js: *yarn_project
- rollup-provider: *yarn_project
- aztec-sandbox: *yarn_project

- e2e-join:
requires:
Expand Down Expand Up @@ -667,3 +693,12 @@ workflows:
- integration-archiver-l1-to-l2
- e2e-p2p
<<: *defaults

- deploy:
requires:
- e2e-end
- aztec-sandbox
filters:
branches:
only: master
<<: *defaults
15 changes: 15 additions & 0 deletions build_manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,21 @@
"types"
]
},
"aztec-sandbox": {
"buildDir": "yarn-project",
"projectDir": "yarn-project/aztec-sandbox",
"dockerfile": "aztec-sandbox/Dockerfile",
"rebuildPatterns": [
"^yarn-project/aztec-sandbox/"
],
"dependencies": [
"aztec-node",
"aztec-rpc",
"aztec.js",
"ethereum",
"foundation"
]
},
"aztec.js": {
"buildDir": "yarn-project",
"projectDir": "yarn-project/aztec.js",
Expand Down
2 changes: 2 additions & 0 deletions build_manifest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

PROJECTS=(
circuits:circuits/cpp:./dockerfiles/Dockerfile.wasm-linux-clang:circuits-wasm-linux-clang
l1-contracts:l1-contracts
yarn-project-base:yarn-project
end-to-end:yarn-project
aztec-sandbox:yarn-project
)
11 changes: 10 additions & 1 deletion yarn-project/archiver/src/archiver/archiver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ export class Archiver implements L2BlockSource, L2LogsSource, ContractDataSource
*/
private lastProcessedBlockNumber = 0n;

/**
* Use this to track logged block in order to avoid repeating the same message.
*/
private lastLoggedBlockNumber = 0n;

/**
* Creates a new instance of the Archiver.
* @param publicClient - A client for interacting with the Ethereum node.
Expand Down Expand Up @@ -123,7 +128,11 @@ export class Archiver implements L2BlockSource, L2LogsSource, ContractDataSource
private async sync(blockUntilSynced: boolean) {
const currentBlockNumber = await this.publicClient.getBlockNumber();
if (currentBlockNumber <= this.lastProcessedBlockNumber) {
this.log(`No new blocks to process, current block number: ${currentBlockNumber}`);
// reducing logs, otherwise this gets triggered on every loop (1s)
if (currentBlockNumber !== this.lastLoggedBlockNumber) {
this.log(`No new blocks to process, current block number: ${currentBlockNumber}`);
this.lastLoggedBlockNumber = currentBlockNumber;
}
return;
}

Expand Down
5 changes: 3 additions & 2 deletions yarn-project/aztec-node/src/aztec-node/http-node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export function txToJson(tx: Tx) {
return {
data: tx.data?.toBuffer().toString('hex'),
encryptedLogs: tx.encryptedLogs?.toBuffer().toString('hex'),
unencryptedLogs: tx.unencryptedLogs?.toBuffer().toString('hex'),
proof: tx.proof?.toBuffer().toString('hex'),
newContractPublicFunctions: tx.newContractPublicFunctions?.map(f => f.toBuffer().toString('hex')) ?? [],
enqueuedPublicFunctions: tx.enqueuedPublicFunctionCalls?.map(f => f.toBuffer().toString('hex')) ?? [],
Expand All @@ -49,10 +50,10 @@ export function txFromJson(json: any) {
const encryptedLogs = TxL2Logs.fromBuffer(Buffer.from(json.encryptedLogs, 'hex'));
const unencryptedLogs = TxL2Logs.fromBuffer(Buffer.from(json.unencryptedLogs, 'hex'));
const proof = Buffer.from(json.proof, 'hex');
const newContractPublicFunctions = json.newContractPublicFunctions
const newContractPublicFunctions = json.newContractPublicFunctions?.length
? json.newContractPublicFunctions.map((x: string) => EncodedContractFunction.fromBuffer(Buffer.from(x, 'hex')))
: [];
const enqueuedPublicFunctions = json.enqueuedPublicFunctions
const enqueuedPublicFunctions = json.enqueuedPublicFunctions?.length
? json.enqueuedPublicFunctions.map((x: string) => PublicCallRequest.fromBuffer(Buffer.from(x, 'hex')))
: [];
return Tx.createTx(
Expand Down
3 changes: 2 additions & 1 deletion yarn-project/aztec-rpc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
"clean": "rm -rf ./dest .tsbuildinfo",
"formatting": "run -T prettier --check ./src && run -T eslint ./src",
"formatting:fix": "run -T prettier -w ./src",
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules $(yarn bin jest) --passWithNoTests"
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules $(yarn bin jest) --passWithNoTests",
"start:http": "DEBUG='aztec:*' && node ./dest/aztec_rpc_http/aztec_rpc_http_server.js"
},
"inherits": [
"../package.common.json"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
import { AztecAddress, EthAddress, Fr } from '@aztec/circuits.js';
import { ContractAbi } from '@aztec/foundation/abi';
import { Point } from '@aztec/foundation/fields';
import { ContractDeploymentTx, PartialContractAddress, Tx, TxHash } from '@aztec/types';
import {
ContractData,
ContractDeploymentTx,
ContractPublicData,
L2BlockL2Logs,
PartialContractAddress,
Tx,
TxHash,
} from '@aztec/types';
import { TxReceipt } from '../tx/index.js';
import { CurveType, SignerType } from '../crypto/types.js';

Expand All @@ -25,12 +33,12 @@ export interface DeployedContract {
}

/**
* Represents an Aztec RPC client implementation.
* Represents an Aztec RPC implementation.
* Provides functionality for all the operations needed to interact with the Aztec network,
* including account management, contract deployment, transaction creation, and execution,
* as well as storage and view functions for smart contracts.
*/
export interface AztecRPCClient {
export interface AztecRPC {
createSmartAccount(
privKey?: Buffer,
curve?: CurveType,
Expand Down Expand Up @@ -66,4 +74,8 @@ export interface AztecRPCClient {
getTxReceipt(txHash: TxHash): Promise<TxReceipt>;
getStorageAt(contract: AztecAddress, storageSlot: Fr): Promise<any>;
viewTx(functionName: string, args: any[], to: AztecAddress, from?: AztecAddress): Promise<any>;
getContractData(contractAddress: AztecAddress): Promise<ContractPublicData | undefined>;
getContractInfo(contractAddress: AztecAddress): Promise<ContractData | undefined>;
getUnencryptedLogs(from: number, take: number): Promise<L2BlockL2Logs[]>;
getBlockNum(): Promise<number>;
}
1 change: 1 addition & 0 deletions yarn-project/aztec-rpc/src/aztec_rpc/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './aztec_rpc.js';
33 changes: 33 additions & 0 deletions yarn-project/aztec-rpc/src/aztec_rpc_http/aztec_rpc_http_server.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { foundry } from 'viem/chains';
import { Tx, TxHash, ContractDeploymentTx } from '@aztec/types';
import { JsonRpcServer } from '@aztec/foundation/json-rpc';
import { AztecAddress } from '@aztec/foundation/aztec-address';
import { Fr, Point } from '@aztec/foundation/fields';
import { AztecNodeConfig, AztecNodeService } from '@aztec/aztec-node';

import { EthAddress, createAztecRPCServer } from '../index.js';

export const localAnvil = foundry;

/**
* Wraps an instance of the Aztec RPC Server implementation to a JSON RPC HTTP interface.
* @returns A new instance of the HTTP server.
*/
export async function getHttpRpcServer(nodeConfig: AztecNodeConfig): Promise<JsonRpcServer> {
const aztecNode = await AztecNodeService.createAndSync(nodeConfig);
const aztecRpcServer = await createAztecRPCServer(aztecNode);
const generatedRpcServer = new JsonRpcServer(
aztecRpcServer,
{
AztecAddress,
TxHash,
EthAddress,
Point,
Fr,
},
{ Tx, ContractDeploymentTx },
false,
['start', 'stop'],
);
return generatedRpcServer;
}
1 change: 1 addition & 0 deletions yarn-project/aztec-rpc/src/aztec_rpc_http/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './aztec_rpc_http_server.js';
Loading