Skip to content
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
2 changes: 1 addition & 1 deletion k8s/local/aztec-sandbox-node/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ spec:
app: aztec-sandbox-node
spec:
containers:
- image: aztecprotocol/aztec:0.71.0
- image: aztecprotocol/aztec:0.72.1
name: aztec-sandbox-node
resources:
limits:
Expand Down
2 changes: 1 addition & 1 deletion packages/backend-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"lint-base": "yarn run g:lint"
},
"dependencies": {
"@aztec/aztec.js": "0.71.0",
"@aztec/aztec.js": "0.72.1",
"@chicmoz-pkg/types": "workspace:^",
"drizzle-orm": "0.33.0",
"exponential-backoff": "3.1.1",
Expand Down
3 changes: 2 additions & 1 deletion packages/backend-utils/src/parse-block.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ const getTxEffectWithHashes = (txEffects: L2Block["body"]["txEffects"]) => {
return txEffects.map((txEffect) => {
return {
...txEffect,
unencryptedLogslength: txEffect.unencryptedLogsLength.toNumber(),
contractClassLogsLength: txEffect.contractClassLogsLength,
privateLogs: txEffect.privateLogs.map((log) => log.toFields()),
publicLogs: txEffect.publicLogs.map((log) => log.toFields()),
txHash: txEffect.txHash.toString(),
};
});
Expand Down
2 changes: 1 addition & 1 deletion packages/message-registry/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"lint-base": "yarn run g:lint"
},
"dependencies": {
"@aztec/aztec.js": "0.71.0",
"@aztec/aztec.js": "0.72.1",
"@chicmoz-pkg/types": "workspace:^"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/types/src/aztec/general.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { z } from "zod";
import { l2NetworkIdSchema } from "../network-ids.js";

export const CHICMOZ_TYPES_AZTEC_VERSION = "0.71.0";
export const CHICMOZ_TYPES_AZTEC_VERSION = "0.72.1";

export const L1ContractAddressesSchema = z.object({
rollupAddress: z.string(),
Expand Down
1 change: 1 addition & 0 deletions packages/types/src/aztec/l2Block.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export const chicmozL2BlockSchema = z.object({
}),
}),
totalFees: z.coerce.bigint(),
totalManaUsed: z.coerce.bigint(),
}),
body: z.object({
txEffects: z.array(chicmozL2TxEffectSchema),
Expand Down
29 changes: 5 additions & 24 deletions packages/types/src/aztec/l2TxEffect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import { z } from "zod";
import { aztecAddressSchema, hexStringSchema } from "../general.js";
import { bufferSchema, frNumberSchema, frSchema } from "./utils.js";

export const unencryptedLogEntrySchema = z.object({
export const contractClassLogsSchema = z.object({
data: bufferSchema,
contractAddress: aztecAddressSchema,
});

const logsSchema = (logEntrySchema: typeof unencryptedLogEntrySchema) =>
const logsSchema = (logEntrySchema: typeof contractClassLogsSchema) =>
z.object({
functionLogs: z.array(
z.object({
Expand All @@ -16,28 +16,10 @@ const logsSchema = (logEntrySchema: typeof unencryptedLogEntrySchema) =>
),
});

//const functionSelectorSchema = z.string().length(10).regex(/^0x[0-9a-fA-F]+$/);

export const chicmozL2PendingTxSchema = z.object({
// TODO: this schema needs to be properly defined, perhaps merged with txEffect
hash: hexStringSchema,
birthTimestamp: z.number(),
//data: bufferSchema,
//noteEncryptedLogs: logsSchema(noteEncryptedLogEntrySchema),
//encryptedLogs: logsSchema(encryptedLogEntrySchema),
//unencryptedLogs: logsSchema(unencryptedLogEntrySchema),
//contractClassLogs: bufferSchema,
//clientIvcProof: bufferSchema,
//enqueuedPublicFunctionCalls: z.array(bufferSchema),
//publicTeardownFunctionCall: z.object({
// callContext: z.object({
// msgSender: aztecAddressSchema,
// contractAddress: aztecAddressSchema,
// functionSelector: functionSelectorSchema,
// isStaticCall: z.boolean(),
// }),
// args: z.array(frSchema),
//}),
});

/**
Expand All @@ -58,12 +40,11 @@ export const chicmozL2TxEffectSchema = z.object({
nullifiers: z.array(frSchema),
l2ToL1Msgs: z.array(frSchema),
publicDataWrites: z.array(z.object({ leafSlot: frSchema, value: frSchema })),
unencryptedLogsLength: frNumberSchema,
privateLogs: z.array(z.array(frSchema)),
unencryptedLogs: logsSchema(unencryptedLogEntrySchema),
publicLogs: z.array(z.array(frSchema)),
contractClassLogs: logsSchema(contractClassLogsSchema),
contractClassLogsLength: frNumberSchema,
});

export type UnencryptedLogEntry = z.infer<typeof unencryptedLogEntrySchema>;

export type ChicmozL2PendingTx = z.infer<typeof chicmozL2PendingTxSchema>;
export type ChicmozL2TxEffect = z.infer<typeof chicmozL2TxEffectSchema>;
4 changes: 2 additions & 2 deletions services/aztec-listener/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"main": "index.js",
"license": "Apache-2.0",
"dependencies": {
"@aztec/aztec.js": "0.71.0",
"@aztec/circuits.js": "0.71.0",
"@aztec/aztec.js": "0.72.1",
"@aztec/circuits.js": "0.72.1",
"@chicmoz-pkg/backend-utils": "workspace:^",
"@chicmoz-pkg/logger-server": "workspace:^",
"@chicmoz-pkg/message-bus": "workspace:^",
Expand Down
20 changes: 0 additions & 20 deletions services/aztec-listener/src/events/emitted/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,26 +39,6 @@ export const onPendingTxs = async (txs: Tx[]) => {
await publishMessage("PENDING_TXS_EVENT", {
txs: txs.map((tx) => {
return {
// TODO
//...Tx.schema.parse(tx.toBuffer()),
//data: tx.data.toBuffer(),
//clientIvcProof: tx.clientIvcProof.toBuffer(),
//contractClassLogs: tx.contractClassLogs.toBuffer(),
//unencryptedLogs: tx.unencryptedLogs.toBuffer(),
//encryptedLogs: tx.encryptedLogs.toBuffer(),
//noteEncryptedLogs: tx.noteEncryptedLogs.toBuffer(),
//enqueuedPublicFunctionCalls: tx.enqueuedPublicFunctionCalls.map((call) =>
// call.toBuffer()
//),
//publicTeardownFunctionCall: {
// callContext: {
// ...tx.publicTeardownFunctionCall.callContext,
// contractAddress: tx.publicTeardownFunctionCall.callContext.contractAddress.toString(),
// msgSender: tx.publicTeardownFunctionCall.callContext.msgSender.toString(),
// functionSelector: tx.publicTeardownFunctionCall.callContext.functionSelector.toString(),
// },
// args: tx.publicTeardownFunctionCall.args.map((arg) => arg.toString()),
//},
hash: tx.getTxHash().toString(),
birthTimestamp: new Date().getTime(),
};
Expand Down
4 changes: 2 additions & 2 deletions services/ethereum-listener/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
],
"license": "Apache-2.0",
"dependencies": {
"@aztec/aztec.js": "0.71.0",
"@aztec/l1-artifacts": "0.71.0",
"@aztec/aztec.js": "0.72.1",
"@aztec/l1-artifacts": "0.72.1",
"@chicmoz-pkg/logger-server": "workspace:^",
"@chicmoz-pkg/message-bus": "workspace:^",
"@chicmoz-pkg/message-registry": "workspace:^",
Expand Down
2 changes: 1 addition & 1 deletion services/event-cannon/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Compile contracts (if changed, or updated version)

aztec-up 0.71.0
aztec-up 0.72.1

cd contract-projects/YOUR_PROJECT
aztec-nargo compile
Expand Down
8 changes: 4 additions & 4 deletions services/event-cannon/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
],
"license": "Apache-2.0",
"dependencies": {
"@aztec/accounts": "0.71.0",
"@aztec/aztec.js": "0.71.0",
"@aztec/l1-artifacts": "0.71.0",
"@aztec/noir-contracts.js": "0.71.0",
"@aztec/accounts": "0.72.1",
"@aztec/aztec.js": "0.72.1",
"@aztec/l1-artifacts": "0.72.1",
"@aztec/noir-contracts.js": "0.72.1",
"@chicmoz-pkg/logger-server": "workspace:^"
},
"devDependencies": {
Expand Down
4 changes: 1 addition & 3 deletions services/event-cannon/src/artifacts/SimpleLogging.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import {
PublicKeys,
type UnencryptedL2Log,
type Wallet,
type U128Like,
type WrappedFieldLike,
} from '@aztec/aztec.js';
import SimpleLoggingContractArtifactJson from '../contract-projects/SimpleLogging/target/simple_logging-SimpleLogging.json' assert { type: 'json' };
Expand Down Expand Up @@ -131,9 +132,6 @@ export class SimpleLoggingContract extends ContractBase {
/** get_counter_value(counter_id: field) */
get_counter_value: ((counter_id: FieldLike) => ContractFunctionInteraction) & Pick<ContractMethod, 'selector'>;

/** increase_counter_private(counter_id: field) */
increase_counter_private: ((counter_id: FieldLike) => ContractFunctionInteraction) & Pick<ContractMethod, 'selector'>;

/** increase_counter_public(counter_id: field) */
increase_counter_public: ((counter_id: FieldLike) => ContractFunctionInteraction) & Pick<ContractMethod, 'selector'>;

Expand Down
10 changes: 7 additions & 3 deletions services/event-cannon/src/cannon/scenarios/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export const getNewSchnorrAccount = async ({
salt: Fr;
}) => {
logger.info(" Creating new Schnorr account...");
const schnorrAccount = getSchnorrAccount(
const schnorrAccount = await getSchnorrAccount(
pxe,
secretKey,
deriveSigningKey(secretKey),
Expand All @@ -70,7 +70,7 @@ export const getNewSchnorrAccount = async ({
logger.info(
` Schnorr account created ${schnorrAccount.getAddress().toString()}`
);
const { address } = schnorrAccount.getCompleteAddress();
const { address } = await schnorrAccount.getCompleteAddress();
logger.info(" Deploying Schnorr account to network...");
await logAndWaitForTx(schnorrAccount.deploy(), "Deploying account");
logger.info(" Getting Schnorr account wallet...");
Expand Down Expand Up @@ -208,7 +208,11 @@ export const publicDeployAccounts = async (
(
await registerContractClass(sender, SchnorrAccountContractArtifact)
).request(),
...instances.map((instance) => deployInstance(sender, instance!).request()),
...(await Promise.all(
instances.map(async (instance) =>
(await deployInstance(sender, instance!)).request()
)
)),
]);
await batch.send().wait();
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ authors = [ "" ]
compiler_version = ">=0.25.0"

[dependencies]
aztec = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "aztec-packages-v0.71.0", directory = "noir-projects/aztec-nr/aztec" }
aztec = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "aztec-packages-v0.72.1", directory = "noir-projects/aztec-nr/aztec" }
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ use dep::aztec::macros::aztec;
contract SimpleLogging {
use dep::aztec::prelude::{Map, PublicMutable};
use dep::aztec::{
//keys::getters::get_public_keys,
macros::{storage::storage, functions::{public, initializer, private, internal}},
macros::{storage::storage, functions::{public, initializer, internal}},
};
#[storage]
struct Storage<Context> {
Expand All @@ -17,17 +16,6 @@ contract SimpleLogging {
fn constructor() {
}

#[private]
fn increase_counter_private(counter_id: Field) {
//let msg_sender_npk_m_hash = get_public_keys(context.msg_sender()).npk_m.hash();
//let secret = context.request_nsk_app(msg_sender_npk_m_hash); // get secret key of caller of function
//let nullifier = std::hash::pedersen_hash([context.msg_sender().to_field(), secret]); // derive nullifier from sender and secret
//context.push_nullifier(nullifier);
SimpleLogging::at(context.this_address()).add_to_counter_public(counter_id).enqueue(
&mut context,
);
}

#[public]
#[internal]
fn add_to_counter_public(counter_id: Field) {
Expand All @@ -37,7 +25,7 @@ contract SimpleLogging {

#[public]
fn increase_counter_public(counter_id: Field) {
context.emit_unencrypted_log(/*message=*/"Counter increased public");
context.emit_public_log(/*message=*/ "pub log");
SimpleLogging::at(context.this_address()).add_to_counter_public(counter_id);
}
unconstrained fn get_counter_value(counter_id: Field) -> pub Field {
Expand Down
Loading