diff --git a/yarn-project/aztec.js/src/contract/batch_call.ts b/yarn-project/aztec.js/src/contract/batch_call.ts index 3a02a7139015..19fb03999f69 100644 --- a/yarn-project/aztec.js/src/contract/batch_call.ts +++ b/yarn-project/aztec.js/src/contract/batch_call.ts @@ -78,7 +78,7 @@ export class BatchCall extends BaseContractInteraction { const [unconstrainedResults, simulatedTx] = await Promise.all([ Promise.all(unconstrainedCalls), - this.wallet.simulateTx(txRequest, true, options?.from), + this.wallet.simulateTx(txRequest, true, options?.from, options?.skipTxValidation), ]); const results: any[] = []; 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 f5881b11a1d9..e018100fb9ed 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 @@ -27,7 +27,8 @@ describe('full_prover', () => { }); afterEach(async () => { - await t.tokenSim.check(); + // TODO: (#8187) Tx validation is skipped here because checking the simulation fails the proof validation + await t.tokenSim.check(true); }); it( @@ -41,7 +42,10 @@ describe('full_prover', () => { 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(); + // TODO: (#8187) This works with above private balance, but not public balance below. + const publicBalance = await provenAssets[1].methods.balance_of_public(accounts[0].address).simulate({ + 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/e2e_prover/with_padding.test.ts b/yarn-project/end-to-end/src/e2e_prover/with_padding.test.ts index 30e507012ab1..702c360876bd 100644 --- a/yarn-project/end-to-end/src/e2e_prover/with_padding.test.ts +++ b/yarn-project/end-to-end/src/e2e_prover/with_padding.test.ts @@ -19,7 +19,8 @@ describe('full_prover_with_padding_tx', () => { }); afterEach(async () => { - await t.tokenSim.check(); + // TODO: (#8187) Tx validation is skipped here because checking the simulation fails the proof validation + await t.tokenSim.check(true); }); it( 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..887ae00f64e3 100644 --- a/yarn-project/end-to-end/src/simulators/token_simulator.ts +++ b/yarn-project/end-to-end/src/simulators/token_simulator.ts @@ -97,7 +97,7 @@ export class TokenSimulator { return this.balancesPrivate.get(address.toString()) || 0n; } - async checkPublic() { + async checkPublic(skipTxValidation: boolean = false) { // public calls const calls = [this.token.methods.total_supply().request()]; for (const address of this.accounts) { @@ -105,7 +105,13 @@ export class TokenSimulator { } const results = ( - await Promise.all(chunk(calls, 4).map(batch => new BatchCall(this.defaultWallet, batch).simulate())) + await Promise.all( + chunk(calls, 4).map(batch => + new BatchCall(this.defaultWallet, batch).simulate({ + skipTxValidation, + }), + ), + ) ).flat(); expect(results[0]).toEqual(this.totalSupply); @@ -115,7 +121,7 @@ export class TokenSimulator { } } - async checkPrivate() { + async checkPrivate(skipTxValidation: boolean = false) { // Private calls const defaultLookups = []; const nonDefaultLookups = []; @@ -133,7 +139,13 @@ 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])); @@ -145,13 +157,15 @@ export class TokenSimulator { const wallet = this.lookupProvider.get(address.toString()); const asset = wallet ? this.token.withWallet(wallet) : this.token; - const actualPrivateBalance = await asset.methods.balance_of_private({ address }).simulate(); + const actualPrivateBalance = await asset.methods.balance_of_private({ address }).simulate({ + skipTxValidation, + }); expect(actualPrivateBalance).toEqual(this.balanceOfPrivate(address)); } } - public async check() { - await this.checkPublic(); - await this.checkPrivate(); + public async check(skipTxValidation: boolean = false) { + await this.checkPublic(skipTxValidation); + await this.checkPrivate(skipTxValidation); } } diff --git a/yarn-project/pxe/src/pxe_service/pxe_service.ts b/yarn-project/pxe/src/pxe_service/pxe_service.ts index 972ef5ce916a..50f096c31927 100644 --- a/yarn-project/pxe/src/pxe_service/pxe_service.ts +++ b/yarn-project/pxe/src/pxe_service/pxe_service.ts @@ -532,7 +532,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 () => {