Skip to content

Commit 4a06547

Browse files
author
AztecBot
committed
Merge branch 'next' into merge-train/avm
2 parents ee21b6b + 318e3f3 commit 4a06547

33 files changed

+727
-410
lines changed

yarn-project/archiver/src/archiver/archiver.ts

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,15 @@ import {
6464
} from '@aztec/stdlib/epoch-helpers';
6565
import type { GetContractClassLogsResponse, GetPublicLogsResponse } from '@aztec/stdlib/interfaces/client';
6666
import type { L2LogsSource } from '@aztec/stdlib/interfaces/server';
67-
import { ContractClassLog, type LogFilter, type PrivateLog, type PublicLog, TxScopedL2Log } from '@aztec/stdlib/logs';
67+
import {
68+
ContractClassLog,
69+
type LogFilter,
70+
type PrivateLog,
71+
type PublicLog,
72+
type SiloedTag,
73+
Tag,
74+
TxScopedL2Log,
75+
} from '@aztec/stdlib/logs';
6876
import { type L1ToL2MessageSource, computeInHashFromL1ToL2Messages } from '@aztec/stdlib/messaging';
6977
import type { CheckpointHeader } from '@aztec/stdlib/rollup';
7078
import { type BlockHeader, type IndexedTxEffect, TxHash, TxReceipt } from '@aztec/stdlib/tx';
@@ -1407,14 +1415,16 @@ export class Archiver
14071415
return this.store.getSettledTxReceipt(txHash);
14081416
}
14091417

1410-
/**
1411-
* Gets all logs that match any of the received tags (i.e. logs with their first field equal to a tag).
1412-
* @param tags - The tags to filter the logs by.
1413-
* @returns For each received tag, an array of matching logs is returned. An empty array implies no logs match
1414-
* that tag.
1415-
*/
1416-
getLogsByTags(tags: Fr[]): Promise<TxScopedL2Log[][]> {
1417-
return this.store.getLogsByTags(tags);
1418+
getPrivateLogsByTags(tags: SiloedTag[], logsPerTag?: number): Promise<TxScopedL2Log[][]> {
1419+
return this.store.getPrivateLogsByTags(tags, logsPerTag);
1420+
}
1421+
1422+
getPublicLogsByTagsFromContract(
1423+
contractAddress: AztecAddress,
1424+
tags: Tag[],
1425+
logsPerTag?: number,
1426+
): Promise<TxScopedL2Log[][]> {
1427+
return this.store.getPublicLogsByTagsFromContract(contractAddress, tags, logsPerTag);
14181428
}
14191429

14201430
/**
@@ -2072,8 +2082,15 @@ export class ArchiverStoreHelper
20722082
getL1ToL2MessageIndex(l1ToL2Message: Fr): Promise<bigint | undefined> {
20732083
return this.store.getL1ToL2MessageIndex(l1ToL2Message);
20742084
}
2075-
getLogsByTags(tags: Fr[], logsPerTag?: number): Promise<TxScopedL2Log[][]> {
2076-
return this.store.getLogsByTags(tags, logsPerTag);
2085+
getPrivateLogsByTags(tags: SiloedTag[], logsPerTag?: number): Promise<TxScopedL2Log[][]> {
2086+
return this.store.getPrivateLogsByTags(tags, logsPerTag);
2087+
}
2088+
getPublicLogsByTagsFromContract(
2089+
contractAddress: AztecAddress,
2090+
tags: Tag[],
2091+
logsPerTag?: number,
2092+
): Promise<TxScopedL2Log[][]> {
2093+
return this.store.getPublicLogsByTagsFromContract(contractAddress, tags, logsPerTag);
20772094
}
20782095
getPublicLogs(filter: LogFilter): Promise<GetPublicLogsResponse> {
20792096
return this.store.getPublicLogs(filter);

yarn-project/archiver/src/archiver/archiver_store.ts

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import type {
1414
UtilityFunctionWithMembershipProof,
1515
} from '@aztec/stdlib/contract';
1616
import type { GetContractClassLogsResponse, GetPublicLogsResponse } from '@aztec/stdlib/interfaces/client';
17-
import type { LogFilter, TxScopedL2Log } from '@aztec/stdlib/logs';
17+
import type { LogFilter, SiloedTag, Tag, TxScopedL2Log } from '@aztec/stdlib/logs';
1818
import { BlockHeader, type IndexedTxEffect, type TxHash, type TxReceipt } from '@aztec/stdlib/tx';
1919
import type { UInt64 } from '@aztec/stdlib/types';
2020

@@ -206,13 +206,27 @@ export interface ArchiverDataStore {
206206
getTotalL1ToL2MessageCount(): Promise<bigint>;
207207

208208
/**
209-
* Gets all logs that match any of the received tags (i.e. logs with their first field equal to a tag).
210-
* @param tags - The tags to filter the logs by.
209+
* Gets all private logs that match any of the received tags (i.e. logs with their first field equal to a SiloedTag).
210+
* @param tags - The SiloedTags to filter the logs by.
211211
* @param logsPerTag - The number of logs to return per tag. Defaults to everything
212-
* @returns For each received tag, an array of matching logs is returned. An empty array implies no logs match
212+
* @returns For each received tag, an array of matching private logs is returned. An empty array implies no logs match
213213
* that tag.
214214
*/
215-
getLogsByTags(tags: Fr[], logsPerTag?: number): Promise<TxScopedL2Log[][]>;
215+
getPrivateLogsByTags(tags: SiloedTag[], logsPerTag?: number): Promise<TxScopedL2Log[][]>;
216+
217+
/**
218+
* Gets all public logs that match any of the received tags from the specified contract (i.e. logs with their first field equal to a Tag).
219+
* @param contractAddress - The contract that emitted the public logs.
220+
* @param tags - The Tags to filter the logs by.
221+
* @param logsPerTag - The number of logs to return per tag. Defaults to everything
222+
* @returns For each received tag, an array of matching public logs is returned. An empty array implies no logs match
223+
* that tag.
224+
*/
225+
getPublicLogsByTagsFromContract(
226+
contractAddress: AztecAddress,
227+
tags: Tag[],
228+
logsPerTag?: number,
229+
): Promise<TxScopedL2Log[][]>;
216230

217231
/**
218232
* Gets public logs based on the provided filter.

0 commit comments

Comments
 (0)