@@ -71,15 +71,15 @@ import {
7171 getFinalMinRevertibleSideEffectCounter ,
7272} from '@aztec/stdlib/tx' ;
7373
74- import type { AddressDataProvider } from '../storage/address_data_provider/address_data_provider .js' ;
75- import type { AnchorBlockDataProvider } from '../storage/anchor_block_data_provider/anchor_block_data_provider .js' ;
76- import type { CapsuleDataProvider } from '../storage/capsule_data_provider/capsule_data_provider .js' ;
77- import type { ContractDataProvider } from '../storage/contract_data_provider/contract_data_provider .js' ;
78- import type { NoteDataProvider } from '../storage/note_data_provider/note_data_provider .js' ;
79- import type { PrivateEventDataProvider } from '../storage/private_event_data_provider/private_event_data_provider .js' ;
80- import type { RecipientTaggingDataProvider } from '../storage/tagging_data_provider/recipient_tagging_data_provider .js' ;
81- import type { SenderAddressBook } from '../storage/tagging_data_provider/sender_address_book .js' ;
82- import type { SenderTaggingDataProvider } from '../storage/tagging_data_provider/sender_tagging_data_provider .js' ;
74+ import type { AddressStore } from '../storage/address_store/address_store .js' ;
75+ import type { AnchorBlockStore } from '../storage/anchor_block_store/anchor_block_store .js' ;
76+ import type { CapsuleStore } from '../storage/capsule_store/capsule_store .js' ;
77+ import type { ContractStore } from '../storage/contract_store/contract_store .js' ;
78+ import type { NoteStore } from '../storage/note_store/note_store .js' ;
79+ import type { PrivateEventStore } from '../storage/private_event_store/private_event_store .js' ;
80+ import type { RecipientTaggingStore } from '../storage/tagging_store/recipient_tagging_store .js' ;
81+ import type { SenderAddressBookStore } from '../storage/tagging_store/sender_address_book_store .js' ;
82+ import type { SenderTaggingStore } from '../storage/tagging_store/sender_tagging_store .js' ;
8383import { ExecutionNoteCache } from './execution_note_cache.js' ;
8484import { ExecutionTaggingIndexCache } from './execution_tagging_index_cache.js' ;
8585import { HashedValuesCache } from './hashed_values_cache.js' ;
@@ -96,17 +96,17 @@ export class ContractFunctionSimulator {
9696 private log : Logger ;
9797
9898 constructor (
99- private contractDataProvider : ContractDataProvider ,
100- private noteDataProvider : NoteDataProvider ,
99+ private contractStore : ContractStore ,
100+ private noteStore : NoteStore ,
101101 private keyStore : KeyStore ,
102- private addressDataProvider : AddressDataProvider ,
102+ private addressStore : AddressStore ,
103103 private aztecNode : AztecNode ,
104- private anchorBlockDataProvider : AnchorBlockDataProvider ,
105- private senderTaggingDataProvider : SenderTaggingDataProvider ,
106- private recipientTaggingDataProvider : RecipientTaggingDataProvider ,
107- private senderAddressBook : SenderAddressBook ,
108- private capsuleDataProvider : CapsuleDataProvider ,
109- private privateEventDataProvider : PrivateEventDataProvider ,
104+ private anchorBlockStore : AnchorBlockStore ,
105+ private senderTaggingStore : SenderTaggingStore ,
106+ private recipientTaggingStore : RecipientTaggingStore ,
107+ private senderAddressBookStore : SenderAddressBookStore ,
108+ private capsuleStore : CapsuleStore ,
109+ private privateEventStore : PrivateEventStore ,
110110 private simulator : CircuitSimulator ,
111111 ) {
112112 this . log = createLogger ( 'simulator' ) ;
@@ -136,12 +136,9 @@ export class ContractFunctionSimulator {
136136 ) : Promise < PrivateExecutionResult > {
137137 const simulatorSetupTimer = new Timer ( ) ;
138138
139- await verifyCurrentClassId ( contractAddress , this . aztecNode , this . contractDataProvider , anchorBlockHeader ) ;
139+ await verifyCurrentClassId ( contractAddress , this . aztecNode , this . contractStore , anchorBlockHeader ) ;
140140
141- const entryPointArtifact = await this . contractDataProvider . getFunctionArtifactWithDebugMetadata (
142- contractAddress ,
143- selector ,
144- ) ;
141+ const entryPointArtifact = await this . contractStore . getFunctionArtifactWithDebugMetadata ( contractAddress , selector ) ;
145142
146143 if ( entryPointArtifact . functionType !== FunctionType . PRIVATE ) {
147144 throw new Error ( `Cannot run ${ entryPointArtifact . functionType } function as private` ) ;
@@ -177,17 +174,17 @@ export class ContractFunctionSimulator {
177174 HashedValuesCache . create ( request . argsOfCalls ) ,
178175 noteCache ,
179176 taggingIndexCache ,
180- this . contractDataProvider ,
181- this . noteDataProvider ,
177+ this . contractStore ,
178+ this . noteStore ,
182179 this . keyStore ,
183- this . addressDataProvider ,
180+ this . addressStore ,
184181 this . aztecNode ,
185- this . anchorBlockDataProvider ,
186- this . senderTaggingDataProvider ,
187- this . recipientTaggingDataProvider ,
188- this . senderAddressBook ,
189- this . capsuleDataProvider ,
190- this . privateEventDataProvider ,
182+ this . anchorBlockStore ,
183+ this . senderTaggingStore ,
184+ this . recipientTaggingStore ,
185+ this . senderAddressBookStore ,
186+ this . capsuleStore ,
187+ this . privateEventStore ,
191188 0 , // totalPublicArgsCount
192189 startSideEffectCounter ,
193190 undefined , // log
@@ -259,12 +256,9 @@ export class ContractFunctionSimulator {
259256 anchorBlockHeader : BlockHeader ,
260257 scopes ?: AztecAddress [ ] ,
261258 ) : Promise < Fr [ ] > {
262- await verifyCurrentClassId ( call . to , this . aztecNode , this . contractDataProvider , anchorBlockHeader ) ;
259+ await verifyCurrentClassId ( call . to , this . aztecNode , this . contractStore , anchorBlockHeader ) ;
263260
264- const entryPointArtifact = await this . contractDataProvider . getFunctionArtifactWithDebugMetadata (
265- call . to ,
266- call . selector ,
267- ) ;
261+ const entryPointArtifact = await this . contractStore . getFunctionArtifactWithDebugMetadata ( call . to , call . selector ) ;
268262
269263 if ( entryPointArtifact . functionType !== FunctionType . UTILITY ) {
270264 throw new Error ( `Cannot run ${ entryPointArtifact . functionType } function as utility` ) ;
@@ -275,16 +269,16 @@ export class ContractFunctionSimulator {
275269 authwits ,
276270 [ ] ,
277271 anchorBlockHeader ,
278- this . contractDataProvider ,
279- this . noteDataProvider ,
272+ this . contractStore ,
273+ this . noteStore ,
280274 this . keyStore ,
281- this . addressDataProvider ,
275+ this . addressStore ,
282276 this . aztecNode ,
283- this . anchorBlockDataProvider ,
284- this . recipientTaggingDataProvider ,
285- this . senderAddressBook ,
286- this . capsuleDataProvider ,
287- this . privateEventDataProvider ,
277+ this . anchorBlockStore ,
278+ this . recipientTaggingStore ,
279+ this . senderAddressBookStore ,
280+ this . capsuleStore ,
281+ this . privateEventStore ,
288282 undefined ,
289283 scopes ,
290284 ) ;
@@ -350,13 +344,13 @@ class OrderedSideEffect<T> {
350344 * @param privateExecutionResult - The result of the private execution.
351345 * @param nonceGenerator - A nonce generator for note hashes. According to the protocol rules,
352346 * it can either be the first nullifier in the tx or the hash of the initial tx request if there are none.
353- * @param contractDataProvider - A provider for contract data in order to get function names and debug info.
347+ * @param contractStore - A provider for contract data in order to get function names and debug info.
354348 * @returns The simulated proving result.
355349 */
356350export async function generateSimulatedProvingResult (
357351 privateExecutionResult : PrivateExecutionResult ,
358352 nonceGenerator : Fr ,
359- contractDataProvider : ContractDataProvider ,
353+ contractStore : ContractStore ,
360354) : Promise < PrivateKernelExecutionProofOutput < PrivateKernelTailCircuitPublicInputs > > {
361355 const siloedNoteHashes : OrderedSideEffect < Fr > [ ] = [ ] ;
362356 const nullifiers : OrderedSideEffect < Fr > [ ] = [ ] ;
@@ -433,7 +427,7 @@ export async function generateSimulatedProvingResult(
433427 : execution . publicInputs . publicTeardownCallRequest ;
434428
435429 executionSteps . push ( {
436- functionName : await contractDataProvider . getDebugFunctionName (
430+ functionName : await contractStore . getDebugFunctionName (
437431 execution . publicInputs . callContext . contractAddress ,
438432 execution . publicInputs . callContext . functionSelector ,
439433 ) ,
0 commit comments