From 0d948db07c4de0c3cd4f1b801ba99f0445bf4739 Mon Sep 17 00:00:00 2001 From: sklppy88 Date: Fri, 23 Aug 2024 10:05:37 +0000 Subject: [PATCH] init --- yarn-project/end-to-end/src/e2e_prover/full.test.ts | 10 ++++++++-- .../end-to-end/src/simulators/token_simulator.ts | 8 ++++++-- yarn-project/pxe/src/pxe_service/pxe_service.ts | 2 +- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/yarn-project/end-to-end/src/e2e_prover/full.test.ts b/yarn-project/end-to-end/src/e2e_prover/full.test.ts index 926e19d98ff7..1c51cee7324d 100644 --- a/yarn-project/end-to-end/src/e2e_prover/full.test.ts +++ b/yarn-project/end-to-end/src/e2e_prover/full.test.ts @@ -36,12 +36,18 @@ describe('full_prover', () => { logger.info( `Starting test using function: ${provenAssets[0].address}:${provenAssets[0].methods.balance_of_private.selector}`, ); - const privateBalance = await provenAssets[0].methods.balance_of_private(accounts[0].address).simulate(); + const privateBalance = await provenAssets[0].methods.balance_of_private(accounts[0].address).simulate({ + // Tx validation is skipped here because the simulation fails the proof validation + skipTxValidation: true, + }); const privateSendAmount = privateBalance / 2n; expect(privateSendAmount).toBeGreaterThan(0n); const privateInteraction = provenAssets[0].methods.transfer(accounts[1].address, privateSendAmount); - const publicBalance = await provenAssets[1].methods.balance_of_public(accounts[0].address).simulate(); + const publicBalance = await provenAssets[1].methods.balance_of_public(accounts[0].address).simulate({ + // Tx validation is skipped here because the simulation fails the proof validation + skipTxValidation: true, + }); const publicSendAmount = publicBalance / 2n; expect(publicSendAmount).toBeGreaterThan(0n); const publicInteraction = provenAssets[1].methods.transfer_public( diff --git a/yarn-project/end-to-end/src/simulators/token_simulator.ts b/yarn-project/end-to-end/src/simulators/token_simulator.ts index c4addad4b217..a7403a3237ed 100644 --- a/yarn-project/end-to-end/src/simulators/token_simulator.ts +++ b/yarn-project/end-to-end/src/simulators/token_simulator.ts @@ -115,7 +115,9 @@ export class TokenSimulator { } } - async checkPrivate() { + async checkPrivate( + skipTxValidation: boolean = false, + ) { // Private calls const defaultLookups = []; const nonDefaultLookups = []; @@ -133,7 +135,9 @@ export class TokenSimulator { defaultCalls.push(this.token.methods.balance_of_private(address).request()); } const results = ( - await Promise.all(chunk(defaultCalls, 4).map(batch => new BatchCall(this.defaultWallet, batch).simulate())) + await Promise.all(chunk(defaultCalls, 4).map(batch => new BatchCall(this.defaultWallet, batch).simulate({ + skipTxValidation, + }))) ).flat(); for (let i = 0; i < defaultLookups.length; i++) { expect(results[i]).toEqual(this.balanceOfPrivate(defaultLookups[i])); diff --git a/yarn-project/pxe/src/pxe_service/pxe_service.ts b/yarn-project/pxe/src/pxe_service/pxe_service.ts index 0d44f9f11354..6b606f4afe80 100644 --- a/yarn-project/pxe/src/pxe_service/pxe_service.ts +++ b/yarn-project/pxe/src/pxe_service/pxe_service.ts @@ -524,7 +524,7 @@ export class PXEService implements PXE { txRequest: TxExecutionRequest, simulatePublic: boolean, msgSender: AztecAddress | undefined = undefined, - skipTxValidation: boolean = true, // TODO(#7956): make the default be false + skipTxValidation: boolean = false, scopes?: AztecAddress[], ): Promise { return await this.jobQueue.put(async () => {