@aztec/world-state 0.0.1-commit.03f7ef2 → 0.0.1-commit.04d373f
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.
- package/dest/instrumentation/instrumentation.d.ts +1 -1
- package/dest/instrumentation/instrumentation.d.ts.map +1 -1
- package/dest/instrumentation/instrumentation.js +17 -41
- package/dest/native/fork_checkpoint.d.ts +7 -1
- package/dest/native/fork_checkpoint.d.ts.map +1 -1
- package/dest/native/fork_checkpoint.js +15 -3
- package/dest/native/ipc_world_state_instance.d.ts +50 -0
- package/dest/native/ipc_world_state_instance.d.ts.map +1 -0
- package/dest/native/ipc_world_state_instance.js +628 -0
- package/dest/native/merkle_trees_facade.d.ts +9 -6
- package/dest/native/merkle_trees_facade.d.ts.map +1 -1
- package/dest/native/merkle_trees_facade.js +47 -16
- package/dest/native/message.d.ts +13 -5
- package/dest/native/message.d.ts.map +1 -1
- package/dest/native/native_world_state.d.ts +34 -8
- package/dest/native/native_world_state.d.ts.map +1 -1
- package/dest/native/native_world_state.js +81 -27
- package/dest/native/native_world_state_instance.d.ts +6 -5
- package/dest/native/native_world_state_instance.d.ts.map +1 -1
- package/dest/native/native_world_state_instance.js +33 -26
- package/dest/native/world_state_ops_queue.js +5 -5
- package/dest/synchronizer/config.d.ts +3 -5
- package/dest/synchronizer/config.d.ts.map +1 -1
- package/dest/synchronizer/config.js +15 -18
- package/dest/synchronizer/factory.d.ts +6 -5
- package/dest/synchronizer/factory.d.ts.map +1 -1
- package/dest/synchronizer/factory.js +7 -6
- package/dest/synchronizer/server_world_state_synchronizer.d.ts +4 -5
- package/dest/synchronizer/server_world_state_synchronizer.d.ts.map +1 -1
- package/dest/synchronizer/server_world_state_synchronizer.js +139 -39
- package/dest/test/utils.d.ts +7 -7
- package/dest/test/utils.d.ts.map +1 -1
- package/dest/test/utils.js +5 -5
- package/dest/testing.d.ts +4 -3
- package/dest/testing.d.ts.map +1 -1
- package/dest/testing.js +10 -6
- package/dest/world-state-db/merkle_tree_db.d.ts +5 -14
- package/dest/world-state-db/merkle_tree_db.d.ts.map +1 -1
- package/package.json +13 -12
- package/src/instrumentation/instrumentation.ts +17 -41
- package/src/native/fork_checkpoint.ts +19 -3
- package/src/native/ipc_world_state_instance.ts +717 -0
- package/src/native/merkle_trees_facade.ts +51 -17
- package/src/native/message.ts +14 -4
- package/src/native/native_world_state.ts +108 -32
- package/src/native/native_world_state_instance.ts +44 -32
- package/src/native/world_state_ops_queue.ts +5 -5
- package/src/synchronizer/config.ts +16 -23
- package/src/synchronizer/factory.ts +19 -11
- package/src/synchronizer/server_world_state_synchronizer.ts +142 -53
- package/src/test/utils.ts +6 -6
- package/src/testing.ts +8 -9
- package/src/world-state-db/merkle_tree_db.ts +8 -14
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { INITIAL_CHECKPOINT_NUMBER } from '@aztec/constants';
|
|
2
|
+
import { BlockNumber, CheckpointNumber } from '@aztec/foundation/branded-types';
|
|
2
3
|
import { createLogger } from '@aztec/foundation/log';
|
|
3
4
|
import { promiseWithResolvers } from '@aztec/foundation/promise';
|
|
4
5
|
import { elapsed } from '@aztec/foundation/timer';
|
|
6
|
+
import { GENESIS_CHECKPOINT_HEADER_HASH, L2BlockStream } from '@aztec/stdlib/block';
|
|
5
7
|
import { WorldStateRunningState } from '@aztec/stdlib/interfaces/server';
|
|
6
8
|
import { MerkleTreeId } from '@aztec/stdlib/trees';
|
|
7
|
-
import {
|
|
9
|
+
import { getTelemetryClient } from '@aztec/telemetry-client';
|
|
8
10
|
import { WorldStateInstrumentation } from '../instrumentation/instrumentation.js';
|
|
9
11
|
import { WorldStateSynchronizerError } from './errors.js';
|
|
10
12
|
/**
|
|
@@ -21,7 +23,6 @@ import { WorldStateSynchronizerError } from './errors.js';
|
|
|
21
23
|
latestBlockNumberAtStart;
|
|
22
24
|
historyToKeep;
|
|
23
25
|
currentState;
|
|
24
|
-
latestBlockHashQuery;
|
|
25
26
|
syncPromise;
|
|
26
27
|
blockStream;
|
|
27
28
|
// WorldState doesn't track the proven block number, it only tracks the latest tips of the pending chain and the finalized chain
|
|
@@ -35,10 +36,9 @@ import { WorldStateSynchronizerError } from './errors.js';
|
|
|
35
36
|
this.log = log;
|
|
36
37
|
this.latestBlockNumberAtStart = BlockNumber.ZERO;
|
|
37
38
|
this.currentState = WorldStateRunningState.IDLE;
|
|
38
|
-
this.latestBlockHashQuery = undefined;
|
|
39
39
|
this.syncPromise = promiseWithResolvers();
|
|
40
40
|
this.merkleTreeCommitted = this.merkleTreeDb.getCommitted();
|
|
41
|
-
this.historyToKeep = config.
|
|
41
|
+
this.historyToKeep = config.worldStateCheckpointHistory < 1 ? undefined : config.worldStateCheckpointHistory;
|
|
42
42
|
this.log.info(`Created world state synchroniser with block history of ${this.historyToKeep === undefined ? 'infinity' : this.historyToKeep}`);
|
|
43
43
|
}
|
|
44
44
|
getCommitted() {
|
|
@@ -64,7 +64,7 @@ import { WorldStateSynchronizerError } from './errors.js';
|
|
|
64
64
|
return this.syncPromise;
|
|
65
65
|
}
|
|
66
66
|
// Get the current latest block number
|
|
67
|
-
this.latestBlockNumberAtStart = BlockNumber(await
|
|
67
|
+
this.latestBlockNumberAtStart = BlockNumber(await this.l2BlockSource.getBlockNumber());
|
|
68
68
|
const blockToDownloadFrom = await this.getLatestBlockNumber() + 1;
|
|
69
69
|
if (blockToDownloadFrom <= this.latestBlockNumberAtStart) {
|
|
70
70
|
// If there are blocks to be retrieved, go to a synching state
|
|
@@ -82,12 +82,11 @@ import { WorldStateSynchronizerError } from './errors.js';
|
|
|
82
82
|
return this.syncPromise.promise;
|
|
83
83
|
}
|
|
84
84
|
createBlockStream() {
|
|
85
|
-
const tracer = this.instrumentation.telemetry.getTracer('WorldStateL2BlockStream');
|
|
86
85
|
const logger = createLogger('world-state:block_stream');
|
|
87
|
-
return new
|
|
88
|
-
proven: this.config.worldStateProvenBlocksOnly,
|
|
86
|
+
return new L2BlockStream(this.l2BlockSource, this, this, logger, {
|
|
89
87
|
pollIntervalMS: this.config.worldStateBlockCheckIntervalMS,
|
|
90
|
-
batchSize: this.config.worldStateBlockRequestBatchSize
|
|
88
|
+
batchSize: this.config.worldStateBlockRequestBatchSize,
|
|
89
|
+
ignoreCheckpoints: true
|
|
91
90
|
});
|
|
92
91
|
}
|
|
93
92
|
async stop() {
|
|
@@ -113,7 +112,7 @@ import { WorldStateSynchronizerError } from './errors.js';
|
|
|
113
112
|
};
|
|
114
113
|
}
|
|
115
114
|
async getLatestBlockNumber() {
|
|
116
|
-
return (await this.getL2Tips()).
|
|
115
|
+
return (await this.getL2Tips()).proposed.number;
|
|
117
116
|
}
|
|
118
117
|
async stopSync() {
|
|
119
118
|
this.log.debug('Stopping sync...');
|
|
@@ -131,9 +130,9 @@ import { WorldStateSynchronizerError } from './errors.js';
|
|
|
131
130
|
/**
|
|
132
131
|
* Forces an immediate sync.
|
|
133
132
|
* @param targetBlockNumber - The target block number that we must sync to. Will download unproven blocks if needed to reach it.
|
|
134
|
-
* @param
|
|
133
|
+
* @param blockHash - If provided, verifies the block at targetBlockNumber matches this hash. On mismatch, triggers a resync (reorg detection).
|
|
135
134
|
* @returns A promise that resolves with the block number the world state was synced to
|
|
136
|
-
*/ async syncImmediate(targetBlockNumber,
|
|
135
|
+
*/ async syncImmediate(targetBlockNumber, blockHash) {
|
|
137
136
|
if (this.currentState !== WorldStateRunningState.RUNNING) {
|
|
138
137
|
throw new Error(`World State is not running. Unable to perform sync.`);
|
|
139
138
|
}
|
|
@@ -143,7 +142,16 @@ import { WorldStateSynchronizerError } from './errors.js';
|
|
|
143
142
|
// If we have been given a block number to sync to and we have reached that number then return
|
|
144
143
|
const currentBlockNumber = await this.getLatestBlockNumber();
|
|
145
144
|
if (targetBlockNumber !== undefined && targetBlockNumber <= currentBlockNumber) {
|
|
146
|
-
|
|
145
|
+
if (blockHash === undefined) {
|
|
146
|
+
return currentBlockNumber;
|
|
147
|
+
}
|
|
148
|
+
// If a block hash was provided, verify we're on the expected fork
|
|
149
|
+
const currentHash = await this.getL2BlockHash(targetBlockNumber);
|
|
150
|
+
if (currentHash === blockHash.toString()) {
|
|
151
|
+
return currentBlockNumber;
|
|
152
|
+
}
|
|
153
|
+
// Hash mismatch: a reorg may have occurred, fall through to trigger sync
|
|
154
|
+
this.log.debug(`World state block hash mismatch at ${targetBlockNumber} (expected ${blockHash}, got ${currentHash}). Triggering resync.`);
|
|
147
155
|
}
|
|
148
156
|
this.log.debug(`World State at ${currentBlockNumber} told to sync to ${targetBlockNumber ?? 'latest'}`);
|
|
149
157
|
// If the archiver is behind the target block, force an archiver sync
|
|
@@ -158,7 +166,7 @@ import { WorldStateSynchronizerError } from './errors.js';
|
|
|
158
166
|
await this.blockStream.sync();
|
|
159
167
|
// If we have been given a block number to sync to and we have not reached that number then fail
|
|
160
168
|
const updatedBlockNumber = await this.getLatestBlockNumber();
|
|
161
|
-
if (
|
|
169
|
+
if (targetBlockNumber !== undefined && targetBlockNumber > updatedBlockNumber) {
|
|
162
170
|
throw new WorldStateSynchronizerError(`Unable to sync to block number ${targetBlockNumber} (last synced is ${updatedBlockNumber})`, {
|
|
163
171
|
cause: {
|
|
164
172
|
reason: 'block_not_available',
|
|
@@ -168,43 +176,96 @@ import { WorldStateSynchronizerError } from './errors.js';
|
|
|
168
176
|
}
|
|
169
177
|
});
|
|
170
178
|
}
|
|
179
|
+
// If a block hash was provided, verify we're on the expected fork after syncing, throw otherwise
|
|
180
|
+
if (blockHash !== undefined && targetBlockNumber !== undefined) {
|
|
181
|
+
const updatedHash = await this.getL2BlockHash(targetBlockNumber);
|
|
182
|
+
if (updatedHash !== blockHash.toString()) {
|
|
183
|
+
throw new WorldStateSynchronizerError(`Block hash mismatch at block ${targetBlockNumber} (expected ${blockHash} but got ${updatedHash})`, {
|
|
184
|
+
cause: {
|
|
185
|
+
reason: 'block_hash_mismatch',
|
|
186
|
+
targetBlockNumber,
|
|
187
|
+
expectedHash: blockHash.toString(),
|
|
188
|
+
actualHash: updatedHash
|
|
189
|
+
}
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
}
|
|
171
193
|
return updatedBlockNumber;
|
|
172
194
|
}
|
|
173
195
|
/** Returns the L2 block hash for a given number. Used by the L2BlockStream for detecting reorgs. */ async getL2BlockHash(number) {
|
|
174
196
|
if (number === BlockNumber.ZERO) {
|
|
175
197
|
return (await this.merkleTreeCommitted.getInitialHeader().hash()).toString();
|
|
176
198
|
}
|
|
177
|
-
|
|
178
|
-
this.latestBlockHashQuery = {
|
|
179
|
-
hash: await this.merkleTreeCommitted.getLeafValue(MerkleTreeId.ARCHIVE, BigInt(number)).then((leaf)=>leaf?.toString()),
|
|
180
|
-
blockNumber: number
|
|
181
|
-
};
|
|
182
|
-
}
|
|
183
|
-
return this.latestBlockHashQuery.hash;
|
|
199
|
+
return this.merkleTreeCommitted.getLeafValue(MerkleTreeId.ARCHIVE, BigInt(number)).then((leaf)=>leaf?.toString());
|
|
184
200
|
}
|
|
185
201
|
/** Returns the latest L2 block number for each tip of the chain (latest, proven, finalized). */ async getL2Tips() {
|
|
186
202
|
const status = await this.merkleTreeDb.getStatusSummary();
|
|
187
|
-
const
|
|
203
|
+
const unfinalizedBlockHashPromise = this.getL2BlockHash(status.unfinalizedBlockNumber);
|
|
204
|
+
const finalizedBlockHashPromise = this.getL2BlockHash(status.finalizedBlockNumber);
|
|
205
|
+
const provenBlockNumber = this.provenBlockNumber ?? status.finalizedBlockNumber;
|
|
206
|
+
const provenBlockHashPromise = this.provenBlockNumber === undefined ? finalizedBlockHashPromise : this.getL2BlockHash(this.provenBlockNumber);
|
|
207
|
+
const [unfinalizedBlockHash, finalizedBlockHash, provenBlockHash] = await Promise.all([
|
|
208
|
+
unfinalizedBlockHashPromise,
|
|
209
|
+
finalizedBlockHashPromise,
|
|
210
|
+
provenBlockHashPromise
|
|
211
|
+
]);
|
|
188
212
|
const latestBlockId = {
|
|
189
213
|
number: status.unfinalizedBlockNumber,
|
|
190
214
|
hash: unfinalizedBlockHash
|
|
191
215
|
};
|
|
216
|
+
// World state doesn't track checkpointed blocks or checkpoints themselves.
|
|
217
|
+
// but we use a block stream so we need to provide 'local' L2Tips.
|
|
218
|
+
// We configure the block stream to ignore checkpoints and set checkpoint values to genesis here.
|
|
219
|
+
const genesisCheckpointHeaderHash = GENESIS_CHECKPOINT_HEADER_HASH.toString();
|
|
220
|
+
const initialBlockHash = (await this.merkleTreeCommitted.getInitialHeader().hash()).toString();
|
|
192
221
|
return {
|
|
193
|
-
|
|
222
|
+
proposed: latestBlockId,
|
|
223
|
+
checkpointed: {
|
|
224
|
+
block: {
|
|
225
|
+
number: BlockNumber.ZERO,
|
|
226
|
+
hash: initialBlockHash
|
|
227
|
+
},
|
|
228
|
+
checkpoint: {
|
|
229
|
+
number: INITIAL_CHECKPOINT_NUMBER,
|
|
230
|
+
hash: genesisCheckpointHeaderHash
|
|
231
|
+
}
|
|
232
|
+
},
|
|
233
|
+
proposedCheckpoint: {
|
|
234
|
+
block: {
|
|
235
|
+
number: BlockNumber.ZERO,
|
|
236
|
+
hash: initialBlockHash
|
|
237
|
+
},
|
|
238
|
+
checkpoint: {
|
|
239
|
+
number: INITIAL_CHECKPOINT_NUMBER,
|
|
240
|
+
hash: genesisCheckpointHeaderHash
|
|
241
|
+
}
|
|
242
|
+
},
|
|
194
243
|
finalized: {
|
|
195
|
-
|
|
196
|
-
|
|
244
|
+
block: {
|
|
245
|
+
number: status.finalizedBlockNumber,
|
|
246
|
+
hash: finalizedBlockHash ?? ''
|
|
247
|
+
},
|
|
248
|
+
checkpoint: {
|
|
249
|
+
number: INITIAL_CHECKPOINT_NUMBER,
|
|
250
|
+
hash: genesisCheckpointHeaderHash
|
|
251
|
+
}
|
|
197
252
|
},
|
|
198
253
|
proven: {
|
|
199
|
-
|
|
200
|
-
|
|
254
|
+
block: {
|
|
255
|
+
number: provenBlockNumber,
|
|
256
|
+
hash: provenBlockHash ?? ''
|
|
257
|
+
},
|
|
258
|
+
checkpoint: {
|
|
259
|
+
number: INITIAL_CHECKPOINT_NUMBER,
|
|
260
|
+
hash: genesisCheckpointHeaderHash
|
|
261
|
+
}
|
|
201
262
|
}
|
|
202
263
|
};
|
|
203
264
|
}
|
|
204
265
|
/** Handles an event emitted by the block stream. */ async handleBlockStreamEvent(event) {
|
|
205
266
|
switch(event.type){
|
|
206
267
|
case 'blocks-added':
|
|
207
|
-
await this.handleL2Blocks(event.blocks
|
|
268
|
+
await this.handleL2Blocks(event.blocks);
|
|
208
269
|
break;
|
|
209
270
|
case 'chain-pruned':
|
|
210
271
|
await this.handleChainPruned(event.block.number);
|
|
@@ -222,7 +283,7 @@ import { WorldStateSynchronizerError } from './errors.js';
|
|
|
222
283
|
* @param l2Blocks - The L2 blocks to handle.
|
|
223
284
|
* @returns Whether the block handled was produced by this same node.
|
|
224
285
|
*/ async handleL2Blocks(l2Blocks) {
|
|
225
|
-
this.log.
|
|
286
|
+
this.log.debug(`Handling L2 blocks ${l2Blocks[0].number} to ${l2Blocks.at(-1).number}`);
|
|
226
287
|
// Fetch the L1->L2 messages for the first block in a checkpoint.
|
|
227
288
|
const messagesForBlocks = new Map();
|
|
228
289
|
await Promise.all(l2Blocks.filter((b)=>b.indexWithinCheckpoint === 0).map(async (block)=>{
|
|
@@ -253,10 +314,12 @@ import { WorldStateSynchronizerError } from './errors.js';
|
|
|
253
314
|
* @param l1ToL2Messages - The L1 to L2 messages for the block.
|
|
254
315
|
* @returns Whether the block handled was produced by this same node.
|
|
255
316
|
*/ async handleL2Block(l2Block, l1ToL2Messages) {
|
|
256
|
-
this.log.
|
|
317
|
+
this.log.debug(`Pushing L2 block ${l2Block.number} to merkle tree db `, {
|
|
257
318
|
blockNumber: l2Block.number,
|
|
258
319
|
blockHash: await l2Block.hash().then((h)=>h.toString()),
|
|
259
|
-
l1ToL2Messages: l1ToL2Messages.map((msg)=>msg.toString())
|
|
320
|
+
l1ToL2Messages: l1ToL2Messages.map((msg)=>msg.toString()),
|
|
321
|
+
blockHeader: l2Block.header.toInspect(),
|
|
322
|
+
blockStats: l2Block.getStats()
|
|
260
323
|
});
|
|
261
324
|
const result = await this.merkleTreeDb.handleL2BlockAndMessages(l2Block, l1ToL2Messages);
|
|
262
325
|
if (this.currentState === WorldStateRunningState.SYNCHING && l2Block.number >= this.latestBlockNumberAtStart) {
|
|
@@ -267,16 +330,52 @@ import { WorldStateSynchronizerError } from './errors.js';
|
|
|
267
330
|
}
|
|
268
331
|
async handleChainFinalized(blockNumber) {
|
|
269
332
|
this.log.verbose(`Finalized chain is now at block ${blockNumber}`);
|
|
333
|
+
// If the finalized block number is older than the oldest available block in world state,
|
|
334
|
+
// skip entirely. The finalized block number can jump backwards (e.g. when the finalization
|
|
335
|
+
// heuristic changes) and try to read block data that has already been pruned. When this
|
|
336
|
+
// happens, there is nothing useful to do — the native world state is already finalized
|
|
337
|
+
// past this point and pruning has already happened.
|
|
338
|
+
const currentSummary = await this.merkleTreeDb.getStatusSummary();
|
|
339
|
+
if (blockNumber < currentSummary.oldestHistoricalBlock || blockNumber < 1) {
|
|
340
|
+
this.log.trace(`Finalized block ${blockNumber} is older than the oldest available block ${currentSummary.oldestHistoricalBlock}. Skipping.`);
|
|
341
|
+
return;
|
|
342
|
+
}
|
|
270
343
|
const summary = await this.merkleTreeDb.setFinalized(blockNumber);
|
|
271
344
|
if (this.historyToKeep === undefined) {
|
|
272
345
|
return;
|
|
273
346
|
}
|
|
274
|
-
const
|
|
275
|
-
|
|
347
|
+
const finalisedBlockData = await this.l2BlockSource.getBlockData({
|
|
348
|
+
number: summary.finalizedBlockNumber
|
|
349
|
+
});
|
|
350
|
+
if (finalisedBlockData === undefined) {
|
|
351
|
+
this.log.warn(`Failed to retrieve checkpointed block for finalized block number: ${summary.finalizedBlockNumber}`);
|
|
352
|
+
return;
|
|
353
|
+
}
|
|
354
|
+
// Compute the required historic checkpoint number
|
|
355
|
+
const newHistoricCheckpointNumber = finalisedBlockData.checkpointNumber - this.historyToKeep + 1;
|
|
356
|
+
if (newHistoricCheckpointNumber <= 1) {
|
|
357
|
+
return;
|
|
358
|
+
}
|
|
359
|
+
// Retrieve the historic checkpoint
|
|
360
|
+
const historicCheckpoint = await this.l2BlockSource.getCheckpoint({
|
|
361
|
+
number: CheckpointNumber(newHistoricCheckpointNumber)
|
|
362
|
+
});
|
|
363
|
+
if (!historicCheckpoint) {
|
|
364
|
+
this.log.warn(`Failed to retrieve checkpoint number ${newHistoricCheckpointNumber} from Archiver`);
|
|
365
|
+
return;
|
|
366
|
+
}
|
|
367
|
+
if (historicCheckpoint.checkpoint.blocks.length === 0 || historicCheckpoint.checkpoint.blocks[0] === undefined) {
|
|
368
|
+
this.log.warn(`Retrieved checkpoint number ${newHistoricCheckpointNumber} has no blocks!`);
|
|
276
369
|
return;
|
|
277
370
|
}
|
|
278
|
-
|
|
279
|
-
const
|
|
371
|
+
// Find the block at the start of the checkpoint and remove blocks up to this one
|
|
372
|
+
const newHistoricBlock = historicCheckpoint.checkpoint.blocks[0];
|
|
373
|
+
if (newHistoricBlock.number <= currentSummary.oldestHistoricalBlock) {
|
|
374
|
+
this.log.debug(`Historic block ${newHistoricBlock.number} is not newer than oldest available ${currentSummary.oldestHistoricalBlock}. Skipping prune.`);
|
|
375
|
+
return;
|
|
376
|
+
}
|
|
377
|
+
this.log.verbose(`Pruning historic blocks to ${newHistoricBlock.number}`);
|
|
378
|
+
const status = await this.merkleTreeDb.removeHistoricalBlocks(BlockNumber(newHistoricBlock.number));
|
|
280
379
|
this.log.debug(`World state summary `, status.summary);
|
|
281
380
|
}
|
|
282
381
|
handleChainProven(blockNumber) {
|
|
@@ -285,10 +384,11 @@ import { WorldStateSynchronizerError } from './errors.js';
|
|
|
285
384
|
return Promise.resolve();
|
|
286
385
|
}
|
|
287
386
|
async handleChainPruned(blockNumber) {
|
|
288
|
-
this.log.
|
|
387
|
+
this.log.info(`Chain pruned to block ${blockNumber}`);
|
|
289
388
|
const status = await this.merkleTreeDb.unwindBlocks(blockNumber);
|
|
290
|
-
this.
|
|
291
|
-
|
|
389
|
+
if (this.provenBlockNumber !== undefined && this.provenBlockNumber > blockNumber) {
|
|
390
|
+
this.provenBlockNumber = undefined;
|
|
391
|
+
}
|
|
292
392
|
this.instrumentation.updateWorldStateMetrics(status);
|
|
293
393
|
}
|
|
294
394
|
/**
|
package/dest/test/utils.d.ts
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import { BlockNumber, type CheckpointNumber } from '@aztec/foundation/branded-types';
|
|
2
2
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
3
|
-
import {
|
|
3
|
+
import { L2Block } from '@aztec/stdlib/block';
|
|
4
4
|
import type { MerkleTreeReadOperations, MerkleTreeWriteOperations } from '@aztec/stdlib/interfaces/server';
|
|
5
5
|
import { mockCheckpointAndMessages } from '@aztec/stdlib/testing';
|
|
6
6
|
import type { NativeWorldStateService } from '../native/native_world_state.js';
|
|
7
|
-
export declare function updateBlockState(block:
|
|
7
|
+
export declare function updateBlockState(block: L2Block, l1ToL2Messages: Fr[], fork: MerkleTreeWriteOperations): Promise<void>;
|
|
8
8
|
export declare function mockBlock(blockNum: BlockNumber, size: number, fork: MerkleTreeWriteOperations, maxEffects?: number | undefined, numL1ToL2Messages?: number, isFirstBlockInCheckpoint?: boolean): Promise<{
|
|
9
|
-
block:
|
|
9
|
+
block: L2Block;
|
|
10
10
|
messages: Fr[];
|
|
11
11
|
}>;
|
|
12
12
|
export declare function mockEmptyBlock(blockNum: BlockNumber, fork: MerkleTreeWriteOperations): Promise<{
|
|
13
|
-
block:
|
|
13
|
+
block: L2Block;
|
|
14
14
|
messages: Fr[];
|
|
15
15
|
}>;
|
|
16
16
|
export declare function mockBlocks(from: BlockNumber, count: number, numTxs: number, worldState: NativeWorldStateService): Promise<{
|
|
17
|
-
blocks:
|
|
17
|
+
blocks: L2Block[];
|
|
18
18
|
messages: Fr[][];
|
|
19
19
|
}>;
|
|
20
20
|
export declare function mockCheckpoint(checkpointNumber: CheckpointNumber, fork: MerkleTreeWriteOperations, options?: Partial<Parameters<typeof mockCheckpointAndMessages>[1]>): Promise<{
|
|
21
|
-
checkpoint: import("
|
|
21
|
+
checkpoint: import("@aztec/stdlib/checkpoint").Checkpoint;
|
|
22
22
|
messages: Fr[];
|
|
23
23
|
}>;
|
|
24
24
|
export declare function assertSameState(forkA: MerkleTreeReadOperations, forkB: MerkleTreeReadOperations): Promise<void>;
|
|
25
25
|
export declare function compareChains(left: MerkleTreeReadOperations, right: MerkleTreeReadOperations): Promise<void>;
|
|
26
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
26
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbHMuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy90ZXN0L3V0aWxzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQU9BLE9BQU8sRUFBRSxXQUFXLEVBQUUsS0FBSyxnQkFBZ0IsRUFBeUIsTUFBTSxpQ0FBaUMsQ0FBQztBQUU1RyxPQUFPLEVBQUUsRUFBRSxFQUFFLE1BQU0sZ0NBQWdDLENBQUM7QUFDcEQsT0FBTyxFQUFFLE9BQU8sRUFBRSxNQUFNLHFCQUFxQixDQUFDO0FBQzlDLE9BQU8sS0FBSyxFQUVWLHdCQUF3QixFQUN4Qix5QkFBeUIsRUFDMUIsTUFBTSxpQ0FBaUMsQ0FBQztBQUN6QyxPQUFPLEVBQUUseUJBQXlCLEVBQXNCLE1BQU0sdUJBQXVCLENBQUM7QUFJdEYsT0FBTyxLQUFLLEVBQUUsdUJBQXVCLEVBQUUsTUFBTSxpQ0FBaUMsQ0FBQztBQUUvRSx3QkFBc0IsZ0JBQWdCLENBQUMsS0FBSyxFQUFFLE9BQU8sRUFBRSxjQUFjLEVBQUUsRUFBRSxFQUFFLEVBQUUsSUFBSSxFQUFFLHlCQUF5QixpQkE4QzNHO0FBRUQsd0JBQXNCLFNBQVMsQ0FDN0IsUUFBUSxFQUFFLFdBQVcsRUFDckIsSUFBSSxFQUFFLE1BQU0sRUFDWixJQUFJLEVBQUUseUJBQXlCLEVBQy9CLFVBQVUsR0FBRSxNQUFNLEdBQUcsU0FBZ0IsRUFDckMsaUJBQWlCLEdBQUUsTUFBNEMsRUFDL0Qsd0JBQXdCLEdBQUUsT0FBYzs7O0dBZXpDO0FBRUQsd0JBQXNCLGNBQWMsQ0FBQyxRQUFRLEVBQUUsV0FBVyxFQUFFLElBQUksRUFBRSx5QkFBeUI7OztHQVkxRjtBQUVELHdCQUFzQixVQUFVLENBQzlCLElBQUksRUFBRSxXQUFXLEVBQ2pCLEtBQUssRUFBRSxNQUFNLEVBQ2IsTUFBTSxFQUFFLE1BQU0sRUFDZCxVQUFVLEVBQUUsdUJBQXVCOzs7R0FlcEM7QUFFRCx3QkFBc0IsY0FBYyxDQUNsQyxnQkFBZ0IsRUFBRSxnQkFBZ0IsRUFDbEMsSUFBSSxFQUFFLHlCQUF5QixFQUMvQixPQUFPLEdBQUUsT0FBTyxDQUFDLFVBQVUsQ0FBQyxPQUFPLHlCQUF5QixDQUFDLENBQUMsQ0FBQyxDQUFDLENBQU07OztHQU92RTtBQUVELHdCQUFzQixlQUFlLENBQUMsS0FBSyxFQUFFLHdCQUF3QixFQUFFLEtBQUssRUFBRSx3QkFBd0IsaUJBUXJHO0FBRUQsd0JBQXNCLGFBQWEsQ0FBQyxJQUFJLEVBQUUsd0JBQXdCLEVBQUUsS0FBSyxFQUFFLHdCQUF3QixpQkFZbEcifQ==
|
package/dest/test/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/test/utils.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/test/utils.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAyB,MAAM,iCAAiC,CAAC;AAE5G,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,KAAK,EAEV,wBAAwB,EACxB,yBAAyB,EAC1B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,yBAAyB,EAAsB,MAAM,uBAAuB,CAAC;AAItF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAE/E,wBAAsB,gBAAgB,CAAC,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,yBAAyB,iBA8C3G;AAED,wBAAsB,SAAS,CAC7B,QAAQ,EAAE,WAAW,EACrB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,yBAAyB,EAC/B,UAAU,GAAE,MAAM,GAAG,SAAgB,EACrC,iBAAiB,GAAE,MAA4C,EAC/D,wBAAwB,GAAE,OAAc;;;GAezC;AAED,wBAAsB,cAAc,CAAC,QAAQ,EAAE,WAAW,EAAE,IAAI,EAAE,yBAAyB;;;GAY1F;AAED,wBAAsB,UAAU,CAC9B,IAAI,EAAE,WAAW,EACjB,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,uBAAuB;;;GAepC;AAED,wBAAsB,cAAc,CAClC,gBAAgB,EAAE,gBAAgB,EAClC,IAAI,EAAE,yBAAyB,EAC/B,OAAO,GAAE,OAAO,CAAC,UAAU,CAAC,OAAO,yBAAyB,CAAC,CAAC,CAAC,CAAC,CAAM;;;GAOvE;AAED,wBAAsB,eAAe,CAAC,KAAK,EAAE,wBAAwB,EAAE,KAAK,EAAE,wBAAwB,iBAQrG;AAED,wBAAsB,aAAa,CAAC,IAAI,EAAE,wBAAwB,EAAE,KAAK,EAAE,wBAAwB,iBAYlG"}
|
package/dest/test/utils.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { MAX_NOTE_HASHES_PER_TX, MAX_NULLIFIERS_PER_TX, NULLIFIER_SUBTREE_HEIGHT, NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP } from '@aztec/constants';
|
|
2
2
|
import { asyncMap } from '@aztec/foundation/async-map';
|
|
3
|
-
import { BlockNumber } from '@aztec/foundation/branded-types';
|
|
3
|
+
import { BlockNumber, IndexWithinCheckpoint } from '@aztec/foundation/branded-types';
|
|
4
4
|
import { padArrayEnd } from '@aztec/foundation/collection';
|
|
5
5
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
6
|
-
import {
|
|
6
|
+
import { L2Block } from '@aztec/stdlib/block';
|
|
7
7
|
import { mockCheckpointAndMessages, mockL1ToL2Messages } from '@aztec/stdlib/testing';
|
|
8
8
|
import { AppendOnlyTreeSnapshot, MerkleTreeId } from '@aztec/stdlib/trees';
|
|
9
9
|
import { BlockHeader } from '@aztec/stdlib/tx';
|
|
@@ -35,8 +35,8 @@ export async function updateBlockState(block, l1ToL2Messages, fork) {
|
|
|
35
35
|
block.archive = new AppendOnlyTreeSnapshot(Fr.fromBuffer(archiveState.root), Number(archiveState.size));
|
|
36
36
|
}
|
|
37
37
|
export async function mockBlock(blockNum, size, fork, maxEffects = 1000, numL1ToL2Messages = NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP, isFirstBlockInCheckpoint = true) {
|
|
38
|
-
const block = await
|
|
39
|
-
indexWithinCheckpoint: isFirstBlockInCheckpoint ? 0 : 1,
|
|
38
|
+
const block = await L2Block.random(blockNum, {
|
|
39
|
+
indexWithinCheckpoint: isFirstBlockInCheckpoint ? IndexWithinCheckpoint(0) : IndexWithinCheckpoint(1),
|
|
40
40
|
txsPerBlock: size,
|
|
41
41
|
txOptions: {
|
|
42
42
|
maxEffects
|
|
@@ -50,7 +50,7 @@ export async function mockBlock(blockNum, size, fork, maxEffects = 1000, numL1To
|
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
52
|
export async function mockEmptyBlock(blockNum, fork) {
|
|
53
|
-
const l2Block =
|
|
53
|
+
const l2Block = L2Block.empty();
|
|
54
54
|
const l1ToL2Messages = Array(16).fill(0).map(Fr.zero);
|
|
55
55
|
l2Block.header.globalVariables.blockNumber = blockNum;
|
|
56
56
|
await updateBlockState(l2Block, l1ToL2Messages, fork);
|
package/dest/testing.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
2
2
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
3
3
|
import { PublicDataTreeLeaf } from '@aztec/stdlib/trees';
|
|
4
|
+
import type { GenesisData } from '@aztec/stdlib/world-state';
|
|
4
5
|
export declare const defaultInitialAccountFeeJuice: Fr;
|
|
5
|
-
export declare function getGenesisValues(initialAccounts: AztecAddress[], initialAccountFeeJuice?: Fr, genesisPublicData?: PublicDataTreeLeaf[]): Promise<{
|
|
6
|
+
export declare function getGenesisValues(initialAccounts: AztecAddress[], initialAccountFeeJuice?: Fr, genesisPublicData?: PublicDataTreeLeaf[], genesisTimestamp?: bigint): Promise<{
|
|
6
7
|
genesisArchiveRoot: Fr;
|
|
7
|
-
|
|
8
|
+
genesis: GenesisData;
|
|
8
9
|
fundingNeeded: bigint;
|
|
9
10
|
}>;
|
|
10
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
11
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVzdGluZy5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL3Rlc3RpbmcudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQ0EsT0FBTyxFQUFFLEVBQUUsRUFBRSxNQUFNLGdDQUFnQyxDQUFDO0FBRXBELE9BQU8sS0FBSyxFQUFFLFlBQVksRUFBRSxNQUFNLDZCQUE2QixDQUFDO0FBQ2hFLE9BQU8sRUFBZ0Isa0JBQWtCLEVBQUUsTUFBTSxxQkFBcUIsQ0FBQztBQUN2RSxPQUFPLEtBQUssRUFBRSxXQUFXLEVBQUUsTUFBTSwyQkFBMkIsQ0FBQztBQXFCN0QsZUFBTyxNQUFNLDZCQUE2QixJQUFxQixDQUFDO0FBRWhFLHdCQUFzQixnQkFBZ0IsQ0FDcEMsZUFBZSxFQUFFLFlBQVksRUFBRSxFQUMvQixzQkFBc0IsS0FBZ0MsRUFDdEQsaUJBQWlCLEdBQUUsa0JBQWtCLEVBQU8sRUFDNUMsZ0JBQWdCLEdBQUUsTUFBVzs7OztHQXNCOUIifQ==
|
package/dest/testing.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../src/testing.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AAEpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAgB,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../src/testing.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AAEpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAgB,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAqB7D,eAAO,MAAM,6BAA6B,IAAqB,CAAC;AAEhE,wBAAsB,gBAAgB,CACpC,eAAe,EAAE,YAAY,EAAE,EAC/B,sBAAsB,KAAgC,EACtD,iBAAiB,GAAE,kBAAkB,EAAO,EAC5C,gBAAgB,GAAE,MAAW;;;;GAsB9B"}
|
package/dest/testing.js
CHANGED
|
@@ -3,14 +3,14 @@ import { Fr } from '@aztec/foundation/curves/bn254';
|
|
|
3
3
|
import { computeFeePayerBalanceLeafSlot } from '@aztec/protocol-contracts/fee-juice';
|
|
4
4
|
import { MerkleTreeId, PublicDataTreeLeaf } from '@aztec/stdlib/trees';
|
|
5
5
|
import { NativeWorldStateService } from './native/index.js';
|
|
6
|
-
async function generateGenesisValues(
|
|
7
|
-
if (!prefilledPublicData.length) {
|
|
6
|
+
async function generateGenesisValues(genesis) {
|
|
7
|
+
if (!genesis.prefilledPublicData.length && genesis.genesisTimestamp === 0n) {
|
|
8
8
|
return {
|
|
9
9
|
genesisArchiveRoot: new Fr(GENESIS_ARCHIVE_ROOT)
|
|
10
10
|
};
|
|
11
11
|
}
|
|
12
12
|
// Create a temporary world state to compute the genesis values.
|
|
13
|
-
const ws = await NativeWorldStateService.tmp(undefined /* rollupAddress */ , true,
|
|
13
|
+
const ws = await NativeWorldStateService.tmp(undefined /* rollupAddress */ , true, genesis);
|
|
14
14
|
const genesisArchiveRoot = new Fr((await ws.getCommitted().getTreeInfo(MerkleTreeId.ARCHIVE)).root);
|
|
15
15
|
await ws.close();
|
|
16
16
|
return {
|
|
@@ -18,16 +18,20 @@ async function generateGenesisValues(prefilledPublicData) {
|
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
20
|
export const defaultInitialAccountFeeJuice = new Fr(10n ** 22n);
|
|
21
|
-
export async function getGenesisValues(initialAccounts, initialAccountFeeJuice = defaultInitialAccountFeeJuice, genesisPublicData = []) {
|
|
21
|
+
export async function getGenesisValues(initialAccounts, initialAccountFeeJuice = defaultInitialAccountFeeJuice, genesisPublicData = [], genesisTimestamp = 0n) {
|
|
22
22
|
// Top up the accounts with fee juice.
|
|
23
23
|
let prefilledPublicData = await Promise.all(initialAccounts.map(async (address)=>new PublicDataTreeLeaf(await computeFeePayerBalanceLeafSlot(address), initialAccountFeeJuice)));
|
|
24
24
|
// Add user-defined public data
|
|
25
25
|
prefilledPublicData = prefilledPublicData.concat(genesisPublicData);
|
|
26
26
|
prefilledPublicData.sort((a, b)=>b.slot.lt(a.slot) ? 1 : -1);
|
|
27
|
-
const
|
|
27
|
+
const genesis = {
|
|
28
|
+
prefilledPublicData,
|
|
29
|
+
genesisTimestamp
|
|
30
|
+
};
|
|
31
|
+
const { genesisArchiveRoot } = await generateGenesisValues(genesis);
|
|
28
32
|
return {
|
|
29
33
|
genesisArchiveRoot,
|
|
30
|
-
|
|
34
|
+
genesis,
|
|
31
35
|
fundingNeeded: BigInt(initialAccounts.length) * initialAccountFeeJuice.toBigInt()
|
|
32
36
|
};
|
|
33
37
|
}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import type { BlockNumber } from '@aztec/foundation/branded-types';
|
|
2
2
|
import type { Fr } from '@aztec/foundation/curves/bn254';
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
5
|
-
import type { ForkMerkleTreeOperations, MerkleTreeReadOperations } from '@aztec/stdlib/interfaces/server';
|
|
6
|
-
import type { MerkleTreeId } from '@aztec/stdlib/trees';
|
|
3
|
+
import type { L2Block } from '@aztec/stdlib/block';
|
|
4
|
+
import type { ForkMerkleTreeOperations, MerkleTreeReadOperations, ReadonlyWorldStateAccess } from '@aztec/stdlib/interfaces/server';
|
|
7
5
|
import type { WorldStateStatusFull, WorldStateStatusSummary } from '../native/message.js';
|
|
8
6
|
/**
|
|
9
7
|
*
|
|
@@ -22,20 +20,13 @@ import type { WorldStateStatusFull, WorldStateStatusSummary } from '../native/me
|
|
|
22
20
|
*/
|
|
23
21
|
export declare const INITIAL_NULLIFIER_TREE_SIZE: number;
|
|
24
22
|
export declare const INITIAL_PUBLIC_DATA_TREE_SIZE: number;
|
|
25
|
-
export
|
|
26
|
-
[MerkleTreeId.NULLIFIER_TREE]: IndexedTreeSnapshot;
|
|
27
|
-
[MerkleTreeId.NOTE_HASH_TREE]: TreeSnapshot<Fr>;
|
|
28
|
-
[MerkleTreeId.PUBLIC_DATA_TREE]: IndexedTreeSnapshot;
|
|
29
|
-
[MerkleTreeId.L1_TO_L2_MESSAGE_TREE]: TreeSnapshot<Fr>;
|
|
30
|
-
[MerkleTreeId.ARCHIVE]: TreeSnapshot<Fr>;
|
|
31
|
-
};
|
|
32
|
-
export interface MerkleTreeAdminDatabase extends ForkMerkleTreeOperations {
|
|
23
|
+
export interface MerkleTreeAdminDatabase extends ForkMerkleTreeOperations, ReadonlyWorldStateAccess {
|
|
33
24
|
/**
|
|
34
25
|
* Handles a single L2 block (i.e. Inserts the new note hashes into the merkle tree).
|
|
35
26
|
* @param block - The L2 block to handle.
|
|
36
27
|
* @param l1ToL2Messages - The L1 to L2 messages for the block.
|
|
37
28
|
*/
|
|
38
|
-
handleL2BlockAndMessages(block:
|
|
29
|
+
handleL2BlockAndMessages(block: L2Block, l1ToL2Messages: Fr[]): Promise<WorldStateStatusFull>;
|
|
39
30
|
/**
|
|
40
31
|
* Gets a handle that allows reading the latest committed state
|
|
41
32
|
*/
|
|
@@ -68,4 +59,4 @@ export interface MerkleTreeAdminDatabase extends ForkMerkleTreeOperations {
|
|
|
68
59
|
/** Deletes the db. */
|
|
69
60
|
clear(): Promise<void>;
|
|
70
61
|
}
|
|
71
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
62
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWVya2xlX3RyZWVfZGIuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy93b3JsZC1zdGF0ZS1kYi9tZXJrbGVfdHJlZV9kYi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFDQSxPQUFPLEtBQUssRUFBRSxXQUFXLEVBQUUsTUFBTSxpQ0FBaUMsQ0FBQztBQUNuRSxPQUFPLEtBQUssRUFBRSxFQUFFLEVBQUUsTUFBTSxnQ0FBZ0MsQ0FBQztBQUN6RCxPQUFPLEtBQUssRUFBRSxPQUFPLEVBQUUsTUFBTSxxQkFBcUIsQ0FBQztBQUNuRCxPQUFPLEtBQUssRUFDVix3QkFBd0IsRUFDeEIsd0JBQXdCLEVBQ3hCLHdCQUF3QixFQUN6QixNQUFNLGlDQUFpQyxDQUFDO0FBRXpDLE9BQU8sS0FBSyxFQUFFLG9CQUFvQixFQUFFLHVCQUF1QixFQUFFLE1BQU0sc0JBQXNCLENBQUM7QUFFMUY7Ozs7Ozs7Ozs7Ozs7O0dBY0c7QUFDSCxlQUFPLE1BQU0sMkJBQTJCLFFBQTRCLENBQUM7QUFFckUsZUFBTyxNQUFNLDZCQUE2QixRQUFtRCxDQUFDO0FBRTlGLE1BQU0sV0FBVyx1QkFBd0IsU0FBUSx3QkFBd0IsRUFBRSx3QkFBd0I7SUFDakc7Ozs7T0FJRztJQUNILHdCQUF3QixDQUFDLEtBQUssRUFBRSxPQUFPLEVBQUUsY0FBYyxFQUFFLEVBQUUsRUFBRSxHQUFHLE9BQU8sQ0FBQyxvQkFBb0IsQ0FBQyxDQUFDO0lBRTlGOztPQUVHO0lBQ0gsWUFBWSxJQUFJLHdCQUF3QixDQUFDO0lBRXpDOzs7O09BSUc7SUFDSCxzQkFBc0IsQ0FBQyxhQUFhLEVBQUUsV0FBVyxHQUFHLE9BQU8sQ0FBQyxvQkFBb0IsQ0FBQyxDQUFDO0lBRWxGOzs7O09BSUc7SUFDSCxZQUFZLENBQUMsYUFBYSxFQUFFLFdBQVcsR0FBRyxPQUFPLENBQUMsb0JBQW9CLENBQUMsQ0FBQztJQUV4RTs7OztPQUlHO0lBQ0gsWUFBWSxDQUFDLGFBQWEsRUFBRSxXQUFXLEdBQUcsT0FBTyxDQUFDLHVCQUF1QixDQUFDLENBQUM7SUFFM0U7OztPQUdHO0lBQ0gsZ0JBQWdCLElBQUksT0FBTyxDQUFDLHVCQUF1QixDQUFDLENBQUM7SUFFckQseUJBQXlCO0lBQ3pCLEtBQUssSUFBSSxPQUFPLENBQUMsSUFBSSxDQUFDLENBQUM7SUFFdkIsc0JBQXNCO0lBQ3RCLEtBQUssSUFBSSxPQUFPLENBQUMsSUFBSSxDQUFDLENBQUM7Q0FDeEIifQ==
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"merkle_tree_db.d.ts","sourceRoot":"","sources":["../../src/world-state-db/merkle_tree_db.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACzD,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"merkle_tree_db.d.ts","sourceRoot":"","sources":["../../src/world-state-db/merkle_tree_db.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACzD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,KAAK,EACV,wBAAwB,EACxB,wBAAwB,EACxB,wBAAwB,EACzB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,KAAK,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAE1F;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,2BAA2B,QAA4B,CAAC;AAErE,eAAO,MAAM,6BAA6B,QAAmD,CAAC;AAE9F,MAAM,WAAW,uBAAwB,SAAQ,wBAAwB,EAAE,wBAAwB;IACjG;;;;OAIG;IACH,wBAAwB,CAAC,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAE9F;;OAEG;IACH,YAAY,IAAI,wBAAwB,CAAC;IAEzC;;;;OAIG;IACH,sBAAsB,CAAC,aAAa,EAAE,WAAW,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAElF;;;;OAIG;IACH,YAAY,CAAC,aAAa,EAAE,WAAW,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAExE;;;;OAIG;IACH,YAAY,CAAC,aAAa,EAAE,WAAW,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC;IAE3E;;;OAGG;IACH,gBAAgB,IAAI,OAAO,CAAC,uBAAuB,CAAC,CAAC;IAErD,yBAAyB;IACzB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAEvB,sBAAsB;IACtB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/world-state",
|
|
3
|
-
"version": "0.0.1-commit.
|
|
3
|
+
"version": "0.0.1-commit.04d373f",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dest/index.js",
|
|
@@ -64,23 +64,24 @@
|
|
|
64
64
|
]
|
|
65
65
|
},
|
|
66
66
|
"dependencies": {
|
|
67
|
-
"@aztec/
|
|
68
|
-
"@aztec/
|
|
69
|
-
"@aztec/
|
|
70
|
-
"@aztec/
|
|
71
|
-
"@aztec/native": "0.0.1-commit.
|
|
72
|
-
"@aztec/protocol-contracts": "0.0.1-commit.
|
|
73
|
-
"@aztec/stdlib": "0.0.1-commit.
|
|
74
|
-
"@aztec/telemetry-client": "0.0.1-commit.
|
|
67
|
+
"@aztec/bb.js": "0.0.1-commit.04d373f",
|
|
68
|
+
"@aztec/constants": "0.0.1-commit.04d373f",
|
|
69
|
+
"@aztec/foundation": "0.0.1-commit.04d373f",
|
|
70
|
+
"@aztec/kv-store": "0.0.1-commit.04d373f",
|
|
71
|
+
"@aztec/native": "0.0.1-commit.04d373f",
|
|
72
|
+
"@aztec/protocol-contracts": "0.0.1-commit.04d373f",
|
|
73
|
+
"@aztec/stdlib": "0.0.1-commit.04d373f",
|
|
74
|
+
"@aztec/telemetry-client": "0.0.1-commit.04d373f",
|
|
75
|
+
"msgpackr": "^1.11.2",
|
|
75
76
|
"tslib": "^2.4.0",
|
|
76
|
-
"zod": "^
|
|
77
|
+
"zod": "^4"
|
|
77
78
|
},
|
|
78
79
|
"devDependencies": {
|
|
79
|
-
"@aztec/archiver": "0.0.1-commit.
|
|
80
|
+
"@aztec/archiver": "0.0.1-commit.04d373f",
|
|
80
81
|
"@jest/globals": "^30.0.0",
|
|
81
82
|
"@types/jest": "^30.0.0",
|
|
82
83
|
"@types/node": "^22.15.17",
|
|
83
|
-
"@typescript/native-preview": "7.0.0-dev.
|
|
84
|
+
"@typescript/native-preview": "7.0.0-dev.20260113.1",
|
|
84
85
|
"jest": "^30.0.0",
|
|
85
86
|
"jest-mock-extended": "^4.0.0",
|
|
86
87
|
"ts-node": "^10.9.1",
|