Skip to content

Commit

Permalink
chore: logs
Browse files Browse the repository at this point in the history
  • Loading branch information
alexghr committed Dec 3, 2024
1 parent 45fae2b commit 123309c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion yarn-project/archiver/src/archiver/archiver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -827,8 +827,11 @@ class ArchiverStoreHelper
.filter(log => ContractClassRegisteredEvent.isContractClassRegisteredEvent(log.data))
.map(log => ContractClassRegisteredEvent.fromLog(log.data))
.map(e => e.toContractClassPublic());
this.#log.info(
`Block ${blockNum} has ${allLogs.length} logs, of which ${contractClasses} contract class registration events`,
);
if (contractClasses.length > 0) {
contractClasses.forEach(c => this.#log.verbose(`Registering contract class ${c.id.toString()}`));
contractClasses.forEach(c => this.#log.info(`Registering contract class ${c.id.toString()}`));
if (operation == Operation.Store) {
// TODO: Will probably want to create some worker threads to compute these bytecode commitments as they are expensive
return await this.store.addContractClasses(
Expand Down
4 changes: 3 additions & 1 deletion yarn-project/aztec.js/src/contract/deploy_method.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,10 @@ export class DeployMethod<TContract extends ContractBase = Contract> extends Bas
*/
public override async prove(options: DeployOptions): Promise<DeployProvenTx<TContract>> {
const txProvingResult = await this.proveInternal(options);
const tx = txProvingResult.toTx();
const instance = this.getInstance(options);
return new DeployProvenTx(this.wallet, txProvingResult.toTx(), this.postDeployCtor, instance);
this.log.info(`Tx ${tx.getTxHash()} contains ${tx.contractClassLogs.unrollLogs().length} contract class logs`);
return new DeployProvenTx(this.wallet, tx, this.postDeployCtor, instance);
}

/**
Expand Down
1 change: 1 addition & 0 deletions yarn-project/aztec.js/src/deployment/register_class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@ export async function registerContractClass(
const encodedBytecode = bufferAsFields(packedBytecode, MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS);
const registerer = getRegistererContract(wallet);
await wallet.addCapsule(encodedBytecode);
console.log({ contract: artifact.name, emitPublicBytecode });
return registerer.methods.register(artifactHash, privateFunctionsRoot, publicBytecodeCommitment, emitPublicBytecode);
}

0 comments on commit 123309c

Please sign in to comment.