@aztec/pxe 0.86.0-starknet.1 → 0.87.0
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/private_kernel/private_kernel_oracle_impl.d.ts.map +1 -1
- package/dest/pxe_http/pxe_http_server.d.ts +0 -1
- package/dest/pxe_http/pxe_http_server.d.ts.map +1 -1
- package/dest/pxe_oracle_interface/pxe_oracle_interface.d.ts +0 -1
- package/dest/pxe_oracle_interface/pxe_oracle_interface.d.ts.map +1 -1
- package/dest/pxe_oracle_interface/pxe_oracle_interface.js +7 -19
- package/dest/pxe_service/pxe_service.d.ts +3 -3
- package/dest/pxe_service/pxe_service.d.ts.map +1 -1
- package/dest/pxe_service/pxe_service.js +50 -25
- package/dest/storage/note_data_provider/note_dao.d.ts +0 -2
- package/dest/storage/note_data_provider/note_dao.d.ts.map +1 -1
- package/dest/storage/note_data_provider/note_data_provider.d.ts.map +1 -1
- package/dest/synchronizer/synchronizer.js +1 -1
- package/dest/test/pxe_test_suite.d.ts.map +1 -1
- package/package.json +18 -18
- package/src/private_kernel/hints/build_private_kernel_reset_private_inputs.ts +2 -2
- package/src/private_kernel/private_kernel_oracle_impl.ts +2 -3
- package/src/pxe_oracle_interface/pxe_oracle_interface.ts +8 -20
- package/src/pxe_service/pxe_service.ts +53 -30
- package/src/storage/note_data_provider/note_data_provider.ts +22 -20
- package/src/synchronizer/synchronizer.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"private_kernel_oracle_impl.d.ts","sourceRoot":"","sources":["../../src/private_kernel/private_kernel_oracle_impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAA2C,MAAM,kBAAkB,CAAC;AAClG,OAAO,KAAK,EAAE,EAAE,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAG1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,EA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/D,OAAO,CAAC,oBAAoB;IAC5B,OAAO,CAAC,QAAQ;IAChB,OAAO,CAAC,IAAI;IACZ,OAAO,CAAC,WAAW;IACnB,OAAO,CAAC,GAAG;gBAJH,oBAAoB,EAAE,oBAAoB,EAC1C,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,SAAS,EACf,WAAW,GAAE,aAAwB,EACrC,GAAG,yCAAoC;IAGpC,0BAA0B,CAAC,OAAO,EAAE,YAAY;;;;;;;;;;;IAWhD,0BAA0B,CAAC,eAAe,EAAE,EAAE;IAQ9C,4BAA4B,CAAC,eAAe,EAAE,EAAE,EAAE,QAAQ,EAAE,gBAAgB;IAUlF,sBAAsB,CAAC,EAAE,EAAE,uBAAuB;IAKnD,4BAA4B,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,OAAO,qBAAqB,CAAC,CAAC;IAS/G,6BAA6B,CAAC,SAAS,EAAE,EAAE,GAAG,OAAO,CAAC,0BAA0B,GAAG,SAAS,CAAC;IAIvF,mBAAmB,IAAI,OAAO,CAAC,EAAE,CAAC;IAQjC,kBAAkB,CAAC,eAAe,EAAE,KAAK,GAAG,OAAO,CAAC,cAAc,CAAC;IAInE,oBAAoB,CAAC,eAAe,EAAE,YAAY,EAAE,QAAQ,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,CAAC;IAI1F,sBAAsB,CAAC,eAAe,EAAE,YAAY,GAAG,OAAO,CAAC,mBAAmB,CAAC;CA4BjG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pxe_http_server.d.ts","sourceRoot":"","sources":["../../src/pxe_http/pxe_http_server.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pxe_http_server.d.ts","sourceRoot":"","sources":["../../src/pxe_http/pxe_http_server.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,GAAG,EAAa,MAAM,iCAAiC,CAAC;AAEtE,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,GAAG,iEAEjD;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC,MAAM,CAStF"}
|
|
@@ -143,5 +143,4 @@ export declare class PXEOracleInterface implements ExecutionDataProvider {
|
|
|
143
143
|
getSharedSecret(address: AztecAddress, ephPk: Point): Promise<Point>;
|
|
144
144
|
storePrivateEventLog(contractAddress: AztecAddress, recipient: AztecAddress, eventSelector: EventSelector, msgContent: Fr[], txHash: TxHash, logIndexInTx: number, txIndexInBlock: number): Promise<void>;
|
|
145
145
|
}
|
|
146
|
-
export declare function trimTrailingZeros(array: Fr[]): Fr[];
|
|
147
146
|
//# sourceMappingURL=pxe_oracle_interface.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pxe_oracle_interface.d.ts","sourceRoot":"","sources":["../../src/pxe_oracle_interface/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,EAAE,KAAK,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAC9F,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,OAAO,KAAK,EAAE,SAAS,EAA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,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,YAAY,GACtB,OAAO,CAAC,IAAI,CAAC;IA6EH,WAAW,CAAC,GAAG,EAAE,EAAE,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC;IAgCnD,oBAAoB,CAAC,eAAe,EAAE,YAAY;IA2C/D,YAAY,CAAC,eAAe,EAAE,YAAY,EAAE,IAAI,EAAE,EAAE,EAAE,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;IAUpE,oBAAoB,CACxB,eAAe,EAAE,YAAY,EAC7B,SAAS,EAAE,YAAY,EACvB,aAAa,EAAE,aAAa,EAC5B,UAAU,EAAE,EAAE,EAAE,EAChB,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,MAAM,EACpB,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC,IAAI,CAAC;CAuBjB"}
|
|
@@ -425,15 +425,15 @@ import { WINDOW_HALF_SIZE, getIndexedTaggingSecretsForTheWindow, getInitialIndex
|
|
|
425
425
|
await this.taggingDataProvider.setTaggingSecretsIndexesAsRecipient(Object.entries(newLargestIndexMapToStore).map(([appTaggingSecret, index])=>new IndexedTaggingSecret(Fr.fromHexString(appTaggingSecret), index)), recipient);
|
|
426
426
|
}
|
|
427
427
|
}
|
|
428
|
-
async #storePendingTaggedLogs(contractAddress, capsuleArrayBaseSlot, recipient,
|
|
428
|
+
async #storePendingTaggedLogs(contractAddress, capsuleArrayBaseSlot, recipient, privateLogs) {
|
|
429
429
|
// Build all pending tagged logs upfront with their tx effects
|
|
430
|
-
const pendingTaggedLogs = await Promise.all(
|
|
430
|
+
const pendingTaggedLogs = await Promise.all(privateLogs.map(async (scopedLog)=>{
|
|
431
431
|
// TODO(#9789): get these effects along with the log
|
|
432
432
|
const txEffect = await this.aztecNode.getTxEffect(scopedLog.txHash);
|
|
433
433
|
if (!txEffect) {
|
|
434
434
|
throw new Error(`Could not find tx effect for tx hash ${scopedLog.txHash}`);
|
|
435
435
|
}
|
|
436
|
-
const pendingTaggedLog = new PendingTaggedLog(scopedLog.log.
|
|
436
|
+
const pendingTaggedLog = new PendingTaggedLog(scopedLog.log.fields, scopedLog.txHash, txEffect.data.noteHashes, txEffect.data.nullifiers[0], recipient, scopedLog.logIndexInTx, txEffect.txIndexInBlock);
|
|
437
437
|
return pendingTaggedLog.toFields();
|
|
438
438
|
}));
|
|
439
439
|
return this.capsuleDataProvider.appendToCapsuleArray(contractAddress, capsuleArrayBaseSlot, pendingTaggedLogs);
|
|
@@ -518,11 +518,10 @@ import { WINDOW_HALF_SIZE, getIndexedTaggingSecretsForTheWindow, getInitialIndex
|
|
|
518
518
|
if (txEffect == undefined) {
|
|
519
519
|
throw new Error(`Unexpected: failed to retrieve tx effects for tx ${scopedLog.txHash} which is known to exist`);
|
|
520
520
|
}
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
return new LogWithTxData(trimmedLog, scopedLog.txHash, txEffect.data.noteHashes, txEffect.data.nullifiers[0]);
|
|
521
|
+
const logContent = (scopedLog.isFromPublic ? [
|
|
522
|
+
scopedLog.log.contractAddress.toField()
|
|
523
|
+
] : []).concat(scopedLog.log.getEmittedFields());
|
|
524
|
+
return new LogWithTxData(logContent, scopedLog.txHash, txEffect.data.noteHashes, txEffect.data.nullifiers[0]);
|
|
526
525
|
}
|
|
527
526
|
async removeNullifiedNotes(contractAddress) {
|
|
528
527
|
this.log.verbose('Searching for nullifiers of known notes', {
|
|
@@ -595,14 +594,3 @@ import { WINDOW_HALF_SIZE, getIndexedTaggingSecretsForTheWindow, getInitialIndex
|
|
|
595
594
|
return this.privateEventDataProvider.storePrivateEventLog(contractAddress, recipient, eventSelector, msgContent, txHash, logIndexInTx, txIndexInBlock, blockNumber);
|
|
596
595
|
}
|
|
597
596
|
}
|
|
598
|
-
// TODO(#11636): remove once we have the actual log length and we don't need to trim it anymore
|
|
599
|
-
export function trimTrailingZeros(array) {
|
|
600
|
-
// Make a copy to avoid modifying the original one
|
|
601
|
-
const toReturn = [
|
|
602
|
-
...array
|
|
603
|
-
];
|
|
604
|
-
while(toReturn.length > 0 && toReturn[toReturn.length - 1].isZero()){
|
|
605
|
-
toReturn.pop();
|
|
606
|
-
}
|
|
607
|
-
return toReturn;
|
|
608
|
-
}
|
|
@@ -5,7 +5,7 @@ import type { SiblingPath } from '@aztec/foundation/trees';
|
|
|
5
5
|
import type { AztecAsyncKVStore } from '@aztec/kv-store';
|
|
6
6
|
import { type ProtocolContractsProvider } from '@aztec/protocol-contracts';
|
|
7
7
|
import { type SimulationProvider } from '@aztec/simulator/client';
|
|
8
|
-
import { type
|
|
8
|
+
import { type ContractArtifact } from '@aztec/stdlib/abi';
|
|
9
9
|
import type { AuthWitness } from '@aztec/stdlib/auth-witness';
|
|
10
10
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
11
11
|
import type { L2Block } from '@aztec/stdlib/block';
|
|
@@ -14,7 +14,7 @@ import type { GasFees } from '@aztec/stdlib/gas';
|
|
|
14
14
|
import type { AztecNode, EventMetadataDefinition, GetContractClassLogsResponse, GetPublicLogsResponse, PXE, PXEInfo, PrivateKernelProver } from '@aztec/stdlib/interfaces/client';
|
|
15
15
|
import type { LogFilter } from '@aztec/stdlib/logs';
|
|
16
16
|
import { type NotesFilter, UniqueNote } from '@aztec/stdlib/note';
|
|
17
|
-
import { type IndexedTxEffect, PrivateExecutionResult, Tx, TxExecutionRequest, type TxHash, TxProfileResult, TxProvingResult, type TxReceipt, TxSimulationResult } from '@aztec/stdlib/tx';
|
|
17
|
+
import { type IndexedTxEffect, PrivateExecutionResult, Tx, TxExecutionRequest, type TxHash, TxProfileResult, TxProvingResult, type TxReceipt, TxSimulationResult, UtilitySimulationResult } from '@aztec/stdlib/tx';
|
|
18
18
|
import type { PXEServiceConfig } from '../config/index.js';
|
|
19
19
|
/**
|
|
20
20
|
* A Private eXecution Environment (PXE) implementation.
|
|
@@ -89,7 +89,7 @@ export declare class PXEService implements PXE {
|
|
|
89
89
|
profileTx(txRequest: TxExecutionRequest, profileMode: 'full' | 'execution-steps' | 'gates', skipProofGeneration?: boolean, msgSender?: AztecAddress): Promise<TxProfileResult>;
|
|
90
90
|
simulateTx(txRequest: TxExecutionRequest, simulatePublic: boolean, msgSender?: AztecAddress | undefined, skipTxValidation?: boolean, skipFeeEnforcement?: boolean, scopes?: AztecAddress[]): Promise<TxSimulationResult>;
|
|
91
91
|
sendTx(tx: Tx): Promise<TxHash>;
|
|
92
|
-
simulateUtility(functionName: string, args: any[], to: AztecAddress, authwits?: AuthWitness[], _from?: AztecAddress, scopes?: AztecAddress[]): Promise<
|
|
92
|
+
simulateUtility(functionName: string, args: any[], to: AztecAddress, authwits?: AuthWitness[], _from?: AztecAddress, scopes?: AztecAddress[]): Promise<UtilitySimulationResult>;
|
|
93
93
|
getNodeInfo(): Promise<NodeInfo>;
|
|
94
94
|
getPXEInfo(): Promise<PXEInfo>;
|
|
95
95
|
getPrivateEvents<T>(contractAddress: AztecAddress, eventMetadataDef: EventMetadataDefinition, from: number, numBlocks: number, recipients: AztecAddress[]): Promise<T[]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pxe_service.d.ts","sourceRoot":"","sources":["../../src/pxe_service/pxe_service.ts"],"names":[],"mappings":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
#nodeInfo;
|
|
51
52
|
constructor(node, synchronizer, keyStore, contractDataProvider, noteDataProvider, capsuleDataProvider, syncDataProvider, taggingDataProvider, addressDataProvider, privateEventDataProvider, simulator, packageVersion, proverEnabled, proofCreator, protocolContractsProvider, log, jobQueue){
|
|
52
53
|
this.node = node;
|
|
53
54
|
this.synchronizer = synchronizer;
|
|
@@ -618,12 +619,32 @@ import { enrichPublicSimulationError, enrichSimulationError } from './error_enri
|
|
|
618
619
|
// delete the same read value, or reading values that another simulation is currently modifying).
|
|
619
620
|
return this.#putInJobQueue(async ()=>{
|
|
620
621
|
try {
|
|
622
|
+
const totalTimer = new Timer();
|
|
623
|
+
const syncTimer = new Timer();
|
|
621
624
|
await this.synchronizer.sync();
|
|
625
|
+
const syncTime = syncTimer.ms();
|
|
622
626
|
// TODO - Should check if `from` has the permission to call the view function.
|
|
623
627
|
const functionCall = await this.#getFunctionCall(functionName, args, to);
|
|
628
|
+
const functionTimer = new Timer();
|
|
624
629
|
const executionResult = await this.#simulateUtility(functionCall, authwits ?? [], scopes);
|
|
625
|
-
|
|
626
|
-
|
|
630
|
+
const functionTime = functionTimer.ms();
|
|
631
|
+
const totalTime = totalTimer.ms();
|
|
632
|
+
const perFunction = [
|
|
633
|
+
{
|
|
634
|
+
functionName,
|
|
635
|
+
time: functionTime
|
|
636
|
+
}
|
|
637
|
+
];
|
|
638
|
+
const timings = {
|
|
639
|
+
total: totalTime,
|
|
640
|
+
sync: syncTime,
|
|
641
|
+
perFunction,
|
|
642
|
+
unaccounted: totalTime - (syncTime + perFunction.reduce((acc, { time })=>acc + time, 0))
|
|
643
|
+
};
|
|
644
|
+
return {
|
|
645
|
+
result: executionResult,
|
|
646
|
+
timings
|
|
647
|
+
};
|
|
627
648
|
} catch (err) {
|
|
628
649
|
const stringifiedArgs = args.map((arg)=>arg.toString()).join(', ');
|
|
629
650
|
throw this.#contextualizeError(err, `simulateUtility ${to}:${functionName}(${stringifiedArgs})`, `scopes=${scopes?.map((s)=>s.toString()).join(', ') ?? 'undefined'}`);
|
|
@@ -631,23 +652,28 @@ import { enrichPublicSimulationError, enrichSimulationError } from './error_enri
|
|
|
631
652
|
});
|
|
632
653
|
}
|
|
633
654
|
async getNodeInfo() {
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
655
|
+
// This assumes we're connected to a single node, so we cache the info to avoid repeated calls.
|
|
656
|
+
// Load balancers and a myriad other configurations can break this assumption, so review this!
|
|
657
|
+
// Temporary mesure to avoid hammering full nodes with requests on testnet.
|
|
658
|
+
if (!this.#nodeInfo) {
|
|
659
|
+
const [nodeVersion, rollupVersion, chainId, enr, contractAddresses, protocolContractAddresses] = await Promise.all([
|
|
660
|
+
this.node.getNodeVersion(),
|
|
661
|
+
this.node.getVersion(),
|
|
662
|
+
this.node.getChainId(),
|
|
663
|
+
this.node.getEncodedEnr(),
|
|
664
|
+
this.node.getL1ContractAddresses(),
|
|
665
|
+
this.node.getProtocolContractAddresses()
|
|
666
|
+
]);
|
|
667
|
+
this.#nodeInfo = {
|
|
668
|
+
nodeVersion,
|
|
669
|
+
l1ChainId: chainId,
|
|
670
|
+
rollupVersion,
|
|
671
|
+
enr,
|
|
672
|
+
l1ContractAddresses: contractAddresses,
|
|
673
|
+
protocolContractAddresses: protocolContractAddresses
|
|
674
|
+
};
|
|
675
|
+
}
|
|
676
|
+
return this.#nodeInfo;
|
|
651
677
|
}
|
|
652
678
|
getPXEInfo() {
|
|
653
679
|
return Promise.resolve({
|
|
@@ -681,18 +707,17 @@ import { enrichPublicSimulationError, enrichSimulationError } from './error_enri
|
|
|
681
707
|
const decodedEvents = logs.map((log)=>{
|
|
682
708
|
// +1 for the event selector
|
|
683
709
|
const expectedLength = eventMetadataDef.fieldNames.length + 1;
|
|
684
|
-
|
|
710
|
+
if (log.log.emittedLength !== expectedLength) {
|
|
711
|
+
throw new Error(`Something is weird here, we have matching EventSelectors, but the actual payload has mismatched length. Expected ${expectedLength}. Got ${log.log.emittedLength}.`);
|
|
712
|
+
}
|
|
713
|
+
const logFields = log.log.getEmittedFields();
|
|
685
714
|
// We are assuming here that event logs are the last 4 bytes of the event. This is not enshrined but is a function of aztec.nr raw log emission.
|
|
686
715
|
if (!EventSelector.fromField(logFields[logFields.length - 1]).equals(eventMetadataDef.eventSelector)) {
|
|
687
716
|
return undefined;
|
|
688
717
|
}
|
|
689
|
-
// If any of the remaining fields, are non-zero, the payload does match expected:
|
|
690
|
-
if (log.log.log.slice(expectedLength + 1).find((f)=>!f.isZero())) {
|
|
691
|
-
throw new Error('Something is weird here, we have matching EventSelectors, but the actual payload has mismatched length');
|
|
692
|
-
}
|
|
693
718
|
return decodeFromAbi([
|
|
694
719
|
eventMetadataDef.abiType
|
|
695
|
-
], log.log.
|
|
720
|
+
], log.log.fields);
|
|
696
721
|
}).filter((log)=>log !== undefined);
|
|
697
722
|
return decodedEvents;
|
|
698
723
|
}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
3
1
|
import { Fr } from '@aztec/foundation/fields';
|
|
4
2
|
import { BufferReader } from '@aztec/foundation/serialize';
|
|
5
3
|
import type { NoteData } from '@aztec/simulator/client';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"note_dao.d.ts","sourceRoot":"","sources":["../../../src/storage/note_data_provider/note_dao.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"note_dao.d.ts","sourceRoot":"","sources":["../../../src/storage/note_data_provider/note_dao.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAS,MAAM,0BAA0B,CAAC;AACrD,OAAO,EAAE,YAAY,EAAqB,MAAM,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CAAC,UAAU,CAAC,GAAG,EAAE,MAAM;IAK7B;;;OAGG;IACI,OAAO;WAMD,MAAM,CAAC,EAClB,IAAoB,EACpB,eAA2B,EAC3B,WAAyB,EACzB,KAAmB,EACnB,QAAsB,EACtB,eAA6B,EAC7B,MAAwB,EACxB,aAAgD,EAChD,WAAoC,EACpC,KAA8B,EAC9B,SAAqB,GACtB,GAAE,OAAO,CAAC,OAAO,CAAM;CAezB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"note_data_provider.d.ts","sourceRoot":"","sources":["../../../src/storage/note_data_provider/note_data_provider.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAEnD,OAAO,KAAK,EAAE,iBAAiB,EAAqC,MAAM,iBAAiB,CAAC;AAC5F,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAc,KAAK,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAElE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,qBAAa,gBAAiB,YAAW,YAAY;;IAsBnD,OAAO;WAsBa,MAAM,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAWlE,QAAQ,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,OAAO,CAAC;IAgBtD,QAAQ,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,KAAK,GAAE,YAAgC,GAAG,OAAO,CAAC,IAAI,CAAC;IAwBjF,gBAAgB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAsB9C,mBAAmB,CAAC,WAAW,EAAE,MAAM,EAAE,kBAAkB,CAAC,EAAE,MAAM,GAAG,OAAO,CA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,EAAE,CAAC;IA2DtF,OAAO;CAGd"}
|
|
@@ -87,7 +87,7 @@ import { L2BlockStream } from '@aztec/stdlib/block';
|
|
|
87
87
|
let currentHeader;
|
|
88
88
|
try {
|
|
89
89
|
currentHeader = await this.syncDataProvider.getBlockHeader();
|
|
90
|
-
} catch
|
|
90
|
+
} catch {
|
|
91
91
|
this.log.debug('Header is not set, requesting from the node');
|
|
92
92
|
}
|
|
93
93
|
if (!currentHeader) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pxe_test_suite.d.ts","sourceRoot":"","sources":["../../src/test/pxe_test_suite.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,iCAAiC,CAAC;AAS3D,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"pxe_test_suite.d.ts","sourceRoot":"","sources":["../../src/test/pxe_test_suite.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,iCAAiC,CAAC;AAS3D,eAAO,MAAM,YAAY,GAAI,UAAU,MAAM,EAAE,UAAU,MAAM,OAAO,CAAC,GAAG,CAAC,SAmG1E,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/pxe",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.87.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./server": "./dest/entrypoints/server/index.js",
|
|
@@ -57,19 +57,19 @@
|
|
|
57
57
|
]
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@aztec/bb-prover": "0.
|
|
61
|
-
"@aztec/bb.js": "0.
|
|
62
|
-
"@aztec/builder": "0.
|
|
63
|
-
"@aztec/constants": "0.
|
|
64
|
-
"@aztec/ethereum": "0.
|
|
65
|
-
"@aztec/foundation": "0.
|
|
66
|
-
"@aztec/key-store": "0.
|
|
67
|
-
"@aztec/kv-store": "0.
|
|
68
|
-
"@aztec/noir-protocol-circuits-types": "0.
|
|
69
|
-
"@aztec/noir-types": "0.
|
|
70
|
-
"@aztec/protocol-contracts": "0.
|
|
71
|
-
"@aztec/simulator": "0.
|
|
72
|
-
"@aztec/stdlib": "0.
|
|
60
|
+
"@aztec/bb-prover": "0.87.0",
|
|
61
|
+
"@aztec/bb.js": "0.87.0",
|
|
62
|
+
"@aztec/builder": "0.87.0",
|
|
63
|
+
"@aztec/constants": "0.87.0",
|
|
64
|
+
"@aztec/ethereum": "0.87.0",
|
|
65
|
+
"@aztec/foundation": "0.87.0",
|
|
66
|
+
"@aztec/key-store": "0.87.0",
|
|
67
|
+
"@aztec/kv-store": "0.87.0",
|
|
68
|
+
"@aztec/noir-protocol-circuits-types": "0.87.0",
|
|
69
|
+
"@aztec/noir-types": "0.87.0",
|
|
70
|
+
"@aztec/protocol-contracts": "0.87.0",
|
|
71
|
+
"@aztec/simulator": "0.87.0",
|
|
72
|
+
"@aztec/stdlib": "0.87.0",
|
|
73
73
|
"koa": "^2.16.1",
|
|
74
74
|
"koa-router": "^12.0.0",
|
|
75
75
|
"lodash.omit": "^4.5.0",
|
|
@@ -78,17 +78,17 @@
|
|
|
78
78
|
"viem": "2.23.7"
|
|
79
79
|
},
|
|
80
80
|
"devDependencies": {
|
|
81
|
-
"@aztec/noir-test-contracts.js": "0.
|
|
81
|
+
"@aztec/noir-test-contracts.js": "0.87.0",
|
|
82
82
|
"@jest/globals": "^29.5.0",
|
|
83
83
|
"@types/jest": "^29.5.0",
|
|
84
84
|
"@types/lodash.omit": "^4.5.7",
|
|
85
85
|
"@types/lodash.times": "^4.3.9",
|
|
86
|
-
"@types/node": "^
|
|
86
|
+
"@types/node": "^22.15.17",
|
|
87
87
|
"jest": "^29.5.0",
|
|
88
88
|
"jest-mock-extended": "^3.0.3",
|
|
89
89
|
"lodash.times": "^4.3.2",
|
|
90
90
|
"ts-node": "^10.9.1",
|
|
91
|
-
"typescript": "^5.
|
|
91
|
+
"typescript": "^5.3.3"
|
|
92
92
|
},
|
|
93
93
|
"files": [
|
|
94
94
|
"dest",
|
|
@@ -97,6 +97,6 @@
|
|
|
97
97
|
],
|
|
98
98
|
"types": "./dest/index.d.ts",
|
|
99
99
|
"engines": {
|
|
100
|
-
"node": ">=
|
|
100
|
+
"node": ">=20.10"
|
|
101
101
|
}
|
|
102
102
|
}
|
|
@@ -419,8 +419,8 @@ export class PrivateKernelResetPrivateInputsBuilder {
|
|
|
419
419
|
const overflownData = noteHashWillOverflow
|
|
420
420
|
? 'note hashes'
|
|
421
421
|
: nullifierWillOverflow
|
|
422
|
-
|
|
423
|
-
|
|
422
|
+
? 'nullifiers'
|
|
423
|
+
: 'private logs';
|
|
424
424
|
throw new Error(`Number of ${overflownData} exceeds the limit.`);
|
|
425
425
|
}
|
|
426
426
|
// Clearing the read requests might not be enough to squash the overflown data.
|
|
@@ -99,9 +99,8 @@ export class PrivateKernelOracleImpl implements PrivateKernelOracle {
|
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
public async getUpdatedClassIdHints(contractAddress: AztecAddress): Promise<UpdatedClassIdHints> {
|
|
102
|
-
const { sharedMutableSlot, sharedMutableHashSlot } =
|
|
103
|
-
contractAddress
|
|
104
|
-
);
|
|
102
|
+
const { sharedMutableSlot, sharedMutableHashSlot } =
|
|
103
|
+
await SharedMutableValuesWithHash.getContractUpdateSlots(contractAddress);
|
|
105
104
|
|
|
106
105
|
const hashLeafSlot = await computePublicDataTreeLeafSlot(
|
|
107
106
|
ProtocolContractAddress.ContractInstanceDeployer,
|
|
@@ -21,6 +21,7 @@ import {
|
|
|
21
21
|
IndexedTaggingSecret,
|
|
22
22
|
LogWithTxData,
|
|
23
23
|
PendingTaggedLog,
|
|
24
|
+
PublicLog,
|
|
24
25
|
TxScopedL2Log,
|
|
25
26
|
deriveEcdhSharedSecret,
|
|
26
27
|
} from '@aztec/stdlib/logs';
|
|
@@ -585,11 +586,11 @@ export class PXEOracleInterface implements ExecutionDataProvider {
|
|
|
585
586
|
contractAddress: AztecAddress,
|
|
586
587
|
capsuleArrayBaseSlot: Fr,
|
|
587
588
|
recipient: AztecAddress,
|
|
588
|
-
|
|
589
|
+
privateLogs: TxScopedL2Log[],
|
|
589
590
|
) {
|
|
590
591
|
// Build all pending tagged logs upfront with their tx effects
|
|
591
592
|
const pendingTaggedLogs = await Promise.all(
|
|
592
|
-
|
|
593
|
+
privateLogs.map(async scopedLog => {
|
|
593
594
|
// TODO(#9789): get these effects along with the log
|
|
594
595
|
const txEffect = await this.aztecNode.getTxEffect(scopedLog.txHash);
|
|
595
596
|
if (!txEffect) {
|
|
@@ -597,7 +598,7 @@ export class PXEOracleInterface implements ExecutionDataProvider {
|
|
|
597
598
|
}
|
|
598
599
|
|
|
599
600
|
const pendingTaggedLog = new PendingTaggedLog(
|
|
600
|
-
scopedLog.log.
|
|
601
|
+
scopedLog.log.fields,
|
|
601
602
|
scopedLog.txHash,
|
|
602
603
|
txEffect.data.noteHashes,
|
|
603
604
|
txEffect.data.nullifiers[0],
|
|
@@ -724,12 +725,11 @@ export class PXEOracleInterface implements ExecutionDataProvider {
|
|
|
724
725
|
throw new Error(`Unexpected: failed to retrieve tx effects for tx ${scopedLog.txHash} which is known to exist`);
|
|
725
726
|
}
|
|
726
727
|
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
const trimmedLog = trimTrailingZeros(scopedLog.log.toFields());
|
|
728
|
+
const logContent = (scopedLog.isFromPublic ? [(scopedLog.log as PublicLog).contractAddress.toField()] : []).concat(
|
|
729
|
+
scopedLog.log.getEmittedFields(),
|
|
730
|
+
);
|
|
731
731
|
|
|
732
|
-
return new LogWithTxData(
|
|
732
|
+
return new LogWithTxData(logContent, scopedLog.txHash, txEffect.data.noteHashes, txEffect.data.nullifiers[0]);
|
|
733
733
|
}
|
|
734
734
|
|
|
735
735
|
public async removeNullifiedNotes(contractAddress: AztecAddress) {
|
|
@@ -833,15 +833,3 @@ export class PXEOracleInterface implements ExecutionDataProvider {
|
|
|
833
833
|
);
|
|
834
834
|
}
|
|
835
835
|
}
|
|
836
|
-
|
|
837
|
-
// TODO(#11636): remove once we have the actual log length and we don't need to trim it anymore
|
|
838
|
-
export function trimTrailingZeros(array: Fr[]): Fr[] {
|
|
839
|
-
// Make a copy to avoid modifying the original one
|
|
840
|
-
const toReturn = [...array];
|
|
841
|
-
|
|
842
|
-
while (toReturn.length > 0 && toReturn[toReturn.length - 1].isZero()) {
|
|
843
|
-
toReturn.pop();
|
|
844
|
-
}
|
|
845
|
-
|
|
846
|
-
return toReturn;
|
|
847
|
-
}
|
|
@@ -14,7 +14,6 @@ import {
|
|
|
14
14
|
} from '@aztec/protocol-contracts';
|
|
15
15
|
import { AcirSimulator, type SimulationProvider, readCurrentClassId } from '@aztec/simulator/client';
|
|
16
16
|
import {
|
|
17
|
-
type AbiDecoded,
|
|
18
17
|
type ContractArtifact,
|
|
19
18
|
EventSelector,
|
|
20
19
|
FunctionCall,
|
|
@@ -67,6 +66,7 @@ import {
|
|
|
67
66
|
TxProvingResult,
|
|
68
67
|
type TxReceipt,
|
|
69
68
|
TxSimulationResult,
|
|
69
|
+
UtilitySimulationResult,
|
|
70
70
|
} from '@aztec/stdlib/tx';
|
|
71
71
|
|
|
72
72
|
import { inspect } from 'util';
|
|
@@ -93,6 +93,8 @@ import { enrichPublicSimulationError, enrichSimulationError } from './error_enri
|
|
|
93
93
|
* A Private eXecution Environment (PXE) implementation.
|
|
94
94
|
*/
|
|
95
95
|
export class PXEService implements PXE {
|
|
96
|
+
#nodeInfo?: NodeInfo;
|
|
97
|
+
|
|
96
98
|
private constructor(
|
|
97
99
|
private node: AztecNode,
|
|
98
100
|
private synchronizer: Synchronizer,
|
|
@@ -917,19 +919,34 @@ export class PXEService implements PXE {
|
|
|
917
919
|
authwits?: AuthWitness[],
|
|
918
920
|
_from?: AztecAddress,
|
|
919
921
|
scopes?: AztecAddress[],
|
|
920
|
-
): Promise<
|
|
922
|
+
): Promise<UtilitySimulationResult> {
|
|
921
923
|
// We disable concurrent simulations since those might execute oracles which read and write to the PXE stores (e.g.
|
|
922
924
|
// to the capsules), and we need to prevent concurrent runs from interfering with one another (e.g. attempting to
|
|
923
925
|
// delete the same read value, or reading values that another simulation is currently modifying).
|
|
924
926
|
return this.#putInJobQueue(async () => {
|
|
925
927
|
try {
|
|
928
|
+
const totalTimer = new Timer();
|
|
929
|
+
const syncTimer = new Timer();
|
|
926
930
|
await this.synchronizer.sync();
|
|
931
|
+
const syncTime = syncTimer.ms();
|
|
927
932
|
// TODO - Should check if `from` has the permission to call the view function.
|
|
928
933
|
const functionCall = await this.#getFunctionCall(functionName, args, to);
|
|
934
|
+
const functionTimer = new Timer();
|
|
929
935
|
const executionResult = await this.#simulateUtility(functionCall, authwits ?? [], scopes);
|
|
936
|
+
const functionTime = functionTimer.ms();
|
|
937
|
+
|
|
938
|
+
const totalTime = totalTimer.ms();
|
|
939
|
+
|
|
940
|
+
const perFunction = [{ functionName, time: functionTime }];
|
|
941
|
+
|
|
942
|
+
const timings: SimulationTimings = {
|
|
943
|
+
total: totalTime,
|
|
944
|
+
sync: syncTime,
|
|
945
|
+
perFunction,
|
|
946
|
+
unaccounted: totalTime - (syncTime + perFunction.reduce((acc, { time }) => acc + time, 0)),
|
|
947
|
+
};
|
|
930
948
|
|
|
931
|
-
|
|
932
|
-
return executionResult;
|
|
949
|
+
return { result: executionResult, timings };
|
|
933
950
|
} catch (err: any) {
|
|
934
951
|
const stringifiedArgs = args.map(arg => arg.toString()).join(', ');
|
|
935
952
|
throw this.#contextualizeError(
|
|
@@ -942,25 +959,31 @@ export class PXEService implements PXE {
|
|
|
942
959
|
}
|
|
943
960
|
|
|
944
961
|
public async getNodeInfo(): Promise<NodeInfo> {
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
+
// This assumes we're connected to a single node, so we cache the info to avoid repeated calls.
|
|
963
|
+
// Load balancers and a myriad other configurations can break this assumption, so review this!
|
|
964
|
+
// Temporary mesure to avoid hammering full nodes with requests on testnet.
|
|
965
|
+
if (!this.#nodeInfo) {
|
|
966
|
+
const [nodeVersion, rollupVersion, chainId, enr, contractAddresses, protocolContractAddresses] =
|
|
967
|
+
await Promise.all([
|
|
968
|
+
this.node.getNodeVersion(),
|
|
969
|
+
this.node.getVersion(),
|
|
970
|
+
this.node.getChainId(),
|
|
971
|
+
this.node.getEncodedEnr(),
|
|
972
|
+
this.node.getL1ContractAddresses(),
|
|
973
|
+
this.node.getProtocolContractAddresses(),
|
|
974
|
+
]);
|
|
975
|
+
|
|
976
|
+
this.#nodeInfo = {
|
|
977
|
+
nodeVersion,
|
|
978
|
+
l1ChainId: chainId,
|
|
979
|
+
rollupVersion,
|
|
980
|
+
enr,
|
|
981
|
+
l1ContractAddresses: contractAddresses,
|
|
982
|
+
protocolContractAddresses: protocolContractAddresses,
|
|
983
|
+
};
|
|
984
|
+
}
|
|
962
985
|
|
|
963
|
-
return nodeInfo;
|
|
986
|
+
return this.#nodeInfo;
|
|
964
987
|
}
|
|
965
988
|
|
|
966
989
|
public getPXEInfo(): Promise<PXEInfo> {
|
|
@@ -1014,19 +1037,19 @@ export class PXEService implements PXE {
|
|
|
1014
1037
|
.map(log => {
|
|
1015
1038
|
// +1 for the event selector
|
|
1016
1039
|
const expectedLength = eventMetadataDef.fieldNames.length + 1;
|
|
1017
|
-
|
|
1040
|
+
if (log.log.emittedLength !== expectedLength) {
|
|
1041
|
+
throw new Error(
|
|
1042
|
+
`Something is weird here, we have matching EventSelectors, but the actual payload has mismatched length. Expected ${expectedLength}. Got ${log.log.emittedLength}.`,
|
|
1043
|
+
);
|
|
1044
|
+
}
|
|
1045
|
+
|
|
1046
|
+
const logFields = log.log.getEmittedFields();
|
|
1018
1047
|
// We are assuming here that event logs are the last 4 bytes of the event. This is not enshrined but is a function of aztec.nr raw log emission.
|
|
1019
1048
|
if (!EventSelector.fromField(logFields[logFields.length - 1]).equals(eventMetadataDef.eventSelector)) {
|
|
1020
1049
|
return undefined;
|
|
1021
1050
|
}
|
|
1022
|
-
// If any of the remaining fields, are non-zero, the payload does match expected:
|
|
1023
|
-
if (log.log.log.slice(expectedLength + 1).find(f => !f.isZero())) {
|
|
1024
|
-
throw new Error(
|
|
1025
|
-
'Something is weird here, we have matching EventSelectors, but the actual payload has mismatched length',
|
|
1026
|
-
);
|
|
1027
|
-
}
|
|
1028
1051
|
|
|
1029
|
-
return decodeFromAbi([eventMetadataDef.abiType], log.log.
|
|
1052
|
+
return decodeFromAbi([eventMetadataDef.abiType], log.log.fields) as T;
|
|
1030
1053
|
})
|
|
1031
1054
|
.filter(log => log !== undefined) as T[];
|
|
1032
1055
|
|
|
@@ -199,20 +199,22 @@ export class NoteDataProvider implements DataProvider {
|
|
|
199
199
|
this.#notesByRecipientAndScope.get(formattedScopeString)!.getValuesAsync(filter.recipient.toString()),
|
|
200
200
|
)
|
|
201
201
|
: filter.txHash
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
202
|
+
? await toArray(
|
|
203
|
+
this.#notesByTxHashAndScope.get(formattedScopeString)!.getValuesAsync(filter.txHash.toString()),
|
|
204
|
+
)
|
|
205
|
+
: filter.contractAddress
|
|
206
|
+
? await toArray(
|
|
207
|
+
this.#notesByContractAndScope
|
|
208
|
+
.get(formattedScopeString)!
|
|
209
|
+
.getValuesAsync(filter.contractAddress.toString()),
|
|
210
|
+
)
|
|
211
|
+
: filter.storageSlot
|
|
212
|
+
? await toArray(
|
|
213
|
+
this.#notesByStorageSlotAndScope
|
|
214
|
+
.get(formattedScopeString)!
|
|
215
|
+
.getValuesAsync(filter.storageSlot.toString()),
|
|
216
|
+
)
|
|
217
|
+
: await toArray(this.#notesByRecipientAndScope.get(formattedScopeString)!.valuesAsync()),
|
|
216
218
|
);
|
|
217
219
|
}
|
|
218
220
|
|
|
@@ -226,12 +228,12 @@ export class NoteDataProvider implements DataProvider {
|
|
|
226
228
|
ids: filter.recipient
|
|
227
229
|
? await toArray(this.#nullifiedNotesByRecipient.getValuesAsync(filter.recipient.toString()))
|
|
228
230
|
: filter.txHash
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
231
|
+
? await toArray(this.#nullifiedNotesByTxHash.getValuesAsync(filter.txHash.toString()))
|
|
232
|
+
: filter.contractAddress
|
|
233
|
+
? await toArray(this.#nullifiedNotesByContract.getValuesAsync(filter.contractAddress.toString()))
|
|
234
|
+
: filter.storageSlot
|
|
235
|
+
? await toArray(this.#nullifiedNotesByStorageSlot.getValuesAsync(filter.storageSlot.toString()))
|
|
236
|
+
: await toArray(this.#nullifiedNotes.keysAsync()),
|
|
235
237
|
notes: this.#nullifiedNotes,
|
|
236
238
|
});
|
|
237
239
|
}
|
|
@@ -105,7 +105,7 @@ export class Synchronizer implements L2BlockStreamEventHandler {
|
|
|
105
105
|
|
|
106
106
|
try {
|
|
107
107
|
currentHeader = await this.syncDataProvider.getBlockHeader();
|
|
108
|
-
} catch
|
|
108
|
+
} catch {
|
|
109
109
|
this.log.debug('Header is not set, requesting from the node');
|
|
110
110
|
}
|
|
111
111
|
if (!currentHeader) {
|