diff --git a/yarn-project/end-to-end/src/e2e_lending_contract.test.ts b/yarn-project/end-to-end/src/e2e_lending_contract.test.ts index 28d8a57055c..efc5b8843d4 100644 --- a/yarn-project/end-to-end/src/e2e_lending_contract.test.ts +++ b/yarn-project/end-to-end/src/e2e_lending_contract.test.ts @@ -87,7 +87,6 @@ describe('e2e_lending_contract', () => { const account = new Account(aztecRpcServer, privateKey, new AuthWitnessAccountContract(privateKey)); const deployTx = await account.deploy(); await deployTx.wait({ interval: 0.1 }); - // wallet = await account.getWallet(); wallet = new AuthWitnessEntrypointWallet( aztecRpcServer, (await account.getEntrypoint()) as unknown as IAuthWitnessAccountEntrypoint, diff --git a/yarn-project/end-to-end/src/e2e_token_contract.test.ts b/yarn-project/end-to-end/src/e2e_token_contract.test.ts index 43c4fc006a3..649a53cdee6 100644 --- a/yarn-project/end-to-end/src/e2e_token_contract.test.ts +++ b/yarn-project/end-to-end/src/e2e_token_contract.test.ts @@ -572,6 +572,8 @@ describe('e2e_token_contract', () => { it.skip('transfer into account to overflow', () => { // This should already be covered by the mint case earlier. e.g., since we cannot mint to overflow, there is not // a way to get funds enough to overflow. + // Require direct storage manipulation for us to perform a nice explicit case though. + // See https://github.com/AztecProtocol/aztec-packages/issues/1259 }); }); }); @@ -703,7 +705,12 @@ describe('e2e_token_contract', () => { expect(await asset.methods.balance_of_private({ address: accounts[1].address }).view()).toEqual(balance1); }); - it.skip('transfer into account to overflow', () => {}); + it.skip('transfer into account to overflow', () => { + // This should already be covered by the mint case earlier. e.g., since we cannot mint to overflow, there is not + // a way to get funds enough to overflow. + // Require direct storage manipulation for us to perform a nice explicit case though. + // See https://github.com/AztecProtocol/aztec-packages/issues/1259 + }); it('transfer on behalf of other without approval', async () => { const balance0 = await asset.methods.balance_of_private({ address: accounts[0].address }).view(); diff --git a/yarn-project/sequencer-client/src/sequencer/sequencer.ts b/yarn-project/sequencer-client/src/sequencer/sequencer.ts index 50d66cd5685..f4c88f24d07 100644 --- a/yarn-project/sequencer-client/src/sequencer/sequencer.ts +++ b/yarn-project/sequencer-client/src/sequencer/sequencer.ts @@ -148,12 +148,7 @@ export class Sequencer { // Only accept processed transactions that are not double-spends // public functions emitting nullifiers would pass earlier check but fail here - const isDoubleSpends = await Promise.all( - processedTxs.map(async tx => await this.isTxDoubleSpend(tx as unknown as Tx)), - ); - const doubleSpends = processedTxs.filter((tx, index) => isDoubleSpends[index]).map(tx => tx.hash); - await this.p2pClient.deleteTxs(doubleSpends); - const processedValidTxs = processedTxs.filter((tx, index) => !isDoubleSpends[index]); + const processedValidTxs = await this.takeValidProcessedTxs(processedTxs); if (processedValidTxs.length === 0) { this.log('No txs processed correctly to build block. Exiting'); @@ -257,6 +252,13 @@ export class Sequencer { return validTxs; } + protected async takeValidProcessedTxs(txs: ProcessedTx[]) { + const isDoubleSpends = await Promise.all(txs.map(async tx => await this.isTxDoubleSpend(tx as unknown as Tx))); + const doubleSpends = txs.filter((tx, index) => isDoubleSpends[index]).map(tx => tx.hash); + await this.p2pClient.deleteTxs(doubleSpends); + return txs.filter((tx, index) => !isDoubleSpends[index]); + } + /** * Returns whether the previous block sent has been mined, and all dependencies have caught up with it. * @returns Boolean indicating if our dependencies are synced to the latest block.