@aztec/pxe 0.0.1-commit.9ef841308 → 0.0.1-commit.a89ec08
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/bin/check_oracle_version.js +4 -4
- package/dest/config/index.d.ts +2 -2
- package/dest/config/index.d.ts.map +1 -1
- package/dest/config/index.js +1 -1
- package/dest/config/package_info.js +1 -1
- package/dest/contract_function_simulator/contract_function_simulator.d.ts +6 -4
- package/dest/contract_function_simulator/contract_function_simulator.d.ts.map +1 -1
- package/dest/contract_function_simulator/contract_function_simulator.js +7 -3
- package/dest/contract_function_simulator/ephemeral_array_service.d.ts +28 -0
- package/dest/contract_function_simulator/ephemeral_array_service.d.ts.map +1 -0
- package/dest/contract_function_simulator/ephemeral_array_service.js +78 -0
- package/dest/contract_function_simulator/noir-structs/event_validation_request.d.ts +1 -1
- package/dest/contract_function_simulator/noir-structs/event_validation_request.js +1 -1
- package/dest/contract_function_simulator/noir-structs/log_retrieval_request.d.ts +1 -1
- package/dest/contract_function_simulator/noir-structs/log_retrieval_request.js +1 -1
- package/dest/contract_function_simulator/noir-structs/log_retrieval_response.d.ts +1 -1
- package/dest/contract_function_simulator/noir-structs/log_retrieval_response.js +1 -1
- package/dest/contract_function_simulator/noir-structs/note_validation_request.d.ts +1 -1
- package/dest/contract_function_simulator/noir-structs/note_validation_request.js +1 -1
- package/dest/contract_function_simulator/oracle/interfaces.d.ts +13 -2
- package/dest/contract_function_simulator/oracle/interfaces.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/legacy_oracle_mappings.d.ts +1 -1
- package/dest/contract_function_simulator/oracle/legacy_oracle_mappings.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/legacy_oracle_mappings.js +10 -1
- package/dest/contract_function_simulator/oracle/oracle.d.ts +13 -2
- package/dest/contract_function_simulator/oracle/oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/oracle.js +98 -3
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts +2 -3
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/private_execution_oracle.js +12 -2
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +28 -13
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.js +104 -34
- package/dest/contract_function_simulator/pick_notes.d.ts +1 -1
- package/dest/contract_function_simulator/pick_notes.d.ts.map +1 -1
- package/dest/contract_function_simulator/pick_notes.js +14 -3
- package/dest/contract_function_simulator/proxied_contract_data_source.d.ts +1 -1
- package/dest/contract_function_simulator/proxied_contract_data_source.d.ts.map +1 -1
- package/dest/contract_function_simulator/proxied_contract_data_source.js +3 -0
- package/dest/contract_sync/contract_sync_service.d.ts +4 -6
- package/dest/contract_sync/contract_sync_service.d.ts.map +1 -1
- package/dest/contract_sync/contract_sync_service.js +38 -46
- package/dest/contract_sync/helpers.d.ts +2 -3
- package/dest/contract_sync/helpers.d.ts.map +1 -1
- package/dest/debug/pxe_debug_utils.d.ts +3 -3
- package/dest/debug/pxe_debug_utils.d.ts.map +1 -1
- package/dest/entrypoints/client/bundle/index.d.ts +1 -2
- package/dest/entrypoints/client/bundle/index.d.ts.map +1 -1
- package/dest/entrypoints/client/bundle/index.js +0 -1
- package/dest/entrypoints/client/bundle/utils.d.ts +2 -2
- package/dest/entrypoints/client/bundle/utils.d.ts.map +1 -1
- package/dest/entrypoints/client/bundle/utils.js +2 -2
- package/dest/entrypoints/client/lazy/index.d.ts +1 -2
- package/dest/entrypoints/client/lazy/index.d.ts.map +1 -1
- package/dest/entrypoints/client/lazy/index.js +0 -1
- package/dest/entrypoints/client/lazy/utils.d.ts +2 -2
- package/dest/entrypoints/client/lazy/utils.d.ts.map +1 -1
- package/dest/entrypoints/client/lazy/utils.js +2 -2
- package/dest/entrypoints/pxe_creation_options.d.ts +3 -1
- package/dest/entrypoints/pxe_creation_options.d.ts.map +1 -1
- package/dest/entrypoints/pxe_creation_options.js +3 -1
- package/dest/entrypoints/server/index.d.ts +2 -3
- package/dest/entrypoints/server/index.d.ts.map +1 -1
- package/dest/entrypoints/server/index.js +1 -2
- package/dest/entrypoints/server/utils.d.ts +2 -2
- package/dest/entrypoints/server/utils.d.ts.map +1 -1
- package/dest/entrypoints/server/utils.js +2 -2
- package/dest/events/private_event_filter_validator.d.ts +3 -2
- package/dest/events/private_event_filter_validator.d.ts.map +1 -1
- package/dest/events/private_event_filter_validator.js +15 -0
- package/dest/logs/log_service.d.ts +6 -6
- package/dest/logs/log_service.d.ts.map +1 -1
- package/dest/logs/log_service.js +15 -21
- package/dest/notes/note_service.d.ts +3 -4
- package/dest/notes/note_service.d.ts.map +1 -1
- package/dest/notes_filter.d.ts +2 -3
- package/dest/notes_filter.d.ts.map +1 -1
- package/dest/oracle_version.d.ts +4 -3
- package/dest/oracle_version.d.ts.map +1 -1
- package/dest/oracle_version.js +20 -10
- package/dest/private_kernel/private_kernel_execution_prover.d.ts +1 -1
- package/dest/private_kernel/private_kernel_execution_prover.d.ts.map +1 -1
- package/dest/private_kernel/private_kernel_execution_prover.js +4 -7
- package/dest/pxe.d.ts +6 -7
- package/dest/pxe.d.ts.map +1 -1
- package/dest/pxe.js +15 -12
- package/dest/storage/anchor_block_store/anchor_block_store.js +1 -1
- package/dest/storage/capsule_store/capsule_service.d.ts +2 -3
- package/dest/storage/capsule_store/capsule_service.d.ts.map +1 -1
- package/dest/storage/capsule_store/capsule_service.js +1 -1
- package/dest/storage/capsule_store/capsule_store.d.ts +1 -1
- package/dest/storage/capsule_store/capsule_store.d.ts.map +1 -1
- package/dest/storage/capsule_store/capsule_store.js +8 -5
- package/dest/storage/contract_store/contract_store.d.ts +1 -1
- package/dest/storage/contract_store/contract_store.d.ts.map +1 -1
- package/dest/storage/contract_store/contract_store.js +4 -2
- package/dest/storage/note_store/note_store.d.ts +1 -1
- package/dest/storage/note_store/note_store.d.ts.map +1 -1
- package/dest/storage/note_store/note_store.js +2 -2
- package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts +2 -2
- package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts.map +1 -1
- package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.js +1 -15
- package/package.json +16 -16
- package/src/bin/check_oracle_version.ts +4 -4
- package/src/config/index.ts +1 -1
- package/src/config/package_info.ts +1 -1
- package/src/contract_function_simulator/contract_function_simulator.ts +10 -6
- package/src/contract_function_simulator/ephemeral_array_service.ts +110 -0
- package/src/contract_function_simulator/noir-structs/event_validation_request.ts +1 -1
- package/src/contract_function_simulator/noir-structs/log_retrieval_request.ts +1 -1
- package/src/contract_function_simulator/noir-structs/log_retrieval_response.ts +1 -1
- package/src/contract_function_simulator/noir-structs/note_validation_request.ts +1 -1
- package/src/contract_function_simulator/oracle/interfaces.ts +20 -1
- package/src/contract_function_simulator/oracle/legacy_oracle_mappings.ts +7 -1
- package/src/contract_function_simulator/oracle/oracle.ts +143 -3
- package/src/contract_function_simulator/oracle/private_execution_oracle.ts +14 -4
- package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +169 -64
- package/src/contract_function_simulator/pick_notes.ts +14 -3
- package/src/contract_function_simulator/proxied_contract_data_source.ts +8 -1
- package/src/contract_sync/contract_sync_service.ts +64 -80
- package/src/contract_sync/helpers.ts +2 -3
- package/src/debug/pxe_debug_utils.ts +3 -3
- package/src/entrypoints/client/bundle/index.ts +0 -1
- package/src/entrypoints/client/bundle/utils.ts +2 -3
- package/src/entrypoints/client/lazy/index.ts +0 -1
- package/src/entrypoints/client/lazy/utils.ts +2 -3
- package/src/entrypoints/pxe_creation_options.ts +7 -0
- package/src/entrypoints/server/index.ts +1 -2
- package/src/entrypoints/server/utils.ts +2 -3
- package/src/events/private_event_filter_validator.ts +21 -1
- package/src/logs/log_service.ts +24 -50
- package/src/notes/note_service.ts +2 -3
- package/src/notes_filter.ts +1 -3
- package/src/oracle_version.ts +20 -10
- package/src/private_kernel/private_kernel_execution_prover.ts +4 -9
- package/src/pxe.ts +21 -16
- package/src/storage/anchor_block_store/anchor_block_store.ts +1 -1
- package/src/storage/capsule_store/capsule_service.ts +5 -6
- package/src/storage/capsule_store/capsule_store.ts +15 -5
- package/src/storage/contract_store/contract_store.ts +8 -6
- package/src/storage/note_store/note_store.ts +2 -5
- package/src/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.ts +2 -14
- package/dest/access_scopes.d.ts +0 -9
- package/dest/access_scopes.d.ts.map +0 -1
- package/dest/access_scopes.js +0 -6
- package/src/access_scopes.ts +0 -9
|
@@ -11,7 +11,8 @@ import { createContractLogger, logContractMessage, stripAztecnrLogPrefix } from
|
|
|
11
11
|
import { EventService } from '../../events/event_service.js';
|
|
12
12
|
import { LogService } from '../../logs/log_service.js';
|
|
13
13
|
import { NoteService } from '../../notes/note_service.js';
|
|
14
|
-
import {
|
|
14
|
+
import { ORACLE_VERSION_MAJOR } from '../../oracle_version.js';
|
|
15
|
+
import { EphemeralArrayService } from '../ephemeral_array_service.js';
|
|
15
16
|
import { EventValidationRequest } from '../noir-structs/event_validation_request.js';
|
|
16
17
|
import { LogRetrievalRequest } from '../noir-structs/log_retrieval_request.js';
|
|
17
18
|
import { LogRetrievalResponse } from '../noir-structs/log_retrieval_response.js';
|
|
@@ -27,6 +28,9 @@ import { MessageLoadOracleInputs } from './message_load_oracle_inputs.js';
|
|
|
27
28
|
contractLogger;
|
|
28
29
|
aztecnrLogger;
|
|
29
30
|
offchainEffects = [];
|
|
31
|
+
ephemeralArrayService = new EphemeralArrayService();
|
|
32
|
+
// We store oracle version to be able to show a nice error message when an oracle handler is missing.
|
|
33
|
+
contractOracleVersion;
|
|
30
34
|
contractAddress;
|
|
31
35
|
authWitnesses;
|
|
32
36
|
capsules;
|
|
@@ -42,6 +46,7 @@ import { MessageLoadOracleInputs } from './message_load_oracle_inputs.js';
|
|
|
42
46
|
privateEventStore;
|
|
43
47
|
messageContextService;
|
|
44
48
|
contractSyncService;
|
|
49
|
+
l2TipsStore;
|
|
45
50
|
jobId;
|
|
46
51
|
logger;
|
|
47
52
|
scopes;
|
|
@@ -61,11 +66,12 @@ import { MessageLoadOracleInputs } from './message_load_oracle_inputs.js';
|
|
|
61
66
|
this.privateEventStore = args.privateEventStore;
|
|
62
67
|
this.messageContextService = args.messageContextService;
|
|
63
68
|
this.contractSyncService = args.contractSyncService;
|
|
69
|
+
this.l2TipsStore = args.l2TipsStore;
|
|
64
70
|
this.jobId = args.jobId;
|
|
65
71
|
this.logger = args.log ?? createLogger('simulator:client_view_context');
|
|
66
72
|
this.scopes = args.scopes;
|
|
67
73
|
}
|
|
68
|
-
assertCompatibleOracleVersion(
|
|
74
|
+
assertCompatibleOracleVersion(major, minor) {
|
|
69
75
|
// TODO(F-416): Remove this hack on v5 when protocol contracts are redeployed.
|
|
70
76
|
// Protocol contracts/canonical contracts shipped with committed bytecode that cannot be changed. Assert they use
|
|
71
77
|
// the expected pinned version or the current one. We want to allow for both the pinned and the current versions
|
|
@@ -73,16 +79,29 @@ import { MessageLoadOracleInputs } from './message_load_oracle_inputs.js';
|
|
|
73
79
|
// pinned contracts (like e.g. next)
|
|
74
80
|
const LEGACY_ORACLE_VERSION = 12;
|
|
75
81
|
if (isProtocolContract(this.contractAddress)) {
|
|
76
|
-
if (
|
|
77
|
-
const hint =
|
|
78
|
-
throw new Error(`Incompatible private environment version: ${hint} See https://docs.aztec.network/errors/8 (expected oracle version ${LEGACY_ORACLE_VERSION} or ${
|
|
82
|
+
if (major !== LEGACY_ORACLE_VERSION && major !== ORACLE_VERSION_MAJOR) {
|
|
83
|
+
const hint = major > ORACLE_VERSION_MAJOR ? 'The contract was compiled with a newer version of Aztec.nr than your private environment supports. Upgrade your private environment to a compatible version.' : 'The contract was compiled with an older version of Aztec.nr than your private environment supports. Recompile the contract with a compatible version of Aztec.nr.';
|
|
84
|
+
throw new Error(`Incompatible private environment version: ${hint} See https://docs.aztec.network/errors/8 (expected oracle major version ${LEGACY_ORACLE_VERSION} or ${ORACLE_VERSION_MAJOR}, got ${major})`);
|
|
79
85
|
}
|
|
86
|
+
this.contractOracleVersion = {
|
|
87
|
+
major,
|
|
88
|
+
minor
|
|
89
|
+
};
|
|
80
90
|
return;
|
|
81
91
|
}
|
|
82
|
-
if (
|
|
83
|
-
const hint =
|
|
84
|
-
throw new Error(`Incompatible private environment version: ${hint} See https://docs.aztec.network/errors/8 (expected oracle version ${
|
|
92
|
+
if (major !== ORACLE_VERSION_MAJOR) {
|
|
93
|
+
const hint = major > ORACLE_VERSION_MAJOR ? 'The contract was compiled with a newer version of Aztec.nr than your private environment supports. Upgrade your private environment to a compatible version.' : 'The contract was compiled with an older version of Aztec.nr than your private environment supports. Recompile the contract with a compatible version of Aztec.nr.';
|
|
94
|
+
throw new Error(`Incompatible private environment version: ${hint} See https://docs.aztec.network/errors/8 (expected oracle major version ${ORACLE_VERSION_MAJOR}, got ${major})`);
|
|
85
95
|
}
|
|
96
|
+
// Major matches - store both major and minor for later diagnostics (e.g. when an oracle is not found)
|
|
97
|
+
this.contractOracleVersion = {
|
|
98
|
+
major,
|
|
99
|
+
minor
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
// Prefixed with "nonOracleFunction" as it is not used as an oracle handler.
|
|
103
|
+
nonOracleFunctionGetContractOracleVersion() {
|
|
104
|
+
return this.contractOracleVersion;
|
|
86
105
|
}
|
|
87
106
|
getRandomField() {
|
|
88
107
|
return Fr.random();
|
|
@@ -97,18 +116,15 @@ import { MessageLoadOracleInputs } from './message_load_oracle_inputs.js';
|
|
|
97
116
|
* @throws If the keys are not registered in the key store.
|
|
98
117
|
* @throws If scopes are defined and the account is not in the scopes.
|
|
99
118
|
*/ async getKeyValidationRequest(pkMHash) {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
if (await this.keyStore.accountHasKey(this.scopes[i], pkMHash)) {
|
|
105
|
-
hasAccess = true;
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
if (!hasAccess) {
|
|
109
|
-
throw new Error(`Key validation request denied: no scoped account has a key with hash ${pkMHash.toString()}.`);
|
|
119
|
+
let hasAccess = false;
|
|
120
|
+
for(let i = 0; i < this.scopes.length && !hasAccess; i++){
|
|
121
|
+
if (await this.keyStore.accountHasKey(this.scopes[i], pkMHash)) {
|
|
122
|
+
hasAccess = true;
|
|
110
123
|
}
|
|
111
124
|
}
|
|
125
|
+
if (!hasAccess) {
|
|
126
|
+
throw new Error(`Key validation request denied: no scoped account has a key with hash ${pkMHash.toString()}.`);
|
|
127
|
+
}
|
|
112
128
|
return this.keyStore.getKeyValidationRequest(pkMHash, this.contractAddress);
|
|
113
129
|
}
|
|
114
130
|
/**
|
|
@@ -333,28 +349,46 @@ import { MessageLoadOracleInputs } from './message_load_oracle_inputs.js';
|
|
|
333
349
|
const logger = kind == 'aztecnr' ? await this.#getAztecnrLogger() : await this.#getContractLogger();
|
|
334
350
|
logContractMessage(logger, LogLevels[level], strippedMessage, fields);
|
|
335
351
|
}
|
|
352
|
+
// Deprecated, only kept for backwards compatibility until Alpha v5 rolls out.
|
|
336
353
|
async getPendingTaggedLogs(pendingTaggedLogArrayBaseSlot, scope) {
|
|
337
|
-
const logService =
|
|
338
|
-
await logService.fetchTaggedLogs(this.contractAddress,
|
|
354
|
+
const logService = this.#createLogService();
|
|
355
|
+
const logs = await logService.fetchTaggedLogs(this.contractAddress, scope);
|
|
356
|
+
await this.capsuleService.appendToCapsuleArray(this.contractAddress, pendingTaggedLogArrayBaseSlot, logs.map((log)=>log.toFields()), this.jobId, scope);
|
|
357
|
+
}
|
|
358
|
+
/** Fetches pending tagged logs into a freshly allocated ephemeral array and returns its base slot. */ async getPendingTaggedLogsV2(scope) {
|
|
359
|
+
const logService = this.#createLogService();
|
|
360
|
+
const logs = await logService.fetchTaggedLogs(this.contractAddress, scope);
|
|
361
|
+
return this.ephemeralArrayService.newArray(logs.map((log)=>log.toFields()));
|
|
362
|
+
}
|
|
363
|
+
#createLogService() {
|
|
364
|
+
return new LogService(this.aztecNode, this.anchorBlockHeader, this.l2TipsStore, this.keyStore, this.recipientTaggingStore, this.senderAddressBookStore, this.addressStore, this.jobId, this.logger.getBindings());
|
|
339
365
|
}
|
|
340
366
|
/**
|
|
341
|
-
*
|
|
342
|
-
* `enqueue_event_for_validation`, inserting them into the note database and event store respectively, making them
|
|
343
|
-
* queryable via `get_notes` and `getPrivateEvents`.
|
|
367
|
+
* Legacy: validates note/event requests stored in capsule arrays.
|
|
344
368
|
*
|
|
345
|
-
*
|
|
346
|
-
* @param contractAddress - The address of the contract that the logs are tagged for.
|
|
347
|
-
* @param noteValidationRequestsArrayBaseSlot - The base slot of capsule array containing note validation requests.
|
|
348
|
-
* @param eventValidationRequestsArrayBaseSlot - The base slot of capsule array containing event validation requests.
|
|
369
|
+
* Deprecated, only kept for backwards compatibility until Alpha v5 rolls out.
|
|
349
370
|
*/ async validateAndStoreEnqueuedNotesAndEvents(contractAddress, noteValidationRequestsArrayBaseSlot, eventValidationRequestsArrayBaseSlot, maxNotePackedLen, maxEventSerializedLen, scope) {
|
|
350
371
|
// TODO(#10727): allow other contracts to store notes
|
|
351
372
|
if (!this.contractAddress.equals(contractAddress)) {
|
|
352
373
|
throw new Error(`Got a note validation request from ${contractAddress}, expected ${this.contractAddress}`);
|
|
353
374
|
}
|
|
354
|
-
// We read all note and event validation requests and process them all concurrently. This makes the process much
|
|
355
|
-
// faster as we don't need to wait for the network round-trip.
|
|
356
375
|
const noteValidationRequests = (await this.capsuleService.readCapsuleArray(contractAddress, noteValidationRequestsArrayBaseSlot, this.jobId, scope)).map((fields)=>NoteValidationRequest.fromFields(fields, maxNotePackedLen));
|
|
357
376
|
const eventValidationRequests = (await this.capsuleService.readCapsuleArray(contractAddress, eventValidationRequestsArrayBaseSlot, this.jobId, scope)).map((fields)=>EventValidationRequest.fromFields(fields, maxEventSerializedLen));
|
|
377
|
+
await this.#processValidationRequests(noteValidationRequests, eventValidationRequests, scope);
|
|
378
|
+
await this.capsuleService.setCapsuleArray(contractAddress, noteValidationRequestsArrayBaseSlot, [], this.jobId, scope);
|
|
379
|
+
await this.capsuleService.setCapsuleArray(contractAddress, eventValidationRequestsArrayBaseSlot, [], this.jobId, scope);
|
|
380
|
+
}
|
|
381
|
+
async validateAndStoreEnqueuedNotesAndEventsV2(noteValidationRequestsArrayBaseSlot, eventValidationRequestsArrayBaseSlot, maxNotePackedLen, maxEventSerializedLen, scope) {
|
|
382
|
+
const noteValidationRequests = this.ephemeralArrayService.readArrayAt(noteValidationRequestsArrayBaseSlot).map((fields)=>NoteValidationRequest.fromFields(fields, maxNotePackedLen));
|
|
383
|
+
const eventValidationRequests = this.ephemeralArrayService.readArrayAt(eventValidationRequestsArrayBaseSlot).map((fields)=>EventValidationRequest.fromFields(fields, maxEventSerializedLen));
|
|
384
|
+
await this.#processValidationRequests(noteValidationRequests, eventValidationRequests, scope);
|
|
385
|
+
}
|
|
386
|
+
/**
|
|
387
|
+
* Dispatches note and event validation requests to the service layer.
|
|
388
|
+
*
|
|
389
|
+
* This function is an auxiliary to support legacy (capsule backed) and new (ephemeral array backed) versions of the
|
|
390
|
+
* `validateAndStoreEnqueuedNotesAndEvents` oracle.
|
|
391
|
+
*/ async #processValidationRequests(noteValidationRequests, eventValidationRequests, scope) {
|
|
358
392
|
const noteService = new NoteService(this.noteStore, this.aztecNode, this.anchorBlockHeader, this.jobId);
|
|
359
393
|
const noteStorePromises = noteValidationRequests.map((request)=>noteService.validateAndStoreNote(request.contractAddress, request.owner, request.storageSlot, request.randomness, request.noteNonce, request.content, request.noteHash, request.nullifier, request.txHash, scope));
|
|
360
394
|
const eventService = new EventService(this.anchorBlockHeader, this.aztecNode, this.privateEventStore, this.jobId);
|
|
@@ -363,9 +397,6 @@ import { MessageLoadOracleInputs } from './message_load_oracle_inputs.js';
|
|
|
363
397
|
...noteStorePromises,
|
|
364
398
|
...eventStorePromises
|
|
365
399
|
]);
|
|
366
|
-
// Requests are cleared once we're done.
|
|
367
|
-
await this.capsuleService.setCapsuleArray(contractAddress, noteValidationRequestsArrayBaseSlot, [], this.jobId, scope);
|
|
368
|
-
await this.capsuleService.setCapsuleArray(contractAddress, eventValidationRequestsArrayBaseSlot, [], this.jobId, scope);
|
|
369
400
|
}
|
|
370
401
|
async getLogsByTag(contractAddress, logRetrievalRequestsArrayBaseSlot, logRetrievalResponsesArrayBaseSlot, scope) {
|
|
371
402
|
// TODO(#10727): allow other contracts to process partial notes
|
|
@@ -375,19 +406,26 @@ import { MessageLoadOracleInputs } from './message_load_oracle_inputs.js';
|
|
|
375
406
|
// We read all log retrieval requests and process them all concurrently. This makes the process much faster as we
|
|
376
407
|
// don't need to wait for the network round-trip.
|
|
377
408
|
const logRetrievalRequests = (await this.capsuleService.readCapsuleArray(contractAddress, logRetrievalRequestsArrayBaseSlot, this.jobId, scope)).map(LogRetrievalRequest.fromFields);
|
|
378
|
-
const logService =
|
|
409
|
+
const logService = this.#createLogService();
|
|
379
410
|
const maybeLogRetrievalResponses = await logService.fetchLogsByTag(contractAddress, logRetrievalRequests);
|
|
380
411
|
// Requests are cleared once we're done.
|
|
381
412
|
await this.capsuleService.setCapsuleArray(contractAddress, logRetrievalRequestsArrayBaseSlot, [], this.jobId, scope);
|
|
382
413
|
// The responses are stored as Option<LogRetrievalResponse> in a second CapsuleArray.
|
|
383
414
|
await this.capsuleService.setCapsuleArray(contractAddress, logRetrievalResponsesArrayBaseSlot, maybeLogRetrievalResponses.map(LogRetrievalResponse.toSerializedOption), this.jobId, scope);
|
|
384
415
|
}
|
|
416
|
+
async getLogsByTagV2(requestArrayBaseSlot) {
|
|
417
|
+
const logRetrievalRequests = this.ephemeralArrayService.readArrayAt(requestArrayBaseSlot).map(LogRetrievalRequest.fromFields);
|
|
418
|
+
const logService = this.#createLogService();
|
|
419
|
+
const maybeLogRetrievalResponses = await logService.fetchLogsByTag(this.contractAddress, logRetrievalRequests);
|
|
420
|
+
return this.ephemeralArrayService.newArray(maybeLogRetrievalResponses.map(LogRetrievalResponse.toSerializedOption));
|
|
421
|
+
}
|
|
422
|
+
// Deprecated, only kept for backwards compatibility until Alpha v5 rolls out.
|
|
385
423
|
async getMessageContextsByTxHash(contractAddress, messageContextRequestsArrayBaseSlot, messageContextResponsesArrayBaseSlot, scope) {
|
|
386
424
|
try {
|
|
387
425
|
if (!this.contractAddress.equals(contractAddress)) {
|
|
388
426
|
throw new Error(`Got a message context request from ${contractAddress}, expected ${this.contractAddress}`);
|
|
389
427
|
}
|
|
390
|
-
// TODO(@mverzilli): this is a prime example of where using
|
|
428
|
+
// TODO(@mverzilli): this is a prime example of where using an ephemeral array would make much more sense, we don't
|
|
391
429
|
// need scopes here, we just need a bit of shared memory to cross boundaries between Noir and TS.
|
|
392
430
|
// At the same time, we don't want to allow any global scope access other than where backwards compatibility
|
|
393
431
|
// forces us to. Hence we need the scope here to be artificial.
|
|
@@ -405,6 +443,17 @@ import { MessageLoadOracleInputs } from './message_load_oracle_inputs.js';
|
|
|
405
443
|
await this.capsuleService.setCapsuleArray(contractAddress, messageContextRequestsArrayBaseSlot, [], this.jobId, scope);
|
|
406
444
|
}
|
|
407
445
|
}
|
|
446
|
+
/** Reads tx hash requests from an ephemeral array, resolves their contexts, and returns the response slot. */ async getMessageContextsByTxHashV2(requestArrayBaseSlot) {
|
|
447
|
+
const requestFields = this.ephemeralArrayService.readArrayAt(requestArrayBaseSlot);
|
|
448
|
+
const txHashes = requestFields.map((fields, i)=>{
|
|
449
|
+
if (fields.length !== 1) {
|
|
450
|
+
throw new Error(`Malformed message context request at index ${i}: expected 1 field (tx hash), got ${fields.length}`);
|
|
451
|
+
}
|
|
452
|
+
return fields[0];
|
|
453
|
+
});
|
|
454
|
+
const maybeMessageContexts = await this.messageContextService.getMessageContextsByTxHash(txHashes, this.anchorBlockHeader.getBlockNumber());
|
|
455
|
+
return this.ephemeralArrayService.newArray(maybeMessageContexts.map(MessageContext.toSerializedOption));
|
|
456
|
+
}
|
|
408
457
|
setCapsule(contractAddress, slot, capsule, scope) {
|
|
409
458
|
if (!contractAddress.equals(this.contractAddress)) {
|
|
410
459
|
// TODO(#10727): instead of this check that this.contractAddress is allowed to access the external DB
|
|
@@ -462,6 +511,27 @@ import { MessageLoadOracleInputs } from './message_load_oracle_inputs.js';
|
|
|
462
511
|
const addressSecret = await computeAddressSecret(await recipientCompleteAddress.getPreaddress(), ivskM);
|
|
463
512
|
return deriveAppSiloedSharedSecret(addressSecret, ephPk, this.contractAddress);
|
|
464
513
|
}
|
|
514
|
+
pushEphemeral(slot, elements) {
|
|
515
|
+
return this.ephemeralArrayService.push(slot, elements);
|
|
516
|
+
}
|
|
517
|
+
popEphemeral(slot) {
|
|
518
|
+
return this.ephemeralArrayService.pop(slot);
|
|
519
|
+
}
|
|
520
|
+
getEphemeral(slot, index) {
|
|
521
|
+
return this.ephemeralArrayService.get(slot, index);
|
|
522
|
+
}
|
|
523
|
+
setEphemeral(slot, index, elements) {
|
|
524
|
+
this.ephemeralArrayService.set(slot, index, elements);
|
|
525
|
+
}
|
|
526
|
+
getEphemeralLen(slot) {
|
|
527
|
+
return this.ephemeralArrayService.len(slot);
|
|
528
|
+
}
|
|
529
|
+
removeEphemeral(slot, index) {
|
|
530
|
+
this.ephemeralArrayService.remove(slot, index);
|
|
531
|
+
}
|
|
532
|
+
clearEphemeral(slot) {
|
|
533
|
+
this.ephemeralArrayService.clear(slot);
|
|
534
|
+
}
|
|
465
535
|
emitOffchainEffect(data) {
|
|
466
536
|
this.offchainEffects.push({
|
|
467
537
|
data,
|
|
@@ -82,4 +82,4 @@ interface ContainsNote {
|
|
|
82
82
|
*/
|
|
83
83
|
export declare function pickNotes<T extends ContainsNote>(noteDatas: T[], { selects, sorts, limit, offset }: GetOptions): T[];
|
|
84
84
|
export {};
|
|
85
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
85
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIj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FFLENBQUM7SUFDZjs7O09BR0c7SUFDSCxLQUFLLENBQUMsRUFBRSxNQUFNLENBQUM7SUFDZjs7O09BR0c7SUFDSCxNQUFNLENBQUMsRUFBRSxNQUFNLENBQUM7Q0FDakI7QUFFRDs7R0FFRztBQUNILFVBQVUsWUFBWTtJQUNwQjs7T0FFRztJQUNILElBQUksRUFBRSxJQUFJLENBQUM7Q0FDWjtBQXlERDs7R0FFRztBQUNILHdCQUFnQixTQUFTLENBQUMsQ0FBQyxTQUFTLFlBQVksRUFDOUMsU0FBUyxFQUFFLENBQUMsRUFBRSxFQUNkLEVBQUUsT0FBWSxFQUFFLEtBQVUsRUFBRSxLQUFTLEVBQUUsTUFBVSxFQUFFLEVBQUUsVUFBVSxHQUM5RCxDQUFDLEVBQUUsQ0FJTCJ9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pick_notes.d.ts","sourceRoot":"","sources":["../../src/contract_function_simulator/pick_notes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,KAAK,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE3D,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,MAAM;IACrB;;OAEG;IACH,QAAQ,EAAE,gBAAgB,CAAC;IAC3B;;OAEG;IACH,KAAK,EAAE,EAAE,CAAC;IACV;;OAEG;IACH,UAAU,EAAE,UAAU,CAAC;CACxB;AAED;;GAEG;AACH,oBAAY,SAAS;IACnB,IAAI,IAAI;IACR,IAAI,IAAI;IACR,GAAG,IAAI;CACR;AAED;;GAEG;AACH,MAAM,WAAW,IAAI;IACnB;;OAEG;IACH,QAAQ,EAAE,gBAAgB,CAAC;IAC3B;;OAEG;IACH,KAAK,EAAE,SAAS,CAAC;CAClB;AAED;;GAEG;AACH,UAAU,UAAU;IAClB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB;;;OAGG;IACH,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;IACf;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,UAAU,YAAY;IACpB;;OAEG;IACH,IAAI,EAAE,IAAI,CAAC;CACZ;
|
|
1
|
+
{"version":3,"file":"pick_notes.d.ts","sourceRoot":"","sources":["../../src/contract_function_simulator/pick_notes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,KAAK,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE3D,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,MAAM;IACrB;;OAEG;IACH,QAAQ,EAAE,gBAAgB,CAAC;IAC3B;;OAEG;IACH,KAAK,EAAE,EAAE,CAAC;IACV;;OAEG;IACH,UAAU,EAAE,UAAU,CAAC;CACxB;AAED;;GAEG;AACH,oBAAY,SAAS;IACnB,IAAI,IAAI;IACR,IAAI,IAAI;IACR,GAAG,IAAI;CACR;AAED;;GAEG;AACH,MAAM,WAAW,IAAI;IACnB;;OAEG;IACH,QAAQ,EAAE,gBAAgB,CAAC;IAC3B;;OAEG;IACH,KAAK,EAAE,SAAS,CAAC;CAClB;AAED;;GAEG;AACH,UAAU,UAAU;IAClB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB;;;OAGG;IACH,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;IACf;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,UAAU,YAAY;IACpB;;OAEG;IACH,IAAI,EAAE,IAAI,CAAC;CACZ;AAyDD;;GAEG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS,YAAY,EAC9C,SAAS,EAAE,CAAC,EAAE,EACd,EAAE,OAAY,EAAE,KAAU,EAAE,KAAS,EAAE,MAAU,EAAE,EAAE,UAAU,GAC9D,CAAC,EAAE,CAIL"}
|
|
@@ -10,8 +10,15 @@ import { Comparator } from '@aztec/stdlib/note';
|
|
|
10
10
|
}({});
|
|
11
11
|
const selectPropertyFromPackedNoteContent = (noteData, selector)=>{
|
|
12
12
|
const noteValueBuffer = noteData[selector.index].toBuffer();
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
// Noir's PropertySelector counts offset from the LSB (last byte of the big-endian buffer),
|
|
14
|
+
// so offset=0,length=Fr.SIZE_IN_BYTES reads the entire field, and offset=0,length=1 reads the last byte.
|
|
15
|
+
const start = Fr.SIZE_IN_BYTES - selector.offset - selector.length;
|
|
16
|
+
const end = Fr.SIZE_IN_BYTES - selector.offset;
|
|
17
|
+
const noteValue = noteValueBuffer.subarray(start, end);
|
|
18
|
+
// Left-pad to Fr.SIZE_IN_BYTES so Fr.fromBuffer interprets the value correctly.
|
|
19
|
+
const padded = Buffer.alloc(Fr.SIZE_IN_BYTES);
|
|
20
|
+
noteValue.copy(padded, Fr.SIZE_IN_BYTES - noteValue.length);
|
|
21
|
+
return Fr.fromBuffer(padded);
|
|
15
22
|
};
|
|
16
23
|
const selectNotes = (noteDatas, selects)=>noteDatas.filter((noteData)=>selects.every(({ selector, value, comparator })=>{
|
|
17
24
|
const noteValueFr = selectPropertyFromPackedNoteContent(noteData.note.items, selector);
|
|
@@ -23,7 +30,11 @@ const selectNotes = (noteDatas, selects)=>noteDatas.filter((noteData)=>selects.e
|
|
|
23
30
|
[Comparator.GT]: ()=>!noteValueFr.lt(value) && !noteValueFr.equals(value),
|
|
24
31
|
[Comparator.GTE]: ()=>!noteValueFr.lt(value)
|
|
25
32
|
};
|
|
26
|
-
|
|
33
|
+
const fn = comparatorSelector[comparator];
|
|
34
|
+
if (!fn) {
|
|
35
|
+
throw new Error(`Invalid comparator value: ${comparator}`);
|
|
36
|
+
}
|
|
37
|
+
return fn();
|
|
27
38
|
}));
|
|
28
39
|
const sortNotes = (a, b, sorts, level = 0)=>{
|
|
29
40
|
if (sorts[level] === undefined) {
|
|
@@ -3,4 +3,4 @@ import type { ContractStore } from '../storage/contract_store/contract_store.js'
|
|
|
3
3
|
export declare class ProxiedContractStoreFactory {
|
|
4
4
|
static create(contractStore: ContractStore, overrides?: ContractOverrides): ContractStore;
|
|
5
5
|
}
|
|
6
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
6
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJveGllZF9jb250cmFjdF9kYXRhX3NvdXJjZS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2NvbnRyYWN0X2Z1bmN0aW9uX3NpbXVsYXRvci9wcm94aWVkX2NvbnRyYWN0X2RhdGFfc291cmNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUVBLE9BQU8sS0FBSyxFQUFFLGlCQUFpQixFQUFFLE1BQU0sa0JBQWtCLENBQUM7QUFFMUQsT0FBTyxLQUFLLEVBQUUsYUFBYSxFQUFFLE1BQU0sNkNBQTZDLENBQUM7QUFPakYscUJBQWEsMkJBQTJCO0lBQ3RDLE1BQU0sQ0FBQyxNQUFNLENBQUMsYUFBYSxFQUFFLGFBQWEsRUFBRSxTQUFTLENBQUMsRUFBRSxpQkFBaUIsaUJBNEV4RTtDQUNGIn0=
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proxied_contract_data_source.d.ts","sourceRoot":"","sources":["../../src/contract_function_simulator/proxied_contract_data_source.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAE1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAC;AAOjF,qBAAa,2BAA2B;IACtC,MAAM,CAAC,MAAM,CAAC,aAAa,EAAE,aAAa,EAAE,SAAS,CAAC,EAAE,iBAAiB,
|
|
1
|
+
{"version":3,"file":"proxied_contract_data_source.d.ts","sourceRoot":"","sources":["../../src/contract_function_simulator/proxied_contract_data_source.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAE1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAC;AAOjF,qBAAa,2BAA2B;IACtC,MAAM,CAAC,MAAM,CAAC,aAAa,EAAE,aAAa,EAAE,SAAS,CAAC,EAAE,iBAAiB,iBA4ExE;CACF"}
|
|
@@ -23,6 +23,7 @@ import { FunctionSelector } from '@aztec/stdlib/abi';
|
|
|
23
23
|
}
|
|
24
24
|
instance.currentContractClassId = realInstance.currentContractClassId;
|
|
25
25
|
instance.originalContractClassId = realInstance.originalContractClassId;
|
|
26
|
+
instance.initializationHash = realInstance.initializationHash;
|
|
26
27
|
return instance;
|
|
27
28
|
} else {
|
|
28
29
|
return target.getContractInstance(address);
|
|
@@ -42,6 +43,7 @@ import { FunctionSelector } from '@aztec/stdlib/abi';
|
|
|
42
43
|
return fn;
|
|
43
44
|
}
|
|
44
45
|
}
|
|
46
|
+
throw new Error(`Function with selector ${selector} not found in stub artifact for overridden contract at ${contractAddress}. The stub does not implement this function.`);
|
|
45
47
|
} else {
|
|
46
48
|
return target.getFunctionArtifact(contractAddress, selector);
|
|
47
49
|
}
|
|
@@ -60,6 +62,7 @@ import { FunctionSelector } from '@aztec/stdlib/abi';
|
|
|
60
62
|
return fn;
|
|
61
63
|
}
|
|
62
64
|
}
|
|
65
|
+
throw new Error(`Function with selector ${selector} not found in stub artifact for overridden contract at ${contractAddress}. The stub does not implement this function.`);
|
|
63
66
|
} else {
|
|
64
67
|
return target.getFunctionArtifactWithDebugMetadata(contractAddress, selector);
|
|
65
68
|
}
|
|
@@ -3,7 +3,6 @@ import type { FunctionCall, FunctionSelector } from '@aztec/stdlib/abi';
|
|
|
3
3
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
4
4
|
import type { AztecNode } from '@aztec/stdlib/interfaces/client';
|
|
5
5
|
import type { BlockHeader } from '@aztec/stdlib/tx';
|
|
6
|
-
import type { AccessScopes } from '../access_scopes.js';
|
|
7
6
|
import type { StagedStore } from '../job_coordinator/job_coordinator.js';
|
|
8
7
|
import type { ContractStore } from '../storage/contract_store/contract_store.js';
|
|
9
8
|
import type { NoteStore } from '../storage/note_store/note_store.js';
|
|
@@ -18,12 +17,11 @@ export declare class ContractSyncService implements StagedStore {
|
|
|
18
17
|
private aztecNode;
|
|
19
18
|
private contractStore;
|
|
20
19
|
private noteStore;
|
|
21
|
-
private getRegisteredAccounts;
|
|
22
20
|
private log;
|
|
23
21
|
readonly storeName = "contract_sync";
|
|
24
22
|
private syncedContracts;
|
|
25
23
|
private excludedFromSync;
|
|
26
|
-
constructor(aztecNode: AztecNode, contractStore: ContractStore, noteStore: NoteStore,
|
|
24
|
+
constructor(aztecNode: AztecNode, contractStore: ContractStore, noteStore: NoteStore, log: Logger);
|
|
27
25
|
/** Sets contracts that should be skipped during sync for a specific job. */
|
|
28
26
|
setExcludedFromSync(jobId: string, addresses: Set<string>): void;
|
|
29
27
|
/**
|
|
@@ -35,12 +33,12 @@ export declare class ContractSyncService implements StagedStore {
|
|
|
35
33
|
* @param utilityExecutor - Executor function for running the sync_state utility function.
|
|
36
34
|
* @param scopes - Access scopes to pass through to the utility executor (affects whose account's private state is discovered).
|
|
37
35
|
*/
|
|
38
|
-
ensureContractSynced(contractAddress: AztecAddress, functionToInvokeAfterSync: FunctionSelector | null, utilityExecutor: (call: FunctionCall, scopes:
|
|
39
|
-
/** Clears sync cache entries for the given scopes of a contract.
|
|
36
|
+
ensureContractSynced(contractAddress: AztecAddress, functionToInvokeAfterSync: FunctionSelector | null, utilityExecutor: (call: FunctionCall, scopes: AztecAddress[]) => Promise<any>, anchorBlockHeader: BlockHeader, jobId: string, scopes: AztecAddress[]): Promise<void>;
|
|
37
|
+
/** Clears sync cache entries for the given scopes of a contract. */
|
|
40
38
|
invalidateContractForScopes(contractAddress: AztecAddress, scopes: AztecAddress[]): void;
|
|
41
39
|
/** Clears sync cache. Called by BlockSynchronizer when anchor block changes. */
|
|
42
40
|
wipe(): void;
|
|
43
41
|
commit(jobId: string): Promise<void>;
|
|
44
42
|
discardStaged(jobId: string): Promise<void>;
|
|
45
43
|
}
|
|
46
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
44
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29udHJhY3Rfc3luY19zZXJ2aWNlLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvY29udHJhY3Rfc3luYy9jb250cmFjdF9zeW5jX3NlcnZpY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLEVBQUUsTUFBTSxFQUFFLE1BQU0sdUJBQXVCLENBQUM7QUFFcEQsT0FBTyxLQUFLLEVBQUUsWUFBWSxFQUFFLGdCQUFnQixFQUFFLE1BQU0sbUJBQW1CLENBQUM7QUFDeEUsT0FBTyxLQUFLLEVBQUUsWUFBWSxFQUFFLE1BQU0sNkJBQTZCLENBQUM7QUFDaEUsT0FBTyxLQUFLLEVBQUUsU0FBUyxFQUFFLE1BQU0saUNBQWlDLENBQUM7QUFDakUsT0FBTyxLQUFLLEVBQUUsV0FBVyxFQUFFLE1BQU0sa0JBQWtCLENBQUM7QUFFcEQsT0FBTyxLQUFLLEVBQUUsV0FBVyxFQUFFLE1BQU0sdUNBQ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UQsb0VBQW9FO0lBQ3BFLDJCQUEyQixDQUFDLGVBQWUsRUFBRSxZQUFZLEVBQUUsTUFBTSxFQUFFLFlBQVksRUFBRSxHQUFHLElBQUksQ0FLdkY7SUFFRCxnRkFBZ0Y7SUFDaEYsSUFBSSxJQUFJLElBQUksQ0FHWDtJQUVELE1BQU0sQ0FBQyxLQUFLLEVBQUUsTUFBTSxHQUFHLE9BQU8sQ0FBQyxJQUFJLENBQUMsQ0FJbkM7SUFFRCxhQUFhLENBQUMsS0FBSyxFQUFFLE1BQU0sR0FBRyxPQUFPLENBQUMsSUFBSSxDQUFDLENBTTFDO0NBc0RGIn0=
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contract_sync_service.d.ts","sourceRoot":"","sources":["../../src/contract_sync/contract_sync_service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"contract_sync_service.d.ts","sourceRoot":"","sources":["../../src/contract_sync/contract_sync_service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAEpD,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACxE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AACzE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAC;AACjF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAMrE;;;;;GAKG;AACH,qBAAa,mBAAoB,YAAW,WAAW;;IAiBnD,OAAO,CAAC,SAAS;IACjB,OAAO,CAAC,aAAa;IACrB,OAAO,CAAC,SAAS;IACjB,OAAO,CAAC,GAAG;IAnBb,QAAQ,CAAC,SAAS,mBAAmB;IAKrC,OAAO,CAAC,eAAe,CAAyC;IAGhE,OAAO,CAAC,gBAAgB,CAAuC;IAO/D,YACU,SAAS,EAAE,SAAS,EACpB,aAAa,EAAE,aAAa,EAC5B,SAAS,EAAE,SAAS,EACpB,GAAG,EAAE,MAAM,EACjB;IAEJ,4EAA4E;IAC5E,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,IAAI,CAE/D;IAED;;;;;;;;OAQG;IACG,oBAAoB,CACxB,eAAe,EAAE,YAAY,EAC7B,yBAAyB,EAAE,gBAAgB,GAAG,IAAI,EAClD,eAAe,EAAE,CAAC,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,KAAK,OAAO,CAAC,GAAG,CAAC,EAC7E,iBAAiB,EAAE,WAAW,EAC9B,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,YAAY,EAAE,GACrB,OAAO,CAAC,IAAI,CAAC,CAwBf;IAED,oEAAoE;IACpE,2BAA2B,CAAC,eAAe,EAAE,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,GAAG,IAAI,CAKvF;IAED,gFAAgF;IAChF,IAAI,IAAI,IAAI,CAGX;IAED,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAInC;IAED,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAM1C;CAsDF"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { Semaphore } from '@aztec/foundation/queue';
|
|
1
2
|
import { syncState, verifyCurrentClassId } from './helpers.js';
|
|
3
|
+
/** Maximum number of scope syncs running concurrently across the PXE. */ const MAX_CONCURRENT_SCOPE_SYNCS = 5;
|
|
2
4
|
/**
|
|
3
5
|
* Service for syncing the private state of contracts and verifying that the PXE holds the current class artifact.
|
|
4
6
|
* It uses a cache to avoid redundant sync operations - the cache is wiped when the anchor block changes.
|
|
@@ -8,7 +10,6 @@ import { syncState, verifyCurrentClassId } from './helpers.js';
|
|
|
8
10
|
aztecNode;
|
|
9
11
|
contractStore;
|
|
10
12
|
noteStore;
|
|
11
|
-
getRegisteredAccounts;
|
|
12
13
|
log;
|
|
13
14
|
storeName;
|
|
14
15
|
// Tracks contracts synced since last wipe. The cache is keyed per individual scope address
|
|
@@ -17,15 +18,19 @@ import { syncState, verifyCurrentClassId } from './helpers.js';
|
|
|
17
18
|
syncedContracts;
|
|
18
19
|
// Per-job excluded contract addresses - these contracts should not be synced.
|
|
19
20
|
excludedFromSync;
|
|
20
|
-
|
|
21
|
+
// Bounds the number of scope syncs running concurrently. Scopes beyond this limit queue here. Sized to trade off
|
|
22
|
+
// parallelism on non-ACIR work (node RPC, note store reads) against memory pressure from concurrent circuit
|
|
23
|
+
// execution.
|
|
24
|
+
#syncSlot;
|
|
25
|
+
constructor(aztecNode, contractStore, noteStore, log){
|
|
21
26
|
this.aztecNode = aztecNode;
|
|
22
27
|
this.contractStore = contractStore;
|
|
23
28
|
this.noteStore = noteStore;
|
|
24
|
-
this.getRegisteredAccounts = getRegisteredAccounts;
|
|
25
29
|
this.log = log;
|
|
26
30
|
this.storeName = 'contract_sync';
|
|
27
31
|
this.syncedContracts = new Map();
|
|
28
32
|
this.excludedFromSync = new Map();
|
|
33
|
+
this.#syncSlot = new Semaphore(MAX_CONCURRENT_SCOPE_SYNCS);
|
|
29
34
|
}
|
|
30
35
|
/** Sets contracts that should be skipped during sync for a specific job. */ setExcludedFromSync(jobId, addresses) {
|
|
31
36
|
this.excludedFromSync.set(jobId, addresses);
|
|
@@ -42,31 +47,14 @@ import { syncState, verifyCurrentClassId } from './helpers.js';
|
|
|
42
47
|
if (this.#shouldSkipSync(jobId, contractAddress)) {
|
|
43
48
|
return;
|
|
44
49
|
}
|
|
45
|
-
this.#startSyncIfNeeded(contractAddress, scopes, (
|
|
50
|
+
this.#startSyncIfNeeded(contractAddress, scopes, ()=>verifyCurrentClassId(contractAddress, this.aztecNode, this.contractStore, anchorBlockHeader), (scope)=>syncState(contractAddress, this.contractStore, functionToInvokeAfterSync, utilityExecutor, this.noteStore, this.aztecNode, anchorBlockHeader, jobId, scope));
|
|
46
51
|
await this.#awaitSync(contractAddress, scopes);
|
|
47
52
|
}
|
|
48
|
-
/** Clears sync cache entries for the given scopes of a contract.
|
|
53
|
+
/** Clears sync cache entries for the given scopes of a contract. */ invalidateContractForScopes(contractAddress, scopes) {
|
|
49
54
|
if (scopes.length === 0) {
|
|
50
55
|
return;
|
|
51
56
|
}
|
|
52
57
|
scopes.forEach((scope)=>this.syncedContracts.delete(toKey(contractAddress, scope)));
|
|
53
|
-
this.syncedContracts.delete(toKey(contractAddress, 'ALL_SCOPES'));
|
|
54
|
-
}
|
|
55
|
-
async #syncContract(contractAddress, functionToInvokeAfterSync, utilityExecutor, anchorBlockHeader, jobId, scopes) {
|
|
56
|
-
this.log.debug(`Syncing contract ${contractAddress}`);
|
|
57
|
-
// Resolve ALL_SCOPES to actual registered accounts, since sync_state must be called once per account.
|
|
58
|
-
const scopeAddresses = scopes === 'ALL_SCOPES' ? await this.getRegisteredAccounts() : scopes;
|
|
59
|
-
await Promise.all([
|
|
60
|
-
// Call sync_state sequentially for each scope address — each invocation synchronizes one account's private
|
|
61
|
-
// state using scoped capsule arrays.
|
|
62
|
-
(async ()=>{
|
|
63
|
-
for (const scope of scopeAddresses){
|
|
64
|
-
await syncState(contractAddress, this.contractStore, functionToInvokeAfterSync, utilityExecutor, this.noteStore, this.aztecNode, anchorBlockHeader, jobId, scope);
|
|
65
|
-
}
|
|
66
|
-
})(),
|
|
67
|
-
verifyCurrentClassId(contractAddress, this.aztecNode, this.contractStore, anchorBlockHeader)
|
|
68
|
-
]);
|
|
69
|
-
this.log.debug(`Contract ${contractAddress} synced`);
|
|
70
58
|
}
|
|
71
59
|
/** Clears sync cache. Called by BlockSynchronizer when anchor block changes. */ wipe() {
|
|
72
60
|
this.log.debug(`Wiping contract sync cache (${this.syncedContracts.size} entries)`);
|
|
@@ -87,38 +75,42 @@ import { syncState, verifyCurrentClassId } from './helpers.js';
|
|
|
87
75
|
/** Returns true if sync should be skipped for this contract */ #shouldSkipSync(jobId, contractAddress) {
|
|
88
76
|
return !!this.excludedFromSync.get(jobId)?.has(contractAddress.toString());
|
|
89
77
|
}
|
|
90
|
-
/**
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
78
|
+
/**
|
|
79
|
+
* If there are unsynced scopes, starts one sync per scope (bounded by #syncSlot) and stores each promise in the
|
|
80
|
+
* cache with per-scope error cleanup. The verifyFn runs once for the whole fan-out and is awaited by every new
|
|
81
|
+
* scope's promise, matching the pre-parallelization invariant that a cache-miss batch re-verifies the class id.
|
|
82
|
+
*/ #startSyncIfNeeded(contractAddress, scopes, verifyFn, syncScopeFn) {
|
|
83
|
+
const scopesToSync = scopes.filter((scope)=>!this.syncedContracts.has(toKey(contractAddress, scope)));
|
|
84
|
+
if (scopesToSync.length === 0) {
|
|
94
85
|
return;
|
|
95
86
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
87
|
+
this.log.debug(`Syncing contract ${contractAddress} for ${scopesToSync.length} scope(s)`);
|
|
88
|
+
const verifyPromise = verifyFn();
|
|
89
|
+
for (const scope of scopesToSync){
|
|
90
|
+
const key = toKey(contractAddress, scope);
|
|
91
|
+
const promise = Promise.all([
|
|
92
|
+
verifyPromise,
|
|
93
|
+
this.#runBounded(()=>syncScopeFn(scope))
|
|
94
|
+
]).then(()=>{}).catch((err)=>{
|
|
95
|
+
this.syncedContracts.delete(key);
|
|
96
|
+
throw err;
|
|
97
|
+
});
|
|
98
|
+
this.syncedContracts.set(key, promise);
|
|
106
99
|
}
|
|
107
|
-
|
|
108
|
-
|
|
100
|
+
}
|
|
101
|
+
/** Runs fn while holding a slot in #syncSlot, bounding total concurrent scope syncs. */ async #runBounded(fn) {
|
|
102
|
+
await this.#syncSlot.acquire();
|
|
103
|
+
try {
|
|
104
|
+
return await fn();
|
|
105
|
+
} finally{
|
|
106
|
+
this.#syncSlot.release();
|
|
109
107
|
}
|
|
110
|
-
return scopes.filter((scope)=>!this.syncedContracts.has(toKey(contractAddress, scope)));
|
|
111
108
|
}
|
|
112
109
|
/** Collects all relevant scope promises (including in-flight ones from concurrent calls) and awaits them. */ async #awaitSync(contractAddress, scopes) {
|
|
113
|
-
const promises =
|
|
110
|
+
const promises = scopes.map((scope)=>this.syncedContracts.get(toKey(contractAddress, scope))).filter((p)=>p !== undefined);
|
|
114
111
|
await Promise.all(promises);
|
|
115
112
|
}
|
|
116
113
|
}
|
|
117
|
-
function toKeys(contract, scopes) {
|
|
118
|
-
return scopes === 'ALL_SCOPES' ? [
|
|
119
|
-
toKey(contract, scopes)
|
|
120
|
-
] : scopes.map((scope)=>toKey(contract, scope));
|
|
121
|
-
}
|
|
122
114
|
function toKey(contract, scope) {
|
|
123
|
-
return
|
|
115
|
+
return `${contract.toString()}:${scope.toString()}`;
|
|
124
116
|
}
|
|
@@ -3,7 +3,6 @@ import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
|
3
3
|
import type { ContractInstance } from '@aztec/stdlib/contract';
|
|
4
4
|
import type { AztecNode } from '@aztec/stdlib/interfaces/client';
|
|
5
5
|
import type { BlockHeader } from '@aztec/stdlib/tx';
|
|
6
|
-
import type { AccessScopes } from '../access_scopes.js';
|
|
7
6
|
import type { ContractStore } from '../storage/contract_store/contract_store.js';
|
|
8
7
|
import type { NoteStore } from '../storage/note_store/note_store.js';
|
|
9
8
|
/**
|
|
@@ -16,7 +15,7 @@ import type { NoteStore } from '../storage/note_store/note_store.js';
|
|
|
16
15
|
* @returns The current class id.
|
|
17
16
|
*/
|
|
18
17
|
export declare function readCurrentClassId(contractAddress: AztecAddress, instance: ContractInstance, aztecNode: AztecNode, header: BlockHeader): Promise<import("@aztec/foundation/schemas").Fr>;
|
|
19
|
-
export declare function syncState(contractAddress: AztecAddress, contractStore: ContractStore, functionToInvokeAfterSync: FunctionSelector | null, utilityExecutor: (privateSyncCall: FunctionCall, scopes:
|
|
18
|
+
export declare function syncState(contractAddress: AztecAddress, contractStore: ContractStore, functionToInvokeAfterSync: FunctionSelector | null, utilityExecutor: (privateSyncCall: FunctionCall, scopes: AztecAddress[]) => Promise<any>, noteStore: NoteStore, aztecNode: AztecNode, anchorBlockHeader: BlockHeader, jobId: string, scope: AztecAddress): Promise<void>;
|
|
20
19
|
/**
|
|
21
20
|
* Verify that the current class id of a contract obtained from AztecNode is the same as the one in contract data
|
|
22
21
|
* provider (i.e. PXE's own storage).
|
|
@@ -26,4 +25,4 @@ export declare function syncState(contractAddress: AztecAddress, contractStore:
|
|
|
26
25
|
* @param header - The header of the block at which to verify the current class id.
|
|
27
26
|
*/
|
|
28
27
|
export declare function verifyCurrentClassId(contractAddress: AztecAddress, aztecNode: AztecNode, contractStore: ContractStore, header: BlockHeader): Promise<void>;
|
|
29
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
28
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaGVscGVycy5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2NvbnRyYWN0X3N5bmMvaGVscGVycy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFDQSxPQUFPLEtBQUssRUFBRSxZQUFZLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSxtQkFBbUIsQ0FBQztBQUN4RSxPQUFPLEtBQUssRUFBRSxZQUFZLEVBQUUsTUFBTSw2QkFBNkIsQ0FBQztBQUNoRSxPQUFPLEtBQUssRUFBRSxnQkFBZ0IsRUFBRSxNQUFNLHdCQUF3QixDQUF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pers.d.ts","sourceRoot":"","sources":["../../src/contract_sync/helpers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACxE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE/D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/contract_sync/helpers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACxE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE/D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAGpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAC;AACjF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAErE;;;;;;;;GAQG;AACH,wBAAsB,kBAAkB,CACtC,eAAe,EAAE,YAAY,EAC7B,QAAQ,EAAE,gBAAgB,EAC1B,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,WAAW,mDAapB;AAED,wBAAsB,SAAS,CAC7B,eAAe,EAAE,YAAY,EAC7B,aAAa,EAAE,aAAa,EAC5B,yBAAyB,EAAE,gBAAgB,GAAG,IAAI,EAClD,eAAe,EAAE,CAAC,eAAe,EAAE,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,KAAK,OAAO,CAAC,GAAG,CAAC,EACxF,SAAS,EAAE,SAAS,EACpB,SAAS,EAAE,SAAS,EACpB,iBAAiB,EAAE,WAAW,EAC9B,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,YAAY,iBAqBpB;AAED;;;;;;;GAOG;AACH,wBAAsB,oBAAoB,CACxC,eAAe,EAAE,YAAY,EAC7B,SAAS,EAAE,SAAS,EACpB,aAAa,EAAE,aAAa,EAC5B,MAAM,EAAE,WAAW,iBAapB"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { FunctionCall } from '@aztec/stdlib/abi';
|
|
2
2
|
import type { AuthWitness } from '@aztec/stdlib/auth-witness';
|
|
3
|
+
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
3
4
|
import type { NoteDao } from '@aztec/stdlib/note';
|
|
4
5
|
import type { ContractOverrides } from '@aztec/stdlib/tx';
|
|
5
|
-
import type { AccessScopes } from '../access_scopes.js';
|
|
6
6
|
import type { BlockSynchronizer } from '../block_synchronizer/block_synchronizer.js';
|
|
7
7
|
import type { ContractFunctionSimulator } from '../contract_function_simulator/contract_function_simulator.js';
|
|
8
8
|
import type { ContractSyncService } from '../contract_sync/contract_sync_service.js';
|
|
@@ -23,7 +23,7 @@ export declare class PXEDebugUtils {
|
|
|
23
23
|
/** Not injected through constructor since they're are co-dependant */
|
|
24
24
|
setPXEHelpers(putJobInQueue: <T>(job: (jobId: string) => Promise<T>) => Promise<T>, getSimulatorForTx: (overrides?: {
|
|
25
25
|
contracts?: ContractOverrides;
|
|
26
|
-
}) => ContractFunctionSimulator, executeUtility: (contractFunctionSimulator: ContractFunctionSimulator, call: FunctionCall, authWitnesses: AuthWitness[] | undefined, scopes:
|
|
26
|
+
}) => ContractFunctionSimulator, executeUtility: (contractFunctionSimulator: ContractFunctionSimulator, call: FunctionCall, authWitnesses: AuthWitness[] | undefined, scopes: AztecAddress[], jobId: string) => Promise<any>): void;
|
|
27
27
|
/**
|
|
28
28
|
* A debugging utility to get notes based on the provided filter.
|
|
29
29
|
*
|
|
@@ -42,4 +42,4 @@ export declare class PXEDebugUtils {
|
|
|
42
42
|
*/
|
|
43
43
|
sync(): Promise<void>;
|
|
44
44
|
}
|
|
45
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
45
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHhlX2RlYnVnX3V0aWxzLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvZGVidWcvcHhlX2RlYnVnX3V0aWxzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxFQUFFLFlBQVksRUFBRSxNQUFNLG1CQUFtQixDQUFDO0FBQ3RELE9BQU8sS0FBSyxFQUFFLFdBQVcsRUFBRSxNQUFNLDRCQUE0QixDQUFDO0FBQzlELE9BQU8sS0FBSyxFQUFFLFlBQVksRUFBRSxNQUFNLDZCQUE2QixDQUFDO0FBQ2hFLE9BQU8sS0FBSyxFQUFFLE9BQU8sRUFBRSxNQUFNLG9CQUFvQixDQUFDO0FBQ2xELE9BQU8sS0FBSyxFQUFFLGlCQUFpQixFQUFFLE1BQU0sa0JBQWtCLENBQUM7QUFFMUQsT0FBTyxLQUFLLEVBQUUsaUJBQWlCLEVBQUUsTUFBTSw2Q0FBNkMsQ0FBQztBQUNyRixPQUFPLEtBQUssRUFBRSx5QkFBeUIsRUFBRSxNQUFNLCtEQUErRCxDQUFDO0FBQy9HLE9BQU8sS0FBSyxFQUFFLG1CQUFtQixFQUFFLE1BQU0sMkNBQTJDLENBQUM7QUFDckYsT0FBTyxLQUFLLEVBQUUsV0FBVyxFQUFFLE1BQU0sb0JBQW9CLENBQUM7QUFDdEQsT0FBTyxLQUFLLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSxxQkFBcUIsQ0FBQztBQUM1RCxPQUFPLEtBQUssRUFBRSxTQUFTLEVBQUUsTUFBTSxxQ0FBcUMsQ0FBQztBQUVyRTs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