diff --git a/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_mem_trace.hpp b/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_mem_trace.hpp index d31d22ab7eb..eff0da9e2d2 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_mem_trace.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_mem_trace.hpp @@ -8,7 +8,7 @@ namespace bb::avm_trace { class AvmMemTraceBuilder { public: - static const size_t MEM_SIZE = 1024; + static const size_t MEM_SIZE = 2048; static const uint32_t SUB_CLK_IND_LOAD_A = 0; static const uint32_t SUB_CLK_IND_LOAD_B = 1; static const uint32_t SUB_CLK_IND_LOAD_C = 2; @@ -101,4 +101,4 @@ class AvmMemTraceBuilder { void store_in_mem_trace( uint32_t clk, IntermRegister interm_reg, uint32_t addr, FF const& val, AvmMemoryTag m_in_tag); }; -} // namespace bb::avm_trace \ No newline at end of file +} // namespace bb::avm_trace diff --git a/yarn-project/simulator/src/public/avm_executor.test.ts b/yarn-project/simulator/src/public/avm_executor.test.ts index 23f31610c1a..218af4b41b3 100644 --- a/yarn-project/simulator/src/public/avm_executor.test.ts +++ b/yarn-project/simulator/src/public/avm_executor.test.ts @@ -35,34 +35,16 @@ describe('AVM WitGen and Proof Generation', () => { header = makeHeader(randomInt(1000000)); }, 10000); - it('Should prove valid execution of bytecode that performs addition', async () => { - const args: Fr[] = [new Fr(1), new Fr(2)]; - // Bytecode for the following contract is encoded: - // const bytecode = encodeToBytecode([ - // new CalldataCopy(/*indirect=*/ 0, /*cdOffset=*/ 0, /*copySize=*/ 2, /*dstOffset=*/ 0), - // new Add(/*indirect=*/ 0, TypeTag.FIELD, /*aOffset=*/ 0, /*bOffset=*/ 1, /*dstOffset=*/ 2), - // new Return(/*indirect=*/ 0, /*returnOffset=*/ 2, /*copySize=*/ 1), - // ]); - const bytecode: Buffer = Buffer.from('IAAAAAAAAAAAAgAAAAAAAAYAAAAAAAAAAQAAAAI4AAAAAAIAAAAB', 'base64'); - publicContracts.getBytecode.mockResolvedValue(bytecode); - const executor = new PublicExecutor(publicState, publicContracts, commitmentsDb, header); - const functionData = FunctionData.empty(); - const execution: PublicExecution = { contractAddress, functionData, args, callContext }; - const [proof, vk] = await executor.getAvmProof(execution); - const valid = await executor.verifyAvmProof(vk, proof); - expect(valid).toBe(true); - }); // This is skipped as we require MOV to be implemented in the AVM - it.skip('Should prove valid execution contract function that performs addition', async () => { - const args: Fr[] = [new Fr(1), new Fr(2)]; + it('Should prove valid execution contract function that performs addition', async () => { + const args: Fr[] = [new Fr(99), new Fr(12)]; const addArtifact = AvmTestContractArtifact.functions.find(f => f.name === 'add_args_return')!; const bytecode = addArtifact.bytecode; publicContracts.getBytecode.mockResolvedValue(bytecode); const functionData = FunctionData.fromAbi(addArtifact); const execution: PublicExecution = { contractAddress, functionData, args, callContext }; - const executor = new PublicExecutor(publicState, publicContracts, commitmentsDb, header); const [proof, vk] = await executor.getAvmProof(execution); const valid = await executor.verifyAvmProof(vk, proof); diff --git a/yarn-project/simulator/src/public/executor.ts b/yarn-project/simulator/src/public/executor.ts index c7278091e58..19463b8a4b4 100644 --- a/yarn-project/simulator/src/public/executor.ts +++ b/yarn-project/simulator/src/public/executor.ts @@ -261,6 +261,7 @@ export class PublicExecutor { // Create the directory if it does not exist await fs.mkdir(artifactsPath, { recursive: true }); + await fs.rm(artifactsPath, { recursive: true, force: true }); const calldataPath = path.join(artifactsPath, 'calldata.bin'); const bytecodePath = path.join(artifactsPath, 'avm_bytecode.bin');