@aztec/pxe 3.0.0-nightly.20251103 → 3.0.0-nightly.20251105
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/contract_function_simulator/contract_function_simulator.d.ts.map +1 -1
- package/dest/contract_function_simulator/contract_function_simulator.js +5 -5
- package/dest/contract_function_simulator/execution_note_cache.d.ts +4 -4
- package/dest/contract_function_simulator/execution_note_cache.d.ts.map +1 -1
- package/dest/contract_function_simulator/execution_note_cache.js +11 -10
- package/dest/contract_function_simulator/pxe_oracle_interface.d.ts.map +1 -1
- package/dest/contract_function_simulator/pxe_oracle_interface.js +1 -1
- package/dest/pxe.d.ts.map +1 -1
- package/dest/pxe.js +4 -5
- package/dest/storage/private_event_data_provider/private_event_data_provider.d.ts +11 -3
- package/dest/storage/private_event_data_provider/private_event_data_provider.d.ts.map +1 -1
- package/dest/storage/private_event_data_provider/private_event_data_provider.js +17 -6
- package/package.json +16 -16
- package/src/contract_function_simulator/contract_function_simulator.ts +11 -5
- package/src/contract_function_simulator/execution_note_cache.ts +8 -8
- package/src/contract_function_simulator/pxe_oracle_interface.ts +2 -1
- package/src/pxe.ts +10 -6
- package/src/storage/private_event_data_provider/private_event_data_provider.ts +27 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contract_function_simulator.d.ts","sourceRoot":"","sources":["../../src/contract_function_simulator/contract_function_simulator.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAK9C,OAAO,EACL,KAAK,gBAAgB,EAOtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAA+B,MAAM,mBAAmB,CAAC;AAClF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"contract_function_simulator.d.ts","sourceRoot":"","sources":["../../src/contract_function_simulator/contract_function_simulator.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAK9C,OAAO,EACL,KAAK,gBAAgB,EAOtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAA+B,MAAM,mBAAmB,CAAC;AAClF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAS3D,OAAO,EAIL,KAAK,iCAAiC,EACtC,oCAAoC,EAKrC,MAAM,sBAAsB,CAAC;AAI9B,OAAO,EAGL,sBAAsB,EAEtB,kBAAkB,EAGnB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAS1E;;GAEG;AACH,qBAAa,yBAAyB;IAIlC,OAAO,CAAC,qBAAqB;IAC7B,OAAO,CAAC,SAAS;IAJnB,OAAO,CAAC,GAAG,CAAS;gBAGV,qBAAqB,EAAE,qBAAqB,EAC5C,SAAS,EAAE,gBAAgB;IAKrC;;;;;;;;;;;OAWG;IACU,GAAG,CACd,OAAO,EAAE,kBAAkB,EAC3B,eAAe,EAAE,YAAY,EAC7B,QAAQ,EAAE,gBAAgB,EAC1B,SAAS,eAA6C,EACtD,aAAa,CAAC,EAAE,YAAY,EAC5B,MAAM,CAAC,EAAE,YAAY,EAAE,GACtB,OAAO,CAAC,sBAAsB,CAAC;IAmGlC;;;;;;;OAOG;IACU,UAAU,CAAC,IAAI,EAAE,YAAY,EAAE,QAAQ,EAAE,WAAW,EAAE,EAAE,MAAM,CAAC,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;IA0ClH,QAAQ;CAGT;AAYD;;;;;;;;;;;GAWG;AACH,wBAAsB,8BAA8B,CAClD,sBAAsB,EAAE,sBAAsB,EAC9C,cAAc,EAAE,EAAE,EAClB,oBAAoB,EAAE,oBAAoB,GACzC,OAAO,CAAC,iCAAiC,CAAC,oCAAoC,CAAC,CAAC,CAgNlF"}
|
|
@@ -10,7 +10,7 @@ import { ExecutionError, createSimulationError, extractCallStack, resolveAsserti
|
|
|
10
10
|
import { FunctionSelector, FunctionType, decodeFromAbi } from '@aztec/stdlib/abi';
|
|
11
11
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
12
12
|
import { Gas } from '@aztec/stdlib/gas';
|
|
13
|
-
import { computeNoteHashNonce, computeUniqueNoteHash, siloNoteHash, siloNullifier } from '@aztec/stdlib/hash';
|
|
13
|
+
import { computeNoteHashNonce, computeProtocolNullifier, computeUniqueNoteHash, siloNoteHash, siloNullifier } from '@aztec/stdlib/hash';
|
|
14
14
|
import { PartialPrivateTailPublicInputsForPublic, PartialPrivateTailPublicInputsForRollup, PrivateKernelTailCircuitPublicInputs, PrivateToPublicAccumulatedData, PrivateToRollupAccumulatedData, PublicCallRequest, ScopedLogHash } from '@aztec/stdlib/kernel';
|
|
15
15
|
import { PrivateLog } from '@aztec/stdlib/logs';
|
|
16
16
|
import { ScopedL2ToL1Message } from '@aztec/stdlib/messaging';
|
|
@@ -59,8 +59,8 @@ import { UtilityExecutionOracle } from './oracle/utility_execution_oracle.js';
|
|
|
59
59
|
// reserve the first side effect for the tx hash (inserted by the private kernel)
|
|
60
60
|
const startSideEffectCounter = 1;
|
|
61
61
|
const callContext = new CallContext(msgSender, contractAddress, await FunctionSelector.fromNameAndParameters(entryPointArtifact.name, entryPointArtifact.parameters), entryPointArtifact.isStatic);
|
|
62
|
-
const
|
|
63
|
-
const noteCache = new ExecutionNoteCache(
|
|
62
|
+
const protocolNullifier = await computeProtocolNullifier(await request.toTxRequest().hash());
|
|
63
|
+
const noteCache = new ExecutionNoteCache(protocolNullifier);
|
|
64
64
|
const taggingIndexCache = new ExecutionTaggingIndexCache();
|
|
65
65
|
const privateExecutionOracle = new PrivateExecutionOracle(request.firstCallArgsHash, request.txContext, callContext, anchorBlockHeader, request.authWitnesses, request.capsules, HashedValuesCache.create(request.argsOfCalls), noteCache, taggingIndexCache, this.executionDataProvider, 0, startSideEffectCounter, undefined, scopes, senderForTags, this.simulator);
|
|
66
66
|
const setupTime = simulatorSetupTimer.ms();
|
|
@@ -71,8 +71,8 @@ import { UtilityExecutionOracle } from './oracle/utility_execution_oracle.js';
|
|
|
71
71
|
// within executionResult.nestedExecutionResults).
|
|
72
72
|
const executionResult = await executePrivateFunction(this.simulator, privateExecutionOracle, entryPointArtifact, contractAddress, request.functionSelector);
|
|
73
73
|
const simulatorTeardownTimer = new Timer();
|
|
74
|
-
const {
|
|
75
|
-
const firstNullifierHint =
|
|
74
|
+
const { usedProtocolNullifierForNonces } = noteCache.finish();
|
|
75
|
+
const firstNullifierHint = usedProtocolNullifierForNonces ? Fr.ZERO : noteCache.getAllNullifiers()[0];
|
|
76
76
|
const publicCallRequests = collectNested([
|
|
77
77
|
executionResult
|
|
78
78
|
], (r)=>r.publicInputs.publicCallRequests.getActiveItems().map((r)=>r.inner).concat(r.publicInputs.publicTeardownCallRequest.isEmpty() ? [] : [
|
|
@@ -11,7 +11,7 @@ interface PendingNote {
|
|
|
11
11
|
*/
|
|
12
12
|
export declare class ExecutionNoteCache {
|
|
13
13
|
#private;
|
|
14
|
-
private readonly
|
|
14
|
+
private readonly protocolNullifier;
|
|
15
15
|
/**
|
|
16
16
|
* New notes created in this transaction.
|
|
17
17
|
* They are pushed to this array in the same order as they are emitted.
|
|
@@ -37,15 +37,15 @@ export declare class ExecutionNoteCache {
|
|
|
37
37
|
* We don't need to use the tx request hash for nonces if another non revertible nullifier is emitted.
|
|
38
38
|
* In that case we disable injecting the tx request hash as a nullifier.
|
|
39
39
|
*/
|
|
40
|
-
private
|
|
41
|
-
constructor(
|
|
40
|
+
private usedProtocolNullifierForNonces;
|
|
41
|
+
constructor(protocolNullifier: Fr);
|
|
42
42
|
/**
|
|
43
43
|
* Enters the revertible phase of the transaction.
|
|
44
44
|
* @param minRevertibleSideEffectCounter - The counter at which the transaction enters the revertible phase.
|
|
45
45
|
*/
|
|
46
46
|
setMinRevertibleSideEffectCounter(minRevertibleSideEffectCounter: number): Promise<void>;
|
|
47
47
|
finish(): {
|
|
48
|
-
|
|
48
|
+
usedProtocolNullifierForNonces: boolean;
|
|
49
49
|
};
|
|
50
50
|
/**
|
|
51
51
|
* Add a new note to cache.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execution_note_cache.d.ts","sourceRoot":"","sources":["../../src/contract_function_simulator/execution_note_cache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAGhE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAEvD,UAAU,WAAW;IACnB,IAAI,EAAE,QAAQ,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,sBAAsB,EAAE,EAAE,CAAC;CAC5B;AAED;;GAEG;AACH,qBAAa,kBAAkB;;IAiCjB,OAAO,CAAC,QAAQ,CAAC,
|
|
1
|
+
{"version":3,"file":"execution_note_cache.d.ts","sourceRoot":"","sources":["../../src/contract_function_simulator/execution_note_cache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAGhE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAEvD,UAAU,WAAW;IACnB,IAAI,EAAE,QAAQ,CAAC;IACf,OAA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
|
|
|
3
3
|
/**
|
|
4
4
|
* Data that's accessible by all the function calls in an execution.
|
|
5
5
|
*/ export class ExecutionNoteCache {
|
|
6
|
-
|
|
6
|
+
protocolNullifier;
|
|
7
7
|
/**
|
|
8
8
|
* New notes created in this transaction.
|
|
9
9
|
* They are pushed to this array in the same order as they are emitted.
|
|
@@ -24,16 +24,16 @@ import { computeNoteHashNonce, computeUniqueNoteHash, siloNoteHash, siloNullifie
|
|
|
24
24
|
/**
|
|
25
25
|
* We don't need to use the tx request hash for nonces if another non revertible nullifier is emitted.
|
|
26
26
|
* In that case we disable injecting the tx request hash as a nullifier.
|
|
27
|
-
*/
|
|
28
|
-
constructor(
|
|
29
|
-
this.
|
|
27
|
+
*/ usedProtocolNullifierForNonces;
|
|
28
|
+
constructor(protocolNullifier){
|
|
29
|
+
this.protocolNullifier = protocolNullifier;
|
|
30
30
|
this.notes = [];
|
|
31
31
|
this.noteMap = new Map();
|
|
32
32
|
this.nullifierMap = new Map();
|
|
33
33
|
this.allNullifiers = new Set();
|
|
34
34
|
this.minRevertibleSideEffectCounter = 0;
|
|
35
35
|
this.inRevertiblePhase = false;
|
|
36
|
-
this.
|
|
36
|
+
this.usedProtocolNullifierForNonces = true;
|
|
37
37
|
}
|
|
38
38
|
/**
|
|
39
39
|
* Enters the revertible phase of the transaction.
|
|
@@ -44,11 +44,11 @@ import { computeNoteHashNonce, computeUniqueNoteHash, siloNoteHash, siloNullifie
|
|
|
44
44
|
}
|
|
45
45
|
this.inRevertiblePhase = true;
|
|
46
46
|
this.minRevertibleSideEffectCounter = minRevertibleSideEffectCounter;
|
|
47
|
-
let nonceGenerator = this.
|
|
47
|
+
let nonceGenerator = this.protocolNullifier;
|
|
48
48
|
const nullifiers = this.getAllNullifiers();
|
|
49
49
|
if (nullifiers.length > 0) {
|
|
50
50
|
nonceGenerator = new Fr(nullifiers[0]);
|
|
51
|
-
this.
|
|
51
|
+
this.usedProtocolNullifierForNonces = false;
|
|
52
52
|
}
|
|
53
53
|
// The existing pending notes are all non-revertible.
|
|
54
54
|
// They cannot be squashed by nullifiers emitted after minRevertibleSideEffectCounter is set.
|
|
@@ -72,13 +72,14 @@ import { computeNoteHashNonce, computeUniqueNoteHash, siloNoteHash, siloNullifie
|
|
|
72
72
|
updatedNotes.forEach((n)=>this.#addNote(n));
|
|
73
73
|
}
|
|
74
74
|
finish() {
|
|
75
|
-
// If we never entered the revertible phase, we need to use the
|
|
75
|
+
// If we never entered the revertible phase, we need to use the protocol nullifier to compute the nonces for the
|
|
76
|
+
// notes if no nullifiers have been emitted.
|
|
76
77
|
if (!this.inRevertiblePhase) {
|
|
77
|
-
this.
|
|
78
|
+
this.usedProtocolNullifierForNonces = this.getAllNullifiers().length === 0;
|
|
78
79
|
}
|
|
79
80
|
// If we entered the revertible phase, the nonce generator was decided based on wether or not a nullifier was emitted before entering.
|
|
80
81
|
return {
|
|
81
|
-
|
|
82
|
+
usedProtocolNullifierForNonces: this.usedProtocolNullifierForNonces
|
|
82
83
|
};
|
|
83
84
|
}
|
|
84
85
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pxe_oracle_interface.d.ts","sourceRoot":"","sources":["../../src/contract_function_simulator/pxe_oracle_interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAEjE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAErD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EACL,aAAa,EACb,KAAK,gCAAgC,EACrC,gBAAgB,EAEjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,KAAK,EAAW,OAAO,EAAiB,MAAM,qBAAqB,CAAC;AAC3E,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAEhF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AC,IAAI,CAAC;IA8DhB;;;;;;;;OAQG;IACU,cAAc,CACzB,eAAe,EAAE,YAAY,EAC7B,6BAA6B,EAAE,EAAE,EACjC,MAAM,CAAC,EAAE,YAAY,EAAE;IAsLZ,8BAA8B,CACzC,eAAe,EAAE,YAAY,EAC7B,mCAAmC,EAAE,EAAE,EACvC,oCAAoC,EAAE,EAAE,GACvC,OAAO,CAAC,IAAI,CAAC;IA0CV,WAAW,CACf,eAAe,EAAE,YAAY,EAC7B,WAAW,EAAE,EAAE,EACf,SAAS,EAAE,EAAE,EACb,OAAO,EAAE,EAAE,EAAE,EACb,QAAQ,EAAE,EAAE,EACZ,SAAS,EAAE,EAAE,EACb,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,YAAY,GACtB,OAAO,CAAC,IAAI,CAAC;IA6EH,gBAAgB,CAC3B,eAAe,EAAE,YAAY,EAC7B,iCAAiC,EAAE,EAAE,EACrC,kCAAkC,EAAE,EAAE;IAqDlC,YAAY,CAChB,eAAe,EAAE,YAAY,EAC7B,QAAQ,EAAE,aAAa,EACvB,OAAO,EAAE,EAAE,EAAE,EACb,eAAe,EAAE,EAAE,EACnB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,YAAY,GACtB,OAAO,CAAC,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"pxe_oracle_interface.d.ts","sourceRoot":"","sources":["../../src/contract_function_simulator/pxe_oracle_interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAEjE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAErD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EACL,aAAa,EACb,KAAK,gCAAgC,EACrC,gBAAgB,EAEjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,KAAK,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,OAAO,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAInF,WAAW,CAAC,eAAe,EAAE,YAAY,EAAE,IAAI,EAAE,EAAE,GAAG,OAAO,CAAC,EAAE,EAAE,GAAG,IAAI,CAAC;IAI1E,aAAa,CAAC,eAAe,EAAE,YAAY,EAAE,IAAI,EAAE,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAIrE,WAAW,CAAC,eAAe,EAAE,YAAY,EAAE,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIjG,eAAe,CAAC,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;IA2B1E,QAAQ,IAAI,cAAc;CAM3B"}
|
|
@@ -557,7 +557,7 @@ import { NoteValidationRequest } from './noir-structs/note_validation_request.js
|
|
|
557
557
|
if (nullifierIndex === undefined) {
|
|
558
558
|
throw new Error(`Event commitment ${eventCommitment} (siloed as ${siloedEventCommitment}) is not present on the nullifier tree at block ${syncedBlockNumber} (from tx ${txHash})`);
|
|
559
559
|
}
|
|
560
|
-
return this.privateEventDataProvider.storePrivateEventLog(contractAddress, recipient, selector, content, txHash, Number(nullifierIndex.data), nullifierIndex.l2BlockNumber);
|
|
560
|
+
return this.privateEventDataProvider.storePrivateEventLog(contractAddress, recipient, selector, content, txHash, Number(nullifierIndex.data), nullifierIndex.l2BlockNumber, nullifierIndex.l2BlockHash);
|
|
561
561
|
}
|
|
562
562
|
// TODO(#14555): delete this function and implement this behavior in the node instead
|
|
563
563
|
async getPublicLogByTag(tag, contractAddress) {
|
package/dest/pxe.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pxe.d.ts","sourceRoot":"","sources":["../src/pxe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C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O,CAAC,CAAC,EAAE,CAAC;IAyBf;;OAEG;IACI,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAG7B"}
|
package/dest/pxe.js
CHANGED
|
@@ -8,7 +8,7 @@ import { protocolContractNames } from '@aztec/protocol-contracts';
|
|
|
8
8
|
import { FunctionSelector, FunctionType, decodeFromAbi, decodeFunctionSignature, encodeArguments } from '@aztec/stdlib/abi';
|
|
9
9
|
import { computeContractAddressFromInstance, getContractClassFromArtifact } from '@aztec/stdlib/contract';
|
|
10
10
|
import { SimulationError } from '@aztec/stdlib/errors';
|
|
11
|
-
import { siloNullifier } from '@aztec/stdlib/hash';
|
|
11
|
+
import { computeProtocolNullifier, siloNullifier } from '@aztec/stdlib/hash';
|
|
12
12
|
import { UniqueNote } from '@aztec/stdlib/note';
|
|
13
13
|
import { PrivateSimulationResult, TxProfileResult, TxProvingResult, TxSimulationResult } from '@aztec/stdlib/tx';
|
|
14
14
|
import { inspect } from 'util';
|
|
@@ -640,9 +640,8 @@ import { Synchronizer } from './synchronizer/index.js';
|
|
|
640
640
|
let executionSteps = [];
|
|
641
641
|
if (skipKernels) {
|
|
642
642
|
// According to the protocol rules, the nonce generator for the note hashes
|
|
643
|
-
// can either be the first nullifier in the tx or the
|
|
644
|
-
|
|
645
|
-
const nonceGenerator = privateExecutionResult.firstNullifier.equals(Fr.ZERO) ? await txRequest.toTxRequest().hash() : privateExecutionResult.firstNullifier;
|
|
643
|
+
// can either be the first nullifier in the tx or the protocol nullifier if there are none.
|
|
644
|
+
const nonceGenerator = privateExecutionResult.firstNullifier.equals(Fr.ZERO) ? await computeProtocolNullifier(await txRequest.toTxRequest().hash()) : privateExecutionResult.firstNullifier;
|
|
646
645
|
({ publicInputs, executionSteps } = await generateSimulatedProvingResult(privateExecutionResult, nonceGenerator, this.contractDataProvider));
|
|
647
646
|
} else {
|
|
648
647
|
// Kernel logic, plus proving of all private functions and kernels.
|
|
@@ -778,7 +777,7 @@ import { Synchronizer } from './synchronizer/index.js';
|
|
|
778
777
|
const events = await this.privateEventDataProvider.getPrivateEvents(contractAddress, from, numBlocks, recipients, eventMetadataDef.eventSelector);
|
|
779
778
|
const decodedEvents = events.map((event)=>decodeFromAbi([
|
|
780
779
|
eventMetadataDef.abiType
|
|
781
|
-
], event));
|
|
780
|
+
], event.msgContent));
|
|
782
781
|
return decodedEvents;
|
|
783
782
|
}
|
|
784
783
|
/**
|
|
@@ -2,7 +2,15 @@ import { Fr } from '@aztec/foundation/fields';
|
|
|
2
2
|
import type { AztecAsyncKVStore } from '@aztec/kv-store';
|
|
3
3
|
import type { EventSelector } from '@aztec/stdlib/abi';
|
|
4
4
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
5
|
-
import
|
|
5
|
+
import { L2BlockHash } from '@aztec/stdlib/block';
|
|
6
|
+
import { TxHash } from '@aztec/stdlib/tx';
|
|
7
|
+
export type PrivateEvent = {
|
|
8
|
+
msgContent: Fr[];
|
|
9
|
+
blockNumber: number;
|
|
10
|
+
blockHash: L2BlockHash;
|
|
11
|
+
txHash: TxHash;
|
|
12
|
+
recipient: AztecAddress;
|
|
13
|
+
};
|
|
6
14
|
/**
|
|
7
15
|
* Stores decrypted private event logs.
|
|
8
16
|
*/
|
|
@@ -20,7 +28,7 @@ export declare class PrivateEventDataProvider {
|
|
|
20
28
|
* @param eventCommitmentIndex - The index of the event commitment in the nullifier tree.
|
|
21
29
|
* @param blockNumber - The block number in which the event was emitted.
|
|
22
30
|
*/
|
|
23
|
-
storePrivateEventLog(contractAddress: AztecAddress, recipient: AztecAddress, eventSelector: EventSelector, msgContent: Fr[], txHash: TxHash, eventCommitmentIndex: number, blockNumber: number): Promise<void>;
|
|
31
|
+
storePrivateEventLog(contractAddress: AztecAddress, recipient: AztecAddress, eventSelector: EventSelector, msgContent: Fr[], txHash: TxHash, eventCommitmentIndex: number, blockNumber: number, blockHash: L2BlockHash): Promise<void>;
|
|
24
32
|
/**
|
|
25
33
|
* Returns the private events given search parameters.
|
|
26
34
|
* @param contractAddress - The address of the contract to get events from.
|
|
@@ -30,6 +38,6 @@ export declare class PrivateEventDataProvider {
|
|
|
30
38
|
* @param eventSelector - The event selector to filter by.
|
|
31
39
|
* @returns - The event log contents.
|
|
32
40
|
*/
|
|
33
|
-
getPrivateEvents(contractAddress: AztecAddress, from: number, numBlocks: number, recipients: AztecAddress[], eventSelector: EventSelector): Promise<
|
|
41
|
+
getPrivateEvents(contractAddress: AztecAddress, from: number, numBlocks: number, recipients: AztecAddress[], eventSelector: EventSelector): Promise<PrivateEvent[]>;
|
|
34
42
|
}
|
|
35
43
|
//# sourceMappingURL=private_event_data_provider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"private_event_data_provider.d.ts","sourceRoot":"","sources":["../../../src/storage/private_event_data_provider/private_event_data_provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAG9C,OAAO,KAAK,EAAmB,iBAAiB,EAAiB,MAAM,iBAAiB,CAAC;AACzF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,
|
|
1
|
+
{"version":3,"file":"private_event_data_provider.d.ts","sourceRoot":"","sources":["../../../src/storage/private_event_data_provider/private_event_data_provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAG9C,OAAO,KAAK,EAAmB,iBAAiB,EAAiB,MAAM,iBAAiB,CAAC;AACzF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAU1C,MAAM,MAAM,YAAY,GAAG;IACzB,UAAU,EAAE,EAAE,EAAE,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,WAAW,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,YAAY,CAAC;CACzB,CAAC;AAEF;;GAEG;AACH,qBAAa,wBAAwB;;IASnC,MAAM,yCAA+C;gBAEzC,KAAK,EAAE,iBAAiB;IAOpC;;;;;;;;;OASG;IACH,oBAAoB,CAClB,eAAe,EAAE,YAAY,EAC7B,SAAS,EAAE,YAAY,EACvB,aAAa,EAAE,aAAa,EAC5B,UAAU,EAAE,EAAE,EAAE,EAChB,MAAM,EAAE,MAAM,EACd,oBAAoB,EAAE,MAAM,EAC5B,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,WAAW,GACrB,OAAO,CAAC,IAAI,CAAC;IA8BhB;;;;;;;;OAQG;IACU,gBAAgB,CAC3B,eAAe,EAAE,YAAY,EAC7B,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,YAAY,EAAE,EAC1B,aAAa,EAAE,aAAa,GAC3B,OAAO,CAAC,YAAY,EAAE,CAAC;CAqC3B"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Fr } from '@aztec/foundation/fields';
|
|
2
2
|
import { createLogger } from '@aztec/foundation/log';
|
|
3
3
|
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
4
|
+
import { L2BlockHash } from '@aztec/stdlib/block';
|
|
5
|
+
import { TxHash } from '@aztec/stdlib/tx';
|
|
4
6
|
/**
|
|
5
7
|
* Stores decrypted private event logs.
|
|
6
8
|
*/ export class PrivateEventDataProvider {
|
|
@@ -24,7 +26,7 @@ import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
|
24
26
|
* @param txHash - The transaction hash of the event log.
|
|
25
27
|
* @param eventCommitmentIndex - The index of the event commitment in the nullifier tree.
|
|
26
28
|
* @param blockNumber - The block number in which the event was emitted.
|
|
27
|
-
*/ storePrivateEventLog(contractAddress, recipient, eventSelector, msgContent, txHash, eventCommitmentIndex, blockNumber) {
|
|
29
|
+
*/ storePrivateEventLog(contractAddress, recipient, eventSelector, msgContent, txHash, eventCommitmentIndex, blockNumber, blockHash) {
|
|
28
30
|
return this.#store.transactionAsync(async ()=>{
|
|
29
31
|
const key = `${contractAddress.toString()}_${recipient.toString()}_${eventSelector.toString()}`;
|
|
30
32
|
// Check if this exact log has already been stored using eventCommitmentIndex as unique identifier
|
|
@@ -46,7 +48,9 @@ import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
|
46
48
|
await this.#eventLogs.push({
|
|
47
49
|
msgContent: serializeToBuffer(msgContent),
|
|
48
50
|
blockNumber,
|
|
49
|
-
|
|
51
|
+
blockHash: blockHash.toBuffer(),
|
|
52
|
+
eventCommitmentIndex,
|
|
53
|
+
txHash: txHash.toBuffer()
|
|
50
54
|
});
|
|
51
55
|
const existingIndices = await this.#eventLogIndex.getAsync(key) || [];
|
|
52
56
|
await this.#eventLogIndex.set(key, [
|
|
@@ -79,15 +83,22 @@ import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
|
79
83
|
const reader = BufferReader.asReader(entry.msgContent);
|
|
80
84
|
const numFields = entry.msgContent.length / Fr.SIZE_IN_BYTES;
|
|
81
85
|
const msgContent = reader.readArray(numFields, Fr);
|
|
86
|
+
const txHash = TxHash.fromBuffer(entry.txHash);
|
|
87
|
+
const blockHash = L2BlockHash.fromBuffer(entry.blockHash);
|
|
82
88
|
events.push({
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
89
|
+
eventCommitmentIndex: entry.eventCommitmentIndex,
|
|
90
|
+
event: {
|
|
91
|
+
msgContent,
|
|
92
|
+
blockNumber: entry.blockNumber,
|
|
93
|
+
recipient,
|
|
94
|
+
txHash,
|
|
95
|
+
blockHash
|
|
96
|
+
}
|
|
86
97
|
});
|
|
87
98
|
}
|
|
88
99
|
}
|
|
89
100
|
// Sort by eventCommitmentIndex only
|
|
90
101
|
events.sort((a, b)=>a.eventCommitmentIndex - b.eventCommitmentIndex);
|
|
91
|
-
return events.map((
|
|
102
|
+
return events.map((ev)=>ev.event);
|
|
92
103
|
}
|
|
93
104
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/pxe",
|
|
3
|
-
"version": "3.0.0-nightly.
|
|
3
|
+
"version": "3.0.0-nightly.20251105",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./server": "./dest/entrypoints/server/index.js",
|
|
@@ -61,19 +61,19 @@
|
|
|
61
61
|
]
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@aztec/bb-prover": "3.0.0-nightly.
|
|
65
|
-
"@aztec/bb.js": "3.0.0-nightly.
|
|
66
|
-
"@aztec/builder": "3.0.0-nightly.
|
|
67
|
-
"@aztec/constants": "3.0.0-nightly.
|
|
68
|
-
"@aztec/ethereum": "3.0.0-nightly.
|
|
69
|
-
"@aztec/foundation": "3.0.0-nightly.
|
|
70
|
-
"@aztec/key-store": "3.0.0-nightly.
|
|
71
|
-
"@aztec/kv-store": "3.0.0-nightly.
|
|
72
|
-
"@aztec/noir-protocol-circuits-types": "3.0.0-nightly.
|
|
73
|
-
"@aztec/noir-types": "3.0.0-nightly.
|
|
74
|
-
"@aztec/protocol-contracts": "3.0.0-nightly.
|
|
75
|
-
"@aztec/simulator": "3.0.0-nightly.
|
|
76
|
-
"@aztec/stdlib": "3.0.0-nightly.
|
|
64
|
+
"@aztec/bb-prover": "3.0.0-nightly.20251105",
|
|
65
|
+
"@aztec/bb.js": "3.0.0-nightly.20251105",
|
|
66
|
+
"@aztec/builder": "3.0.0-nightly.20251105",
|
|
67
|
+
"@aztec/constants": "3.0.0-nightly.20251105",
|
|
68
|
+
"@aztec/ethereum": "3.0.0-nightly.20251105",
|
|
69
|
+
"@aztec/foundation": "3.0.0-nightly.20251105",
|
|
70
|
+
"@aztec/key-store": "3.0.0-nightly.20251105",
|
|
71
|
+
"@aztec/kv-store": "3.0.0-nightly.20251105",
|
|
72
|
+
"@aztec/noir-protocol-circuits-types": "3.0.0-nightly.20251105",
|
|
73
|
+
"@aztec/noir-types": "3.0.0-nightly.20251105",
|
|
74
|
+
"@aztec/protocol-contracts": "3.0.0-nightly.20251105",
|
|
75
|
+
"@aztec/simulator": "3.0.0-nightly.20251105",
|
|
76
|
+
"@aztec/stdlib": "3.0.0-nightly.20251105",
|
|
77
77
|
"koa": "^2.16.1",
|
|
78
78
|
"koa-router": "^13.1.1",
|
|
79
79
|
"lodash.omit": "^4.5.0",
|
|
@@ -82,8 +82,8 @@
|
|
|
82
82
|
"viem": "npm:@spalladino/viem@2.38.2-eip7594.0"
|
|
83
83
|
},
|
|
84
84
|
"devDependencies": {
|
|
85
|
-
"@aztec/merkle-tree": "3.0.0-nightly.
|
|
86
|
-
"@aztec/noir-test-contracts.js": "3.0.0-nightly.
|
|
85
|
+
"@aztec/merkle-tree": "3.0.0-nightly.20251105",
|
|
86
|
+
"@aztec/noir-test-contracts.js": "3.0.0-nightly.20251105",
|
|
87
87
|
"@jest/globals": "^30.0.0",
|
|
88
88
|
"@types/jest": "^30.0.0",
|
|
89
89
|
"@types/lodash.omit": "^4.5.7",
|
|
@@ -37,7 +37,13 @@ import { FunctionSelector, FunctionType, decodeFromAbi } from '@aztec/stdlib/abi
|
|
|
37
37
|
import type { AuthWitness } from '@aztec/stdlib/auth-witness';
|
|
38
38
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
39
39
|
import { Gas } from '@aztec/stdlib/gas';
|
|
40
|
-
import {
|
|
40
|
+
import {
|
|
41
|
+
computeNoteHashNonce,
|
|
42
|
+
computeProtocolNullifier,
|
|
43
|
+
computeUniqueNoteHash,
|
|
44
|
+
siloNoteHash,
|
|
45
|
+
siloNullifier,
|
|
46
|
+
} from '@aztec/stdlib/hash';
|
|
41
47
|
import {
|
|
42
48
|
PartialPrivateTailPublicInputsForPublic,
|
|
43
49
|
PartialPrivateTailPublicInputsForRollup,
|
|
@@ -132,8 +138,8 @@ export class ContractFunctionSimulator {
|
|
|
132
138
|
entryPointArtifact.isStatic,
|
|
133
139
|
);
|
|
134
140
|
|
|
135
|
-
const
|
|
136
|
-
const noteCache = new ExecutionNoteCache(
|
|
141
|
+
const protocolNullifier = await computeProtocolNullifier(await request.toTxRequest().hash());
|
|
142
|
+
const noteCache = new ExecutionNoteCache(protocolNullifier);
|
|
137
143
|
const taggingIndexCache = new ExecutionTaggingIndexCache();
|
|
138
144
|
|
|
139
145
|
const privateExecutionOracle = new PrivateExecutionOracle(
|
|
@@ -170,8 +176,8 @@ export class ContractFunctionSimulator {
|
|
|
170
176
|
request.functionSelector,
|
|
171
177
|
);
|
|
172
178
|
const simulatorTeardownTimer = new Timer();
|
|
173
|
-
const {
|
|
174
|
-
const firstNullifierHint =
|
|
179
|
+
const { usedProtocolNullifierForNonces } = noteCache.finish();
|
|
180
|
+
const firstNullifierHint = usedProtocolNullifierForNonces ? Fr.ZERO : noteCache.getAllNullifiers()[0];
|
|
175
181
|
|
|
176
182
|
const publicCallRequests = collectNested([executionResult], r =>
|
|
177
183
|
r.publicInputs.publicCallRequests
|
|
@@ -44,9 +44,9 @@ export class ExecutionNoteCache {
|
|
|
44
44
|
* We don't need to use the tx request hash for nonces if another non revertible nullifier is emitted.
|
|
45
45
|
* In that case we disable injecting the tx request hash as a nullifier.
|
|
46
46
|
*/
|
|
47
|
-
private
|
|
47
|
+
private usedProtocolNullifierForNonces = true;
|
|
48
48
|
|
|
49
|
-
constructor(private readonly
|
|
49
|
+
constructor(private readonly protocolNullifier: Fr) {}
|
|
50
50
|
|
|
51
51
|
/**
|
|
52
52
|
* Enters the revertible phase of the transaction.
|
|
@@ -60,12 +60,11 @@ export class ExecutionNoteCache {
|
|
|
60
60
|
}
|
|
61
61
|
this.inRevertiblePhase = true;
|
|
62
62
|
this.minRevertibleSideEffectCounter = minRevertibleSideEffectCounter;
|
|
63
|
-
|
|
64
|
-
let nonceGenerator = this.txRequestHash;
|
|
63
|
+
let nonceGenerator = this.protocolNullifier;
|
|
65
64
|
const nullifiers = this.getAllNullifiers();
|
|
66
65
|
if (nullifiers.length > 0) {
|
|
67
66
|
nonceGenerator = new Fr(nullifiers[0]);
|
|
68
|
-
this.
|
|
67
|
+
this.usedProtocolNullifierForNonces = false;
|
|
69
68
|
}
|
|
70
69
|
|
|
71
70
|
// The existing pending notes are all non-revertible.
|
|
@@ -93,13 +92,14 @@ export class ExecutionNoteCache {
|
|
|
93
92
|
}
|
|
94
93
|
|
|
95
94
|
public finish() {
|
|
96
|
-
// If we never entered the revertible phase, we need to use the
|
|
95
|
+
// If we never entered the revertible phase, we need to use the protocol nullifier to compute the nonces for the
|
|
96
|
+
// notes if no nullifiers have been emitted.
|
|
97
97
|
if (!this.inRevertiblePhase) {
|
|
98
|
-
this.
|
|
98
|
+
this.usedProtocolNullifierForNonces = this.getAllNullifiers().length === 0;
|
|
99
99
|
}
|
|
100
100
|
// If we entered the revertible phase, the nonce generator was decided based on wether or not a nullifier was emitted before entering.
|
|
101
101
|
return {
|
|
102
|
-
|
|
102
|
+
usedProtocolNullifierForNonces: this.usedProtocolNullifierForNonces,
|
|
103
103
|
};
|
|
104
104
|
}
|
|
105
105
|
|
|
@@ -833,7 +833,8 @@ export class PXEOracleInterface implements ExecutionDataProvider {
|
|
|
833
833
|
content,
|
|
834
834
|
txHash,
|
|
835
835
|
Number(nullifierIndex.data), // Index of the event commitment in the nullifier tree
|
|
836
|
-
nullifierIndex.l2BlockNumber, // Block in which the event was emitted
|
|
836
|
+
nullifierIndex.l2BlockNumber, // Block number in which the event was emitted
|
|
837
|
+
nullifierIndex.l2BlockHash, // Block hash in which the event was emitted
|
|
837
838
|
);
|
|
838
839
|
}
|
|
839
840
|
|
package/src/pxe.ts
CHANGED
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
getContractClassFromArtifact,
|
|
29
29
|
} from '@aztec/stdlib/contract';
|
|
30
30
|
import { SimulationError } from '@aztec/stdlib/errors';
|
|
31
|
-
import { siloNullifier } from '@aztec/stdlib/hash';
|
|
31
|
+
import { computeProtocolNullifier, siloNullifier } from '@aztec/stdlib/hash';
|
|
32
32
|
import type { AztecNode, PrivateKernelProver } from '@aztec/stdlib/interfaces/client';
|
|
33
33
|
import type {
|
|
34
34
|
PrivateExecutionStep,
|
|
@@ -73,7 +73,10 @@ import { AddressDataProvider } from './storage/address_data_provider/address_dat
|
|
|
73
73
|
import { CapsuleDataProvider } from './storage/capsule_data_provider/capsule_data_provider.js';
|
|
74
74
|
import { ContractDataProvider } from './storage/contract_data_provider/contract_data_provider.js';
|
|
75
75
|
import { NoteDataProvider } from './storage/note_data_provider/note_data_provider.js';
|
|
76
|
-
import {
|
|
76
|
+
import {
|
|
77
|
+
type PrivateEvent,
|
|
78
|
+
PrivateEventDataProvider,
|
|
79
|
+
} from './storage/private_event_data_provider/private_event_data_provider.js';
|
|
77
80
|
import { SyncDataProvider } from './storage/sync_data_provider/sync_data_provider.js';
|
|
78
81
|
import { TaggingDataProvider } from './storage/tagging_data_provider/tagging_data_provider.js';
|
|
79
82
|
import { Synchronizer } from './synchronizer/index.js';
|
|
@@ -905,10 +908,9 @@ export class PXE {
|
|
|
905
908
|
|
|
906
909
|
if (skipKernels) {
|
|
907
910
|
// According to the protocol rules, the nonce generator for the note hashes
|
|
908
|
-
// can either be the first nullifier in the tx or the
|
|
909
|
-
// if there are none.
|
|
911
|
+
// can either be the first nullifier in the tx or the protocol nullifier if there are none.
|
|
910
912
|
const nonceGenerator = privateExecutionResult.firstNullifier.equals(Fr.ZERO)
|
|
911
|
-
? await txRequest.toTxRequest().hash()
|
|
913
|
+
? await computeProtocolNullifier(await txRequest.toTxRequest().hash())
|
|
912
914
|
: privateExecutionResult.firstNullifier;
|
|
913
915
|
({ publicInputs, executionSteps } = await generateSimulatedProvingResult(
|
|
914
916
|
privateExecutionResult,
|
|
@@ -1094,7 +1096,9 @@ export class PXE {
|
|
|
1094
1096
|
eventMetadataDef.eventSelector,
|
|
1095
1097
|
);
|
|
1096
1098
|
|
|
1097
|
-
const decodedEvents = events.map(
|
|
1099
|
+
const decodedEvents = events.map(
|
|
1100
|
+
(event: PrivateEvent): T => decodeFromAbi([eventMetadataDef.abiType], event.msgContent) as T,
|
|
1101
|
+
);
|
|
1098
1102
|
|
|
1099
1103
|
return decodedEvents;
|
|
1100
1104
|
}
|
|
@@ -4,14 +4,25 @@ import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
|
4
4
|
import type { AztecAsyncArray, AztecAsyncKVStore, AztecAsyncMap } from '@aztec/kv-store';
|
|
5
5
|
import type { EventSelector } from '@aztec/stdlib/abi';
|
|
6
6
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
7
|
-
import
|
|
7
|
+
import { L2BlockHash } from '@aztec/stdlib/block';
|
|
8
|
+
import { TxHash } from '@aztec/stdlib/tx';
|
|
8
9
|
|
|
9
10
|
interface PrivateEventEntry {
|
|
10
11
|
msgContent: Buffer;
|
|
11
12
|
blockNumber: number;
|
|
13
|
+
blockHash: Buffer;
|
|
12
14
|
eventCommitmentIndex: number;
|
|
15
|
+
txHash: Buffer;
|
|
13
16
|
}
|
|
14
17
|
|
|
18
|
+
export type PrivateEvent = {
|
|
19
|
+
msgContent: Fr[];
|
|
20
|
+
blockNumber: number;
|
|
21
|
+
blockHash: L2BlockHash;
|
|
22
|
+
txHash: TxHash;
|
|
23
|
+
recipient: AztecAddress;
|
|
24
|
+
};
|
|
25
|
+
|
|
15
26
|
/**
|
|
16
27
|
* Stores decrypted private event logs.
|
|
17
28
|
*/
|
|
@@ -51,6 +62,7 @@ export class PrivateEventDataProvider {
|
|
|
51
62
|
txHash: TxHash,
|
|
52
63
|
eventCommitmentIndex: number,
|
|
53
64
|
blockNumber: number,
|
|
65
|
+
blockHash: L2BlockHash,
|
|
54
66
|
): Promise<void> {
|
|
55
67
|
return this.#store.transactionAsync(async () => {
|
|
56
68
|
const key = `${contractAddress.toString()}_${recipient.toString()}_${eventSelector.toString()}`;
|
|
@@ -68,7 +80,9 @@ export class PrivateEventDataProvider {
|
|
|
68
80
|
await this.#eventLogs.push({
|
|
69
81
|
msgContent: serializeToBuffer(msgContent),
|
|
70
82
|
blockNumber,
|
|
83
|
+
blockHash: blockHash.toBuffer(),
|
|
71
84
|
eventCommitmentIndex,
|
|
85
|
+
txHash: txHash.toBuffer(),
|
|
72
86
|
});
|
|
73
87
|
|
|
74
88
|
const existingIndices = (await this.#eventLogIndex.getAsync(key)) || [];
|
|
@@ -94,8 +108,8 @@ export class PrivateEventDataProvider {
|
|
|
94
108
|
numBlocks: number,
|
|
95
109
|
recipients: AztecAddress[],
|
|
96
110
|
eventSelector: EventSelector,
|
|
97
|
-
): Promise<
|
|
98
|
-
const events: Array<{
|
|
111
|
+
): Promise<PrivateEvent[]> {
|
|
112
|
+
const events: Array<{ eventCommitmentIndex: number; event: PrivateEvent }> = [];
|
|
99
113
|
|
|
100
114
|
for (const recipient of recipients) {
|
|
101
115
|
const key = `${contractAddress.toString()}_${recipient.toString()}_${eventSelector.toString()}`;
|
|
@@ -111,18 +125,24 @@ export class PrivateEventDataProvider {
|
|
|
111
125
|
const reader = BufferReader.asReader(entry.msgContent);
|
|
112
126
|
const numFields = entry.msgContent.length / Fr.SIZE_IN_BYTES;
|
|
113
127
|
const msgContent = reader.readArray(numFields, Fr);
|
|
128
|
+
const txHash = TxHash.fromBuffer(entry.txHash);
|
|
129
|
+
const blockHash = L2BlockHash.fromBuffer(entry.blockHash);
|
|
114
130
|
|
|
115
131
|
events.push({
|
|
116
|
-
msgContent,
|
|
117
|
-
blockNumber: entry.blockNumber,
|
|
118
132
|
eventCommitmentIndex: entry.eventCommitmentIndex,
|
|
133
|
+
event: {
|
|
134
|
+
msgContent,
|
|
135
|
+
blockNumber: entry.blockNumber,
|
|
136
|
+
recipient,
|
|
137
|
+
txHash,
|
|
138
|
+
blockHash,
|
|
139
|
+
},
|
|
119
140
|
});
|
|
120
141
|
}
|
|
121
142
|
}
|
|
122
143
|
|
|
123
144
|
// Sort by eventCommitmentIndex only
|
|
124
145
|
events.sort((a, b) => a.eventCommitmentIndex - b.eventCommitmentIndex);
|
|
125
|
-
|
|
126
|
-
return events.map(e => e.msgContent);
|
|
146
|
+
return events.map(ev => ev.event);
|
|
127
147
|
}
|
|
128
148
|
}
|