@aztec/pxe 0.0.1-commit.6230a0c → 0.0.1-commit.643667a5cb
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/access_scopes.d.ts +9 -0
- package/dest/access_scopes.d.ts.map +1 -0
- package/dest/access_scopes.js +6 -0
- package/dest/block_synchronizer/block_synchronizer.d.ts +4 -2
- package/dest/block_synchronizer/block_synchronizer.d.ts.map +1 -1
- package/dest/block_synchronizer/block_synchronizer.js +7 -1
- package/dest/config/package_info.js +1 -1
- package/dest/contract_function_simulator/contract_function_simulator.d.ts +54 -28
- package/dest/contract_function_simulator/contract_function_simulator.d.ts.map +1 -1
- package/dest/contract_function_simulator/contract_function_simulator.js +174 -68
- 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 +2 -2
- package/dest/contract_function_simulator/noir-structs/note_validation_request.d.ts.map +1 -1
- package/dest/contract_function_simulator/noir-structs/note_validation_request.js +1 -1
- package/dest/contract_function_simulator/oracle/interfaces.d.ts +2 -2
- package/dest/contract_function_simulator/oracle/interfaces.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/oracle.d.ts +2 -2
- package/dest/contract_function_simulator/oracle/oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/oracle.js +3 -3
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts +36 -35
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/private_execution_oracle.js +64 -19
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +32 -11
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.js +57 -31
- package/dest/contract_logging.d.ts +22 -0
- package/dest/contract_logging.d.ts.map +1 -0
- package/dest/contract_logging.js +23 -0
- package/dest/contract_sync/contract_sync_service.d.ts +43 -0
- package/dest/contract_sync/contract_sync_service.d.ts.map +1 -0
- package/dest/contract_sync/contract_sync_service.js +97 -0
- package/dest/contract_sync/helpers.d.ts +29 -0
- package/dest/contract_sync/helpers.d.ts.map +1 -0
- package/dest/contract_sync/{index.js → helpers.js} +8 -14
- package/dest/debug/pxe_debug_utils.d.ts +14 -10
- package/dest/debug/pxe_debug_utils.d.ts.map +1 -1
- package/dest/debug/pxe_debug_utils.js +16 -15
- package/dest/entrypoints/client/bundle/index.d.ts +4 -1
- package/dest/entrypoints/client/bundle/index.d.ts.map +1 -1
- package/dest/entrypoints/client/bundle/index.js +3 -0
- 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 +9 -1
- package/dest/entrypoints/client/lazy/index.d.ts +4 -1
- package/dest/entrypoints/client/lazy/index.d.ts.map +1 -1
- package/dest/entrypoints/client/lazy/index.js +3 -0
- 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 +9 -1
- package/dest/entrypoints/server/index.d.ts +4 -2
- package/dest/entrypoints/server/index.d.ts.map +1 -1
- package/dest/entrypoints/server/index.js +3 -1
- package/dest/entrypoints/server/utils.js +9 -1
- package/dest/logs/log_service.d.ts +3 -2
- package/dest/logs/log_service.d.ts.map +1 -1
- package/dest/logs/log_service.js +5 -10
- package/dest/notes/note_service.d.ts +4 -3
- package/dest/notes/note_service.d.ts.map +1 -1
- package/dest/notes/note_service.js +3 -2
- package/dest/notes_filter.d.ts +25 -0
- package/dest/notes_filter.d.ts.map +1 -0
- package/dest/notes_filter.js +4 -0
- package/dest/oracle_version.d.ts +2 -2
- package/dest/oracle_version.js +2 -2
- package/dest/private_kernel/hints/compute_tx_expiration_timestamp.d.ts +4 -0
- package/dest/private_kernel/hints/compute_tx_expiration_timestamp.d.ts.map +1 -0
- package/dest/private_kernel/hints/{compute_tx_include_by_timestamp.js → compute_tx_expiration_timestamp.js} +12 -12
- package/dest/private_kernel/hints/index.d.ts +1 -1
- package/dest/private_kernel/hints/index.js +1 -1
- package/dest/private_kernel/hints/private_kernel_reset_private_inputs_builder.js +4 -4
- package/dest/private_kernel/private_kernel_execution_prover.js +6 -6
- package/dest/private_kernel/private_kernel_oracle.d.ts +6 -2
- package/dest/private_kernel/private_kernel_oracle.d.ts.map +1 -1
- package/dest/private_kernel/private_kernel_oracle.js +7 -3
- package/dest/pxe.d.ts +69 -23
- package/dest/pxe.d.ts.map +1 -1
- package/dest/pxe.js +92 -60
- package/dest/storage/contract_store/contract_store.d.ts +42 -15
- package/dest/storage/contract_store/contract_store.d.ts.map +1 -1
- package/dest/storage/contract_store/contract_store.js +145 -69
- package/dest/storage/note_store/note_store.d.ts +3 -3
- package/dest/storage/note_store/note_store.d.ts.map +1 -1
- package/dest/storage/note_store/note_store.js +6 -4
- 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 +17 -3
- package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.js +4 -4
- package/dest/tagging/recipient_sync/utils/find_highest_indexes.js +2 -2
- package/package.json +25 -16
- package/src/access_scopes.ts +9 -0
- package/src/block_synchronizer/block_synchronizer.ts +6 -0
- package/src/config/package_info.ts +1 -1
- package/src/contract_function_simulator/contract_function_simulator.ts +330 -128
- 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/oracle/interfaces.ts +1 -1
- package/src/contract_function_simulator/oracle/oracle.ts +3 -3
- package/src/contract_function_simulator/oracle/private_execution_oracle.ts +85 -96
- package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +102 -29
- package/src/contract_logging.ts +39 -0
- package/src/contract_sync/contract_sync_service.ts +152 -0
- package/src/contract_sync/{index.ts → helpers.ts} +13 -34
- package/src/debug/pxe_debug_utils.ts +48 -18
- package/src/entrypoints/client/bundle/index.ts +3 -0
- package/src/entrypoints/client/bundle/utils.ts +9 -1
- package/src/entrypoints/client/lazy/index.ts +3 -0
- package/src/entrypoints/client/lazy/utils.ts +9 -1
- package/src/entrypoints/server/index.ts +3 -1
- package/src/entrypoints/server/utils.ts +7 -7
- package/src/logs/log_service.ts +7 -19
- package/src/notes/note_service.ts +4 -3
- package/src/notes_filter.ts +26 -0
- package/src/oracle_version.ts +2 -2
- package/src/private_kernel/hints/{compute_tx_include_by_timestamp.ts → compute_tx_expiration_timestamp.ts} +13 -13
- package/src/private_kernel/hints/index.ts +1 -1
- package/src/private_kernel/hints/private_kernel_reset_private_inputs_builder.ts +7 -7
- package/src/private_kernel/private_kernel_execution_prover.ts +6 -6
- package/src/private_kernel/private_kernel_oracle.ts +7 -7
- package/src/pxe.ts +173 -112
- package/src/storage/contract_store/contract_store.ts +174 -75
- package/src/storage/note_store/note_store.ts +12 -5
- package/src/tagging/get_all_logs_by_tags.ts +28 -4
- package/src/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.ts +4 -4
- package/src/tagging/recipient_sync/utils/find_highest_indexes.ts +2 -2
- package/dest/contract_sync/index.d.ts +0 -24
- package/dest/contract_sync/index.d.ts.map +0 -1
- package/dest/private_kernel/hints/compute_tx_include_by_timestamp.d.ts +0 -4
- package/dest/private_kernel/hints/compute_tx_include_by_timestamp.d.ts.map +0 -1
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
type PrivateKernelSimulateOutput,
|
|
27
27
|
ReadRequestActionEnum,
|
|
28
28
|
ReadRequestResetActions,
|
|
29
|
-
type
|
|
29
|
+
type ScopedKeyValidationRequestAndSeparator,
|
|
30
30
|
ScopedNoteHash,
|
|
31
31
|
ScopedNullifier,
|
|
32
32
|
ScopedReadRequest,
|
|
@@ -68,9 +68,9 @@ function getNullifierMembershipWitnessResolver(oracle: PrivateKernelOracle) {
|
|
|
68
68
|
};
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
async function
|
|
71
|
+
async function getMasterSecretKeysAndKeyTypeDomainSeparators(
|
|
72
72
|
keyValidationRequests: ClaimedLengthArray<
|
|
73
|
-
|
|
73
|
+
ScopedKeyValidationRequestAndSeparator,
|
|
74
74
|
typeof MAX_KEY_VALIDATION_REQUESTS_PER_TX
|
|
75
75
|
>,
|
|
76
76
|
numRequestsToVerify: number,
|
|
@@ -189,8 +189,8 @@ export class PrivateKernelResetPrivateInputsBuilder {
|
|
|
189
189
|
this.previousKernel.validationRequests.nullifierReadRequests,
|
|
190
190
|
this.nullifierResetActions,
|
|
191
191
|
),
|
|
192
|
-
|
|
193
|
-
this.previousKernel.validationRequests.
|
|
192
|
+
getMasterSecretKeysAndKeyTypeDomainSeparators(
|
|
193
|
+
this.previousKernel.validationRequests.scopedKeyValidationRequestsAndSeparators,
|
|
194
194
|
dimensions.KEY_VALIDATION,
|
|
195
195
|
oracle,
|
|
196
196
|
),
|
|
@@ -357,8 +357,8 @@ export class PrivateKernelResetPrivateInputsBuilder {
|
|
|
357
357
|
}
|
|
358
358
|
|
|
359
359
|
private needsResetNullifierKeys() {
|
|
360
|
-
const numCurr = this.previousKernel.validationRequests.
|
|
361
|
-
const numNext = this.nextIteration ? this.nextIteration.
|
|
360
|
+
const numCurr = this.previousKernel.validationRequests.scopedKeyValidationRequestsAndSeparators.claimedLength;
|
|
361
|
+
const numNext = this.nextIteration ? this.nextIteration.keyValidationRequestsAndSeparators.claimedLength : 0;
|
|
362
362
|
const maxAmountToKeep = !this.nextIteration ? 0 : MAX_KEY_VALIDATION_REQUESTS_PER_TX;
|
|
363
363
|
if (numCurr + numNext <= maxAmountToKeep) {
|
|
364
364
|
return false;
|
|
@@ -260,20 +260,20 @@ export class PrivateKernelExecutionProver {
|
|
|
260
260
|
// TODO: Enable padding once we better understand the final amounts to pad to.
|
|
261
261
|
const paddedSideEffectAmounts = PaddedSideEffectAmounts.empty();
|
|
262
262
|
|
|
263
|
-
// Use the aggregated
|
|
264
|
-
// TODO: Call `
|
|
265
|
-
const
|
|
263
|
+
// Use the aggregated expirationTimestamp set throughout the tx execution.
|
|
264
|
+
// TODO: Call `computeTxExpirationTimestamp` to round the value down and reduce precision, improving privacy.
|
|
265
|
+
const expirationTimestampUpperBound = previousKernelData.publicInputs.expirationTimestamp;
|
|
266
266
|
const anchorBlockTimestamp = previousKernelData.publicInputs.constants.anchorBlockHeader.globalVariables.timestamp;
|
|
267
|
-
if (
|
|
267
|
+
if (expirationTimestampUpperBound <= anchorBlockTimestamp) {
|
|
268
268
|
throw new Error(
|
|
269
|
-
`Include-by timestamp must be greater than the anchor block timestamp. Anchor block timestamp: ${anchorBlockTimestamp}. Include-by timestamp: ${
|
|
269
|
+
`Include-by timestamp must be greater than the anchor block timestamp. Anchor block timestamp: ${anchorBlockTimestamp}. Include-by timestamp: ${expirationTimestampUpperBound}.`,
|
|
270
270
|
);
|
|
271
271
|
}
|
|
272
272
|
|
|
273
273
|
const privateInputs = new PrivateKernelTailCircuitPrivateInputs(
|
|
274
274
|
previousKernelData,
|
|
275
275
|
paddedSideEffectAmounts,
|
|
276
|
-
|
|
276
|
+
expirationTimestampUpperBound,
|
|
277
277
|
);
|
|
278
278
|
|
|
279
279
|
const witgenTimer = new Timer();
|
|
@@ -8,11 +8,7 @@ import { ProtocolContractAddress } from '@aztec/protocol-contracts';
|
|
|
8
8
|
import type { FunctionSelector } from '@aztec/stdlib/abi';
|
|
9
9
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
10
10
|
import { BlockHash } from '@aztec/stdlib/block';
|
|
11
|
-
import {
|
|
12
|
-
type ContractInstanceWithAddress,
|
|
13
|
-
computeContractClassIdPreimage,
|
|
14
|
-
computeSaltedInitializationHash,
|
|
15
|
-
} from '@aztec/stdlib/contract';
|
|
11
|
+
import { type ContractInstanceWithAddress, computeSaltedInitializationHash } from '@aztec/stdlib/contract';
|
|
16
12
|
import { DelayedPublicMutableValues, DelayedPublicMutableValuesWithHash } from '@aztec/stdlib/delayed-public-mutable';
|
|
17
13
|
import { computePublicDataTreeLeafSlot } from '@aztec/stdlib/hash';
|
|
18
14
|
import type { AztecNode } from '@aztec/stdlib/interfaces/client';
|
|
@@ -49,11 +45,15 @@ export class PrivateKernelOracle {
|
|
|
49
45
|
|
|
50
46
|
/** Retrieves the preimage of a contract class id from the contract classes db. */
|
|
51
47
|
public async getContractClassIdPreimage(contractClassId: Fr) {
|
|
52
|
-
const contractClass = await this.contractStore.
|
|
48
|
+
const contractClass = await this.contractStore.getContractClassWithPreimage(contractClassId);
|
|
53
49
|
if (!contractClass) {
|
|
54
50
|
throw new Error(`Contract class not found when getting class id preimage. Class id: ${contractClassId}.`);
|
|
55
51
|
}
|
|
56
|
-
return
|
|
52
|
+
return {
|
|
53
|
+
artifactHash: contractClass.artifactHash,
|
|
54
|
+
privateFunctionsRoot: contractClass.privateFunctionsRoot,
|
|
55
|
+
publicBytecodeCommitment: contractClass.publicBytecodeCommitment,
|
|
56
|
+
};
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
/** Returns a membership witness with the sibling path and leaf index in our private functions tree. */
|