@aztec/archiver 3.0.0-nightly.20251124 → 3.0.0-nightly.20251125
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -92,7 +92,7 @@ export async function retrievedBlockToPublishedL2Block({ archiveRoot, stateRefer
|
|
|
92
92
|
if (searchStartBlock > searchEndBlock) {
|
|
93
93
|
break;
|
|
94
94
|
}
|
|
95
|
-
const l2BlockProposedLogs = (await rollup.getEvents.
|
|
95
|
+
const l2BlockProposedLogs = (await rollup.getEvents.CheckpointProposed({}, {
|
|
96
96
|
fromBlock: searchStartBlock,
|
|
97
97
|
toBlock: searchEndBlock
|
|
98
98
|
})).filter((log)=>log.blockNumber >= searchStartBlock && log.blockNumber <= searchEndBlock);
|
|
@@ -100,7 +100,7 @@ export async function retrievedBlockToPublishedL2Block({ archiveRoot, stateRefer
|
|
|
100
100
|
break;
|
|
101
101
|
}
|
|
102
102
|
const lastLog = l2BlockProposedLogs[l2BlockProposedLogs.length - 1];
|
|
103
|
-
logger.debug(`Got ${l2BlockProposedLogs.length} L2 block processed logs for L2 blocks ${l2BlockProposedLogs[0].args.
|
|
103
|
+
logger.debug(`Got ${l2BlockProposedLogs.length} L2 block processed logs for L2 blocks ${l2BlockProposedLogs[0].args.checkpointNumber}-${lastLog.args.checkpointNumber} between L1 blocks ${searchStartBlock}-${searchEndBlock}`);
|
|
104
104
|
if (rollupConstants === undefined) {
|
|
105
105
|
const [chainId, version, targetCommitteeSize] = await Promise.all([
|
|
106
106
|
publicClient.getChainId(),
|
|
@@ -129,7 +129,7 @@ export async function retrievedBlockToPublishedL2Block({ archiveRoot, stateRefer
|
|
|
129
129
|
*/ async function processL2BlockProposedLogs(rollup, publicClient, blobSinkClient, logs, { chainId, version, targetCommitteeSize }, logger) {
|
|
130
130
|
const retrievedBlocks = [];
|
|
131
131
|
await asyncPool(10, logs, async (log)=>{
|
|
132
|
-
const l2BlockNumber = Number(log.args.
|
|
132
|
+
const l2BlockNumber = Number(log.args.checkpointNumber);
|
|
133
133
|
const archive = log.args.archive;
|
|
134
134
|
const archiveFromChain = await rollup.read.archiveAt([
|
|
135
135
|
BigInt(l2BlockNumber)
|
|
@@ -306,13 +306,13 @@ export async function getL1BlockTime(publicClient, blockNumber) {
|
|
|
306
306
|
}
|
|
307
307
|
function mapLogsInboxMessage(logs) {
|
|
308
308
|
return logs.map((log)=>{
|
|
309
|
-
const { index, hash,
|
|
309
|
+
const { index, hash, checkpointNumber, rollingHash } = log.args;
|
|
310
310
|
return {
|
|
311
311
|
index: index,
|
|
312
312
|
leaf: Fr.fromHexString(hash),
|
|
313
313
|
l1BlockNumber: log.blockNumber,
|
|
314
314
|
l1BlockHash: Buffer32.fromString(log.blockHash),
|
|
315
|
-
l2BlockNumber: Number(
|
|
315
|
+
l2BlockNumber: Number(checkpointNumber),
|
|
316
316
|
rollingHash: Buffer16.fromString(rollingHash)
|
|
317
317
|
};
|
|
318
318
|
});
|
|
@@ -330,7 +330,7 @@ function mapLogsInboxMessage(logs) {
|
|
|
330
330
|
});
|
|
331
331
|
return logs.map((log)=>({
|
|
332
332
|
l1BlockNumber: log.blockNumber,
|
|
333
|
-
l2BlockNumber: Number(log.args.
|
|
333
|
+
l2BlockNumber: Number(log.args.checkpointNumber),
|
|
334
334
|
proverId: Fr.fromHexString(log.args.proverId),
|
|
335
335
|
txHash: log.transactionHash
|
|
336
336
|
}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/archiver",
|
|
3
|
-
"version": "3.0.0-nightly.
|
|
3
|
+
"version": "3.0.0-nightly.20251125",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dest/index.js",
|
|
@@ -66,18 +66,18 @@
|
|
|
66
66
|
]
|
|
67
67
|
},
|
|
68
68
|
"dependencies": {
|
|
69
|
-
"@aztec/blob-lib": "3.0.0-nightly.
|
|
70
|
-
"@aztec/blob-sink": "3.0.0-nightly.
|
|
71
|
-
"@aztec/constants": "3.0.0-nightly.
|
|
72
|
-
"@aztec/epoch-cache": "3.0.0-nightly.
|
|
73
|
-
"@aztec/ethereum": "3.0.0-nightly.
|
|
74
|
-
"@aztec/foundation": "3.0.0-nightly.
|
|
75
|
-
"@aztec/kv-store": "3.0.0-nightly.
|
|
76
|
-
"@aztec/l1-artifacts": "3.0.0-nightly.
|
|
77
|
-
"@aztec/noir-protocol-circuits-types": "3.0.0-nightly.
|
|
78
|
-
"@aztec/protocol-contracts": "3.0.0-nightly.
|
|
79
|
-
"@aztec/stdlib": "3.0.0-nightly.
|
|
80
|
-
"@aztec/telemetry-client": "3.0.0-nightly.
|
|
69
|
+
"@aztec/blob-lib": "3.0.0-nightly.20251125",
|
|
70
|
+
"@aztec/blob-sink": "3.0.0-nightly.20251125",
|
|
71
|
+
"@aztec/constants": "3.0.0-nightly.20251125",
|
|
72
|
+
"@aztec/epoch-cache": "3.0.0-nightly.20251125",
|
|
73
|
+
"@aztec/ethereum": "3.0.0-nightly.20251125",
|
|
74
|
+
"@aztec/foundation": "3.0.0-nightly.20251125",
|
|
75
|
+
"@aztec/kv-store": "3.0.0-nightly.20251125",
|
|
76
|
+
"@aztec/l1-artifacts": "3.0.0-nightly.20251125",
|
|
77
|
+
"@aztec/noir-protocol-circuits-types": "3.0.0-nightly.20251125",
|
|
78
|
+
"@aztec/protocol-contracts": "3.0.0-nightly.20251125",
|
|
79
|
+
"@aztec/stdlib": "3.0.0-nightly.20251125",
|
|
80
|
+
"@aztec/telemetry-client": "3.0.0-nightly.20251125",
|
|
81
81
|
"lodash.groupby": "^4.6.0",
|
|
82
82
|
"lodash.omit": "^4.5.0",
|
|
83
83
|
"tsc-watch": "^6.0.0",
|
package/src/archiver/archiver.ts
CHANGED
|
@@ -885,7 +885,7 @@ export class Archiver extends (EventEmitter as new () => ArchiverEmitter) implem
|
|
|
885
885
|
validationResult,
|
|
886
886
|
});
|
|
887
887
|
|
|
888
|
-
// We keep consuming blocks if we find an invalid one, since we do not listen for
|
|
888
|
+
// We keep consuming blocks if we find an invalid one, since we do not listen for CheckpointInvalidated events
|
|
889
889
|
// We just pretend the invalid ones are not there and keep consuming the next blocks
|
|
890
890
|
// Note that this breaks if the committee ever attests to a descendant of an invalid block
|
|
891
891
|
continue;
|
|
@@ -173,7 +173,7 @@ export async function retrieveBlocksFromRollup(
|
|
|
173
173
|
break;
|
|
174
174
|
}
|
|
175
175
|
const l2BlockProposedLogs = (
|
|
176
|
-
await rollup.getEvents.
|
|
176
|
+
await rollup.getEvents.CheckpointProposed(
|
|
177
177
|
{},
|
|
178
178
|
{
|
|
179
179
|
fromBlock: searchStartBlock,
|
|
@@ -188,7 +188,7 @@ export async function retrieveBlocksFromRollup(
|
|
|
188
188
|
|
|
189
189
|
const lastLog = l2BlockProposedLogs[l2BlockProposedLogs.length - 1];
|
|
190
190
|
logger.debug(
|
|
191
|
-
`Got ${l2BlockProposedLogs.length} L2 block processed logs for L2 blocks ${l2BlockProposedLogs[0].args.
|
|
191
|
+
`Got ${l2BlockProposedLogs.length} L2 block processed logs for L2 blocks ${l2BlockProposedLogs[0].args.checkpointNumber}-${lastLog.args.checkpointNumber} between L1 blocks ${searchStartBlock}-${searchEndBlock}`,
|
|
192
192
|
);
|
|
193
193
|
|
|
194
194
|
if (rollupConstants === undefined) {
|
|
@@ -231,13 +231,13 @@ async function processL2BlockProposedLogs(
|
|
|
231
231
|
rollup: GetContractReturnType<typeof RollupAbi, ViemPublicClient>,
|
|
232
232
|
publicClient: ViemPublicClient,
|
|
233
233
|
blobSinkClient: BlobSinkClientInterface,
|
|
234
|
-
logs: GetContractEventsReturnType<typeof RollupAbi, '
|
|
234
|
+
logs: GetContractEventsReturnType<typeof RollupAbi, 'CheckpointProposed'>,
|
|
235
235
|
{ chainId, version, targetCommitteeSize }: { chainId: Fr; version: Fr; targetCommitteeSize: number },
|
|
236
236
|
logger: Logger,
|
|
237
237
|
): Promise<RetrievedL2Block[]> {
|
|
238
238
|
const retrievedBlocks: RetrievedL2Block[] = [];
|
|
239
239
|
await asyncPool(10, logs, async log => {
|
|
240
|
-
const l2BlockNumber = Number(log.args.
|
|
240
|
+
const l2BlockNumber = Number(log.args.checkpointNumber!);
|
|
241
241
|
const archive = log.args.archive!;
|
|
242
242
|
const archiveFromChain = await rollup.read.archiveAt([BigInt(l2BlockNumber)]);
|
|
243
243
|
const blobHashes = log.args.versionedBlobHashes!.map(blobHash => Buffer.from(blobHash.slice(2), 'hex'));
|
|
@@ -474,13 +474,13 @@ export async function retrieveL1ToL2Messages(
|
|
|
474
474
|
|
|
475
475
|
function mapLogsInboxMessage(logs: GetContractEventsReturnType<typeof InboxAbi, 'MessageSent'>): InboxMessage[] {
|
|
476
476
|
return logs.map(log => {
|
|
477
|
-
const { index, hash,
|
|
477
|
+
const { index, hash, checkpointNumber, rollingHash } = log.args;
|
|
478
478
|
return {
|
|
479
479
|
index: index!,
|
|
480
480
|
leaf: Fr.fromHexString(hash!),
|
|
481
481
|
l1BlockNumber: log.blockNumber,
|
|
482
482
|
l1BlockHash: Buffer32.fromString(log.blockHash),
|
|
483
|
-
l2BlockNumber: Number(
|
|
483
|
+
l2BlockNumber: Number(checkpointNumber!),
|
|
484
484
|
rollingHash: Buffer16.fromString(rollingHash!),
|
|
485
485
|
};
|
|
486
486
|
});
|
|
@@ -503,7 +503,7 @@ export async function retrieveL2ProofVerifiedEvents(
|
|
|
503
503
|
|
|
504
504
|
return logs.map(log => ({
|
|
505
505
|
l1BlockNumber: log.blockNumber,
|
|
506
|
-
l2BlockNumber: Number(log.args.
|
|
506
|
+
l2BlockNumber: Number(log.args.checkpointNumber),
|
|
507
507
|
proverId: Fr.fromHexString(log.args.proverId),
|
|
508
508
|
txHash: log.transactionHash,
|
|
509
509
|
}));
|