Skip to content

Commit

Permalink
refactor: remove EnqueuedCallSimulator (#10015)
Browse files Browse the repository at this point in the history
The EnqueuedCallSimulator crafted public inputs for the public kernel
merge circuit at the enqueued call level. Now that public inputs are
being crafted per public TX and the public kernel merge isn't used, this
module can be removed.
  • Loading branch information
dbanks12 authored Nov 18, 2024
1 parent d86a9d9 commit aa949ef
Show file tree
Hide file tree
Showing 9 changed files with 451 additions and 506 deletions.
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

0 comments on commit aa949ef

Please sign in to comment.