Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: remove EnqueuedCallSimulator #10015

Merged
merged 4 commits into from
Nov 18, 2024
Merged
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
268 changes: 0 additions & 268 deletions yarn-project/simulator/src/public/enqueued_call_simulator.ts

This file was deleted.

1 change: 0 additions & 1 deletion yarn-project/simulator/src/public/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
export * from './db_interfaces.js';
export { EnqueuedCallSimulator } from './enqueued_call_simulator.js';
export * from './public_tx_simulator.js';
export {
type EnqueuedPublicCallExecutionResult as PublicExecutionResult,
Expand Down
4 changes: 2 additions & 2 deletions yarn-project/simulator/src/public/public_processor.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ describe('public_processor', () => {

worldStateDB.storageRead.mockResolvedValue(Fr.ZERO);

publicTxProcessor.process.mockImplementation(() => {
publicTxProcessor.simulate.mockImplementation(() => {
return Promise.resolve(mockedEnqueuedCallsResult);
});

Expand Down Expand Up @@ -136,7 +136,7 @@ describe('public_processor', () => {
});

it('returns failed txs without aborting entire operation', async function () {
publicTxProcessor.process.mockRejectedValue(new SimulationError(`Failed`, []));
publicTxProcessor.simulate.mockRejectedValue(new SimulationError(`Failed`, []));

const tx = mockTxWithPublicCalls();
const [processed, failed] = await processor.process([tx], 1, handler);
Expand Down
10 changes: 2 additions & 8 deletions yarn-project/simulator/src/public/public_processor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,7 @@ export class PublicProcessor {
worldStateDB: WorldStateDB,
telemetryClient: TelemetryClient,
) {
const publicTxSimulator = PublicTxSimulator.create(
db,
publicExecutor,
globalVariables,
historicalHeader,
worldStateDB,
);
const publicTxSimulator = PublicTxSimulator.create(db, publicExecutor, globalVariables, worldStateDB);

return new PublicProcessor(db, globalVariables, historicalHeader, worldStateDB, publicTxSimulator, telemetryClient);
}
Expand Down Expand Up @@ -281,7 +275,7 @@ export class PublicProcessor {
const timer = new Timer();

const { avmProvingRequest, gasUsed, revertCode, revertReason, processedPhases } =
await this.publicTxSimulator.process(tx);
await this.publicTxSimulator.simulate(tx);

if (!avmProvingRequest) {
this.metrics.recordFailedTx();
Expand Down
Loading
Loading