@aztec/pxe 0.0.1-commit.96bb3f7 → 0.0.1-commit.a072138
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 +1 -1
- package/dest/block_synchronizer/block_synchronizer.d.ts +9 -5
- package/dest/block_synchronizer/block_synchronizer.d.ts.map +1 -1
- package/dest/block_synchronizer/block_synchronizer.js +66 -21
- package/dest/config/index.d.ts +3 -1
- package/dest/config/index.d.ts.map +1 -1
- package/dest/config/index.js +17 -0
- package/dest/contract_function_simulator/benchmarked_node.d.ts +9 -0
- package/dest/contract_function_simulator/benchmarked_node.d.ts.map +1 -0
- package/dest/contract_function_simulator/benchmarked_node.js +77 -0
- package/dest/contract_function_simulator/contract_function_simulator.d.ts +6 -10
- package/dest/contract_function_simulator/contract_function_simulator.d.ts.map +1 -1
- package/dest/contract_function_simulator/contract_function_simulator.js +33 -25
- package/dest/contract_function_simulator/execution_note_cache.d.ts +18 -9
- package/dest/contract_function_simulator/execution_note_cache.d.ts.map +1 -1
- package/dest/contract_function_simulator/execution_note_cache.js +45 -28
- package/dest/contract_function_simulator/index.d.ts +2 -2
- package/dest/contract_function_simulator/index.d.ts.map +1 -1
- package/dest/contract_function_simulator/index.js +1 -1
- 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/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/noir-structs/utility_context.d.ts +4 -10
- package/dest/contract_function_simulator/noir-structs/utility_context.d.ts.map +1 -1
- package/dest/contract_function_simulator/noir-structs/utility_context.js +7 -18
- package/dest/contract_function_simulator/oracle/interfaces.d.ts +15 -11
- package/dest/contract_function_simulator/oracle/interfaces.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/message_load_oracle_inputs.d.ts +3 -1
- package/dest/contract_function_simulator/oracle/message_load_oracle_inputs.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/note_packing_utils.d.ts +6 -6
- package/dest/contract_function_simulator/oracle/note_packing_utils.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/note_packing_utils.js +8 -8
- package/dest/contract_function_simulator/oracle/oracle.d.ts +10 -8
- package/dest/contract_function_simulator/oracle/oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/oracle.js +44 -33
- package/dest/contract_function_simulator/oracle/private_execution.d.ts +2 -26
- package/dest/contract_function_simulator/oracle/private_execution.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/private_execution.js +0 -35
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts +11 -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 +22 -10
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +33 -20
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.js +78 -76
- package/dest/contract_sync/index.d.ts +23 -0
- package/dest/contract_sync/index.d.ts.map +1 -0
- package/dest/contract_sync/index.js +54 -0
- package/dest/debug/pxe_debug_utils.d.ts +16 -6
- package/dest/debug/pxe_debug_utils.d.ts.map +1 -1
- package/dest/debug/pxe_debug_utils.js +20 -10
- package/dest/entrypoints/client/bundle/utils.d.ts +1 -1
- package/dest/entrypoints/client/bundle/utils.d.ts.map +1 -1
- package/dest/entrypoints/client/bundle/utils.js +12 -6
- 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 +13 -7
- package/dest/entrypoints/pxe_creation_options.d.ts +3 -2
- package/dest/entrypoints/pxe_creation_options.d.ts.map +1 -1
- package/dest/entrypoints/server/index.d.ts +3 -1
- package/dest/entrypoints/server/index.d.ts.map +1 -1
- package/dest/entrypoints/server/index.js +2 -0
- package/dest/entrypoints/server/utils.d.ts +1 -1
- package/dest/entrypoints/server/utils.d.ts.map +1 -1
- package/dest/entrypoints/server/utils.js +19 -8
- package/dest/events/event_service.d.ts +6 -6
- package/dest/events/event_service.d.ts.map +1 -1
- package/dest/events/event_service.js +19 -22
- package/dest/events/private_event_filter_validator.d.ts +5 -5
- package/dest/events/private_event_filter_validator.d.ts.map +1 -1
- package/dest/events/private_event_filter_validator.js +5 -6
- package/dest/job_coordinator/job_coordinator.d.ts +3 -2
- package/dest/job_coordinator/job_coordinator.d.ts.map +1 -1
- package/dest/job_coordinator/job_coordinator.js +3 -2
- package/dest/logs/log_service.d.ts +6 -4
- package/dest/logs/log_service.d.ts.map +1 -1
- package/dest/logs/log_service.js +21 -16
- package/dest/notes/note_service.d.ts +7 -7
- package/dest/notes/note_service.d.ts.map +1 -1
- package/dest/notes/note_service.js +31 -36
- package/dest/oracle_version.d.ts +3 -3
- package/dest/oracle_version.d.ts.map +1 -1
- package/dest/oracle_version.js +4 -3
- package/dest/private_kernel/hints/index.d.ts +2 -2
- package/dest/private_kernel/hints/index.d.ts.map +1 -1
- package/dest/private_kernel/hints/index.js +1 -1
- package/dest/private_kernel/hints/private_kernel_reset_private_inputs_builder.d.ts +28 -0
- package/dest/private_kernel/hints/private_kernel_reset_private_inputs_builder.d.ts.map +1 -0
- package/dest/private_kernel/hints/{build_private_kernel_reset_private_inputs.js → private_kernel_reset_private_inputs_builder.js} +12 -6
- package/dest/private_kernel/private_kernel_execution_prover.d.ts +3 -2
- package/dest/private_kernel/private_kernel_execution_prover.d.ts.map +1 -1
- package/dest/private_kernel/private_kernel_execution_prover.js +3 -3
- package/dest/private_kernel/private_kernel_oracle.d.ts +23 -28
- package/dest/private_kernel/private_kernel_oracle.d.ts.map +1 -1
- package/dest/private_kernel/private_kernel_oracle.js +90 -2
- package/dest/pxe.d.ts +7 -36
- package/dest/pxe.d.ts.map +1 -1
- package/dest/pxe.js +43 -83
- package/dest/storage/address_store/address_store.d.ts +1 -1
- package/dest/storage/address_store/address_store.d.ts.map +1 -1
- package/dest/storage/address_store/address_store.js +12 -11
- package/dest/storage/anchor_block_store/anchor_block_store.d.ts +9 -1
- package/dest/storage/anchor_block_store/anchor_block_store.d.ts.map +1 -1
- package/dest/storage/anchor_block_store/anchor_block_store.js +8 -1
- package/dest/storage/capsule_store/capsule_store.d.ts +24 -9
- package/dest/storage/capsule_store/capsule_store.d.ts.map +1 -1
- package/dest/storage/capsule_store/capsule_store.js +130 -23
- package/dest/storage/contract_store/contract_store.d.ts +1 -2
- package/dest/storage/contract_store/contract_store.d.ts.map +1 -1
- package/dest/storage/contract_store/contract_store.js +22 -25
- package/dest/storage/metadata.d.ts +1 -1
- package/dest/storage/metadata.js +1 -1
- package/dest/storage/note_store/note_store.d.ts +51 -52
- package/dest/storage/note_store/note_store.d.ts.map +1 -1
- package/dest/storage/note_store/note_store.js +282 -263
- package/dest/storage/note_store/stored_note.d.ts +16 -0
- package/dest/storage/note_store/stored_note.d.ts.map +1 -0
- package/dest/storage/note_store/stored_note.js +43 -0
- package/dest/storage/private_event_store/private_event_store.d.ts +43 -8
- package/dest/storage/private_event_store/private_event_store.d.ts.map +1 -1
- package/dest/storage/private_event_store/private_event_store.js +226 -111
- package/dest/storage/private_event_store/stored_private_event.d.ts +23 -0
- package/dest/storage/private_event_store/stored_private_event.d.ts.map +1 -0
- package/dest/storage/private_event_store/stored_private_event.js +56 -0
- package/dest/storage/tagging_store/recipient_tagging_store.d.ts +15 -8
- package/dest/storage/tagging_store/recipient_tagging_store.d.ts.map +1 -1
- package/dest/storage/tagging_store/recipient_tagging_store.js +88 -19
- package/dest/storage/tagging_store/sender_address_book_store.d.ts +1 -1
- package/dest/storage/tagging_store/sender_address_book_store.d.ts.map +1 -1
- package/dest/storage/tagging_store/sender_address_book_store.js +20 -14
- package/dest/storage/tagging_store/sender_tagging_store.d.ts +19 -9
- package/dest/storage/tagging_store/sender_tagging_store.d.ts.map +1 -1
- package/dest/storage/tagging_store/sender_tagging_store.js +252 -100
- package/dest/tagging/get_all_logs_by_tags.d.ts +24 -0
- package/dest/tagging/get_all_logs_by_tags.d.ts.map +1 -0
- package/dest/tagging/get_all_logs_by_tags.js +46 -0
- package/dest/tagging/index.d.ts +2 -1
- package/dest/tagging/index.d.ts.map +1 -1
- package/dest/tagging/index.js +1 -0
- package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts +3 -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 +6 -6
- package/dest/tagging/recipient_sync/utils/load_logs_for_range.d.ts +3 -2
- package/dest/tagging/recipient_sync/utils/load_logs_for_range.d.ts.map +1 -1
- package/dest/tagging/recipient_sync/utils/load_logs_for_range.js +5 -2
- package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts +3 -2
- package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts.map +1 -1
- package/dest/tagging/sender_sync/sync_sender_tagging_indexes.js +7 -7
- package/dest/tagging/sender_sync/utils/get_status_change_of_pending.d.ts +1 -1
- package/dest/tagging/sender_sync/utils/get_status_change_of_pending.d.ts.map +1 -1
- package/dest/tagging/sender_sync/utils/get_status_change_of_pending.js +5 -8
- package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.d.ts +5 -2
- package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.d.ts.map +1 -1
- package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.js +10 -5
- package/package.json +18 -18
- package/src/bin/check_oracle_version.ts +1 -0
- package/src/block_synchronizer/block_synchronizer.ts +85 -33
- package/src/config/index.ts +14 -0
- package/src/contract_function_simulator/benchmarked_node.ts +103 -0
- package/src/contract_function_simulator/contract_function_simulator.ts +34 -28
- package/src/contract_function_simulator/execution_note_cache.ts +44 -25
- package/src/contract_function_simulator/index.ts +1 -1
- package/src/contract_function_simulator/noir-structs/event_validation_request.ts +1 -1
- package/src/contract_function_simulator/noir-structs/note_validation_request.ts +1 -1
- package/src/contract_function_simulator/noir-structs/utility_context.ts +6 -25
- package/src/contract_function_simulator/oracle/interfaces.ts +20 -10
- package/src/contract_function_simulator/oracle/note_packing_utils.ts +10 -10
- package/src/contract_function_simulator/oracle/oracle.ts +65 -40
- package/src/contract_function_simulator/oracle/private_execution.ts +1 -67
- package/src/contract_function_simulator/oracle/private_execution_oracle.ts +35 -12
- package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +100 -82
- package/src/contract_sync/index.ts +98 -0
- package/src/debug/pxe_debug_utils.ts +26 -11
- package/src/entrypoints/client/bundle/utils.ts +7 -14
- package/src/entrypoints/client/lazy/utils.ts +8 -14
- package/src/entrypoints/pxe_creation_options.ts +2 -1
- package/src/entrypoints/server/index.ts +2 -0
- package/src/entrypoints/server/utils.ts +15 -19
- package/src/events/event_service.ts +17 -25
- package/src/events/private_event_filter_validator.ts +3 -5
- package/src/job_coordinator/job_coordinator.ts +4 -3
- package/src/logs/log_service.ts +32 -14
- package/src/notes/note_service.ts +38 -43
- package/src/oracle_version.ts +4 -3
- package/src/private_kernel/hints/index.ts +1 -1
- package/src/private_kernel/hints/{build_private_kernel_reset_private_inputs.ts → private_kernel_reset_private_inputs_builder.ts} +32 -20
- package/src/private_kernel/private_kernel_execution_prover.ts +7 -4
- package/src/private_kernel/private_kernel_oracle.ts +116 -37
- package/src/pxe.ts +77 -118
- package/src/storage/address_store/address_store.ts +15 -15
- package/src/storage/anchor_block_store/anchor_block_store.ts +8 -0
- package/src/storage/capsule_store/capsule_store.ts +159 -23
- package/src/storage/contract_store/contract_store.ts +22 -31
- package/src/storage/metadata.ts +1 -1
- package/src/storage/note_store/note_store.ts +317 -318
- package/src/storage/note_store/stored_note.ts +48 -0
- package/src/storage/private_event_store/private_event_store.ts +292 -124
- package/src/storage/private_event_store/stored_private_event.ts +73 -0
- package/src/storage/tagging_store/recipient_tagging_store.ts +106 -20
- package/src/storage/tagging_store/sender_address_book_store.ts +20 -14
- package/src/storage/tagging_store/sender_tagging_store.ts +293 -108
- package/src/tagging/get_all_logs_by_tags.ts +68 -0
- package/src/tagging/index.ts +1 -0
- package/src/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.ts +16 -5
- package/src/tagging/recipient_sync/utils/load_logs_for_range.ts +7 -1
- package/src/tagging/sender_sync/sync_sender_tagging_indexes.ts +9 -6
- package/src/tagging/sender_sync/utils/get_status_change_of_pending.ts +5 -17
- package/src/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.ts +16 -4
- package/dest/contract_function_simulator/proxied_node.d.ts +0 -9
- package/dest/contract_function_simulator/proxied_node.d.ts.map +0 -1
- package/dest/contract_function_simulator/proxied_node.js +0 -27
- package/dest/private_kernel/hints/build_private_kernel_reset_private_inputs.d.ts +0 -28
- package/dest/private_kernel/hints/build_private_kernel_reset_private_inputs.d.ts.map +0 -1
- package/dest/private_kernel/private_kernel_oracle_impl.d.ts +0 -46
- package/dest/private_kernel/private_kernel_oracle_impl.d.ts.map +0 -1
- package/dest/private_kernel/private_kernel_oracle_impl.js +0 -85
- package/dest/public_storage/public_storage_service.d.ts +0 -24
- package/dest/public_storage/public_storage_service.d.ts.map +0 -1
- package/dest/public_storage/public_storage_service.js +0 -26
- package/dest/tree_membership/tree_membership_service.d.ts +0 -52
- package/dest/tree_membership/tree_membership_service.d.ts.map +0 -1
- package/dest/tree_membership/tree_membership_service.js +0 -84
- package/src/contract_function_simulator/proxied_node.ts +0 -33
- package/src/private_kernel/private_kernel_oracle_impl.ts +0 -127
- package/src/public_storage/public_storage_service.ts +0 -33
- package/src/tree_membership/tree_membership_service.ts +0 -112
|
@@ -1,26 +1,28 @@
|
|
|
1
1
|
import type { Fr } from '@aztec/foundation/curves/bn254';
|
|
2
|
+
import { type LoggerBindings } from '@aztec/foundation/log';
|
|
2
3
|
import type { KeyStore } from '@aztec/key-store';
|
|
3
4
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
4
5
|
import type { AztecNode } from '@aztec/stdlib/interfaces/server';
|
|
6
|
+
import type { BlockHeader } from '@aztec/stdlib/tx';
|
|
5
7
|
import type { LogRetrievalRequest } from '../contract_function_simulator/noir-structs/log_retrieval_request.js';
|
|
6
8
|
import { LogRetrievalResponse } from '../contract_function_simulator/noir-structs/log_retrieval_response.js';
|
|
7
9
|
import { AddressStore } from '../storage/address_store/address_store.js';
|
|
8
|
-
import { AnchorBlockStore } from '../storage/anchor_block_store/anchor_block_store.js';
|
|
9
10
|
import { CapsuleStore } from '../storage/capsule_store/capsule_store.js';
|
|
10
11
|
import type { RecipientTaggingStore } from '../storage/tagging_store/recipient_tagging_store.js';
|
|
11
12
|
import type { SenderAddressBookStore } from '../storage/tagging_store/sender_address_book_store.js';
|
|
12
13
|
export declare class LogService {
|
|
13
14
|
#private;
|
|
14
15
|
private readonly aztecNode;
|
|
15
|
-
private readonly
|
|
16
|
+
private readonly anchorBlockHeader;
|
|
16
17
|
private readonly keyStore;
|
|
17
18
|
private readonly capsuleStore;
|
|
18
19
|
private readonly recipientTaggingStore;
|
|
19
20
|
private readonly senderAddressBookStore;
|
|
20
21
|
private readonly addressStore;
|
|
22
|
+
private readonly jobId;
|
|
21
23
|
private log;
|
|
22
|
-
constructor(aztecNode: AztecNode,
|
|
24
|
+
constructor(aztecNode: AztecNode, anchorBlockHeader: BlockHeader, keyStore: KeyStore, capsuleStore: CapsuleStore, recipientTaggingStore: RecipientTaggingStore, senderAddressBookStore: SenderAddressBookStore, addressStore: AddressStore, jobId: string, bindings?: LoggerBindings);
|
|
23
25
|
bulkRetrieveLogs(logRetrievalRequests: LogRetrievalRequest[]): Promise<(LogRetrievalResponse | null)[]>;
|
|
24
26
|
syncTaggedLogs(contractAddress: AztecAddress, pendingTaggedLogArrayBaseSlot: Fr, scopes?: AztecAddress[]): Promise<void>;
|
|
25
27
|
}
|
|
26
|
-
//# sourceMapping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AAsB,EAAE,sBAAsB,EAC9C,YAAY,EAAE,YAAY,EAC1B,KAAK,EAAE,MAAM,EAC9B,QAAQ,CAAC,EAAE,cAAc,EAG1B;IAEY,gBAAgB,CAAC,oBAAoB,EAAE,mBAAmB,EAAE,GAAG,OAAO,CAAC,CAAC,oBAAoB,GAAG,IAAI,CAAC,EAAE,CAAC,CAiBnH;IAuDY,cAAc,CACzB,eAAe,EAAE,YAAY,EAC7B,6BAA6B,EAAE,EAAE,EACjC,MAAM,CAAC,EAAE,YAAY,EAAE,iBA0CxB;CAgEF"}
|
package/dest/logs/log_service.js
CHANGED
|
@@ -2,25 +2,27 @@ import { createLogger } from '@aztec/foundation/log';
|
|
|
2
2
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
3
3
|
import { DirectionalAppTaggingSecret, PendingTaggedLog, SiloedTag } from '@aztec/stdlib/logs';
|
|
4
4
|
import { LogRetrievalResponse } from '../contract_function_simulator/noir-structs/log_retrieval_response.js';
|
|
5
|
-
import { loadPrivateLogsForSenderRecipientPair } from '../tagging/index.js';
|
|
5
|
+
import { getAllPrivateLogsByTags, getAllPublicLogsByTagsFromContract, loadPrivateLogsForSenderRecipientPair } from '../tagging/index.js';
|
|
6
6
|
export class LogService {
|
|
7
7
|
aztecNode;
|
|
8
|
-
|
|
8
|
+
anchorBlockHeader;
|
|
9
9
|
keyStore;
|
|
10
10
|
capsuleStore;
|
|
11
11
|
recipientTaggingStore;
|
|
12
12
|
senderAddressBookStore;
|
|
13
13
|
addressStore;
|
|
14
|
+
jobId;
|
|
14
15
|
log;
|
|
15
|
-
constructor(aztecNode,
|
|
16
|
+
constructor(aztecNode, anchorBlockHeader, keyStore, capsuleStore, recipientTaggingStore, senderAddressBookStore, addressStore, jobId, bindings){
|
|
16
17
|
this.aztecNode = aztecNode;
|
|
17
|
-
this.
|
|
18
|
+
this.anchorBlockHeader = anchorBlockHeader;
|
|
18
19
|
this.keyStore = keyStore;
|
|
19
20
|
this.capsuleStore = capsuleStore;
|
|
20
21
|
this.recipientTaggingStore = recipientTaggingStore;
|
|
21
22
|
this.senderAddressBookStore = senderAddressBookStore;
|
|
22
23
|
this.addressStore = addressStore;
|
|
23
|
-
this.
|
|
24
|
+
this.jobId = jobId;
|
|
25
|
+
this.log = createLogger('pxe:log_service', bindings);
|
|
24
26
|
}
|
|
25
27
|
async bulkRetrieveLogs(logRetrievalRequests) {
|
|
26
28
|
return await Promise.all(logRetrievalRequests.map(async (request)=>{
|
|
@@ -35,11 +37,12 @@ export class LogService {
|
|
|
35
37
|
}));
|
|
36
38
|
}
|
|
37
39
|
async #getPublicLogByTag(tag, contractAddress) {
|
|
38
|
-
const
|
|
40
|
+
const anchorBlockHash = await this.anchorBlockHeader.hash();
|
|
41
|
+
const allLogsPerTag = await getAllPublicLogsByTagsFromContract(this.aztecNode, contractAddress, [
|
|
39
42
|
tag
|
|
40
|
-
]);
|
|
41
|
-
const logsForTag =
|
|
42
|
-
if (logsForTag.length
|
|
43
|
+
], anchorBlockHash);
|
|
44
|
+
const logsForTag = allLogsPerTag[0];
|
|
45
|
+
if (logsForTag.length === 0) {
|
|
43
46
|
return null;
|
|
44
47
|
} else if (logsForTag.length > 1) {
|
|
45
48
|
// TODO(#11627): handle this case
|
|
@@ -49,11 +52,12 @@ export class LogService {
|
|
|
49
52
|
return new LogRetrievalResponse(scopedLog.logData.slice(1), scopedLog.txHash, scopedLog.noteHashes, scopedLog.firstNullifier);
|
|
50
53
|
}
|
|
51
54
|
async #getPrivateLogByTag(siloedTag) {
|
|
52
|
-
const
|
|
55
|
+
const anchorBlockHash = await this.anchorBlockHeader.hash();
|
|
56
|
+
const allLogsPerTag = await getAllPrivateLogsByTags(this.aztecNode, [
|
|
53
57
|
siloedTag
|
|
54
|
-
]);
|
|
55
|
-
const logsForTag =
|
|
56
|
-
if (logsForTag.length
|
|
58
|
+
], anchorBlockHash);
|
|
59
|
+
const logsForTag = allLogsPerTag[0];
|
|
60
|
+
if (logsForTag.length === 0) {
|
|
57
61
|
return null;
|
|
58
62
|
} else if (logsForTag.length > 1) {
|
|
59
63
|
// TODO(#11627): handle this case
|
|
@@ -67,7 +71,8 @@ export class LogService {
|
|
|
67
71
|
contract: contractAddress
|
|
68
72
|
});
|
|
69
73
|
// We only load logs from block up to and including the anchor block number
|
|
70
|
-
const anchorBlockNumber =
|
|
74
|
+
const anchorBlockNumber = this.anchorBlockHeader.getBlockNumber();
|
|
75
|
+
const anchorBlockHash = await this.anchorBlockHeader.hash();
|
|
71
76
|
// Determine recipients: use scopes if provided, otherwise get all accounts
|
|
72
77
|
const recipients = scopes && scopes.length > 0 ? scopes : await this.keyStore.getAccounts();
|
|
73
78
|
// For each recipient, fetch secrets, load logs, and store them.
|
|
@@ -76,7 +81,7 @@ export class LogService {
|
|
|
76
81
|
// Get all secrets for this recipient (one per sender)
|
|
77
82
|
const secrets = await this.#getSecretsForSenders(contractAddress, recipient);
|
|
78
83
|
// Load logs for all sender-recipient pairs in parallel
|
|
79
|
-
const logArrays = await Promise.all(secrets.map((secret)=>loadPrivateLogsForSenderRecipientPair(secret, contractAddress, this.aztecNode, this.recipientTaggingStore, anchorBlockNumber)));
|
|
84
|
+
const logArrays = await Promise.all(secrets.map((secret)=>loadPrivateLogsForSenderRecipientPair(secret, contractAddress, this.aztecNode, this.recipientTaggingStore, anchorBlockNumber, anchorBlockHash, this.jobId)));
|
|
80
85
|
// Flatten all logs from all secrets
|
|
81
86
|
const allLogs = logArrays.flat();
|
|
82
87
|
// Store the logs for this recipient
|
|
@@ -107,7 +112,7 @@ export class LogService {
|
|
|
107
112
|
return pendingTaggedLog.toFields();
|
|
108
113
|
});
|
|
109
114
|
// TODO: This looks like it could belong more at the oracle interface level
|
|
110
|
-
return this.capsuleStore.appendToCapsuleArray(contractAddress, capsuleArrayBaseSlot, pendingTaggedLogs);
|
|
115
|
+
return this.capsuleStore.appendToCapsuleArray(contractAddress, capsuleArrayBaseSlot, pendingTaggedLogs, this.jobId);
|
|
111
116
|
}
|
|
112
117
|
async #getCompleteAddress(account) {
|
|
113
118
|
const completeAddress = await this.addressStore.getCompleteAddress(account);
|
|
@@ -2,14 +2,14 @@ import { Fr } from '@aztec/foundation/curves/bn254';
|
|
|
2
2
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
3
3
|
import { type AztecNode } from '@aztec/stdlib/interfaces/client';
|
|
4
4
|
import { Note, NoteStatus } from '@aztec/stdlib/note';
|
|
5
|
-
import type { TxHash } from '@aztec/stdlib/tx';
|
|
6
|
-
import type { AnchorBlockStore } from '../storage/anchor_block_store/anchor_block_store.js';
|
|
5
|
+
import type { BlockHeader, TxHash } from '@aztec/stdlib/tx';
|
|
7
6
|
import type { NoteStore } from '../storage/note_store/note_store.js';
|
|
8
7
|
export declare class NoteService {
|
|
9
8
|
private readonly noteStore;
|
|
10
9
|
private readonly aztecNode;
|
|
11
|
-
private readonly
|
|
12
|
-
|
|
10
|
+
private readonly anchorBlockHeader;
|
|
11
|
+
private readonly jobId;
|
|
12
|
+
constructor(noteStore: NoteStore, aztecNode: AztecNode, anchorBlockHeader: BlockHeader, jobId: string);
|
|
13
13
|
/**
|
|
14
14
|
* Retrieves a set of notes stored in the database for a given contract address and storage slot.
|
|
15
15
|
* The query result is paginated using 'limit' and 'offset' values.
|
|
@@ -27,8 +27,8 @@ export declare class NoteService {
|
|
|
27
27
|
noteNonce: Fr;
|
|
28
28
|
note: Note;
|
|
29
29
|
noteHash: Fr;
|
|
30
|
+
isPending: boolean;
|
|
30
31
|
siloedNullifier: Fr;
|
|
31
|
-
index: bigint;
|
|
32
32
|
}[]>;
|
|
33
33
|
/**
|
|
34
34
|
* Looks for nullifiers of active contract notes and marks them as nullified if a nullifier is found.
|
|
@@ -43,6 +43,6 @@ export declare class NoteService {
|
|
|
43
43
|
* @param contractAddress - The contract whose notes should be checked and nullified.
|
|
44
44
|
*/
|
|
45
45
|
syncNoteNullifiers(contractAddress: AztecAddress): Promise<void>;
|
|
46
|
-
|
|
46
|
+
validateAndStoreNote(contractAddress: AztecAddress, owner: AztecAddress, storageSlot: Fr, randomness: Fr, noteNonce: Fr, content: Fr[], noteHash: Fr, nullifier: Fr, txHash: TxHash, recipient: AztecAddress): Promise<void>;
|
|
47
47
|
}
|
|
48
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
48
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibm90ZV9zZXJ2aWNlLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvbm90ZXMvbm90ZV9zZXJ2aWNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxFQUFFLEVBQUUsTUFBTSxnQ0FBZ0MsQ0FBQztBQUNwRCxPQUFPLEtBQUssRUFBRSxZQUFZLEVBQUUsTUFBTSw2QkFBNkIsQ0FBQztBQUdoRSxPQUFPLEVBQUUsS0FBSyxTQUFTLEVBQWUsTUFBTSxpQ0FBaUMsQ0FBQztBQUM5RSxPQUFPLEVBQUUsSUFBSSxFQUFXLFVBQVUsRUFBRSxNQUFNLG9CQUFvQixDQUFDO0FBRS9ELE9BQU8sS0FBSyxFQUFFLFdBQVcsRUFBRSxNQUFNLEVBQUUsTUFBTSxrQkFBa0IsQ0FBQztBQUU1RCxPQUFPLEtBQUssRUFBRSxTQUFTLEVBQUUsTUFBTSxxQ0FBcUMsQ0FBQztBQUVyRSxxQkFBYSxXQUFXO0lBRXBCLE9BQU8sQ0FBQyxRQUFRLENBQUMsU0FBUztJQUMxQixPQUFPLENBQUMsUUFBUSxDQUFDLFNBQVM7SUFDMUIsT0FBTyxDQUFDLFFBQVEsQ0FBQyxpQkFBaUI7SUFDbEMsT0FBTyxDQUFDLFFBQVEsQ0FBQyxLQUFLO0lBSnhCLFlBQ21CLFNBQVMsRUFBRSxTQUFTLEVBQ3BCLFNBQVMsRUFBRSxTQUFTLEVBQ3BCLGlCQUFpQixFQUFFLFdBQVc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,EAAE,MAAM,EACd,SAAS,EAAE,YAAY,GACtB,OAAO,CAAC,IAAI,CAAC,CAsEf;CACF"}
|
|
@@ -5,11 +5,13 @@ import { MerkleTreeId } from '@aztec/stdlib/trees';
|
|
|
5
5
|
export class NoteService {
|
|
6
6
|
noteStore;
|
|
7
7
|
aztecNode;
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
anchorBlockHeader;
|
|
9
|
+
jobId;
|
|
10
|
+
constructor(noteStore, aztecNode, anchorBlockHeader, jobId){
|
|
10
11
|
this.noteStore = noteStore;
|
|
11
12
|
this.aztecNode = aztecNode;
|
|
12
|
-
this.
|
|
13
|
+
this.anchorBlockHeader = anchorBlockHeader;
|
|
14
|
+
this.jobId = jobId;
|
|
13
15
|
}
|
|
14
16
|
/**
|
|
15
17
|
* Retrieves a set of notes stored in the database for a given contract address and storage slot.
|
|
@@ -26,8 +28,8 @@ export class NoteService {
|
|
|
26
28
|
storageSlot,
|
|
27
29
|
status,
|
|
28
30
|
scopes
|
|
29
|
-
});
|
|
30
|
-
return noteDaos.map(({ contractAddress, owner, storageSlot, randomness, noteNonce, note, noteHash, siloedNullifier
|
|
31
|
+
}, this.jobId);
|
|
32
|
+
return noteDaos.map(({ contractAddress, owner, storageSlot, randomness, noteNonce, note, noteHash, siloedNullifier })=>({
|
|
31
33
|
contractAddress,
|
|
32
34
|
owner,
|
|
33
35
|
storageSlot,
|
|
@@ -35,9 +37,8 @@ export class NoteService {
|
|
|
35
37
|
noteNonce,
|
|
36
38
|
note,
|
|
37
39
|
noteHash,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
index
|
|
40
|
+
isPending: false,
|
|
41
|
+
siloedNullifier
|
|
41
42
|
}));
|
|
42
43
|
}
|
|
43
44
|
/**
|
|
@@ -52,10 +53,10 @@ export class NoteService {
|
|
|
52
53
|
*
|
|
53
54
|
* @param contractAddress - The contract whose notes should be checked and nullified.
|
|
54
55
|
*/ async syncNoteNullifiers(contractAddress) {
|
|
55
|
-
const
|
|
56
|
+
const anchorBlockHash = await this.anchorBlockHeader.hash();
|
|
56
57
|
const contractNotes = await this.noteStore.getNotes({
|
|
57
58
|
contractAddress
|
|
58
|
-
});
|
|
59
|
+
}, this.jobId);
|
|
59
60
|
if (contractNotes.length === 0) {
|
|
60
61
|
return;
|
|
61
62
|
}
|
|
@@ -72,7 +73,7 @@ export class NoteService {
|
|
|
72
73
|
}, [
|
|
73
74
|
[]
|
|
74
75
|
]);
|
|
75
|
-
const nullifierIndexes = (await Promise.all(nullifierBatches.map((batch)=>this.aztecNode.findLeavesIndexes(
|
|
76
|
+
const nullifierIndexes = (await Promise.all(nullifierBatches.map((batch)=>this.aztecNode.findLeavesIndexes(anchorBlockHash, MerkleTreeId.NULLIFIER_TREE, batch)))).flat();
|
|
76
77
|
const foundNullifiers = nullifiersToCheck.map((nullifier, i)=>{
|
|
77
78
|
if (nullifierIndexes[i] !== undefined) {
|
|
78
79
|
return {
|
|
@@ -83,9 +84,9 @@ export class NoteService {
|
|
|
83
84
|
};
|
|
84
85
|
}
|
|
85
86
|
}).filter((nullifier)=>nullifier !== undefined);
|
|
86
|
-
await this.noteStore.applyNullifiers(foundNullifiers);
|
|
87
|
+
await this.noteStore.applyNullifiers(foundNullifiers, this.jobId);
|
|
87
88
|
}
|
|
88
|
-
async
|
|
89
|
+
async validateAndStoreNote(contractAddress, owner, storageSlot, randomness, noteNonce, content, noteHash, nullifier, txHash, recipient) {
|
|
89
90
|
// We are going to store the new note in the NoteStore, which will let us later return it via `getNotes`.
|
|
90
91
|
// There's two things we need to check before we do this however:
|
|
91
92
|
// - we must make sure the note does actually exist in the note hash tree
|
|
@@ -104,49 +105,43 @@ export class NoteService {
|
|
|
104
105
|
// number which *should* be recent enough to be available, even for non-archive nodes.
|
|
105
106
|
// Also note that the note should never be ahead of the synced block here since `fetchTaggedLogs` only processes
|
|
106
107
|
// logs up to the synced block making this only an additional safety check.
|
|
107
|
-
const
|
|
108
|
+
const anchorBlockNumber = this.anchorBlockHeader.getBlockNumber();
|
|
109
|
+
const anchorBlockHash = await this.anchorBlockHeader.hash();
|
|
108
110
|
// By computing siloed and unique note hashes ourselves we prevent contracts from interfering with the note storage
|
|
109
111
|
// of other contracts, which would constitute a security breach.
|
|
110
112
|
const uniqueNoteHash = await computeUniqueNoteHash(noteNonce, await siloNoteHash(contractAddress, noteHash));
|
|
111
113
|
const siloedNullifier = await siloNullifier(contractAddress, nullifier);
|
|
112
|
-
const txEffect = await
|
|
114
|
+
const [txEffect, [nullifierIndex]] = await Promise.all([
|
|
115
|
+
this.aztecNode.getTxEffect(txHash),
|
|
116
|
+
this.aztecNode.findLeavesIndexes(anchorBlockHash, MerkleTreeId.NULLIFIER_TREE, [
|
|
117
|
+
siloedNullifier
|
|
118
|
+
])
|
|
119
|
+
]);
|
|
113
120
|
if (!txEffect) {
|
|
114
121
|
throw new Error(`Could not find tx effect for tx hash ${txHash}`);
|
|
115
122
|
}
|
|
116
|
-
if (txEffect.l2BlockNumber >
|
|
117
|
-
throw new Error(`Could not find tx effect for tx hash ${txHash} as of block number ${
|
|
123
|
+
if (txEffect.l2BlockNumber > anchorBlockNumber) {
|
|
124
|
+
throw new Error(`Could not find tx effect for tx hash ${txHash} as of block number ${anchorBlockNumber}`);
|
|
118
125
|
}
|
|
119
|
-
|
|
120
|
-
|
|
126
|
+
// Find the index of the note hash in the noteHashes array to determine note ordering within the tx
|
|
127
|
+
const noteIndexInTx = txEffect.data.noteHashes.findIndex((nh)=>nh.equals(uniqueNoteHash));
|
|
128
|
+
if (noteIndexInTx === -1) {
|
|
121
129
|
throw new Error(`Note hash ${noteHash} (uniqued as ${uniqueNoteHash}) is not present in tx ${txHash}`);
|
|
122
130
|
}
|
|
123
|
-
|
|
124
|
-
// note existence in said tree. We concurrently also check if the note's nullifier exists, performing all node
|
|
125
|
-
// queries in a single round-trip.
|
|
126
|
-
const [[uniqueNoteHashTreeIndexInBlock], [nullifierIndex]] = await Promise.all([
|
|
127
|
-
this.aztecNode.findLeavesIndexes(syncedBlockNumber, MerkleTreeId.NOTE_HASH_TREE, [
|
|
128
|
-
uniqueNoteHash
|
|
129
|
-
]),
|
|
130
|
-
this.aztecNode.findLeavesIndexes(syncedBlockNumber, MerkleTreeId.NULLIFIER_TREE, [
|
|
131
|
-
siloedNullifier
|
|
132
|
-
])
|
|
133
|
-
]);
|
|
134
|
-
if (uniqueNoteHashTreeIndexInBlock === undefined) {
|
|
135
|
-
throw new Error(`Note hash ${noteHash} (uniqued as ${uniqueNoteHash}) is not present on the tree at block ${syncedBlockNumber} (from tx ${txHash})`);
|
|
136
|
-
}
|
|
137
|
-
const noteDao = new NoteDao(new Note(content), contractAddress, owner, storageSlot, randomness, noteNonce, noteHash, siloedNullifier, txHash, uniqueNoteHashTreeIndexInBlock.l2BlockNumber, uniqueNoteHashTreeIndexInBlock.l2BlockHash.toString(), uniqueNoteHashTreeIndexInBlock.data);
|
|
131
|
+
const noteDao = new NoteDao(new Note(content), contractAddress, owner, storageSlot, randomness, noteNonce, noteHash, siloedNullifier, txHash, txEffect.l2BlockNumber, txEffect.l2BlockHash.toString(), txEffect.txIndexInBlock, noteIndexInTx);
|
|
138
132
|
// The note was found by `recipient`, so we use that as the scope when storing the note.
|
|
139
133
|
await this.noteStore.addNotes([
|
|
140
134
|
noteDao
|
|
141
|
-
], recipient);
|
|
135
|
+
], recipient, this.jobId);
|
|
142
136
|
if (nullifierIndex !== undefined) {
|
|
137
|
+
// We found nullifier index which implies that the note has already been nullified.
|
|
143
138
|
const { data: _, ...blockHashAndNum } = nullifierIndex;
|
|
144
139
|
await this.noteStore.applyNullifiers([
|
|
145
140
|
{
|
|
146
141
|
data: siloedNullifier,
|
|
147
142
|
...blockHashAndNum
|
|
148
143
|
}
|
|
149
|
-
]);
|
|
144
|
+
], this.jobId);
|
|
150
145
|
}
|
|
151
146
|
}
|
|
152
147
|
}
|
package/dest/oracle_version.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const ORACLE_VERSION =
|
|
2
|
-
export declare const ORACLE_INTERFACE_HASH = "
|
|
3
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
1
|
+
export declare const ORACLE_VERSION = 10;
|
|
2
|
+
export declare const ORACLE_INTERFACE_HASH = "a3b284ee5abff0509986d6d2fa78a3e6e2ec212325674de78355c5e70b05784c";
|
|
3
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3JhY2xlX3ZlcnNpb24uZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9vcmFjbGVfdmVyc2lvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFNQSxlQUFPLE1BQU0sY0FBYyxLQUFLLENBQUM7QUFLakMsZUFBTyxNQUFNLHFCQUFxQixxRUFBcUUsQ0FBQyJ9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oracle_version.d.ts","sourceRoot":"","sources":["../src/oracle_version.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"oracle_version.d.ts","sourceRoot":"","sources":["../src/oracle_version.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,cAAc,KAAK,CAAC;AAKjC,eAAO,MAAM,qBAAqB,qEAAqE,CAAC"}
|
package/dest/oracle_version.js
CHANGED
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
///
|
|
5
5
|
/// @dev Whenever a contract function or Noir test is run, the `utilityAssertCompatibleOracleVersion` oracle is called
|
|
6
6
|
/// and if the oracle version is incompatible an error is thrown.
|
|
7
|
-
export const ORACLE_VERSION =
|
|
7
|
+
export const ORACLE_VERSION = 10;
|
|
8
8
|
/// This hash is computed as by hashing the Oracle interface and it is used to detect when the Oracle interface changes,
|
|
9
|
-
/// which in turn implies that you need to update the ORACLE_VERSION constant
|
|
10
|
-
|
|
9
|
+
/// which in turn implies that you need to update the ORACLE_VERSION constant in this file and in
|
|
10
|
+
/// `noir-projects/aztec-nr/aztec/src/oracle/version.nr`.
|
|
11
|
+
export const ORACLE_INTERFACE_HASH = 'a3b284ee5abff0509986d6d2fa78a3e6e2ec212325674de78355c5e70b05784c';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './private_kernel_reset_private_inputs_builder.js';
|
|
2
2
|
export * from './compute_tx_include_by_timestamp.js';
|
|
3
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
3
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9wcml2YXRlX2tlcm5lbC9oaW50cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxjQUFjLGtEQUFrRCxDQUFDO0FBQ2pFLGNBQWMsc0NBQXNDLENBQUMifQ==
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/private_kernel/hints/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/private_kernel/hints/index.ts"],"names":[],"mappings":"AAAA,cAAc,kDAAkD,CAAC;AACjE,cAAc,sCAAsC,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './private_kernel_reset_private_inputs_builder.js';
|
|
2
2
|
export * from './compute_tx_include_by_timestamp.js';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type PrivateKernelCircuitPublicInputs, PrivateKernelResetCircuitPrivateInputs, type PrivateKernelSimulateOutput } from '@aztec/stdlib/kernel';
|
|
2
|
+
import { type PrivateCallExecutionResult } from '@aztec/stdlib/tx';
|
|
3
|
+
import type { PrivateKernelOracle } from '../private_kernel_oracle.js';
|
|
4
|
+
export declare class PrivateKernelResetPrivateInputsBuilder {
|
|
5
|
+
private previousKernelOutput;
|
|
6
|
+
private executionStack;
|
|
7
|
+
private noteHashNullifierCounterMap;
|
|
8
|
+
private splitCounter;
|
|
9
|
+
private previousKernel;
|
|
10
|
+
private nextIteration?;
|
|
11
|
+
private noteHashResetActions;
|
|
12
|
+
private nullifierResetActions;
|
|
13
|
+
private numTransientData?;
|
|
14
|
+
private transientDataSquashingHints;
|
|
15
|
+
private requestedDimensions;
|
|
16
|
+
constructor(previousKernelOutput: PrivateKernelSimulateOutput<PrivateKernelCircuitPublicInputs>, executionStack: PrivateCallExecutionResult[], noteHashNullifierCounterMap: Map<number, number>, splitCounter: number);
|
|
17
|
+
needsReset(): boolean;
|
|
18
|
+
build(oracle: PrivateKernelOracle): Promise<PrivateKernelResetCircuitPrivateInputs>;
|
|
19
|
+
private reduceReadRequestActions;
|
|
20
|
+
private needsResetNoteHashReadRequests;
|
|
21
|
+
private needsResetNullifierReadRequests;
|
|
22
|
+
private needsResetNullifierKeys;
|
|
23
|
+
private needsResetTransientData;
|
|
24
|
+
private needsSiloNoteHashes;
|
|
25
|
+
private needsSiloNullifiers;
|
|
26
|
+
private needsSiloPrivateLogs;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJpdmF0ZV9rZXJuZWxfcmVzZXRfcHJpdmF0ZV9pbnB1dHNfYnVpbGRlci5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL3ByaXZhdGVfa2VybmVsL2hpbnRzL3ByaXZhdGVfa2VybmVsX3Jlc2V0X3ByaXZhdGVfaW5wdXRzX2J1aWxkZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBZUEsT0FBTyxFQUtMLEtBQUssZ0NBQWdDLEVBRXJDLHNDQUFzQyxFQUd0QyxLQUFLLDJCQUEyQixFQWVqQyxNQUFNL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QUFDLG1CQUFtQjtJQWMzQixPQUFPLENBQUMsbUJBQW1CO0lBa0IzQixPQUFPLENBQUMsb0JBQW9CO0NBcUI3QiJ9
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"private_kernel_reset_private_inputs_builder.d.ts","sourceRoot":"","sources":["../../../src/private_kernel/hints/private_kernel_reset_private_inputs_builder.ts"],"names":[],"mappings":"AAeA,OAAO,EAKL,KAAK,gCAAgC,EAErC,sCAAsC,EAGtC,KAAK,2BAA2B,EAejC,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,KAAK,0BAA0B,EAAiB,MAAM,kBAAkB,CAAC;AAGlF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AA4CvE,qBAAa,sCAAsC;IAY/C,OAAO,CAAC,oBAAoB;IAC5B,OAAO,CAAC,cAAc;IACtB,OAAO,CAAC,2BAA2B;IACnC,OAAO,CAAC,YAAY;IAdtB,OAAO,CAAC,cAAc,CAAmC;IAEzD,OAAO,CAAC,aAAa,CAAC,CAA6B;IAEnD,OAAO,CAAC,oBAAoB,CAAqE;IACjG,OAAO,CAAC,qBAAqB,CAAqE;IAClG,OAAO,CAAC,gBAAgB,CAAC,CAAS;IAClC,OAAO,CAAC,2BAA2B,CAAkE;IACrG,OAAO,CAAC,mBAAmB,CAA+B;IAE1D,YACU,oBAAoB,EAAE,2BAA2B,CAAC,gCAAgC,CAAC,EACnF,cAAc,EAAE,0BAA0B,EAAE,EAC5C,2BAA2B,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAChD,YAAY,EAAE,MAAM,EAW7B;IAED,UAAU,IAAI,OAAO,CAsBpB;IAEK,KAAK,CAAC,MAAM,EAAE,mBAAmB,mDA+EtC;IAED,OAAO,CAAC,wBAAwB;IA2BhC,OAAO,CAAC,8BAA8B;IAuDtC,OAAO,CAAC,+BAA+B;IAuDvC,OAAO,CAAC,uBAAuB;IAa/B,OAAO,CAAC,uBAAuB;IAsE/B,OAAO,CAAC,mBAAmB;IAc3B,OAAO,CAAC,mBAAmB;IAkB3B,OAAO,CAAC,oBAAoB;CAqB7B"}
|
|
@@ -92,16 +92,22 @@ export class PrivateKernelResetPrivateInputsBuilder {
|
|
|
92
92
|
// The dimensions found must be big enough to reset all values, i.e. empty remainder.
|
|
93
93
|
const allowRemainder = isInner;
|
|
94
94
|
const dimensions = findPrivateKernelResetDimensions(this.requestedDimensions, privateKernelResetDimensionsConfig, isInner, allowRemainder);
|
|
95
|
-
const previousVkMembershipWitness = await oracle.getVkMembershipWitness(this.previousKernelOutput.verificationKey.keyAsFields);
|
|
96
|
-
const vkData = new VkData(this.previousKernelOutput.verificationKey, Number(previousVkMembershipWitness.leafIndex), previousVkMembershipWitness.siblingPath);
|
|
97
|
-
const previousKernelData = new PrivateKernelData(this.previousKernelOutput.publicInputs, vkData);
|
|
98
95
|
this.reduceReadRequestActions(this.noteHashResetActions, dimensions.NOTE_HASH_PENDING_READ, dimensions.NOTE_HASH_SETTLED_READ);
|
|
99
96
|
this.reduceReadRequestActions(this.nullifierResetActions, dimensions.NULLIFIER_PENDING_READ, dimensions.NULLIFIER_SETTLED_READ);
|
|
97
|
+
// Execute all the expensive node querying operations in parallel.
|
|
98
|
+
const [previousVkMembershipWitness, noteHashReadRequestHints, nullifierReadRequestHints, keyValidationHints] = await Promise.all([
|
|
99
|
+
oracle.getVkMembershipWitness(this.previousKernelOutput.verificationKey.keyAsFields),
|
|
100
|
+
buildNoteHashReadRequestHintsFromResetActions(oracle, this.previousKernel.validationRequests.noteHashReadRequests, this.previousKernel.end.noteHashes, this.noteHashResetActions),
|
|
101
|
+
buildNullifierReadRequestHintsFromResetActions({
|
|
102
|
+
getNullifierMembershipWitness: getNullifierMembershipWitnessResolver(oracle)
|
|
103
|
+
}, this.previousKernel.validationRequests.nullifierReadRequests, this.nullifierResetActions),
|
|
104
|
+
getMasterSecretKeysAndAppKeyGenerators(this.previousKernel.validationRequests.scopedKeyValidationRequestsAndGenerators, dimensions.KEY_VALIDATION, oracle)
|
|
105
|
+
]);
|
|
106
|
+
const vkData = new VkData(this.previousKernelOutput.verificationKey, Number(previousVkMembershipWitness.leafIndex), previousVkMembershipWitness.siblingPath);
|
|
107
|
+
const previousKernelData = new PrivateKernelData(this.previousKernelOutput.publicInputs, vkData);
|
|
100
108
|
// TODO: Enable padding when we have a better idea what are the final amounts we should pad to.
|
|
101
109
|
const paddedSideEffects = PaddedSideEffects.empty();
|
|
102
|
-
return new PrivateKernelResetCircuitPrivateInputs(previousKernelData, paddedSideEffects, new PrivateKernelResetHints(
|
|
103
|
-
getNullifierMembershipWitness: getNullifierMembershipWitnessResolver(oracle)
|
|
104
|
-
}, this.previousKernel.validationRequests.nullifierReadRequests, this.nullifierResetActions), await getMasterSecretKeysAndAppKeyGenerators(this.previousKernel.validationRequests.scopedKeyValidationRequestsAndGenerators, dimensions.KEY_VALIDATION, oracle), this.transientDataSquashingHints), dimensions);
|
|
110
|
+
return new PrivateKernelResetCircuitPrivateInputs(previousKernelData, paddedSideEffects, new PrivateKernelResetHints(noteHashReadRequestHints, nullifierReadRequestHints, keyValidationHints, this.transientDataSquashingHints), dimensions);
|
|
105
111
|
}
|
|
106
112
|
reduceReadRequestActions(resetActions, maxPending, maxSettled) {
|
|
107
113
|
let numPending = 0;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type LoggerBindings } from '@aztec/foundation/log';
|
|
1
2
|
import type { PrivateKernelProver } from '@aztec/stdlib/interfaces/client';
|
|
2
3
|
import { type PrivateKernelExecutionProofOutput, type PrivateKernelTailCircuitPublicInputs } from '@aztec/stdlib/kernel';
|
|
3
4
|
import { type PrivateExecutionResult, TxRequest } from '@aztec/stdlib/tx';
|
|
@@ -18,7 +19,7 @@ export declare class PrivateKernelExecutionProver {
|
|
|
18
19
|
private proofCreator;
|
|
19
20
|
private fakeProofs;
|
|
20
21
|
private log;
|
|
21
|
-
constructor(oracle: PrivateKernelOracle, proofCreator: PrivateKernelProver, fakeProofs?: boolean);
|
|
22
|
+
constructor(oracle: PrivateKernelOracle, proofCreator: PrivateKernelProver, fakeProofs?: boolean, bindings?: LoggerBindings);
|
|
22
23
|
/**
|
|
23
24
|
* Generate a proof for a given transaction request and execution result.
|
|
24
25
|
* The function iterates through the nested executions in the execution result, creates private call data,
|
|
@@ -41,4 +42,4 @@ export declare class PrivateKernelExecutionProver {
|
|
|
41
42
|
private getVkData;
|
|
42
43
|
private createPrivateCallData;
|
|
43
44
|
}
|
|
44
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
45
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJpdmF0ZV9rZXJuZWxfZXhlY3V0aW9uX3Byb3Zlci5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3ByaXZhdGVfa2VybmVsL3ByaXZhdGVfa2VybmVsX2V4ZWN1dGlvbl9wcm92ZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBRUEsT0FBTyxFQUFlLEtBQUssY0FBYyxFQUFnQixNQUFNLHVCQUF1QixDQUFDO0FBTXZGLE9BQU8sS0FBSyxFQUFFLG1CQUFtQixFQUFFLE1BQU0saUNBQWlDLENBQUM7QUFDM0UsT0FBTyxFQVFMLEtBQUssaUNBQWlDLEVBS3RDLEtBQUssb0NBQW9DLEVBRTFDLE1BQU0sc0JBQXNCLENBQUM7QUFFOUIsT0FBTyxFQUVMLEtBQUssc0JBQXNCLEVBQzNCLFNBQVMsRUFHVixNQUFNLGtCQUFrQixDQUFDO0FBSTFCLE9BQU8sS0FBSyxFQUFFLG1CQUFtQixFQUFFLE1BQU0sNEJBQTRCLENBQUM7QUFTdEUsTUFBTSxXQUFXLGtDQUFrQztJQUNqRCxRQUFRLEVBQUUsT0FBTyxDQUFDO0lBQ2xCLGtCQUFrQixFQUFFLE9BQU8sQ0FBQztJQUM1QixXQUFXLEVBQUUsT0FBTyxHQUFHLGlCQUFpQixHQUFHLE1BQU0sR0FBRyxNQUFNLENBQUM7Q0FDNUQ7QUFFRDs7Ozs7R0FLRztBQUNILHFCQUFhLDRCQUE0QjtJQUlyQyxPQUFPLENBQUMsTUFBTTtJQUNkLE9BQU8sQ0FBQyxZQUFZO0lBQ3BCLE9BQU8sQ0FBQyxVQUFVO0lBTHBCLE9BQU8sQ0FBQyxHQUFHLENBQVM7SUFFcEIsWUFDVSxNQUFNLEVBQUUsbUJBQW1CLEVBQzNCLFlBQVksRUFBRSxtQkFBbUIsRUFDakMsVUFBVSxVQUFRLEVBQzFCLFFBQVEsQ0FBQyxFQUFFLGNBQWMsRUFHMUI7SUFFRDs7Ozs7Ozs7OztPQVVHO0lBQ0csZ0JBQWdCLENBQ3BCLFNBQVMsRUFBRSxTQUFTLEVBQ3BCLGVBQWUsRUFBRSxzQkFBc0IsRUFDdkMsRUFBRSxRQUFRLEVBQUUsa0JBQWtCLEVBQUUsV0FBVyxFQUFFLEdBQUUsa0NBSTlDLEdBQ0EsT0FBTyxDQUFDLGlDQUFpQyxDQUFDLG9DQUFvQyxDQUFDLENBQUMsQ0FvUmxGO0lBRUQ7Ozs7O09BS0c7SUFDSCxPQUFPLENBQUMsdUJBQXVCO1lBb0JqQixTQUFTO1lBU1QscUJBQXFCO0NBK0JwQyJ9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"private_kernel_execution_prover.d.ts","sourceRoot":"","sources":["../../src/private_kernel/private_kernel_execution_prover.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"private_kernel_execution_prover.d.ts","sourceRoot":"","sources":["../../src/private_kernel/private_kernel_execution_prover.ts"],"names":[],"mappings":"AAEA,OAAO,EAAe,KAAK,cAAc,EAAgB,MAAM,uBAAuB,CAAC;AAMvF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAC3E,OAAO,EAQL,KAAK,iCAAiC,EAKtC,KAAK,oCAAoC,EAE1C,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAEL,KAAK,sBAAsB,EAC3B,SAAS,EAGV,MAAM,kBAAkB,CAAC;AAI1B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAStE,MAAM,WAAW,kCAAkC;IACjD,QAAQ,EAAE,OAAO,CAAC;IAClB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,WAAW,EAAE,OAAO,GAAG,iBAAiB,GAAG,MAAM,GAAG,MAAM,CAAC;CAC5D;AAED;;;;;GAKG;AACH,qBAAa,4BAA4B;IAIrC,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,YAAY;IACpB,OAAO,CAAC,UAAU;IALpB,OAAO,CAAC,GAAG,CAAS;IAEpB,YACU,MAAM,EAAE,mBAAmB,EAC3B,YAAY,EAAE,mBAAmB,EACjC,UAAU,UAAQ,EAC1B,QAAQ,CAAC,EAAE,cAAc,EAG1B;IAED;;;;;;;;;;OAUG;IACG,gBAAgB,CACpB,SAAS,EAAE,SAAS,EACpB,eAAe,EAAE,sBAAsB,EACvC,EAAE,QAAQ,EAAE,kBAAkB,EAAE,WAAW,EAAE,GAAE,kCAI9C,GACA,OAAO,CAAC,iCAAiC,CAAC,oCAAoC,CAAC,CAAC,CAoRlF;IAED;;;;;OAKG;IACH,OAAO,CAAC,uBAAuB;YAoBjB,SAAS;YAST,qBAAqB;CA+BpC"}
|
|
@@ -10,7 +10,7 @@ import { HidingKernelToPublicPrivateInputs, HidingKernelToRollupPrivateInputs, P
|
|
|
10
10
|
import { ChonkProof } from '@aztec/stdlib/proofs';
|
|
11
11
|
import { collectNoteHashNullifierCounterMap, getFinalMinRevertibleSideEffectCounter } from '@aztec/stdlib/tx';
|
|
12
12
|
import { VerificationKeyAsFields, VerificationKeyData, VkData } from '@aztec/stdlib/vks';
|
|
13
|
-
import { PrivateKernelResetPrivateInputsBuilder } from './hints/
|
|
13
|
+
import { PrivateKernelResetPrivateInputsBuilder } from './hints/private_kernel_reset_private_inputs_builder.js';
|
|
14
14
|
const NULL_SIMULATE_OUTPUT = {
|
|
15
15
|
publicInputs: PrivateKernelCircuitPublicInputs.empty(),
|
|
16
16
|
verificationKey: VerificationKeyData.empty(),
|
|
@@ -27,11 +27,11 @@ const NULL_SIMULATE_OUTPUT = {
|
|
|
27
27
|
proofCreator;
|
|
28
28
|
fakeProofs;
|
|
29
29
|
log;
|
|
30
|
-
constructor(oracle, proofCreator, fakeProofs = false){
|
|
30
|
+
constructor(oracle, proofCreator, fakeProofs = false, bindings){
|
|
31
31
|
this.oracle = oracle;
|
|
32
32
|
this.proofCreator = proofCreator;
|
|
33
33
|
this.fakeProofs = fakeProofs;
|
|
34
|
-
this.log = createLogger('pxe:private-kernel-execution-prover');
|
|
34
|
+
this.log = createLogger('pxe:private-kernel-execution-prover', bindings);
|
|
35
35
|
}
|
|
36
36
|
/**
|
|
37
37
|
* Generate a proof for a given transaction request and execution result.
|
|
@@ -2,63 +2,58 @@ import { FUNCTION_TREE_HEIGHT, NOTE_HASH_TREE_HEIGHT, VK_TREE_HEIGHT } from '@az
|
|
|
2
2
|
import type { Fr } from '@aztec/foundation/curves/bn254';
|
|
3
3
|
import type { GrumpkinScalar, Point } from '@aztec/foundation/curves/grumpkin';
|
|
4
4
|
import { MembershipWitness } from '@aztec/foundation/trees';
|
|
5
|
+
import type { KeyStore } from '@aztec/key-store';
|
|
5
6
|
import type { FunctionSelector } from '@aztec/stdlib/abi';
|
|
6
7
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
8
|
+
import { BlockHash } from '@aztec/stdlib/block';
|
|
9
|
+
import { type ContractInstanceWithAddress } from '@aztec/stdlib/contract';
|
|
10
|
+
import type { AztecNode } from '@aztec/stdlib/interfaces/client';
|
|
7
11
|
import { UpdatedClassIdHints } from '@aztec/stdlib/kernel';
|
|
8
|
-
import type { PublicKeys } from '@aztec/stdlib/keys';
|
|
9
12
|
import type { NullifierMembershipWitness } from '@aztec/stdlib/trees';
|
|
10
13
|
import type { VerificationKeyAsFields } from '@aztec/stdlib/vks';
|
|
14
|
+
import type { ContractStore } from '../storage/contract_store/contract_store.js';
|
|
11
15
|
/**
|
|
12
16
|
* Provides functionality needed by the private kernel for interacting with our state trees.
|
|
13
|
-
* This is either PrivateKernelOracleImpl, or a mocked test implementation.
|
|
14
17
|
*/
|
|
15
|
-
export
|
|
18
|
+
export declare class PrivateKernelOracle {
|
|
19
|
+
private contractStore;
|
|
20
|
+
private keyStore;
|
|
21
|
+
private node;
|
|
22
|
+
private blockHash;
|
|
23
|
+
constructor(contractStore: ContractStore, keyStore: KeyStore, node: AztecNode, blockHash: BlockHash);
|
|
16
24
|
/** Retrieves the preimage of a contract address from the registered contract instances db. */
|
|
17
|
-
getContractAddressPreimage(address: AztecAddress): Promise<{
|
|
25
|
+
getContractAddressPreimage(address: AztecAddress): Promise<ContractInstanceWithAddress & {
|
|
18
26
|
saltedInitializationHash: Fr;
|
|
19
|
-
publicKeys: PublicKeys;
|
|
20
|
-
currentContractClassId: Fr;
|
|
21
|
-
originalContractClassId: Fr;
|
|
22
27
|
}>;
|
|
23
28
|
/** Retrieves the preimage of a contract class id from the contract classes db. */
|
|
24
|
-
getContractClassIdPreimage(contractClassId: Fr): Promise<
|
|
25
|
-
|
|
26
|
-
publicBytecodeCommitment: Fr;
|
|
27
|
-
privateFunctionsRoot: Fr;
|
|
28
|
-
}>;
|
|
29
|
-
/**
|
|
30
|
-
* Returns a membership witness with the sibling path and leaf index in our private functions tree.
|
|
31
|
-
*/
|
|
29
|
+
getContractClassIdPreimage(contractClassId: Fr): Promise<import("@aztec/stdlib/contract").ContractClassIdPreimage>;
|
|
30
|
+
/** Returns a membership witness with the sibling path and leaf index in our private functions tree. */
|
|
32
31
|
getFunctionMembershipWitness(contractClassId: Fr, selector: FunctionSelector): Promise<MembershipWitness<typeof FUNCTION_TREE_HEIGHT>>;
|
|
33
32
|
/**
|
|
34
33
|
* Returns a membership witness with the sibling path and leaf index in our protocol VK indexed merkle tree.
|
|
35
34
|
* Used to validate the previous kernel's verification key.
|
|
36
35
|
*/
|
|
37
36
|
getVkMembershipWitness(vk: VerificationKeyAsFields): Promise<MembershipWitness<typeof VK_TREE_HEIGHT>>;
|
|
38
|
-
/**
|
|
39
|
-
* Returns a membership witness with the sibling path and leaf index in our private function indexed merkle tree.
|
|
40
|
-
*/
|
|
37
|
+
/** Returns a membership witness with the sibling path and leaf index in our note hash tree. */
|
|
41
38
|
getNoteHashMembershipWitness(noteHash: Fr): Promise<MembershipWitness<typeof NOTE_HASH_TREE_HEIGHT> | undefined>;
|
|
42
|
-
/**
|
|
43
|
-
* Returns a membership witness with the sibling path and leaf index in our nullifier indexed merkle tree.
|
|
44
|
-
*/
|
|
39
|
+
/** Returns a membership witness with the sibling path and leaf index in our nullifier indexed merkle tree. */
|
|
45
40
|
getNullifierMembershipWitness(nullifier: Fr): Promise<NullifierMembershipWitness | undefined>;
|
|
46
|
-
/**
|
|
47
|
-
* Returns the root of our note hash merkle tree.
|
|
48
|
-
*/
|
|
41
|
+
/** Returns the root of our note hash merkle tree. */
|
|
49
42
|
getNoteHashTreeRoot(): Promise<Fr>;
|
|
50
43
|
/**
|
|
51
44
|
* Retrieves the sk_m corresponding to the pk_m.
|
|
52
45
|
* @throws If the provided public key is not associated with any of the registered accounts.
|
|
53
|
-
* @param
|
|
46
|
+
* @param masterPublicKey - The master public key to get secret key for.
|
|
54
47
|
* @returns A Promise that resolves to sk_m.
|
|
55
48
|
* @dev Used when feeding the sk_m to the kernel circuit for keys verification.
|
|
56
49
|
*/
|
|
57
50
|
getMasterSecretKey(masterPublicKey: Point): Promise<GrumpkinScalar>;
|
|
58
51
|
/** Use debug data to get the function name corresponding to a selector. */
|
|
59
52
|
getDebugFunctionName(contractAddress: AztecAddress, selector: FunctionSelector): Promise<string | undefined>;
|
|
60
|
-
/**
|
|
61
|
-
*
|
|
53
|
+
/**
|
|
54
|
+
* Returns a membership witness and leaf index to our public data indexed merkle tree,
|
|
55
|
+
* along with an associated DelayedPublicMutable containing the class ID to update.
|
|
56
|
+
*/
|
|
62
57
|
getUpdatedClassIdHints(contractAddress: AztecAddress): Promise<UpdatedClassIdHints>;
|
|
63
58
|
}
|
|
64
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
59
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJpdmF0ZV9rZXJuZWxfb3JhY2xlLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvcHJpdmF0ZV9rZXJuZWwvcHJpdmF0ZV9rZXJuZWxfb3JhY2xlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxvQkFBb0IsRUFBRSxxQkFBcUIsRUFBMkIsY0FBYyxFQUFFLE1BQU0sa0JBQWtCLENBQUM7QUFDeEgsT0FBTyxLQUFLLEVBQUUsRUFBRSxFQUFFLE1BQU0sZ0NBQWdDLENBQUM7QUFDekQsT0FBTyxLQUFLLEVBQUUsY0FBYyxFQUFFLEtBQUssRUFBRSxNQUFNLG1DQUFtQyxDQUFDO0FBQy9FLE9BQU8sRUFBRSxpQkFBaUIsRUFBRSxNQUFNLHlCQUF5QixDQUFDO0FBQzVELE9BQU8sS0FBSyxFQUFFLFFBQVEsRUFBRSxNQUFNLGtCQUFrQixDQUFDO0FBR2pELE9BQU8sS0FBSyxFQUFFLGdCQUFnQixFQUFFLE1BQU0sbUJBQW1CLENBQUM7QUFDMUQsT0FBTyxLQUFLLEVBQUUsWUFBWSxFQUFFLE1BQU0sNkJBQTZCLENBQUM7QUFDaEUsT0FBTyxFQUFFLFNBQVMsRUFBRSxNQUFNLHFCQUFxQixDQUFDO0FBQ2hELE9BQU8sRUFDTCxLQUFLLDJCQUEyQixFQUdqQyxNQUFNLHdCQUF3QixDQUFDO0FBR2hDLE9BQU8sS0FBSyxFQUFFLFNBQVMsRUFBRSxNQUFNLGlDQUFp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