Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ import type { NodeStats, RoundTripStats } from '@aztec/stdlib/tx';
* value in `safe_json_rpc_client.ts` to 1 (the main motivation for batching was to get around parallel http requests
* limits in web browsers which is not a problem when debugging in node.js).
*/
export type ProxiedNode = AztecNode & { getStats(): NodeStats };
export type BenchmarkedNode = AztecNode & { getStats(): NodeStats };

export class ProxiedNodeFactory {
static create(node: AztecNode): ProxiedNode {
export class BenchmarkedNodeFactory {
static create(node: AztecNode): BenchmarkedNode {
// Per-method call stats
const perMethod: Partial<Record<keyof AztecNode, { times: number[] }>> = {};

Expand All @@ -36,7 +36,7 @@ export class ProxiedNodeFactory {
};

return new Proxy(node, {
get(target, prop: keyof ProxiedNode) {
get(target, prop: keyof BenchmarkedNode) {
if (prop === 'getStats') {
return (): NodeStats => {
return { perMethod, roundTrips };
Expand Down Expand Up @@ -98,6 +98,6 @@ export class ProxiedNodeFactory {
};
}
},
}) as ProxiedNode;
}) as BenchmarkedNode;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,14 @@ import type { PrivateEventStore } from '../storage/private_event_store/private_e
import type { RecipientTaggingStore } from '../storage/tagging_store/recipient_tagging_store.js';
import type { SenderAddressBookStore } from '../storage/tagging_store/sender_address_book_store.js';
import type { SenderTaggingStore } from '../storage/tagging_store/sender_tagging_store.js';
import type { BenchmarkedNode } from './benchmarked_node.js';
import { ExecutionNoteCache } from './execution_note_cache.js';
import { ExecutionTaggingIndexCache } from './execution_tagging_index_cache.js';
import { HashedValuesCache } from './hashed_values_cache.js';
import { Oracle } from './oracle/oracle.js';
import { executePrivateFunction, verifyCurrentClassId } from './oracle/private_execution.js';
import { PrivateExecutionOracle } from './oracle/private_execution_oracle.js';
import { UtilityExecutionOracle } from './oracle/utility_execution_oracle.js';
import type { ProxiedNode } from './proxied_node.js';

/**
* The contract function simulator.
Expand Down Expand Up @@ -332,8 +332,8 @@ export class ContractFunctionSimulator {
*/
getStats() {
const nodeRPCCalls =
typeof (this.aztecNode as ProxiedNode).getStats === 'function'
? (this.aztecNode as ProxiedNode).getStats()
typeof (this.aztecNode as BenchmarkedNode).getStats === 'function'
? (this.aztecNode as BenchmarkedNode).getStats()
: {
perMethod: {},
roundTrips: { roundTrips: 0, totalBlockingTime: 0, roundTripDurations: [], roundTripMethods: [] },
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/pxe/src/private_kernel/hints/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from './build_private_kernel_reset_private_inputs.js';
export * from './private_kernel_reset_private_inputs_builder.js';
export * from './compute_tx_include_by_timestamp.js';
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import {
} from '@aztec/stdlib/tx';
import { VerificationKeyAsFields, VerificationKeyData, VkData } from '@aztec/stdlib/vks';

import { PrivateKernelResetPrivateInputsBuilder } from './hints/build_private_kernel_reset_private_inputs.js';
import { PrivateKernelResetPrivateInputsBuilder } from './hints/private_kernel_reset_private_inputs_builder.js';
import type { PrivateKernelOracle } from './private_kernel_oracle.js';

const NULL_SIMULATE_OUTPUT: PrivateKernelSimulateOutput<PrivateKernelCircuitPublicInputs> = {
Expand Down
4 changes: 2 additions & 2 deletions yarn-project/pxe/src/pxe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ import { inspect } from 'util';

import { BlockSynchronizer } from './block_synchronizer/index.js';
import type { PXEConfig } from './config/index.js';
import { BenchmarkedNodeFactory } from './contract_function_simulator/benchmarked_node.js';
import {
ContractFunctionSimulator,
generateSimulatedProvingResult,
} from './contract_function_simulator/contract_function_simulator.js';
import { readCurrentClassId } from './contract_function_simulator/oracle/private_execution.js';
import { ProxiedContractStoreFactory } from './contract_function_simulator/proxied_contract_data_source.js';
import { ProxiedNodeFactory } from './contract_function_simulator/proxied_node.js';
import { PXEDebugUtils } from './debug/pxe_debug_utils.js';
import { enrichPublicSimulationError, enrichSimulationError } from './error_enriching.js';
import { PrivateEventFilterValidator } from './events/private_event_filter_validator.js';
Expand Down Expand Up @@ -206,7 +206,7 @@ export class PXE {
this.noteStore,
this.keyStore,
this.addressStore,
ProxiedNodeFactory.create(this.node),
BenchmarkedNodeFactory.create(this.node),
this.anchorBlockStore,
this.senderTaggingStore,
this.recipientTaggingStore,
Expand Down