diff --git a/yarn-project/archiver/src/archiver-sync.test.ts b/yarn-project/archiver/src/archiver-sync.test.ts index f4898e6791f8..524b0dcbd8ee 100644 --- a/yarn-project/archiver/src/archiver-sync.test.ts +++ b/yarn-project/archiver/src/archiver-sync.test.ts @@ -891,7 +891,7 @@ describe('Archiver Sync', () => { // Verify data from checkpoint 2 is removed const txHash = cp2.blocks[0].body.txEffects[0].txHash; - expect(await archiver.getTxEffect(txHash)).resolves.toBeUndefined; + expect(await archiver.getTxEffect(txHash)).toBeUndefined(); expect(await archiver.getCheckpoints({ from: CheckpointNumber(2), limit: 1 })).toEqual([]); expect((await archiver.getPublicLogs({ fromBlock: 2, toBlock: 3 })).logs).toEqual([]); diff --git a/yarn-project/cli/src/cmds/l1/update_l1_validators.ts b/yarn-project/cli/src/cmds/l1/update_l1_validators.ts index 6329dcdba50d..45967e0fe589 100644 --- a/yarn-project/cli/src/cmds/l1/update_l1_validators.ts +++ b/yarn-project/cli/src/cmds/l1/update_l1_validators.ts @@ -38,7 +38,6 @@ export interface LoggerArgs { export function generateL1Account() { const privateKey = generatePrivateKey(); const account = privateKeyToAccount(privateKey); - account.address; return { privateKey, address: account.address, diff --git a/yarn-project/end-to-end/src/e2e_cross_chain_messaging/token_bridge_private.test.ts b/yarn-project/end-to-end/src/e2e_cross_chain_messaging/token_bridge_private.test.ts index 70cf8c1b53eb..8e27d8bea1e5 100644 --- a/yarn-project/end-to-end/src/e2e_cross_chain_messaging/token_bridge_private.test.ts +++ b/yarn-project/end-to-end/src/e2e_cross_chain_messaging/token_bridge_private.test.ts @@ -113,6 +113,5 @@ describe('e2e_cross_chain_messaging token_bridge_private', () => { .send({ from: user2Address }); await crossChainTestHarness.expectPrivateBalanceOnL2(ownerAddress, initialPrivateBalance + bridgeAmount); - }), - 90_000; + }, 90_000); }); diff --git a/yarn-project/end-to-end/src/e2e_synching.test.ts b/yarn-project/end-to-end/src/e2e_synching.test.ts index 950669ff7d3a..99e8c3101e7f 100644 --- a/yarn-project/end-to-end/src/e2e_synching.test.ts +++ b/yarn-project/end-to-end/src/e2e_synching.test.ts @@ -633,10 +633,10 @@ describe('e2e_synching', () => { ); for (let i = 0; i < contracts.length; i++) { expect(contractInstances[i]).not.toBeUndefined(); - expect(contractClassIds.some(id => id.equals(contractInstances[i].currentContractClassId))).toBeTrue; + expect(contractClassIds.some(id => id.equals(contractInstances[i].currentContractClassId))).toBeTrue(); } - expect(await archiver.getTxEffect(txHash)).not.toBeUndefined; + expect(await archiver.getTxEffect(txHash)).not.toBeUndefined(); expect( await archiver.getPublicLogs({ fromBlock: blockTip.number, toBlock: blockTip.number + 1 }), ).not.toEqual([]); @@ -649,18 +649,18 @@ describe('e2e_synching', () => { const contractClassIdsAfter = await archiver.getContractClassIds(); - expect(contractClassIdsAfter.some(id => id.equals(contractInstances[0].currentContractClassId))).toBeTrue; - expect(contractClassIdsAfter.some(id => id.equals(contractInstances[1].currentContractClassId))).toBeFalse; - expect(await archiver.getContract(contracts[0].address)).not.toBeUndefined; - expect(await archiver.getContract(contracts[1].address)).toBeUndefined; - expect(await archiver.getContract(contracts[2].address)).toBeUndefined; + expect(contractClassIdsAfter.some(id => id.equals(contractInstances[0].currentContractClassId))).toBeTrue(); + expect(contractClassIdsAfter.some(id => id.equals(contractInstances[1].currentContractClassId))).toBeFalse(); + expect(await archiver.getContract(contracts[0].address)).not.toBeUndefined(); + expect(await archiver.getContract(contracts[1].address)).toBeUndefined(); + expect(await archiver.getContract(contracts[2].address)).toBeUndefined(); // Only the hardcoded schnorr is pruned since the contract class also existed before prune. expect(contractClassIdsAfter).toEqual( contractClassIds.filter(c => !c.equals(contractInstances[1].currentContractClassId)), ); - expect(await archiver.getTxEffect(txHash)).toBeUndefined; + expect(await archiver.getTxEffect(txHash)).toBeUndefined(); expect(await archiver.getPublicLogs({ fromBlock: blockTip.number, toBlock: blockTip.number + 1 })).toEqual( [], ); diff --git a/yarn-project/end-to-end/src/spartan/mempool_limit.test.ts b/yarn-project/end-to-end/src/spartan/mempool_limit.test.ts index 18ab57a34eb6..752946fa34ff 100644 --- a/yarn-project/end-to-end/src/spartan/mempool_limit.test.ts +++ b/yarn-project/end-to-end/src/spartan/mempool_limit.test.ts @@ -21,7 +21,7 @@ import { Fr } from '@aztec/aztec.js/fields'; import { createAztecNodeClient } from '@aztec/aztec.js/node'; import { Tx, TxStatus } from '@aztec/aztec.js/tx'; import { asyncPool } from '@aztec/foundation/async-pool'; -import { times } from '@aztec/foundation/collection'; +import { times, timesAsync } from '@aztec/foundation/collection'; import { createLogger } from '@aztec/foundation/log'; import { retryUntil } from '@aztec/foundation/retry'; import { TokenContract } from '@aztec/noir-contracts.js/Token'; @@ -199,11 +199,12 @@ describe('mempool limiter test', () => { it('evicts txs to keep mempool under specified limit', async () => { if (!config.REAL_VERIFIER) { - const txs = times(TX_FLOOD_SIZE, () => { + const txs = await timesAsync(TX_FLOOD_SIZE, async () => { const tx = Tx.fromBuffer(sampleTx.toBuffer()); // this only works on unproven networks, otherwise this will fail verification tx.data.forPublic!.nonRevertibleAccumulatedData.nullifiers[0] = Fr.random(); - tx.txHash; + // The nullifier mutation means the hash is outdated + await tx.recomputeHash(); return tx; }); diff --git a/yarn-project/foundation/eslint.config.js b/yarn-project/foundation/eslint.config.js index 51b7beb16235..e6b7356b2120 100644 --- a/yarn-project/foundation/eslint.config.js +++ b/yarn-project/foundation/eslint.config.js @@ -64,7 +64,6 @@ export default [ '@typescript-eslint/no-unsafe-assignment': 'off', '@typescript-eslint/no-unsafe-member-access': 'off', '@typescript-eslint/no-unsafe-return': 'off', - '@typescript-eslint/no-unused-expressions': 'off', '@typescript-eslint/unbound-method': 'off', '@typescript-eslint/no-unsafe-argument': 'off', '@typescript-eslint/no-unnecessary-type-assertion': 'off', @@ -85,6 +84,7 @@ export default [ '@typescript-eslint/no-floating-promises': 'error', '@typescript-eslint/no-misused-promises': 'error', '@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }], + '@typescript-eslint/no-unused-expressions': ['error', { allowShortCircuit: true, allowTernary: true }], 'require-await': 'error', 'no-console': 'error', curly: ['error', 'all'], diff --git a/yarn-project/foundation/src/committable/committable.test.ts b/yarn-project/foundation/src/committable/committable.test.ts index a435dfc3eb0b..a8bc8fb440dc 100644 --- a/yarn-project/foundation/src/committable/committable.test.ts +++ b/yarn-project/foundation/src/committable/committable.test.ts @@ -27,6 +27,9 @@ describe('committable', () => { expect(committableNumber.get(true)).toBe(3); expect(committableNumber.get(false)).toBe(2); committableNumber.rollback(); - expect(committableNumber.get()).toBe(2); + // After rollback the uncommitted value must be discarded, so reading with includeUncommitted falls back to the + // committed value. Asserting on get(true) here is what actually exercises rollback. + expect(committableNumber.get(true)).toBe(2); + expect(committableNumber.get(false)).toBe(2); }); }); diff --git a/yarn-project/foundation/src/committable/committable.ts b/yarn-project/foundation/src/committable/committable.ts index 7b06c36df8d7..f2a8b14d3311 100644 --- a/yarn-project/foundation/src/committable/committable.ts +++ b/yarn-project/foundation/src/committable/committable.ts @@ -24,7 +24,7 @@ export class Committable { * Rolls back the uncommitted value. */ public rollback() { - this.nextValue === undefined; + this.nextValue = undefined; } /** diff --git a/yarn-project/prover-client/src/orchestrator/orchestrator.ts b/yarn-project/prover-client/src/orchestrator/orchestrator.ts index 19951893c916..d413d3bba3c1 100644 --- a/yarn-project/prover-client/src/orchestrator/orchestrator.ts +++ b/yarn-project/prover-client/src/orchestrator/orchestrator.ts @@ -697,7 +697,6 @@ export class ProvingOrchestrator extends TopTreeProvingScheduler implements Epoc const txProvingState = provingState.getTxProvingState(txIndex); const txHash = txProvingState.processedTx.hash.toString(); - NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH; const handleResult = ( result: PublicInputsAndRecursiveProof< PublicChonkVerifierPublicInputs,