@aztec/pxe 0.0.1-commit.3fd054f6 → 0.0.1-commit.42ee6df9b
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/block_synchronizer/block_synchronizer.d.ts +1 -1
- package/dest/block_synchronizer/block_synchronizer.d.ts.map +1 -1
- package/dest/block_synchronizer/block_synchronizer.js +6 -0
- package/dest/contract_function_simulator/contract_function_simulator.d.ts +3 -4
- package/dest/contract_function_simulator/contract_function_simulator.d.ts.map +1 -1
- package/dest/contract_function_simulator/contract_function_simulator.js +4 -3
- package/dest/contract_function_simulator/noir-structs/event_validation_request.d.ts +2 -3
- package/dest/contract_function_simulator/noir-structs/event_validation_request.d.ts.map +1 -1
- package/dest/contract_function_simulator/noir-structs/event_validation_request.js +2 -5
- package/dest/contract_function_simulator/noir-structs/note_validation_request.d.ts +2 -3
- 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 +2 -5
- package/dest/contract_function_simulator/oracle/interfaces.d.ts +19 -19
- package/dest/contract_function_simulator/oracle/interfaces.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/legacy_oracle_mappings.d.ts +1 -1
- package/dest/contract_function_simulator/oracle/legacy_oracle_mappings.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/legacy_oracle_mappings.js +18 -22
- package/dest/contract_function_simulator/oracle/oracle.d.ts +38 -19
- package/dest/contract_function_simulator/oracle/oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/oracle.js +60 -39
- package/dest/contract_function_simulator/oracle/private_execution.js +1 -1
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts +7 -8
- 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 -7
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +30 -29
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.js +115 -79
- package/dest/contract_logging.d.ts +9 -4
- package/dest/contract_logging.d.ts.map +1 -1
- package/dest/contract_logging.js +21 -6
- package/dest/contract_sync/contract_sync_service.d.ts +3 -4
- package/dest/contract_sync/contract_sync_service.d.ts.map +1 -1
- package/dest/contract_sync/contract_sync_service.js +12 -22
- 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 +7 -2
- package/dest/debug/pxe_debug_utils.d.ts +3 -3
- package/dest/debug/pxe_debug_utils.d.ts.map +1 -1
- package/dest/entrypoints/client/bundle/index.d.ts +1 -2
- package/dest/entrypoints/client/bundle/index.d.ts.map +1 -1
- package/dest/entrypoints/client/bundle/index.js +0 -1
- package/dest/entrypoints/client/lazy/index.d.ts +1 -2
- package/dest/entrypoints/client/lazy/index.d.ts.map +1 -1
- package/dest/entrypoints/client/lazy/index.js +0 -1
- package/dest/entrypoints/server/index.d.ts +1 -2
- package/dest/entrypoints/server/index.d.ts.map +1 -1
- package/dest/entrypoints/server/index.js +0 -1
- package/dest/events/event_service.d.ts +3 -2
- package/dest/events/event_service.d.ts.map +1 -1
- package/dest/events/event_service.js +16 -4
- package/dest/logs/log_service.d.ts +6 -7
- package/dest/logs/log_service.d.ts.map +1 -1
- package/dest/logs/log_service.js +32 -30
- package/dest/messages/message_context_service.d.ts +3 -3
- package/dest/messages/message_context_service.d.ts.map +1 -1
- package/dest/messages/message_context_service.js +3 -3
- package/dest/notes/note_service.d.ts +4 -5
- package/dest/notes/note_service.d.ts.map +1 -1
- package/dest/notes/note_service.js +14 -5
- package/dest/notes_filter.d.ts +2 -3
- package/dest/notes_filter.d.ts.map +1 -1
- package/dest/oracle_version.d.ts +2 -2
- package/dest/oracle_version.js +2 -2
- package/dest/pxe.d.ts +4 -5
- package/dest/pxe.d.ts.map +1 -1
- package/dest/pxe.js +6 -4
- package/dest/storage/capsule_store/capsule_service.d.ts +21 -0
- package/dest/storage/capsule_store/capsule_service.d.ts.map +1 -0
- package/dest/storage/capsule_store/capsule_service.js +50 -0
- package/dest/storage/capsule_store/capsule_store.d.ts +9 -9
- package/dest/storage/capsule_store/capsule_store.d.ts.map +1 -1
- package/dest/storage/capsule_store/capsule_store.js +33 -28
- package/dest/storage/capsule_store/index.d.ts +2 -1
- package/dest/storage/capsule_store/index.d.ts.map +1 -1
- package/dest/storage/capsule_store/index.js +1 -0
- package/dest/storage/metadata.d.ts +1 -1
- package/dest/storage/metadata.js +1 -1
- package/dest/storage/note_store/note_store.d.ts +1 -1
- package/dest/storage/note_store/note_store.d.ts.map +1 -1
- package/dest/storage/note_store/note_store.js +2 -2
- package/package.json +16 -16
- package/src/block_synchronizer/block_synchronizer.ts +6 -0
- package/src/contract_function_simulator/contract_function_simulator.ts +6 -6
- package/src/contract_function_simulator/noir-structs/event_validation_request.ts +0 -3
- package/src/contract_function_simulator/noir-structs/note_validation_request.ts +0 -3
- package/src/contract_function_simulator/oracle/interfaces.ts +26 -17
- package/src/contract_function_simulator/oracle/legacy_oracle_mappings.ts +13 -50
- package/src/contract_function_simulator/oracle/oracle.ts +79 -33
- package/src/contract_function_simulator/oracle/private_execution.ts +1 -1
- package/src/contract_function_simulator/oracle/private_execution_oracle.ts +19 -10
- package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +204 -91
- package/src/contract_logging.ts +18 -5
- package/src/contract_sync/contract_sync_service.ts +32 -43
- package/src/contract_sync/helpers.ts +4 -4
- package/src/debug/pxe_debug_utils.ts +3 -3
- package/src/entrypoints/client/bundle/index.ts +0 -1
- package/src/entrypoints/client/lazy/index.ts +0 -1
- package/src/entrypoints/server/index.ts +0 -1
- package/src/events/event_service.ts +17 -4
- package/src/logs/log_service.ts +63 -48
- package/src/messages/message_context_service.ts +3 -4
- package/src/notes/note_service.ts +18 -8
- package/src/notes_filter.ts +1 -3
- package/src/oracle_version.ts +2 -2
- package/src/pxe.ts +11 -10
- package/src/storage/capsule_store/capsule_service.ts +90 -0
- package/src/storage/capsule_store/capsule_store.ts +34 -26
- package/src/storage/capsule_store/index.ts +1 -0
- package/src/storage/metadata.ts +1 -1
- package/src/storage/note_store/note_store.ts +2 -5
- package/dest/access_scopes.d.ts +0 -9
- package/dest/access_scopes.d.ts.map +0 -1
- package/dest/access_scopes.js +0 -6
- package/dest/contract_function_simulator/noir-structs/message_tx_context.d.ts +0 -16
- package/dest/contract_function_simulator/noir-structs/message_tx_context.d.ts.map +0 -1
- package/dest/contract_function_simulator/noir-structs/message_tx_context.js +0 -57
- package/src/access_scopes.ts +0 -9
- package/src/contract_function_simulator/noir-structs/message_tx_context.ts +0 -55
|
@@ -75,7 +75,7 @@ import { StoredNote } from './stored_note.js';
|
|
|
75
75
|
* @returns Filtered and deduplicated notes (a note might be present in multiple scopes - we ensure it is only
|
|
76
76
|
* returned once if this is the case)
|
|
77
77
|
*/ getNotes(filter, jobId) {
|
|
78
|
-
if (filter.scopes
|
|
78
|
+
if (filter.scopes.length === 0) {
|
|
79
79
|
return Promise.resolve([]);
|
|
80
80
|
}
|
|
81
81
|
return this.#store.transactionAsync(async ()=>{
|
|
@@ -135,7 +135,7 @@ import { StoredNote } from './stored_note.js';
|
|
|
135
135
|
if (filter.siloedNullifier && !note.noteDao.siloedNullifier.equals(filter.siloedNullifier)) {
|
|
136
136
|
continue;
|
|
137
137
|
}
|
|
138
|
-
if (
|
|
138
|
+
if (note.scopes.intersection(new Set(filter.scopes.map((s)=>s.toString()))).size === 0) {
|
|
139
139
|
continue;
|
|
140
140
|
}
|
|
141
141
|
foundNotes.set(note.noteDao.siloedNullifier.toString(), note.noteDao);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/pxe",
|
|
3
|
-
"version": "0.0.1-commit.
|
|
3
|
+
"version": "0.0.1-commit.42ee6df9b",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"typedocOptions": {
|
|
6
6
|
"entryPoints": [
|
|
@@ -70,19 +70,19 @@
|
|
|
70
70
|
]
|
|
71
71
|
},
|
|
72
72
|
"dependencies": {
|
|
73
|
-
"@aztec/bb-prover": "0.0.1-commit.
|
|
74
|
-
"@aztec/bb.js": "0.0.1-commit.
|
|
75
|
-
"@aztec/builder": "0.0.1-commit.
|
|
76
|
-
"@aztec/constants": "0.0.1-commit.
|
|
77
|
-
"@aztec/ethereum": "0.0.1-commit.
|
|
78
|
-
"@aztec/foundation": "0.0.1-commit.
|
|
79
|
-
"@aztec/key-store": "0.0.1-commit.
|
|
80
|
-
"@aztec/kv-store": "0.0.1-commit.
|
|
81
|
-
"@aztec/noir-protocol-circuits-types": "0.0.1-commit.
|
|
82
|
-
"@aztec/noir-types": "0.0.1-commit.
|
|
83
|
-
"@aztec/protocol-contracts": "0.0.1-commit.
|
|
84
|
-
"@aztec/simulator": "0.0.1-commit.
|
|
85
|
-
"@aztec/stdlib": "0.0.1-commit.
|
|
73
|
+
"@aztec/bb-prover": "0.0.1-commit.42ee6df9b",
|
|
74
|
+
"@aztec/bb.js": "0.0.1-commit.42ee6df9b",
|
|
75
|
+
"@aztec/builder": "0.0.1-commit.42ee6df9b",
|
|
76
|
+
"@aztec/constants": "0.0.1-commit.42ee6df9b",
|
|
77
|
+
"@aztec/ethereum": "0.0.1-commit.42ee6df9b",
|
|
78
|
+
"@aztec/foundation": "0.0.1-commit.42ee6df9b",
|
|
79
|
+
"@aztec/key-store": "0.0.1-commit.42ee6df9b",
|
|
80
|
+
"@aztec/kv-store": "0.0.1-commit.42ee6df9b",
|
|
81
|
+
"@aztec/noir-protocol-circuits-types": "0.0.1-commit.42ee6df9b",
|
|
82
|
+
"@aztec/noir-types": "0.0.1-commit.42ee6df9b",
|
|
83
|
+
"@aztec/protocol-contracts": "0.0.1-commit.42ee6df9b",
|
|
84
|
+
"@aztec/simulator": "0.0.1-commit.42ee6df9b",
|
|
85
|
+
"@aztec/stdlib": "0.0.1-commit.42ee6df9b",
|
|
86
86
|
"koa": "^2.16.1",
|
|
87
87
|
"koa-router": "^13.1.1",
|
|
88
88
|
"lodash.omit": "^4.5.0",
|
|
@@ -91,8 +91,8 @@
|
|
|
91
91
|
"viem": "npm:@aztec/viem@2.38.2"
|
|
92
92
|
},
|
|
93
93
|
"devDependencies": {
|
|
94
|
-
"@aztec/noir-test-contracts.js": "0.0.1-commit.
|
|
95
|
-
"@aztec/world-state": "0.0.1-commit.
|
|
94
|
+
"@aztec/noir-test-contracts.js": "0.0.1-commit.42ee6df9b",
|
|
95
|
+
"@aztec/world-state": "0.0.1-commit.42ee6df9b",
|
|
96
96
|
"@jest/globals": "^30.0.0",
|
|
97
97
|
"@types/jest": "^30.0.0",
|
|
98
98
|
"@types/lodash.omit": "^4.5.7",
|
|
@@ -77,6 +77,8 @@ export class BlockSynchronizer implements L2BlockStreamEventHandler {
|
|
|
77
77
|
const blockHeader = await this.node.getBlockHeader(BlockNumber(event.block.number));
|
|
78
78
|
if (blockHeader) {
|
|
79
79
|
await this.updateAnchorBlockHeader(blockHeader);
|
|
80
|
+
} else {
|
|
81
|
+
this.log.warn(`Block header not found for proven block ${event.block.number}, skipping anchor update`);
|
|
80
82
|
}
|
|
81
83
|
}
|
|
82
84
|
break;
|
|
@@ -86,6 +88,8 @@ export class BlockSynchronizer implements L2BlockStreamEventHandler {
|
|
|
86
88
|
const blockHeader = await this.node.getBlockHeader(BlockNumber(event.block.number));
|
|
87
89
|
if (blockHeader) {
|
|
88
90
|
await this.updateAnchorBlockHeader(blockHeader);
|
|
91
|
+
} else {
|
|
92
|
+
this.log.warn(`Block header not found for finalized block ${event.block.number}, skipping anchor update`);
|
|
89
93
|
}
|
|
90
94
|
}
|
|
91
95
|
break;
|
|
@@ -152,6 +156,8 @@ export class BlockSynchronizer implements L2BlockStreamEventHandler {
|
|
|
152
156
|
}
|
|
153
157
|
|
|
154
158
|
this.log.debug(`Syncing PXE with the node`);
|
|
159
|
+
// Capture the promise locally so we always await the exact promise we created, even if this.isSyncing is modified
|
|
160
|
+
// between assignment and await (e.g. due to future refactors introducing a yield point).
|
|
155
161
|
const isSyncing = this.doSync();
|
|
156
162
|
this.isSyncing = isSyncing;
|
|
157
163
|
try {
|
|
@@ -89,10 +89,10 @@ import {
|
|
|
89
89
|
getFinalMinRevertibleSideEffectCounter,
|
|
90
90
|
} from '@aztec/stdlib/tx';
|
|
91
91
|
|
|
92
|
-
import type { AccessScopes } from '../access_scopes.js';
|
|
93
92
|
import type { ContractSyncService } from '../contract_sync/contract_sync_service.js';
|
|
94
93
|
import type { MessageContextService } from '../messages/message_context_service.js';
|
|
95
94
|
import type { AddressStore } from '../storage/address_store/address_store.js';
|
|
95
|
+
import { CapsuleService } from '../storage/capsule_store/capsule_service.js';
|
|
96
96
|
import type { CapsuleStore } from '../storage/capsule_store/capsule_store.js';
|
|
97
97
|
import type { ContractStore } from '../storage/contract_store/contract_store.js';
|
|
98
98
|
import type { NoteStore } from '../storage/note_store/note_store.js';
|
|
@@ -122,7 +122,7 @@ export type ContractSimulatorRunOpts = {
|
|
|
122
122
|
/** The address used as a tagging sender when emitting private logs. */
|
|
123
123
|
senderForTags?: AztecAddress;
|
|
124
124
|
/** The accounts whose notes we can access in this call. */
|
|
125
|
-
scopes:
|
|
125
|
+
scopes: AztecAddress[];
|
|
126
126
|
/** The job ID for staged writes. */
|
|
127
127
|
jobId: string;
|
|
128
128
|
};
|
|
@@ -245,7 +245,7 @@ export class ContractFunctionSimulator {
|
|
|
245
245
|
senderTaggingStore: this.senderTaggingStore,
|
|
246
246
|
recipientTaggingStore: this.recipientTaggingStore,
|
|
247
247
|
senderAddressBookStore: this.senderAddressBookStore,
|
|
248
|
-
|
|
248
|
+
capsuleService: new CapsuleService(this.capsuleStore, scopes),
|
|
249
249
|
privateEventStore: this.privateEventStore,
|
|
250
250
|
messageContextService: this.messageContextService,
|
|
251
251
|
contractSyncService: this.contractSyncService,
|
|
@@ -284,7 +284,7 @@ export class ContractFunctionSimulator {
|
|
|
284
284
|
);
|
|
285
285
|
const publicFunctionsCalldata = await Promise.all(
|
|
286
286
|
publicCallRequests.map(async r => {
|
|
287
|
-
const calldata = await privateExecutionOracle.
|
|
287
|
+
const calldata = await privateExecutionOracle.getHashPreimage(r.calldataHash);
|
|
288
288
|
return new HashedValues(calldata, r.calldataHash);
|
|
289
289
|
}),
|
|
290
290
|
);
|
|
@@ -319,7 +319,7 @@ export class ContractFunctionSimulator {
|
|
|
319
319
|
call: FunctionCall,
|
|
320
320
|
authwits: AuthWitness[],
|
|
321
321
|
anchorBlockHeader: BlockHeader,
|
|
322
|
-
scopes:
|
|
322
|
+
scopes: AztecAddress[],
|
|
323
323
|
jobId: string,
|
|
324
324
|
): Promise<{ result: Fr[]; offchainEffects: OffchainEffect[] }> {
|
|
325
325
|
const entryPointArtifact = await this.contractStore.getFunctionArtifactWithDebugMetadata(call.to, call.selector);
|
|
@@ -340,7 +340,7 @@ export class ContractFunctionSimulator {
|
|
|
340
340
|
aztecNode: this.aztecNode,
|
|
341
341
|
recipientTaggingStore: this.recipientTaggingStore,
|
|
342
342
|
senderAddressBookStore: this.senderAddressBookStore,
|
|
343
|
-
|
|
343
|
+
capsuleService: new CapsuleService(this.capsuleStore, scopes),
|
|
344
344
|
privateEventStore: this.privateEventStore,
|
|
345
345
|
messageContextService: this.messageContextService,
|
|
346
346
|
contractSyncService: this.contractSyncService,
|
|
@@ -16,7 +16,6 @@ export class EventValidationRequest {
|
|
|
16
16
|
public serializedEvent: Fr[],
|
|
17
17
|
public eventCommitment: Fr,
|
|
18
18
|
public txHash: TxHash,
|
|
19
|
-
public recipient: AztecAddress,
|
|
20
19
|
) {}
|
|
21
20
|
|
|
22
21
|
static fromFields(fields: Fr[], maxEventSerializedLen: number): EventValidationRequest {
|
|
@@ -33,7 +32,6 @@ export class EventValidationRequest {
|
|
|
33
32
|
|
|
34
33
|
const eventCommitment = reader.readField();
|
|
35
34
|
const txHash = TxHash.fromField(reader.readField());
|
|
36
|
-
const recipient = AztecAddress.fromField(reader.readField());
|
|
37
35
|
|
|
38
36
|
if (reader.remainingFields() !== 0) {
|
|
39
37
|
throw new Error(
|
|
@@ -48,7 +46,6 @@ export class EventValidationRequest {
|
|
|
48
46
|
serializedEvent,
|
|
49
47
|
eventCommitment,
|
|
50
48
|
txHash,
|
|
51
|
-
recipient,
|
|
52
49
|
);
|
|
53
50
|
}
|
|
54
51
|
}
|
|
@@ -18,7 +18,6 @@ export class NoteValidationRequest {
|
|
|
18
18
|
public noteHash: Fr,
|
|
19
19
|
public nullifier: Fr,
|
|
20
20
|
public txHash: TxHash,
|
|
21
|
-
public recipient: AztecAddress,
|
|
22
21
|
) {}
|
|
23
22
|
|
|
24
23
|
static fromFields(fields: Fr[], maxNotePackedLen: number): NoteValidationRequest {
|
|
@@ -37,7 +36,6 @@ export class NoteValidationRequest {
|
|
|
37
36
|
const noteHash = reader.readField();
|
|
38
37
|
const nullifier = reader.readField();
|
|
39
38
|
const txHash = TxHash.fromField(reader.readField());
|
|
40
|
-
const recipient = AztecAddress.fromField(reader.readField());
|
|
41
39
|
|
|
42
40
|
if (reader.remainingFields() !== 0) {
|
|
43
41
|
throw new Error(
|
|
@@ -55,7 +53,6 @@ export class NoteValidationRequest {
|
|
|
55
53
|
noteHash,
|
|
56
54
|
nullifier,
|
|
57
55
|
txHash,
|
|
58
|
-
recipient,
|
|
59
56
|
);
|
|
60
57
|
}
|
|
61
58
|
}
|
|
@@ -86,7 +86,7 @@ export interface IUtilityExecutionOracle {
|
|
|
86
86
|
nullifier: Fr,
|
|
87
87
|
): Promise<NullifierMembershipWitness | undefined>;
|
|
88
88
|
getBlockHeader(blockNumber: BlockNumber): Promise<BlockHeader | undefined>;
|
|
89
|
-
|
|
89
|
+
getPublicKeysAndPartialAddress(
|
|
90
90
|
account: AztecAddress,
|
|
91
91
|
): Promise<{ publicKeys: PublicKeys; partialAddress: PartialAddress } | undefined>;
|
|
92
92
|
getAuthWitness(messageHash: Fr): Promise<Fr[] | undefined>;
|
|
@@ -107,43 +107,52 @@ export interface IUtilityExecutionOracle {
|
|
|
107
107
|
offset: number,
|
|
108
108
|
status: NoteStatus,
|
|
109
109
|
): Promise<NoteData[]>;
|
|
110
|
-
|
|
110
|
+
doesNullifierExist(innerNullifier: Fr): Promise<boolean>;
|
|
111
111
|
getL1ToL2MembershipWitness(
|
|
112
112
|
contractAddress: AztecAddress,
|
|
113
113
|
messageHash: Fr,
|
|
114
114
|
secret: Fr,
|
|
115
115
|
): Promise<MessageLoadOracleInputs<typeof L1_TO_L2_MSG_TREE_HEIGHT>>;
|
|
116
|
-
|
|
116
|
+
getFromPublicStorage(
|
|
117
117
|
anchorBlockHash: BlockHash,
|
|
118
118
|
contractAddress: AztecAddress,
|
|
119
119
|
startStorageSlot: Fr,
|
|
120
120
|
numberOfElements: number,
|
|
121
121
|
): Promise<Fr[]>;
|
|
122
|
-
|
|
122
|
+
getPendingTaggedLogs(pendingTaggedLogArrayBaseSlot: Fr, scope: AztecAddress): Promise<void>;
|
|
123
123
|
validateAndStoreEnqueuedNotesAndEvents(
|
|
124
124
|
contractAddress: AztecAddress,
|
|
125
125
|
noteValidationRequestsArrayBaseSlot: Fr,
|
|
126
126
|
eventValidationRequestsArrayBaseSlot: Fr,
|
|
127
127
|
maxNotePackedLen: number,
|
|
128
128
|
maxEventSerializedLen: number,
|
|
129
|
+
scope: AztecAddress,
|
|
129
130
|
): Promise<void>;
|
|
130
|
-
|
|
131
|
+
getLogsByTag(
|
|
131
132
|
contractAddress: AztecAddress,
|
|
132
133
|
logRetrievalRequestsArrayBaseSlot: Fr,
|
|
133
134
|
logRetrievalResponsesArrayBaseSlot: Fr,
|
|
135
|
+
scope: AztecAddress,
|
|
134
136
|
): Promise<void>;
|
|
135
|
-
|
|
137
|
+
getMessageContextsByTxHash(
|
|
136
138
|
contractAddress: AztecAddress,
|
|
137
139
|
messageContextRequestsArrayBaseSlot: Fr,
|
|
138
140
|
messageContextResponsesArrayBaseSlot: Fr,
|
|
141
|
+
scope: AztecAddress,
|
|
139
142
|
): Promise<void>;
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
deleteCapsule(contractAddress: AztecAddress, key: Fr):
|
|
143
|
-
copyCapsule(
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
143
|
+
setCapsule(contractAddress: AztecAddress, key: Fr, capsule: Fr[], scope: AztecAddress): void;
|
|
144
|
+
getCapsule(contractAddress: AztecAddress, key: Fr, scope: AztecAddress): Promise<Fr[] | null>;
|
|
145
|
+
deleteCapsule(contractAddress: AztecAddress, key: Fr, scope: AztecAddress): void;
|
|
146
|
+
copyCapsule(
|
|
147
|
+
contractAddress: AztecAddress,
|
|
148
|
+
srcKey: Fr,
|
|
149
|
+
dstKey: Fr,
|
|
150
|
+
numEntries: number,
|
|
151
|
+
scope: AztecAddress,
|
|
152
|
+
): Promise<void>;
|
|
153
|
+
decryptAes128(ciphertext: Buffer, iv: Buffer, symKey: Buffer): Promise<Buffer>;
|
|
154
|
+
getSharedSecret(address: AztecAddress, ephPk: Point, contractAddress: AztecAddress): Promise<Fr>;
|
|
155
|
+
setContractSyncCacheInvalid(contractAddress: AztecAddress, scopes: AztecAddress[]): void;
|
|
147
156
|
emitOffchainEffect(data: Fr[]): Promise<void>;
|
|
148
157
|
}
|
|
149
158
|
|
|
@@ -154,8 +163,8 @@ export interface IUtilityExecutionOracle {
|
|
|
154
163
|
export interface IPrivateExecutionOracle {
|
|
155
164
|
isPrivate: true;
|
|
156
165
|
|
|
157
|
-
|
|
158
|
-
|
|
166
|
+
setHashPreimage(values: Fr[], hash: Fr): void;
|
|
167
|
+
getHashPreimage(hash: Fr): Promise<Fr[]>;
|
|
159
168
|
notifyCreatedNote(
|
|
160
169
|
owner: AztecAddress,
|
|
161
170
|
storageSlot: Fr,
|
|
@@ -176,9 +185,9 @@ export interface IPrivateExecutionOracle {
|
|
|
176
185
|
sideEffectCounter: number,
|
|
177
186
|
isStaticCall: boolean,
|
|
178
187
|
): Promise<{ endSideEffectCounter: Fr; returnsHash: Fr }>;
|
|
179
|
-
|
|
188
|
+
assertValidPublicCalldata(calldataHash: Fr): Promise<void>;
|
|
180
189
|
notifyRevertiblePhaseStart(minRevertibleSideEffectCounter: number): Promise<void>;
|
|
181
|
-
|
|
190
|
+
isExecutionInRevertiblePhase(sideEffectCounter: number): Promise<boolean>;
|
|
182
191
|
getSenderForTags(): Promise<AztecAddress | undefined>;
|
|
183
192
|
setSenderForTags(senderForTags: AztecAddress): Promise<void>;
|
|
184
193
|
getNextAppTagAsSender(sender: AztecAddress, recipient: AztecAddress): Promise<Tag>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { toACVMField } from '@aztec/simulator/client';
|
|
2
2
|
import type { ACIRCallback, ACVMField } from '@aztec/simulator/client';
|
|
3
|
+
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
3
4
|
|
|
4
5
|
import type { Oracle } from './oracle.js';
|
|
5
6
|
|
|
@@ -23,11 +24,12 @@ export function buildLegacyOracleCallbacks(oracle: Oracle): ACIRCallback {
|
|
|
23
24
|
contractAddress: ACVMField[],
|
|
24
25
|
slot: ACVMField[],
|
|
25
26
|
tSize: ACVMField[],
|
|
26
|
-
): Promise<(ACVMField | ACVMField[])[]> =>
|
|
27
|
+
): Promise<(ACVMField | ACVMField[])[]> =>
|
|
28
|
+
oracle.aztec_utl_getCapsule(contractAddress, slot, tSize, [toACVMField(AztecAddress.ZERO)]),
|
|
27
29
|
privateStoreInExecutionCache: (values: ACVMField[], hash: ACVMField[]): Promise<ACVMField[]> =>
|
|
28
|
-
oracle.
|
|
30
|
+
oracle.aztec_prv_setHashPreimage(values, hash),
|
|
29
31
|
privateLoadFromExecutionCache: (returnsHash: ACVMField[]): Promise<ACVMField[][]> =>
|
|
30
|
-
oracle.
|
|
32
|
+
oracle.aztec_prv_getHashPreimage(returnsHash),
|
|
31
33
|
privateCallPrivateFunction: (
|
|
32
34
|
contractAddress: ACVMField[],
|
|
33
35
|
functionSelector: ACVMField[],
|
|
@@ -60,76 +62,37 @@ export function buildLegacyOracleCallbacks(oracle: Oracle): ACIRCallback {
|
|
|
60
62
|
startStorageSlot: ACVMField[],
|
|
61
63
|
numberOfElements: ACVMField[],
|
|
62
64
|
): Promise<ACVMField[][]> =>
|
|
63
|
-
oracle.
|
|
65
|
+
oracle.aztec_utl_getFromPublicStorage(blockHash, contractAddress, startStorageSlot, numberOfElements),
|
|
64
66
|
utilityStoreCapsule: (
|
|
65
67
|
contractAddress: ACVMField[],
|
|
66
68
|
slot: ACVMField[],
|
|
67
69
|
capsule: ACVMField[],
|
|
68
|
-
): Promise<ACVMField[]> =>
|
|
70
|
+
): Promise<ACVMField[]> =>
|
|
71
|
+
oracle.aztec_utl_setCapsule(contractAddress, slot, capsule, [toACVMField(AztecAddress.ZERO)]),
|
|
69
72
|
utilityCopyCapsule: (
|
|
70
73
|
contractAddress: ACVMField[],
|
|
71
74
|
srcSlot: ACVMField[],
|
|
72
75
|
dstSlot: ACVMField[],
|
|
73
76
|
numEntries: ACVMField[],
|
|
74
|
-
): Promise<ACVMField[]> => oracle.aztec_utl_copyCapsule(contractAddress, srcSlot, dstSlot, numEntries),
|
|
75
|
-
utilityDeleteCapsule: (contractAddress: ACVMField[], slot: ACVMField[]): Promise<ACVMField[]> =>
|
|
76
|
-
oracle.aztec_utl_deleteCapsule(contractAddress, slot),
|
|
77
|
-
utilityGetSharedSecret: (
|
|
78
|
-
address: ACVMField[],
|
|
79
|
-
ephPKField0: ACVMField[],
|
|
80
|
-
ephPKField1: ACVMField[],
|
|
81
|
-
ephPKField2: ACVMField[],
|
|
82
|
-
): Promise<ACVMField[]> => oracle.aztec_utl_getSharedSecret(address, ephPKField0, ephPKField1, ephPKField2),
|
|
83
|
-
utilityFetchTaggedLogs: (pendingTaggedLogArrayBaseSlot: ACVMField[]): Promise<ACVMField[]> =>
|
|
84
|
-
oracle.aztec_utl_fetchTaggedLogs(pendingTaggedLogArrayBaseSlot),
|
|
85
|
-
utilityBulkRetrieveLogs: (
|
|
86
|
-
contractAddress: ACVMField[],
|
|
87
|
-
logRetrievalRequestsArrayBaseSlot: ACVMField[],
|
|
88
|
-
logRetrievalResponsesArrayBaseSlot: ACVMField[],
|
|
89
77
|
): Promise<ACVMField[]> =>
|
|
90
|
-
oracle.
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
logRetrievalResponsesArrayBaseSlot,
|
|
94
|
-
),
|
|
78
|
+
oracle.aztec_utl_copyCapsule(contractAddress, srcSlot, dstSlot, numEntries, [toACVMField(AztecAddress.ZERO)]),
|
|
79
|
+
utilityDeleteCapsule: (contractAddress: ACVMField[], slot: ACVMField[]): Promise<ACVMField[]> =>
|
|
80
|
+
oracle.aztec_utl_deleteCapsule(contractAddress, slot, [toACVMField(AztecAddress.ZERO)]),
|
|
95
81
|
utilityGetL1ToL2MembershipWitness: (
|
|
96
82
|
contractAddress: ACVMField[],
|
|
97
83
|
messageHash: ACVMField[],
|
|
98
84
|
secret: ACVMField[],
|
|
99
85
|
): Promise<(ACVMField | ACVMField[])[]> =>
|
|
100
86
|
oracle.aztec_utl_getL1ToL2MembershipWitness(contractAddress, messageHash, secret),
|
|
101
|
-
utilityEmitOffchainEffect: (data: ACVMField[]): Promise<ACVMField[]> => oracle.aztec_utl_emitOffchainEffect(data),
|
|
102
|
-
// Adapter: old 3-param signature → new 5-param with injected constants.
|
|
103
|
-
// Values derived from: MAX_MESSAGE_CONTENT_LEN(11) - RESERVED_FIELDS (3 for notes, 1 for events).
|
|
104
|
-
utilityValidateAndStoreEnqueuedNotesAndEvents: (
|
|
105
|
-
contractAddress: ACVMField[],
|
|
106
|
-
noteValidationRequestsArrayBaseSlot: ACVMField[],
|
|
107
|
-
eventValidationRequestsArrayBaseSlot: ACVMField[],
|
|
108
|
-
): Promise<ACVMField[]> =>
|
|
109
|
-
oracle.aztec_utl_validateAndStoreEnqueuedNotesAndEvents(
|
|
110
|
-
contractAddress,
|
|
111
|
-
noteValidationRequestsArrayBaseSlot,
|
|
112
|
-
eventValidationRequestsArrayBaseSlot,
|
|
113
|
-
[new Fr(8).toString()],
|
|
114
|
-
[new Fr(10).toString()],
|
|
115
|
-
),
|
|
116
87
|
// Renames (same signature, different oracle name)
|
|
117
88
|
privateNotifySetMinRevertibleSideEffectCounter: (counter: ACVMField[]): Promise<ACVMField[]> =>
|
|
118
89
|
oracle.aztec_prv_notifyRevertiblePhaseStart(counter),
|
|
119
|
-
privateIsSideEffectCounterRevertible: (sideEffectCounter: ACVMField[]): Promise<ACVMField[]> =>
|
|
120
|
-
oracle.aztec_prv_inRevertiblePhase(sideEffectCounter),
|
|
121
90
|
// Signature changes: old 4-param oracles → new 1-param validatePublicCalldata
|
|
122
91
|
privateNotifyEnqueuedPublicFunctionCall: (
|
|
123
92
|
_contractAddress: ACVMField[],
|
|
124
93
|
calldataHash: ACVMField[],
|
|
125
94
|
_sideEffectCounter: ACVMField[],
|
|
126
95
|
_isStaticCall: ACVMField[],
|
|
127
|
-
): Promise<ACVMField[]> => oracle.
|
|
128
|
-
privateNotifySetPublicTeardownFunctionCall: (
|
|
129
|
-
_contractAddress: ACVMField[],
|
|
130
|
-
calldataHash: ACVMField[],
|
|
131
|
-
_sideEffectCounter: ACVMField[],
|
|
132
|
-
_isStaticCall: ACVMField[],
|
|
133
|
-
): Promise<ACVMField[]> => oracle.aztec_prv_validatePublicCalldata(calldataHash),
|
|
96
|
+
): Promise<ACVMField[]> => oracle.aztec_prv_assertValidPublicCalldata(calldataHash),
|
|
134
97
|
};
|
|
135
98
|
}
|