@aztec/pxe 0.0.1-commit.fff30aa → 0.0.1-dev
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 +5 -3
- package/dest/block_synchronizer/block_synchronizer.d.ts.map +1 -1
- package/dest/block_synchronizer/block_synchronizer.js +10 -2
- package/dest/config/package_info.js +1 -1
- package/dest/contract_function_simulator/contract_function_simulator.d.ts +4 -1
- package/dest/contract_function_simulator/contract_function_simulator.d.ts.map +1 -1
- package/dest/contract_function_simulator/contract_function_simulator.js +18 -10
- package/dest/contract_function_simulator/oracle/interfaces.d.ts +5 -2
- package/dest/contract_function_simulator/oracle/interfaces.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/oracle.d.ts +4 -1
- package/dest/contract_function_simulator/oracle/oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/oracle.js +53 -1
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts +10 -14
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/private_execution_oracle.js +16 -14
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +19 -2
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.js +108 -5
- package/dest/contract_sync/contract_sync_service.d.ts +2 -1
- package/dest/contract_sync/contract_sync_service.d.ts.map +1 -1
- package/dest/contract_sync/contract_sync_service.js +41 -7
- package/dest/contract_sync/helpers.d.ts +2 -3
- package/dest/contract_sync/helpers.d.ts.map +1 -1
- package/dest/contract_sync/helpers.js +12 -19
- 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 +2 -1
- package/dest/entrypoints/client/lazy/utils.d.ts +1 -1
- package/dest/entrypoints/client/lazy/utils.d.ts.map +1 -1
- package/dest/entrypoints/client/lazy/utils.js +2 -1
- package/dest/entrypoints/pxe_creation_options.d.ts +4 -1
- package/dest/entrypoints/pxe_creation_options.d.ts.map +1 -1
- package/dest/entrypoints/server/index.d.ts +2 -1
- package/dest/entrypoints/server/index.d.ts.map +1 -1
- package/dest/entrypoints/server/index.js +1 -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 +2 -1
- package/dest/events/event_service.d.ts +13 -5
- package/dest/events/event_service.d.ts.map +1 -1
- package/dest/events/event_service.js +28 -7
- package/dest/hooks/authorize_utility_call.d.ts +37 -0
- package/dest/hooks/authorize_utility_call.d.ts.map +1 -0
- package/dest/hooks/authorize_utility_call.js +4 -0
- package/dest/hooks/execution_hooks.d.ts +42 -0
- package/dest/hooks/execution_hooks.d.ts.map +1 -0
- package/dest/hooks/execution_hooks.js +9 -0
- package/dest/hooks/index.d.ts +4 -0
- package/dest/hooks/index.d.ts.map +1 -0
- package/dest/hooks/index.js +1 -0
- package/dest/logs/log_service.d.ts +1 -1
- package/dest/logs/log_service.d.ts.map +1 -1
- package/dest/logs/log_service.js +20 -35
- package/dest/messages/message_context_service.d.ts +1 -1
- package/dest/messages/message_context_service.d.ts.map +1 -1
- package/dest/messages/message_context_service.js +12 -10
- package/dest/notes/note_service.d.ts +25 -3
- package/dest/notes/note_service.d.ts.map +1 -1
- package/dest/notes/note_service.js +80 -65
- package/dest/oracle_version.d.ts +2 -2
- package/dest/oracle_version.js +2 -2
- package/dest/private_kernel/private_kernel_execution_prover.d.ts +2 -1
- package/dest/private_kernel/private_kernel_execution_prover.d.ts.map +1 -1
- package/dest/private_kernel/private_kernel_execution_prover.js +18 -4
- package/dest/private_kernel/private_kernel_oracle.d.ts +1 -1
- package/dest/private_kernel/private_kernel_oracle.d.ts.map +1 -1
- package/dest/private_kernel/private_kernel_oracle.js +7 -2
- package/dest/pxe.d.ts +20 -5
- package/dest/pxe.d.ts.map +1 -1
- package/dest/pxe.js +61 -59
- package/dest/storage/backwards_compatibility_tests/kv_store_snapshot.d.ts +42 -0
- package/dest/storage/backwards_compatibility_tests/kv_store_snapshot.d.ts.map +1 -0
- package/dest/storage/backwards_compatibility_tests/kv_store_snapshot.js +93 -0
- package/dest/storage/backwards_compatibility_tests/schema_tests.d.ts +15 -0
- package/dest/storage/backwards_compatibility_tests/schema_tests.d.ts.map +1 -0
- package/dest/storage/backwards_compatibility_tests/schema_tests.js +588 -0
- package/dest/storage/backwards_compatibility_tests/store_spy.d.ts +19 -0
- package/dest/storage/backwards_compatibility_tests/store_spy.d.ts.map +1 -0
- package/dest/storage/backwards_compatibility_tests/store_spy.js +63 -0
- package/dest/storage/open_pxe_stores.d.ts +31 -0
- package/dest/storage/open_pxe_stores.d.ts.map +1 -0
- package/dest/storage/open_pxe_stores.js +26 -0
- package/dest/tagging/get_all_logs_by_tags.d.ts +1 -1
- package/dest/tagging/get_all_logs_by_tags.d.ts.map +1 -1
- package/dest/tagging/get_all_logs_by_tags.js +3 -0
- package/dest/tagging/index.d.ts +4 -3
- package/dest/tagging/index.d.ts.map +1 -1
- package/dest/tagging/index.js +3 -2
- package/dest/tagging/persist_sender_tagging_index_ranges.d.ts +29 -0
- package/dest/tagging/persist_sender_tagging_index_ranges.d.ts.map +1 -0
- package/dest/tagging/persist_sender_tagging_index_ranges.js +42 -0
- package/dest/tagging/recipient_sync/sync_tagged_private_logs.d.ts +56 -0
- package/dest/tagging/recipient_sync/sync_tagged_private_logs.d.ts.map +1 -0
- package/dest/tagging/recipient_sync/sync_tagged_private_logs.js +158 -0
- package/dest/tagging/reconcile_tagging_index_ranges.d.ts +36 -0
- package/dest/tagging/reconcile_tagging_index_ranges.d.ts.map +1 -0
- package/dest/tagging/reconcile_tagging_index_ranges.js +74 -0
- package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts +1 -1
- package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts.map +1 -1
- package/dest/tagging/sender_sync/sync_sender_tagging_indexes.js +19 -8
- package/dest/tagging/sender_sync/utils/get_status_change_of_pending.d.ts +11 -6
- 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 +21 -0
- package/package.json +17 -16
- package/src/bin/check_oracle_version.ts +1 -1
- package/src/block_synchronizer/block_synchronizer.ts +11 -3
- package/src/config/package_info.ts +1 -1
- package/src/contract_function_simulator/contract_function_simulator.ts +32 -9
- package/src/contract_function_simulator/oracle/interfaces.ts +12 -1
- package/src/contract_function_simulator/oracle/oracle.ts +73 -1
- package/src/contract_function_simulator/oracle/private_execution_oracle.ts +25 -21
- package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +165 -29
- package/src/contract_sync/contract_sync_service.ts +55 -23
- package/src/contract_sync/helpers.ts +11 -23
- package/src/entrypoints/client/bundle/utils.ts +1 -0
- package/src/entrypoints/client/lazy/utils.ts +1 -0
- package/src/entrypoints/pxe_creation_options.ts +4 -0
- package/src/entrypoints/server/index.ts +1 -0
- package/src/entrypoints/server/utils.ts +1 -0
- package/src/events/event_service.ts +52 -17
- package/src/hooks/authorize_utility_call.ts +40 -0
- package/src/hooks/execution_hooks.ts +48 -0
- package/src/hooks/index.ts +7 -0
- package/src/logs/log_service.ts +46 -71
- package/src/messages/message_context_service.ts +25 -24
- package/src/notes/note_service.ts +115 -91
- package/src/oracle_version.ts +2 -2
- package/src/private_kernel/private_kernel_execution_prover.ts +29 -3
- package/src/private_kernel/private_kernel_oracle.ts +15 -5
- package/src/pxe.ts +116 -53
- package/src/storage/backwards_compatibility_tests/__snapshots__/AddressStore.json +22 -0
- package/src/storage/backwards_compatibility_tests/__snapshots__/AnchorBlockStore.json +3 -0
- package/src/storage/backwards_compatibility_tests/__snapshots__/CapsuleStore.json +16 -0
- package/src/storage/backwards_compatibility_tests/__snapshots__/ContractStore.json +28 -0
- package/src/storage/backwards_compatibility_tests/__snapshots__/KeyStore.json +52 -0
- package/src/storage/backwards_compatibility_tests/__snapshots__/L2TipsKVStore.json +42 -0
- package/src/storage/backwards_compatibility_tests/__snapshots__/NoteStore.json +36 -0
- package/src/storage/backwards_compatibility_tests/__snapshots__/PrivateEventStore.json +44 -0
- package/src/storage/backwards_compatibility_tests/__snapshots__/RecipientTaggingStore.json +18 -0
- package/src/storage/backwards_compatibility_tests/__snapshots__/SenderAddressBookStore.json +16 -0
- package/src/storage/backwards_compatibility_tests/__snapshots__/SenderTaggingStore.json +22 -0
- package/src/storage/backwards_compatibility_tests/__snapshots__/opened_stores.json +97 -0
- package/src/storage/backwards_compatibility_tests/kv_store_snapshot.ts +122 -0
- package/src/storage/backwards_compatibility_tests/schema_tests.ts +707 -0
- package/src/storage/backwards_compatibility_tests/store_spy.ts +73 -0
- package/src/storage/open_pxe_stores.ts +47 -0
- package/src/tagging/get_all_logs_by_tags.ts +4 -0
- package/src/tagging/index.ts +3 -2
- package/src/tagging/persist_sender_tagging_index_ranges.ts +57 -0
- package/src/tagging/recipient_sync/sync_tagged_private_logs.ts +236 -0
- package/src/tagging/reconcile_tagging_index_ranges.ts +102 -0
- package/src/tagging/sender_sync/sync_sender_tagging_indexes.ts +33 -10
- package/src/tagging/sender_sync/utils/get_status_change_of_pending.ts +23 -8
- package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts +0 -14
- package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts.map +0 -1
- package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.js +0 -85
- package/dest/tagging/recipient_sync/utils/load_logs_for_range.d.ts +0 -14
- package/dest/tagging/recipient_sync/utils/load_logs_for_range.d.ts.map +0 -1
- package/dest/tagging/recipient_sync/utils/load_logs_for_range.js +0 -33
- package/src/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.ts +0 -130
- package/src/tagging/recipient_sync/utils/load_logs_for_range.ts +0 -44
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createLogger } from '@aztec/foundation/log';
|
|
2
|
-
import { siloNullifier } from '@aztec/stdlib/hash';
|
|
2
|
+
import { computePrivateEventCommitment, siloNullifier } from '@aztec/stdlib/hash';
|
|
3
3
|
export class EventService {
|
|
4
4
|
anchorBlockHeader;
|
|
5
5
|
aztecNode;
|
|
@@ -13,16 +13,37 @@ export class EventService {
|
|
|
13
13
|
this.jobId = jobId;
|
|
14
14
|
this.log = log;
|
|
15
15
|
}
|
|
16
|
-
|
|
16
|
+
/**
|
|
17
|
+
* Validates and stores a batch of private events against pre-fetched tx effects.
|
|
18
|
+
*
|
|
19
|
+
* @param requests - The events to validate and store.
|
|
20
|
+
* @param scope - The scope under which the events are being stored.
|
|
21
|
+
* @param txEffects - Pre-fetched tx effects keyed by `TxHash.toString()`. Must contain entries for every request's
|
|
22
|
+
* txHash; missing entries are treated as a node bug and cause an error.
|
|
23
|
+
*/ async validateAndStoreEvents(requests, scope, txEffects) {
|
|
24
|
+
if (requests.length === 0) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
const anchorBlockNumber = this.anchorBlockHeader.getBlockNumber();
|
|
28
|
+
await Promise.all(requests.map((req)=>this.#validateAndStoreEvent(req, scope, txEffects, anchorBlockNumber)));
|
|
29
|
+
}
|
|
30
|
+
async #validateAndStoreEvent(request, scope, txEffects, anchorBlockNumber) {
|
|
31
|
+
const { contractAddress, eventTypeId: selector, randomness, serializedEvent: content, eventCommitment, txHash } = request;
|
|
32
|
+
// Defense-in-depth: the built-in private-event path derives this commitment from content before enqueueing, but
|
|
33
|
+
// unconstrained PXE-side code (e.g. a custom message handler) can reach this oracle with arbitrary
|
|
34
|
+
// (content, commitment) pairs. Without this check it could bind arbitrary content to a legitimate tx nullifier,
|
|
35
|
+
// causing PXE to surface fabricated event data.
|
|
36
|
+
const recomputedCommitment = await computePrivateEventCommitment(randomness, selector.toField(), content);
|
|
37
|
+
if (!recomputedCommitment.equals(eventCommitment)) {
|
|
38
|
+
this.log.warn(`Skipping event whose content does not hash to the provided commitment. contract=${contractAddress}, selector=${selector}, eventCommitment=${eventCommitment}, txHash=${txHash}, recomputedCommitment=${recomputedCommitment}`);
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
17
41
|
// While using 'latest' block number would be fine for private events since they cannot be accessed from Aztec.nr
|
|
18
42
|
// (and thus we're less concerned about being ahead of the synced block), we use the synced block number to
|
|
19
43
|
// maintain consistent behavior in the PXE. Additionally, events should never be ahead of the synced block here
|
|
20
44
|
// since `fetchTaggedLogs` only processes logs up to the synced block.
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
this.aztecNode.getTxEffect(txHash)
|
|
24
|
-
]);
|
|
25
|
-
const anchorBlockNumber = this.anchorBlockHeader.getBlockNumber();
|
|
45
|
+
const siloedEventCommitment = await siloNullifier(contractAddress, eventCommitment);
|
|
46
|
+
const txEffect = txEffects.get(txHash.toString());
|
|
26
47
|
if (!txEffect) {
|
|
27
48
|
// We error out instead of just logging a warning and skipping the event because this would indicate a bug. This
|
|
28
49
|
// is because the node has already served info about this tx either when obtaining the log (TxScopedL2Log contain
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { Fr } from '@aztec/foundation/curves/bn254';
|
|
2
|
+
import type { FunctionSelector } from '@aztec/stdlib/abi';
|
|
3
|
+
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
4
|
+
/** Information about a cross-contract utility call that requires authorization. */
|
|
5
|
+
export type UtilityCallAuthorizationRequest = {
|
|
6
|
+
/** The contract requesting the cross-contract call. */
|
|
7
|
+
caller: AztecAddress;
|
|
8
|
+
/** The target contract being called. */
|
|
9
|
+
target: AztecAddress;
|
|
10
|
+
/** The function selector being invoked on the target. */
|
|
11
|
+
functionSelector: FunctionSelector;
|
|
12
|
+
/** The name of the function being called, if known from the contract artifact. */
|
|
13
|
+
functionName?: string;
|
|
14
|
+
/** The serialized arguments passed to the function. */
|
|
15
|
+
args: Fr[];
|
|
16
|
+
/** Whether the call originates from a private or utility execution context. */
|
|
17
|
+
callerContext: 'private' | 'utility';
|
|
18
|
+
};
|
|
19
|
+
/** Authorization was granted. */
|
|
20
|
+
type Authorized = {
|
|
21
|
+
authorized: true;
|
|
22
|
+
};
|
|
23
|
+
/** Authorization was denied. */
|
|
24
|
+
type Denied = {
|
|
25
|
+
authorized: false;
|
|
26
|
+
/** Reason for denial, included in the error message. */
|
|
27
|
+
reason?: string;
|
|
28
|
+
};
|
|
29
|
+
/** Result of an authorization hook evaluation. */
|
|
30
|
+
export type UtilityCallAuthorizationResponse = Authorized | Denied;
|
|
31
|
+
/**
|
|
32
|
+
* Hook called when a utility function attempts a cross-contract call.
|
|
33
|
+
* Returns a response indicating whether the call is authorized and an optional denial reason.
|
|
34
|
+
*/
|
|
35
|
+
export type AuthorizeUtilityCall = (request: UtilityCallAuthorizationRequest) => Promise<UtilityCallAuthorizationResponse>;
|
|
36
|
+
export {};
|
|
37
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXV0aG9yaXplX3V0aWxpdHlfY2FsbC5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2hvb2tzL2F1dGhvcml6ZV91dGlsaXR5X2NhbGwudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLEVBQUUsRUFBRSxFQUFFLE1BQU0sZ0NBQWdDLENBQUM7QUFDekQsT0FBTyxLQUFLLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSxtQkFBbUIsQ0FBQztBQUMxRCxPQUFPLEtBQUssRUFBRSxZQUFZLEVBQUUsTUFBTSw2QkFBNkIsQ0FBQztBQUVoRSxtRkFBbUY7QUFDbkYsTUFBTSxNQUFNLCtCQUErQixHQUFHO0lBQzVDLHVEQUF1RDtJQUN2RCxNQUFNLEVBQUUsWUFBWSxDQUFDO0lBQ3JCLHd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BAA+B,GAAG;IAC5C,uDAAuD;IACvD,MAAM,EAAE,YAAY,CAAC;IACrB,wCAAwC;IACxC,MAAM,EAAE,YAAY,CAAC;IACrB,yDAAyD;IACzD,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,kFAAkF;IAClF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,uDAAuD;IACvD,IAAI,EAAE,EAAE,EAAE,CAAC;IACX,+EAA+E;IAC/E,aAAa,EAAE,SAAS,GAAG,SAAS,CAAC;CACtC,CAAC;AAEF,iCAAiC;AACjC,KAAK,UAAU,GAAG;IAAE,UAAU,EAAE,IAAI,CAAA;CAAE,CAAC;AAEvC,gCAAgC;AAChC,KAAK,MAAM,GAAG;IACZ,UAAU,EAAE,KAAK,CAAC;IAClB,wDAAwD;IACxD,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,kDAAkD;AAClD,MAAM,MAAM,gCAAgC,GAAG,UAAU,GAAG,MAAM,CAAC;AAEnE;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG,CACjC,OAAO,EAAE,+BAA+B,KACrC,OAAO,CAAC,gCAAgC,CAAC,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { AuthorizeUtilityCall } from './authorize_utility_call.js';
|
|
2
|
+
/**
|
|
3
|
+
* Hooks that PXE invokes during client-side simulation to gate operations that the protocol
|
|
4
|
+
* does not restrict on its own. They give the wallet a chance to apply custom policies (e.g.
|
|
5
|
+
* prompting the user, consulting a dynamic allowlist, or inspecting call arguments) before the
|
|
6
|
+
* execution proceeds.
|
|
7
|
+
*
|
|
8
|
+
* For example, {@link authorizeUtilityCall} is called whenever a utility function makes a
|
|
9
|
+
* cross-contract call. A call made by a malicious contract could leak private information, so the
|
|
10
|
+
* hook lets the wallet decide, per-call, whether to allow it. A static allowlist would not work
|
|
11
|
+
* here because neither the app nor the wallet can predict ahead of time which contracts will be
|
|
12
|
+
* invoked during execution.
|
|
13
|
+
*
|
|
14
|
+
* Note: hooks are unrelated to authentication witnesses (authwits). Authwits are an on-chain
|
|
15
|
+
* mechanism where a contract verifies that a caller was authorized by a specific account; hooks
|
|
16
|
+
* are a client-side PXE concern that gates execution before it proceeds.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```ts
|
|
20
|
+
* const pxe = await PXE.create({
|
|
21
|
+
* // ...
|
|
22
|
+
* hooks: {
|
|
23
|
+
* authorizeUtilityCall: async (req) => {
|
|
24
|
+
* // Allow calls to a known helper contract, deny everything else.
|
|
25
|
+
* return req.target.equals(trustedHelper)
|
|
26
|
+
* ? { authorized: true }
|
|
27
|
+
* : { authorized: false, reason: 'Unknown target' };
|
|
28
|
+
* },
|
|
29
|
+
* },
|
|
30
|
+
* });
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export interface ExecutionHooks {
|
|
34
|
+
/** Called when a contract attempts a cross-contract utility call. */
|
|
35
|
+
authorizeUtilityCall: AuthorizeUtilityCall;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Builds an {@link ExecutionHooks} from individually-constructed hook callbacks. Returns `undefined`
|
|
39
|
+
* when every field is absent, so callers can unconditionally pass the result as `hooks`.
|
|
40
|
+
*/
|
|
41
|
+
export declare function composeHooks(partial: Partial<ExecutionHooks>): ExecutionHooks | undefined;
|
|
42
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXhlY3V0aW9uX2hvb2tzLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvaG9va3MvZXhlY3V0aW9uX2hvb2tzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxFQUFFLG9CQUFvQixFQUFFLE1BQU0sNkJBQTZCLENBQUM7QUFFeEU7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztHQThCRztBQUNILE1BQU0sV0FBVyxjQUFjO0lBQzdCLHFFQUFxRTtJQUNyRSxvQkFBb0IsRUFBRSxvQkFBb0IsQ0FBQztDQUM1QztBQUVEOzs7R0FHRztBQUNILHdCQUFnQixZQUFZLENBQUMsT0FBTyxFQUFFLE9BQU8sQ0FBQyxjQUFjLENBQUMsR0FBRyxjQUFjLEdBQUcsU0FBUyxDQUt6RiJ9
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execution_hooks.d.ts","sourceRoot":"","sources":["../../src/hooks/execution_hooks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAExE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,MAAM,WAAW,cAAc;IAC7B,qEAAqE;IACrE,oBAAoB,EAAE,oBAAoB,CAAC;CAC5C;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,cAAc,CAAC,GAAG,cAAc,GAAG,SAAS,CAKzF"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Builds an {@link ExecutionHooks} from individually-constructed hook callbacks. Returns `undefined`
|
|
3
|
+
* when every field is absent, so callers can unconditionally pass the result as `hooks`.
|
|
4
|
+
*/ export function composeHooks(partial) {
|
|
5
|
+
if (Object.values(partial).every((v)=>v === undefined)) {
|
|
6
|
+
return undefined;
|
|
7
|
+
}
|
|
8
|
+
return partial;
|
|
9
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export type { AuthorizeUtilityCall, UtilityCallAuthorizationRequest, UtilityCallAuthorizationResponse, } from './authorize_utility_call.js';
|
|
2
|
+
export type { ExecutionHooks } from './execution_hooks.js';
|
|
3
|
+
export { composeHooks } from './execution_hooks.js';
|
|
4
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ob29rcy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxZQUFZLEVBQ1Ysb0JBQW9CLEVBQ3BCLCtCQUErQixFQUMvQixnQ0FBZ0MsR0FDakMsTUFBTSw2QkFBNkIsQ0FBQztBQUNyQyxZQUFZLEVBQUUsY0FBYyxFQUFFLE1BQU0sc0JBQXNCLENBQUM7QUFDM0QsT0FBTyxFQUFFLFlBQVksRUFBRSxNQUFNLHNCQUFzQixDQUFDIn0=
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,oBAAoB,EACpB,+BAA+B,EAC/B,gCAAgC,GACjC,MAAM,6BAA6B,CAAC;AACrC,YAAY,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { composeHooks } from './execution_hooks.js';
|
|
@@ -25,4 +25,4 @@ export declare class LogService {
|
|
|
25
25
|
fetchLogsByTag(contractAddress: AztecAddress, logRetrievalRequests: LogRetrievalRequest[]): Promise<(LogRetrievalResponse | null)[]>;
|
|
26
26
|
fetchTaggedLogs(contractAddress: AztecAddress, recipient: AztecAddress): Promise<PendingTaggedLog[]>;
|
|
27
27
|
}
|
|
28
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
28
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9nX3NlcnZpY2UuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9sb2dzL2xvZ19zZXJ2aWNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBZSxLQUFLLGNBQW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T0FBTyxDQUFDLFFBQVEsQ0FBQyxLQUFLO0lBVnhCLE9BQU8sQ0FBQyxHQUFHLENBQVM7SUFFcEIsWUFDbUIsU0FBUyxFQUFFLFNBQVMsRUFDcEIsaUJBQWlCLEVBQUUsV0FBVyxFQUM5QixXQUFXLEVBQUUsY0FBYyxFQUMzQixRQUFRLEVBQUUsUUFBUSxFQUNsQixxQkFBcUIsRUFBRSxxQkFBcUIsRUFDNUMsc0JBQXNCLEVBQUUsc0JBQXNCLEVBQzlDLFlBQVksRUFBRSxZQUFZLEVBQzFCLEtBQUssRUFBRSxNQUFNLEVBQzlCLFFBQVEsQ0FBQyxFQUFFLGNBQWMsRUFHMUI7SUFFWSxjQUFjLENBQ3pCLGVBQWUsRUFBRSxZQUFZLEVBQzdCLG9CQUFvQixFQUFFLG1CQUFtQixFQUFFLEdBQzFDLE9BQU8sQ0FBQyxDQUFDLG9CQUFvQixHQUFHLElBQUksQ0FBQyxFQUFFLENBQUMsQ0FxQzFDO0lBdUJZLGVBQWUsQ0FBQyxlQUFlLEVBQUUsWUFBWSxFQUFFLFNBQVMsRUFBRSxZQUFZLEdBQUcsT0FBTyxDQUFDLGdCQUFnQixFQUFFLENBQUMsQ0FvQmhIO0NBMENGIn0=
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log_service.d.ts","sourceRoot":"","sources":["../../src/logs/log_service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,cAAc,EAAgB,MAAM,uBAAuB,CAAC;AACvF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,
|
|
1
|
+
{"version":3,"file":"log_service.d.ts","sourceRoot":"","sources":["../../src/logs/log_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C9C,YAAY,EAAE,YAAY,EAC1B,KAAK,EAAE,MAAM,EAC9B,QAAQ,CAAC,EAAE,cAAc,EAG1B;IAEY,cAAc,CACzB,eAAe,EAAE,YAAY,EAC7B,oBAAoB,EAAE,mBAAmB,EAAE,GAC1C,OAAO,CAAC,CAAC,oBAAoB,GAAG,IAAI,CAAC,EAAE,CAAC,CAqC1C;IAuBY,eAAe,CAAC,eAAe,EAAE,YAAY,EAAE,SAAS,EAAE,YAAY,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAoBhH;CA0CF"}
|
package/dest/logs/log_service.js
CHANGED
|
@@ -2,7 +2,7 @@ import { createLogger } from '@aztec/foundation/log';
|
|
|
2
2
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
3
3
|
import { ExtendedDirectionalAppTaggingSecret, PendingTaggedLog, SiloedTag } from '@aztec/stdlib/logs';
|
|
4
4
|
import { LogRetrievalResponse } from '../contract_function_simulator/noir-structs/log_retrieval_response.js';
|
|
5
|
-
import { getAllPrivateLogsByTags, getAllPublicLogsByTagsFromContract,
|
|
5
|
+
import { getAllPrivateLogsByTags, getAllPublicLogsByTagsFromContract, syncTaggedPrivateLogs } from '../tagging/index.js';
|
|
6
6
|
export class LogService {
|
|
7
7
|
aztecNode;
|
|
8
8
|
anchorBlockHeader;
|
|
@@ -30,57 +30,42 @@ export class LogService {
|
|
|
30
30
|
throw new Error(`Got a log retrieval request from ${request.contractAddress}, expected ${contractAddress}`);
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
33
|
+
if (logRetrievalRequests.length === 0) {
|
|
34
|
+
return [];
|
|
35
|
+
}
|
|
36
|
+
const anchorBlockHash = await this.anchorBlockHeader.hash();
|
|
37
|
+
const tags = logRetrievalRequests.map((r)=>r.tag);
|
|
38
|
+
const siloedTags = await Promise.all(logRetrievalRequests.map((r)=>SiloedTag.computeFromTagAndApp(r.tag, r.contractAddress)));
|
|
39
|
+
const [allPublicLogsPerTag, allPrivateLogsPerTag] = await Promise.all([
|
|
40
|
+
getAllPublicLogsByTagsFromContract(this.aztecNode, contractAddress, tags, anchorBlockHash),
|
|
41
|
+
getAllPrivateLogsByTags(this.aztecNode, siloedTags, anchorBlockHash)
|
|
42
|
+
]);
|
|
43
|
+
return logRetrievalRequests.map((request, i)=>{
|
|
44
|
+
const publicLog = this.#extractSingleLog(allPublicLogsPerTag[i], `public log for tag ${request.tag} and contract ${request.contractAddress.toString()}`);
|
|
45
|
+
const privateLog = this.#extractSingleLog(allPrivateLogsPerTag[i], `private log for tag ${siloedTags[i]}`);
|
|
38
46
|
if (publicLog !== null && privateLog !== null) {
|
|
39
47
|
this.log.warn(`Found both a public and private log for tag ${request.tag} from contract ${request.contractAddress}. This may indicate a contract bug. Returning the public log.`);
|
|
40
48
|
}
|
|
41
49
|
return publicLog ?? privateLog;
|
|
42
|
-
})
|
|
50
|
+
});
|
|
43
51
|
}
|
|
44
|
-
|
|
45
|
-
const anchorBlockHash = await this.anchorBlockHeader.hash();
|
|
46
|
-
const allLogsPerTag = await getAllPublicLogsByTagsFromContract(this.aztecNode, contractAddress, [
|
|
47
|
-
tag
|
|
48
|
-
], anchorBlockHash);
|
|
49
|
-
const logsForTag = allLogsPerTag[0];
|
|
52
|
+
#extractSingleLog(logsForTag, description) {
|
|
50
53
|
if (logsForTag.length === 0) {
|
|
51
54
|
return null;
|
|
52
|
-
} else if (logsForTag.length > 1) {
|
|
53
|
-
this.log.warn(`Expected at most 1 public log for tag ${tag} and contract ${contractAddress.toString()}, got ${logsForTag.length}. This may indicate a contract bug. Returning the first log.`);
|
|
54
55
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
58
|
-
async #getPrivateLogByTag(siloedTag) {
|
|
59
|
-
const anchorBlockHash = await this.anchorBlockHeader.hash();
|
|
60
|
-
const allLogsPerTag = await getAllPrivateLogsByTags(this.aztecNode, [
|
|
61
|
-
siloedTag
|
|
62
|
-
], anchorBlockHash);
|
|
63
|
-
const logsForTag = allLogsPerTag[0];
|
|
64
|
-
if (logsForTag.length === 0) {
|
|
65
|
-
return null;
|
|
66
|
-
} else if (logsForTag.length > 1) {
|
|
67
|
-
this.log.warn(`Expected at most 1 private log for tag ${siloedTag}, got ${logsForTag.length}. This may indicate a contract bug. Returning the first log.`);
|
|
56
|
+
if (logsForTag.length > 1) {
|
|
57
|
+
this.log.warn(`Expected at most 1 ${description}, got ${logsForTag.length}. This may indicate a contract bug. Returning the first log.`);
|
|
68
58
|
}
|
|
69
59
|
const scopedLog = logsForTag[0];
|
|
70
60
|
return new LogRetrievalResponse(scopedLog.logData.slice(1), scopedLog.txHash, scopedLog.noteHashes, scopedLog.firstNullifier);
|
|
71
61
|
}
|
|
72
62
|
async fetchTaggedLogs(contractAddress, recipient) {
|
|
73
63
|
this.log.verbose(`Fetching tagged logs for ${contractAddress.toString()}`);
|
|
74
|
-
// We only load logs from block up to and including the anchor block number
|
|
75
|
-
const anchorBlockNumber = this.anchorBlockHeader.getBlockNumber();
|
|
76
|
-
const anchorBlockHash = await this.anchorBlockHeader.hash();
|
|
77
64
|
const l2Tips = await this.l2TipsStore.getL2Tips();
|
|
78
|
-
const currentTimestamp = this.anchorBlockHeader.globalVariables.timestamp;
|
|
79
65
|
// Get all secrets for this recipient (one per sender)
|
|
80
66
|
const secrets = await this.#getSecretsForSenders(contractAddress, recipient);
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
return logArrays.flat().map((scopedLog)=>new PendingTaggedLog(scopedLog.logData, scopedLog.txHash, scopedLog.noteHashes, scopedLog.firstNullifier));
|
|
67
|
+
const logs = await syncTaggedPrivateLogs(secrets, this.aztecNode, this.recipientTaggingStore, this.anchorBlockHeader, l2Tips.finalized.block.number, this.jobId);
|
|
68
|
+
return logs.map((scopedLog)=>new PendingTaggedLog(scopedLog.logData, scopedLog.txHash, scopedLog.noteHashes, scopedLog.firstNullifier));
|
|
84
69
|
}
|
|
85
70
|
async #getSecretsForSenders(contractAddress, recipient) {
|
|
86
71
|
const recipientCompleteAddress = await this.addressStore.getCompleteAddress(recipient);
|
|
@@ -14,4 +14,4 @@ export declare class MessageContextService {
|
|
|
14
14
|
*/
|
|
15
15
|
getMessageContextsByTxHash(txHashes: Fr[], anchorBlockNumber: number): Promise<(MessageContext | null)[]>;
|
|
16
16
|
}
|
|
17
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
17
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWVzc2FnZV9jb250ZXh0X3NlcnZpY2UuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9tZXNzYWdlcy9tZXNzYWdlX2NvbnRleHRfc2VydmljZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFDQSxPQUFPLEVBQUUsRUFBRSxFQUFFLE1BQU0sZ0NBQWdDLENBQUM7QUFDcEQsT0FBTyxLQUFLLEVBQUUsU0FBUyxFQUFFLE1BQU0saUNBQWlDLENBQUM7QUFDakUsT0FBTyxFQUFFLGNBQWMsRUFBRSxNQUFNLG9CQUFvQixDQUFDO0FBR3BELCtFQUErRTtBQUMvRSxxQkFBYSxxQkFBcUI7SUFDcEIsT0FBTyxDQUFDLFFBQVEsQ0FBQyxTQUFTO0lBQXRDLFlBQTZCLFNBQVMsRUFBRSxTQUFTLEVBQUk7SUFFckQ7Ozs7OztPQU1HO0lBQ0csMEJBQTBCLENBQUMsUUFBUSxFQUFFLEVBQUUsRUFBRSxFQUFFLGlCQUFpQixFQUFFLE1BQU0sR0FBRyxPQUFPLENBQUMsQ0FBQyxjQUFjLEdBQUcsSUFBSSxDQUFDLEVBQUUsQ0FBQyxDQTBCOUc7Q0FDRiJ9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message_context_service.d.ts","sourceRoot":"","sources":["../../src/messages/message_context_service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"message_context_service.d.ts","sourceRoot":"","sources":["../../src/messages/message_context_service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGpD,+EAA+E;AAC/E,qBAAa,qBAAqB;IACpB,OAAO,CAAC,QAAQ,CAAC,SAAS;IAAtC,YAA6B,SAAS,EAAE,SAAS,EAAI;IAErD;;;;;;OAMG;IACG,0BAA0B,CAAC,QAAQ,EAAE,EAAE,EAAE,EAAE,iBAAiB,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,cAAc,GAAG,IAAI,CAAC,EAAE,CAAC,CA0B9G;CACF"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { uniqueBy } from '@aztec/foundation/collection';
|
|
1
2
|
import { MessageContext } from '@aztec/stdlib/logs';
|
|
2
3
|
import { TxHash } from '@aztec/stdlib/tx';
|
|
3
4
|
/** Resolves transaction hashes into the context needed to process messages. */ export class MessageContextService {
|
|
@@ -11,16 +12,17 @@ import { TxHash } from '@aztec/stdlib/tx';
|
|
|
11
12
|
* For each tx hash, looks up the corresponding tx effect and extracts the note hashes and first nullifier needed to
|
|
12
13
|
* process messages that originated from that transaction. Returns `null` for tx hashes that are zero, not yet
|
|
13
14
|
* available, or in blocks beyond the anchor block.
|
|
14
|
-
*/ getMessageContextsByTxHash(txHashes, anchorBlockNumber) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
15
|
+
*/ async getMessageContextsByTxHash(txHashes, anchorBlockNumber) {
|
|
16
|
+
const nonZeroTxHashes = txHashes.filter((h)=>!h.isZero()).map((h)=>TxHash.fromField(h));
|
|
17
|
+
const uniqueTxHashes = uniqueBy(nonZeroTxHashes, (h)=>h.toString());
|
|
18
|
+
const fetched = await Promise.all(uniqueTxHashes.map((h)=>this.aztecNode.getTxEffect(h)));
|
|
19
|
+
const txEffects = new Map(uniqueTxHashes.map((h, i)=>[
|
|
20
|
+
h.toString(),
|
|
21
|
+
fetched[i]
|
|
22
|
+
]).filter((entry)=>entry[1] !== undefined));
|
|
23
|
+
return txHashes.map((txHashField)=>{
|
|
22
24
|
const txHash = TxHash.fromField(txHashField);
|
|
23
|
-
const txEffect =
|
|
25
|
+
const txEffect = txEffects.get(txHash.toString());
|
|
24
26
|
if (!txEffect || txEffect.l2BlockNumber > anchorBlockNumber) {
|
|
25
27
|
return null;
|
|
26
28
|
}
|
|
@@ -31,6 +33,6 @@ import { TxHash } from '@aztec/stdlib/tx';
|
|
|
31
33
|
throw new Error(`Tx effect for ${txHash} has no nullifiers`);
|
|
32
34
|
}
|
|
33
35
|
return new MessageContext(data.txHash, data.noteHashes, data.nullifiers[0]);
|
|
34
|
-
})
|
|
36
|
+
});
|
|
35
37
|
}
|
|
36
38
|
}
|
|
@@ -2,9 +2,11 @@ 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 { BlockHeader,
|
|
5
|
+
import type { BlockHeader, IndexedTxEffect } from '@aztec/stdlib/tx';
|
|
6
|
+
import type { NoteValidationRequest } from '../contract_function_simulator/noir-structs/note_validation_request.js';
|
|
6
7
|
import type { NoteStore } from '../storage/note_store/note_store.js';
|
|
7
8
|
export declare class NoteService {
|
|
9
|
+
#private;
|
|
8
10
|
private readonly noteStore;
|
|
9
11
|
private readonly aztecNode;
|
|
10
12
|
private readonly anchorBlockHeader;
|
|
@@ -43,6 +45,26 @@ export declare class NoteService {
|
|
|
43
45
|
* @param contractAddress - The contract whose notes should be checked and nullified.
|
|
44
46
|
*/
|
|
45
47
|
syncNoteNullifiers(contractAddress: AztecAddress, scopes: AztecAddress[]): Promise<void>;
|
|
46
|
-
|
|
48
|
+
/**
|
|
49
|
+
* Validates and stores a batch of notes against pre-fetched tx effects.
|
|
50
|
+
*
|
|
51
|
+
* For each request we must verify that:
|
|
52
|
+
* - the note actually exists in the corresponding tx effect (and thus in the note hash tree), and
|
|
53
|
+
* - the note has not already been nullified.
|
|
54
|
+
*
|
|
55
|
+
* Failing to do either would result in circuits getting either non-existent notes and failing to produce inclusion
|
|
56
|
+
* proofs for them, or getting nullified notes and producing duplicate nullifiers, both of which are catastrophic
|
|
57
|
+
* failure modes.
|
|
58
|
+
*
|
|
59
|
+
* Note that adding a note and removing it is *not* equivalent to never adding it in the first place. A nullifier
|
|
60
|
+
* emitted in a block that comes after note creation might result in the note being de-nullified by a chain reorg,
|
|
61
|
+
* so we must store both the note hash and nullifier block information.
|
|
62
|
+
*
|
|
63
|
+
* @param requests - The notes to validate and store.
|
|
64
|
+
* @param scope - The scope under which the notes are being stored.
|
|
65
|
+
* @param txEffects - Pre-fetched tx effects keyed by `TxHash.toString()`. Must contain entries for every request's
|
|
66
|
+
* txHash; missing entries are treated as a node bug and cause an error.
|
|
67
|
+
*/
|
|
68
|
+
validateAndStoreNotes(requests: NoteValidationRequest[], scope: AztecAddress, txEffects: Map<string, IndexedTxEffect>): Promise<void>;
|
|
47
69
|
}
|
|
48
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
70
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibm90ZV9zZXJ2aWNlLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvbm90ZXMvbm90ZV9zZXJ2aWNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUNBLE9BQU8sRUFBRSxFQUFFLEVBQUUsTUFBTSxnQ0FBZ0MsQ0FBQztBQUNwRCxP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LFlBQVksRUFBRSxHQUFHLE9BQU8sQ0FBQyxJQUFJLENBQUMsQ0FxQnBHO0lBRUQ7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7T0FtQkc7SUFDVSxxQkFBcUIsQ0FDaEMsUUFBUSxFQUFFLHFCQUFxQixFQUFFLEVBQ2pDLEtBQUssRUFBRSxZQUFZLEVBQ25CLFNBQVMsRUFBRSxHQUFHLENBQUMsTUFBTSxFQUFFLGVBQWUsQ0FBQyxHQUN0QyxPQUFPLENBQUMsSUFBSSxDQUFDLENBa0dmO0NBVUYifQ==
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"note_service.d.ts","sourceRoot":"","sources":["../../src/notes/note_service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"note_service.d.ts","sourceRoot":"","sources":["../../src/notes/note_service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAGhE,OAAO,EAAE,KAAK,SAAS,EAAe,MAAM,iCAAiC,CAAC;AAC9E,OAAO,EAAE,IAAI,EAAW,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAE/D,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAErE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wEAAwE,CAAC;AACpH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAErE,qBAAa,WAAW;;IAEpB,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IAClC,OAAO,CAAC,QAAQ,CAAC,KAAK;IAJxB,YACmB,SAAS,EAAE,SAAS,EACpB,SAAS,EAAE,SAAS,EACpB,iBAAiB,EAAE,WAAW,EAC9B,KAAK,EAAE,MAAM,EAC5B;IAEJ;;;;;;;;OAQG;IACU,QAAQ,CACnB,eAAe,EAAE,YAAY,EAC7B,KAAK,EAAE,YAAY,GAAG,SAAS,EAC/B,WAAW,EAAE,EAAE,EACf,MAAM,EAAE,UAAU,EAClB,MAAM,EAAE,YAAY,EAAE;;;;;;;;;;SAyBvB;IAED;;;;;;;;;;;OAWG;IACU,kBAAkB,CAAC,eAAe,EAAE,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAqBpG;IAED;;;;;;;;;;;;;;;;;;;OAmBG;IACU,qBAAqB,CAChC,QAAQ,EAAE,qBAAqB,EAAE,EACjC,KAAK,EAAE,YAAY,EACnB,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,eAAe,CAAC,GACtC,OAAO,CAAC,IAAI,CAAC,CAkGf;CAUF"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { chunk } from '@aztec/foundation/collection';
|
|
1
2
|
import { computeUniqueNoteHash, siloNoteHash, siloNullifier } from '@aztec/stdlib/hash';
|
|
2
3
|
import { MAX_RPC_LEN } from '@aztec/stdlib/interfaces/client';
|
|
3
4
|
import { Note, NoteDao } from '@aztec/stdlib/note';
|
|
@@ -62,19 +63,7 @@ export class NoteService {
|
|
|
62
63
|
return;
|
|
63
64
|
}
|
|
64
65
|
const nullifiersToCheck = contractNotes.map((note)=>note.siloedNullifier);
|
|
65
|
-
const
|
|
66
|
-
if (acc[acc.length - 1].length < MAX_RPC_LEN) {
|
|
67
|
-
acc[acc.length - 1].push(nullifier);
|
|
68
|
-
} else {
|
|
69
|
-
acc.push([
|
|
70
|
-
nullifier
|
|
71
|
-
]);
|
|
72
|
-
}
|
|
73
|
-
return acc;
|
|
74
|
-
}, [
|
|
75
|
-
[]
|
|
76
|
-
]);
|
|
77
|
-
const nullifierIndexes = (await Promise.all(nullifierBatches.map((batch)=>this.aztecNode.findLeavesIndexes(anchorBlockHash, MerkleTreeId.NULLIFIER_TREE, batch)))).flat();
|
|
66
|
+
const nullifierIndexes = await this.#findNullifierIndexes(anchorBlockHash, nullifiersToCheck);
|
|
78
67
|
const foundNullifiers = nullifiersToCheck.map((nullifier, i)=>{
|
|
79
68
|
if (nullifierIndexes[i] !== undefined) {
|
|
80
69
|
return {
|
|
@@ -87,19 +76,29 @@ export class NoteService {
|
|
|
87
76
|
}).filter((nullifier)=>nullifier !== undefined);
|
|
88
77
|
await this.noteStore.applyNullifiers(foundNullifiers, this.jobId);
|
|
89
78
|
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
79
|
+
/**
|
|
80
|
+
* Validates and stores a batch of notes against pre-fetched tx effects.
|
|
81
|
+
*
|
|
82
|
+
* For each request we must verify that:
|
|
83
|
+
* - the note actually exists in the corresponding tx effect (and thus in the note hash tree), and
|
|
84
|
+
* - the note has not already been nullified.
|
|
85
|
+
*
|
|
86
|
+
* Failing to do either would result in circuits getting either non-existent notes and failing to produce inclusion
|
|
87
|
+
* proofs for them, or getting nullified notes and producing duplicate nullifiers, both of which are catastrophic
|
|
88
|
+
* failure modes.
|
|
89
|
+
*
|
|
90
|
+
* Note that adding a note and removing it is *not* equivalent to never adding it in the first place. A nullifier
|
|
91
|
+
* emitted in a block that comes after note creation might result in the note being de-nullified by a chain reorg,
|
|
92
|
+
* so we must store both the note hash and nullifier block information.
|
|
93
|
+
*
|
|
94
|
+
* @param requests - The notes to validate and store.
|
|
95
|
+
* @param scope - The scope under which the notes are being stored.
|
|
96
|
+
* @param txEffects - Pre-fetched tx effects keyed by `TxHash.toString()`. Must contain entries for every request's
|
|
97
|
+
* txHash; missing entries are treated as a node bug and cause an error.
|
|
98
|
+
*/ async validateAndStoreNotes(requests, scope, txEffects) {
|
|
99
|
+
if (requests.length === 0) {
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
103
102
|
// We avoid making node queries at 'latest' since we don't want to process notes or nullifiers that only exist ahead
|
|
104
103
|
// in time of the locally synced state.
|
|
105
104
|
// Note that while this technically results in historical queries, we perform it at the latest locally synced block
|
|
@@ -110,48 +109,64 @@ export class NoteService {
|
|
|
110
109
|
const anchorBlockHash = await this.anchorBlockHeader.hash();
|
|
111
110
|
// By computing siloed and unique note hashes ourselves we prevent contracts from interfering with the note storage
|
|
112
111
|
// of other contracts, which would constitute a security breach.
|
|
113
|
-
const
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
112
|
+
const computed = await Promise.all(requests.map(async ({ contractAddress, noteHash, nullifier, noteNonce })=>{
|
|
113
|
+
const [siloedNoteHash, siloedNullifier] = await Promise.all([
|
|
114
|
+
siloNoteHash(contractAddress, noteHash),
|
|
115
|
+
siloNullifier(contractAddress, nullifier)
|
|
116
|
+
]);
|
|
117
|
+
const uniqueNoteHash = await computeUniqueNoteHash(noteNonce, siloedNoteHash);
|
|
118
|
+
return {
|
|
119
|
+
uniqueNoteHash,
|
|
118
120
|
siloedNullifier
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
121
|
+
};
|
|
122
|
+
}));
|
|
123
|
+
const nullifierIndexes = await this.#findNullifierIndexes(anchorBlockHash, computed.map((c)=>c.siloedNullifier));
|
|
124
|
+
const noteDaos = [];
|
|
125
|
+
const foundNullifiers = [];
|
|
126
|
+
for(let i = 0; i < requests.length; i++){
|
|
127
|
+
const { contractAddress, owner, storageSlot, randomness, noteNonce, content, noteHash, txHash } = requests[i];
|
|
128
|
+
const { uniqueNoteHash, siloedNullifier } = computed[i];
|
|
129
|
+
const nullifierIndex = nullifierIndexes[i];
|
|
130
|
+
const txEffect = txEffects.get(txHash.toString());
|
|
131
|
+
if (!txEffect) {
|
|
132
|
+
// We error out instead of just logging a warning and skipping the note because this would indicate a bug. This
|
|
133
|
+
// is because the node has already served info about this tx either when obtaining the log (TxScopedL2Log
|
|
134
|
+
// contain tx info) or when getting metadata for the offchain message (before the message got passed to
|
|
135
|
+
// `process_log`).
|
|
136
|
+
throw new Error(`Could not find tx effect for tx hash ${txHash} when processing a note.`);
|
|
137
|
+
}
|
|
138
|
+
if (txEffect.l2BlockNumber > anchorBlockNumber) {
|
|
139
|
+
// If the message was delivered onchain, this would indicate a bug: log sync should never load logs from blocks
|
|
140
|
+
// newer than the anchor block. If the note came via an offchain message, it would likely also be a bug, since
|
|
141
|
+
// we sync a new anchor block before calling `process_message`. For this not to be a bug, the message would
|
|
142
|
+
// need to come from a newer block than the anchor served by the node, implying the node isn't properly synced.
|
|
143
|
+
// We therefore error out here rather than assuming the offchain message was constructed by a malicious
|
|
144
|
+
// sender with the intention of bricking recipient's PXE (if we assumed that we would just ignore the message).
|
|
145
|
+
throw new Error(`Obtained a newer tx effect for ${txHash} for a note validation request than the anchor block ${anchorBlockNumber}. This is a bug as we should not ever be processing a note from a newer block than the anchor block.`);
|
|
146
|
+
}
|
|
147
|
+
// Find the index of the note hash in the noteHashes array to determine note ordering within the tx
|
|
148
|
+
const noteIndexInTx = txEffect.data.noteHashes.findIndex((nh)=>nh.equals(uniqueNoteHash));
|
|
149
|
+
if (noteIndexInTx === -1) {
|
|
150
|
+
// Similar to the comment above - we error out as this would indicate a bug in nonce discovery.
|
|
151
|
+
throw new Error(`Note hash ${noteHash} (uniqued as ${uniqueNoteHash}) is not present in tx ${txHash}`);
|
|
152
|
+
}
|
|
153
|
+
noteDaos.push(new NoteDao(new Note(content), contractAddress, owner, storageSlot, randomness, noteNonce, noteHash, siloedNullifier, txHash, txEffect.l2BlockNumber, txEffect.l2BlockHash.toString(), txEffect.txIndexInBlock, noteIndexInTx));
|
|
154
|
+
if (nullifierIndex !== undefined) {
|
|
155
|
+
// We found a nullifier index which implies that the note has already been nullified.
|
|
156
|
+
const { data: _, ...blockHashAndNum } = nullifierIndex;
|
|
157
|
+
foundNullifiers.push({
|
|
151
158
|
data: siloedNullifier,
|
|
152
159
|
...blockHashAndNum
|
|
153
|
-
}
|
|
154
|
-
|
|
160
|
+
});
|
|
161
|
+
}
|
|
155
162
|
}
|
|
163
|
+
await this.noteStore.addNotes(noteDaos, scope, this.jobId);
|
|
164
|
+
if (foundNullifiers.length > 0) {
|
|
165
|
+
await this.noteStore.applyNullifiers(foundNullifiers, this.jobId);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
async #findNullifierIndexes(anchorBlockHash, siloedNullifiers) {
|
|
169
|
+
const batches = chunk(siloedNullifiers, MAX_RPC_LEN);
|
|
170
|
+
return (await Promise.all(batches.map((batch)=>this.aztecNode.findLeavesIndexes(anchorBlockHash, MerkleTreeId.NULLIFIER_TREE, batch)))).flat();
|
|
156
171
|
}
|
|
157
172
|
}
|
package/dest/oracle_version.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare const ORACLE_VERSION_MAJOR = 22;
|
|
2
|
-
export declare const ORACLE_VERSION_MINOR =
|
|
3
|
-
export declare const ORACLE_INTERFACE_HASH = "
|
|
2
|
+
export declare const ORACLE_VERSION_MINOR = 3;
|
|
3
|
+
export declare const ORACLE_INTERFACE_HASH = "0649632102f27d1411749e46733b96103eaac948914d328afc4b90d3bf6e5af5";
|
|
4
4
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3JhY2xlX3ZlcnNpb24uZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9vcmFjbGVfdmVyc2lvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFZQSxlQUFPLE1BQU0sb0JBQW9CLEtBQUssQ0FBQztBQUN2QyxlQUFPLE1BQU0sb0JBQW9CLElBQUksQ0FBQztBQVF0QyxlQUFPLE1BQU0scUJBQXFCLHFFQUFxRSxDQUFDIn0=
|