Skip to content

Commit 8aba814

Browse files
authored
refactor: minor naming cleanups (#19685)
In this PR I rename `ProxiedNode` as `BenchmarkedNode` because `ProxiedNode` name was just bad (originally discussed [here](#19291 (comment))) and I rename `build_nullifier_read_request_hints.ts` to reflect the name of the class it contains.
2 parents 0931457 + e7c2d53 commit 8aba814

File tree

6 files changed

+12
-12
lines changed

6 files changed

+12
-12
lines changed

yarn-project/pxe/src/contract_function_simulator/proxied_node.ts renamed to yarn-project/pxe/src/contract_function_simulator/benchmarked_node.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ import type { NodeStats, RoundTripStats } from '@aztec/stdlib/tx';
1717
* value in `safe_json_rpc_client.ts` to 1 (the main motivation for batching was to get around parallel http requests
1818
* limits in web browsers which is not a problem when debugging in node.js).
1919
*/
20-
export type ProxiedNode = AztecNode & { getStats(): NodeStats };
20+
export type BenchmarkedNode = AztecNode & { getStats(): NodeStats };
2121

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

@@ -36,7 +36,7 @@ export class ProxiedNodeFactory {
3636
};
3737

3838
return new Proxy(node, {
39-
get(target, prop: keyof ProxiedNode) {
39+
get(target, prop: keyof BenchmarkedNode) {
4040
if (prop === 'getStats') {
4141
return (): NodeStats => {
4242
return { perMethod, roundTrips };
@@ -98,6 +98,6 @@ export class ProxiedNodeFactory {
9898
};
9999
}
100100
},
101-
}) as ProxiedNode;
101+
}) as BenchmarkedNode;
102102
}
103103
}

yarn-project/pxe/src/contract_function_simulator/contract_function_simulator.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,14 @@ import type { PrivateEventStore } from '../storage/private_event_store/private_e
8080
import type { RecipientTaggingStore } from '../storage/tagging_store/recipient_tagging_store.js';
8181
import type { SenderAddressBookStore } from '../storage/tagging_store/sender_address_book_store.js';
8282
import type { SenderTaggingStore } from '../storage/tagging_store/sender_tagging_store.js';
83+
import type { BenchmarkedNode } from './benchmarked_node.js';
8384
import { ExecutionNoteCache } from './execution_note_cache.js';
8485
import { ExecutionTaggingIndexCache } from './execution_tagging_index_cache.js';
8586
import { HashedValuesCache } from './hashed_values_cache.js';
8687
import { Oracle } from './oracle/oracle.js';
8788
import { executePrivateFunction, verifyCurrentClassId } from './oracle/private_execution.js';
8889
import { PrivateExecutionOracle } from './oracle/private_execution_oracle.js';
8990
import { UtilityExecutionOracle } from './oracle/utility_execution_oracle.js';
90-
import type { ProxiedNode } from './proxied_node.js';
9191

9292
/**
9393
* The contract function simulator.
@@ -332,8 +332,8 @@ export class ContractFunctionSimulator {
332332
*/
333333
getStats() {
334334
const nodeRPCCalls =
335-
typeof (this.aztecNode as ProxiedNode).getStats === 'function'
336-
? (this.aztecNode as ProxiedNode).getStats()
335+
typeof (this.aztecNode as BenchmarkedNode).getStats === 'function'
336+
? (this.aztecNode as BenchmarkedNode).getStats()
337337
: {
338338
perMethod: {},
339339
roundTrips: { roundTrips: 0, totalBlockingTime: 0, roundTripDurations: [], roundTripMethods: [] },
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
export * from './build_private_kernel_reset_private_inputs.js';
1+
export * from './private_kernel_reset_private_inputs_builder.js';
22
export * from './compute_tx_include_by_timestamp.js';

yarn-project/pxe/src/private_kernel/hints/build_private_kernel_reset_private_inputs.ts renamed to yarn-project/pxe/src/private_kernel/hints/private_kernel_reset_private_inputs_builder.ts

File renamed without changes.

yarn-project/pxe/src/private_kernel/private_kernel_execution_prover.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import {
3333
} from '@aztec/stdlib/tx';
3434
import { VerificationKeyAsFields, VerificationKeyData, VkData } from '@aztec/stdlib/vks';
3535

36-
import { PrivateKernelResetPrivateInputsBuilder } from './hints/build_private_kernel_reset_private_inputs.js';
36+
import { PrivateKernelResetPrivateInputsBuilder } from './hints/private_kernel_reset_private_inputs_builder.js';
3737
import type { PrivateKernelOracle } from './private_kernel_oracle.js';
3838

3939
const NULL_SIMULATE_OUTPUT: PrivateKernelSimulateOutput<PrivateKernelCircuitPublicInputs> = {

yarn-project/pxe/src/pxe.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,13 @@ import { inspect } from 'util';
5353

5454
import { BlockSynchronizer } from './block_synchronizer/index.js';
5555
import type { PXEConfig } from './config/index.js';
56+
import { BenchmarkedNodeFactory } from './contract_function_simulator/benchmarked_node.js';
5657
import {
5758
ContractFunctionSimulator,
5859
generateSimulatedProvingResult,
5960
} from './contract_function_simulator/contract_function_simulator.js';
6061
import { readCurrentClassId } from './contract_function_simulator/oracle/private_execution.js';
6162
import { ProxiedContractStoreFactory } from './contract_function_simulator/proxied_contract_data_source.js';
62-
import { ProxiedNodeFactory } from './contract_function_simulator/proxied_node.js';
6363
import { PXEDebugUtils } from './debug/pxe_debug_utils.js';
6464
import { enrichPublicSimulationError, enrichSimulationError } from './error_enriching.js';
6565
import { PrivateEventFilterValidator } from './events/private_event_filter_validator.js';
@@ -206,7 +206,7 @@ export class PXE {
206206
this.noteStore,
207207
this.keyStore,
208208
this.addressStore,
209-
ProxiedNodeFactory.create(this.node),
209+
BenchmarkedNodeFactory.create(this.node),
210210
this.anchorBlockStore,
211211
this.senderTaggingStore,
212212
this.recipientTaggingStore,

0 commit comments

Comments
 (0)